\n"
"Language-Team: English (http://www.transifex.com/coders4help/volunteer-planner/language/en/)\n"
@@ -15,430 +16,402 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: accounts/apps.py:8 accounts/apps.py:16
+msgid "first name"
+msgstr ""
+
+msgid "email"
+msgstr ""
+
msgid "Accounts"
msgstr ""
-#: accounts/models.py:16 organizations/models.py:119
msgid "user account"
msgstr ""
-#: accounts/models.py:17
msgid "user accounts"
msgstr ""
-#: accounts/templates/user_account_edit.html:12
-#: scheduletemplates/templates/admin/scheduletemplates/scheduletemplate/scheduletemplate_submit_line.html:3
msgid "Save"
msgstr ""
-#: accounts/templates/user_detail.html:10 templates/registration/login.html:23
-#: templates/registration/registration_form.html:22
msgid "Username"
msgstr ""
-#: accounts/templates/user_detail.html:11
msgid "First name"
msgstr ""
-#: accounts/templates/user_detail.html:12
msgid "Last name"
msgstr ""
-#: accounts/templates/user_detail.html:13
-#: templates/registration/registration_form.html:18
msgid "Email"
msgstr ""
-#: accounts/templates/user_detail.html:16
msgid "Edit Account"
msgstr ""
-#: google_tools/templatetags/google_links.py:17
+msgid "additional CSS"
+msgstr ""
+
+msgid "translation"
+msgstr ""
+
+msgid "translations"
+msgstr ""
+
+msgid "No translation available"
+msgstr ""
+
+msgid "additional style"
+msgstr ""
+
+msgid "additional flat page style"
+msgstr ""
+
+msgid "additional flat page styles"
+msgstr ""
+
+msgid "flat page"
+msgstr ""
+
+msgid "language"
+msgstr ""
+
+msgid "title"
+msgstr ""
+
+msgid "content"
+msgstr ""
+
+msgid "flat page translation"
+msgstr ""
+
+msgid "flat page translations"
+msgstr ""
+
+msgid "View on site"
+msgstr ""
+
+msgid "Remove"
+msgstr ""
+
+#, python-format
+msgid "Add another %(verbose_name)s"
+msgstr ""
+
+msgid "Edit this page"
+msgstr ""
+
#, python-brace-format
msgctxt "maps search url pattern"
msgid "https://www.google.com/maps/place/{location}"
msgstr ""
-#: google_tools/templatetags/google_links.py:27
#, python-brace-format
msgctxt "maps directions url pattern"
msgid "https://www.google.com/maps/dir/{departure}/{destination}/"
msgstr ""
-#: news/models.py:13
-msgid "creation date"
+msgid "subtitle"
msgstr ""
-#: news/models.py:14
-msgid "title"
+msgid "articletext"
msgstr ""
-#: news/models.py:15
-msgid "subtitle"
+msgid "creation date"
msgstr ""
-#: news/models.py:16
-msgid "articletext"
+msgid "news entry"
+msgstr ""
+
+msgid "news entries"
msgstr ""
-#: non_logged_in_area/templates/base_non_logged_in.html:46
-#: templates/registration/login.html:3 templates/registration/login.html:10
msgid "Login"
msgstr ""
-#: non_logged_in_area/templates/base_non_logged_in.html:49
msgid "Start helping"
msgstr ""
-#: non_logged_in_area/templates/base_non_logged_in.html:76
msgid "Main page"
msgstr ""
-#: non_logged_in_area/templates/base_non_logged_in.html:79
-#: non_logged_in_area/templates/faqs.html:5
-msgid "Frequently Asked Questions"
+msgid "Imprint"
msgstr ""
-#: non_logged_in_area/templates/base_non_logged_in.html:82
-msgid "Contact"
+msgid "About"
msgstr ""
-#: non_logged_in_area/templates/base_non_logged_in.html:85
-msgid "Imprint"
+msgid "Supporter"
msgstr ""
-#: non_logged_in_area/templates/base_non_logged_in.html:88
-msgid "Terms of Service"
+msgid "Press"
msgstr ""
-#: non_logged_in_area/templates/base_non_logged_in.html:91
-#: non_logged_in_area/templates/privacy_policy.html:6
-msgid "Privacy Policy"
+msgid "Contact"
+msgstr ""
+
+msgid "F.A.Q."
+msgstr ""
+
+msgid "Frequently Asked Questions"
msgstr ""
-#: non_logged_in_area/templates/faqs.html:10
msgctxt "FAQ Q1"
msgid "How does volunteer-planner work?"
msgstr ""
-#: non_logged_in_area/templates/faqs.html:19
msgctxt "FAQ A1.1"
msgid "Create an account."
msgstr ""
-#: non_logged_in_area/templates/faqs.html:25
msgctxt "FAQ A1.2"
msgid "Confirm your email address by clicking the activation link you've been sent."
msgstr ""
-#: non_logged_in_area/templates/faqs.html:32
msgctxt "FAQ A1.3"
msgid "Log in."
msgstr ""
-#: non_logged_in_area/templates/faqs.html:37
msgctxt "FAQ A1.4"
msgid "Choose a place to help and a shift and sign up to help."
msgstr ""
-#: non_logged_in_area/templates/faqs.html:42
msgctxt "FAQ A1.5"
msgid "Get there on time and start helping out."
msgstr ""
-#: non_logged_in_area/templates/faqs.html:51
msgctxt "FAQ Q2"
msgid "How can I unsubscribe from a shift?"
msgstr ""
-#: non_logged_in_area/templates/faqs.html:57
msgctxt "FAQ A2"
msgid "No problem. Log-in again look for the shift you planned to do and unsubscribe. Then other volunteers can again subscribe."
msgstr ""
-#: non_logged_in_area/templates/faqs.html:66
msgctxt "FAQ Q3"
msgid "Are there more shelters coming into volunteer-planner?"
msgstr ""
-#: non_logged_in_area/templates/faqs.html:70
-#: non_logged_in_area/templates/faqs.html:138 shiftmailer/models.py:13
-msgid "email"
-msgstr ""
-
-#: non_logged_in_area/templates/faqs.html:72
#, python-format
msgctxt "FAQ A3"
msgid "Yes! If you are a volunteer worker in a refugee shelter and they also want to use volunteer-planner please contact us via %(email_url)s."
msgstr ""
-#: non_logged_in_area/templates/faqs.html:82
msgctxt "FAQ Q4"
msgid "I registered but I didn't get any activation link. What can I do?"
msgstr ""
-#: non_logged_in_area/templates/faqs.html:89
msgctxt "FAQ A4"
msgid "Please look into your email-spam folder. If you can't find something please wait another 30 minutes. Email delivery can sometimes take longer."
msgstr ""
-#: non_logged_in_area/templates/faqs.html:99
msgctxt "FAQ Q5"
msgid "Do I have to be vaccinated to help at the camps/shelters?"
msgstr ""
-#: non_logged_in_area/templates/faqs.html:105
msgctxt "FAQ A5"
msgid "You are not supposed to be vaccinated. BUT: Where there are a lot of people deseases can flourish better."
msgstr ""
-#: non_logged_in_area/templates/faqs.html:114
msgctxt "FAQ Q6"
msgid "Who is volunteer-planner.org?"
msgstr ""
-#: non_logged_in_area/templates/faqs.html:120
msgctxt "FAQ A6"
msgid "We are Coders4Help, a group of international volunteering programmers, designers and projectmanagers."
msgstr ""
-#: non_logged_in_area/templates/faqs.html:130
msgctxt "FAQ Q7"
msgid "How can I help you?"
msgstr ""
-#: non_logged_in_area/templates/faqs.html:137
msgid "Facebook site"
msgstr ""
-#: non_logged_in_area/templates/faqs.html:139
#, python-format
msgctxt "FAQ A7"
msgid "Currently we need help to translate, write texts and create awesome designs. Want to help? Write a message on our %(facebook_link)s or send an %(email_url)s."
msgstr ""
-#: non_logged_in_area/templates/home.html:25
msgid "I want to help!"
msgstr ""
-#: non_logged_in_area/templates/home.html:27
msgid "Register and see where you can help"
msgstr ""
-#: non_logged_in_area/templates/home.html:32
msgid "Organize volunteers!"
msgstr ""
-#: non_logged_in_area/templates/home.html:34
msgid "Register a shelter and organize volunteers"
msgstr ""
-#: non_logged_in_area/templates/home.html:48
msgid "Places to help"
msgstr ""
-#: non_logged_in_area/templates/home.html:55
msgid "Registered Volunteers"
msgstr ""
-#: non_logged_in_area/templates/home.html:62
msgid "Worked Hours"
msgstr ""
-#: non_logged_in_area/templates/home.html:74
msgid "What is it all about?"
msgstr ""
-#: non_logged_in_area/templates/home.html:77
msgid "You are a volunteer and want to help refugees? Volunteer-Planner.org shows you where, when and how to help directly in the field."
msgstr ""
-#: non_logged_in_area/templates/home.html:85
msgid "This platform is non-commercial and ads-free. An international team of field workers, programmers, project managers and designers are volunteering for this project and bring in their professional experience to make a difference.
"
msgstr ""
-#: non_logged_in_area/templates/home.html:98
-msgid "You can help at this locations:"
+msgid "You can help at these locations:"
+msgstr ""
+
+msgid "There are currently no places in need of help."
+msgstr ""
+
+msgid "Privacy Policy"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:10
msgctxt "Privacy Policy Sec1"
msgid "Scope"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:16
msgctxt "Privacy Policy Sec1 P1"
msgid "This privacy policy informs the user of the collection and use of personal data on this website (herein after \"the service\") by the service provider, the Benefit e.V. (Wollankstr. 2, 13187 Berlin)."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:21
msgctxt "Privacy Policy Sec1 P2"
msgid "The legal basis for the privacy policy are the German Data Protection Act (Bundesdatenschutzgesetz, BDSG) and the German Telemedia Act (Telemediengesetz, TMG)."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:29
msgctxt "Privacy Policy Sec2"
msgid "Access data / server log files"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:35
msgctxt "Privacy Policy Sec2 P1"
msgid "The service provider (or the provider of his webspace) collects data on every access to the service and stores this access data in so-called server log files. Access data includes the name of the website that is being visited, which files are being accessed, the date and time of access, transfered data, notification of successful access, the type and version number of the user's web browser, the user's operating system, the referrer URL (i.e., the website the user visited previously), the user's IP address, and the name of the user's Internet provider."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:40
msgctxt "Privacy Policy Sec2 P2"
msgid "The service provider uses the server log files for statistical purposes and for the operation, the security, and the enhancement of the provided service only. However, the service provider reserves the right to reassess the log files at any time if specific indications for an illegal use of the service exist."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:48
msgctxt "Privacy Policy Sec3"
msgid "Use of personal data"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:54
msgctxt "Privacy Policy Sec3 P1"
msgid "Personal data is information which can be used to identify a person, i.e., all data that can be traced back to a specific person. Personal data includes the name, the e-mail address, or the telephone number of a user. Even data on personal preferences, hobbies, memberships, or visited websites counts as personal data."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:59
msgctxt "Privacy Policy Sec3 P2"
msgid "The service provider collects, uses, and shares personal data with third parties only if he is permitted by law to do so or if the user has given his permission."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:67
msgctxt "Privacy Policy Sec4"
msgid "Contact"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:73
msgctxt "Privacy Policy Sec4 P1"
msgid "When contacting the service provider (e.g. via e-mail or using a web contact form), the data provided by the user is stored for processing the inquiry and for answering potential follow-up inquiries in the future."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:81
msgctxt "Privacy Policy Sec5"
msgid "Cookies"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:87
msgctxt "Privacy Policy Sec5 P1"
msgid "Cookies are small files that are being stored on the user's device (personal computer, smartphone, or the like) with information specific to that device. They can be used for various purposes: Cookies may be used to improve the user experience (e.g. by storing and, hence, \"remembering\" login credentials). Cookies may also be used to collect statistical data that allows the service provider to analyse the user's usage of the website, aiming to improve the service."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:92
msgctxt "Privacy Policy Sec5 P2"
msgid "The user can customize the use of cookies. Most web browsers offer settings to restrict or even completely prevent the storing of cookies. However, the service provider notes that such restrictions may have a negative impact on the user experience and the functionality of the website."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:97
#, python-format
msgctxt "Privacy Policy Sec5 P3"
msgid "The user can manage the use of cookies from many online advertisers by visiting either the US-american website %(us_url)s or the European website %(eu_url)s."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:105
msgctxt "Privacy Policy Sec6"
msgid "Registration"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:111
msgctxt "Privacy Policy Sec6 P1"
msgid "The data provided by the user during registration allows for the usage of the service. The service provider may inform the user via e-mail about information relevant to the service or the registration, such as information on changes, which the service undergoes, or technical information (see also next section)."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:116
msgctxt "Privacy Policy Sec6 P2"
msgid "The registration and user profile forms show which data is being collected and stored. They include - but are not limited to - the user's first name, last name, and e-mail address."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:124
msgctxt "Privacy Policy Sec7"
msgid "E-mail notifications / Newsletter"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:130
msgctxt "Privacy Policy Sec7 P1"
msgid "When registering an account with the service, the user gives permission to receive e-mail notifications as well as newsletter e-mails."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:135
msgctxt "Privacy Policy Sec7 P2"
msgid "E-mail notifications inform the user of certain events that relate to the user's use of the service. With the newsletter, the service provider sends the user general information about the provider and his offered service(s)."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:140
msgctxt "Privacy Policy Sec7 P3"
msgid "If the user wishes to revoke his permission to receive e-mails, he needs to delete his user account."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:148
msgctxt "Privacy Policy Sec8"
msgid "Google Analytics"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:154
msgctxt "Privacy Policy Sec8 P1"
msgid "This website uses Google Analytics, a web analytics service provided by Google, Inc. (“Google”). Google Analytics uses “cookies”, which are text files placed on the user's device, to help the website analyze how users use the site. The information generated by the cookie about the user's use of the website will be transmitted to and stored by Google on servers in the United States."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:159
msgctxt "Privacy Policy Sec8 P2"
msgid "In case IP-anonymisation is activated on this website, the user's IP address will be truncated within the area of Member States of the European Union or other parties to the Agreement on the European Economic Area. Only in exceptional cases the whole IP address will be first transfered to a Google server in the USA and truncated there. The IP-anonymisation is active on this website."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:164
msgctxt "Privacy Policy Sec8 P3"
msgid "Google will use this information on behalf of the operator of this website for the purpose of evaluating your use of the website, compiling reports on website activity for website operators and providing them other services relating to website activity and internet usage."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:169
#, python-format
msgctxt "Privacy Policy Sec8 P4"
msgid "The IP-address, that the user's browser conveys within the scope of Google Analytics, will not be associated with any other data held by Google. The user may refuse the use of cookies by selecting the appropriate settings on his browser, however it is to be noted that if the user does this he may not be able to use the full functionality of this website. He can also opt-out from being tracked by Google Analytics with effect for the future by downloading and installing Google Analytics Opt-out Browser Addon for his current web browser: %(optout_plugin_url)s."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:174
msgid "click this link"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:175
#, python-format
msgctxt "Privacy Policy Sec8 P5"
msgid "As an alternative to the browser Addon or within browsers on mobile devices, the user can %(optout_javascript)s in order to opt-out from being tracked by Google Analytics within this website in the future (the opt-out applies only for the browser in which the user sets it and within this domain). An opt-out cookie will be stored on the user's device, which means that the user will have to click this link again, if he deletes his cookies."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:183
msgctxt "Privacy Policy Sec9"
msgid "Revocation, Changes, Corrections, and Updates"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:189
msgctxt "Privacy Policy Sec9 P1"
msgid "The user has the right to be informed upon application and free of charge, which personal data about him has been stored. Additionally, the user can ask for the correction of uncorrect data, as well as for the suspension or even deletion of his personal data as far as there is no legal obligation to retain that data."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:198
msgctxt "Privacy Policy Credit"
msgid "Based on the privacy policy sample of the lawyer Thomas Schwenke - I LAW it"
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:20
msgid "advantages"
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:22
msgid "save time"
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:23
msgid "improve selforganization of the volunteers"
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:26
msgid ""
"\n"
" volunteers split themselves up more effectively into shifts,\n"
@@ -446,7 +419,6 @@ msgid ""
" "
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:32
msgid ""
"\n"
" shift plans can be given to the security personnel\n"
@@ -455,7 +427,6 @@ msgid ""
" "
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:39
msgid ""
"\n"
" the more shelters and camps are organized with us, the more volunteers are joining\n"
@@ -463,15 +434,12 @@ msgid ""
" "
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:45
msgid "for free without costs"
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:51
msgid "The right help at the right time at the right place"
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:52
msgid ""
"\n"
" Many people want to help! But often it's not so easy to figure out where, when and how one can help.\n"
@@ -480,11 +448,9 @@ msgid ""
" "
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:60
msgid "for free, ad free"
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:61
msgid ""
"\n"
"
The platform was build by a group of volunteering professionals in the area of software development, project management, design,\n"
@@ -492,11 +458,9 @@ msgid ""
" "
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:69
msgid "contact us!"
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:72
msgid ""
"\n"
" ...maybe with an attached draft of the shifts you want to see on volunteer-planner. Please write to http://%(site_domain)s%(activation_key_url)s \n"
+"\n"
+"This link will expire in %(expiration_days)s days.\n"
+"\n"
+"Yours,\n"
+"\n"
+"the volunteer-planner.org team\n"
+msgstr ""
+
+#, python-format
+msgid ""
+"\n"
+"Hello %(user)s,\n"
+"\n"
+"thank you very much that you want to help! Just one more step and you'll be ready to start volunteering!\n"
+"\n"
+"Please click the following link to finish your registration at volunteer-planner.org:\n"
+"\n"
+"http://%(site_domain)s%(activation_key_url)s\n"
+"\n"
+"This link will expire in %(expiration_days)s days.\n"
+"\n"
+"Yours,\n"
+"\n"
+"the volunteer-planner.org team\n"
+msgstr ""
+
+msgid "Your volunteer-planner.org registration"
+msgstr ""
+
msgid "Your username and password didn't match. Please try again."
msgstr ""
-#: templates/registration/login.html:26
-#: templates/registration/registration_form.html:26
msgid "Password"
msgstr ""
-#: templates/registration/login.html:36
-#: templates/registration/password_reset_form.html:6
msgid "Forgot your password?"
msgstr ""
-#: templates/registration/login.html:40
msgid "Help and sign-up"
msgstr ""
-#: templates/registration/password_change_done.html:3
msgid "Password changed"
msgstr ""
-#: templates/registration/password_change_done.html:7
msgid "Password successfully changed!"
msgstr ""
-#: templates/registration/password_change_form.html:3
-#: templates/registration/password_change_form.html:6
msgid "Change Password"
msgstr ""
-#: templates/registration/password_change_form.html:11
-#: templates/registration/password_change_form.html:13
-#: templates/registration/password_reset_form.html:12
-#: templates/registration/password_reset_form.html:14
msgid "Email address"
msgstr ""
-#: templates/registration/password_change_form.html:15
-#: templates/registration/password_reset_confirm.html:13
msgid "Change password"
msgstr ""
-#: templates/registration/password_reset_complete.html:3
msgid "Password reset complete"
msgstr ""
-#: templates/registration/password_reset_complete.html:8
msgctxt "login link title reset password complete page"
msgid "log in"
msgstr ""
-#: templates/registration/password_reset_complete.html:10
#, python-format
msgctxt "reset password complete page"
msgid "Your password has been reset! You may now %(login_link)s again."
msgstr ""
-#: templates/registration/password_reset_confirm.html:3
msgid "Enter new password"
msgstr ""
-#: templates/registration/password_reset_confirm.html:6
msgid "Enter your new password below to reset your password"
msgstr ""
-#: templates/registration/password_reset_done.html:3
msgid "Password reset"
msgstr ""
-#: templates/registration/password_reset_done.html:6
msgid "We sent you an email with a link to reset your password."
msgstr ""
-#: templates/registration/password_reset_done.html:7
msgid "Please check your email and click the link to continue."
msgstr ""
-#: templates/registration/password_reset_email.html:3
#, python-format
msgid ""
"You are receiving this email because you (or someone pretending to be you)\n"
@@ -1213,7 +1139,6 @@ msgid ""
"into your web browser:"
msgstr ""
-#: templates/registration/password_reset_email.html:12
#, python-format
msgid ""
"\n"
@@ -1223,76 +1148,62 @@ msgid ""
"%(site_name)s Management\n"
msgstr ""
-#: templates/registration/password_reset_form.html:3
-#: templates/registration/password_reset_form.html:16
msgid "Reset password"
msgstr ""
-#: templates/registration/password_reset_form.html:7
msgid "No Problem! We'll send you instructions on how to reset your password."
msgstr ""
-#: templates/registration/registration_complete.html:3
msgid "Activation email sent"
msgstr ""
-#: templates/registration/registration_complete.html:7
-#: tests/registration/test_registration.py:145
msgid "An activation mail will be sent to you email address."
msgstr ""
-#: templates/registration/registration_complete.html:13
msgid "Please confirm registration with the link in the email. If you haven't received it in 10 minutes, look for it in your spam folder."
msgstr ""
-#: templates/registration/registration_form.html:3
msgid "Register for an account"
msgstr ""
-#: templates/registration/registration_form.html:8
msgid "Registration"
msgstr ""
-#: templates/registration/registration_form.html:21
msgid "Username already exists. Please choose a different username."
msgstr ""
-#: templates/registration/registration_form.html:23
msgid "Don't use spaces or special characters"
msgstr ""
-#: templates/registration/registration_form.html:29
msgid "Repeat password"
msgstr ""
-#: templates/registration/registration_form.html:31
msgid "Sign-up"
msgstr ""
-#: tests/registration/test_registration.py:43
msgid "This field is required."
msgstr ""
-#: tests/registration/test_registration.py:82
msgid "Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters."
msgstr ""
-#: tests/registration/test_registration.py:110
msgid "A user with that username already exists."
msgstr ""
-#: tests/registration/test_registration.py:131
msgid "The two password fields didn't match."
msgstr ""
-#: volunteer_planner/settings/base.py:141
+msgid "English"
+msgstr ""
+
msgid "German"
msgstr ""
-#: volunteer_planner/settings/base.py:142
-msgid "English"
+msgid "Greek"
msgstr ""
-#: volunteer_planner/settings/base.py:143
msgid "Hungarian"
msgstr ""
+
+msgid "Swedish"
+msgstr ""
diff --git a/locale/hu/LC_MESSAGES/django.po b/locale/hu/LC_MESSAGES/django.po
index 8d6dd6ac..299fdde2 100644
--- a/locale/hu/LC_MESSAGES/django.po
+++ b/locale/hu/LC_MESSAGES/django.po
@@ -1,8 +1,7 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
-#
-# Translators:
+#
# Translators:
# Christoph, 2015
# Christoph, 2015
@@ -15,438 +14,526 @@ msgid ""
msgstr ""
"Project-Id-Version: volunteer-planner.org\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-10-22 13:29+0200\n"
-"PO-Revision-Date: 2015-10-22 11:28+0000\n"
+"POT-Creation-Date: 2015-11-08 23:26+0100\n"
+"PO-Revision-Date: 2015-11-08 22:26+0000\n"
"Last-Translator: Christoph\n"
"Language-Team: Hungarian (http://www.transifex.com/coders4help/volunteer-planner/language/hu/)\n"
-"Language: hu\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"Language: hu\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: accounts/apps.py:8 accounts/apps.py:16
+msgid "first name"
+msgstr ""
+
+msgid "email"
+msgstr "e-mail"
+
msgid "Accounts"
msgstr ""
-#: accounts/models.py:16 organizations/models.py:119
msgid "user account"
msgstr "felhasználói fiók"
-#: accounts/models.py:17
msgid "user accounts"
msgstr "felhasználói fiókok"
-#: accounts/templates/user_account_edit.html:12
-#: scheduletemplates/templates/admin/scheduletemplates/scheduletemplate/scheduletemplate_submit_line.html:3
msgid "Save"
msgstr "Mentés"
-#: accounts/templates/user_detail.html:10 templates/registration/login.html:23
-#: templates/registration/registration_form.html:22
msgid "Username"
msgstr "Felhasználónév"
-#: accounts/templates/user_detail.html:11
msgid "First name"
msgstr "Keresztnév"
-#: accounts/templates/user_detail.html:12
msgid "Last name"
msgstr "Vezetéknév"
-#: accounts/templates/user_detail.html:13
-#: templates/registration/registration_form.html:18
msgid "Email"
msgstr "E-mail"
-#: accounts/templates/user_detail.html:16
msgid "Edit Account"
msgstr "Fiók szerkesztése"
-#: google_tools/templatetags/google_links.py:17
+msgid "additional CSS"
+msgstr ""
+
+msgid "translation"
+msgstr ""
+
+msgid "translations"
+msgstr ""
+
+msgid "No translation available"
+msgstr ""
+
+msgid "additional style"
+msgstr ""
+
+msgid "additional flat page style"
+msgstr ""
+
+msgid "additional flat page styles"
+msgstr ""
+
+msgid "flat page"
+msgstr ""
+
+msgid "language"
+msgstr ""
+
+msgid "title"
+msgstr "cím"
+
+msgid "content"
+msgstr ""
+
+msgid "flat page translation"
+msgstr ""
+
+msgid "flat page translations"
+msgstr ""
+
+msgid "View on site"
+msgstr ""
+
+msgid "Remove"
+msgstr ""
+
+#, python-format
+msgid "Add another %(verbose_name)s"
+msgstr ""
+
+msgid "Edit this page"
+msgstr ""
+
#, python-brace-format
msgctxt "maps search url pattern"
msgid "https://www.google.com/maps/place/{location}"
msgstr "https://www.google.com/maps/place/{location}"
-#: google_tools/templatetags/google_links.py:27
#, python-brace-format
msgctxt "maps directions url pattern"
msgid "https://www.google.com/maps/dir/{departure}/{destination}/"
msgstr "https://www.google.com/maps/dir/{departure}/{destination}/"
-#: news/models.py:13
-msgid "creation date"
-msgstr ""
-
-#: news/models.py:14
-msgid "title"
-msgstr "cím"
-
-#: news/models.py:15
msgid "subtitle"
msgstr "alcím"
-#: news/models.py:16
msgid "articletext"
msgstr ""
-#: non_logged_in_area/templates/base_non_logged_in.html:46
-#: templates/registration/login.html:3 templates/registration/login.html:10
+msgid "creation date"
+msgstr ""
+
+msgid "news entry"
+msgstr ""
+
+msgid "news entries"
+msgstr ""
+
msgid "Login"
msgstr "Bejelentkezés"
-#: non_logged_in_area/templates/base_non_logged_in.html:49
msgid "Start helping"
msgstr "Kezdődhet a segítségnyújtás"
-#: non_logged_in_area/templates/base_non_logged_in.html:76
msgid "Main page"
msgstr "Kezdőoldal"
-#: non_logged_in_area/templates/base_non_logged_in.html:79
-#: non_logged_in_area/templates/faqs.html:5
-msgid "Frequently Asked Questions"
-msgstr "Gyakori kérdések"
+msgid "Imprint"
+msgstr "Impresszum"
+
+msgid "About"
+msgstr ""
+
+msgid "Supporter"
+msgstr ""
+
+msgid "Press"
+msgstr ""
-#: non_logged_in_area/templates/base_non_logged_in.html:82
msgid "Contact"
msgstr "Kapcsolat"
-#: non_logged_in_area/templates/base_non_logged_in.html:85
-msgid "Imprint"
-msgstr "Impresszum"
-
-#: non_logged_in_area/templates/base_non_logged_in.html:88
-msgid "Terms of Service"
-msgstr "Használati feltételek"
+msgid "F.A.Q."
+msgstr ""
-#: non_logged_in_area/templates/base_non_logged_in.html:91
-#: non_logged_in_area/templates/privacy_policy.html:6
-msgid "Privacy Policy"
-msgstr "Magánszféra"
+msgid "Frequently Asked Questions"
+msgstr "Gyakori kérdések"
-#: non_logged_in_area/templates/faqs.html:10
msgctxt "FAQ Q1"
msgid "How does volunteer-planner work?"
msgstr "Hogyan működik a volunteer-planner?"
-#: non_logged_in_area/templates/faqs.html:19
msgctxt "FAQ A1.1"
msgid "Create an account."
msgstr "Azonosító létrehozása"
-#: non_logged_in_area/templates/faqs.html:25
msgctxt "FAQ A1.2"
-msgid "Confirm your email address by clicking the activation link you've been sent."
+msgid ""
+"Confirm your email address by clicking the activation link you've been sent."
msgstr "Az elküldött levélben lévő aktivációs linkre kattintva igazold az e-mail cím hitelességét."
-#: non_logged_in_area/templates/faqs.html:32
msgctxt "FAQ A1.3"
msgid "Log in."
msgstr "Bejelentkezés"
-#: non_logged_in_area/templates/faqs.html:37
msgctxt "FAQ A1.4"
msgid "Choose a place to help and a shift and sign up to help."
msgstr "Válassz egy helyszínt és egy beosztást, és iratkozz fel segítőnek."
-#: non_logged_in_area/templates/faqs.html:42
msgctxt "FAQ A1.5"
msgid "Get there on time and start helping out."
msgstr "Legyél ott időben és kezdhetsz is segíteni."
-#: non_logged_in_area/templates/faqs.html:51
msgctxt "FAQ Q2"
msgid "How can I unsubscribe from a shift?"
msgstr "Hogyan tudok egy beosztásról leiratkozni?"
-#: non_logged_in_area/templates/faqs.html:57
msgctxt "FAQ A2"
-msgid "No problem. Log-in again look for the shift you planned to do and unsubscribe. Then other volunteers can again subscribe."
+msgid ""
+"No problem. Log-in again look for the shift you planned to do and "
+"unsubscribe. Then other volunteers can again subscribe."
msgstr "Semmi gond. Jelentkezz be újból a tervezett beosztásra, és iratkozz le róla. A többi önkéntes újra jelentkezhet."
-#: non_logged_in_area/templates/faqs.html:66
msgctxt "FAQ Q3"
msgid "Are there more shelters coming into volunteer-planner?"
msgstr "Lesz több helyszín is a volunteer-planner-ben?"
-#: non_logged_in_area/templates/faqs.html:70
-#: non_logged_in_area/templates/faqs.html:138 shiftmailer/models.py:13
-msgid "email"
-msgstr "e-mail"
-
-#: non_logged_in_area/templates/faqs.html:72
#, python-format
msgctxt "FAQ A3"
-msgid "Yes! If you are a volunteer worker in a refugee shelter and they also want to use volunteer-planner please contact us via %(email_url)s."
+msgid ""
+"Yes! If you are a volunteer worker in a refugee shelter and they also want "
+"to use volunteer-planner please contact us via %(email_url)s."
msgstr "Igen, ha önkéntes munkára jelentkeztél egy helyszínre, és ők szintén a volunteer-planner-t akarják használni, lépj velünk kapcsolatba a %(email_url)s e-mail címen."
-#: non_logged_in_area/templates/faqs.html:82
msgctxt "FAQ Q4"
msgid "I registered but I didn't get any activation link. What can I do?"
msgstr "Már regisztráltam, de nem kaptam aktiváló e-mailt. Mit tehetek?"
-#: non_logged_in_area/templates/faqs.html:89
msgctxt "FAQ A4"
-msgid "Please look into your email-spam folder. If you can't find something please wait another 30 minutes. Email delivery can sometimes take longer."
+msgid ""
+"Please look into your email-spam folder. If you can't find something please "
+"wait another 30 minutes. Email delivery can sometimes take longer."
msgstr "Ellenőrizd a levélszemét könyvtárat! Ha ott sincs, akkor várj még 30 percet, az e-mail kézbesítés néha tovább tarthat."
-#: non_logged_in_area/templates/faqs.html:99
msgctxt "FAQ Q5"
msgid "Do I have to be vaccinated to help at the camps/shelters?"
msgstr "Szükség van-e oltásokra ahhoz, hogy önkéntes lehessek?"
-#: non_logged_in_area/templates/faqs.html:105
msgctxt "FAQ A5"
-msgid "You are not supposed to be vaccinated. BUT: Where there are a lot of people deseases can flourish better."
+msgid ""
+"You are not supposed to be vaccinated. BUT: Where there are a lot of people "
+"deseases can flourish better."
msgstr "Nem várjuk el, hogy beoltasd magad. De ahol sok ember van egy helyen, ott betegségek gyorsabban el tudnak terjedni."
-#: non_logged_in_area/templates/faqs.html:114
msgctxt "FAQ Q6"
msgid "Who is volunteer-planner.org?"
msgstr "Mi a pontosan a volunteer-planner.org?"
-#: non_logged_in_area/templates/faqs.html:120
msgctxt "FAQ A6"
-msgid "We are Coders4Help, a group of international volunteering programmers, designers and projectmanagers."
+msgid ""
+"We are Coders4Help, a group of international volunteering programmers, "
+"designers and projectmanagers."
msgstr "Mi vagyunk a Coders4Help, egy önkéntes fejlesztőkből, mérnökökből és projektmenedzserekből álló, nemzetközi csoport."
-#: non_logged_in_area/templates/faqs.html:130
msgctxt "FAQ Q7"
msgid "How can I help you?"
msgstr "Miben segíthetek nektek?"
-#: non_logged_in_area/templates/faqs.html:137
msgid "Facebook site"
msgstr "Facebook oldal"
-#: non_logged_in_area/templates/faqs.html:139
#, python-format
msgctxt "FAQ A7"
-msgid "Currently we need help to translate, write texts and create awesome designs. Want to help? Write a message on our %(facebook_link)s or send an %(email_url)s."
+msgid ""
+"Currently we need help to translate, write texts and create awesome designs."
+" Want to help? Write a message on our %(facebook_link)s or send an "
+"%(email_url)s."
msgstr "Jelenleg segítségre fordításban, szövegírásban és tervezésben van szükségünk. Ha segíteni akarsz, küldj üzenetet %(facebook_link)s vagy e-mailt %(email_url)s."
-#: non_logged_in_area/templates/home.html:25
msgid "I want to help!"
msgstr "Szeretnék segíteni!"
-#: non_logged_in_area/templates/home.html:27
msgid "Register and see where you can help"
msgstr "Regisztrálj, és válaszd ki miben tudsz segíteni!"
-#: non_logged_in_area/templates/home.html:32
msgid "Organize volunteers!"
msgstr "Szervezz önkénteseket!"
-#: non_logged_in_area/templates/home.html:34
msgid "Register a shelter and organize volunteers"
msgstr "Regisztrájl egy helyszínt és szervezz oda önkénteseket!"
-#: non_logged_in_area/templates/home.html:48
msgid "Places to help"
msgstr "Segítségre váró helyszínek"
-#: non_logged_in_area/templates/home.html:55
msgid "Registered Volunteers"
msgstr "Regisztrált önkéntesek"
-#: non_logged_in_area/templates/home.html:62
msgid "Worked Hours"
msgstr "Munkaórák"
-#: non_logged_in_area/templates/home.html:74
msgid "What is it all about?"
msgstr "Miről szól ez az egész?"
-#: non_logged_in_area/templates/home.html:77
-msgid "You are a volunteer and want to help refugees? Volunteer-Planner.org shows you where, when and how to help directly in the field."
+msgid ""
+"You are a volunteer and want to help refugees? Volunteer-Planner.org shows "
+"you where, when and how to help directly in the field."
msgstr "Önkéntesként segítenél a menedékkérőknek? A Volunteer-Planner.org megmutatja, hol, mikor és hogyan segíthetsz."
-#: non_logged_in_area/templates/home.html:85
-msgid "
This platform is non-commercial and ads-free. An international team of field workers, programmers, project managers and designers are volunteering for this project and bring in their professional experience to make a difference.
"
+msgid ""
+"This platform is non-commercial and ads-free. An international team of "
+"field workers, programmers, project managers and designers are volunteering "
+"for this project and bring in their professional experience to make a "
+"difference.
"
+msgstr ""
+
+msgid "You can help at these locations:"
+msgstr ""
+
+msgid "There are currently no places in need of help."
msgstr ""
-#: non_logged_in_area/templates/home.html:98
-msgid "You can help at this locations:"
-msgstr "Ezeken a helyszíneken segíthetsz:"
+msgid "Privacy Policy"
+msgstr "Magánszféra"
-#: non_logged_in_area/templates/privacy_policy.html:10
msgctxt "Privacy Policy Sec1"
msgid "Scope"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:16
msgctxt "Privacy Policy Sec1 P1"
-msgid "This privacy policy informs the user of the collection and use of personal data on this website (herein after \"the service\") by the service provider, the Benefit e.V. (Wollankstr. 2, 13187 Berlin)."
+msgid ""
+"This privacy policy informs the user of the collection and use of personal "
+"data on this website (herein after \"the service\") by the service provider,"
+" the Benefit e.V. (Wollankstr. 2, 13187 Berlin)."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:21
msgctxt "Privacy Policy Sec1 P2"
-msgid "The legal basis for the privacy policy are the German Data Protection Act (Bundesdatenschutzgesetz, BDSG) and the German Telemedia Act (Telemediengesetz, TMG)."
+msgid ""
+"The legal basis for the privacy policy are the German Data Protection Act "
+"(Bundesdatenschutzgesetz, BDSG) and the German Telemedia Act "
+"(Telemediengesetz, TMG)."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:29
msgctxt "Privacy Policy Sec2"
msgid "Access data / server log files"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:35
msgctxt "Privacy Policy Sec2 P1"
-msgid "The service provider (or the provider of his webspace) collects data on every access to the service and stores this access data in so-called server log files. Access data includes the name of the website that is being visited, which files are being accessed, the date and time of access, transfered data, notification of successful access, the type and version number of the user's web browser, the user's operating system, the referrer URL (i.e., the website the user visited previously), the user's IP address, and the name of the user's Internet provider."
+msgid ""
+"The service provider (or the provider of his webspace) collects data on "
+"every access to the service and stores this access data in so-called server "
+"log files. Access data includes the name of the website that is being "
+"visited, which files are being accessed, the date and time of access, "
+"transfered data, notification of successful access, the type and version "
+"number of the user's web browser, the user's operating system, the referrer "
+"URL (i.e., the website the user visited previously), the user's IP address, "
+"and the name of the user's Internet provider."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:40
msgctxt "Privacy Policy Sec2 P2"
-msgid "The service provider uses the server log files for statistical purposes and for the operation, the security, and the enhancement of the provided service only. However, the service provider reserves the right to reassess the log files at any time if specific indications for an illegal use of the service exist."
+msgid ""
+"The service provider uses the server log files for statistical purposes and "
+"for the operation, the security, and the enhancement of the provided service"
+" only. However, the service provider reserves the right to reassess the log "
+"files at any time if specific indications for an illegal use of the service "
+"exist."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:48
msgctxt "Privacy Policy Sec3"
msgid "Use of personal data"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:54
msgctxt "Privacy Policy Sec3 P1"
-msgid "Personal data is information which can be used to identify a person, i.e., all data that can be traced back to a specific person. Personal data includes the name, the e-mail address, or the telephone number of a user. Even data on personal preferences, hobbies, memberships, or visited websites counts as personal data."
+msgid ""
+"Personal data is information which can be used to identify a person, i.e., "
+"all data that can be traced back to a specific person. Personal data "
+"includes the name, the e-mail address, or the telephone number of a user. "
+"Even data on personal preferences, hobbies, memberships, or visited websites"
+" counts as personal data."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:59
msgctxt "Privacy Policy Sec3 P2"
-msgid "The service provider collects, uses, and shares personal data with third parties only if he is permitted by law to do so or if the user has given his permission."
+msgid ""
+"The service provider collects, uses, and shares personal data with third "
+"parties only if he is permitted by law to do so or if the user has given his"
+" permission."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:67
msgctxt "Privacy Policy Sec4"
msgid "Contact"
msgstr "Kapcsolat"
-#: non_logged_in_area/templates/privacy_policy.html:73
msgctxt "Privacy Policy Sec4 P1"
-msgid "When contacting the service provider (e.g. via e-mail or using a web contact form), the data provided by the user is stored for processing the inquiry and for answering potential follow-up inquiries in the future."
+msgid ""
+"When contacting the service provider (e.g. via e-mail or using a web contact"
+" form), the data provided by the user is stored for processing the inquiry "
+"and for answering potential follow-up inquiries in the future."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:81
msgctxt "Privacy Policy Sec5"
msgid "Cookies"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:87
msgctxt "Privacy Policy Sec5 P1"
-msgid "Cookies are small files that are being stored on the user's device (personal computer, smartphone, or the like) with information specific to that device. They can be used for various purposes: Cookies may be used to improve the user experience (e.g. by storing and, hence, \"remembering\" login credentials). Cookies may also be used to collect statistical data that allows the service provider to analyse the user's usage of the website, aiming to improve the service."
+msgid ""
+"Cookies are small files that are being stored on the user's device (personal"
+" computer, smartphone, or the like) with information specific to that "
+"device. They can be used for various purposes: Cookies may be used to "
+"improve the user experience (e.g. by storing and, hence, \"remembering\" "
+"login credentials). Cookies may also be used to collect statistical data "
+"that allows the service provider to analyse the user's usage of the website,"
+" aiming to improve the service."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:92
msgctxt "Privacy Policy Sec5 P2"
-msgid "The user can customize the use of cookies. Most web browsers offer settings to restrict or even completely prevent the storing of cookies. However, the service provider notes that such restrictions may have a negative impact on the user experience and the functionality of the website."
+msgid ""
+"The user can customize the use of cookies. Most web browsers offer settings "
+"to restrict or even completely prevent the storing of cookies. However, the "
+"service provider notes that such restrictions may have a negative impact on "
+"the user experience and the functionality of the website."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:97
#, python-format
msgctxt "Privacy Policy Sec5 P3"
-msgid "The user can manage the use of cookies from many online advertisers by visiting either the US-american website %(us_url)s or the European website %(eu_url)s."
+msgid ""
+"The user can manage the use of cookies from many online advertisers by "
+"visiting either the US-american website %(us_url)s or the European website "
+"%(eu_url)s."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:105
msgctxt "Privacy Policy Sec6"
msgid "Registration"
msgstr "Regisztráció"
-#: non_logged_in_area/templates/privacy_policy.html:111
msgctxt "Privacy Policy Sec6 P1"
-msgid "The data provided by the user during registration allows for the usage of the service. The service provider may inform the user via e-mail about information relevant to the service or the registration, such as information on changes, which the service undergoes, or technical information (see also next section)."
+msgid ""
+"The data provided by the user during registration allows for the usage of "
+"the service. The service provider may inform the user via e-mail about "
+"information relevant to the service or the registration, such as information"
+" on changes, which the service undergoes, or technical information (see also"
+" next section)."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:116
msgctxt "Privacy Policy Sec6 P2"
-msgid "The registration and user profile forms show which data is being collected and stored. They include - but are not limited to - the user's first name, last name, and e-mail address."
+msgid ""
+"The registration and user profile forms show which data is being collected "
+"and stored. They include - but are not limited to - the user's first name, "
+"last name, and e-mail address."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:124
msgctxt "Privacy Policy Sec7"
msgid "E-mail notifications / Newsletter"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:130
msgctxt "Privacy Policy Sec7 P1"
-msgid "When registering an account with the service, the user gives permission to receive e-mail notifications as well as newsletter e-mails."
+msgid ""
+"When registering an account with the service, the user gives permission to "
+"receive e-mail notifications as well as newsletter e-mails."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:135
msgctxt "Privacy Policy Sec7 P2"
-msgid "E-mail notifications inform the user of certain events that relate to the user's use of the service. With the newsletter, the service provider sends the user general information about the provider and his offered service(s)."
+msgid ""
+"E-mail notifications inform the user of certain events that relate to the "
+"user's use of the service. With the newsletter, the service provider sends "
+"the user general information about the provider and his offered service(s)."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:140
msgctxt "Privacy Policy Sec7 P3"
-msgid "If the user wishes to revoke his permission to receive e-mails, he needs to delete his user account."
+msgid ""
+"If the user wishes to revoke his permission to receive e-mails, he needs to "
+"delete his user account."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:148
msgctxt "Privacy Policy Sec8"
msgid "Google Analytics"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:154
msgctxt "Privacy Policy Sec8 P1"
-msgid "This website uses Google Analytics, a web analytics service provided by Google, Inc. (“Google”). Google Analytics uses “cookies”, which are text files placed on the user's device, to help the website analyze how users use the site. The information generated by the cookie about the user's use of the website will be transmitted to and stored by Google on servers in the United States."
+msgid ""
+"This website uses Google Analytics, a web analytics service provided by "
+"Google, Inc. (“Google”). Google Analytics uses “cookies”, which are text "
+"files placed on the user's device, to help the website analyze how users use"
+" the site. The information generated by the cookie about the user's use of "
+"the website will be transmitted to and stored by Google on servers in the "
+"United States."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:159
msgctxt "Privacy Policy Sec8 P2"
-msgid "In case IP-anonymisation is activated on this website, the user's IP address will be truncated within the area of Member States of the European Union or other parties to the Agreement on the European Economic Area. Only in exceptional cases the whole IP address will be first transfered to a Google server in the USA and truncated there. The IP-anonymisation is active on this website."
+msgid ""
+"In case IP-anonymisation is activated on this website, the user's IP address"
+" will be truncated within the area of Member States of the European Union or"
+" other parties to the Agreement on the European Economic Area. Only in "
+"exceptional cases the whole IP address will be first transfered to a Google "
+"server in the USA and truncated there. The IP-anonymisation is active on "
+"this website."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:164
msgctxt "Privacy Policy Sec8 P3"
-msgid "Google will use this information on behalf of the operator of this website for the purpose of evaluating your use of the website, compiling reports on website activity for website operators and providing them other services relating to website activity and internet usage."
+msgid ""
+"Google will use this information on behalf of the operator of this website "
+"for the purpose of evaluating your use of the website, compiling reports on "
+"website activity for website operators and providing them other services "
+"relating to website activity and internet usage."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:169
#, python-format
msgctxt "Privacy Policy Sec8 P4"
-msgid "The IP-address, that the user's browser conveys within the scope of Google Analytics, will not be associated with any other data held by Google. The user may refuse the use of cookies by selecting the appropriate settings on his browser, however it is to be noted that if the user does this he may not be able to use the full functionality of this website. He can also opt-out from being tracked by Google Analytics with effect for the future by downloading and installing Google Analytics Opt-out Browser Addon for his current web browser: %(optout_plugin_url)s."
+msgid ""
+"The IP-address, that the user's browser conveys within the scope of Google "
+"Analytics, will not be associated with any other data held by Google. The "
+"user may refuse the use of cookies by selecting the appropriate settings on "
+"his browser, however it is to be noted that if the user does this he may not"
+" be able to use the full functionality of this website. He can also opt-out "
+"from being tracked by Google Analytics with effect for the future by "
+"downloading and installing Google Analytics Opt-out Browser Addon for his "
+"current web browser: %(optout_plugin_url)s."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:174
msgid "click this link"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:175
#, python-format
msgctxt "Privacy Policy Sec8 P5"
-msgid "As an alternative to the browser Addon or within browsers on mobile devices, the user can %(optout_javascript)s in order to opt-out from being tracked by Google Analytics within this website in the future (the opt-out applies only for the browser in which the user sets it and within this domain). An opt-out cookie will be stored on the user's device, which means that the user will have to click this link again, if he deletes his cookies."
+msgid ""
+"As an alternative to the browser Addon or within browsers on mobile devices,"
+" the user can %(optout_javascript)s in order to opt-out from being tracked "
+"by Google Analytics within this website in the future (the opt-out applies "
+"only for the browser in which the user sets it and within this domain). An "
+"opt-out cookie will be stored on the user's device, which means that the "
+"user will have to click this link again, if he deletes his cookies."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:183
msgctxt "Privacy Policy Sec9"
msgid "Revocation, Changes, Corrections, and Updates"
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:189
msgctxt "Privacy Policy Sec9 P1"
-msgid "The user has the right to be informed upon application and free of charge, which personal data about him has been stored. Additionally, the user can ask for the correction of uncorrect data, as well as for the suspension or even deletion of his personal data as far as there is no legal obligation to retain that data."
+msgid ""
+"The user has the right to be informed upon application and free of charge, "
+"which personal data about him has been stored. Additionally, the user can "
+"ask for the correction of uncorrect data, as well as for the suspension or "
+"even deletion of his personal data as far as there is no legal obligation to"
+" retain that data."
msgstr ""
-#: non_logged_in_area/templates/privacy_policy.html:198
msgctxt "Privacy Policy Credit"
-msgid "Based on the privacy policy sample of the lawyer Thomas Schwenke - I LAW it"
+msgid ""
+"Based on the privacy policy sample of the lawyer Thomas Schwenke - I LAW it"
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:20
msgid "advantages"
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:22
msgid "save time"
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:23
msgid "improve selforganization of the volunteers"
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:26
msgid ""
"\n"
" volunteers split themselves up more effectively into shifts,\n"
@@ -454,7 +541,6 @@ msgid ""
" "
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:32
msgid ""
"\n"
" shift plans can be given to the security personnel\n"
@@ -463,7 +549,6 @@ msgid ""
" "
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:39
msgid ""
"\n"
" the more shelters and camps are organized with us, the more volunteers are joining\n"
@@ -471,15 +556,12 @@ msgid ""
" "
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:45
msgid "for free without costs"
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:51
msgid "The right help at the right time at the right place"
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:52
msgid ""
"\n"
" Many people want to help! But often it's not so easy to figure out where, when and how one can help.\n"
@@ -488,11 +570,9 @@ msgid ""
" "
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:60
msgid "for free, ad free"
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:61
msgid ""
"\n"
"
The platform was build by a group of volunteering professionals in the area of software development, project management, design,\n"
@@ -500,11 +580,9 @@ msgid ""
" "
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:69
msgid "contact us!"
msgstr ""
-#: non_logged_in_area/templates/shelters_need_help.html:72
msgid ""
"\n"
" ...maybe with an attached draft of the shifts you want to see on volunteer-planner. Please write to http://%(site_domain)s%(activation_key_url)s \n"
+"\n"
+"This link will expire in %(expiration_days)s days.\n"
+"\n"
+"Yours,\n"
+"\n"
+"the volunteer-planner.org team\n"
+msgstr ""
+
+#, python-format
+msgid ""
+"\n"
+"Hello %(user)s,\n"
+"\n"
+"thank you very much that you want to help! Just one more step and you'll be ready to start volunteering!\n"
+"\n"
+"Please click the following link to finish your registration at volunteer-planner.org:\n"
+"\n"
+"http://%(site_domain)s%(activation_key_url)s\n"
+"\n"
+"This link will expire in %(expiration_days)s days.\n"
+"\n"
+"Yours,\n"
+"\n"
+"the volunteer-planner.org team\n"
+msgstr ""
+
+msgid "Your volunteer-planner.org registration"
+msgstr ""
+
msgid "Your username and password didn't match. Please try again."
msgstr "A felhasználónév és a jelszó nem megfelelő. Próbálja újra."
-#: templates/registration/login.html:26
-#: templates/registration/registration_form.html:26
msgid "Password"
msgstr "Jelszó"
-#: templates/registration/login.html:36
-#: templates/registration/password_reset_form.html:6
msgid "Forgot your password?"
msgstr "Elfelejtette a jelszavát?"
-#: templates/registration/login.html:40
msgid "Help and sign-up"
msgstr "Segíts és regisztrálj!"
-#: templates/registration/password_change_done.html:3
msgid "Password changed"
msgstr "A jelszó megváltozott"
-#: templates/registration/password_change_done.html:7
msgid "Password successfully changed!"
msgstr "A jelszót sikeresen megváltoztatta!"
-#: templates/registration/password_change_form.html:3
-#: templates/registration/password_change_form.html:6
msgid "Change Password"
msgstr "Jelszó megváltoztatása"
-#: templates/registration/password_change_form.html:11
-#: templates/registration/password_change_form.html:13
-#: templates/registration/password_reset_form.html:12
-#: templates/registration/password_reset_form.html:14
msgid "Email address"
msgstr "E-mail cím"
-#: templates/registration/password_change_form.html:15
-#: templates/registration/password_reset_confirm.html:13
msgid "Change password"
msgstr "Jelszó megváltoztatása"
-#: templates/registration/password_reset_complete.html:3
msgid "Password reset complete"
msgstr "A jelszó-visszaállítás kész."
-#: templates/registration/password_reset_complete.html:8
msgctxt "login link title reset password complete page"
msgid "log in"
msgstr "Bejelentkezés"
-#: templates/registration/password_reset_complete.html:10
#, python-format
msgctxt "reset password complete page"
msgid "Your password has been reset! You may now %(login_link)s again."
msgstr "Visszaállítottuk a jelszót. A %(login_link)s linken újra bejelentkezhetsz."
-#: templates/registration/password_reset_confirm.html:3
msgid "Enter new password"
msgstr "Adjon meg új jelszót"
-#: templates/registration/password_reset_confirm.html:6
msgid "Enter your new password below to reset your password"
msgstr "Írja be az új jelszavát alább, hogy visszaállítsa a jelszavát."
-#: templates/registration/password_reset_done.html:3
msgid "Password reset"
msgstr "Jelszó visszaállítás"
-#: templates/registration/password_reset_done.html:6
msgid "We sent you an email with a link to reset your password."
msgstr "Elküldtünk önnek egy e-mailt egy hivatkozással, amivel visszaállíthatja a jelszavát."
-#: templates/registration/password_reset_done.html:7
msgid "Please check your email and click the link to continue."
msgstr "Kérem, ellenőrizze az e-mailjét és kattintson a hivatkozásra a folytatáshoz."
-#: templates/registration/password_reset_email.html:3
#, python-format
msgid ""
"You are receiving this email because you (or someone pretending to be you)\n"
@@ -1219,19 +1271,8 @@ msgid ""
"\n"
"To reset your password, please click the following link, or copy and paste it\n"
"into your web browser:"
-msgstr ""
-"Ezt az e-mailt azért kapta, mert ön (vagy valaki az ön nevében)\n"
-"\n"
-"azt ön jelszavának a visszaállítását kérte a %(domain)s weboldalon. Ha nem szeretné\n"
-"\n"
-"visszaállítani a jelszavát, kérem hagyja figyelmen kívül ezt az üzenetet.\n"
-"\n"
-"\n"
-"\n"
-"A jelszava visszaállításához kattintson a következő hivatkozásra, vagy másolja ki és illessze be\n"
-"a böngészőjébe:"
+msgstr "Ezt az e-mailt azért kapta, mert ön (vagy valaki az ön nevében)\n\nazt ön jelszavának a visszaállítását kérte a %(domain)s weboldalon. Ha nem szeretné\n\nvisszaállítani a jelszavát, kérem hagyja figyelmen kívül ezt az üzenetet.\n\n\n\nA jelszava visszaállításához kattintson a következő hivatkozásra, vagy másolja ki és illessze be\na böngészőjébe:"
-#: templates/registration/password_reset_email.html:12
#, python-format
msgid ""
"\n"
@@ -1239,86 +1280,68 @@ msgid ""
"\n"
"Best regards,\n"
"%(site_name)s Management\n"
-msgstr ""
-"\n"
-"A felhasználóneve, ha esetleg elfelejtette volna: %(username)s\n"
-"\n"
-"\n"
-"\n"
-"Üdvözlettel,\n"
-"\n"
-"%(site_name)s management\n"
+msgstr "\nA felhasználóneve, ha esetleg elfelejtette volna: %(username)s\n\n\n\nÜdvözlettel,\n\n%(site_name)s management\n"
-#: templates/registration/password_reset_form.html:3
-#: templates/registration/password_reset_form.html:16
msgid "Reset password"
msgstr "Jelszó visszaállítása"
-#: templates/registration/password_reset_form.html:7
msgid "No Problem! We'll send you instructions on how to reset your password."
msgstr "Semmi gond! Elküldjük önnek, hogy hogyan állíthatja vissza a jelszavát."
-#: templates/registration/registration_complete.html:3
msgid "Activation email sent"
msgstr "Az akitváló e-mailt elküldtük!"
-#: templates/registration/registration_complete.html:7
-#: tests/registration/test_registration.py:145
msgid "An activation mail will be sent to you email address."
msgstr "A regisztrációt aktiváló e-mailt küldünk az e-mail címedre."
-#: templates/registration/registration_complete.html:13
-msgid "Please confirm registration with the link in the email. If you haven't received it in 10 minutes, look for it in your spam folder."
+msgid ""
+"Please confirm registration with the link in the email. If you haven't "
+"received it in 10 minutes, look for it in your spam folder."
msgstr "Erősítsd meg a regisztrációs szándékodat az e-malben kapott linkre kattintva. Ha nem kapsz e-mailt, nézd meg a levélszemetet tartalmazó könyvtárat 10 perc múlva."
-#: templates/registration/registration_form.html:3
msgid "Register for an account"
msgstr "Felhasználói regisztráció"
-#: templates/registration/registration_form.html:8
msgid "Registration"
msgstr "Regisztráció"
-#: templates/registration/registration_form.html:21
msgid "Username already exists. Please choose a different username."
msgstr "Már létezik ez a felhasználói név. Kérjük, válassz egy másikat!"
-#: templates/registration/registration_form.html:23
msgid "Don't use spaces or special characters"
msgstr "Ne használj space-t vagy speciális karaktereket"
-#: templates/registration/registration_form.html:29
msgid "Repeat password"
msgstr "Ismételd meg a jelszót"
-#: templates/registration/registration_form.html:31
msgid "Sign-up"
msgstr "Regisztráció"
-#: tests/registration/test_registration.py:43
msgid "This field is required."
msgstr "Kötelezően megadandó érték."
-#: tests/registration/test_registration.py:82
-msgid "Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters."
+msgid ""
+"Enter a valid username. This value may contain only letters, numbers and "
+"@/./+/-/_ characters."
msgstr "Egy érvényes felhasználói nevet adj meg, ami betüből, számból és a következő karakterekből állhat: @/./+/-/_ "
-#: tests/registration/test_registration.py:110
msgid "A user with that username already exists."
msgstr "Ezzel a felhasználónévvel már létezik felhasználó."
-#: tests/registration/test_registration.py:131
msgid "The two password fields didn't match."
msgstr "A két jelszó nem egyezik!"
-#: volunteer_planner/settings/base.py:141
+msgid "English"
+msgstr "Angol"
+
msgid "German"
msgstr "Német"
-#: volunteer_planner/settings/base.py:142
-msgid "English"
-msgstr "Angol"
+msgid "Greek"
+msgstr ""
-#: volunteer_planner/settings/base.py:143
msgid "Hungarian"
msgstr "Magyar"
+
+msgid "Swedish"
+msgstr ""
diff --git a/locale/sv/LC_MESSAGES/django.po b/locale/sv/LC_MESSAGES/django.po
new file mode 100644
index 00000000..b18c0ab2
--- /dev/null
+++ b/locale/sv/LC_MESSAGES/django.po
@@ -0,0 +1,1344 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Translators:
+# Christoph, 2015
+# Jonna Appelqvist, 2015
+# Jonna Appelqvist, 2015
+# Linnéa Deurell , 2015
+msgid ""
+msgstr ""
+"Project-Id-Version: volunteer-planner.org\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-11-08 23:26+0100\n"
+"PO-Revision-Date: 2015-11-08 22:26+0000\n"
+"Last-Translator: Christoph\n"
+"Language-Team: Swedish (http://www.transifex.com/coders4help/volunteer-planner/language/sv/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: sv\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgid "first name"
+msgstr "Förnamn"
+
+msgid "email"
+msgstr "E-post"
+
+msgid "Accounts"
+msgstr "Konton"
+
+msgid "user account"
+msgstr "Användarkonto"
+
+msgid "user accounts"
+msgstr "Användarkonton"
+
+msgid "Save"
+msgstr "Spara"
+
+msgid "Username"
+msgstr "Användarnamn"
+
+msgid "First name"
+msgstr "Förnamn"
+
+msgid "Last name"
+msgstr "Efternamn"
+
+msgid "Email"
+msgstr "E-postadress"
+
+msgid "Edit Account"
+msgstr "Hantera konto"
+
+msgid "additional CSS"
+msgstr "ytterligare CSS"
+
+msgid "translation"
+msgstr "Översättning"
+
+msgid "translations"
+msgstr "Översättningar"
+
+msgid "No translation available"
+msgstr "Ingen översättning tillgänglig"
+
+msgid "additional style"
+msgstr "ytterligare stilar"
+
+msgid "additional flat page style"
+msgstr ""
+
+msgid "additional flat page styles"
+msgstr ""
+
+msgid "flat page"
+msgstr ""
+
+msgid "language"
+msgstr "Språk"
+
+msgid "title"
+msgstr "Rubrik"
+
+msgid "content"
+msgstr "Innehåll"
+
+msgid "flat page translation"
+msgstr ""
+
+msgid "flat page translations"
+msgstr ""
+
+msgid "View on site"
+msgstr "Visa på sida"
+
+msgid "Remove"
+msgstr "Ta bort"
+
+#, python-format
+msgid "Add another %(verbose_name)s"
+msgstr "Lägg till annan %(verbose_name)s"
+
+msgid "Edit this page"
+msgstr "Redigera denna sida"
+
+#, python-brace-format
+msgctxt "maps search url pattern"
+msgid "https://www.google.com/maps/place/{location}"
+msgstr "https://www.google.com/maps/place/{location}"
+
+#, python-brace-format
+msgctxt "maps directions url pattern"
+msgid "https://www.google.com/maps/dir/{departure}/{destination}/"
+msgstr "https://www.google.com/maps/dir/{departure}/{destination}/"
+
+msgid "subtitle"
+msgstr "Underrubrik"
+
+msgid "articletext"
+msgstr "Artikeltext"
+
+msgid "creation date"
+msgstr "Datum"
+
+msgid "news entry"
+msgstr ""
+
+msgid "news entries"
+msgstr ""
+
+msgid "Login"
+msgstr "Logga in"
+
+msgid "Start helping"
+msgstr "Börja hjälpa"
+
+msgid "Main page"
+msgstr "Startsida"
+
+msgid "Imprint"
+msgstr "Om webbplatsen"
+
+msgid "About"
+msgstr ""
+
+msgid "Supporter"
+msgstr ""
+
+msgid "Press"
+msgstr ""
+
+msgid "Contact"
+msgstr "Kontakt"
+
+msgid "F.A.Q."
+msgstr ""
+
+msgid "Frequently Asked Questions"
+msgstr "Vanliga frågor"
+
+msgctxt "FAQ Q1"
+msgid "How does volunteer-planner work?"
+msgstr "Hur fungerar volunteer-planner?"
+
+msgctxt "FAQ A1.1"
+msgid "Create an account."
+msgstr "Skapa ett konto."
+
+msgctxt "FAQ A1.2"
+msgid ""
+"Confirm your email address by clicking the activation link you've been sent."
+msgstr "Bekräfta din e-postadress genom att klicka på länken i mejlet vi skickat till dig."
+
+msgctxt "FAQ A1.3"
+msgid "Log in."
+msgstr "Logga in."
+
+msgctxt "FAQ A1.4"
+msgid "Choose a place to help and a shift and sign up to help."
+msgstr "Välj en plats och ett pass och anmäl dig för att hjälpa till."
+
+msgctxt "FAQ A1.5"
+msgid "Get there on time and start helping out."
+msgstr "Kom i tid och börja hjälpa till."
+
+msgctxt "FAQ Q2"
+msgid "How can I unsubscribe from a shift?"
+msgstr "Hur kan jag avanmäla mig från ett pass?"
+
+msgctxt "FAQ A2"
+msgid ""
+"No problem. Log-in again look for the shift you planned to do and "
+"unsubscribe. Then other volunteers can again subscribe."
+msgstr "Inga problem. Logga in igen och avanmäl dig på samma ställe som du anmälde dig till passet. Därmed får andra volontärer möjlighet att anmäla sig istället."
+
+msgctxt "FAQ Q3"
+msgid "Are there more shelters coming into volunteer-planner?"
+msgstr "Kommer det att komma upp fler boenden på volunteer-planner?"
+
+#, python-format
+msgctxt "FAQ A3"
+msgid ""
+"Yes! If you are a volunteer worker in a refugee shelter and they also want "
+"to use volunteer-planner please contact us via %(email_url)s."
+msgstr "Ja! Om du är volontär på ett flyktingboende som skulle vilja använda sig av volunteer-planner, kontakta oss via %(email_url)s. "
+
+msgctxt "FAQ Q4"
+msgid "I registered but I didn't get any activation link. What can I do?"
+msgstr "Jag har registrerat mig men inte fått någon aktiveringslänk. Vad kan jag göra?"
+
+msgctxt "FAQ A4"
+msgid ""
+"Please look into your email-spam folder. If you can't find something please "
+"wait another 30 minutes. Email delivery can sometimes take longer."
+msgstr "Vänligen kontrollera mappen för skräppost i din e-post. Om du inte hittar mejlet där, ber vi dig vänta i 30 minuter. Ibland kan det dröja lite längre innan det kommer fram."
+
+msgctxt "FAQ Q5"
+msgid "Do I have to be vaccinated to help at the camps/shelters?"
+msgstr "Behöver jag vara vaccinerad för att hjälpa till vid förläggningar/boenden?"
+
+msgctxt "FAQ A5"
+msgid ""
+"You are not supposed to be vaccinated. BUT: Where there are a lot of people "
+"deseases can flourish better."
+msgstr "Det krävs inte att du är vaccinerad. Men det kan rekommenderas, då sjukdomar sprids lättare på platser där många människor lever tätt inpå varandra."
+
+msgctxt "FAQ Q6"
+msgid "Who is volunteer-planner.org?"
+msgstr "Vilka är volunteer-planner.org?"
+
+msgctxt "FAQ A6"
+msgid ""
+"We are Coders4Help, a group of international volunteering programmers, "
+"designers and projectmanagers."
+msgstr "Vi är Coders4Help, en internationell volontärgrupp bestående av programmerare, designers och projektledare."
+
+msgctxt "FAQ Q7"
+msgid "How can I help you?"
+msgstr "Hur kan jag hjälpa er?"
+
+msgid "Facebook site"
+msgstr "Facebook"
+
+#, python-format
+msgctxt "FAQ A7"
+msgid ""
+"Currently we need help to translate, write texts and create awesome designs."
+" Want to help? Write a message on our %(facebook_link)s or send an "
+"%(email_url)s."
+msgstr "Just nu behöver vi hjälp med översättning, att skriva texter och skapa grym design. Vill du hjälpa till? Skriv ett meddelande till oss på %(facebook_link)s eller skicka ett %(email_url)s."
+
+msgid "I want to help!"
+msgstr "Jag vill hjälpa till!"
+
+msgid "Register and see where you can help"
+msgstr "Registrera dig och se var du kan hjälpa till"
+
+msgid "Organize volunteers!"
+msgstr "Organisera volontärer!"
+
+msgid "Register a shelter and organize volunteers"
+msgstr "Registrera ett boende och organisera volontärer"
+
+msgid "Places to help"
+msgstr "Platser att hjälpa till på"
+
+msgid "Registered Volunteers"
+msgstr "Registrerade volontärer"
+
+msgid "Worked Hours"
+msgstr "Arbetade timmar"
+
+msgid "What is it all about?"
+msgstr "Vad går det ut på?"
+
+msgid ""
+"You are a volunteer and want to help refugees? Volunteer-Planner.org shows "
+"you where, when and how to help directly in the field."
+msgstr "Vill du bli volontär och hjälpa flyktingar? Volunteer-planner.org visar dig när, var och hur du kan hjälpa till direkt där det behövs. "
+
+msgid ""
+"This platform is non-commercial and ads-free. An international team of "
+"field workers, programmers, project managers and designers are volunteering "
+"for this project and bring in their professional experience to make a "
+"difference.
"
+msgstr "Denna plattform är icke-komersiell och fri från reklam. Ett internationellt team av fältarbetare, programmerare, projektledare och designers arbetar ideellt med detta projekt, för att med sin samlade yrkeserfarenhet göra skillnad.
"
+
+msgid "You can help at these locations:"
+msgstr ""
+
+msgid "There are currently no places in need of help."
+msgstr ""
+
+msgid "Privacy Policy"
+msgstr "Integritetspolicy"
+
+msgctxt "Privacy Policy Sec1"
+msgid "Scope"
+msgstr "Tillämpningsområde"
+
+msgctxt "Privacy Policy Sec1 P1"
+msgid ""
+"This privacy policy informs the user of the collection and use of personal "
+"data on this website (herein after \"the service\") by the service provider,"
+" the Benefit e.V. (Wollankstr. 2, 13187 Berlin)."
+msgstr "Vår integritetspolicy informerar användaren av denna webbsida (nedan kallat \"tjänsten\") om hur personliga uppgifter behandlas och sparas av tillhandahållaren av tjänsten, Benefit e.V (Wollankstr. 2, 13187 Berlin)."
+
+msgctxt "Privacy Policy Sec1 P2"
+msgid ""
+"The legal basis for the privacy policy are the German Data Protection Act "
+"(Bundesdatenschutzgesetz, BDSG) and the German Telemedia Act "
+"(Telemediengesetz, TMG)."
+msgstr "Alla personliga uppgifter sparas och hanteras enligt den tyska personuppgiftslagen (Bundesdatenschutzgesetz, BDSG) och den tyska lagen för elektronisk kommunikation (Telemediengesetz, TMG)."
+
+msgctxt "Privacy Policy Sec2"
+msgid "Access data / server log files"
+msgstr "Tillgång till uppgifter / serverlogg"
+
+msgctxt "Privacy Policy Sec2 P1"
+msgid ""
+"The service provider (or the provider of his webspace) collects data on "
+"every access to the service and stores this access data in so-called server "
+"log files. Access data includes the name of the website that is being "
+"visited, which files are being accessed, the date and time of access, "
+"transfered data, notification of successful access, the type and version "
+"number of the user's web browser, the user's operating system, the referrer "
+"URL (i.e., the website the user visited previously), the user's IP address, "
+"and the name of the user's Internet provider."
+msgstr "Tillhandahållaren av tjänsten (alternativt tillhandahållaren av denna webbsida) samlar in uppgifter vid användande av tjänsten och lagrar dessa uppgifter i en s.k. serverlogg. Användaruppgifter inkluderar: namn på begärd webbsida, vilka filer som används, datum och tid för användande, överförd datamängd, avisering om framgångsrik användning och användarens webbläsartyp/version, operativsystem, HTTP-referenten (dvs. användarens senast besökta webbsida), IP-adress och internetleverantör."
+
+msgctxt "Privacy Policy Sec2 P2"
+msgid ""
+"The service provider uses the server log files for statistical purposes and "
+"for the operation, the security, and the enhancement of the provided service"
+" only. However, the service provider reserves the right to reassess the log "
+"files at any time if specific indications for an illegal use of the service "
+"exist."
+msgstr "Tillhandahållaren av tjänsten använder uppgifterna i serverloggen enbart i statistisk syfte och för den tillhandahållna tjänstens drift, säkerhet, och förbättring. Vid konkreta misstankar om olaglig användning av tjänsten reserverar sig tillhandahållaren av tjänsten för rätten att se över uppgifterna i serverloggen."
+
+msgctxt "Privacy Policy Sec3"
+msgid "Use of personal data"
+msgstr "Användande av personuppgifter"
+
+msgctxt "Privacy Policy Sec3 P1"
+msgid ""
+"Personal data is information which can be used to identify a person, i.e., "
+"all data that can be traced back to a specific person. Personal data "
+"includes the name, the e-mail address, or the telephone number of a user. "
+"Even data on personal preferences, hobbies, memberships, or visited websites"
+" counts as personal data."
+msgstr "Personliga uppgifter är information som kan användas för att identifiera en person, d.v.s. all information som kan härledas till en specifik individ: till exempel namn, e-postadress eller en användares telefonnummer. Även uppgifter om personliga preferenser, intressen, medlemsskap eller besökta webbsidor räknas som personliga uppgifter."
+
+msgctxt "Privacy Policy Sec3 P2"
+msgid ""
+"The service provider collects, uses, and shares personal data with third "
+"parties only if he is permitted by law to do so or if the user has given his"
+" permission."
+msgstr "Personuppgifter samlas in, används och delas av tillhandahållaren av tjänsten med tredje part i strikt enlighet med lagen, eller med användarens tillåtelse."
+
+msgctxt "Privacy Policy Sec4"
+msgid "Contact"
+msgstr "Kontakt"
+
+msgctxt "Privacy Policy Sec4 P1"
+msgid ""
+"When contacting the service provider (e.g. via e-mail or using a web contact"
+" form), the data provided by the user is stored for processing the inquiry "
+"and for answering potential follow-up inquiries in the future."
+msgstr "Vid kontakt med tillhandahållaren av tjänsten (t.ex. via e-post eller kontaktformulär) sparas användarens angivna uppgifter för att behandla förfrågan och besvara eventuella följdförfrågningar."
+
+msgctxt "Privacy Policy Sec5"
+msgid "Cookies"
+msgstr "Cookies"
+
+msgctxt "Privacy Policy Sec5 P1"
+msgid ""
+"Cookies are small files that are being stored on the user's device (personal"
+" computer, smartphone, or the like) with information specific to that "
+"device. They can be used for various purposes: Cookies may be used to "
+"improve the user experience (e.g. by storing and, hence, \"remembering\" "
+"login credentials). Cookies may also be used to collect statistical data "
+"that allows the service provider to analyse the user's usage of the website,"
+" aiming to improve the service."
+msgstr "Cookies är små filer som sparas på en enhet (personlig dator, smartphone o.dyl.). Dessa filer innehåller information specifik för just den enheten och kan användas i olika syften: Cookies får användas för att förbättra användarupplevelsen (t.ex. genom att spara och därigenom \"minnas\" inloggningsuppgifter). Cookies får också användas till att samla in statistisk information som tillåter leverantören att analysera hur webbsidan används och därigenom kunna förbättra tjänsten."
+
+msgctxt "Privacy Policy Sec5 P2"
+msgid ""
+"The user can customize the use of cookies. Most web browsers offer settings "
+"to restrict or even completely prevent the storing of cookies. However, the "
+"service provider notes that such restrictions may have a negative impact on "
+"the user experience and the functionality of the website."
+msgstr "Användaren kan själv reglera vilka cookies som ska användas. De flesta webbläsare erbjuder möjligheten att ändra i inställningarna, så att cookies delvis eller helt nekas. Om cookie-funktionen stängs av kan dock webbsidans användarupplevelse och funktionalitet påverkas negativt."
+
+#, python-format
+msgctxt "Privacy Policy Sec5 P3"
+msgid ""
+"The user can manage the use of cookies from many online advertisers by "
+"visiting either the US-american website %(us_url)s or the European website "
+"%(eu_url)s."
+msgstr "Användaren kan hantera cookies som används av många online-annonsörer genom att besöka den amerikanska webbsidan %(us_url)s eller den europeiska webbsidan %(eu_url)s."
+
+msgctxt "Privacy Policy Sec6"
+msgid "Registration"
+msgstr "Registrering"
+
+msgctxt "Privacy Policy Sec6 P1"
+msgid ""
+"The data provided by the user during registration allows for the usage of "
+"the service. The service provider may inform the user via e-mail about "
+"information relevant to the service or the registration, such as information"
+" on changes, which the service undergoes, or technical information (see also"
+" next section)."
+msgstr "De uppgifter som användaren angivit vid registreringen beviljar användandet av tjänsten. Tillhandahållaren av tjänsten får via e-post kontakta användaren med, för tjänsten eller registreringen, relevant information. Sådan information omfattar ändringar av tjänsten eller teknisk information (se även nästa avsnitt)."
+
+msgctxt "Privacy Policy Sec6 P2"
+msgid ""
+"The registration and user profile forms show which data is being collected "
+"and stored. They include - but are not limited to - the user's first name, "
+"last name, and e-mail address."
+msgstr "Vilka personuppgifter som sparas framkommer av de uppgifter som måste anges vid registreringen och som sedan kan hanteras under användarprofilen. Däribland ingår, men det är inte begränsat till, användarens förnamn, efternamn och e-postadress."
+
+msgctxt "Privacy Policy Sec7"
+msgid "E-mail notifications / Newsletter"
+msgstr "Avisering via e-post / Nyhetsbrev"
+
+msgctxt "Privacy Policy Sec7 P1"
+msgid ""
+"When registering an account with the service, the user gives permission to "
+"receive e-mail notifications as well as newsletter e-mails."
+msgstr "När ett användarkonto skapas godkänner användaren att denne skickas aviseringar och nyhetsbrev via e-post."
+
+msgctxt "Privacy Policy Sec7 P2"
+msgid ""
+"E-mail notifications inform the user of certain events that relate to the "
+"user's use of the service. With the newsletter, the service provider sends "
+"the user general information about the provider and his offered service(s)."
+msgstr "Med e-postaviseringar får användaren information om särskilda aktiviteter, baserad på användarens nyttjande av tjänsten. I nyhetsbrevet får användaren allmän information om leverantören och dennes tillhandahållna tjänst(er). "
+
+msgctxt "Privacy Policy Sec7 P3"
+msgid ""
+"If the user wishes to revoke his permission to receive e-mails, he needs to "
+"delete his user account."
+msgstr "Om användaren inte skulle vilja motta e-post måste han eller hon radera sitt användarkonto."
+
+msgctxt "Privacy Policy Sec8"
+msgid "Google Analytics"
+msgstr "Google Analytics"
+
+msgctxt "Privacy Policy Sec8 P1"
+msgid ""
+"This website uses Google Analytics, a web analytics service provided by "
+"Google, Inc. (“Google”). Google Analytics uses “cookies”, which are text "
+"files placed on the user's device, to help the website analyze how users use"
+" the site. The information generated by the cookie about the user's use of "
+"the website will be transmitted to and stored by Google on servers in the "
+"United States."
+msgstr "Denna webbsida använder sig av Google Analytics, en webbanalystjänst från Google Inc. (\"Google\"). Google Analytics använder sig av s.k. \"cookies\", textfiler som sparas på användarens enhet för att analysera hur webbsidan används. Den användarinformation som genereras av en cookie skickas och sparas på Googles servrar i USA."
+
+msgctxt "Privacy Policy Sec8 P2"
+msgid ""
+"In case IP-anonymisation is activated on this website, the user's IP address"
+" will be truncated within the area of Member States of the European Union or"
+" other parties to the Agreement on the European Economic Area. Only in "
+"exceptional cases the whole IP address will be first transfered to a Google "
+"server in the USA and truncated there. The IP-anonymisation is active on "
+"this website."
+msgstr "Om anonym IP-adress är aktiverad på denna webbsida kommer användarens IP-adress att förkortas inom området för den Europeiska unionens medlemsstater eller andra avtalsparter inom det Europeiska ekonomiska samarbetsområdet. Endast i särskilda undantagsfall kommer IP-adressen i sin helhet att överföras till en Google-server i USA och förkortas där. IP-anonymisering är aktiverad på denna webbsida."
+
+msgctxt "Privacy Policy Sec8 P3"
+msgid ""
+"Google will use this information on behalf of the operator of this website "
+"for the purpose of evaluating your use of the website, compiling reports on "
+"website activity for website operators and providing them other services "
+"relating to website activity and internet usage."
+msgstr "Google använder denna information i syfte att utvärdera hur du använder webbsidan, att sammanställa aktivitetsrapporter till webbsidans ägare och tillhandahålla ägaren ytterligare tjänster i samband med aktiviteter på webbsidan och internetanvändning."
+
+#, python-format
+msgctxt "Privacy Policy Sec8 P4"
+msgid ""
+"The IP-address, that the user's browser conveys within the scope of Google "
+"Analytics, will not be associated with any other data held by Google. The "
+"user may refuse the use of cookies by selecting the appropriate settings on "
+"his browser, however it is to be noted that if the user does this he may not"
+" be able to use the full functionality of this website. He can also opt-out "
+"from being tracked by Google Analytics with effect for the future by "
+"downloading and installing Google Analytics Opt-out Browser Addon for his "
+"current web browser: %(optout_plugin_url)s."
+msgstr "IP-adressen som skickas av användarens webbläsare inom tillämpningsområdet för Google Analytics kommer inte att länkas samman med annan data som innehas av Google. Användaren kan motsätta sig användandet av cookies genom att ändra inställningarna i webbläsaren. Observera att det i detta fall kan leda till en försämring av webbsidans funktionalitet. Användaren kan även begära att undantas från att bli spårad av Google Analytics med framtida verkan genom att ladda ner och installera ett inaktiverings-add-on, Google Analytics Opt-out Browser Add-on, för den nuvarande webbläsaren: %(optout_plugin_url)s."
+
+msgid "click this link"
+msgstr "klicka på denna länk"
+
+#, python-format
+msgctxt "Privacy Policy Sec8 P5"
+msgid ""
+"As an alternative to the browser Addon or within browsers on mobile devices,"
+" the user can %(optout_javascript)s in order to opt-out from being tracked "
+"by Google Analytics within this website in the future (the opt-out applies "
+"only for the browser in which the user sets it and within this domain). An "
+"opt-out cookie will be stored on the user's device, which means that the "
+"user will have to click this link again, if he deletes his cookies."
+msgstr "Som ett alternativ till en webbläsar-add-on eller för webbläsare i mobila enheter kan användaren %(optout_javascript)s för att, vid framtida användande av webbsidan, välja att lägga till ett undantag från spårning av Google Analytics (detta undantag gäller endast för den webbläsare som ställts in på sådant sätt och för denna domän). En s.k. \"opt-out cookie\" kommer att sparas på användarens enhet. Om användaren skulle rensa alla sina cookies innebär detta att denne måste lägga till undantaget via ovanstående länk på nytt. "
+
+msgctxt "Privacy Policy Sec9"
+msgid "Revocation, Changes, Corrections, and Updates"
+msgstr "Återkallelser, ändringar, rättelser och uppdateringar"
+
+msgctxt "Privacy Policy Sec9 P1"
+msgid ""
+"The user has the right to be informed upon application and free of charge, "
+"which personal data about him has been stored. Additionally, the user can "
+"ask for the correction of uncorrect data, as well as for the suspension or "
+"even deletion of his personal data as far as there is no legal obligation to"
+" retain that data."
+msgstr "Användaren har vid tillämpning av cookies rätt till att kostnadsfritt bli informerad om vilka personliga uppgifter som sparats. Användaren kan även begära att felaktiga uppgifter rättas, eller att lagringen av dennes personliga uppgifter upphävs eller raderas, såvitt det inte finns någon laglig grund till att lagra uppgifterna."
+
+msgctxt "Privacy Policy Credit"
+msgid ""
+"Based on the privacy policy sample of the lawyer Thomas Schwenke - I LAW it"
+msgstr "Baserad på förlagan till policy för integritetsskydd av advokat Thomas Schwenke – I LAW it"
+
+msgid "advantages"
+msgstr "fördelar"
+
+msgid "save time"
+msgstr "spara tid"
+
+msgid "improve selforganization of the volunteers"
+msgstr "förbättra självorganiseringen av volontärer"
+
+msgid ""
+"\n"
+" volunteers split themselves up more effectively into shifts,\n"
+" temporary shortcuts can be anticipated by helpers themselves more easily\n"
+" "
+msgstr "\nvolontärer fördelar sig mellan pass mer effektivt,\nhjälpare kan på egen hand enkelt få en överblick över var det finns för få som hjälper till"
+
+msgid ""
+"\n"
+" shift plans can be given to the security personnel\n"
+" or coordinating persons by an auto-mailer\n"
+" every morning\n"
+" "
+msgstr "\nscheman för pass kan ges till säkerhetspersonalen\neller samordnande personer via automatiskt e-postutskick\nvarje morgon"
+
+msgid ""
+"\n"
+" the more shelters and camps are organized with us, the more volunteers are joining\n"
+" and all facilities will benefit from a common pool of motivated volunteers\n"
+" "
+msgstr "\nju fler boenden och förläggningar som använder sig av plattformen, ju kändare blir den.\nJu kändare den blir, desto fler frivilliga kommer att upptäcka den och kunna hjälpa till"
+
+msgid "for free without costs"
+msgstr "kostnadsfritt"
+
+msgid "The right help at the right time at the right place"
+msgstr "Rätt hjälp i rätt tid och på rätt plats"
+
+msgid ""
+"\n"
+" Many people want to help! But often it's not so easy to figure out where, when and how one can help.\n"
+" volunteer-planner tries to solve this problem! \n"
+"
\n"
+" "
+msgstr "\nMånga människor vill hjälpa till! Men ofta är det inte enkelt att veta hur, var och när det behövs.\nvolunteer-planner vill lösa detta problem!\n
"
+
+msgid "for free, ad free"
+msgstr "Kostnadsfritt. Reklamfritt."
+
+msgid ""
+"\n"
+"
The platform was build by a group of volunteering professionals in the area of software development, project management, design,\n"
+" and marketing. The code is open sourced for non-commercial use. Private data (emailaddresses, profile data etc.) will be not given to any third party.
\n"
+" "
+msgstr "\n Denna plattform är skapad av ett team frivilliga hjälpare, yrkesverksamma inom områdena programvaruutveckling, projektledning, design\noch marknadsföring. Den är gjord med öppen källkod och får inte användas i kommersiellt syfte. Privatuppgifter (e-postadress, profilinformation o.s.v.) ges inte vidare till tredje part.
"
+
+msgid "contact us!"
+msgstr "Kontakta oss!"
+
+msgid ""
+"\n"
+" ...maybe with an attached draft of the shifts you want to see on volunteer-planner. Please write to onboarding@volunteer-planner.org \n"
+" "
+msgstr "\n...kanske med ett bifogat utkast över de pass du vill se på volunteer-planner.\nVänligen skriv till onboarding@volunteer-planner.org "
+
+msgid "edit"
+msgstr "Redigera"
+
+msgid "short description"
+msgstr "Kort beskrivning"
+
+msgid "description"
+msgstr "Beskrivning"
+
+msgid "contact info"
+msgstr "Kontaktinformation"
+
+msgid "by invitation"
+msgstr ""
+
+msgid "anyone (approved by manager)"
+msgstr ""
+
+msgid "anyone"
+msgstr ""
+
+msgid "rejected"
+msgstr ""
+
+msgid "pending"
+msgstr ""
+
+msgid "approved"
+msgstr ""
+
+msgid "admin"
+msgstr "Admin"
+
+msgid "manager"
+msgstr "Chef"
+
+msgid "member"
+msgstr "Medlem"
+
+msgid "role"
+msgstr "Ställning"
+
+msgid "status"
+msgstr ""
+
+msgid "name"
+msgstr "Namn"
+
+msgid "address"
+msgstr "Adress"
+
+msgid "slug"
+msgstr ""
+
+msgid "join mode"
+msgstr ""
+
+msgid "Who can join this organization?"
+msgstr ""
+
+msgid "organization"
+msgstr "Organisation"
+
+msgid "organizations"
+msgstr "Organisationer"
+
+#, python-brace-format
+msgid "{name}"
+msgstr "{name}"
+
+msgid "place"
+msgstr "Plats"
+
+msgid "postal code"
+msgstr "Postnummer"
+
+msgid "Show on map of all facilities"
+msgstr "Visa på karta över alla anläggningar"
+
+msgid "latitude"
+msgstr "Latitud"
+
+msgid "longitude"
+msgstr "Longitud"
+
+msgid "Who can join this facility?"
+msgstr ""
+
+msgid "facility"
+msgstr "Anläggning"
+
+msgid "facilities"
+msgstr "Anläggningar"
+
+msgid "organization member"
+msgstr "Organisationsmedlem"
+
+msgid "organization members"
+msgstr "Organisationsmedlemmar"
+
+#, python-brace-format
+msgid "{username} at {organization_name} ({user_role})"
+msgstr ""
+
+msgid "facility member"
+msgstr "Anläggningsmedlem"
+
+msgid "facility members"
+msgstr "Anläggningsmedlemmar"
+
+#, python-brace-format
+msgid "{username} at {facility_name} ({user_role})"
+msgstr ""
+
+msgid "workplace"
+msgstr "Arbetsplats"
+
+msgid "workplaces"
+msgstr "Arbetsplatser"
+
+msgid "task"
+msgstr "Uppgift"
+
+msgid "tasks"
+msgstr "Uppgifter"
+
+#, python-format
+msgid "Members in %(facility)s"
+msgstr ""
+
+msgid "Role"
+msgstr ""
+
+msgid "Actions"
+msgstr ""
+
+msgid "Block"
+msgstr ""
+
+msgid "Accept"
+msgstr ""
+
+#, python-format
+msgid "Hello %(username)s,"
+msgstr ""
+
+#, python-format
+msgid ""
+"Your membership request at %(facility_name)s was approved. You now may sign "
+"up for restricted shifts at this facility."
+msgstr ""
+
+msgid ""
+"Yours,\n"
+"the volunteer-planner.org Team"
+msgstr ""
+
+msgid "Helpdesk"
+msgstr "Support"
+
+msgid "Open Shifts"
+msgstr "Lediga pass"
+
+msgid "News"
+msgstr "Nyheter"
+
+msgid "Facilities"
+msgstr "Boenden"
+
+msgid "Show details"
+msgstr "Visa detaljer"
+
+msgid "volunteer-planner.org: Membership approved"
+msgstr ""
+
+msgid "country"
+msgstr "Land"
+
+msgid "countries"
+msgstr "Länder"
+
+msgid "region"
+msgstr "Region"
+
+msgid "regions"
+msgstr "Regioner"
+
+msgid "area"
+msgstr "Område"
+
+msgid "areas"
+msgstr "Områden"
+
+msgid "places"
+msgstr "Platser"
+
+msgid "number of volunteers"
+msgstr "Antal volontärer"
+
+msgid "volunteers"
+msgstr "Volontärer"
+
+msgid "Scheduler"
+msgstr "Schemaläggare"
+
+msgid "number of needed volunteers"
+msgstr "Antal volontärer som behövs"
+
+msgid "starting time"
+msgstr "Starttid"
+
+msgid "ending time"
+msgstr "Sluttid"
+
+msgid "members only"
+msgstr ""
+
+msgid "allow only members to help"
+msgstr ""
+
+msgid "shift"
+msgstr "Pass"
+
+msgid "shifts"
+msgstr "Pass"
+
+#, python-brace-format
+msgid "the next day"
+msgid_plural "after {number_of_days} days"
+msgstr[0] "nästa dag"
+msgstr[1] "efter {number_of_days} dagar"
+
+msgid "shift helper"
+msgstr "Passhjälpare"
+
+msgid "shift helpers"
+msgstr "Passhjälpare"
+
+msgid "Show on Google Maps"
+msgstr "Visa i Google Maps"
+
+msgctxt "helpdesk shifts heading"
+msgid "shifts"
+msgstr "Pass"
+
+#, python-format
+msgid "There are no upcoming shifts available for %(geographical_name)s."
+msgstr "Det finns inga kommande pass lediga för %(geographical_name)s."
+
+msgid "You can help in the following facilities"
+msgstr "Du kan hjälpa till på följande platser"
+
+msgid "filter"
+msgstr "filter"
+
+msgid "see more"
+msgstr "se mer"
+
+msgid "open shifts"
+msgstr "Lediga pass"
+
+#, python-format
+msgctxt "title with facility"
+msgid "Schedule for %(facility_name)s"
+msgstr "Schema för %(facility_name)s"
+
+#, python-format
+msgid "%(starting_time)s - %(ending_time)s"
+msgstr ""
+
+#, python-format
+msgctxt "title with date"
+msgid "Schedule for %(schedule_date)s"
+msgstr "Schema för %(schedule_date)s"
+
+msgid "Link"
+msgstr ""
+
+msgid "Time"
+msgstr "Tid"
+
+msgid "Helpers"
+msgstr "Hjälpare"
+
+msgid "Start"
+msgstr "Början"
+
+msgid "End"
+msgstr "Slut"
+
+msgid "Required"
+msgstr "Behov"
+
+msgid "Status"
+msgstr "Status"
+
+msgid "Users"
+msgstr "Användare"
+
+msgid "You"
+msgstr "Du"
+
+#, python-format
+msgid "%(slots_left)s more"
+msgstr "%(slots_left)s till"
+
+msgid "Covered"
+msgstr "Täckt"
+
+msgid "Drop out"
+msgstr "Lämna pass"
+
+msgid "Sign up"
+msgstr "Delta"
+
+msgid "Membership pending"
+msgstr ""
+
+msgid "Membership rejected"
+msgstr ""
+
+msgid "Become member"
+msgstr ""
+
+#, python-format
+msgid ""
+"\n"
+"Hello,\n"
+"\n"
+"we're sorry, but we had to cancel the following shift at request of the organizer:\n"
+"\n"
+"%(shift_title)s, %(location)s\n"
+"%(from_date)s from %(from_time)s to %(to_time)s o'clock\n"
+"\n"
+"This is an automaticly generated e-mail. If you have any questions, please contact the facility directly.\n"
+"\n"
+"Yours,\n"
+"\n"
+"the volunteer-planner.org team\n"
+msgstr ""
+
+msgid "Members only"
+msgstr ""
+
+#, python-format
+msgid ""
+"\n"
+"Hello,\n"
+"\n"
+"we're sorry, but we had to change the times of the following shift at request of the organizer:\n"
+"\n"
+"%(shift_title)s, %(location)s\n"
+"%(old_from_date)s from %(old_from_time)s to %(old_to_time)s o'clock\n"
+"\n"
+"The new shift times are:\n"
+"\n"
+"%(from_date)s from %(from_time)s to %(to_time)s o'clock\n"
+"\n"
+"If you can not help at the new times any longer, please cancel your attendance at volunteer-planner.org.\n"
+"\n"
+"This is an automaticly generated e-mail. If you have any questions, please contact the facility directly.\n"
+"\n"
+"Yours,\n"
+"\n"
+"the volunteer-planner.org team\n"
+msgstr ""
+
+msgid "The submitted data was invalid."
+msgstr "Den angivna informationen är ogiltig."
+
+msgid "User account does not exist."
+msgstr "Användarkontot finns inte."
+
+msgid "A membership request has been sent."
+msgstr ""
+
+msgid ""
+"We can't add you to this shift because you've already agreed to other shifts"
+" at the same time:"
+msgstr "Vi kan inte lägga till dig till detta pass, då du redan är anmäld till ett annat pass vid samma tidpunkt:"
+
+msgid "We can't add you to this shift because there are no more slots left."
+msgstr ""
+
+msgid "You were successfully added to this shift."
+msgstr "Du har nu lagts till detta pass."
+
+#, python-brace-format
+msgid "You already signed up for this shift at {date_time}."
+msgstr "Du har redan anmält dig till detta pass den {date_time}."
+
+msgid "You successfully left this shift."
+msgstr "Du har nu avanmält dig från detta pass."
+
+#, python-brace-format
+msgid "A shift already exists at {date}"
+msgid_plural "{num_shifts} shifts already exists at {date}"
+msgstr[0] "Ett pass existerar redan den {date}"
+msgstr[1] "{num_shifts} pass existerar redan den {date}"
+
+#, python-brace-format
+msgid "{num_shifts} shift was added to {date}"
+msgid_plural "{num_shifts} shifts were added to {date}"
+msgstr[0] "{num_shifts} pass har lagts till den {date}"
+msgstr[1] "{num_shifts} pass har lagts till den {date}"
+
+msgid "Something didn't work. Sorry about that."
+msgstr "Oj! Vi ber om ursäkt, men något gick fel."
+
+msgid "slots"
+msgstr "Platser"
+
+msgid "from"
+msgstr "från"
+
+msgid "to"
+msgstr "till"
+
+msgid "schedule templates"
+msgstr "Utkast till scheman"
+
+msgid "schedule template"
+msgstr "Utkast till schema"
+
+msgid "days"
+msgstr "dagar"
+
+msgid "shift templates"
+msgstr "byt utkast"
+
+msgid "shift template"
+msgstr "byt utkast"
+
+#, python-brace-format
+msgid "{task_name} - {workplace_name}"
+msgstr "{task_name} - {workplace_name}"
+
+#, python-brace-format
+msgid "{task_name}"
+msgstr "{task_name}"
+
+msgid "Home"
+msgstr "Hem"
+
+msgid "Apply Template"
+msgstr "Använd utkast"
+
+msgid "no workplace"
+msgstr "utan arbetsplats"
+
+msgid "apply"
+msgstr "Använd"
+
+msgid "Select a date"
+msgstr "Välj ett datum"
+
+msgid "Continue"
+msgstr ""
+
+msgid "Select shift templates"
+msgstr "Välj byt utkast"
+
+msgid "Please review and confirm shifts to create"
+msgstr ""
+
+msgid "Apply"
+msgstr ""
+
+msgid "Apply and select new date"
+msgstr ""
+
+msgid "Save and apply template"
+msgstr "Spara och använd utkast"
+
+msgid "Delete"
+msgstr "Radera"
+
+msgid "Save as new"
+msgstr "Spara som ny"
+
+msgid "Save and add another"
+msgstr "Spara och lägg till ny"
+
+msgid "Save and continue editing"
+msgstr "Spara och fortsätt redigera"
+
+msgid "Delete?"
+msgstr "Radera?"
+
+msgid "Change"
+msgstr "Ändra"
+
+msgid "last name"
+msgstr "Efternamn"
+
+msgid "position"
+msgstr "Ställning"
+
+msgid "organisation"
+msgstr "Organisation"
+
+#, python-format
+msgctxt "shift today title"
+msgid "Schedule for %(organization_name)s on %(date)s"
+msgstr "Schema för %(organization_name)s den %(date)s"
+
+msgid "All data is private and not supposed to be given away!"
+msgstr "Samtliga uppgifter behandlas konfidentiellt och får inte lämnas ut till tredje part!"
+
+#, python-format
+msgid ""
+"from %(start_time)s to %(end_time)s following %(volunteer_count)s volunteers"
+" have signed up:"
+msgstr "Följande %(volunteer_count)s volontärer har anmält sig från klockan %(start_time)s till %(end_time)s:"
+
+#, python-format
+msgid "Questions? Get in touch: %(mailto_link)s"
+msgstr "Frågor? Hör av dig: %(mailto_link)s"
+
+msgid "Manage"
+msgstr ""
+
+msgid "Members"
+msgstr ""
+
+msgid "Toggle navigation"
+msgstr "Växla navigering"
+
+msgid "FAQ"
+msgstr "Vanliga frågor"
+
+msgid "Account"
+msgstr "Konto"
+
+msgid "Help"
+msgstr "Hjälp"
+
+msgid "Logout"
+msgstr "Logga ut"
+
+msgid "Admin"
+msgstr "Admin"
+
+msgid "Regions"
+msgstr "Regioner"
+
+msgid "Activation complete"
+msgstr "Aktivering slutförd"
+
+msgid "Activation problem"
+msgstr "Problem vid aktivering"
+
+msgctxt ""
+"login link title in registration confirmation success text 'You may now "
+"%(login_link)s'"
+msgid "login"
+msgstr "Logga in"
+
+#, python-format
+msgid ""
+"Thanks %(account)s, activation complete! You may now %(login_link)s using "
+"the username and password you set at registration."
+msgstr "Tack %(account)s, aktiveringen är slutförd! Du kan nu %(login_link)s med ditt användarnamn och lösenord. "
+
+msgid ""
+"Oops – Either you activated your account already, or the activation "
+"key is invalid or has expired."
+msgstr "Hoppsan – Antingen har du redan aktiverat ditt konto, eller har du använt dig av en ogiltig eller utgången aktiveringsnyckel."
+
+msgid "Activation successful!"
+msgstr "Aktiveringen har slutförts! "
+
+msgctxt "Activation successful page"
+msgid "Thank you for signing up."
+msgstr "Tack för att du registrerat dig."
+
+msgctxt "Login link text on activation success page"
+msgid "You can login here."
+msgstr "Här kan du logga in."
+
+#, python-format
+msgid ""
+"\n"
+"Hello %(user)s,\n"
+"\n"
+"thank you very much that you want to help! Just one more step and you'll be ready to start volunteering!\n"
+"\n"
+"Please click the following link to finish your registration at volunteer-planner.org:\n"
+"\n"
+"http://%(site_domain)s%(activation_key_url)s \n"
+"\n"
+"This link will expire in %(expiration_days)s days.\n"
+"\n"
+"Yours,\n"
+"\n"
+"the volunteer-planner.org team\n"
+msgstr ""
+
+#, python-format
+msgid ""
+"\n"
+"Hello %(user)s,\n"
+"\n"
+"thank you very much that you want to help! Just one more step and you'll be ready to start volunteering!\n"
+"\n"
+"Please click the following link to finish your registration at volunteer-planner.org:\n"
+"\n"
+"http://%(site_domain)s%(activation_key_url)s\n"
+"\n"
+"This link will expire in %(expiration_days)s days.\n"
+"\n"
+"Yours,\n"
+"\n"
+"the volunteer-planner.org team\n"
+msgstr ""
+
+msgid "Your volunteer-planner.org registration"
+msgstr ""
+
+msgid "Your username and password didn't match. Please try again."
+msgstr "Ditt användarnamn och lösenord stämmer inte överens. Vänligen försök igen."
+
+msgid "Password"
+msgstr "Lösenord"
+
+msgid "Forgot your password?"
+msgstr "Glömt ditt lösenord?"
+
+msgid "Help and sign-up"
+msgstr "Logga in och hjälp till"
+
+msgid "Password changed"
+msgstr "Lösenord ändrat"
+
+msgid "Password successfully changed!"
+msgstr "Lösenordet har nu ändrats!"
+
+msgid "Change Password"
+msgstr "Ändra lösenord"
+
+msgid "Email address"
+msgstr "E-postadress"
+
+msgid "Change password"
+msgstr "Ändra lösenord"
+
+msgid "Password reset complete"
+msgstr "Lösenordet har återställts"
+
+msgctxt "login link title reset password complete page"
+msgid "log in"
+msgstr "Logga in"
+
+#, python-format
+msgctxt "reset password complete page"
+msgid "Your password has been reset! You may now %(login_link)s again."
+msgstr "Ditt lösenord har återställts! Du kan nu %(login_link)s igen."
+
+msgid "Enter new password"
+msgstr "Ange nytt lösenord"
+
+msgid "Enter your new password below to reset your password"
+msgstr "För att återställa lösenordet anger du ditt nya lösenord nedan"
+
+msgid "Password reset"
+msgstr "Lösenord återställt"
+
+msgid "We sent you an email with a link to reset your password."
+msgstr "Vi har skickat ett mejl till dig med en länk för att återställa ditt lösenord. "
+
+msgid "Please check your email and click the link to continue."
+msgstr "Kontrollera din e-post och klicka på länken för att fortsätta."
+
+#, python-format
+msgid ""
+"You are receiving this email because you (or someone pretending to be you)\n"
+"requested that your password be reset on the %(domain)s site. If you do not\n"
+"wish to reset your password, please ignore this message.\n"
+"\n"
+"To reset your password, please click the following link, or copy and paste it\n"
+"into your web browser:"
+msgstr "Du får detta mejl för att du (eller någon som utger sig för att vara du)\nbegärt att återställa ditt lösenord på %(domain)s sida. Om du inte\nvill återställa ditt lösenord kan du bortse från detta meddelande.\n\nKlicka på följande länk för att återställa ditt lösenord, eller kopiera och klistra in länken\ni din webbläsare:"
+
+#, python-format
+msgid ""
+"\n"
+"Your username, in case you've forgotten: %(username)s\n"
+"\n"
+"Best regards,\n"
+"%(site_name)s Management\n"
+msgstr "\nSkulle du ha glömt ditt användarnamn, så är det: %(username)s\n\nVänliga hälsningar,\n%(site_name)s team\n"
+
+msgid "Reset password"
+msgstr "Återställ lösenord"
+
+msgid "No Problem! We'll send you instructions on how to reset your password."
+msgstr "Inga problem! Vi skickar dig instruktioner för hur du återställer ditt lösenord."
+
+msgid "Activation email sent"
+msgstr "Ett aktiveringsmejl har skickats"
+
+msgid "An activation mail will be sent to you email address."
+msgstr "Ett aktiveringsmejl kommer att skickas till din e-postadress."
+
+msgid ""
+"Please confirm registration with the link in the email. If you haven't "
+"received it in 10 minutes, look for it in your spam folder."
+msgstr "Vänligen bekräfta registreringen genom att klicka på länken i mejlet. Om du inte mottagit ett mejl inom 10 minuter, titta efter i mappen för skräppost. "
+
+msgid "Register for an account"
+msgstr "Skapa ett konto"
+
+msgid "Registration"
+msgstr "Anmälan"
+
+msgid "Username already exists. Please choose a different username."
+msgstr "Användarnamnet finns redan. Vänligen välj ett annat användarnamn."
+
+msgid "Don't use spaces or special characters"
+msgstr "Använd inte mellanrum eller specialtecken"
+
+msgid "Repeat password"
+msgstr "Upprepa lösenord"
+
+msgid "Sign-up"
+msgstr "Skapa konto"
+
+msgid "This field is required."
+msgstr "Detta fält är nödvändigt."
+
+msgid ""
+"Enter a valid username. This value may contain only letters, numbers and "
+"@/./+/-/_ characters."
+msgstr "Ange ett giltigt användarnamn. Det får endast bestå av bokstäver, siffror och följande tecken: @/./+/-/_. "
+
+msgid "A user with that username already exists."
+msgstr "Det finns redan en användare med det här användarnamnet."
+
+msgid "The two password fields didn't match."
+msgstr "De två lösenordsfälten stämmer inte överens."
+
+msgid "English"
+msgstr "Engelska"
+
+msgid "German"
+msgstr "Tyska"
+
+msgid "Greek"
+msgstr ""
+
+msgid "Hungarian"
+msgstr "Ungerska"
+
+msgid "Swedish"
+msgstr "Svenska"
diff --git a/manage.py b/manage.py
index 796aba1b..b6035051 100755
--- a/manage.py
+++ b/manage.py
@@ -4,7 +4,7 @@
import sys
if __name__ == "__main__":
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "volunteer_planner.settings.local")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "volunteer_planner.settings.local_postgres")
from django.core.management import execute_from_command_line
diff --git a/news/admin.py b/news/admin.py
index a645e37c..6b6adc73 100755
--- a/news/admin.py
+++ b/news/admin.py
@@ -1,19 +1,34 @@
+# coding: utf-8
+
from django.contrib import admin
from django import forms
-# Register your models here.
from ckeditor.widgets import CKEditorWidget
-from .models import News
+
+from . import models
class NewsAdminForm(forms.ModelForm):
class Meta:
- model = News
+ model = models.NewsEntry
fields = '__all__'
+
text = forms.CharField(widget=CKEditorWidget())
+@admin.register(models.NewsEntry)
class NewsAdmin(admin.ModelAdmin):
form = NewsAdminForm
- readonly_fields = ('slug',)
-admin.site.register(News, NewsAdmin)
+ list_display = (
+ 'title',
+ 'subtitle',
+ 'slug',
+ 'creation_date',
+ 'facility',
+ 'organization'
+ )
+ list_filter = (
+ 'facility',
+ 'organization'
+ )
+ readonly_fields = ('slug',)
diff --git a/news/migrations/0002_rename_news_model.py b/news/migrations/0002_rename_news_model.py
new file mode 100644
index 00000000..74928b46
--- /dev/null
+++ b/news/migrations/0002_rename_news_model.py
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('organizations', '0007_auto_20151023_2129'),
+ ('news', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.RenameModel(
+ old_name='News',
+ new_name='NewsEntry'
+ ),
+ migrations.AlterModelOptions(
+ name='newsentry',
+ options={'ordering': ('facility', 'organization', 'creation_date'),
+ 'verbose_name': 'news entry',
+ 'verbose_name_plural': 'news entries'},
+ ),
+ migrations.AlterField(
+ model_name='newsentry',
+ name='facility',
+ field=models.ForeignKey(related_name='news_entries', blank=True,
+ to='organizations.Facility', null=True),
+ ),
+ migrations.AlterField(
+ model_name='newsentry',
+ name='organization',
+ field=models.ForeignKey(related_name='news_entries', blank=True,
+ to='organizations.Organization', null=True),
+ ),
+ migrations.AlterField(
+ model_name='newsentry',
+ name='text',
+ field=models.TextField(verbose_name='articletext'),
+ ),
+ ]
diff --git a/news/models.py b/news/models.py
index 35143600..2df66be9 100755
--- a/news/models.py
+++ b/news/models.py
@@ -5,29 +5,46 @@
from django.template.defaultfilters import slugify
-class News(models.Model):
+class NewsEntry(models.Model):
"""
facilities and organizations can publish news.
TODO: News are shown in appropriate organization templates
"""
+ title = models.CharField(max_length=255,
+ verbose_name=_("title"))
+
+ subtitle = models.CharField(max_length=255,
+ verbose_name=_("subtitle"),
+ null=True,
+ blank=True)
+
+ text = models.TextField(verbose_name=_("articletext"))
+
+ slug = models.SlugField(auto_created=True, max_length=255)
+
creation_date = models.DateField(auto_now=True,
verbose_name=_("creation date"))
- title = models.CharField(max_length=255, verbose_name=_("title"))
- subtitle = models.CharField(max_length=255, verbose_name=_("subtitle"),
- null=True, blank=True)
- text = models.TextField(max_length=20055, verbose_name=_("articletext"))
- slug = models.SlugField(auto_created=True, max_length=255)
- facility = models.ForeignKey('organizations.Facility', null=True,
+
+ facility = models.ForeignKey('organizations.Facility',
+ related_name='news_entries',
+ null=True,
blank=True)
- organization = models.ForeignKey('organizations.Organization', null=True,
+
+ organization = models.ForeignKey('organizations.Organization',
+ related_name='news_entries',
+ null=True,
blank=True)
+ class Meta:
+ verbose_name = _('news entry')
+ verbose_name_plural = _('news entries')
+ ordering = ('facility', 'organization', 'creation_date')
+
def save(self, *args, **kwargs):
if not self.id:
# Newly created object, so set slug
self.slug = slugify(self.title)
-
- super(News, self).save(*args, **kwargs)
+ super(NewsEntry, self).save(*args, **kwargs)
def __unicode__(self):
return u'{}'.format(self.title)
diff --git a/non_logged_in_area/static/css/custom.css b/non_logged_in_area/static/css/custom.css
index a72528bf..ad5ed875 100644
--- a/non_logged_in_area/static/css/custom.css
+++ b/non_logged_in_area/static/css/custom.css
@@ -274,6 +274,10 @@ li.check-icon:before {
color: #fff;
}
+#footer-nav{
+ z-index: 1;
+}
+
#footer-nav ul {
list-style: none;
margin: 0;
diff --git a/non_logged_in_area/templates/base_non_logged_in.html b/non_logged_in_area/templates/base_non_logged_in.html
index 924dad86..e3a02160 100644
--- a/non_logged_in_area/templates/base_non_logged_in.html
+++ b/non_logged_in_area/templates/base_non_logged_in.html
@@ -15,7 +15,9 @@
-
+
+
+
@@ -23,6 +25,10 @@
+ {% block additional_header %}
+
+ {% endblock %}
+
+
{# There's a issue with Nexus 4 not working with the collapsible hamburger in BS4 #}
+
+ {% include "../templates/partials/switch_language.html" with nav_item_tag="span" %}
+
{% trans "Login" %}
@@ -72,42 +82,29 @@
-
-
-
-
{% trans "supported by corporate volunteers from" %}
-
-
-
-
-
-
-{#
#}
-{#
#}
-
-
-
-
diff --git a/non_logged_in_area/templates/home.html b/non_logged_in_area/templates/home.html
index 75241e12..ac35efd2 100644
--- a/non_logged_in_area/templates/home.html
+++ b/non_logged_in_area/templates/home.html
@@ -95,22 +95,25 @@ {% trans "What is it all about?" %}
-
{% trans "You can help at this locations:" %}
-
- {% for facility_in_area in facilities_by_area %}
- {% comment %}
- If we get many facilities, we can always make this a collapsed-by-default
- list. At the moment, there's not enough and it's more usable and SEO
- friendly to show all.
- {% endcomment %}
- {{ facility_in_area.grouper }}
-
- {% for facility in facility_in_area.list %}
- {{ facility.name }}
- {% if not forloop.last %}•{% endif %}
- {% endfor %}
-
- {% endfor %}
+
{% trans "You can help at these locations:" %}
+ {% if facilities_by_area %}
+ {% for facility_in_area in facilities_by_area %}
+ {% comment %}
+ If we get many facilities, we can always make this a collapsed-by-default
+ list. At the moment, there's not enough and it's more usable and SEO
+ friendly to show all.
+ {% endcomment %}
+ {{ facility_in_area.grouper }}
+
+ {% for facility in facility_in_area.list %}
+ {{ facility.name }}
+ {% if not forloop.last %}•{% endif %}
+ {% endfor %}
+
+ {% endfor %}
+ {% else %}
+ {% trans "There are currently no places in need of help." %}
+ {% endif %}
diff --git a/organizations/admin.py b/organizations/admin.py
index 5e767b5d..ec1a7510 100644
--- a/organizations/admin.py
+++ b/organizations/admin.py
@@ -8,9 +8,11 @@
from django.db.models import Q, Count
from django.template.defaultfilters import striptags
from django.utils.encoding import smart_text
+
from django.utils.translation import ugettext_lazy as _
from . import models
+from organizations.models import Membership
DEFAULT_FILTER_ROLES = (models.Membership.Roles.ADMIN,
models.Membership.Roles.MANAGER)
@@ -18,6 +20,9 @@
def get_memberships_by_role(membership_queryset):
memberships_by_role = defaultdict(lambda: [])
+ membership_queryset = membership_queryset.filter(
+ membership__status__gte=Membership.Status.APPROVED
+ )
qs = membership_queryset.order_by('membership__role') \
.values_list('membership__role', 'pk')
for role, group in itertools.groupby(qs, itemgetter(0)):
@@ -47,12 +52,13 @@ def get_cached_memberships(user, roles=DEFAULT_FILTER_ROLES):
def filter_queryset_by_membership(qs, user,
facility_filter_fk=None,
organization_filter_fk=None,
- roles=DEFAULT_FILTER_ROLES):
+ roles=DEFAULT_FILTER_ROLES,
+ skip_superuser=True):
if facility_filter_fk and organization_filter_fk:
raise Exception(
'facility_filter_fk and organization_filter_fk are mutually exclusive.')
- if user.is_superuser:
+ if skip_superuser and user.is_superuser:
return qs
user_orgs, user_facilities = get_cached_memberships(user, roles)
@@ -222,7 +228,7 @@ def get_contact_info(self, obj):
'description': CKEditorWidget(),
'contact_info': CKEditorWidget(),
}
-
+ prepopulated_fields = {'slug': ['name']}
@admin.register(models.Facility)
class FacilityAdmin(MembershipFilteredAdmin):
@@ -267,7 +273,7 @@ def get_contact_info(self, obj):
'description': CKEditorWidget(),
'contact_info': CKEditorWidget(),
}
-
+ prepopulated_fields = {'slug': ['name']}
@admin.register(models.OrganizationMembership)
class OrganizationMembershipAdmin(MembershipFilteredAdmin):
@@ -341,3 +347,5 @@ def get_description(self, obj):
widgets = {
'description': CKEditorWidget(),
}
+
+
diff --git a/organizations/migrations/0007_auto_20151023_2129.py b/organizations/migrations/0007_auto_20151023_2129.py
new file mode 100644
index 00000000..832db1a8
--- /dev/null
+++ b/organizations/migrations/0007_auto_20151023_2129.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('organizations', '0006_auto_20151022_1445'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='facility',
+ name='contact_info',
+ field=models.TextField(verbose_name='contact info'),
+ ),
+ migrations.AlterField(
+ model_name='organization',
+ name='contact_info',
+ field=models.TextField(verbose_name='contact info'),
+ ),
+ ]
diff --git a/organizations/migrations/0008_add_slug_field.py b/organizations/migrations/0008_add_slug_field.py
new file mode 100644
index 00000000..9a60e9c5
--- /dev/null
+++ b/organizations/migrations/0008_add_slug_field.py
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+import sys
+
+from django.db import models, migrations
+from django.utils.text import slugify
+from common.migrations import skip
+
+
+def add_slugs(apps, schema_editor):
+ Organization = apps.get_model('organizations', 'Organization')
+ Facility = apps.get_model('organizations', 'Facility')
+
+ for model in (Organization, Facility):
+ for instance in model.objects.all():
+ instance.slug = slugify(instance.name)[:80] or slugify('{}'.format(instance.id))
+ instance.save()
+ sys.stdout.write(u'{} -> {}\n'.format(instance, instance.slug))
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ('organizations', '0007_auto_20151023_2129'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='facility',
+ name='slug',
+ field=models.SlugField(max_length=80, null=True, verbose_name='slug', blank=True),
+ ),
+ migrations.AddField(
+ model_name='organization',
+ name='slug',
+ field=models.SlugField(max_length=80, null=True, verbose_name='slug', blank=True),
+ ),
+
+ migrations.RunPython(add_slugs, skip),
+
+ migrations.AlterField(
+ model_name='facility',
+ name='slug',
+ field=models.SlugField(max_length=80, verbose_name='slug'),
+ ),
+ migrations.AlterField(
+ model_name='organization',
+ name='slug',
+ field=models.SlugField(max_length=80, verbose_name='slug'),
+ ),
+ ]
diff --git a/organizations/migrations/0009_membership_status.py b/organizations/migrations/0009_membership_status.py
new file mode 100644
index 00000000..5ab0bced
--- /dev/null
+++ b/organizations/migrations/0009_membership_status.py
@@ -0,0 +1,65 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+from common.migrations import skip
+
+# imported for status choices only, model is not used
+from organizations.models import Membership
+
+
+def approve_all(apps, _):
+ OrganizationMembership = apps.get_model('organizations',
+ 'OrganizationMembership')
+ FacilityMembership = apps.get_model('organizations',
+ 'FacilityMembership')
+
+ OrganizationMembership.objects.update(status=Membership.Status.APPROVED)
+ FacilityMembership.objects.update(status=Membership.Status.APPROVED)
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ('organizations', '0008_add_slug_field'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='facilitymembership',
+ name='status',
+ field=models.PositiveSmallIntegerField(default=2,
+ verbose_name='status',
+ choices=[(0, 'rejected'),
+ (1, 'pending'),
+ (2, 'approved')]),
+ ),
+ migrations.AddField(
+ model_name='organizationmembership',
+ name='status',
+ field=models.PositiveSmallIntegerField(default=2,
+ verbose_name='status',
+ choices=[(0, 'rejected'),
+ (1, 'pending'),
+ (2, 'approved')]),
+ ),
+ migrations.AlterField(
+ model_name='facilitymembership',
+ name='role',
+ field=models.PositiveSmallIntegerField(default=2,
+ verbose_name='role',
+ choices=[(0, 'admin'),
+ (1, 'manager'),
+ (2, 'member')]),
+ ),
+ migrations.AlterField(
+ model_name='organizationmembership',
+ name='role',
+ field=models.PositiveSmallIntegerField(default=2,
+ verbose_name='role',
+ choices=[(0, 'admin'),
+ (1, 'manager'),
+ (2, 'member')]),
+ ),
+ migrations.RunPython(approve_all, skip)
+ ]
diff --git a/organizations/migrations/0010_membership_join_mode.py b/organizations/migrations/0010_membership_join_mode.py
new file mode 100644
index 00000000..5dbde1ca
--- /dev/null
+++ b/organizations/migrations/0010_membership_join_mode.py
@@ -0,0 +1,56 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+from common.migrations import skip
+from organizations.models import Membership
+
+
+def add_default_join_mode(apps, _):
+ OrganizationMembership = apps.get_model('organizations',
+ 'OrganizationMembership')
+
+ FacilityMembership = apps.get_model('organizations',
+ 'FacilityMembership')
+
+ OrganizationMembership.objects.update(status=Membership.Status.APPROVED)
+ FacilityMembership.objects.update(status=Membership.Status.APPROVED)
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ('organizations', '0009_membership_status'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='facility',
+ name='join_mode',
+ field=models.PositiveSmallIntegerField(
+ default=0,
+ help_text='Who can join this facility?',
+ verbose_name='join mode',
+ choices=[
+ (0, 'by invitation'),
+ (1, 'anyone (approved by manager)'),
+ (2, 'anyone')
+ ]
+ ),
+ ),
+ migrations.AddField(
+ model_name='organization',
+ name='join_mode',
+ field=models.PositiveSmallIntegerField(
+ default=0,
+ help_text='Who can join this organization?',
+ verbose_name='join mode',
+ choices=[
+ (0, 'by invitation'),
+ (1, 'anyone (approved by manager)'),
+ (2, 'anyone')
+ ]
+ ),
+ ),
+ migrations.RunPython(add_default_join_mode, skip)
+ ]
diff --git a/organizations/migrations/0011_add_timeline_view_option.py b/organizations/migrations/0011_add_timeline_view_option.py
new file mode 100644
index 00000000..5752be55
--- /dev/null
+++ b/organizations/migrations/0011_add_timeline_view_option.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('organizations', '0010_membership_join_mode'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='facility',
+ name='timeline_enabled',
+ field=models.PositiveSmallIntegerField(default=1, verbose_name='Schedule View', choices=[(0, 'disabled'), (1, 'enabled (collapsed)'), (2, 'enabled')]),
+ ),
+ ]
diff --git a/organizations/models.py b/organizations/models.py
index 3a96efc2..2bfde747 100644
--- a/organizations/models.py
+++ b/organizations/models.py
@@ -1,9 +1,53 @@
# coding: utf-8
-
+from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
from accounts.models import UserAccount
+from scheduler.models import Shift
+
+
+class Membership(models.Model):
+ related_name = None
+
+ class JoinMode:
+ INVITATION_ONLY, APPROVAL_BY_ADMIN, ANYONE = 0, 1, 2
+ CHOICES = (
+ (INVITATION_ONLY, _(u'by invitation')),
+ (APPROVAL_BY_ADMIN, _(u'anyone (approved by manager)')),
+ (ANYONE, _(u'anyone')),
+ )
+
+ class Status:
+ REJECTED, PENDING, APPROVED = 0, 1, 2
+ CHOICES = (
+ (REJECTED, _(u'rejected')),
+ (PENDING, _(u'pending')),
+ (APPROVED, _(u'approved')),
+ )
+
+ class Roles:
+ ADMIN, MANAGER, MEMBER = 0, 1, 2
+ CHOICES = (
+ (ADMIN, _(u'admin')),
+ (MANAGER, _(u'manager')),
+ (MEMBER, _(u'member')),
+ )
+
+ role = models.PositiveSmallIntegerField(choices=Roles.CHOICES,
+ default=Roles.MEMBER,
+ verbose_name=_(u'role'))
+
+ status = models.PositiveSmallIntegerField(choices=Status.CHOICES,
+ default=Status.APPROVED,
+ verbose_name=_(u'status'))
+
+ user_account = models.ForeignKey(UserAccount,
+ verbose_name=_(u'user account'),
+ related_name=related_name)
+
+ class Meta:
+ abstract = True
class Organization(models.Model):
@@ -19,15 +63,25 @@ class Organization(models.Model):
description = models.TextField(verbose_name=_(u'description'))
# anything one needs to know on how to contact the facility
- contact_info = models.TextField(verbose_name=_(u'description'))
+ contact_info = models.TextField(verbose_name=_(u'contact info'))
# the orgs address
address = models.TextField(verbose_name=_('address'))
# users associated with this organization
# ie. members, admins, admins
- members = models.ManyToManyField(UserAccount,
- through='organizations.OrganizationMembership')
+ members = models.ManyToManyField(
+ UserAccount,
+ through='organizations.OrganizationMembership'
+ )
+
+ slug = models.SlugField(max_length=80, verbose_name=_(u'slug'))
+
+ join_mode = models.PositiveSmallIntegerField(
+ choices=Membership.JoinMode.CHOICES,
+ default=Membership.JoinMode.INVITATION_ONLY,
+ verbose_name=_(u'join mode'),
+ help_text=_(u'Who can join this organization?'))
class Meta:
verbose_name = _(u'organization')
@@ -37,8 +91,24 @@ class Meta:
def __unicode__(self):
return _(u"{name}").format(name=self.name)
+ def get_absolute_url(self):
+ return reverse('organization',
+ args=[self.slug])
+
+
+
+
class Facility(models.Model):
+
+ class TimelineViewMode:
+ DISABLED, COLLAPSED, ENABLED = 0, 1, 2
+ CHOICES = (
+ (DISABLED, _(u'disabled')),
+ (COLLAPSED, _(u'enabled (collapsed)')),
+ (ENABLED, _(u'enabled')),
+ )
+
# the organization running this facility
organization = models.ForeignKey('organizations.Organization',
verbose_name=_('organization'),
@@ -87,40 +157,42 @@ class Facility(models.Model):
longitude = models.CharField(max_length=30, blank=True,
verbose_name=_('longitude'))
+ slug = models.SlugField(max_length=80, verbose_name=_(u'slug'))
+
+ timeline_enabled = models.PositiveSmallIntegerField(
+ choices=TimelineViewMode.CHOICES,
+ default=TimelineViewMode.COLLAPSED,
+ verbose_name=_(u'Schedule View'))
+
+ join_mode = models.PositiveSmallIntegerField(
+ choices=Membership.JoinMode.CHOICES,
+ default=Membership.JoinMode.INVITATION_ONLY,
+ verbose_name=_(u'join mode'),
+ help_text=_(u'Who can join this facility?'))
+
class Meta:
verbose_name = _(u'facility')
verbose_name_plural = _(u'facilities')
ordering = ('organization', 'place', 'name',)
+
+
@property
def address_line(self):
- return self.address.replace("\n", ", ").strip()
+ return ', '.join(
+ filter(None, map(lambda s: s.strip(), self.address.splitlines())))
+
+ # TODO: Could this be implemented in a more optimized way?
+ @property
+ def open_shifts(self):
+ return Shift.open_shifts.filter(facility=self)
def __unicode__(self):
return _(u"{name}").format(name=self.name)
-
-class Membership(models.Model):
- related_name = None
-
- class Roles:
- ADMIN, MANAGER, MEMBER = 0, 1, 2
- CHOICES = (
- (ADMIN, _(u'admin')),
- (MANAGER, _(u'manager')),
- (MEMBER, _(u'member')),
- )
-
- role = models.PositiveIntegerField(choices=Roles.CHOICES,
- default=Roles.MEMBER,
- verbose_name=_(u'role'))
-
- user_account = models.ForeignKey(UserAccount,
- verbose_name=_(u'user account'),
- related_name=related_name)
-
- class Meta:
- abstract = True
+ def get_absolute_url(self):
+ return reverse('facility',
+ args=[self.organization.slug, self.slug])
class OrganizationMembership(Membership):
diff --git a/organizations/templates/emails/membership_approved.txt b/organizations/templates/emails/membership_approved.txt
new file mode 100644
index 00000000..1d8a8c11
--- /dev/null
+++ b/organizations/templates/emails/membership_approved.txt
@@ -0,0 +1,11 @@
+{% load i18n %}
+{% blocktrans trimmed %}
+Hello {{ username }},
+{% endblocktrans %}
+
+{% blocktrans trimmed %}
+Your membership request at {{ facility_name }} was approved. You now may sign up for restricted shifts at this facility.
+{% endblocktrans %}
+
+{% blocktrans %}Yours,
+the volunteer-planner.org Team{% endblocktrans %}
diff --git a/organizations/templates/facility.html b/organizations/templates/facility.html
new file mode 100644
index 00000000..35026304
--- /dev/null
+++ b/organizations/templates/facility.html
@@ -0,0 +1,59 @@
+{% extends "helpdesk_base.html" %}
+
+{% load i18n vpfilters %}
+
+{% block helpdesk_content %}
+
+
+
+ {{ facility.name }}
+
+ {% if facility.address_line %}
+
+ {{ facility.address_line }}
+ → Google
+ Maps
+
+ {% endif %}
+
+ {{ facility.contact_info | safe }}
+
+ {{ facility.description | safe }}
+
+
+ {{ facility.organization.name }}
+
+
+ {% trans "Open Shifts" %}
+
+ {% for shift in facility.shifts %}
+ {{ shift.date_string }}
+
+ {% endfor %}
+
+
+ {% if facility.news %}
+ {% trans "News" %}
+ {% for news in facility.news %}
+ {{ news.title }}
+ {{ news.date }}
+ {{ news.text | safe }}
+ {% endfor %}
+ {% endif %}
+
+{% endblock %}
diff --git a/organizations/templates/manage_members.html b/organizations/templates/manage_members.html
new file mode 100644
index 00000000..b13ae463
--- /dev/null
+++ b/organizations/templates/manage_members.html
@@ -0,0 +1,115 @@
+{% extends "base.html" %}
+
+{% load i18n staticfiles %}
+
+{% block additional_js %}
+
+
+{% endblock %}
+
+{% block content %}
+
+ {% with object as facility %}
+
+
+
+
+ {% blocktrans trimmed %}
+ Members in {{ facility }}
+ {% endblocktrans %}
+
+
+
+
+ {% regroup facility.memberships.all by status as memberships_by_status %}
+
+
+
+ {{ facility.name }}
+
+ {% for memberships_for_status in memberships_by_status %}
+
+
{{ memberships_for_status.list.0.get_status_display|title }}
+
+
+
+
+
+ {% trans "Username" %}
+
+
+ {% trans "Role" %}
+
+
+ {% trans "Actions" %}
+
+
+
+
+
+ {% for membership in memberships_for_status.list %}
+
+
+
+ {{ membership.user_account.user.username }}
+
+
+ {{ membership.get_role_display|title }}
+
+
+ {% if membership.status == membership.Status.APPROVED %}
+
+ {% trans "Block" %}
+ |
+ {% elif membership.status == membership.Status.PENDING %}
+
+ {% trans "Accept" %}
+ |
+
+ {% trans "Block" %}
+ |
+ {% endif %}
+
+ {% trans "Remove" %}
+
+
+
+ {% endfor %}
+
+
+
+ {% endfor %}
+
+
+ {% endwith %}
+{% endblock %}
+
+
diff --git a/organizations/templates/organization.html b/organizations/templates/organization.html
new file mode 100644
index 00000000..7e2fa7ba
--- /dev/null
+++ b/organizations/templates/organization.html
@@ -0,0 +1,32 @@
+{% extends "helpdesk_base.html" %}
+
+{% load i18n %}
+
+{% block helpdesk_content %}
+
+
+
+ {{ object.name }}
+
+ {{ object.address }}
+
+ {{ object.contact_info | safe }}
+
+ {{ object.description | safe }}
+
+ {% trans "Facilities" %}
+
+ {% for facility in object.facilities.all %}
+ {% include 'partials/compact_facility.html' with facility=facility %}
+ {% endfor %}
+
+{% endblock %}
diff --git a/organizations/templates/partials/compact_facility.html b/organizations/templates/partials/compact_facility.html
new file mode 100644
index 00000000..2964461e
--- /dev/null
+++ b/organizations/templates/partials/compact_facility.html
@@ -0,0 +1,45 @@
+{% load i18n google_links %}
+
+
+
+
{{ facility.name }}
+
+ {% if facility.address %}
+
+ {{ facility.address_line }}
+ → Google Maps
+
+ {% endif %}
+
+
+ {% if facility.short_description %}
+ {{ facility.short_description|safe }}
+ {% else %}
+ {{ facility.description|truncatechars_html:150|safe }}
+ {% endif %}
+
+
+
+ {% trans "Show details" %}
+
+
+
+ {# TODO: Should be optimized (see Facility.open_shifts) #}
+ {% regroup facility.open_shifts.all by starting_time.date as shifts_by_day %}
+ {% if shifts_by_day %}
+
+
{% trans "Open Shifts" %}
+
+
+ {% for shifts_on_day in shifts_by_day %}
+ {% with shifts_on_day.grouper as shift_date %}
+
+ {{ shift_date|date }}
+
+
+ {% endwith %}
+ {% endfor %}
+
+
+ {% endif %}
+
diff --git a/organizations/templatetags/__init__.py b/organizations/templatetags/__init__.py
new file mode 100644
index 00000000..3117685a
--- /dev/null
+++ b/organizations/templatetags/__init__.py
@@ -0,0 +1,2 @@
+# coding: utf-8
+
diff --git a/organizations/templatetags/memberships.py b/organizations/templatetags/memberships.py
new file mode 100644
index 00000000..c7876e2b
--- /dev/null
+++ b/organizations/templatetags/memberships.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+from django import template
+from django.db.models import Count
+
+from organizations.admin import (
+ get_cached_memberships,
+ filter_queryset_by_membership
+)
+from organizations.models import Membership, FacilityMembership
+
+register = template.Library()
+
+
+@register.filter
+def is_facility_member(user, facility, role=None):
+ user_orgs, user_facilities = get_cached_memberships(
+ user=user,
+ roles=(Membership.Roles.ADMIN,
+ Membership.Roles.MANAGER,
+ Membership.Roles.MEMBER)
+ )
+ return facility.id in user_facilities or facility.organization.id in user_orgs
+
+
+@register.filter
+def is_membership_pending(user, facility):
+ return FacilityMembership.objects.filter(facility=facility,
+ user_account__user_id=user.id,
+ status=Membership.Status.PENDING).exists()
+
+
+@register.filter
+def is_membership_rejected(user, facility):
+ return FacilityMembership.objects.filter(facility=facility,
+ user_account__user_id=user.id,
+ status=Membership.Status.REJECTED).exists()
+
+
+@register.filter
+def get_pending_membership_approvals(user):
+ memberships = FacilityMembership.objects.filter(
+ status=FacilityMembership.Status.PENDING).order_by('facility')
+
+ counters = filter_queryset_by_membership(memberships, user).values(
+ 'facility').annotate(count=Count('facility'))
+
+ result = dict(facilities=dict(), total=0)
+ for counter in counters:
+ result['facilities'][counter['facility']] = counter['count']
+ result['total'] += counter['count']
+
+ return result
diff --git a/organizations/urls.py b/organizations/urls.py
new file mode 100644
index 00000000..d5816cf9
--- /dev/null
+++ b/organizations/urls.py
@@ -0,0 +1,21 @@
+# coding: utf-8
+
+from django.conf.urls import url
+
+from .views import OrganizationView, FacilityView, ManageFacilityMembersView, \
+ managing_members_view
+
+urlpatterns = [
+ url(r'^(?P[^/]+)/?$', OrganizationView.as_view(),
+ name='organization'),
+
+ url(r'^(?P[^/]+)/(?P[^/]+)/?$',
+ FacilityView.as_view(), name='facility'),
+
+ url(r'^(?P[^/]+)/(?P[^/]+)/manage/members/?$',
+ ManageFacilityMembersView.as_view(), name='manage-members'),
+
+ url(
+ r'^(?P[^/]+)/(?P[^/]+)/manage/members/update/?$', managing_members_view, name='manage-members-ajax'),
+
+]
diff --git a/organizations/views.py b/organizations/views.py
index 8f5fbe68..adfae339 100644
--- a/organizations/views.py
+++ b/organizations/views.py
@@ -1,4 +1,172 @@
# coding=utf-8
-from django.shortcuts import render
-# Create your views here.
+import itertools
+
+from django.conf import settings
+from django.contrib.admin.views.decorators import staff_member_required
+from django.core.mail import EmailMessage
+from django.core.urlresolvers import reverse
+from django.http import HttpResponseForbidden
+from django.template.defaultfilters import date
+from django.template.loader import get_template
+from django.utils.safestring import mark_safe
+from django.utils.translation import ugettext_lazy as _
+from django.views.generic import DetailView
+from django_ajax.decorators import ajax
+
+from accounts.models import UserAccount
+from google_tools.templatetags.google_links import google_maps_directions
+from news.models import NewsEntry
+from organizations.admin import filter_queryset_by_membership
+from scheduler.models import Shift
+from .models import Organization, Facility, FacilityMembership
+
+
+class OrganizationView(DetailView):
+ template_name = 'organization.html'
+ model = Organization
+
+ def get_queryset(self):
+ qs = super(OrganizationView, self).get_queryset()
+ return qs.prefetch_related('facilities')
+
+
+class FacilityView(DetailView):
+ template_name = 'facility.html'
+ model = Facility
+ queryset = Facility.objects.select_related('organization')
+
+ def get_context_data(self, **kwargs):
+ context = super(FacilityView, self).get_context_data(**kwargs)
+ shifts = Shift.open_shifts.filter(facility=self.object)
+ context['object'] = self.object
+ context['facility'] = get_facility_details(self.object, shifts)
+
+ return context
+
+
+@ajax
+@staff_member_required
+def managing_members_view(request, **kwargs):
+ try:
+ facilities_managed_by_user = filter_queryset_by_membership(
+ Facility.objects.all(),
+ request.user,
+ skip_superuser=False)
+
+ facilities = facilities_managed_by_user.filter(
+ organization__slug=kwargs['organization__slug'],
+ slug=kwargs['slug']
+ )
+
+ facility = facilities.get()
+
+ user_account_id = request.POST.get('user_account_id')
+
+ action = request.POST.get('action')
+
+ membership = FacilityMembership.objects.get(facility=facility,
+ user_account__id=user_account_id)
+
+ if action == "remove":
+ membership.delete()
+ if action == "reject":
+ membership.status = membership.Status.REJECTED
+ membership.save()
+ elif membership.status == membership.Status.PENDING:
+ if action == "accept":
+ membership.status = membership.Status.APPROVED
+ membership.save()
+ send_membership_approved_notification(membership,
+ approved_by=request.user)
+
+ except Exception:
+ if settings.DEBUG:
+ raise
+ return HttpResponseForbidden()
+ return {'result': "sucess"}
+
+
+class ManageFacilityMembersView(DetailView):
+ """
+ This view returns the pending member requests for approval by the shift
+ planner for the already logged in
+ shift planner of certain facilities.
+ """
+
+ model = Facility
+ template_name = "manage_members.html"
+
+ def get_queryset(self):
+ qs = super(ManageFacilityMembersView, self).get_queryset()
+ qs = qs.select_related('organization')
+ qs = qs.prefetch_related(
+ 'memberships',
+ 'memberships__user_account',
+ 'memberships__user_account__user')
+ return filter_queryset_by_membership(qs,
+ self.request.user,
+ skip_superuser=False)
+
+
+def send_membership_approved_notification(membership, approved_by):
+ to = membership.user_account.user.email
+
+ try:
+ template = get_template('emails/membership_approved.txt')
+ context = {
+ "username": membership.user_account.user.username,
+ "facility_name": membership.facility.name,
+ }
+ message = template.render(context)
+ subject = _(u'volunteer-planner.org: Membership approved')
+
+ from_email = approved_by.email or "Volunteer-Planner.org "
+ reply_to = (from_email,)
+
+ addresses = (to,)
+
+ mail = EmailMessage(subject=subject,
+ body=message,
+ to=addresses,
+ from_email=from_email,
+ reply_to=reply_to)
+ mail.send()
+ except:
+ raise
+
+
+def get_facility_details(facility, shifts):
+ address_line = facility.address_line if facility.address else None
+ shifts_by_date = itertools.groupby(shifts, lambda s: s.starting_time.date())
+ return {
+ 'name': facility.name,
+ 'url': facility.get_absolute_url(),
+ 'news': _serialize_news(NewsEntry.objects.filter(facility=facility)),
+ 'address_line': address_line,
+ 'contact_info': facility.contact_info,
+ 'google_maps_link': google_maps_directions(
+ address_line) if address_line else None,
+ 'description': mark_safe(facility.description),
+ 'area_slug': facility.place.area.slug,
+ 'shifts': [{
+ 'date_string': date(shift_date),
+ 'link': reverse('planner_by_facility', kwargs={
+ 'facility_slug': facility.slug,
+ 'year': shift_date.year,
+ 'month': shift_date.month,
+ 'day': shift_date.day,
+ })
+ } for shift_date, shifts_of_day in shifts_by_date],
+ 'organization': {
+ 'id': facility.organization.id,
+ 'name': facility.organization.name,
+ 'url': facility.organization.get_absolute_url(),
+ }
+ }
+
+
+def _serialize_news(news_entries):
+ return [dict(title=news_entry.title,
+ date=news_entry.creation_date,
+ text=news_entry.text) for news_entry in news_entries]
diff --git a/requirements/_base.txt b/requirements/_base.txt
index 1333c322..bbc8dcec 100644
--- a/requirements/_base.txt
+++ b/requirements/_base.txt
@@ -22,5 +22,5 @@ six==1.7.3
selenium==2.47.3
sqlparse==0.1.16
traitlets==4.0.0
-wsgiref==0.1.2
xlwt==1.0.0
+djangoajax==2.2.15
diff --git a/requirements/dev.txt b/requirements/dev.txt
index 07288fcf..5d602197 100644
--- a/requirements/dev.txt
+++ b/requirements/dev.txt
@@ -3,6 +3,7 @@ coverage==4.0
django-debug-toolbar==1.3.2
factory-boy==2.5.2
gunicorn==19.3.0
+pytest-cache==1.0
pytest-cov==2.1.0
pytest-django==2.8.0
pytest==2.7.2
diff --git a/resources/custom/css/vp.css b/resources/custom/css/vp.css
index 1addd83f..ee9086dd 100644
--- a/resources/custom/css/vp.css
+++ b/resources/custom/css/vp.css
@@ -94,6 +94,10 @@ code {
}
+/*
+ Nav bar
+ */
+
.dropdown-submenu {
@@ -144,6 +148,15 @@ code {
.spacer{
margin-top:35px;
}
+.blue-batches{
+ color:white;
+ background-color: #338EFF;
+ margin-left:5px;
+}
+
+.action{
+ cursor: pointer;
+}
.area-filter button {
margin-right: 6px;
diff --git a/resources/font-awesome/css/font-awesome.css b/resources/font-awesome/css/font-awesome.css
new file mode 100644
index 00000000..880eb825
--- /dev/null
+++ b/resources/font-awesome/css/font-awesome.css
@@ -0,0 +1,2026 @@
+/*!
+ * Font Awesome 4.4.0 by @davegandy - http://fontawesome.io - @fontawesome
+ * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
+ */
+/* FONT PATH
+ * -------------------------- */
+@font-face {
+ font-family: 'FontAwesome';
+ src: url('../fonts/fontawesome-webfont.eot?v=4.4.0');
+ src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.4.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.4.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.4.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.4.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.4.0#fontawesomeregular') format('svg');
+ font-weight: normal;
+ font-style: normal;
+}
+.fa {
+ display: inline-block;
+ font: normal normal normal 14px/1 FontAwesome;
+ font-size: inherit;
+ text-rendering: auto;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+/* makes the font 33% larger relative to the icon container */
+.fa-lg {
+ font-size: 1.33333333em;
+ line-height: 0.75em;
+ vertical-align: -15%;
+}
+.fa-2x {
+ font-size: 2em;
+}
+.fa-3x {
+ font-size: 3em;
+}
+.fa-4x {
+ font-size: 4em;
+}
+.fa-5x {
+ font-size: 5em;
+}
+.fa-fw {
+ width: 1.28571429em;
+ text-align: center;
+}
+.fa-ul {
+ padding-left: 0;
+ margin-left: 2.14285714em;
+ list-style-type: none;
+}
+.fa-ul > li {
+ position: relative;
+}
+.fa-li {
+ position: absolute;
+ left: -2.14285714em;
+ width: 2.14285714em;
+ top: 0.14285714em;
+ text-align: center;
+}
+.fa-li.fa-lg {
+ left: -1.85714286em;
+}
+.fa-border {
+ padding: .2em .25em .15em;
+ border: solid 0.08em #eeeeee;
+ border-radius: .1em;
+}
+.fa-pull-left {
+ float: left;
+}
+.fa-pull-right {
+ float: right;
+}
+.fa.fa-pull-left {
+ margin-right: .3em;
+}
+.fa.fa-pull-right {
+ margin-left: .3em;
+}
+/* Deprecated as of 4.4.0 */
+.pull-right {
+ float: right;
+}
+.pull-left {
+ float: left;
+}
+.fa.pull-left {
+ margin-right: .3em;
+}
+.fa.pull-right {
+ margin-left: .3em;
+}
+.fa-spin {
+ -webkit-animation: fa-spin 2s infinite linear;
+ animation: fa-spin 2s infinite linear;
+}
+.fa-pulse {
+ -webkit-animation: fa-spin 1s infinite steps(8);
+ animation: fa-spin 1s infinite steps(8);
+}
+@-webkit-keyframes fa-spin {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+ 100% {
+ -webkit-transform: rotate(359deg);
+ transform: rotate(359deg);
+ }
+}
+@keyframes fa-spin {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+ 100% {
+ -webkit-transform: rotate(359deg);
+ transform: rotate(359deg);
+ }
+}
+.fa-rotate-90 {
+ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
+ -webkit-transform: rotate(90deg);
+ -ms-transform: rotate(90deg);
+ transform: rotate(90deg);
+}
+.fa-rotate-180 {
+ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
+ -webkit-transform: rotate(180deg);
+ -ms-transform: rotate(180deg);
+ transform: rotate(180deg);
+}
+.fa-rotate-270 {
+ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
+ -webkit-transform: rotate(270deg);
+ -ms-transform: rotate(270deg);
+ transform: rotate(270deg);
+}
+.fa-flip-horizontal {
+ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);
+ -webkit-transform: scale(-1, 1);
+ -ms-transform: scale(-1, 1);
+ transform: scale(-1, 1);
+}
+.fa-flip-vertical {
+ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);
+ -webkit-transform: scale(1, -1);
+ -ms-transform: scale(1, -1);
+ transform: scale(1, -1);
+}
+:root .fa-rotate-90,
+:root .fa-rotate-180,
+:root .fa-rotate-270,
+:root .fa-flip-horizontal,
+:root .fa-flip-vertical {
+ filter: none;
+}
+.fa-stack {
+ position: relative;
+ display: inline-block;
+ width: 2em;
+ height: 2em;
+ line-height: 2em;
+ vertical-align: middle;
+}
+.fa-stack-1x,
+.fa-stack-2x {
+ position: absolute;
+ left: 0;
+ width: 100%;
+ text-align: center;
+}
+.fa-stack-1x {
+ line-height: inherit;
+}
+.fa-stack-2x {
+ font-size: 2em;
+}
+.fa-inverse {
+ color: #ffffff;
+}
+/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
+ readers do not read off random characters that represent icons */
+.fa-glass:before {
+ content: "\f000";
+}
+.fa-music:before {
+ content: "\f001";
+}
+.fa-search:before {
+ content: "\f002";
+}
+.fa-envelope-o:before {
+ content: "\f003";
+}
+.fa-heart:before {
+ content: "\f004";
+}
+.fa-star:before {
+ content: "\f005";
+}
+.fa-star-o:before {
+ content: "\f006";
+}
+.fa-user:before {
+ content: "\f007";
+}
+.fa-film:before {
+ content: "\f008";
+}
+.fa-th-large:before {
+ content: "\f009";
+}
+.fa-th:before {
+ content: "\f00a";
+}
+.fa-th-list:before {
+ content: "\f00b";
+}
+.fa-check:before {
+ content: "\f00c";
+}
+.fa-remove:before,
+.fa-close:before,
+.fa-times:before {
+ content: "\f00d";
+}
+.fa-search-plus:before {
+ content: "\f00e";
+}
+.fa-search-minus:before {
+ content: "\f010";
+}
+.fa-power-off:before {
+ content: "\f011";
+}
+.fa-signal:before {
+ content: "\f012";
+}
+.fa-gear:before,
+.fa-cog:before {
+ content: "\f013";
+}
+.fa-trash-o:before {
+ content: "\f014";
+}
+.fa-home:before {
+ content: "\f015";
+}
+.fa-file-o:before {
+ content: "\f016";
+}
+.fa-clock-o:before {
+ content: "\f017";
+}
+.fa-road:before {
+ content: "\f018";
+}
+.fa-download:before {
+ content: "\f019";
+}
+.fa-arrow-circle-o-down:before {
+ content: "\f01a";
+}
+.fa-arrow-circle-o-up:before {
+ content: "\f01b";
+}
+.fa-inbox:before {
+ content: "\f01c";
+}
+.fa-play-circle-o:before {
+ content: "\f01d";
+}
+.fa-rotate-right:before,
+.fa-repeat:before {
+ content: "\f01e";
+}
+.fa-refresh:before {
+ content: "\f021";
+}
+.fa-list-alt:before {
+ content: "\f022";
+}
+.fa-lock:before {
+ content: "\f023";
+}
+.fa-flag:before {
+ content: "\f024";
+}
+.fa-headphones:before {
+ content: "\f025";
+}
+.fa-volume-off:before {
+ content: "\f026";
+}
+.fa-volume-down:before {
+ content: "\f027";
+}
+.fa-volume-up:before {
+ content: "\f028";
+}
+.fa-qrcode:before {
+ content: "\f029";
+}
+.fa-barcode:before {
+ content: "\f02a";
+}
+.fa-tag:before {
+ content: "\f02b";
+}
+.fa-tags:before {
+ content: "\f02c";
+}
+.fa-book:before {
+ content: "\f02d";
+}
+.fa-bookmark:before {
+ content: "\f02e";
+}
+.fa-print:before {
+ content: "\f02f";
+}
+.fa-camera:before {
+ content: "\f030";
+}
+.fa-font:before {
+ content: "\f031";
+}
+.fa-bold:before {
+ content: "\f032";
+}
+.fa-italic:before {
+ content: "\f033";
+}
+.fa-text-height:before {
+ content: "\f034";
+}
+.fa-text-width:before {
+ content: "\f035";
+}
+.fa-align-left:before {
+ content: "\f036";
+}
+.fa-align-center:before {
+ content: "\f037";
+}
+.fa-align-right:before {
+ content: "\f038";
+}
+.fa-align-justify:before {
+ content: "\f039";
+}
+.fa-list:before {
+ content: "\f03a";
+}
+.fa-dedent:before,
+.fa-outdent:before {
+ content: "\f03b";
+}
+.fa-indent:before {
+ content: "\f03c";
+}
+.fa-video-camera:before {
+ content: "\f03d";
+}
+.fa-photo:before,
+.fa-image:before,
+.fa-picture-o:before {
+ content: "\f03e";
+}
+.fa-pencil:before {
+ content: "\f040";
+}
+.fa-map-marker:before {
+ content: "\f041";
+}
+.fa-adjust:before {
+ content: "\f042";
+}
+.fa-tint:before {
+ content: "\f043";
+}
+.fa-edit:before,
+.fa-pencil-square-o:before {
+ content: "\f044";
+}
+.fa-share-square-o:before {
+ content: "\f045";
+}
+.fa-check-square-o:before {
+ content: "\f046";
+}
+.fa-arrows:before {
+ content: "\f047";
+}
+.fa-step-backward:before {
+ content: "\f048";
+}
+.fa-fast-backward:before {
+ content: "\f049";
+}
+.fa-backward:before {
+ content: "\f04a";
+}
+.fa-play:before {
+ content: "\f04b";
+}
+.fa-pause:before {
+ content: "\f04c";
+}
+.fa-stop:before {
+ content: "\f04d";
+}
+.fa-forward:before {
+ content: "\f04e";
+}
+.fa-fast-forward:before {
+ content: "\f050";
+}
+.fa-step-forward:before {
+ content: "\f051";
+}
+.fa-eject:before {
+ content: "\f052";
+}
+.fa-chevron-left:before {
+ content: "\f053";
+}
+.fa-chevron-right:before {
+ content: "\f054";
+}
+.fa-plus-circle:before {
+ content: "\f055";
+}
+.fa-minus-circle:before {
+ content: "\f056";
+}
+.fa-times-circle:before {
+ content: "\f057";
+}
+.fa-check-circle:before {
+ content: "\f058";
+}
+.fa-question-circle:before {
+ content: "\f059";
+}
+.fa-info-circle:before {
+ content: "\f05a";
+}
+.fa-crosshairs:before {
+ content: "\f05b";
+}
+.fa-times-circle-o:before {
+ content: "\f05c";
+}
+.fa-check-circle-o:before {
+ content: "\f05d";
+}
+.fa-ban:before {
+ content: "\f05e";
+}
+.fa-arrow-left:before {
+ content: "\f060";
+}
+.fa-arrow-right:before {
+ content: "\f061";
+}
+.fa-arrow-up:before {
+ content: "\f062";
+}
+.fa-arrow-down:before {
+ content: "\f063";
+}
+.fa-mail-forward:before,
+.fa-share:before {
+ content: "\f064";
+}
+.fa-expand:before {
+ content: "\f065";
+}
+.fa-compress:before {
+ content: "\f066";
+}
+.fa-plus:before {
+ content: "\f067";
+}
+.fa-minus:before {
+ content: "\f068";
+}
+.fa-asterisk:before {
+ content: "\f069";
+}
+.fa-exclamation-circle:before {
+ content: "\f06a";
+}
+.fa-gift:before {
+ content: "\f06b";
+}
+.fa-leaf:before {
+ content: "\f06c";
+}
+.fa-fire:before {
+ content: "\f06d";
+}
+.fa-eye:before {
+ content: "\f06e";
+}
+.fa-eye-slash:before {
+ content: "\f070";
+}
+.fa-warning:before,
+.fa-exclamation-triangle:before {
+ content: "\f071";
+}
+.fa-plane:before {
+ content: "\f072";
+}
+.fa-calendar:before {
+ content: "\f073";
+}
+.fa-random:before {
+ content: "\f074";
+}
+.fa-comment:before {
+ content: "\f075";
+}
+.fa-magnet:before {
+ content: "\f076";
+}
+.fa-chevron-up:before {
+ content: "\f077";
+}
+.fa-chevron-down:before {
+ content: "\f078";
+}
+.fa-retweet:before {
+ content: "\f079";
+}
+.fa-shopping-cart:before {
+ content: "\f07a";
+}
+.fa-folder:before {
+ content: "\f07b";
+}
+.fa-folder-open:before {
+ content: "\f07c";
+}
+.fa-arrows-v:before {
+ content: "\f07d";
+}
+.fa-arrows-h:before {
+ content: "\f07e";
+}
+.fa-bar-chart-o:before,
+.fa-bar-chart:before {
+ content: "\f080";
+}
+.fa-twitter-square:before {
+ content: "\f081";
+}
+.fa-facebook-square:before {
+ content: "\f082";
+}
+.fa-camera-retro:before {
+ content: "\f083";
+}
+.fa-key:before {
+ content: "\f084";
+}
+.fa-gears:before,
+.fa-cogs:before {
+ content: "\f085";
+}
+.fa-comments:before {
+ content: "\f086";
+}
+.fa-thumbs-o-up:before {
+ content: "\f087";
+}
+.fa-thumbs-o-down:before {
+ content: "\f088";
+}
+.fa-star-half:before {
+ content: "\f089";
+}
+.fa-heart-o:before {
+ content: "\f08a";
+}
+.fa-sign-out:before {
+ content: "\f08b";
+}
+.fa-linkedin-square:before {
+ content: "\f08c";
+}
+.fa-thumb-tack:before {
+ content: "\f08d";
+}
+.fa-external-link:before {
+ content: "\f08e";
+}
+.fa-sign-in:before {
+ content: "\f090";
+}
+.fa-trophy:before {
+ content: "\f091";
+}
+.fa-github-square:before {
+ content: "\f092";
+}
+.fa-upload:before {
+ content: "\f093";
+}
+.fa-lemon-o:before {
+ content: "\f094";
+}
+.fa-phone:before {
+ content: "\f095";
+}
+.fa-square-o:before {
+ content: "\f096";
+}
+.fa-bookmark-o:before {
+ content: "\f097";
+}
+.fa-phone-square:before {
+ content: "\f098";
+}
+.fa-twitter:before {
+ content: "\f099";
+}
+.fa-facebook-f:before,
+.fa-facebook:before {
+ content: "\f09a";
+}
+.fa-github:before {
+ content: "\f09b";
+}
+.fa-unlock:before {
+ content: "\f09c";
+}
+.fa-credit-card:before {
+ content: "\f09d";
+}
+.fa-feed:before,
+.fa-rss:before {
+ content: "\f09e";
+}
+.fa-hdd-o:before {
+ content: "\f0a0";
+}
+.fa-bullhorn:before {
+ content: "\f0a1";
+}
+.fa-bell:before {
+ content: "\f0f3";
+}
+.fa-certificate:before {
+ content: "\f0a3";
+}
+.fa-hand-o-right:before {
+ content: "\f0a4";
+}
+.fa-hand-o-left:before {
+ content: "\f0a5";
+}
+.fa-hand-o-up:before {
+ content: "\f0a6";
+}
+.fa-hand-o-down:before {
+ content: "\f0a7";
+}
+.fa-arrow-circle-left:before {
+ content: "\f0a8";
+}
+.fa-arrow-circle-right:before {
+ content: "\f0a9";
+}
+.fa-arrow-circle-up:before {
+ content: "\f0aa";
+}
+.fa-arrow-circle-down:before {
+ content: "\f0ab";
+}
+.fa-globe:before {
+ content: "\f0ac";
+}
+.fa-wrench:before {
+ content: "\f0ad";
+}
+.fa-tasks:before {
+ content: "\f0ae";
+}
+.fa-filter:before {
+ content: "\f0b0";
+}
+.fa-briefcase:before {
+ content: "\f0b1";
+}
+.fa-arrows-alt:before {
+ content: "\f0b2";
+}
+.fa-group:before,
+.fa-users:before {
+ content: "\f0c0";
+}
+.fa-chain:before,
+.fa-link:before {
+ content: "\f0c1";
+}
+.fa-cloud:before {
+ content: "\f0c2";
+}
+.fa-flask:before {
+ content: "\f0c3";
+}
+.fa-cut:before,
+.fa-scissors:before {
+ content: "\f0c4";
+}
+.fa-copy:before,
+.fa-files-o:before {
+ content: "\f0c5";
+}
+.fa-paperclip:before {
+ content: "\f0c6";
+}
+.fa-save:before,
+.fa-floppy-o:before {
+ content: "\f0c7";
+}
+.fa-square:before {
+ content: "\f0c8";
+}
+.fa-navicon:before,
+.fa-reorder:before,
+.fa-bars:before {
+ content: "\f0c9";
+}
+.fa-list-ul:before {
+ content: "\f0ca";
+}
+.fa-list-ol:before {
+ content: "\f0cb";
+}
+.fa-strikethrough:before {
+ content: "\f0cc";
+}
+.fa-underline:before {
+ content: "\f0cd";
+}
+.fa-table:before {
+ content: "\f0ce";
+}
+.fa-magic:before {
+ content: "\f0d0";
+}
+.fa-truck:before {
+ content: "\f0d1";
+}
+.fa-pinterest:before {
+ content: "\f0d2";
+}
+.fa-pinterest-square:before {
+ content: "\f0d3";
+}
+.fa-google-plus-square:before {
+ content: "\f0d4";
+}
+.fa-google-plus:before {
+ content: "\f0d5";
+}
+.fa-money:before {
+ content: "\f0d6";
+}
+.fa-caret-down:before {
+ content: "\f0d7";
+}
+.fa-caret-up:before {
+ content: "\f0d8";
+}
+.fa-caret-left:before {
+ content: "\f0d9";
+}
+.fa-caret-right:before {
+ content: "\f0da";
+}
+.fa-columns:before {
+ content: "\f0db";
+}
+.fa-unsorted:before,
+.fa-sort:before {
+ content: "\f0dc";
+}
+.fa-sort-down:before,
+.fa-sort-desc:before {
+ content: "\f0dd";
+}
+.fa-sort-up:before,
+.fa-sort-asc:before {
+ content: "\f0de";
+}
+.fa-envelope:before {
+ content: "\f0e0";
+}
+.fa-linkedin:before {
+ content: "\f0e1";
+}
+.fa-rotate-left:before,
+.fa-undo:before {
+ content: "\f0e2";
+}
+.fa-legal:before,
+.fa-gavel:before {
+ content: "\f0e3";
+}
+.fa-dashboard:before,
+.fa-tachometer:before {
+ content: "\f0e4";
+}
+.fa-comment-o:before {
+ content: "\f0e5";
+}
+.fa-comments-o:before {
+ content: "\f0e6";
+}
+.fa-flash:before,
+.fa-bolt:before {
+ content: "\f0e7";
+}
+.fa-sitemap:before {
+ content: "\f0e8";
+}
+.fa-umbrella:before {
+ content: "\f0e9";
+}
+.fa-paste:before,
+.fa-clipboard:before {
+ content: "\f0ea";
+}
+.fa-lightbulb-o:before {
+ content: "\f0eb";
+}
+.fa-exchange:before {
+ content: "\f0ec";
+}
+.fa-cloud-download:before {
+ content: "\f0ed";
+}
+.fa-cloud-upload:before {
+ content: "\f0ee";
+}
+.fa-user-md:before {
+ content: "\f0f0";
+}
+.fa-stethoscope:before {
+ content: "\f0f1";
+}
+.fa-suitcase:before {
+ content: "\f0f2";
+}
+.fa-bell-o:before {
+ content: "\f0a2";
+}
+.fa-coffee:before {
+ content: "\f0f4";
+}
+.fa-cutlery:before {
+ content: "\f0f5";
+}
+.fa-file-text-o:before {
+ content: "\f0f6";
+}
+.fa-building-o:before {
+ content: "\f0f7";
+}
+.fa-hospital-o:before {
+ content: "\f0f8";
+}
+.fa-ambulance:before {
+ content: "\f0f9";
+}
+.fa-medkit:before {
+ content: "\f0fa";
+}
+.fa-fighter-jet:before {
+ content: "\f0fb";
+}
+.fa-beer:before {
+ content: "\f0fc";
+}
+.fa-h-square:before {
+ content: "\f0fd";
+}
+.fa-plus-square:before {
+ content: "\f0fe";
+}
+.fa-angle-double-left:before {
+ content: "\f100";
+}
+.fa-angle-double-right:before {
+ content: "\f101";
+}
+.fa-angle-double-up:before {
+ content: "\f102";
+}
+.fa-angle-double-down:before {
+ content: "\f103";
+}
+.fa-angle-left:before {
+ content: "\f104";
+}
+.fa-angle-right:before {
+ content: "\f105";
+}
+.fa-angle-up:before {
+ content: "\f106";
+}
+.fa-angle-down:before {
+ content: "\f107";
+}
+.fa-desktop:before {
+ content: "\f108";
+}
+.fa-laptop:before {
+ content: "\f109";
+}
+.fa-tablet:before {
+ content: "\f10a";
+}
+.fa-mobile-phone:before,
+.fa-mobile:before {
+ content: "\f10b";
+}
+.fa-circle-o:before {
+ content: "\f10c";
+}
+.fa-quote-left:before {
+ content: "\f10d";
+}
+.fa-quote-right:before {
+ content: "\f10e";
+}
+.fa-spinner:before {
+ content: "\f110";
+}
+.fa-circle:before {
+ content: "\f111";
+}
+.fa-mail-reply:before,
+.fa-reply:before {
+ content: "\f112";
+}
+.fa-github-alt:before {
+ content: "\f113";
+}
+.fa-folder-o:before {
+ content: "\f114";
+}
+.fa-folder-open-o:before {
+ content: "\f115";
+}
+.fa-smile-o:before {
+ content: "\f118";
+}
+.fa-frown-o:before {
+ content: "\f119";
+}
+.fa-meh-o:before {
+ content: "\f11a";
+}
+.fa-gamepad:before {
+ content: "\f11b";
+}
+.fa-keyboard-o:before {
+ content: "\f11c";
+}
+.fa-flag-o:before {
+ content: "\f11d";
+}
+.fa-flag-checkered:before {
+ content: "\f11e";
+}
+.fa-terminal:before {
+ content: "\f120";
+}
+.fa-code:before {
+ content: "\f121";
+}
+.fa-mail-reply-all:before,
+.fa-reply-all:before {
+ content: "\f122";
+}
+.fa-star-half-empty:before,
+.fa-star-half-full:before,
+.fa-star-half-o:before {
+ content: "\f123";
+}
+.fa-location-arrow:before {
+ content: "\f124";
+}
+.fa-crop:before {
+ content: "\f125";
+}
+.fa-code-fork:before {
+ content: "\f126";
+}
+.fa-unlink:before,
+.fa-chain-broken:before {
+ content: "\f127";
+}
+.fa-question:before {
+ content: "\f128";
+}
+.fa-info:before {
+ content: "\f129";
+}
+.fa-exclamation:before {
+ content: "\f12a";
+}
+.fa-superscript:before {
+ content: "\f12b";
+}
+.fa-subscript:before {
+ content: "\f12c";
+}
+.fa-eraser:before {
+ content: "\f12d";
+}
+.fa-puzzle-piece:before {
+ content: "\f12e";
+}
+.fa-microphone:before {
+ content: "\f130";
+}
+.fa-microphone-slash:before {
+ content: "\f131";
+}
+.fa-shield:before {
+ content: "\f132";
+}
+.fa-calendar-o:before {
+ content: "\f133";
+}
+.fa-fire-extinguisher:before {
+ content: "\f134";
+}
+.fa-rocket:before {
+ content: "\f135";
+}
+.fa-maxcdn:before {
+ content: "\f136";
+}
+.fa-chevron-circle-left:before {
+ content: "\f137";
+}
+.fa-chevron-circle-right:before {
+ content: "\f138";
+}
+.fa-chevron-circle-up:before {
+ content: "\f139";
+}
+.fa-chevron-circle-down:before {
+ content: "\f13a";
+}
+.fa-html5:before {
+ content: "\f13b";
+}
+.fa-css3:before {
+ content: "\f13c";
+}
+.fa-anchor:before {
+ content: "\f13d";
+}
+.fa-unlock-alt:before {
+ content: "\f13e";
+}
+.fa-bullseye:before {
+ content: "\f140";
+}
+.fa-ellipsis-h:before {
+ content: "\f141";
+}
+.fa-ellipsis-v:before {
+ content: "\f142";
+}
+.fa-rss-square:before {
+ content: "\f143";
+}
+.fa-play-circle:before {
+ content: "\f144";
+}
+.fa-ticket:before {
+ content: "\f145";
+}
+.fa-minus-square:before {
+ content: "\f146";
+}
+.fa-minus-square-o:before {
+ content: "\f147";
+}
+.fa-level-up:before {
+ content: "\f148";
+}
+.fa-level-down:before {
+ content: "\f149";
+}
+.fa-check-square:before {
+ content: "\f14a";
+}
+.fa-pencil-square:before {
+ content: "\f14b";
+}
+.fa-external-link-square:before {
+ content: "\f14c";
+}
+.fa-share-square:before {
+ content: "\f14d";
+}
+.fa-compass:before {
+ content: "\f14e";
+}
+.fa-toggle-down:before,
+.fa-caret-square-o-down:before {
+ content: "\f150";
+}
+.fa-toggle-up:before,
+.fa-caret-square-o-up:before {
+ content: "\f151";
+}
+.fa-toggle-right:before,
+.fa-caret-square-o-right:before {
+ content: "\f152";
+}
+.fa-euro:before,
+.fa-eur:before {
+ content: "\f153";
+}
+.fa-gbp:before {
+ content: "\f154";
+}
+.fa-dollar:before,
+.fa-usd:before {
+ content: "\f155";
+}
+.fa-rupee:before,
+.fa-inr:before {
+ content: "\f156";
+}
+.fa-cny:before,
+.fa-rmb:before,
+.fa-yen:before,
+.fa-jpy:before {
+ content: "\f157";
+}
+.fa-ruble:before,
+.fa-rouble:before,
+.fa-rub:before {
+ content: "\f158";
+}
+.fa-won:before,
+.fa-krw:before {
+ content: "\f159";
+}
+.fa-bitcoin:before,
+.fa-btc:before {
+ content: "\f15a";
+}
+.fa-file:before {
+ content: "\f15b";
+}
+.fa-file-text:before {
+ content: "\f15c";
+}
+.fa-sort-alpha-asc:before {
+ content: "\f15d";
+}
+.fa-sort-alpha-desc:before {
+ content: "\f15e";
+}
+.fa-sort-amount-asc:before {
+ content: "\f160";
+}
+.fa-sort-amount-desc:before {
+ content: "\f161";
+}
+.fa-sort-numeric-asc:before {
+ content: "\f162";
+}
+.fa-sort-numeric-desc:before {
+ content: "\f163";
+}
+.fa-thumbs-up:before {
+ content: "\f164";
+}
+.fa-thumbs-down:before {
+ content: "\f165";
+}
+.fa-youtube-square:before {
+ content: "\f166";
+}
+.fa-youtube:before {
+ content: "\f167";
+}
+.fa-xing:before {
+ content: "\f168";
+}
+.fa-xing-square:before {
+ content: "\f169";
+}
+.fa-youtube-play:before {
+ content: "\f16a";
+}
+.fa-dropbox:before {
+ content: "\f16b";
+}
+.fa-stack-overflow:before {
+ content: "\f16c";
+}
+.fa-instagram:before {
+ content: "\f16d";
+}
+.fa-flickr:before {
+ content: "\f16e";
+}
+.fa-adn:before {
+ content: "\f170";
+}
+.fa-bitbucket:before {
+ content: "\f171";
+}
+.fa-bitbucket-square:before {
+ content: "\f172";
+}
+.fa-tumblr:before {
+ content: "\f173";
+}
+.fa-tumblr-square:before {
+ content: "\f174";
+}
+.fa-long-arrow-down:before {
+ content: "\f175";
+}
+.fa-long-arrow-up:before {
+ content: "\f176";
+}
+.fa-long-arrow-left:before {
+ content: "\f177";
+}
+.fa-long-arrow-right:before {
+ content: "\f178";
+}
+.fa-apple:before {
+ content: "\f179";
+}
+.fa-windows:before {
+ content: "\f17a";
+}
+.fa-android:before {
+ content: "\f17b";
+}
+.fa-linux:before {
+ content: "\f17c";
+}
+.fa-dribbble:before {
+ content: "\f17d";
+}
+.fa-skype:before {
+ content: "\f17e";
+}
+.fa-foursquare:before {
+ content: "\f180";
+}
+.fa-trello:before {
+ content: "\f181";
+}
+.fa-female:before {
+ content: "\f182";
+}
+.fa-male:before {
+ content: "\f183";
+}
+.fa-gittip:before,
+.fa-gratipay:before {
+ content: "\f184";
+}
+.fa-sun-o:before {
+ content: "\f185";
+}
+.fa-moon-o:before {
+ content: "\f186";
+}
+.fa-archive:before {
+ content: "\f187";
+}
+.fa-bug:before {
+ content: "\f188";
+}
+.fa-vk:before {
+ content: "\f189";
+}
+.fa-weibo:before {
+ content: "\f18a";
+}
+.fa-renren:before {
+ content: "\f18b";
+}
+.fa-pagelines:before {
+ content: "\f18c";
+}
+.fa-stack-exchange:before {
+ content: "\f18d";
+}
+.fa-arrow-circle-o-right:before {
+ content: "\f18e";
+}
+.fa-arrow-circle-o-left:before {
+ content: "\f190";
+}
+.fa-toggle-left:before,
+.fa-caret-square-o-left:before {
+ content: "\f191";
+}
+.fa-dot-circle-o:before {
+ content: "\f192";
+}
+.fa-wheelchair:before {
+ content: "\f193";
+}
+.fa-vimeo-square:before {
+ content: "\f194";
+}
+.fa-turkish-lira:before,
+.fa-try:before {
+ content: "\f195";
+}
+.fa-plus-square-o:before {
+ content: "\f196";
+}
+.fa-space-shuttle:before {
+ content: "\f197";
+}
+.fa-slack:before {
+ content: "\f198";
+}
+.fa-envelope-square:before {
+ content: "\f199";
+}
+.fa-wordpress:before {
+ content: "\f19a";
+}
+.fa-openid:before {
+ content: "\f19b";
+}
+.fa-institution:before,
+.fa-bank:before,
+.fa-university:before {
+ content: "\f19c";
+}
+.fa-mortar-board:before,
+.fa-graduation-cap:before {
+ content: "\f19d";
+}
+.fa-yahoo:before {
+ content: "\f19e";
+}
+.fa-google:before {
+ content: "\f1a0";
+}
+.fa-reddit:before {
+ content: "\f1a1";
+}
+.fa-reddit-square:before {
+ content: "\f1a2";
+}
+.fa-stumbleupon-circle:before {
+ content: "\f1a3";
+}
+.fa-stumbleupon:before {
+ content: "\f1a4";
+}
+.fa-delicious:before {
+ content: "\f1a5";
+}
+.fa-digg:before {
+ content: "\f1a6";
+}
+.fa-pied-piper:before {
+ content: "\f1a7";
+}
+.fa-pied-piper-alt:before {
+ content: "\f1a8";
+}
+.fa-drupal:before {
+ content: "\f1a9";
+}
+.fa-joomla:before {
+ content: "\f1aa";
+}
+.fa-language:before {
+ content: "\f1ab";
+}
+.fa-fax:before {
+ content: "\f1ac";
+}
+.fa-building:before {
+ content: "\f1ad";
+}
+.fa-child:before {
+ content: "\f1ae";
+}
+.fa-paw:before {
+ content: "\f1b0";
+}
+.fa-spoon:before {
+ content: "\f1b1";
+}
+.fa-cube:before {
+ content: "\f1b2";
+}
+.fa-cubes:before {
+ content: "\f1b3";
+}
+.fa-behance:before {
+ content: "\f1b4";
+}
+.fa-behance-square:before {
+ content: "\f1b5";
+}
+.fa-steam:before {
+ content: "\f1b6";
+}
+.fa-steam-square:before {
+ content: "\f1b7";
+}
+.fa-recycle:before {
+ content: "\f1b8";
+}
+.fa-automobile:before,
+.fa-car:before {
+ content: "\f1b9";
+}
+.fa-cab:before,
+.fa-taxi:before {
+ content: "\f1ba";
+}
+.fa-tree:before {
+ content: "\f1bb";
+}
+.fa-spotify:before {
+ content: "\f1bc";
+}
+.fa-deviantart:before {
+ content: "\f1bd";
+}
+.fa-soundcloud:before {
+ content: "\f1be";
+}
+.fa-database:before {
+ content: "\f1c0";
+}
+.fa-file-pdf-o:before {
+ content: "\f1c1";
+}
+.fa-file-word-o:before {
+ content: "\f1c2";
+}
+.fa-file-excel-o:before {
+ content: "\f1c3";
+}
+.fa-file-powerpoint-o:before {
+ content: "\f1c4";
+}
+.fa-file-photo-o:before,
+.fa-file-picture-o:before,
+.fa-file-image-o:before {
+ content: "\f1c5";
+}
+.fa-file-zip-o:before,
+.fa-file-archive-o:before {
+ content: "\f1c6";
+}
+.fa-file-sound-o:before,
+.fa-file-audio-o:before {
+ content: "\f1c7";
+}
+.fa-file-movie-o:before,
+.fa-file-video-o:before {
+ content: "\f1c8";
+}
+.fa-file-code-o:before {
+ content: "\f1c9";
+}
+.fa-vine:before {
+ content: "\f1ca";
+}
+.fa-codepen:before {
+ content: "\f1cb";
+}
+.fa-jsfiddle:before {
+ content: "\f1cc";
+}
+.fa-life-bouy:before,
+.fa-life-buoy:before,
+.fa-life-saver:before,
+.fa-support:before,
+.fa-life-ring:before {
+ content: "\f1cd";
+}
+.fa-circle-o-notch:before {
+ content: "\f1ce";
+}
+.fa-ra:before,
+.fa-rebel:before {
+ content: "\f1d0";
+}
+.fa-ge:before,
+.fa-empire:before {
+ content: "\f1d1";
+}
+.fa-git-square:before {
+ content: "\f1d2";
+}
+.fa-git:before {
+ content: "\f1d3";
+}
+.fa-y-combinator-square:before,
+.fa-yc-square:before,
+.fa-hacker-news:before {
+ content: "\f1d4";
+}
+.fa-tencent-weibo:before {
+ content: "\f1d5";
+}
+.fa-qq:before {
+ content: "\f1d6";
+}
+.fa-wechat:before,
+.fa-weixin:before {
+ content: "\f1d7";
+}
+.fa-send:before,
+.fa-paper-plane:before {
+ content: "\f1d8";
+}
+.fa-send-o:before,
+.fa-paper-plane-o:before {
+ content: "\f1d9";
+}
+.fa-history:before {
+ content: "\f1da";
+}
+.fa-circle-thin:before {
+ content: "\f1db";
+}
+.fa-header:before {
+ content: "\f1dc";
+}
+.fa-paragraph:before {
+ content: "\f1dd";
+}
+.fa-sliders:before {
+ content: "\f1de";
+}
+.fa-share-alt:before {
+ content: "\f1e0";
+}
+.fa-share-alt-square:before {
+ content: "\f1e1";
+}
+.fa-bomb:before {
+ content: "\f1e2";
+}
+.fa-soccer-ball-o:before,
+.fa-futbol-o:before {
+ content: "\f1e3";
+}
+.fa-tty:before {
+ content: "\f1e4";
+}
+.fa-binoculars:before {
+ content: "\f1e5";
+}
+.fa-plug:before {
+ content: "\f1e6";
+}
+.fa-slideshare:before {
+ content: "\f1e7";
+}
+.fa-twitch:before {
+ content: "\f1e8";
+}
+.fa-yelp:before {
+ content: "\f1e9";
+}
+.fa-newspaper-o:before {
+ content: "\f1ea";
+}
+.fa-wifi:before {
+ content: "\f1eb";
+}
+.fa-calculator:before {
+ content: "\f1ec";
+}
+.fa-paypal:before {
+ content: "\f1ed";
+}
+.fa-google-wallet:before {
+ content: "\f1ee";
+}
+.fa-cc-visa:before {
+ content: "\f1f0";
+}
+.fa-cc-mastercard:before {
+ content: "\f1f1";
+}
+.fa-cc-discover:before {
+ content: "\f1f2";
+}
+.fa-cc-amex:before {
+ content: "\f1f3";
+}
+.fa-cc-paypal:before {
+ content: "\f1f4";
+}
+.fa-cc-stripe:before {
+ content: "\f1f5";
+}
+.fa-bell-slash:before {
+ content: "\f1f6";
+}
+.fa-bell-slash-o:before {
+ content: "\f1f7";
+}
+.fa-trash:before {
+ content: "\f1f8";
+}
+.fa-copyright:before {
+ content: "\f1f9";
+}
+.fa-at:before {
+ content: "\f1fa";
+}
+.fa-eyedropper:before {
+ content: "\f1fb";
+}
+.fa-paint-brush:before {
+ content: "\f1fc";
+}
+.fa-birthday-cake:before {
+ content: "\f1fd";
+}
+.fa-area-chart:before {
+ content: "\f1fe";
+}
+.fa-pie-chart:before {
+ content: "\f200";
+}
+.fa-line-chart:before {
+ content: "\f201";
+}
+.fa-lastfm:before {
+ content: "\f202";
+}
+.fa-lastfm-square:before {
+ content: "\f203";
+}
+.fa-toggle-off:before {
+ content: "\f204";
+}
+.fa-toggle-on:before {
+ content: "\f205";
+}
+.fa-bicycle:before {
+ content: "\f206";
+}
+.fa-bus:before {
+ content: "\f207";
+}
+.fa-ioxhost:before {
+ content: "\f208";
+}
+.fa-angellist:before {
+ content: "\f209";
+}
+.fa-cc:before {
+ content: "\f20a";
+}
+.fa-shekel:before,
+.fa-sheqel:before,
+.fa-ils:before {
+ content: "\f20b";
+}
+.fa-meanpath:before {
+ content: "\f20c";
+}
+.fa-buysellads:before {
+ content: "\f20d";
+}
+.fa-connectdevelop:before {
+ content: "\f20e";
+}
+.fa-dashcube:before {
+ content: "\f210";
+}
+.fa-forumbee:before {
+ content: "\f211";
+}
+.fa-leanpub:before {
+ content: "\f212";
+}
+.fa-sellsy:before {
+ content: "\f213";
+}
+.fa-shirtsinbulk:before {
+ content: "\f214";
+}
+.fa-simplybuilt:before {
+ content: "\f215";
+}
+.fa-skyatlas:before {
+ content: "\f216";
+}
+.fa-cart-plus:before {
+ content: "\f217";
+}
+.fa-cart-arrow-down:before {
+ content: "\f218";
+}
+.fa-diamond:before {
+ content: "\f219";
+}
+.fa-ship:before {
+ content: "\f21a";
+}
+.fa-user-secret:before {
+ content: "\f21b";
+}
+.fa-motorcycle:before {
+ content: "\f21c";
+}
+.fa-street-view:before {
+ content: "\f21d";
+}
+.fa-heartbeat:before {
+ content: "\f21e";
+}
+.fa-venus:before {
+ content: "\f221";
+}
+.fa-mars:before {
+ content: "\f222";
+}
+.fa-mercury:before {
+ content: "\f223";
+}
+.fa-intersex:before,
+.fa-transgender:before {
+ content: "\f224";
+}
+.fa-transgender-alt:before {
+ content: "\f225";
+}
+.fa-venus-double:before {
+ content: "\f226";
+}
+.fa-mars-double:before {
+ content: "\f227";
+}
+.fa-venus-mars:before {
+ content: "\f228";
+}
+.fa-mars-stroke:before {
+ content: "\f229";
+}
+.fa-mars-stroke-v:before {
+ content: "\f22a";
+}
+.fa-mars-stroke-h:before {
+ content: "\f22b";
+}
+.fa-neuter:before {
+ content: "\f22c";
+}
+.fa-genderless:before {
+ content: "\f22d";
+}
+.fa-facebook-official:before {
+ content: "\f230";
+}
+.fa-pinterest-p:before {
+ content: "\f231";
+}
+.fa-whatsapp:before {
+ content: "\f232";
+}
+.fa-server:before {
+ content: "\f233";
+}
+.fa-user-plus:before {
+ content: "\f234";
+}
+.fa-user-times:before {
+ content: "\f235";
+}
+.fa-hotel:before,
+.fa-bed:before {
+ content: "\f236";
+}
+.fa-viacoin:before {
+ content: "\f237";
+}
+.fa-train:before {
+ content: "\f238";
+}
+.fa-subway:before {
+ content: "\f239";
+}
+.fa-medium:before {
+ content: "\f23a";
+}
+.fa-yc:before,
+.fa-y-combinator:before {
+ content: "\f23b";
+}
+.fa-optin-monster:before {
+ content: "\f23c";
+}
+.fa-opencart:before {
+ content: "\f23d";
+}
+.fa-expeditedssl:before {
+ content: "\f23e";
+}
+.fa-battery-4:before,
+.fa-battery-full:before {
+ content: "\f240";
+}
+.fa-battery-3:before,
+.fa-battery-three-quarters:before {
+ content: "\f241";
+}
+.fa-battery-2:before,
+.fa-battery-half:before {
+ content: "\f242";
+}
+.fa-battery-1:before,
+.fa-battery-quarter:before {
+ content: "\f243";
+}
+.fa-battery-0:before,
+.fa-battery-empty:before {
+ content: "\f244";
+}
+.fa-mouse-pointer:before {
+ content: "\f245";
+}
+.fa-i-cursor:before {
+ content: "\f246";
+}
+.fa-object-group:before {
+ content: "\f247";
+}
+.fa-object-ungroup:before {
+ content: "\f248";
+}
+.fa-sticky-note:before {
+ content: "\f249";
+}
+.fa-sticky-note-o:before {
+ content: "\f24a";
+}
+.fa-cc-jcb:before {
+ content: "\f24b";
+}
+.fa-cc-diners-club:before {
+ content: "\f24c";
+}
+.fa-clone:before {
+ content: "\f24d";
+}
+.fa-balance-scale:before {
+ content: "\f24e";
+}
+.fa-hourglass-o:before {
+ content: "\f250";
+}
+.fa-hourglass-1:before,
+.fa-hourglass-start:before {
+ content: "\f251";
+}
+.fa-hourglass-2:before,
+.fa-hourglass-half:before {
+ content: "\f252";
+}
+.fa-hourglass-3:before,
+.fa-hourglass-end:before {
+ content: "\f253";
+}
+.fa-hourglass:before {
+ content: "\f254";
+}
+.fa-hand-grab-o:before,
+.fa-hand-rock-o:before {
+ content: "\f255";
+}
+.fa-hand-stop-o:before,
+.fa-hand-paper-o:before {
+ content: "\f256";
+}
+.fa-hand-scissors-o:before {
+ content: "\f257";
+}
+.fa-hand-lizard-o:before {
+ content: "\f258";
+}
+.fa-hand-spock-o:before {
+ content: "\f259";
+}
+.fa-hand-pointer-o:before {
+ content: "\f25a";
+}
+.fa-hand-peace-o:before {
+ content: "\f25b";
+}
+.fa-trademark:before {
+ content: "\f25c";
+}
+.fa-registered:before {
+ content: "\f25d";
+}
+.fa-creative-commons:before {
+ content: "\f25e";
+}
+.fa-gg:before {
+ content: "\f260";
+}
+.fa-gg-circle:before {
+ content: "\f261";
+}
+.fa-tripadvisor:before {
+ content: "\f262";
+}
+.fa-odnoklassniki:before {
+ content: "\f263";
+}
+.fa-odnoklassniki-square:before {
+ content: "\f264";
+}
+.fa-get-pocket:before {
+ content: "\f265";
+}
+.fa-wikipedia-w:before {
+ content: "\f266";
+}
+.fa-safari:before {
+ content: "\f267";
+}
+.fa-chrome:before {
+ content: "\f268";
+}
+.fa-firefox:before {
+ content: "\f269";
+}
+.fa-opera:before {
+ content: "\f26a";
+}
+.fa-internet-explorer:before {
+ content: "\f26b";
+}
+.fa-tv:before,
+.fa-television:before {
+ content: "\f26c";
+}
+.fa-contao:before {
+ content: "\f26d";
+}
+.fa-500px:before {
+ content: "\f26e";
+}
+.fa-amazon:before {
+ content: "\f270";
+}
+.fa-calendar-plus-o:before {
+ content: "\f271";
+}
+.fa-calendar-minus-o:before {
+ content: "\f272";
+}
+.fa-calendar-times-o:before {
+ content: "\f273";
+}
+.fa-calendar-check-o:before {
+ content: "\f274";
+}
+.fa-industry:before {
+ content: "\f275";
+}
+.fa-map-pin:before {
+ content: "\f276";
+}
+.fa-map-signs:before {
+ content: "\f277";
+}
+.fa-map-o:before {
+ content: "\f278";
+}
+.fa-map:before {
+ content: "\f279";
+}
+.fa-commenting:before {
+ content: "\f27a";
+}
+.fa-commenting-o:before {
+ content: "\f27b";
+}
+.fa-houzz:before {
+ content: "\f27c";
+}
+.fa-vimeo:before {
+ content: "\f27d";
+}
+.fa-black-tie:before {
+ content: "\f27e";
+}
+.fa-fonticons:before {
+ content: "\f280";
+}
diff --git a/resources/font-awesome/css/font-awesome.min.css b/resources/font-awesome/css/font-awesome.min.css
new file mode 100644
index 00000000..ee4e9782
--- /dev/null
+++ b/resources/font-awesome/css/font-awesome.min.css
@@ -0,0 +1,4 @@
+/*!
+ * Font Awesome 4.4.0 by @davegandy - http://fontawesome.io - @fontawesome
+ * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
+ */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.4.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.4.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.4.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.4.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.4.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.4.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}
diff --git a/resources/font-awesome/fonts/FontAwesome.otf b/resources/font-awesome/fonts/FontAwesome.otf
new file mode 100644
index 00000000..681bdd4d
Binary files /dev/null and b/resources/font-awesome/fonts/FontAwesome.otf differ
diff --git a/resources/font-awesome/fonts/fontawesome-webfont.eot b/resources/font-awesome/fonts/fontawesome-webfont.eot
new file mode 100644
index 00000000..a30335d7
Binary files /dev/null and b/resources/font-awesome/fonts/fontawesome-webfont.eot differ
diff --git a/resources/font-awesome/fonts/fontawesome-webfont.svg b/resources/font-awesome/fonts/fontawesome-webfont.svg
new file mode 100644
index 00000000..6fd19abc
--- /dev/null
+++ b/resources/font-awesome/fonts/fontawesome-webfont.svg
@@ -0,0 +1,640 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/font-awesome/fonts/fontawesome-webfont.ttf b/resources/font-awesome/fonts/fontawesome-webfont.ttf
new file mode 100644
index 00000000..d7994e13
Binary files /dev/null and b/resources/font-awesome/fonts/fontawesome-webfont.ttf differ
diff --git a/resources/font-awesome/fonts/fontawesome-webfont.woff b/resources/font-awesome/fonts/fontawesome-webfont.woff
new file mode 100644
index 00000000..6fd4ede0
Binary files /dev/null and b/resources/font-awesome/fonts/fontawesome-webfont.woff differ
diff --git a/resources/font-awesome/fonts/fontawesome-webfont.woff2 b/resources/font-awesome/fonts/fontawesome-webfont.woff2
new file mode 100644
index 00000000..5560193c
Binary files /dev/null and b/resources/font-awesome/fonts/fontawesome-webfont.woff2 differ
diff --git a/resources/img/supporters/freshmilk.jpg b/resources/img/supporters/freshmilk.jpg
new file mode 100644
index 00000000..6027a2bf
Binary files /dev/null and b/resources/img/supporters/freshmilk.jpg differ
diff --git a/resources/img/supporters/salesforcefoundation.jpg b/resources/img/supporters/salesforcefoundation.jpg
new file mode 100644
index 00000000..b7a73cfd
Binary files /dev/null and b/resources/img/supporters/salesforcefoundation.jpg differ
diff --git a/resources/img/supporters/uhura.jpg b/resources/img/supporters/uhura.jpg
new file mode 100644
index 00000000..f8b79e08
Binary files /dev/null and b/resources/img/supporters/uhura.jpg differ
diff --git a/resources/img/supporters/upstruct.jpg b/resources/img/supporters/upstruct.jpg
new file mode 100644
index 00000000..38fc9519
Binary files /dev/null and b/resources/img/supporters/upstruct.jpg differ
diff --git a/resources/momentjs/moment-with-locales.js b/resources/momentjs/moment-with-locales.js
new file mode 100644
index 00000000..e2bc4a12
--- /dev/null
+++ b/resources/momentjs/moment-with-locales.js
@@ -0,0 +1,9977 @@
+(function (global, factory) {
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define(factory) :
+ global.moment = factory()
+}(this, function () { 'use strict';
+
+ var hookCallback;
+
+ function utils_hooks__hooks () {
+ return hookCallback.apply(null, arguments);
+ }
+
+ // This is done to register the method called with moment()
+ // without creating circular dependencies.
+ function setHookCallback (callback) {
+ hookCallback = callback;
+ }
+
+ function isArray(input) {
+ return Object.prototype.toString.call(input) === '[object Array]';
+ }
+
+ function isDate(input) {
+ return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
+ }
+
+ function map(arr, fn) {
+ var res = [], i;
+ for (i = 0; i < arr.length; ++i) {
+ res.push(fn(arr[i], i));
+ }
+ return res;
+ }
+
+ function hasOwnProp(a, b) {
+ return Object.prototype.hasOwnProperty.call(a, b);
+ }
+
+ function extend(a, b) {
+ for (var i in b) {
+ if (hasOwnProp(b, i)) {
+ a[i] = b[i];
+ }
+ }
+
+ if (hasOwnProp(b, 'toString')) {
+ a.toString = b.toString;
+ }
+
+ if (hasOwnProp(b, 'valueOf')) {
+ a.valueOf = b.valueOf;
+ }
+
+ return a;
+ }
+
+ function create_utc__createUTC (input, format, locale, strict) {
+ return createLocalOrUTC(input, format, locale, strict, true).utc();
+ }
+
+ function defaultParsingFlags() {
+ // We need to deep clone this object.
+ return {
+ empty : false,
+ unusedTokens : [],
+ unusedInput : [],
+ overflow : -2,
+ charsLeftOver : 0,
+ nullInput : false,
+ invalidMonth : null,
+ invalidFormat : false,
+ userInvalidated : false,
+ iso : false
+ };
+ }
+
+ function getParsingFlags(m) {
+ if (m._pf == null) {
+ m._pf = defaultParsingFlags();
+ }
+ return m._pf;
+ }
+
+ function valid__isValid(m) {
+ if (m._isValid == null) {
+ var flags = getParsingFlags(m);
+ m._isValid = !isNaN(m._d.getTime()) &&
+ flags.overflow < 0 &&
+ !flags.empty &&
+ !flags.invalidMonth &&
+ !flags.invalidWeekday &&
+ !flags.nullInput &&
+ !flags.invalidFormat &&
+ !flags.userInvalidated;
+
+ if (m._strict) {
+ m._isValid = m._isValid &&
+ flags.charsLeftOver === 0 &&
+ flags.unusedTokens.length === 0 &&
+ flags.bigHour === undefined;
+ }
+ }
+ return m._isValid;
+ }
+
+ function valid__createInvalid (flags) {
+ var m = create_utc__createUTC(NaN);
+ if (flags != null) {
+ extend(getParsingFlags(m), flags);
+ }
+ else {
+ getParsingFlags(m).userInvalidated = true;
+ }
+
+ return m;
+ }
+
+ var momentProperties = utils_hooks__hooks.momentProperties = [];
+
+ function copyConfig(to, from) {
+ var i, prop, val;
+
+ if (typeof from._isAMomentObject !== 'undefined') {
+ to._isAMomentObject = from._isAMomentObject;
+ }
+ if (typeof from._i !== 'undefined') {
+ to._i = from._i;
+ }
+ if (typeof from._f !== 'undefined') {
+ to._f = from._f;
+ }
+ if (typeof from._l !== 'undefined') {
+ to._l = from._l;
+ }
+ if (typeof from._strict !== 'undefined') {
+ to._strict = from._strict;
+ }
+ if (typeof from._tzm !== 'undefined') {
+ to._tzm = from._tzm;
+ }
+ if (typeof from._isUTC !== 'undefined') {
+ to._isUTC = from._isUTC;
+ }
+ if (typeof from._offset !== 'undefined') {
+ to._offset = from._offset;
+ }
+ if (typeof from._pf !== 'undefined') {
+ to._pf = getParsingFlags(from);
+ }
+ if (typeof from._locale !== 'undefined') {
+ to._locale = from._locale;
+ }
+
+ if (momentProperties.length > 0) {
+ for (i in momentProperties) {
+ prop = momentProperties[i];
+ val = from[prop];
+ if (typeof val !== 'undefined') {
+ to[prop] = val;
+ }
+ }
+ }
+
+ return to;
+ }
+
+ var updateInProgress = false;
+
+ // Moment prototype object
+ function Moment(config) {
+ copyConfig(this, config);
+ this._d = new Date(config._d != null ? config._d.getTime() : NaN);
+ // Prevent infinite loop in case updateOffset creates new moment
+ // objects.
+ if (updateInProgress === false) {
+ updateInProgress = true;
+ utils_hooks__hooks.updateOffset(this);
+ updateInProgress = false;
+ }
+ }
+
+ function isMoment (obj) {
+ return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
+ }
+
+ function absFloor (number) {
+ if (number < 0) {
+ return Math.ceil(number);
+ } else {
+ return Math.floor(number);
+ }
+ }
+
+ function toInt(argumentForCoercion) {
+ var coercedNumber = +argumentForCoercion,
+ value = 0;
+
+ if (coercedNumber !== 0 && isFinite(coercedNumber)) {
+ value = absFloor(coercedNumber);
+ }
+
+ return value;
+ }
+
+ function compareArrays(array1, array2, dontConvert) {
+ var len = Math.min(array1.length, array2.length),
+ lengthDiff = Math.abs(array1.length - array2.length),
+ diffs = 0,
+ i;
+ for (i = 0; i < len; i++) {
+ if ((dontConvert && array1[i] !== array2[i]) ||
+ (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
+ diffs++;
+ }
+ }
+ return diffs + lengthDiff;
+ }
+
+ function Locale() {
+ }
+
+ var locales = {};
+ var globalLocale;
+
+ function normalizeLocale(key) {
+ return key ? key.toLowerCase().replace('_', '-') : key;
+ }
+
+ // pick the locale from the array
+ // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
+ // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
+ function chooseLocale(names) {
+ var i = 0, j, next, locale, split;
+
+ while (i < names.length) {
+ split = normalizeLocale(names[i]).split('-');
+ j = split.length;
+ next = normalizeLocale(names[i + 1]);
+ next = next ? next.split('-') : null;
+ while (j > 0) {
+ locale = loadLocale(split.slice(0, j).join('-'));
+ if (locale) {
+ return locale;
+ }
+ if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
+ //the next array item is better than a shallower substring of this one
+ break;
+ }
+ j--;
+ }
+ i++;
+ }
+ return null;
+ }
+
+ function loadLocale(name) {
+ var oldLocale = null;
+ // TODO: Find a better way to register and load all the locales in Node
+ if (!locales[name] && typeof module !== 'undefined' &&
+ module && module.exports) {
+ try {
+ oldLocale = globalLocale._abbr;
+ require('./locale/' + name);
+ // because defineLocale currently also sets the global locale, we
+ // want to undo that for lazy loaded locales
+ locale_locales__getSetGlobalLocale(oldLocale);
+ } catch (e) { }
+ }
+ return locales[name];
+ }
+
+ // This function will load locale and then set the global locale. If
+ // no arguments are passed in, it will simply return the current global
+ // locale key.
+ function locale_locales__getSetGlobalLocale (key, values) {
+ var data;
+ if (key) {
+ if (typeof values === 'undefined') {
+ data = locale_locales__getLocale(key);
+ }
+ else {
+ data = defineLocale(key, values);
+ }
+
+ if (data) {
+ // moment.duration._locale = moment._locale = data;
+ globalLocale = data;
+ }
+ }
+
+ return globalLocale._abbr;
+ }
+
+ function defineLocale (name, values) {
+ if (values !== null) {
+ values.abbr = name;
+ locales[name] = locales[name] || new Locale();
+ locales[name].set(values);
+
+ // backwards compat for now: also set the locale
+ locale_locales__getSetGlobalLocale(name);
+
+ return locales[name];
+ } else {
+ // useful for testing
+ delete locales[name];
+ return null;
+ }
+ }
+
+ // returns locale data
+ function locale_locales__getLocale (key) {
+ var locale;
+
+ if (key && key._locale && key._locale._abbr) {
+ key = key._locale._abbr;
+ }
+
+ if (!key) {
+ return globalLocale;
+ }
+
+ if (!isArray(key)) {
+ //short-circuit everything else
+ locale = loadLocale(key);
+ if (locale) {
+ return locale;
+ }
+ key = [key];
+ }
+
+ return chooseLocale(key);
+ }
+
+ var aliases = {};
+
+ function addUnitAlias (unit, shorthand) {
+ var lowerCase = unit.toLowerCase();
+ aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
+ }
+
+ function normalizeUnits(units) {
+ return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
+ }
+
+ function normalizeObjectUnits(inputObject) {
+ var normalizedInput = {},
+ normalizedProp,
+ prop;
+
+ for (prop in inputObject) {
+ if (hasOwnProp(inputObject, prop)) {
+ normalizedProp = normalizeUnits(prop);
+ if (normalizedProp) {
+ normalizedInput[normalizedProp] = inputObject[prop];
+ }
+ }
+ }
+
+ return normalizedInput;
+ }
+
+ function makeGetSet (unit, keepTime) {
+ return function (value) {
+ if (value != null) {
+ get_set__set(this, unit, value);
+ utils_hooks__hooks.updateOffset(this, keepTime);
+ return this;
+ } else {
+ return get_set__get(this, unit);
+ }
+ };
+ }
+
+ function get_set__get (mom, unit) {
+ return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]();
+ }
+
+ function get_set__set (mom, unit, value) {
+ return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
+ }
+
+ // MOMENTS
+
+ function getSet (units, value) {
+ var unit;
+ if (typeof units === 'object') {
+ for (unit in units) {
+ this.set(unit, units[unit]);
+ }
+ } else {
+ units = normalizeUnits(units);
+ if (typeof this[units] === 'function') {
+ return this[units](value);
+ }
+ }
+ return this;
+ }
+
+ function zeroFill(number, targetLength, forceSign) {
+ var absNumber = '' + Math.abs(number),
+ zerosToFill = targetLength - absNumber.length,
+ sign = number >= 0;
+ return (sign ? (forceSign ? '+' : '') : '-') +
+ Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
+ }
+
+ var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
+
+ var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
+
+ var formatFunctions = {};
+
+ var formatTokenFunctions = {};
+
+ // token: 'M'
+ // padded: ['MM', 2]
+ // ordinal: 'Mo'
+ // callback: function () { this.month() + 1 }
+ function addFormatToken (token, padded, ordinal, callback) {
+ var func = callback;
+ if (typeof callback === 'string') {
+ func = function () {
+ return this[callback]();
+ };
+ }
+ if (token) {
+ formatTokenFunctions[token] = func;
+ }
+ if (padded) {
+ formatTokenFunctions[padded[0]] = function () {
+ return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
+ };
+ }
+ if (ordinal) {
+ formatTokenFunctions[ordinal] = function () {
+ return this.localeData().ordinal(func.apply(this, arguments), token);
+ };
+ }
+ }
+
+ function removeFormattingTokens(input) {
+ if (input.match(/\[[\s\S]/)) {
+ return input.replace(/^\[|\]$/g, '');
+ }
+ return input.replace(/\\/g, '');
+ }
+
+ function makeFormatFunction(format) {
+ var array = format.match(formattingTokens), i, length;
+
+ for (i = 0, length = array.length; i < length; i++) {
+ if (formatTokenFunctions[array[i]]) {
+ array[i] = formatTokenFunctions[array[i]];
+ } else {
+ array[i] = removeFormattingTokens(array[i]);
+ }
+ }
+
+ return function (mom) {
+ var output = '';
+ for (i = 0; i < length; i++) {
+ output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
+ }
+ return output;
+ };
+ }
+
+ // format date using native date object
+ function formatMoment(m, format) {
+ if (!m.isValid()) {
+ return m.localeData().invalidDate();
+ }
+
+ format = expandFormat(format, m.localeData());
+ formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
+
+ return formatFunctions[format](m);
+ }
+
+ function expandFormat(format, locale) {
+ var i = 5;
+
+ function replaceLongDateFormatTokens(input) {
+ return locale.longDateFormat(input) || input;
+ }
+
+ localFormattingTokens.lastIndex = 0;
+ while (i >= 0 && localFormattingTokens.test(format)) {
+ format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
+ localFormattingTokens.lastIndex = 0;
+ i -= 1;
+ }
+
+ return format;
+ }
+
+ var match1 = /\d/; // 0 - 9
+ var match2 = /\d\d/; // 00 - 99
+ var match3 = /\d{3}/; // 000 - 999
+ var match4 = /\d{4}/; // 0000 - 9999
+ var match6 = /[+-]?\d{6}/; // -999999 - 999999
+ var match1to2 = /\d\d?/; // 0 - 99
+ var match1to3 = /\d{1,3}/; // 0 - 999
+ var match1to4 = /\d{1,4}/; // 0 - 9999
+ var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
+
+ var matchUnsigned = /\d+/; // 0 - inf
+ var matchSigned = /[+-]?\d+/; // -inf - inf
+
+ var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
+
+ var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
+
+ // any word (or two) characters or numbers including two/three word month in arabic.
+ var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
+
+ var regexes = {};
+
+ function isFunction (sth) {
+ // https://github.com/moment/moment/issues/2325
+ return typeof sth === 'function' &&
+ Object.prototype.toString.call(sth) === '[object Function]';
+ }
+
+
+ function addRegexToken (token, regex, strictRegex) {
+ regexes[token] = isFunction(regex) ? regex : function (isStrict) {
+ return (isStrict && strictRegex) ? strictRegex : regex;
+ };
+ }
+
+ function getParseRegexForToken (token, config) {
+ if (!hasOwnProp(regexes, token)) {
+ return new RegExp(unescapeFormat(token));
+ }
+
+ return regexes[token](config._strict, config._locale);
+ }
+
+ // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
+ function unescapeFormat(s) {
+ return s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
+ return p1 || p2 || p3 || p4;
+ }).replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
+ }
+
+ var tokens = {};
+
+ function addParseToken (token, callback) {
+ var i, func = callback;
+ if (typeof token === 'string') {
+ token = [token];
+ }
+ if (typeof callback === 'number') {
+ func = function (input, array) {
+ array[callback] = toInt(input);
+ };
+ }
+ for (i = 0; i < token.length; i++) {
+ tokens[token[i]] = func;
+ }
+ }
+
+ function addWeekParseToken (token, callback) {
+ addParseToken(token, function (input, array, config, token) {
+ config._w = config._w || {};
+ callback(input, config._w, config, token);
+ });
+ }
+
+ function addTimeToArrayFromToken(token, input, config) {
+ if (input != null && hasOwnProp(tokens, token)) {
+ tokens[token](input, config._a, config, token);
+ }
+ }
+
+ var YEAR = 0;
+ var MONTH = 1;
+ var DATE = 2;
+ var HOUR = 3;
+ var MINUTE = 4;
+ var SECOND = 5;
+ var MILLISECOND = 6;
+
+ function daysInMonth(year, month) {
+ return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
+ }
+
+ // FORMATTING
+
+ addFormatToken('M', ['MM', 2], 'Mo', function () {
+ return this.month() + 1;
+ });
+
+ addFormatToken('MMM', 0, 0, function (format) {
+ return this.localeData().monthsShort(this, format);
+ });
+
+ addFormatToken('MMMM', 0, 0, function (format) {
+ return this.localeData().months(this, format);
+ });
+
+ // ALIASES
+
+ addUnitAlias('month', 'M');
+
+ // PARSING
+
+ addRegexToken('M', match1to2);
+ addRegexToken('MM', match1to2, match2);
+ addRegexToken('MMM', matchWord);
+ addRegexToken('MMMM', matchWord);
+
+ addParseToken(['M', 'MM'], function (input, array) {
+ array[MONTH] = toInt(input) - 1;
+ });
+
+ addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
+ var month = config._locale.monthsParse(input, token, config._strict);
+ // if we didn't find a month name, mark the date as invalid.
+ if (month != null) {
+ array[MONTH] = month;
+ } else {
+ getParsingFlags(config).invalidMonth = input;
+ }
+ });
+
+ // LOCALES
+
+ var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
+ function localeMonths (m) {
+ return this._months[m.month()];
+ }
+
+ var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
+ function localeMonthsShort (m) {
+ return this._monthsShort[m.month()];
+ }
+
+ function localeMonthsParse (monthName, format, strict) {
+ var i, mom, regex;
+
+ if (!this._monthsParse) {
+ this._monthsParse = [];
+ this._longMonthsParse = [];
+ this._shortMonthsParse = [];
+ }
+
+ for (i = 0; i < 12; i++) {
+ // make the regex if we don't have it already
+ mom = create_utc__createUTC([2000, i]);
+ if (strict && !this._longMonthsParse[i]) {
+ this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
+ this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
+ }
+ if (!strict && !this._monthsParse[i]) {
+ regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
+ this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
+ }
+ // test the regex
+ if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
+ return i;
+ } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
+ return i;
+ } else if (!strict && this._monthsParse[i].test(monthName)) {
+ return i;
+ }
+ }
+ }
+
+ // MOMENTS
+
+ function setMonth (mom, value) {
+ var dayOfMonth;
+
+ // TODO: Move this out of here!
+ if (typeof value === 'string') {
+ value = mom.localeData().monthsParse(value);
+ // TODO: Another silent failure?
+ if (typeof value !== 'number') {
+ return mom;
+ }
+ }
+
+ dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
+ mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
+ return mom;
+ }
+
+ function getSetMonth (value) {
+ if (value != null) {
+ setMonth(this, value);
+ utils_hooks__hooks.updateOffset(this, true);
+ return this;
+ } else {
+ return get_set__get(this, 'Month');
+ }
+ }
+
+ function getDaysInMonth () {
+ return daysInMonth(this.year(), this.month());
+ }
+
+ function checkOverflow (m) {
+ var overflow;
+ var a = m._a;
+
+ if (a && getParsingFlags(m).overflow === -2) {
+ overflow =
+ a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
+ a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
+ a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
+ a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
+ a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
+ a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
+ -1;
+
+ if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
+ overflow = DATE;
+ }
+
+ getParsingFlags(m).overflow = overflow;
+ }
+
+ return m;
+ }
+
+ function warn(msg) {
+ if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) {
+ console.warn('Deprecation warning: ' + msg);
+ }
+ }
+
+ function deprecate(msg, fn) {
+ var firstTime = true;
+
+ return extend(function () {
+ if (firstTime) {
+ warn(msg + '\n' + (new Error()).stack);
+ firstTime = false;
+ }
+ return fn.apply(this, arguments);
+ }, fn);
+ }
+
+ var deprecations = {};
+
+ function deprecateSimple(name, msg) {
+ if (!deprecations[name]) {
+ warn(msg);
+ deprecations[name] = true;
+ }
+ }
+
+ utils_hooks__hooks.suppressDeprecationWarnings = false;
+
+ var from_string__isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
+
+ var isoDates = [
+ ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/],
+ ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/],
+ ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/],
+ ['GGGG-[W]WW', /\d{4}-W\d{2}/],
+ ['YYYY-DDD', /\d{4}-\d{3}/]
+ ];
+
+ // iso time formats and regexes
+ var isoTimes = [
+ ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/],
+ ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/],
+ ['HH:mm', /(T| )\d\d:\d\d/],
+ ['HH', /(T| )\d\d/]
+ ];
+
+ var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
+
+ // date from iso format
+ function configFromISO(config) {
+ var i, l,
+ string = config._i,
+ match = from_string__isoRegex.exec(string);
+
+ if (match) {
+ getParsingFlags(config).iso = true;
+ for (i = 0, l = isoDates.length; i < l; i++) {
+ if (isoDates[i][1].exec(string)) {
+ config._f = isoDates[i][0];
+ break;
+ }
+ }
+ for (i = 0, l = isoTimes.length; i < l; i++) {
+ if (isoTimes[i][1].exec(string)) {
+ // match[6] should be 'T' or space
+ config._f += (match[6] || ' ') + isoTimes[i][0];
+ break;
+ }
+ }
+ if (string.match(matchOffset)) {
+ config._f += 'Z';
+ }
+ configFromStringAndFormat(config);
+ } else {
+ config._isValid = false;
+ }
+ }
+
+ // date from iso format or fallback
+ function configFromString(config) {
+ var matched = aspNetJsonRegex.exec(config._i);
+
+ if (matched !== null) {
+ config._d = new Date(+matched[1]);
+ return;
+ }
+
+ configFromISO(config);
+ if (config._isValid === false) {
+ delete config._isValid;
+ utils_hooks__hooks.createFromInputFallback(config);
+ }
+ }
+
+ utils_hooks__hooks.createFromInputFallback = deprecate(
+ 'moment construction falls back to js Date. This is ' +
+ 'discouraged and will be removed in upcoming major ' +
+ 'release. Please refer to ' +
+ 'https://github.com/moment/moment/issues/1407 for more info.',
+ function (config) {
+ config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
+ }
+ );
+
+ function createDate (y, m, d, h, M, s, ms) {
+ //can't just apply() to create a date:
+ //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
+ var date = new Date(y, m, d, h, M, s, ms);
+
+ //the date constructor doesn't accept years < 1970
+ if (y < 1970) {
+ date.setFullYear(y);
+ }
+ return date;
+ }
+
+ function createUTCDate (y) {
+ var date = new Date(Date.UTC.apply(null, arguments));
+ if (y < 1970) {
+ date.setUTCFullYear(y);
+ }
+ return date;
+ }
+
+ addFormatToken(0, ['YY', 2], 0, function () {
+ return this.year() % 100;
+ });
+
+ addFormatToken(0, ['YYYY', 4], 0, 'year');
+ addFormatToken(0, ['YYYYY', 5], 0, 'year');
+ addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
+
+ // ALIASES
+
+ addUnitAlias('year', 'y');
+
+ // PARSING
+
+ addRegexToken('Y', matchSigned);
+ addRegexToken('YY', match1to2, match2);
+ addRegexToken('YYYY', match1to4, match4);
+ addRegexToken('YYYYY', match1to6, match6);
+ addRegexToken('YYYYYY', match1to6, match6);
+
+ addParseToken(['YYYYY', 'YYYYYY'], YEAR);
+ addParseToken('YYYY', function (input, array) {
+ array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input);
+ });
+ addParseToken('YY', function (input, array) {
+ array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input);
+ });
+
+ // HELPERS
+
+ function daysInYear(year) {
+ return isLeapYear(year) ? 366 : 365;
+ }
+
+ function isLeapYear(year) {
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
+ }
+
+ // HOOKS
+
+ utils_hooks__hooks.parseTwoDigitYear = function (input) {
+ return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
+ };
+
+ // MOMENTS
+
+ var getSetYear = makeGetSet('FullYear', false);
+
+ function getIsLeapYear () {
+ return isLeapYear(this.year());
+ }
+
+ addFormatToken('w', ['ww', 2], 'wo', 'week');
+ addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
+
+ // ALIASES
+
+ addUnitAlias('week', 'w');
+ addUnitAlias('isoWeek', 'W');
+
+ // PARSING
+
+ addRegexToken('w', match1to2);
+ addRegexToken('ww', match1to2, match2);
+ addRegexToken('W', match1to2);
+ addRegexToken('WW', match1to2, match2);
+
+ addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
+ week[token.substr(0, 1)] = toInt(input);
+ });
+
+ // HELPERS
+
+ // firstDayOfWeek 0 = sun, 6 = sat
+ // the day of the week that starts the week
+ // (usually sunday or monday)
+ // firstDayOfWeekOfYear 0 = sun, 6 = sat
+ // the first week is the week that contains the first
+ // of this day of the week
+ // (eg. ISO weeks use thursday (4))
+ function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {
+ var end = firstDayOfWeekOfYear - firstDayOfWeek,
+ daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(),
+ adjustedMoment;
+
+
+ if (daysToDayOfWeek > end) {
+ daysToDayOfWeek -= 7;
+ }
+
+ if (daysToDayOfWeek < end - 7) {
+ daysToDayOfWeek += 7;
+ }
+
+ adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd');
+ return {
+ week: Math.ceil(adjustedMoment.dayOfYear() / 7),
+ year: adjustedMoment.year()
+ };
+ }
+
+ // LOCALES
+
+ function localeWeek (mom) {
+ return weekOfYear(mom, this._week.dow, this._week.doy).week;
+ }
+
+ var defaultLocaleWeek = {
+ dow : 0, // Sunday is the first day of the week.
+ doy : 6 // The week that contains Jan 1st is the first week of the year.
+ };
+
+ function localeFirstDayOfWeek () {
+ return this._week.dow;
+ }
+
+ function localeFirstDayOfYear () {
+ return this._week.doy;
+ }
+
+ // MOMENTS
+
+ function getSetWeek (input) {
+ var week = this.localeData().week(this);
+ return input == null ? week : this.add((input - week) * 7, 'd');
+ }
+
+ function getSetISOWeek (input) {
+ var week = weekOfYear(this, 1, 4).week;
+ return input == null ? week : this.add((input - week) * 7, 'd');
+ }
+
+ addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
+
+ // ALIASES
+
+ addUnitAlias('dayOfYear', 'DDD');
+
+ // PARSING
+
+ addRegexToken('DDD', match1to3);
+ addRegexToken('DDDD', match3);
+ addParseToken(['DDD', 'DDDD'], function (input, array, config) {
+ config._dayOfYear = toInt(input);
+ });
+
+ // HELPERS
+
+ //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
+ function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) {
+ var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear;
+ if (d < firstDayOfWeek) {
+ d += 7;
+ }
+
+ weekday = weekday != null ? 1 * weekday : firstDayOfWeek;
+
+ dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday;
+
+ return {
+ year: dayOfYear > 0 ? year : year - 1,
+ dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear
+ };
+ }
+
+ // MOMENTS
+
+ function getSetDayOfYear (input) {
+ var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
+ return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
+ }
+
+ // Pick the first defined of two or three arguments.
+ function defaults(a, b, c) {
+ if (a != null) {
+ return a;
+ }
+ if (b != null) {
+ return b;
+ }
+ return c;
+ }
+
+ function currentDateArray(config) {
+ var now = new Date();
+ if (config._useUTC) {
+ return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()];
+ }
+ return [now.getFullYear(), now.getMonth(), now.getDate()];
+ }
+
+ // convert an array to a date.
+ // the array should mirror the parameters below
+ // note: all values past the year are optional and will default to the lowest possible value.
+ // [year, month, day , hour, minute, second, millisecond]
+ function configFromArray (config) {
+ var i, date, input = [], currentDate, yearToUse;
+
+ if (config._d) {
+ return;
+ }
+
+ currentDate = currentDateArray(config);
+
+ //compute day of the year from weeks and weekdays
+ if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
+ dayOfYearFromWeekInfo(config);
+ }
+
+ //if the day of the year is set, figure out what it is
+ if (config._dayOfYear) {
+ yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
+
+ if (config._dayOfYear > daysInYear(yearToUse)) {
+ getParsingFlags(config)._overflowDayOfYear = true;
+ }
+
+ date = createUTCDate(yearToUse, 0, config._dayOfYear);
+ config._a[MONTH] = date.getUTCMonth();
+ config._a[DATE] = date.getUTCDate();
+ }
+
+ // Default to current date.
+ // * if no year, month, day of month are given, default to today
+ // * if day of month is given, default month and year
+ // * if month is given, default only year
+ // * if year is given, don't default anything
+ for (i = 0; i < 3 && config._a[i] == null; ++i) {
+ config._a[i] = input[i] = currentDate[i];
+ }
+
+ // Zero out whatever was not defaulted, including time
+ for (; i < 7; i++) {
+ config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
+ }
+
+ // Check for 24:00:00.000
+ if (config._a[HOUR] === 24 &&
+ config._a[MINUTE] === 0 &&
+ config._a[SECOND] === 0 &&
+ config._a[MILLISECOND] === 0) {
+ config._nextDay = true;
+ config._a[HOUR] = 0;
+ }
+
+ config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
+ // Apply timezone offset from input. The actual utcOffset can be changed
+ // with parseZone.
+ if (config._tzm != null) {
+ config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
+ }
+
+ if (config._nextDay) {
+ config._a[HOUR] = 24;
+ }
+ }
+
+ function dayOfYearFromWeekInfo(config) {
+ var w, weekYear, week, weekday, dow, doy, temp;
+
+ w = config._w;
+ if (w.GG != null || w.W != null || w.E != null) {
+ dow = 1;
+ doy = 4;
+
+ // TODO: We need to take the current isoWeekYear, but that depends on
+ // how we interpret now (local, utc, fixed offset). So create
+ // a now version of current config (take local/utc/offset flags, and
+ // create now).
+ weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year);
+ week = defaults(w.W, 1);
+ weekday = defaults(w.E, 1);
+ } else {
+ dow = config._locale._week.dow;
+ doy = config._locale._week.doy;
+
+ weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year);
+ week = defaults(w.w, 1);
+
+ if (w.d != null) {
+ // weekday -- low day numbers are considered next week
+ weekday = w.d;
+ if (weekday < dow) {
+ ++week;
+ }
+ } else if (w.e != null) {
+ // local weekday -- counting starts from begining of week
+ weekday = w.e + dow;
+ } else {
+ // default to begining of week
+ weekday = dow;
+ }
+ }
+ temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow);
+
+ config._a[YEAR] = temp.year;
+ config._dayOfYear = temp.dayOfYear;
+ }
+
+ utils_hooks__hooks.ISO_8601 = function () {};
+
+ // date from string and format string
+ function configFromStringAndFormat(config) {
+ // TODO: Move this to another part of the creation flow to prevent circular deps
+ if (config._f === utils_hooks__hooks.ISO_8601) {
+ configFromISO(config);
+ return;
+ }
+
+ config._a = [];
+ getParsingFlags(config).empty = true;
+
+ // This array is used to make a Date, either with `new Date` or `Date.UTC`
+ var string = '' + config._i,
+ i, parsedInput, tokens, token, skipped,
+ stringLength = string.length,
+ totalParsedInputLength = 0;
+
+ tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
+
+ for (i = 0; i < tokens.length; i++) {
+ token = tokens[i];
+ parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
+ if (parsedInput) {
+ skipped = string.substr(0, string.indexOf(parsedInput));
+ if (skipped.length > 0) {
+ getParsingFlags(config).unusedInput.push(skipped);
+ }
+ string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
+ totalParsedInputLength += parsedInput.length;
+ }
+ // don't parse if it's not a known token
+ if (formatTokenFunctions[token]) {
+ if (parsedInput) {
+ getParsingFlags(config).empty = false;
+ }
+ else {
+ getParsingFlags(config).unusedTokens.push(token);
+ }
+ addTimeToArrayFromToken(token, parsedInput, config);
+ }
+ else if (config._strict && !parsedInput) {
+ getParsingFlags(config).unusedTokens.push(token);
+ }
+ }
+
+ // add remaining unparsed input length to the string
+ getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
+ if (string.length > 0) {
+ getParsingFlags(config).unusedInput.push(string);
+ }
+
+ // clear _12h flag if hour is <= 12
+ if (getParsingFlags(config).bigHour === true &&
+ config._a[HOUR] <= 12 &&
+ config._a[HOUR] > 0) {
+ getParsingFlags(config).bigHour = undefined;
+ }
+ // handle meridiem
+ config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
+
+ configFromArray(config);
+ checkOverflow(config);
+ }
+
+
+ function meridiemFixWrap (locale, hour, meridiem) {
+ var isPm;
+
+ if (meridiem == null) {
+ // nothing to do
+ return hour;
+ }
+ if (locale.meridiemHour != null) {
+ return locale.meridiemHour(hour, meridiem);
+ } else if (locale.isPM != null) {
+ // Fallback
+ isPm = locale.isPM(meridiem);
+ if (isPm && hour < 12) {
+ hour += 12;
+ }
+ if (!isPm && hour === 12) {
+ hour = 0;
+ }
+ return hour;
+ } else {
+ // this is not supposed to happen
+ return hour;
+ }
+ }
+
+ function configFromStringAndArray(config) {
+ var tempConfig,
+ bestMoment,
+
+ scoreToBeat,
+ i,
+ currentScore;
+
+ if (config._f.length === 0) {
+ getParsingFlags(config).invalidFormat = true;
+ config._d = new Date(NaN);
+ return;
+ }
+
+ for (i = 0; i < config._f.length; i++) {
+ currentScore = 0;
+ tempConfig = copyConfig({}, config);
+ if (config._useUTC != null) {
+ tempConfig._useUTC = config._useUTC;
+ }
+ tempConfig._f = config._f[i];
+ configFromStringAndFormat(tempConfig);
+
+ if (!valid__isValid(tempConfig)) {
+ continue;
+ }
+
+ // if there is any input that was not parsed add a penalty for that format
+ currentScore += getParsingFlags(tempConfig).charsLeftOver;
+
+ //or tokens
+ currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
+
+ getParsingFlags(tempConfig).score = currentScore;
+
+ if (scoreToBeat == null || currentScore < scoreToBeat) {
+ scoreToBeat = currentScore;
+ bestMoment = tempConfig;
+ }
+ }
+
+ extend(config, bestMoment || tempConfig);
+ }
+
+ function configFromObject(config) {
+ if (config._d) {
+ return;
+ }
+
+ var i = normalizeObjectUnits(config._i);
+ config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond];
+
+ configFromArray(config);
+ }
+
+ function createFromConfig (config) {
+ var res = new Moment(checkOverflow(prepareConfig(config)));
+ if (res._nextDay) {
+ // Adding is smart enough around DST
+ res.add(1, 'd');
+ res._nextDay = undefined;
+ }
+
+ return res;
+ }
+
+ function prepareConfig (config) {
+ var input = config._i,
+ format = config._f;
+
+ config._locale = config._locale || locale_locales__getLocale(config._l);
+
+ if (input === null || (format === undefined && input === '')) {
+ return valid__createInvalid({nullInput: true});
+ }
+
+ if (typeof input === 'string') {
+ config._i = input = config._locale.preparse(input);
+ }
+
+ if (isMoment(input)) {
+ return new Moment(checkOverflow(input));
+ } else if (isArray(format)) {
+ configFromStringAndArray(config);
+ } else if (format) {
+ configFromStringAndFormat(config);
+ } else if (isDate(input)) {
+ config._d = input;
+ } else {
+ configFromInput(config);
+ }
+
+ return config;
+ }
+
+ function configFromInput(config) {
+ var input = config._i;
+ if (input === undefined) {
+ config._d = new Date();
+ } else if (isDate(input)) {
+ config._d = new Date(+input);
+ } else if (typeof input === 'string') {
+ configFromString(config);
+ } else if (isArray(input)) {
+ config._a = map(input.slice(0), function (obj) {
+ return parseInt(obj, 10);
+ });
+ configFromArray(config);
+ } else if (typeof(input) === 'object') {
+ configFromObject(config);
+ } else if (typeof(input) === 'number') {
+ // from milliseconds
+ config._d = new Date(input);
+ } else {
+ utils_hooks__hooks.createFromInputFallback(config);
+ }
+ }
+
+ function createLocalOrUTC (input, format, locale, strict, isUTC) {
+ var c = {};
+
+ if (typeof(locale) === 'boolean') {
+ strict = locale;
+ locale = undefined;
+ }
+ // object construction must be done this way.
+ // https://github.com/moment/moment/issues/1423
+ c._isAMomentObject = true;
+ c._useUTC = c._isUTC = isUTC;
+ c._l = locale;
+ c._i = input;
+ c._f = format;
+ c._strict = strict;
+
+ return createFromConfig(c);
+ }
+
+ function local__createLocal (input, format, locale, strict) {
+ return createLocalOrUTC(input, format, locale, strict, false);
+ }
+
+ var prototypeMin = deprecate(
+ 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548',
+ function () {
+ var other = local__createLocal.apply(null, arguments);
+ return other < this ? this : other;
+ }
+ );
+
+ var prototypeMax = deprecate(
+ 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548',
+ function () {
+ var other = local__createLocal.apply(null, arguments);
+ return other > this ? this : other;
+ }
+ );
+
+ // Pick a moment m from moments so that m[fn](other) is true for all
+ // other. This relies on the function fn to be transitive.
+ //
+ // moments should either be an array of moment objects or an array, whose
+ // first element is an array of moment objects.
+ function pickBy(fn, moments) {
+ var res, i;
+ if (moments.length === 1 && isArray(moments[0])) {
+ moments = moments[0];
+ }
+ if (!moments.length) {
+ return local__createLocal();
+ }
+ res = moments[0];
+ for (i = 1; i < moments.length; ++i) {
+ if (!moments[i].isValid() || moments[i][fn](res)) {
+ res = moments[i];
+ }
+ }
+ return res;
+ }
+
+ // TODO: Use [].sort instead?
+ function min () {
+ var args = [].slice.call(arguments, 0);
+
+ return pickBy('isBefore', args);
+ }
+
+ function max () {
+ var args = [].slice.call(arguments, 0);
+
+ return pickBy('isAfter', args);
+ }
+
+ function Duration (duration) {
+ var normalizedInput = normalizeObjectUnits(duration),
+ years = normalizedInput.year || 0,
+ quarters = normalizedInput.quarter || 0,
+ months = normalizedInput.month || 0,
+ weeks = normalizedInput.week || 0,
+ days = normalizedInput.day || 0,
+ hours = normalizedInput.hour || 0,
+ minutes = normalizedInput.minute || 0,
+ seconds = normalizedInput.second || 0,
+ milliseconds = normalizedInput.millisecond || 0;
+
+ // representation for dateAddRemove
+ this._milliseconds = +milliseconds +
+ seconds * 1e3 + // 1000
+ minutes * 6e4 + // 1000 * 60
+ hours * 36e5; // 1000 * 60 * 60
+ // Because of dateAddRemove treats 24 hours as different from a
+ // day when working around DST, we need to store them separately
+ this._days = +days +
+ weeks * 7;
+ // It is impossible translate months into days without knowing
+ // which months you are are talking about, so we have to store
+ // it separately.
+ this._months = +months +
+ quarters * 3 +
+ years * 12;
+
+ this._data = {};
+
+ this._locale = locale_locales__getLocale();
+
+ this._bubble();
+ }
+
+ function isDuration (obj) {
+ return obj instanceof Duration;
+ }
+
+ function offset (token, separator) {
+ addFormatToken(token, 0, 0, function () {
+ var offset = this.utcOffset();
+ var sign = '+';
+ if (offset < 0) {
+ offset = -offset;
+ sign = '-';
+ }
+ return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
+ });
+ }
+
+ offset('Z', ':');
+ offset('ZZ', '');
+
+ // PARSING
+
+ addRegexToken('Z', matchOffset);
+ addRegexToken('ZZ', matchOffset);
+ addParseToken(['Z', 'ZZ'], function (input, array, config) {
+ config._useUTC = true;
+ config._tzm = offsetFromString(input);
+ });
+
+ // HELPERS
+
+ // timezone chunker
+ // '+10:00' > ['10', '00']
+ // '-1530' > ['-15', '30']
+ var chunkOffset = /([\+\-]|\d\d)/gi;
+
+ function offsetFromString(string) {
+ var matches = ((string || '').match(matchOffset) || []);
+ var chunk = matches[matches.length - 1] || [];
+ var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
+ var minutes = +(parts[1] * 60) + toInt(parts[2]);
+
+ return parts[0] === '+' ? minutes : -minutes;
+ }
+
+ // Return a moment from input, that is local/utc/zone equivalent to model.
+ function cloneWithOffset(input, model) {
+ var res, diff;
+ if (model._isUTC) {
+ res = model.clone();
+ diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);
+ // Use low-level api, because this fn is low-level api.
+ res._d.setTime(+res._d + diff);
+ utils_hooks__hooks.updateOffset(res, false);
+ return res;
+ } else {
+ return local__createLocal(input).local();
+ }
+ }
+
+ function getDateOffset (m) {
+ // On Firefox.24 Date#getTimezoneOffset returns a floating point.
+ // https://github.com/moment/moment/pull/1871
+ return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
+ }
+
+ // HOOKS
+
+ // This function will be called whenever a moment is mutated.
+ // It is intended to keep the offset in sync with the timezone.
+ utils_hooks__hooks.updateOffset = function () {};
+
+ // MOMENTS
+
+ // keepLocalTime = true means only change the timezone, without
+ // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
+ // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
+ // +0200, so we adjust the time as needed, to be valid.
+ //
+ // Keeping the time actually adds/subtracts (one hour)
+ // from the actual represented time. That is why we call updateOffset
+ // a second time. In case it wants us to change the offset again
+ // _changeInProgress == true case, then we have to adjust, because
+ // there is no such time in the given timezone.
+ function getSetOffset (input, keepLocalTime) {
+ var offset = this._offset || 0,
+ localAdjust;
+ if (input != null) {
+ if (typeof input === 'string') {
+ input = offsetFromString(input);
+ }
+ if (Math.abs(input) < 16) {
+ input = input * 60;
+ }
+ if (!this._isUTC && keepLocalTime) {
+ localAdjust = getDateOffset(this);
+ }
+ this._offset = input;
+ this._isUTC = true;
+ if (localAdjust != null) {
+ this.add(localAdjust, 'm');
+ }
+ if (offset !== input) {
+ if (!keepLocalTime || this._changeInProgress) {
+ add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);
+ } else if (!this._changeInProgress) {
+ this._changeInProgress = true;
+ utils_hooks__hooks.updateOffset(this, true);
+ this._changeInProgress = null;
+ }
+ }
+ return this;
+ } else {
+ return this._isUTC ? offset : getDateOffset(this);
+ }
+ }
+
+ function getSetZone (input, keepLocalTime) {
+ if (input != null) {
+ if (typeof input !== 'string') {
+ input = -input;
+ }
+
+ this.utcOffset(input, keepLocalTime);
+
+ return this;
+ } else {
+ return -this.utcOffset();
+ }
+ }
+
+ function setOffsetToUTC (keepLocalTime) {
+ return this.utcOffset(0, keepLocalTime);
+ }
+
+ function setOffsetToLocal (keepLocalTime) {
+ if (this._isUTC) {
+ this.utcOffset(0, keepLocalTime);
+ this._isUTC = false;
+
+ if (keepLocalTime) {
+ this.subtract(getDateOffset(this), 'm');
+ }
+ }
+ return this;
+ }
+
+ function setOffsetToParsedOffset () {
+ if (this._tzm) {
+ this.utcOffset(this._tzm);
+ } else if (typeof this._i === 'string') {
+ this.utcOffset(offsetFromString(this._i));
+ }
+ return this;
+ }
+
+ function hasAlignedHourOffset (input) {
+ input = input ? local__createLocal(input).utcOffset() : 0;
+
+ return (this.utcOffset() - input) % 60 === 0;
+ }
+
+ function isDaylightSavingTime () {
+ return (
+ this.utcOffset() > this.clone().month(0).utcOffset() ||
+ this.utcOffset() > this.clone().month(5).utcOffset()
+ );
+ }
+
+ function isDaylightSavingTimeShifted () {
+ if (typeof this._isDSTShifted !== 'undefined') {
+ return this._isDSTShifted;
+ }
+
+ var c = {};
+
+ copyConfig(c, this);
+ c = prepareConfig(c);
+
+ if (c._a) {
+ var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a);
+ this._isDSTShifted = this.isValid() &&
+ compareArrays(c._a, other.toArray()) > 0;
+ } else {
+ this._isDSTShifted = false;
+ }
+
+ return this._isDSTShifted;
+ }
+
+ function isLocal () {
+ return !this._isUTC;
+ }
+
+ function isUtcOffset () {
+ return this._isUTC;
+ }
+
+ function isUtc () {
+ return this._isUTC && this._offset === 0;
+ }
+
+ var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/;
+
+ // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
+ // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
+ var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;
+
+ function create__createDuration (input, key) {
+ var duration = input,
+ // matching against regexp is expensive, do it on demand
+ match = null,
+ sign,
+ ret,
+ diffRes;
+
+ if (isDuration(input)) {
+ duration = {
+ ms : input._milliseconds,
+ d : input._days,
+ M : input._months
+ };
+ } else if (typeof input === 'number') {
+ duration = {};
+ if (key) {
+ duration[key] = input;
+ } else {
+ duration.milliseconds = input;
+ }
+ } else if (!!(match = aspNetRegex.exec(input))) {
+ sign = (match[1] === '-') ? -1 : 1;
+ duration = {
+ y : 0,
+ d : toInt(match[DATE]) * sign,
+ h : toInt(match[HOUR]) * sign,
+ m : toInt(match[MINUTE]) * sign,
+ s : toInt(match[SECOND]) * sign,
+ ms : toInt(match[MILLISECOND]) * sign
+ };
+ } else if (!!(match = create__isoRegex.exec(input))) {
+ sign = (match[1] === '-') ? -1 : 1;
+ duration = {
+ y : parseIso(match[2], sign),
+ M : parseIso(match[3], sign),
+ d : parseIso(match[4], sign),
+ h : parseIso(match[5], sign),
+ m : parseIso(match[6], sign),
+ s : parseIso(match[7], sign),
+ w : parseIso(match[8], sign)
+ };
+ } else if (duration == null) {// checks for null or undefined
+ duration = {};
+ } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
+ diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to));
+
+ duration = {};
+ duration.ms = diffRes.milliseconds;
+ duration.M = diffRes.months;
+ }
+
+ ret = new Duration(duration);
+
+ if (isDuration(input) && hasOwnProp(input, '_locale')) {
+ ret._locale = input._locale;
+ }
+
+ return ret;
+ }
+
+ create__createDuration.fn = Duration.prototype;
+
+ function parseIso (inp, sign) {
+ // We'd normally use ~~inp for this, but unfortunately it also
+ // converts floats to ints.
+ // inp may be undefined, so careful calling replace on it.
+ var res = inp && parseFloat(inp.replace(',', '.'));
+ // apply sign while we're at it
+ return (isNaN(res) ? 0 : res) * sign;
+ }
+
+ function positiveMomentsDifference(base, other) {
+ var res = {milliseconds: 0, months: 0};
+
+ res.months = other.month() - base.month() +
+ (other.year() - base.year()) * 12;
+ if (base.clone().add(res.months, 'M').isAfter(other)) {
+ --res.months;
+ }
+
+ res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
+
+ return res;
+ }
+
+ function momentsDifference(base, other) {
+ var res;
+ other = cloneWithOffset(other, base);
+ if (base.isBefore(other)) {
+ res = positiveMomentsDifference(base, other);
+ } else {
+ res = positiveMomentsDifference(other, base);
+ res.milliseconds = -res.milliseconds;
+ res.months = -res.months;
+ }
+
+ return res;
+ }
+
+ function createAdder(direction, name) {
+ return function (val, period) {
+ var dur, tmp;
+ //invert the arguments, but complain about it
+ if (period !== null && !isNaN(+period)) {
+ deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).');
+ tmp = val; val = period; period = tmp;
+ }
+
+ val = typeof val === 'string' ? +val : val;
+ dur = create__createDuration(val, period);
+ add_subtract__addSubtract(this, dur, direction);
+ return this;
+ };
+ }
+
+ function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) {
+ var milliseconds = duration._milliseconds,
+ days = duration._days,
+ months = duration._months;
+ updateOffset = updateOffset == null ? true : updateOffset;
+
+ if (milliseconds) {
+ mom._d.setTime(+mom._d + milliseconds * isAdding);
+ }
+ if (days) {
+ get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding);
+ }
+ if (months) {
+ setMonth(mom, get_set__get(mom, 'Month') + months * isAdding);
+ }
+ if (updateOffset) {
+ utils_hooks__hooks.updateOffset(mom, days || months);
+ }
+ }
+
+ var add_subtract__add = createAdder(1, 'add');
+ var add_subtract__subtract = createAdder(-1, 'subtract');
+
+ function moment_calendar__calendar (time, formats) {
+ // We want to compare the start of today, vs this.
+ // Getting start-of-today depends on whether we're local/utc/offset or not.
+ var now = time || local__createLocal(),
+ sod = cloneWithOffset(now, this).startOf('day'),
+ diff = this.diff(sod, 'days', true),
+ format = diff < -6 ? 'sameElse' :
+ diff < -1 ? 'lastWeek' :
+ diff < 0 ? 'lastDay' :
+ diff < 1 ? 'sameDay' :
+ diff < 2 ? 'nextDay' :
+ diff < 7 ? 'nextWeek' : 'sameElse';
+ return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now)));
+ }
+
+ function clone () {
+ return new Moment(this);
+ }
+
+ function isAfter (input, units) {
+ var inputMs;
+ units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');
+ if (units === 'millisecond') {
+ input = isMoment(input) ? input : local__createLocal(input);
+ return +this > +input;
+ } else {
+ inputMs = isMoment(input) ? +input : +local__createLocal(input);
+ return inputMs < +this.clone().startOf(units);
+ }
+ }
+
+ function isBefore (input, units) {
+ var inputMs;
+ units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');
+ if (units === 'millisecond') {
+ input = isMoment(input) ? input : local__createLocal(input);
+ return +this < +input;
+ } else {
+ inputMs = isMoment(input) ? +input : +local__createLocal(input);
+ return +this.clone().endOf(units) < inputMs;
+ }
+ }
+
+ function isBetween (from, to, units) {
+ return this.isAfter(from, units) && this.isBefore(to, units);
+ }
+
+ function isSame (input, units) {
+ var inputMs;
+ units = normalizeUnits(units || 'millisecond');
+ if (units === 'millisecond') {
+ input = isMoment(input) ? input : local__createLocal(input);
+ return +this === +input;
+ } else {
+ inputMs = +local__createLocal(input);
+ return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units));
+ }
+ }
+
+ function diff (input, units, asFloat) {
+ var that = cloneWithOffset(input, this),
+ zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4,
+ delta, output;
+
+ units = normalizeUnits(units);
+
+ if (units === 'year' || units === 'month' || units === 'quarter') {
+ output = monthDiff(this, that);
+ if (units === 'quarter') {
+ output = output / 3;
+ } else if (units === 'year') {
+ output = output / 12;
+ }
+ } else {
+ delta = this - that;
+ output = units === 'second' ? delta / 1e3 : // 1000
+ units === 'minute' ? delta / 6e4 : // 1000 * 60
+ units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
+ units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
+ units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
+ delta;
+ }
+ return asFloat ? output : absFloor(output);
+ }
+
+ function monthDiff (a, b) {
+ // difference in months
+ var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
+ // b is in (anchor - 1 month, anchor + 1 month)
+ anchor = a.clone().add(wholeMonthDiff, 'months'),
+ anchor2, adjust;
+
+ if (b - anchor < 0) {
+ anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
+ // linear across the month
+ adjust = (b - anchor) / (anchor - anchor2);
+ } else {
+ anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
+ // linear across the month
+ adjust = (b - anchor) / (anchor2 - anchor);
+ }
+
+ return -(wholeMonthDiff + adjust);
+ }
+
+ utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
+
+ function toString () {
+ return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
+ }
+
+ function moment_format__toISOString () {
+ var m = this.clone().utc();
+ if (0 < m.year() && m.year() <= 9999) {
+ if ('function' === typeof Date.prototype.toISOString) {
+ // native implementation is ~50x faster, use it when we can
+ return this.toDate().toISOString();
+ } else {
+ return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
+ }
+ } else {
+ return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
+ }
+ }
+
+ function moment_format__format (inputString) {
+ var output = formatMoment(this, inputString || utils_hooks__hooks.defaultFormat);
+ return this.localeData().postformat(output);
+ }
+
+ function from (time, withoutSuffix) {
+ if (!this.isValid()) {
+ return this.localeData().invalidDate();
+ }
+ return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
+ }
+
+ function fromNow (withoutSuffix) {
+ return this.from(local__createLocal(), withoutSuffix);
+ }
+
+ function to (time, withoutSuffix) {
+ if (!this.isValid()) {
+ return this.localeData().invalidDate();
+ }
+ return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
+ }
+
+ function toNow (withoutSuffix) {
+ return this.to(local__createLocal(), withoutSuffix);
+ }
+
+ function locale (key) {
+ var newLocaleData;
+
+ if (key === undefined) {
+ return this._locale._abbr;
+ } else {
+ newLocaleData = locale_locales__getLocale(key);
+ if (newLocaleData != null) {
+ this._locale = newLocaleData;
+ }
+ return this;
+ }
+ }
+
+ var lang = deprecate(
+ 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
+ function (key) {
+ if (key === undefined) {
+ return this.localeData();
+ } else {
+ return this.locale(key);
+ }
+ }
+ );
+
+ function localeData () {
+ return this._locale;
+ }
+
+ function startOf (units) {
+ units = normalizeUnits(units);
+ // the following switch intentionally omits break keywords
+ // to utilize falling through the cases.
+ switch (units) {
+ case 'year':
+ this.month(0);
+ /* falls through */
+ case 'quarter':
+ case 'month':
+ this.date(1);
+ /* falls through */
+ case 'week':
+ case 'isoWeek':
+ case 'day':
+ this.hours(0);
+ /* falls through */
+ case 'hour':
+ this.minutes(0);
+ /* falls through */
+ case 'minute':
+ this.seconds(0);
+ /* falls through */
+ case 'second':
+ this.milliseconds(0);
+ }
+
+ // weeks are a special case
+ if (units === 'week') {
+ this.weekday(0);
+ }
+ if (units === 'isoWeek') {
+ this.isoWeekday(1);
+ }
+
+ // quarters are also special
+ if (units === 'quarter') {
+ this.month(Math.floor(this.month() / 3) * 3);
+ }
+
+ return this;
+ }
+
+ function endOf (units) {
+ units = normalizeUnits(units);
+ if (units === undefined || units === 'millisecond') {
+ return this;
+ }
+ return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
+ }
+
+ function to_type__valueOf () {
+ return +this._d - ((this._offset || 0) * 60000);
+ }
+
+ function unix () {
+ return Math.floor(+this / 1000);
+ }
+
+ function toDate () {
+ return this._offset ? new Date(+this) : this._d;
+ }
+
+ function toArray () {
+ var m = this;
+ return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
+ }
+
+ function toObject () {
+ var m = this;
+ return {
+ years: m.year(),
+ months: m.month(),
+ date: m.date(),
+ hours: m.hours(),
+ minutes: m.minutes(),
+ seconds: m.seconds(),
+ milliseconds: m.milliseconds()
+ };
+ }
+
+ function moment_valid__isValid () {
+ return valid__isValid(this);
+ }
+
+ function parsingFlags () {
+ return extend({}, getParsingFlags(this));
+ }
+
+ function invalidAt () {
+ return getParsingFlags(this).overflow;
+ }
+
+ addFormatToken(0, ['gg', 2], 0, function () {
+ return this.weekYear() % 100;
+ });
+
+ addFormatToken(0, ['GG', 2], 0, function () {
+ return this.isoWeekYear() % 100;
+ });
+
+ function addWeekYearFormatToken (token, getter) {
+ addFormatToken(0, [token, token.length], 0, getter);
+ }
+
+ addWeekYearFormatToken('gggg', 'weekYear');
+ addWeekYearFormatToken('ggggg', 'weekYear');
+ addWeekYearFormatToken('GGGG', 'isoWeekYear');
+ addWeekYearFormatToken('GGGGG', 'isoWeekYear');
+
+ // ALIASES
+
+ addUnitAlias('weekYear', 'gg');
+ addUnitAlias('isoWeekYear', 'GG');
+
+ // PARSING
+
+ addRegexToken('G', matchSigned);
+ addRegexToken('g', matchSigned);
+ addRegexToken('GG', match1to2, match2);
+ addRegexToken('gg', match1to2, match2);
+ addRegexToken('GGGG', match1to4, match4);
+ addRegexToken('gggg', match1to4, match4);
+ addRegexToken('GGGGG', match1to6, match6);
+ addRegexToken('ggggg', match1to6, match6);
+
+ addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
+ week[token.substr(0, 2)] = toInt(input);
+ });
+
+ addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
+ week[token] = utils_hooks__hooks.parseTwoDigitYear(input);
+ });
+
+ // HELPERS
+
+ function weeksInYear(year, dow, doy) {
+ return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week;
+ }
+
+ // MOMENTS
+
+ function getSetWeekYear (input) {
+ var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year;
+ return input == null ? year : this.add((input - year), 'y');
+ }
+
+ function getSetISOWeekYear (input) {
+ var year = weekOfYear(this, 1, 4).year;
+ return input == null ? year : this.add((input - year), 'y');
+ }
+
+ function getISOWeeksInYear () {
+ return weeksInYear(this.year(), 1, 4);
+ }
+
+ function getWeeksInYear () {
+ var weekInfo = this.localeData()._week;
+ return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
+ }
+
+ addFormatToken('Q', 0, 0, 'quarter');
+
+ // ALIASES
+
+ addUnitAlias('quarter', 'Q');
+
+ // PARSING
+
+ addRegexToken('Q', match1);
+ addParseToken('Q', function (input, array) {
+ array[MONTH] = (toInt(input) - 1) * 3;
+ });
+
+ // MOMENTS
+
+ function getSetQuarter (input) {
+ return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
+ }
+
+ addFormatToken('D', ['DD', 2], 'Do', 'date');
+
+ // ALIASES
+
+ addUnitAlias('date', 'D');
+
+ // PARSING
+
+ addRegexToken('D', match1to2);
+ addRegexToken('DD', match1to2, match2);
+ addRegexToken('Do', function (isStrict, locale) {
+ return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
+ });
+
+ addParseToken(['D', 'DD'], DATE);
+ addParseToken('Do', function (input, array) {
+ array[DATE] = toInt(input.match(match1to2)[0], 10);
+ });
+
+ // MOMENTS
+
+ var getSetDayOfMonth = makeGetSet('Date', true);
+
+ addFormatToken('d', 0, 'do', 'day');
+
+ addFormatToken('dd', 0, 0, function (format) {
+ return this.localeData().weekdaysMin(this, format);
+ });
+
+ addFormatToken('ddd', 0, 0, function (format) {
+ return this.localeData().weekdaysShort(this, format);
+ });
+
+ addFormatToken('dddd', 0, 0, function (format) {
+ return this.localeData().weekdays(this, format);
+ });
+
+ addFormatToken('e', 0, 0, 'weekday');
+ addFormatToken('E', 0, 0, 'isoWeekday');
+
+ // ALIASES
+
+ addUnitAlias('day', 'd');
+ addUnitAlias('weekday', 'e');
+ addUnitAlias('isoWeekday', 'E');
+
+ // PARSING
+
+ addRegexToken('d', match1to2);
+ addRegexToken('e', match1to2);
+ addRegexToken('E', match1to2);
+ addRegexToken('dd', matchWord);
+ addRegexToken('ddd', matchWord);
+ addRegexToken('dddd', matchWord);
+
+ addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) {
+ var weekday = config._locale.weekdaysParse(input);
+ // if we didn't get a weekday name, mark the date as invalid
+ if (weekday != null) {
+ week.d = weekday;
+ } else {
+ getParsingFlags(config).invalidWeekday = input;
+ }
+ });
+
+ addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
+ week[token] = toInt(input);
+ });
+
+ // HELPERS
+
+ function parseWeekday(input, locale) {
+ if (typeof input !== 'string') {
+ return input;
+ }
+
+ if (!isNaN(input)) {
+ return parseInt(input, 10);
+ }
+
+ input = locale.weekdaysParse(input);
+ if (typeof input === 'number') {
+ return input;
+ }
+
+ return null;
+ }
+
+ // LOCALES
+
+ var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
+ function localeWeekdays (m) {
+ return this._weekdays[m.day()];
+ }
+
+ var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
+ function localeWeekdaysShort (m) {
+ return this._weekdaysShort[m.day()];
+ }
+
+ var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
+ function localeWeekdaysMin (m) {
+ return this._weekdaysMin[m.day()];
+ }
+
+ function localeWeekdaysParse (weekdayName) {
+ var i, mom, regex;
+
+ this._weekdaysParse = this._weekdaysParse || [];
+
+ for (i = 0; i < 7; i++) {
+ // make the regex if we don't have it already
+ if (!this._weekdaysParse[i]) {
+ mom = local__createLocal([2000, 1]).day(i);
+ regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
+ this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
+ }
+ // test the regex
+ if (this._weekdaysParse[i].test(weekdayName)) {
+ return i;
+ }
+ }
+ }
+
+ // MOMENTS
+
+ function getSetDayOfWeek (input) {
+ var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
+ if (input != null) {
+ input = parseWeekday(input, this.localeData());
+ return this.add(input - day, 'd');
+ } else {
+ return day;
+ }
+ }
+
+ function getSetLocaleDayOfWeek (input) {
+ var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
+ return input == null ? weekday : this.add(input - weekday, 'd');
+ }
+
+ function getSetISODayOfWeek (input) {
+ // behaves the same as moment#day except
+ // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
+ // as a setter, sunday should belong to the previous week.
+ return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7);
+ }
+
+ addFormatToken('H', ['HH', 2], 0, 'hour');
+ addFormatToken('h', ['hh', 2], 0, function () {
+ return this.hours() % 12 || 12;
+ });
+
+ function meridiem (token, lowercase) {
+ addFormatToken(token, 0, 0, function () {
+ return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
+ });
+ }
+
+ meridiem('a', true);
+ meridiem('A', false);
+
+ // ALIASES
+
+ addUnitAlias('hour', 'h');
+
+ // PARSING
+
+ function matchMeridiem (isStrict, locale) {
+ return locale._meridiemParse;
+ }
+
+ addRegexToken('a', matchMeridiem);
+ addRegexToken('A', matchMeridiem);
+ addRegexToken('H', match1to2);
+ addRegexToken('h', match1to2);
+ addRegexToken('HH', match1to2, match2);
+ addRegexToken('hh', match1to2, match2);
+
+ addParseToken(['H', 'HH'], HOUR);
+ addParseToken(['a', 'A'], function (input, array, config) {
+ config._isPm = config._locale.isPM(input);
+ config._meridiem = input;
+ });
+ addParseToken(['h', 'hh'], function (input, array, config) {
+ array[HOUR] = toInt(input);
+ getParsingFlags(config).bigHour = true;
+ });
+
+ // LOCALES
+
+ function localeIsPM (input) {
+ // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
+ // Using charAt should be more compatible.
+ return ((input + '').toLowerCase().charAt(0) === 'p');
+ }
+
+ var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
+ function localeMeridiem (hours, minutes, isLower) {
+ if (hours > 11) {
+ return isLower ? 'pm' : 'PM';
+ } else {
+ return isLower ? 'am' : 'AM';
+ }
+ }
+
+
+ // MOMENTS
+
+ // Setting the hour should keep the time, because the user explicitly
+ // specified which hour he wants. So trying to maintain the same hour (in
+ // a new timezone) makes sense. Adding/subtracting hours does not follow
+ // this rule.
+ var getSetHour = makeGetSet('Hours', true);
+
+ addFormatToken('m', ['mm', 2], 0, 'minute');
+
+ // ALIASES
+
+ addUnitAlias('minute', 'm');
+
+ // PARSING
+
+ addRegexToken('m', match1to2);
+ addRegexToken('mm', match1to2, match2);
+ addParseToken(['m', 'mm'], MINUTE);
+
+ // MOMENTS
+
+ var getSetMinute = makeGetSet('Minutes', false);
+
+ addFormatToken('s', ['ss', 2], 0, 'second');
+
+ // ALIASES
+
+ addUnitAlias('second', 's');
+
+ // PARSING
+
+ addRegexToken('s', match1to2);
+ addRegexToken('ss', match1to2, match2);
+ addParseToken(['s', 'ss'], SECOND);
+
+ // MOMENTS
+
+ var getSetSecond = makeGetSet('Seconds', false);
+
+ addFormatToken('S', 0, 0, function () {
+ return ~~(this.millisecond() / 100);
+ });
+
+ addFormatToken(0, ['SS', 2], 0, function () {
+ return ~~(this.millisecond() / 10);
+ });
+
+ addFormatToken(0, ['SSS', 3], 0, 'millisecond');
+ addFormatToken(0, ['SSSS', 4], 0, function () {
+ return this.millisecond() * 10;
+ });
+ addFormatToken(0, ['SSSSS', 5], 0, function () {
+ return this.millisecond() * 100;
+ });
+ addFormatToken(0, ['SSSSSS', 6], 0, function () {
+ return this.millisecond() * 1000;
+ });
+ addFormatToken(0, ['SSSSSSS', 7], 0, function () {
+ return this.millisecond() * 10000;
+ });
+ addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
+ return this.millisecond() * 100000;
+ });
+ addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
+ return this.millisecond() * 1000000;
+ });
+
+
+ // ALIASES
+
+ addUnitAlias('millisecond', 'ms');
+
+ // PARSING
+
+ addRegexToken('S', match1to3, match1);
+ addRegexToken('SS', match1to3, match2);
+ addRegexToken('SSS', match1to3, match3);
+
+ var token;
+ for (token = 'SSSS'; token.length <= 9; token += 'S') {
+ addRegexToken(token, matchUnsigned);
+ }
+
+ function parseMs(input, array) {
+ array[MILLISECOND] = toInt(('0.' + input) * 1000);
+ }
+
+ for (token = 'S'; token.length <= 9; token += 'S') {
+ addParseToken(token, parseMs);
+ }
+ // MOMENTS
+
+ var getSetMillisecond = makeGetSet('Milliseconds', false);
+
+ addFormatToken('z', 0, 0, 'zoneAbbr');
+ addFormatToken('zz', 0, 0, 'zoneName');
+
+ // MOMENTS
+
+ function getZoneAbbr () {
+ return this._isUTC ? 'UTC' : '';
+ }
+
+ function getZoneName () {
+ return this._isUTC ? 'Coordinated Universal Time' : '';
+ }
+
+ var momentPrototype__proto = Moment.prototype;
+
+ momentPrototype__proto.add = add_subtract__add;
+ momentPrototype__proto.calendar = moment_calendar__calendar;
+ momentPrototype__proto.clone = clone;
+ momentPrototype__proto.diff = diff;
+ momentPrototype__proto.endOf = endOf;
+ momentPrototype__proto.format = moment_format__format;
+ momentPrototype__proto.from = from;
+ momentPrototype__proto.fromNow = fromNow;
+ momentPrototype__proto.to = to;
+ momentPrototype__proto.toNow = toNow;
+ momentPrototype__proto.get = getSet;
+ momentPrototype__proto.invalidAt = invalidAt;
+ momentPrototype__proto.isAfter = isAfter;
+ momentPrototype__proto.isBefore = isBefore;
+ momentPrototype__proto.isBetween = isBetween;
+ momentPrototype__proto.isSame = isSame;
+ momentPrototype__proto.isValid = moment_valid__isValid;
+ momentPrototype__proto.lang = lang;
+ momentPrototype__proto.locale = locale;
+ momentPrototype__proto.localeData = localeData;
+ momentPrototype__proto.max = prototypeMax;
+ momentPrototype__proto.min = prototypeMin;
+ momentPrototype__proto.parsingFlags = parsingFlags;
+ momentPrototype__proto.set = getSet;
+ momentPrototype__proto.startOf = startOf;
+ momentPrototype__proto.subtract = add_subtract__subtract;
+ momentPrototype__proto.toArray = toArray;
+ momentPrototype__proto.toObject = toObject;
+ momentPrototype__proto.toDate = toDate;
+ momentPrototype__proto.toISOString = moment_format__toISOString;
+ momentPrototype__proto.toJSON = moment_format__toISOString;
+ momentPrototype__proto.toString = toString;
+ momentPrototype__proto.unix = unix;
+ momentPrototype__proto.valueOf = to_type__valueOf;
+
+ // Year
+ momentPrototype__proto.year = getSetYear;
+ momentPrototype__proto.isLeapYear = getIsLeapYear;
+
+ // Week Year
+ momentPrototype__proto.weekYear = getSetWeekYear;
+ momentPrototype__proto.isoWeekYear = getSetISOWeekYear;
+
+ // Quarter
+ momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter;
+
+ // Month
+ momentPrototype__proto.month = getSetMonth;
+ momentPrototype__proto.daysInMonth = getDaysInMonth;
+
+ // Week
+ momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek;
+ momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek;
+ momentPrototype__proto.weeksInYear = getWeeksInYear;
+ momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear;
+
+ // Day
+ momentPrototype__proto.date = getSetDayOfMonth;
+ momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek;
+ momentPrototype__proto.weekday = getSetLocaleDayOfWeek;
+ momentPrototype__proto.isoWeekday = getSetISODayOfWeek;
+ momentPrototype__proto.dayOfYear = getSetDayOfYear;
+
+ // Hour
+ momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour;
+
+ // Minute
+ momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute;
+
+ // Second
+ momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond;
+
+ // Millisecond
+ momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond;
+
+ // Offset
+ momentPrototype__proto.utcOffset = getSetOffset;
+ momentPrototype__proto.utc = setOffsetToUTC;
+ momentPrototype__proto.local = setOffsetToLocal;
+ momentPrototype__proto.parseZone = setOffsetToParsedOffset;
+ momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset;
+ momentPrototype__proto.isDST = isDaylightSavingTime;
+ momentPrototype__proto.isDSTShifted = isDaylightSavingTimeShifted;
+ momentPrototype__proto.isLocal = isLocal;
+ momentPrototype__proto.isUtcOffset = isUtcOffset;
+ momentPrototype__proto.isUtc = isUtc;
+ momentPrototype__proto.isUTC = isUtc;
+
+ // Timezone
+ momentPrototype__proto.zoneAbbr = getZoneAbbr;
+ momentPrototype__proto.zoneName = getZoneName;
+
+ // Deprecations
+ momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
+ momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
+ momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
+ momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone);
+
+ var momentPrototype = momentPrototype__proto;
+
+ function moment_moment__createUnix (input) {
+ return local__createLocal(input * 1000);
+ }
+
+ function moment_moment__createInZone () {
+ return local__createLocal.apply(null, arguments).parseZone();
+ }
+
+ var defaultCalendar = {
+ sameDay : '[Today at] LT',
+ nextDay : '[Tomorrow at] LT',
+ nextWeek : 'dddd [at] LT',
+ lastDay : '[Yesterday at] LT',
+ lastWeek : '[Last] dddd [at] LT',
+ sameElse : 'L'
+ };
+
+ function locale_calendar__calendar (key, mom, now) {
+ var output = this._calendar[key];
+ return typeof output === 'function' ? output.call(mom, now) : output;
+ }
+
+ var defaultLongDateFormat = {
+ LTS : 'h:mm:ss A',
+ LT : 'h:mm A',
+ L : 'MM/DD/YYYY',
+ LL : 'MMMM D, YYYY',
+ LLL : 'MMMM D, YYYY h:mm A',
+ LLLL : 'dddd, MMMM D, YYYY h:mm A'
+ };
+
+ function longDateFormat (key) {
+ var format = this._longDateFormat[key],
+ formatUpper = this._longDateFormat[key.toUpperCase()];
+
+ if (format || !formatUpper) {
+ return format;
+ }
+
+ this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
+ return val.slice(1);
+ });
+
+ return this._longDateFormat[key];
+ }
+
+ var defaultInvalidDate = 'Invalid date';
+
+ function invalidDate () {
+ return this._invalidDate;
+ }
+
+ var defaultOrdinal = '%d';
+ var defaultOrdinalParse = /\d{1,2}/;
+
+ function ordinal (number) {
+ return this._ordinal.replace('%d', number);
+ }
+
+ function preParsePostFormat (string) {
+ return string;
+ }
+
+ var defaultRelativeTime = {
+ future : 'in %s',
+ past : '%s ago',
+ s : 'a few seconds',
+ m : 'a minute',
+ mm : '%d minutes',
+ h : 'an hour',
+ hh : '%d hours',
+ d : 'a day',
+ dd : '%d days',
+ M : 'a month',
+ MM : '%d months',
+ y : 'a year',
+ yy : '%d years'
+ };
+
+ function relative__relativeTime (number, withoutSuffix, string, isFuture) {
+ var output = this._relativeTime[string];
+ return (typeof output === 'function') ?
+ output(number, withoutSuffix, string, isFuture) :
+ output.replace(/%d/i, number);
+ }
+
+ function pastFuture (diff, output) {
+ var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
+ return typeof format === 'function' ? format(output) : format.replace(/%s/i, output);
+ }
+
+ function locale_set__set (config) {
+ var prop, i;
+ for (i in config) {
+ prop = config[i];
+ if (typeof prop === 'function') {
+ this[i] = prop;
+ } else {
+ this['_' + i] = prop;
+ }
+ }
+ // Lenient ordinal parsing accepts just a number in addition to
+ // number + (possibly) stuff coming from _ordinalParseLenient.
+ this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
+ }
+
+ var prototype__proto = Locale.prototype;
+
+ prototype__proto._calendar = defaultCalendar;
+ prototype__proto.calendar = locale_calendar__calendar;
+ prototype__proto._longDateFormat = defaultLongDateFormat;
+ prototype__proto.longDateFormat = longDateFormat;
+ prototype__proto._invalidDate = defaultInvalidDate;
+ prototype__proto.invalidDate = invalidDate;
+ prototype__proto._ordinal = defaultOrdinal;
+ prototype__proto.ordinal = ordinal;
+ prototype__proto._ordinalParse = defaultOrdinalParse;
+ prototype__proto.preparse = preParsePostFormat;
+ prototype__proto.postformat = preParsePostFormat;
+ prototype__proto._relativeTime = defaultRelativeTime;
+ prototype__proto.relativeTime = relative__relativeTime;
+ prototype__proto.pastFuture = pastFuture;
+ prototype__proto.set = locale_set__set;
+
+ // Month
+ prototype__proto.months = localeMonths;
+ prototype__proto._months = defaultLocaleMonths;
+ prototype__proto.monthsShort = localeMonthsShort;
+ prototype__proto._monthsShort = defaultLocaleMonthsShort;
+ prototype__proto.monthsParse = localeMonthsParse;
+
+ // Week
+ prototype__proto.week = localeWeek;
+ prototype__proto._week = defaultLocaleWeek;
+ prototype__proto.firstDayOfYear = localeFirstDayOfYear;
+ prototype__proto.firstDayOfWeek = localeFirstDayOfWeek;
+
+ // Day of Week
+ prototype__proto.weekdays = localeWeekdays;
+ prototype__proto._weekdays = defaultLocaleWeekdays;
+ prototype__proto.weekdaysMin = localeWeekdaysMin;
+ prototype__proto._weekdaysMin = defaultLocaleWeekdaysMin;
+ prototype__proto.weekdaysShort = localeWeekdaysShort;
+ prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort;
+ prototype__proto.weekdaysParse = localeWeekdaysParse;
+
+ // Hours
+ prototype__proto.isPM = localeIsPM;
+ prototype__proto._meridiemParse = defaultLocaleMeridiemParse;
+ prototype__proto.meridiem = localeMeridiem;
+
+ function lists__get (format, index, field, setter) {
+ var locale = locale_locales__getLocale();
+ var utc = create_utc__createUTC().set(setter, index);
+ return locale[field](utc, format);
+ }
+
+ function list (format, index, field, count, setter) {
+ if (typeof format === 'number') {
+ index = format;
+ format = undefined;
+ }
+
+ format = format || '';
+
+ if (index != null) {
+ return lists__get(format, index, field, setter);
+ }
+
+ var i;
+ var out = [];
+ for (i = 0; i < count; i++) {
+ out[i] = lists__get(format, i, field, setter);
+ }
+ return out;
+ }
+
+ function lists__listMonths (format, index) {
+ return list(format, index, 'months', 12, 'month');
+ }
+
+ function lists__listMonthsShort (format, index) {
+ return list(format, index, 'monthsShort', 12, 'month');
+ }
+
+ function lists__listWeekdays (format, index) {
+ return list(format, index, 'weekdays', 7, 'day');
+ }
+
+ function lists__listWeekdaysShort (format, index) {
+ return list(format, index, 'weekdaysShort', 7, 'day');
+ }
+
+ function lists__listWeekdaysMin (format, index) {
+ return list(format, index, 'weekdaysMin', 7, 'day');
+ }
+
+ locale_locales__getSetGlobalLocale('en', {
+ ordinalParse: /\d{1,2}(th|st|nd|rd)/,
+ ordinal : function (number) {
+ var b = number % 10,
+ output = (toInt(number % 100 / 10) === 1) ? 'th' :
+ (b === 1) ? 'st' :
+ (b === 2) ? 'nd' :
+ (b === 3) ? 'rd' : 'th';
+ return number + output;
+ }
+ });
+
+ // Side effect imports
+ utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale);
+ utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale);
+
+ var mathAbs = Math.abs;
+
+ function duration_abs__abs () {
+ var data = this._data;
+
+ this._milliseconds = mathAbs(this._milliseconds);
+ this._days = mathAbs(this._days);
+ this._months = mathAbs(this._months);
+
+ data.milliseconds = mathAbs(data.milliseconds);
+ data.seconds = mathAbs(data.seconds);
+ data.minutes = mathAbs(data.minutes);
+ data.hours = mathAbs(data.hours);
+ data.months = mathAbs(data.months);
+ data.years = mathAbs(data.years);
+
+ return this;
+ }
+
+ function duration_add_subtract__addSubtract (duration, input, value, direction) {
+ var other = create__createDuration(input, value);
+
+ duration._milliseconds += direction * other._milliseconds;
+ duration._days += direction * other._days;
+ duration._months += direction * other._months;
+
+ return duration._bubble();
+ }
+
+ // supports only 2.0-style add(1, 's') or add(duration)
+ function duration_add_subtract__add (input, value) {
+ return duration_add_subtract__addSubtract(this, input, value, 1);
+ }
+
+ // supports only 2.0-style subtract(1, 's') or subtract(duration)
+ function duration_add_subtract__subtract (input, value) {
+ return duration_add_subtract__addSubtract(this, input, value, -1);
+ }
+
+ function absCeil (number) {
+ if (number < 0) {
+ return Math.floor(number);
+ } else {
+ return Math.ceil(number);
+ }
+ }
+
+ function bubble () {
+ var milliseconds = this._milliseconds;
+ var days = this._days;
+ var months = this._months;
+ var data = this._data;
+ var seconds, minutes, hours, years, monthsFromDays;
+
+ // if we have a mix of positive and negative values, bubble down first
+ // check: https://github.com/moment/moment/issues/2166
+ if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
+ (milliseconds <= 0 && days <= 0 && months <= 0))) {
+ milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
+ days = 0;
+ months = 0;
+ }
+
+ // The following code bubbles up values, see the tests for
+ // examples of what that means.
+ data.milliseconds = milliseconds % 1000;
+
+ seconds = absFloor(milliseconds / 1000);
+ data.seconds = seconds % 60;
+
+ minutes = absFloor(seconds / 60);
+ data.minutes = minutes % 60;
+
+ hours = absFloor(minutes / 60);
+ data.hours = hours % 24;
+
+ days += absFloor(hours / 24);
+
+ // convert days to months
+ monthsFromDays = absFloor(daysToMonths(days));
+ months += monthsFromDays;
+ days -= absCeil(monthsToDays(monthsFromDays));
+
+ // 12 months -> 1 year
+ years = absFloor(months / 12);
+ months %= 12;
+
+ data.days = days;
+ data.months = months;
+ data.years = years;
+
+ return this;
+ }
+
+ function daysToMonths (days) {
+ // 400 years have 146097 days (taking into account leap year rules)
+ // 400 years have 12 months === 4800
+ return days * 4800 / 146097;
+ }
+
+ function monthsToDays (months) {
+ // the reverse of daysToMonths
+ return months * 146097 / 4800;
+ }
+
+ function as (units) {
+ var days;
+ var months;
+ var milliseconds = this._milliseconds;
+
+ units = normalizeUnits(units);
+
+ if (units === 'month' || units === 'year') {
+ days = this._days + milliseconds / 864e5;
+ months = this._months + daysToMonths(days);
+ return units === 'month' ? months : months / 12;
+ } else {
+ // handle milliseconds separately because of floating point math errors (issue #1867)
+ days = this._days + Math.round(monthsToDays(this._months));
+ switch (units) {
+ case 'week' : return days / 7 + milliseconds / 6048e5;
+ case 'day' : return days + milliseconds / 864e5;
+ case 'hour' : return days * 24 + milliseconds / 36e5;
+ case 'minute' : return days * 1440 + milliseconds / 6e4;
+ case 'second' : return days * 86400 + milliseconds / 1000;
+ // Math.floor prevents floating point math errors here
+ case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
+ default: throw new Error('Unknown unit ' + units);
+ }
+ }
+ }
+
+ // TODO: Use this.as('ms')?
+ function duration_as__valueOf () {
+ return (
+ this._milliseconds +
+ this._days * 864e5 +
+ (this._months % 12) * 2592e6 +
+ toInt(this._months / 12) * 31536e6
+ );
+ }
+
+ function makeAs (alias) {
+ return function () {
+ return this.as(alias);
+ };
+ }
+
+ var asMilliseconds = makeAs('ms');
+ var asSeconds = makeAs('s');
+ var asMinutes = makeAs('m');
+ var asHours = makeAs('h');
+ var asDays = makeAs('d');
+ var asWeeks = makeAs('w');
+ var asMonths = makeAs('M');
+ var asYears = makeAs('y');
+
+ function duration_get__get (units) {
+ units = normalizeUnits(units);
+ return this[units + 's']();
+ }
+
+ function makeGetter(name) {
+ return function () {
+ return this._data[name];
+ };
+ }
+
+ var milliseconds = makeGetter('milliseconds');
+ var seconds = makeGetter('seconds');
+ var minutes = makeGetter('minutes');
+ var hours = makeGetter('hours');
+ var days = makeGetter('days');
+ var duration_get__months = makeGetter('months');
+ var years = makeGetter('years');
+
+ function weeks () {
+ return absFloor(this.days() / 7);
+ }
+
+ var round = Math.round;
+ var thresholds = {
+ s: 45, // seconds to minute
+ m: 45, // minutes to hour
+ h: 22, // hours to day
+ d: 26, // days to month
+ M: 11 // months to year
+ };
+
+ // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
+ function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
+ return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
+ }
+
+ function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) {
+ var duration = create__createDuration(posNegDuration).abs();
+ var seconds = round(duration.as('s'));
+ var minutes = round(duration.as('m'));
+ var hours = round(duration.as('h'));
+ var days = round(duration.as('d'));
+ var months = round(duration.as('M'));
+ var years = round(duration.as('y'));
+
+ var a = seconds < thresholds.s && ['s', seconds] ||
+ minutes === 1 && ['m'] ||
+ minutes < thresholds.m && ['mm', minutes] ||
+ hours === 1 && ['h'] ||
+ hours < thresholds.h && ['hh', hours] ||
+ days === 1 && ['d'] ||
+ days < thresholds.d && ['dd', days] ||
+ months === 1 && ['M'] ||
+ months < thresholds.M && ['MM', months] ||
+ years === 1 && ['y'] || ['yy', years];
+
+ a[2] = withoutSuffix;
+ a[3] = +posNegDuration > 0;
+ a[4] = locale;
+ return substituteTimeAgo.apply(null, a);
+ }
+
+ // This function allows you to set a threshold for relative time strings
+ function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {
+ if (thresholds[threshold] === undefined) {
+ return false;
+ }
+ if (limit === undefined) {
+ return thresholds[threshold];
+ }
+ thresholds[threshold] = limit;
+ return true;
+ }
+
+ function humanize (withSuffix) {
+ var locale = this.localeData();
+ var output = duration_humanize__relativeTime(this, !withSuffix, locale);
+
+ if (withSuffix) {
+ output = locale.pastFuture(+this, output);
+ }
+
+ return locale.postformat(output);
+ }
+
+ var iso_string__abs = Math.abs;
+
+ function iso_string__toISOString() {
+ // for ISO strings we do not use the normal bubbling rules:
+ // * milliseconds bubble up until they become hours
+ // * days do not bubble at all
+ // * months bubble up until they become years
+ // This is because there is no context-free conversion between hours and days
+ // (think of clock changes)
+ // and also not between days and months (28-31 days per month)
+ var seconds = iso_string__abs(this._milliseconds) / 1000;
+ var days = iso_string__abs(this._days);
+ var months = iso_string__abs(this._months);
+ var minutes, hours, years;
+
+ // 3600 seconds -> 60 minutes -> 1 hour
+ minutes = absFloor(seconds / 60);
+ hours = absFloor(minutes / 60);
+ seconds %= 60;
+ minutes %= 60;
+
+ // 12 months -> 1 year
+ years = absFloor(months / 12);
+ months %= 12;
+
+
+ // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
+ var Y = years;
+ var M = months;
+ var D = days;
+ var h = hours;
+ var m = minutes;
+ var s = seconds;
+ var total = this.asSeconds();
+
+ if (!total) {
+ // this is the same as C#'s (Noda) and python (isodate)...
+ // but not other JS (goog.date)
+ return 'P0D';
+ }
+
+ return (total < 0 ? '-' : '') +
+ 'P' +
+ (Y ? Y + 'Y' : '') +
+ (M ? M + 'M' : '') +
+ (D ? D + 'D' : '') +
+ ((h || m || s) ? 'T' : '') +
+ (h ? h + 'H' : '') +
+ (m ? m + 'M' : '') +
+ (s ? s + 'S' : '');
+ }
+
+ var duration_prototype__proto = Duration.prototype;
+
+ duration_prototype__proto.abs = duration_abs__abs;
+ duration_prototype__proto.add = duration_add_subtract__add;
+ duration_prototype__proto.subtract = duration_add_subtract__subtract;
+ duration_prototype__proto.as = as;
+ duration_prototype__proto.asMilliseconds = asMilliseconds;
+ duration_prototype__proto.asSeconds = asSeconds;
+ duration_prototype__proto.asMinutes = asMinutes;
+ duration_prototype__proto.asHours = asHours;
+ duration_prototype__proto.asDays = asDays;
+ duration_prototype__proto.asWeeks = asWeeks;
+ duration_prototype__proto.asMonths = asMonths;
+ duration_prototype__proto.asYears = asYears;
+ duration_prototype__proto.valueOf = duration_as__valueOf;
+ duration_prototype__proto._bubble = bubble;
+ duration_prototype__proto.get = duration_get__get;
+ duration_prototype__proto.milliseconds = milliseconds;
+ duration_prototype__proto.seconds = seconds;
+ duration_prototype__proto.minutes = minutes;
+ duration_prototype__proto.hours = hours;
+ duration_prototype__proto.days = days;
+ duration_prototype__proto.weeks = weeks;
+ duration_prototype__proto.months = duration_get__months;
+ duration_prototype__proto.years = years;
+ duration_prototype__proto.humanize = humanize;
+ duration_prototype__proto.toISOString = iso_string__toISOString;
+ duration_prototype__proto.toString = iso_string__toISOString;
+ duration_prototype__proto.toJSON = iso_string__toISOString;
+ duration_prototype__proto.locale = locale;
+ duration_prototype__proto.localeData = localeData;
+
+ // Deprecations
+ duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString);
+ duration_prototype__proto.lang = lang;
+
+ // Side effect imports
+
+ addFormatToken('X', 0, 0, 'unix');
+ addFormatToken('x', 0, 0, 'valueOf');
+
+ // PARSING
+
+ addRegexToken('x', matchSigned);
+ addRegexToken('X', matchTimestamp);
+ addParseToken('X', function (input, array, config) {
+ config._d = new Date(parseFloat(input, 10) * 1000);
+ });
+ addParseToken('x', function (input, array, config) {
+ config._d = new Date(toInt(input));
+ });
+
+ // Side effect imports
+
+ ;
+
+ //! moment.js
+ //! version : 2.10.6
+ //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
+ //! license : MIT
+ //! momentjs.com
+
+ utils_hooks__hooks.version = '2.10.6';
+
+ setHookCallback(local__createLocal);
+
+ utils_hooks__hooks.fn = momentPrototype;
+ utils_hooks__hooks.min = min;
+ utils_hooks__hooks.max = max;
+ utils_hooks__hooks.utc = create_utc__createUTC;
+ utils_hooks__hooks.unix = moment_moment__createUnix;
+ utils_hooks__hooks.months = lists__listMonths;
+ utils_hooks__hooks.isDate = isDate;
+ utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale;
+ utils_hooks__hooks.invalid = valid__createInvalid;
+ utils_hooks__hooks.duration = create__createDuration;
+ utils_hooks__hooks.isMoment = isMoment;
+ utils_hooks__hooks.weekdays = lists__listWeekdays;
+ utils_hooks__hooks.parseZone = moment_moment__createInZone;
+ utils_hooks__hooks.localeData = locale_locales__getLocale;
+ utils_hooks__hooks.isDuration = isDuration;
+ utils_hooks__hooks.monthsShort = lists__listMonthsShort;
+ utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin;
+ utils_hooks__hooks.defineLocale = defineLocale;
+ utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort;
+ utils_hooks__hooks.normalizeUnits = normalizeUnits;
+ utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold;
+
+ var _moment__default = utils_hooks__hooks;
+
+ //! moment.js locale configuration
+ //! locale : afrikaans (af)
+ //! author : Werner Mollentze : https://github.com/wernerm
+
+ var af = _moment__default.defineLocale('af', {
+ months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),
+ monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
+ weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),
+ weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
+ weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
+ meridiemParse: /vm|nm/i,
+ isPM : function (input) {
+ return /^nm$/i.test(input);
+ },
+ meridiem : function (hours, minutes, isLower) {
+ if (hours < 12) {
+ return isLower ? 'vm' : 'VM';
+ } else {
+ return isLower ? 'nm' : 'NM';
+ }
+ },
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd, D MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay : '[Vandag om] LT',
+ nextDay : '[Môre om] LT',
+ nextWeek : 'dddd [om] LT',
+ lastDay : '[Gister om] LT',
+ lastWeek : '[Laas] dddd [om] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'oor %s',
+ past : '%s gelede',
+ s : '\'n paar sekondes',
+ m : '\'n minuut',
+ mm : '%d minute',
+ h : '\'n uur',
+ hh : '%d ure',
+ d : '\'n dag',
+ dd : '%d dae',
+ M : '\'n maand',
+ MM : '%d maande',
+ y : '\'n jaar',
+ yy : '%d jaar'
+ },
+ ordinalParse: /\d{1,2}(ste|de)/,
+ ordinal : function (number) {
+ return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter
+ },
+ week : {
+ dow : 1, // Maandag is die eerste dag van die week.
+ doy : 4 // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Moroccan Arabic (ar-ma)
+ //! author : ElFadili Yassine : https://github.com/ElFadiliY
+ //! author : Abdel Said : https://github.com/abdelsaid
+
+ var ar_ma = _moment__default.defineLocale('ar-ma', {
+ months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
+ monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
+ weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
+ weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
+ weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd D MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay: '[اليوم على الساعة] LT',
+ nextDay: '[غدا على الساعة] LT',
+ nextWeek: 'dddd [على الساعة] LT',
+ lastDay: '[أمس على الساعة] LT',
+ lastWeek: 'dddd [على الساعة] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'في %s',
+ past : 'منذ %s',
+ s : 'ثوان',
+ m : 'دقيقة',
+ mm : '%d دقائق',
+ h : 'ساعة',
+ hh : '%d ساعات',
+ d : 'يوم',
+ dd : '%d أيام',
+ M : 'شهر',
+ MM : '%d أشهر',
+ y : 'سنة',
+ yy : '%d سنوات'
+ },
+ week : {
+ dow : 6, // Saturday is the first day of the week.
+ doy : 12 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Arabic Saudi Arabia (ar-sa)
+ //! author : Suhail Alkowaileet : https://github.com/xsoh
+
+ var ar_sa__symbolMap = {
+ '1': '١',
+ '2': '٢',
+ '3': '٣',
+ '4': '٤',
+ '5': '٥',
+ '6': '٦',
+ '7': '٧',
+ '8': '٨',
+ '9': '٩',
+ '0': '٠'
+ }, ar_sa__numberMap = {
+ '١': '1',
+ '٢': '2',
+ '٣': '3',
+ '٤': '4',
+ '٥': '5',
+ '٦': '6',
+ '٧': '7',
+ '٨': '8',
+ '٩': '9',
+ '٠': '0'
+ };
+
+ var ar_sa = _moment__default.defineLocale('ar-sa', {
+ months : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
+ monthsShort : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
+ weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
+ weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
+ weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd D MMMM YYYY HH:mm'
+ },
+ meridiemParse: /ص|م/,
+ isPM : function (input) {
+ return 'م' === input;
+ },
+ meridiem : function (hour, minute, isLower) {
+ if (hour < 12) {
+ return 'ص';
+ } else {
+ return 'م';
+ }
+ },
+ calendar : {
+ sameDay: '[اليوم على الساعة] LT',
+ nextDay: '[غدا على الساعة] LT',
+ nextWeek: 'dddd [على الساعة] LT',
+ lastDay: '[أمس على الساعة] LT',
+ lastWeek: 'dddd [على الساعة] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'في %s',
+ past : 'منذ %s',
+ s : 'ثوان',
+ m : 'دقيقة',
+ mm : '%d دقائق',
+ h : 'ساعة',
+ hh : '%d ساعات',
+ d : 'يوم',
+ dd : '%d أيام',
+ M : 'شهر',
+ MM : '%d أشهر',
+ y : 'سنة',
+ yy : '%d سنوات'
+ },
+ preparse: function (string) {
+ return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
+ return ar_sa__numberMap[match];
+ }).replace(/،/g, ',');
+ },
+ postformat: function (string) {
+ return string.replace(/\d/g, function (match) {
+ return ar_sa__symbolMap[match];
+ }).replace(/,/g, '،');
+ },
+ week : {
+ dow : 6, // Saturday is the first day of the week.
+ doy : 12 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Tunisian Arabic (ar-tn)
+
+ var ar_tn = _moment__default.defineLocale('ar-tn', {
+ months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
+ monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
+ weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
+ weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
+ weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
+ longDateFormat: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ calendar: {
+ sameDay: '[اليوم على الساعة] LT',
+ nextDay: '[غدا على الساعة] LT',
+ nextWeek: 'dddd [على الساعة] LT',
+ lastDay: '[أمس على الساعة] LT',
+ lastWeek: 'dddd [على الساعة] LT',
+ sameElse: 'L'
+ },
+ relativeTime: {
+ future: 'في %s',
+ past: 'منذ %s',
+ s: 'ثوان',
+ m: 'دقيقة',
+ mm: '%d دقائق',
+ h: 'ساعة',
+ hh: '%d ساعات',
+ d: 'يوم',
+ dd: '%d أيام',
+ M: 'شهر',
+ MM: '%d أشهر',
+ y: 'سنة',
+ yy: '%d سنوات'
+ },
+ week: {
+ dow: 1, // Monday is the first day of the week.
+ doy: 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! Locale: Arabic (ar)
+ //! Author: Abdel Said: https://github.com/abdelsaid
+ //! Changes in months, weekdays: Ahmed Elkhatib
+ //! Native plural forms: forabi https://github.com/forabi
+
+ var ar__symbolMap = {
+ '1': '١',
+ '2': '٢',
+ '3': '٣',
+ '4': '٤',
+ '5': '٥',
+ '6': '٦',
+ '7': '٧',
+ '8': '٨',
+ '9': '٩',
+ '0': '٠'
+ }, ar__numberMap = {
+ '١': '1',
+ '٢': '2',
+ '٣': '3',
+ '٤': '4',
+ '٥': '5',
+ '٦': '6',
+ '٧': '7',
+ '٨': '8',
+ '٩': '9',
+ '٠': '0'
+ }, pluralForm = function (n) {
+ return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
+ }, plurals = {
+ s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
+ m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
+ h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
+ d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
+ M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
+ y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
+ }, pluralize = function (u) {
+ return function (number, withoutSuffix, string, isFuture) {
+ var f = pluralForm(number),
+ str = plurals[u][pluralForm(number)];
+ if (f === 2) {
+ str = str[withoutSuffix ? 0 : 1];
+ }
+ return str.replace(/%d/i, number);
+ };
+ }, ar__months = [
+ 'كانون الثاني يناير',
+ 'شباط فبراير',
+ 'آذار مارس',
+ 'نيسان أبريل',
+ 'أيار مايو',
+ 'حزيران يونيو',
+ 'تموز يوليو',
+ 'آب أغسطس',
+ 'أيلول سبتمبر',
+ 'تشرين الأول أكتوبر',
+ 'تشرين الثاني نوفمبر',
+ 'كانون الأول ديسمبر'
+ ];
+
+ var ar = _moment__default.defineLocale('ar', {
+ months : ar__months,
+ monthsShort : ar__months,
+ weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
+ weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
+ weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'D/\u200FM/\u200FYYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd D MMMM YYYY HH:mm'
+ },
+ meridiemParse: /ص|م/,
+ isPM : function (input) {
+ return 'م' === input;
+ },
+ meridiem : function (hour, minute, isLower) {
+ if (hour < 12) {
+ return 'ص';
+ } else {
+ return 'م';
+ }
+ },
+ calendar : {
+ sameDay: '[اليوم عند الساعة] LT',
+ nextDay: '[غدًا عند الساعة] LT',
+ nextWeek: 'dddd [عند الساعة] LT',
+ lastDay: '[أمس عند الساعة] LT',
+ lastWeek: 'dddd [عند الساعة] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'بعد %s',
+ past : 'منذ %s',
+ s : pluralize('s'),
+ m : pluralize('m'),
+ mm : pluralize('m'),
+ h : pluralize('h'),
+ hh : pluralize('h'),
+ d : pluralize('d'),
+ dd : pluralize('d'),
+ M : pluralize('M'),
+ MM : pluralize('M'),
+ y : pluralize('y'),
+ yy : pluralize('y')
+ },
+ preparse: function (string) {
+ return string.replace(/\u200f/g, '').replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
+ return ar__numberMap[match];
+ }).replace(/،/g, ',');
+ },
+ postformat: function (string) {
+ return string.replace(/\d/g, function (match) {
+ return ar__symbolMap[match];
+ }).replace(/,/g, '،');
+ },
+ week : {
+ dow : 6, // Saturday is the first day of the week.
+ doy : 12 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : azerbaijani (az)
+ //! author : topchiyev : https://github.com/topchiyev
+
+ var az__suffixes = {
+ 1: '-inci',
+ 5: '-inci',
+ 8: '-inci',
+ 70: '-inci',
+ 80: '-inci',
+ 2: '-nci',
+ 7: '-nci',
+ 20: '-nci',
+ 50: '-nci',
+ 3: '-üncü',
+ 4: '-üncü',
+ 100: '-üncü',
+ 6: '-ncı',
+ 9: '-uncu',
+ 10: '-uncu',
+ 30: '-uncu',
+ 60: '-ıncı',
+ 90: '-ıncı'
+ };
+
+ var az = _moment__default.defineLocale('az', {
+ months : 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'),
+ monthsShort : 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
+ weekdays : 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'),
+ weekdaysShort : 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
+ weekdaysMin : 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD.MM.YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd, D MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay : '[bugün saat] LT',
+ nextDay : '[sabah saat] LT',
+ nextWeek : '[gələn həftə] dddd [saat] LT',
+ lastDay : '[dünən] LT',
+ lastWeek : '[keçən həftə] dddd [saat] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : '%s sonra',
+ past : '%s əvvəl',
+ s : 'birneçə saniyyə',
+ m : 'bir dəqiqə',
+ mm : '%d dəqiqə',
+ h : 'bir saat',
+ hh : '%d saat',
+ d : 'bir gün',
+ dd : '%d gün',
+ M : 'bir ay',
+ MM : '%d ay',
+ y : 'bir il',
+ yy : '%d il'
+ },
+ meridiemParse: /gecə|səhər|gündüz|axşam/,
+ isPM : function (input) {
+ return /^(gündüz|axşam)$/.test(input);
+ },
+ meridiem : function (hour, minute, isLower) {
+ if (hour < 4) {
+ return 'gecə';
+ } else if (hour < 12) {
+ return 'səhər';
+ } else if (hour < 17) {
+ return 'gündüz';
+ } else {
+ return 'axşam';
+ }
+ },
+ ordinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,
+ ordinal : function (number) {
+ if (number === 0) { // special case for zero
+ return number + '-ıncı';
+ }
+ var a = number % 10,
+ b = number % 100 - a,
+ c = number >= 100 ? 100 : null;
+ return number + (az__suffixes[a] || az__suffixes[b] || az__suffixes[c]);
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : belarusian (be)
+ //! author : Dmitry Demidov : https://github.com/demidov91
+ //! author: Praleska: http://praleska.pro/
+ //! Author : Menelion Elensúle : https://github.com/Oire
+
+ function be__plural(word, num) {
+ var forms = word.split('_');
+ return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
+ }
+ function be__relativeTimeWithPlural(number, withoutSuffix, key) {
+ var format = {
+ 'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
+ 'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
+ 'dd': 'дзень_дні_дзён',
+ 'MM': 'месяц_месяцы_месяцаў',
+ 'yy': 'год_гады_гадоў'
+ };
+ if (key === 'm') {
+ return withoutSuffix ? 'хвіліна' : 'хвіліну';
+ }
+ else if (key === 'h') {
+ return withoutSuffix ? 'гадзіна' : 'гадзіну';
+ }
+ else {
+ return number + ' ' + be__plural(format[key], +number);
+ }
+ }
+ function be__monthsCaseReplace(m, format) {
+ var months = {
+ 'nominative': 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_'),
+ 'accusative': 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_')
+ },
+ nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ?
+ 'accusative' :
+ 'nominative';
+ return months[nounCase][m.month()];
+ }
+ function be__weekdaysCaseReplace(m, format) {
+ var weekdays = {
+ 'nominative': 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'),
+ 'accusative': 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_')
+ },
+ nounCase = (/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/).test(format) ?
+ 'accusative' :
+ 'nominative';
+ return weekdays[nounCase][m.day()];
+ }
+
+ var be = _moment__default.defineLocale('be', {
+ months : be__monthsCaseReplace,
+ monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),
+ weekdays : be__weekdaysCaseReplace,
+ weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
+ weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD.MM.YYYY',
+ LL : 'D MMMM YYYY г.',
+ LLL : 'D MMMM YYYY г., HH:mm',
+ LLLL : 'dddd, D MMMM YYYY г., HH:mm'
+ },
+ calendar : {
+ sameDay: '[Сёння ў] LT',
+ nextDay: '[Заўтра ў] LT',
+ lastDay: '[Учора ў] LT',
+ nextWeek: function () {
+ return '[У] dddd [ў] LT';
+ },
+ lastWeek: function () {
+ switch (this.day()) {
+ case 0:
+ case 3:
+ case 5:
+ case 6:
+ return '[У мінулую] dddd [ў] LT';
+ case 1:
+ case 2:
+ case 4:
+ return '[У мінулы] dddd [ў] LT';
+ }
+ },
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'праз %s',
+ past : '%s таму',
+ s : 'некалькі секунд',
+ m : be__relativeTimeWithPlural,
+ mm : be__relativeTimeWithPlural,
+ h : be__relativeTimeWithPlural,
+ hh : be__relativeTimeWithPlural,
+ d : 'дзень',
+ dd : be__relativeTimeWithPlural,
+ M : 'месяц',
+ MM : be__relativeTimeWithPlural,
+ y : 'год',
+ yy : be__relativeTimeWithPlural
+ },
+ meridiemParse: /ночы|раніцы|дня|вечара/,
+ isPM : function (input) {
+ return /^(дня|вечара)$/.test(input);
+ },
+ meridiem : function (hour, minute, isLower) {
+ if (hour < 4) {
+ return 'ночы';
+ } else if (hour < 12) {
+ return 'раніцы';
+ } else if (hour < 17) {
+ return 'дня';
+ } else {
+ return 'вечара';
+ }
+ },
+ ordinalParse: /\d{1,2}-(і|ы|га)/,
+ ordinal: function (number, period) {
+ switch (period) {
+ case 'M':
+ case 'd':
+ case 'DDD':
+ case 'w':
+ case 'W':
+ return (number % 10 === 2 || number % 10 === 3) && (number % 100 !== 12 && number % 100 !== 13) ? number + '-і' : number + '-ы';
+ case 'D':
+ return number + '-га';
+ default:
+ return number;
+ }
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : bulgarian (bg)
+ //! author : Krasen Borisov : https://github.com/kraz
+
+ var bg = _moment__default.defineLocale('bg', {
+ months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),
+ monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
+ weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),
+ weekdaysShort : 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
+ weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
+ longDateFormat : {
+ LT : 'H:mm',
+ LTS : 'H:mm:ss',
+ L : 'D.MM.YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY H:mm',
+ LLLL : 'dddd, D MMMM YYYY H:mm'
+ },
+ calendar : {
+ sameDay : '[Днес в] LT',
+ nextDay : '[Утре в] LT',
+ nextWeek : 'dddd [в] LT',
+ lastDay : '[Вчера в] LT',
+ lastWeek : function () {
+ switch (this.day()) {
+ case 0:
+ case 3:
+ case 6:
+ return '[В изминалата] dddd [в] LT';
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return '[В изминалия] dddd [в] LT';
+ }
+ },
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'след %s',
+ past : 'преди %s',
+ s : 'няколко секунди',
+ m : 'минута',
+ mm : '%d минути',
+ h : 'час',
+ hh : '%d часа',
+ d : 'ден',
+ dd : '%d дни',
+ M : 'месец',
+ MM : '%d месеца',
+ y : 'година',
+ yy : '%d години'
+ },
+ ordinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
+ ordinal : function (number) {
+ var lastDigit = number % 10,
+ last2Digits = number % 100;
+ if (number === 0) {
+ return number + '-ев';
+ } else if (last2Digits === 0) {
+ return number + '-ен';
+ } else if (last2Digits > 10 && last2Digits < 20) {
+ return number + '-ти';
+ } else if (lastDigit === 1) {
+ return number + '-ви';
+ } else if (lastDigit === 2) {
+ return number + '-ри';
+ } else if (lastDigit === 7 || lastDigit === 8) {
+ return number + '-ми';
+ } else {
+ return number + '-ти';
+ }
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Bengali (bn)
+ //! author : Kaushik Gandhi : https://github.com/kaushikgandhi
+
+ var bn__symbolMap = {
+ '1': '১',
+ '2': '২',
+ '3': '৩',
+ '4': '৪',
+ '5': '৫',
+ '6': '৬',
+ '7': '৭',
+ '8': '৮',
+ '9': '৯',
+ '0': '০'
+ },
+ bn__numberMap = {
+ '১': '1',
+ '২': '2',
+ '৩': '3',
+ '৪': '4',
+ '৫': '5',
+ '৬': '6',
+ '৭': '7',
+ '৮': '8',
+ '৯': '9',
+ '০': '0'
+ };
+
+ var bn = _moment__default.defineLocale('bn', {
+ months : 'জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'),
+ monthsShort : 'জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্'.split('_'),
+ weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রুবার_শনিবার'.split('_'),
+ weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্রু_শনি'.split('_'),
+ weekdaysMin : 'রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি'.split('_'),
+ longDateFormat : {
+ LT : 'A h:mm সময়',
+ LTS : 'A h:mm:ss সময়',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY, A h:mm সময়',
+ LLLL : 'dddd, D MMMM YYYY, A h:mm সময়'
+ },
+ calendar : {
+ sameDay : '[আজ] LT',
+ nextDay : '[আগামীকাল] LT',
+ nextWeek : 'dddd, LT',
+ lastDay : '[গতকাল] LT',
+ lastWeek : '[গত] dddd, LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : '%s পরে',
+ past : '%s আগে',
+ s : 'কএক সেকেন্ড',
+ m : 'এক মিনিট',
+ mm : '%d মিনিট',
+ h : 'এক ঘন্টা',
+ hh : '%d ঘন্টা',
+ d : 'এক দিন',
+ dd : '%d দিন',
+ M : 'এক মাস',
+ MM : '%d মাস',
+ y : 'এক বছর',
+ yy : '%d বছর'
+ },
+ preparse: function (string) {
+ return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
+ return bn__numberMap[match];
+ });
+ },
+ postformat: function (string) {
+ return string.replace(/\d/g, function (match) {
+ return bn__symbolMap[match];
+ });
+ },
+ meridiemParse: /রাত|সকাল|দুপুর|বিকেল|রাত/,
+ isPM: function (input) {
+ return /^(দুপুর|বিকেল|রাত)$/.test(input);
+ },
+ //Bengali is a vast language its spoken
+ //in different forms in various parts of the world.
+ //I have just generalized with most common one used
+ meridiem : function (hour, minute, isLower) {
+ if (hour < 4) {
+ return 'রাত';
+ } else if (hour < 10) {
+ return 'সকাল';
+ } else if (hour < 17) {
+ return 'দুপুর';
+ } else if (hour < 20) {
+ return 'বিকেল';
+ } else {
+ return 'রাত';
+ }
+ },
+ week : {
+ dow : 0, // Sunday is the first day of the week.
+ doy : 6 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : tibetan (bo)
+ //! author : Thupten N. Chakrishar : https://github.com/vajradog
+
+ var bo__symbolMap = {
+ '1': '༡',
+ '2': '༢',
+ '3': '༣',
+ '4': '༤',
+ '5': '༥',
+ '6': '༦',
+ '7': '༧',
+ '8': '༨',
+ '9': '༩',
+ '0': '༠'
+ },
+ bo__numberMap = {
+ '༡': '1',
+ '༢': '2',
+ '༣': '3',
+ '༤': '4',
+ '༥': '5',
+ '༦': '6',
+ '༧': '7',
+ '༨': '8',
+ '༩': '9',
+ '༠': '0'
+ };
+
+ var bo = _moment__default.defineLocale('bo', {
+ months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
+ monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
+ weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'),
+ weekdaysShort : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
+ weekdaysMin : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
+ longDateFormat : {
+ LT : 'A h:mm',
+ LTS : 'A h:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY, A h:mm',
+ LLLL : 'dddd, D MMMM YYYY, A h:mm'
+ },
+ calendar : {
+ sameDay : '[དི་རིང] LT',
+ nextDay : '[སང་ཉིན] LT',
+ nextWeek : '[བདུན་ཕྲག་རྗེས་མ], LT',
+ lastDay : '[ཁ་སང] LT',
+ lastWeek : '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : '%s ལ་',
+ past : '%s སྔན་ལ',
+ s : 'ལམ་སང',
+ m : 'སྐར་མ་གཅིག',
+ mm : '%d སྐར་མ',
+ h : 'ཆུ་ཚོད་གཅིག',
+ hh : '%d ཆུ་ཚོད',
+ d : 'ཉིན་གཅིག',
+ dd : '%d ཉིན་',
+ M : 'ཟླ་བ་གཅིག',
+ MM : '%d ཟླ་བ',
+ y : 'ལོ་གཅིག',
+ yy : '%d ལོ'
+ },
+ preparse: function (string) {
+ return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {
+ return bo__numberMap[match];
+ });
+ },
+ postformat: function (string) {
+ return string.replace(/\d/g, function (match) {
+ return bo__symbolMap[match];
+ });
+ },
+ meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,
+ isPM: function (input) {
+ return /^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(input);
+ },
+ meridiem : function (hour, minute, isLower) {
+ if (hour < 4) {
+ return 'མཚན་མོ';
+ } else if (hour < 10) {
+ return 'ཞོགས་ཀས';
+ } else if (hour < 17) {
+ return 'ཉིན་གུང';
+ } else if (hour < 20) {
+ return 'དགོང་དག';
+ } else {
+ return 'མཚན་མོ';
+ }
+ },
+ week : {
+ dow : 0, // Sunday is the first day of the week.
+ doy : 6 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : breton (br)
+ //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou
+
+ function relativeTimeWithMutation(number, withoutSuffix, key) {
+ var format = {
+ 'mm': 'munutenn',
+ 'MM': 'miz',
+ 'dd': 'devezh'
+ };
+ return number + ' ' + mutation(format[key], number);
+ }
+ function specialMutationForYears(number) {
+ switch (lastNumber(number)) {
+ case 1:
+ case 3:
+ case 4:
+ case 5:
+ case 9:
+ return number + ' bloaz';
+ default:
+ return number + ' vloaz';
+ }
+ }
+ function lastNumber(number) {
+ if (number > 9) {
+ return lastNumber(number % 10);
+ }
+ return number;
+ }
+ function mutation(text, number) {
+ if (number === 2) {
+ return softMutation(text);
+ }
+ return text;
+ }
+ function softMutation(text) {
+ var mutationTable = {
+ 'm': 'v',
+ 'b': 'v',
+ 'd': 'z'
+ };
+ if (mutationTable[text.charAt(0)] === undefined) {
+ return text;
+ }
+ return mutationTable[text.charAt(0)] + text.substring(1);
+ }
+
+ var br = _moment__default.defineLocale('br', {
+ months : 'Genver_C\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'),
+ monthsShort : 'Gen_C\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
+ weekdays : 'Sul_Lun_Meurzh_Merc\'her_Yaou_Gwener_Sadorn'.split('_'),
+ weekdaysShort : 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
+ weekdaysMin : 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
+ longDateFormat : {
+ LT : 'h[e]mm A',
+ LTS : 'h[e]mm:ss A',
+ L : 'DD/MM/YYYY',
+ LL : 'D [a viz] MMMM YYYY',
+ LLL : 'D [a viz] MMMM YYYY h[e]mm A',
+ LLLL : 'dddd, D [a viz] MMMM YYYY h[e]mm A'
+ },
+ calendar : {
+ sameDay : '[Hiziv da] LT',
+ nextDay : '[Warc\'hoazh da] LT',
+ nextWeek : 'dddd [da] LT',
+ lastDay : '[Dec\'h da] LT',
+ lastWeek : 'dddd [paset da] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'a-benn %s',
+ past : '%s \'zo',
+ s : 'un nebeud segondennoù',
+ m : 'ur vunutenn',
+ mm : relativeTimeWithMutation,
+ h : 'un eur',
+ hh : '%d eur',
+ d : 'un devezh',
+ dd : relativeTimeWithMutation,
+ M : 'ur miz',
+ MM : relativeTimeWithMutation,
+ y : 'ur bloaz',
+ yy : specialMutationForYears
+ },
+ ordinalParse: /\d{1,2}(añ|vet)/,
+ ordinal : function (number) {
+ var output = (number === 1) ? 'añ' : 'vet';
+ return number + output;
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : bosnian (bs)
+ //! author : Nedim Cholich : https://github.com/frontyard
+ //! based on (hr) translation by Bojan Marković
+
+ function bs__translate(number, withoutSuffix, key) {
+ var result = number + ' ';
+ switch (key) {
+ case 'm':
+ return withoutSuffix ? 'jedna minuta' : 'jedne minute';
+ case 'mm':
+ if (number === 1) {
+ result += 'minuta';
+ } else if (number === 2 || number === 3 || number === 4) {
+ result += 'minute';
+ } else {
+ result += 'minuta';
+ }
+ return result;
+ case 'h':
+ return withoutSuffix ? 'jedan sat' : 'jednog sata';
+ case 'hh':
+ if (number === 1) {
+ result += 'sat';
+ } else if (number === 2 || number === 3 || number === 4) {
+ result += 'sata';
+ } else {
+ result += 'sati';
+ }
+ return result;
+ case 'dd':
+ if (number === 1) {
+ result += 'dan';
+ } else {
+ result += 'dana';
+ }
+ return result;
+ case 'MM':
+ if (number === 1) {
+ result += 'mjesec';
+ } else if (number === 2 || number === 3 || number === 4) {
+ result += 'mjeseca';
+ } else {
+ result += 'mjeseci';
+ }
+ return result;
+ case 'yy':
+ if (number === 1) {
+ result += 'godina';
+ } else if (number === 2 || number === 3 || number === 4) {
+ result += 'godine';
+ } else {
+ result += 'godina';
+ }
+ return result;
+ }
+ }
+
+ var bs = _moment__default.defineLocale('bs', {
+ months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'),
+ monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'),
+ weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
+ weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
+ weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),
+ longDateFormat : {
+ LT : 'H:mm',
+ LTS : 'H:mm:ss',
+ L : 'DD. MM. YYYY',
+ LL : 'D. MMMM YYYY',
+ LLL : 'D. MMMM YYYY H:mm',
+ LLLL : 'dddd, D. MMMM YYYY H:mm'
+ },
+ calendar : {
+ sameDay : '[danas u] LT',
+ nextDay : '[sutra u] LT',
+ nextWeek : function () {
+ switch (this.day()) {
+ case 0:
+ return '[u] [nedjelju] [u] LT';
+ case 3:
+ return '[u] [srijedu] [u] LT';
+ case 6:
+ return '[u] [subotu] [u] LT';
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return '[u] dddd [u] LT';
+ }
+ },
+ lastDay : '[jučer u] LT',
+ lastWeek : function () {
+ switch (this.day()) {
+ case 0:
+ case 3:
+ return '[prošlu] dddd [u] LT';
+ case 6:
+ return '[prošle] [subote] [u] LT';
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return '[prošli] dddd [u] LT';
+ }
+ },
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'za %s',
+ past : 'prije %s',
+ s : 'par sekundi',
+ m : bs__translate,
+ mm : bs__translate,
+ h : bs__translate,
+ hh : bs__translate,
+ d : 'dan',
+ dd : bs__translate,
+ M : 'mjesec',
+ MM : bs__translate,
+ y : 'godinu',
+ yy : bs__translate
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : catalan (ca)
+ //! author : Juan G. Hurtado : https://github.com/juanghurtado
+
+ var ca = _moment__default.defineLocale('ca', {
+ months : 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),
+ monthsShort : 'gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.'.split('_'),
+ weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),
+ weekdaysShort : 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),
+ weekdaysMin : 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'),
+ longDateFormat : {
+ LT : 'H:mm',
+ LTS : 'LT:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY H:mm',
+ LLLL : 'dddd D MMMM YYYY H:mm'
+ },
+ calendar : {
+ sameDay : function () {
+ return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
+ },
+ nextDay : function () {
+ return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
+ },
+ nextWeek : function () {
+ return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
+ },
+ lastDay : function () {
+ return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
+ },
+ lastWeek : function () {
+ return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
+ },
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'en %s',
+ past : 'fa %s',
+ s : 'uns segons',
+ m : 'un minut',
+ mm : '%d minuts',
+ h : 'una hora',
+ hh : '%d hores',
+ d : 'un dia',
+ dd : '%d dies',
+ M : 'un mes',
+ MM : '%d mesos',
+ y : 'un any',
+ yy : '%d anys'
+ },
+ ordinalParse: /\d{1,2}(r|n|t|è|a)/,
+ ordinal : function (number, period) {
+ var output = (number === 1) ? 'r' :
+ (number === 2) ? 'n' :
+ (number === 3) ? 'r' :
+ (number === 4) ? 't' : 'è';
+ if (period === 'w' || period === 'W') {
+ output = 'a';
+ }
+ return number + output;
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : czech (cs)
+ //! author : petrbela : https://github.com/petrbela
+
+ var cs__months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'),
+ cs__monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');
+ function cs__plural(n) {
+ return (n > 1) && (n < 5) && (~~(n / 10) !== 1);
+ }
+ function cs__translate(number, withoutSuffix, key, isFuture) {
+ var result = number + ' ';
+ switch (key) {
+ case 's': // a few seconds / in a few seconds / a few seconds ago
+ return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';
+ case 'm': // a minute / in a minute / a minute ago
+ return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');
+ case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
+ if (withoutSuffix || isFuture) {
+ return result + (cs__plural(number) ? 'minuty' : 'minut');
+ } else {
+ return result + 'minutami';
+ }
+ break;
+ case 'h': // an hour / in an hour / an hour ago
+ return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
+ case 'hh': // 9 hours / in 9 hours / 9 hours ago
+ if (withoutSuffix || isFuture) {
+ return result + (cs__plural(number) ? 'hodiny' : 'hodin');
+ } else {
+ return result + 'hodinami';
+ }
+ break;
+ case 'd': // a day / in a day / a day ago
+ return (withoutSuffix || isFuture) ? 'den' : 'dnem';
+ case 'dd': // 9 days / in 9 days / 9 days ago
+ if (withoutSuffix || isFuture) {
+ return result + (cs__plural(number) ? 'dny' : 'dní');
+ } else {
+ return result + 'dny';
+ }
+ break;
+ case 'M': // a month / in a month / a month ago
+ return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';
+ case 'MM': // 9 months / in 9 months / 9 months ago
+ if (withoutSuffix || isFuture) {
+ return result + (cs__plural(number) ? 'měsíce' : 'měsíců');
+ } else {
+ return result + 'měsíci';
+ }
+ break;
+ case 'y': // a year / in a year / a year ago
+ return (withoutSuffix || isFuture) ? 'rok' : 'rokem';
+ case 'yy': // 9 years / in 9 years / 9 years ago
+ if (withoutSuffix || isFuture) {
+ return result + (cs__plural(number) ? 'roky' : 'let');
+ } else {
+ return result + 'lety';
+ }
+ break;
+ }
+ }
+
+ var cs = _moment__default.defineLocale('cs', {
+ months : cs__months,
+ monthsShort : cs__monthsShort,
+ monthsParse : (function (months, monthsShort) {
+ var i, _monthsParse = [];
+ for (i = 0; i < 12; i++) {
+ // use custom parser to solve problem with July (červenec)
+ _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');
+ }
+ return _monthsParse;
+ }(cs__months, cs__monthsShort)),
+ weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
+ weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'),
+ weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'),
+ longDateFormat : {
+ LT: 'H:mm',
+ LTS : 'H:mm:ss',
+ L : 'DD.MM.YYYY',
+ LL : 'D. MMMM YYYY',
+ LLL : 'D. MMMM YYYY H:mm',
+ LLLL : 'dddd D. MMMM YYYY H:mm'
+ },
+ calendar : {
+ sameDay: '[dnes v] LT',
+ nextDay: '[zítra v] LT',
+ nextWeek: function () {
+ switch (this.day()) {
+ case 0:
+ return '[v neděli v] LT';
+ case 1:
+ case 2:
+ return '[v] dddd [v] LT';
+ case 3:
+ return '[ve středu v] LT';
+ case 4:
+ return '[ve čtvrtek v] LT';
+ case 5:
+ return '[v pátek v] LT';
+ case 6:
+ return '[v sobotu v] LT';
+ }
+ },
+ lastDay: '[včera v] LT',
+ lastWeek: function () {
+ switch (this.day()) {
+ case 0:
+ return '[minulou neděli v] LT';
+ case 1:
+ case 2:
+ return '[minulé] dddd [v] LT';
+ case 3:
+ return '[minulou středu v] LT';
+ case 4:
+ case 5:
+ return '[minulý] dddd [v] LT';
+ case 6:
+ return '[minulou sobotu v] LT';
+ }
+ },
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'za %s',
+ past : 'před %s',
+ s : cs__translate,
+ m : cs__translate,
+ mm : cs__translate,
+ h : cs__translate,
+ hh : cs__translate,
+ d : cs__translate,
+ dd : cs__translate,
+ M : cs__translate,
+ MM : cs__translate,
+ y : cs__translate,
+ yy : cs__translate
+ },
+ ordinalParse : /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : chuvash (cv)
+ //! author : Anatoly Mironov : https://github.com/mirontoli
+
+ var cv = _moment__default.defineLocale('cv', {
+ months : 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split('_'),
+ monthsShort : 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),
+ weekdays : 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split('_'),
+ weekdaysShort : 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),
+ weekdaysMin : 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD-MM-YYYY',
+ LL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',
+ LLL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
+ LLLL : 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm'
+ },
+ calendar : {
+ sameDay: '[Паян] LT [сехетре]',
+ nextDay: '[Ыран] LT [сехетре]',
+ lastDay: '[Ӗнер] LT [сехетре]',
+ nextWeek: '[Ҫитес] dddd LT [сехетре]',
+ lastWeek: '[Иртнӗ] dddd LT [сехетре]',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : function (output) {
+ var affix = /сехет$/i.exec(output) ? 'рен' : /ҫул$/i.exec(output) ? 'тан' : 'ран';
+ return output + affix;
+ },
+ past : '%s каялла',
+ s : 'пӗр-ик ҫеккунт',
+ m : 'пӗр минут',
+ mm : '%d минут',
+ h : 'пӗр сехет',
+ hh : '%d сехет',
+ d : 'пӗр кун',
+ dd : '%d кун',
+ M : 'пӗр уйӑх',
+ MM : '%d уйӑх',
+ y : 'пӗр ҫул',
+ yy : '%d ҫул'
+ },
+ ordinalParse: /\d{1,2}-мӗш/,
+ ordinal : '%d-мӗш',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Welsh (cy)
+ //! author : Robert Allen
+
+ var cy = _moment__default.defineLocale('cy', {
+ months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'),
+ monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'),
+ weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'),
+ weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),
+ weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),
+ // time formats are the same as en-gb
+ longDateFormat: {
+ LT: 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ calendar: {
+ sameDay: '[Heddiw am] LT',
+ nextDay: '[Yfory am] LT',
+ nextWeek: 'dddd [am] LT',
+ lastDay: '[Ddoe am] LT',
+ lastWeek: 'dddd [diwethaf am] LT',
+ sameElse: 'L'
+ },
+ relativeTime: {
+ future: 'mewn %s',
+ past: '%s yn ôl',
+ s: 'ychydig eiliadau',
+ m: 'munud',
+ mm: '%d munud',
+ h: 'awr',
+ hh: '%d awr',
+ d: 'diwrnod',
+ dd: '%d diwrnod',
+ M: 'mis',
+ MM: '%d mis',
+ y: 'blwyddyn',
+ yy: '%d flynedd'
+ },
+ ordinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,
+ // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh
+ ordinal: function (number) {
+ var b = number,
+ output = '',
+ lookup = [
+ '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed
+ 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed
+ ];
+ if (b > 20) {
+ if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {
+ output = 'fed'; // not 30ain, 70ain or 90ain
+ } else {
+ output = 'ain';
+ }
+ } else if (b > 0) {
+ output = lookup[b];
+ }
+ return number + output;
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : danish (da)
+ //! author : Ulrik Nielsen : https://github.com/mrbase
+
+ var da = _moment__default.defineLocale('da', {
+ months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'),
+ monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
+ weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
+ weekdaysShort : 'søn_man_tir_ons_tor_fre_lør'.split('_'),
+ weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D. MMMM YYYY',
+ LLL : 'D. MMMM YYYY HH:mm',
+ LLLL : 'dddd [d.] D. MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay : '[I dag kl.] LT',
+ nextDay : '[I morgen kl.] LT',
+ nextWeek : 'dddd [kl.] LT',
+ lastDay : '[I går kl.] LT',
+ lastWeek : '[sidste] dddd [kl] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'om %s',
+ past : '%s siden',
+ s : 'få sekunder',
+ m : 'et minut',
+ mm : '%d minutter',
+ h : 'en time',
+ hh : '%d timer',
+ d : 'en dag',
+ dd : '%d dage',
+ M : 'en måned',
+ MM : '%d måneder',
+ y : 'et år',
+ yy : '%d år'
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : austrian german (de-at)
+ //! author : lluchs : https://github.com/lluchs
+ //! author: Menelion Elensúle: https://github.com/Oire
+ //! author : Martin Groller : https://github.com/MadMG
+
+ function de_at__processRelativeTime(number, withoutSuffix, key, isFuture) {
+ var format = {
+ 'm': ['eine Minute', 'einer Minute'],
+ 'h': ['eine Stunde', 'einer Stunde'],
+ 'd': ['ein Tag', 'einem Tag'],
+ 'dd': [number + ' Tage', number + ' Tagen'],
+ 'M': ['ein Monat', 'einem Monat'],
+ 'MM': [number + ' Monate', number + ' Monaten'],
+ 'y': ['ein Jahr', 'einem Jahr'],
+ 'yy': [number + ' Jahre', number + ' Jahren']
+ };
+ return withoutSuffix ? format[key][0] : format[key][1];
+ }
+
+ var de_at = _moment__default.defineLocale('de-at', {
+ months : 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
+ monthsShort : 'Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
+ weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
+ weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
+ weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
+ longDateFormat : {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L : 'DD.MM.YYYY',
+ LL : 'D. MMMM YYYY',
+ LLL : 'D. MMMM YYYY HH:mm',
+ LLLL : 'dddd, D. MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay: '[Heute um] LT [Uhr]',
+ sameElse: 'L',
+ nextDay: '[Morgen um] LT [Uhr]',
+ nextWeek: 'dddd [um] LT [Uhr]',
+ lastDay: '[Gestern um] LT [Uhr]',
+ lastWeek: '[letzten] dddd [um] LT [Uhr]'
+ },
+ relativeTime : {
+ future : 'in %s',
+ past : 'vor %s',
+ s : 'ein paar Sekunden',
+ m : de_at__processRelativeTime,
+ mm : '%d Minuten',
+ h : de_at__processRelativeTime,
+ hh : '%d Stunden',
+ d : de_at__processRelativeTime,
+ dd : de_at__processRelativeTime,
+ M : de_at__processRelativeTime,
+ MM : de_at__processRelativeTime,
+ y : de_at__processRelativeTime,
+ yy : de_at__processRelativeTime
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : german (de)
+ //! author : lluchs : https://github.com/lluchs
+ //! author: Menelion Elensúle: https://github.com/Oire
+
+ function de__processRelativeTime(number, withoutSuffix, key, isFuture) {
+ var format = {
+ 'm': ['eine Minute', 'einer Minute'],
+ 'h': ['eine Stunde', 'einer Stunde'],
+ 'd': ['ein Tag', 'einem Tag'],
+ 'dd': [number + ' Tage', number + ' Tagen'],
+ 'M': ['ein Monat', 'einem Monat'],
+ 'MM': [number + ' Monate', number + ' Monaten'],
+ 'y': ['ein Jahr', 'einem Jahr'],
+ 'yy': [number + ' Jahre', number + ' Jahren']
+ };
+ return withoutSuffix ? format[key][0] : format[key][1];
+ }
+
+ var de = _moment__default.defineLocale('de', {
+ months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
+ monthsShort : 'Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
+ weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
+ weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
+ weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
+ longDateFormat : {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L : 'DD.MM.YYYY',
+ LL : 'D. MMMM YYYY',
+ LLL : 'D. MMMM YYYY HH:mm',
+ LLLL : 'dddd, D. MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay: '[Heute um] LT [Uhr]',
+ sameElse: 'L',
+ nextDay: '[Morgen um] LT [Uhr]',
+ nextWeek: 'dddd [um] LT [Uhr]',
+ lastDay: '[Gestern um] LT [Uhr]',
+ lastWeek: '[letzten] dddd [um] LT [Uhr]'
+ },
+ relativeTime : {
+ future : 'in %s',
+ past : 'vor %s',
+ s : 'ein paar Sekunden',
+ m : de__processRelativeTime,
+ mm : '%d Minuten',
+ h : de__processRelativeTime,
+ hh : '%d Stunden',
+ d : de__processRelativeTime,
+ dd : de__processRelativeTime,
+ M : de__processRelativeTime,
+ MM : de__processRelativeTime,
+ y : de__processRelativeTime,
+ yy : de__processRelativeTime
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : modern greek (el)
+ //! author : Aggelos Karalias : https://github.com/mehiel
+
+ var el = _moment__default.defineLocale('el', {
+ monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'),
+ monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'),
+ months : function (momentToFormat, format) {
+ if (/D/.test(format.substring(0, format.indexOf('MMMM')))) { // if there is a day number before 'MMMM'
+ return this._monthsGenitiveEl[momentToFormat.month()];
+ } else {
+ return this._monthsNominativeEl[momentToFormat.month()];
+ }
+ },
+ monthsShort : 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),
+ weekdays : 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'),
+ weekdaysShort : 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),
+ weekdaysMin : 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),
+ meridiem : function (hours, minutes, isLower) {
+ if (hours > 11) {
+ return isLower ? 'μμ' : 'ΜΜ';
+ } else {
+ return isLower ? 'πμ' : 'ΠΜ';
+ }
+ },
+ isPM : function (input) {
+ return ((input + '').toLowerCase()[0] === 'μ');
+ },
+ meridiemParse : /[ΠΜ]\.?Μ?\.?/i,
+ longDateFormat : {
+ LT : 'h:mm A',
+ LTS : 'h:mm:ss A',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY h:mm A',
+ LLLL : 'dddd, D MMMM YYYY h:mm A'
+ },
+ calendarEl : {
+ sameDay : '[Σήμερα {}] LT',
+ nextDay : '[Αύριο {}] LT',
+ nextWeek : 'dddd [{}] LT',
+ lastDay : '[Χθες {}] LT',
+ lastWeek : function () {
+ switch (this.day()) {
+ case 6:
+ return '[το προηγούμενο] dddd [{}] LT';
+ default:
+ return '[την προηγούμενη] dddd [{}] LT';
+ }
+ },
+ sameElse : 'L'
+ },
+ calendar : function (key, mom) {
+ var output = this._calendarEl[key],
+ hours = mom && mom.hours();
+ if (typeof output === 'function') {
+ output = output.apply(mom);
+ }
+ return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις'));
+ },
+ relativeTime : {
+ future : 'σε %s',
+ past : '%s πριν',
+ s : 'λίγα δευτερόλεπτα',
+ m : 'ένα λεπτό',
+ mm : '%d λεπτά',
+ h : 'μία ώρα',
+ hh : '%d ώρες',
+ d : 'μία μέρα',
+ dd : '%d μέρες',
+ M : 'ένας μήνας',
+ MM : '%d μήνες',
+ y : 'ένας χρόνος',
+ yy : '%d χρόνια'
+ },
+ ordinalParse: /\d{1,2}η/,
+ ordinal: '%dη',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : australian english (en-au)
+
+ var en_au = _moment__default.defineLocale('en-au', {
+ months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
+ monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
+ weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+ weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
+ weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
+ longDateFormat : {
+ LT : 'h:mm A',
+ LTS : 'h:mm:ss A',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY h:mm A',
+ LLLL : 'dddd, D MMMM YYYY h:mm A'
+ },
+ calendar : {
+ sameDay : '[Today at] LT',
+ nextDay : '[Tomorrow at] LT',
+ nextWeek : 'dddd [at] LT',
+ lastDay : '[Yesterday at] LT',
+ lastWeek : '[Last] dddd [at] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'in %s',
+ past : '%s ago',
+ s : 'a few seconds',
+ m : 'a minute',
+ mm : '%d minutes',
+ h : 'an hour',
+ hh : '%d hours',
+ d : 'a day',
+ dd : '%d days',
+ M : 'a month',
+ MM : '%d months',
+ y : 'a year',
+ yy : '%d years'
+ },
+ ordinalParse: /\d{1,2}(st|nd|rd|th)/,
+ ordinal : function (number) {
+ var b = number % 10,
+ output = (~~(number % 100 / 10) === 1) ? 'th' :
+ (b === 1) ? 'st' :
+ (b === 2) ? 'nd' :
+ (b === 3) ? 'rd' : 'th';
+ return number + output;
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : canadian english (en-ca)
+ //! author : Jonathan Abourbih : https://github.com/jonbca
+
+ var en_ca = _moment__default.defineLocale('en-ca', {
+ months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
+ monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
+ weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+ weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
+ weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
+ longDateFormat : {
+ LT : 'h:mm A',
+ LTS : 'h:mm:ss A',
+ L : 'YYYY-MM-DD',
+ LL : 'D MMMM, YYYY',
+ LLL : 'D MMMM, YYYY h:mm A',
+ LLLL : 'dddd, D MMMM, YYYY h:mm A'
+ },
+ calendar : {
+ sameDay : '[Today at] LT',
+ nextDay : '[Tomorrow at] LT',
+ nextWeek : 'dddd [at] LT',
+ lastDay : '[Yesterday at] LT',
+ lastWeek : '[Last] dddd [at] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'in %s',
+ past : '%s ago',
+ s : 'a few seconds',
+ m : 'a minute',
+ mm : '%d minutes',
+ h : 'an hour',
+ hh : '%d hours',
+ d : 'a day',
+ dd : '%d days',
+ M : 'a month',
+ MM : '%d months',
+ y : 'a year',
+ yy : '%d years'
+ },
+ ordinalParse: /\d{1,2}(st|nd|rd|th)/,
+ ordinal : function (number) {
+ var b = number % 10,
+ output = (~~(number % 100 / 10) === 1) ? 'th' :
+ (b === 1) ? 'st' :
+ (b === 2) ? 'nd' :
+ (b === 3) ? 'rd' : 'th';
+ return number + output;
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : great britain english (en-gb)
+ //! author : Chris Gedrim : https://github.com/chrisgedrim
+
+ var en_gb = _moment__default.defineLocale('en-gb', {
+ months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
+ monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
+ weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+ weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
+ weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd, D MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay : '[Today at] LT',
+ nextDay : '[Tomorrow at] LT',
+ nextWeek : 'dddd [at] LT',
+ lastDay : '[Yesterday at] LT',
+ lastWeek : '[Last] dddd [at] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'in %s',
+ past : '%s ago',
+ s : 'a few seconds',
+ m : 'a minute',
+ mm : '%d minutes',
+ h : 'an hour',
+ hh : '%d hours',
+ d : 'a day',
+ dd : '%d days',
+ M : 'a month',
+ MM : '%d months',
+ y : 'a year',
+ yy : '%d years'
+ },
+ ordinalParse: /\d{1,2}(st|nd|rd|th)/,
+ ordinal : function (number) {
+ var b = number % 10,
+ output = (~~(number % 100 / 10) === 1) ? 'th' :
+ (b === 1) ? 'st' :
+ (b === 2) ? 'nd' :
+ (b === 3) ? 'rd' : 'th';
+ return number + output;
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : esperanto (eo)
+ //! author : Colin Dean : https://github.com/colindean
+ //! komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko.
+ //! Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni!
+
+ var eo = _moment__default.defineLocale('eo', {
+ months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'),
+ monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'),
+ weekdays : 'Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato'.split('_'),
+ weekdaysShort : 'Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab'.split('_'),
+ weekdaysMin : 'Di_Lu_Ma_Me_Ĵa_Ve_Sa'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'YYYY-MM-DD',
+ LL : 'D[-an de] MMMM, YYYY',
+ LLL : 'D[-an de] MMMM, YYYY HH:mm',
+ LLLL : 'dddd, [la] D[-an de] MMMM, YYYY HH:mm'
+ },
+ meridiemParse: /[ap]\.t\.m/i,
+ isPM: function (input) {
+ return input.charAt(0).toLowerCase() === 'p';
+ },
+ meridiem : function (hours, minutes, isLower) {
+ if (hours > 11) {
+ return isLower ? 'p.t.m.' : 'P.T.M.';
+ } else {
+ return isLower ? 'a.t.m.' : 'A.T.M.';
+ }
+ },
+ calendar : {
+ sameDay : '[Hodiaŭ je] LT',
+ nextDay : '[Morgaŭ je] LT',
+ nextWeek : 'dddd [je] LT',
+ lastDay : '[Hieraŭ je] LT',
+ lastWeek : '[pasinta] dddd [je] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'je %s',
+ past : 'antaŭ %s',
+ s : 'sekundoj',
+ m : 'minuto',
+ mm : '%d minutoj',
+ h : 'horo',
+ hh : '%d horoj',
+ d : 'tago',//ne 'diurno', ĉar estas uzita por proksimumo
+ dd : '%d tagoj',
+ M : 'monato',
+ MM : '%d monatoj',
+ y : 'jaro',
+ yy : '%d jaroj'
+ },
+ ordinalParse: /\d{1,2}a/,
+ ordinal : '%da',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : spanish (es)
+ //! author : Julio Napurí : https://github.com/julionc
+
+ var monthsShortDot = 'Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.'.split('_'),
+ es__monthsShort = 'Ene_Feb_Mar_Abr_May_Jun_Jul_Ago_Sep_Oct_Nov_Dic'.split('_');
+
+ var es = _moment__default.defineLocale('es', {
+ months : 'Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre'.split('_'),
+ monthsShort : function (m, format) {
+ if (/-MMM-/.test(format)) {
+ return es__monthsShort[m.month()];
+ } else {
+ return monthsShortDot[m.month()];
+ }
+ },
+ weekdays : 'Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado'.split('_'),
+ weekdaysShort : 'Dom._Lun._Mar._Mié._Jue._Vie._Sáb.'.split('_'),
+ weekdaysMin : 'Do_Lu_Ma_Mi_Ju_Vi_Sá'.split('_'),
+ longDateFormat : {
+ LT : 'H:mm',
+ LTS : 'H:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D [de] MMMM [de] YYYY',
+ LLL : 'D [de] MMMM [de] YYYY H:mm',
+ LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm'
+ },
+ calendar : {
+ sameDay : function () {
+ return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
+ },
+ nextDay : function () {
+ return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
+ },
+ nextWeek : function () {
+ return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
+ },
+ lastDay : function () {
+ return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
+ },
+ lastWeek : function () {
+ return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
+ },
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'en %s',
+ past : 'hace %s',
+ s : 'unos segundos',
+ m : 'un minuto',
+ mm : '%d minutos',
+ h : 'una hora',
+ hh : '%d horas',
+ d : 'un día',
+ dd : '%d días',
+ M : 'un mes',
+ MM : '%d meses',
+ y : 'un año',
+ yy : '%d años'
+ },
+ ordinalParse : /\d{1,2}º/,
+ ordinal : '%dº',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : estonian (et)
+ //! author : Henry Kehlmann : https://github.com/madhenry
+ //! improvements : Illimar Tambek : https://github.com/ragulka
+
+ function et__processRelativeTime(number, withoutSuffix, key, isFuture) {
+ var format = {
+ 's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'],
+ 'm' : ['ühe minuti', 'üks minut'],
+ 'mm': [number + ' minuti', number + ' minutit'],
+ 'h' : ['ühe tunni', 'tund aega', 'üks tund'],
+ 'hh': [number + ' tunni', number + ' tundi'],
+ 'd' : ['ühe päeva', 'üks päev'],
+ 'M' : ['kuu aja', 'kuu aega', 'üks kuu'],
+ 'MM': [number + ' kuu', number + ' kuud'],
+ 'y' : ['ühe aasta', 'aasta', 'üks aasta'],
+ 'yy': [number + ' aasta', number + ' aastat']
+ };
+ if (withoutSuffix) {
+ return format[key][2] ? format[key][2] : format[key][1];
+ }
+ return isFuture ? format[key][0] : format[key][1];
+ }
+
+ var et = _moment__default.defineLocale('et', {
+ months : 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'),
+ monthsShort : 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),
+ weekdays : 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'),
+ weekdaysShort : 'P_E_T_K_N_R_L'.split('_'),
+ weekdaysMin : 'P_E_T_K_N_R_L'.split('_'),
+ longDateFormat : {
+ LT : 'H:mm',
+ LTS : 'H:mm:ss',
+ L : 'DD.MM.YYYY',
+ LL : 'D. MMMM YYYY',
+ LLL : 'D. MMMM YYYY H:mm',
+ LLLL : 'dddd, D. MMMM YYYY H:mm'
+ },
+ calendar : {
+ sameDay : '[Täna,] LT',
+ nextDay : '[Homme,] LT',
+ nextWeek : '[Järgmine] dddd LT',
+ lastDay : '[Eile,] LT',
+ lastWeek : '[Eelmine] dddd LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : '%s pärast',
+ past : '%s tagasi',
+ s : et__processRelativeTime,
+ m : et__processRelativeTime,
+ mm : et__processRelativeTime,
+ h : et__processRelativeTime,
+ hh : et__processRelativeTime,
+ d : et__processRelativeTime,
+ dd : '%d päeva',
+ M : et__processRelativeTime,
+ MM : et__processRelativeTime,
+ y : et__processRelativeTime,
+ yy : et__processRelativeTime
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : euskara (eu)
+ //! author : Eneko Illarramendi : https://github.com/eillarra
+
+ var eu = _moment__default.defineLocale('eu', {
+ months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'),
+ monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'),
+ weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'),
+ weekdaysShort : 'ig._al._ar._az._og._ol._lr.'.split('_'),
+ weekdaysMin : 'ig_al_ar_az_og_ol_lr'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'YYYY-MM-DD',
+ LL : 'YYYY[ko] MMMM[ren] D[a]',
+ LLL : 'YYYY[ko] MMMM[ren] D[a] HH:mm',
+ LLLL : 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',
+ l : 'YYYY-M-D',
+ ll : 'YYYY[ko] MMM D[a]',
+ lll : 'YYYY[ko] MMM D[a] HH:mm',
+ llll : 'ddd, YYYY[ko] MMM D[a] HH:mm'
+ },
+ calendar : {
+ sameDay : '[gaur] LT[etan]',
+ nextDay : '[bihar] LT[etan]',
+ nextWeek : 'dddd LT[etan]',
+ lastDay : '[atzo] LT[etan]',
+ lastWeek : '[aurreko] dddd LT[etan]',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : '%s barru',
+ past : 'duela %s',
+ s : 'segundo batzuk',
+ m : 'minutu bat',
+ mm : '%d minutu',
+ h : 'ordu bat',
+ hh : '%d ordu',
+ d : 'egun bat',
+ dd : '%d egun',
+ M : 'hilabete bat',
+ MM : '%d hilabete',
+ y : 'urte bat',
+ yy : '%d urte'
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Persian (fa)
+ //! author : Ebrahim Byagowi : https://github.com/ebraminio
+
+ var fa__symbolMap = {
+ '1': '۱',
+ '2': '۲',
+ '3': '۳',
+ '4': '۴',
+ '5': '۵',
+ '6': '۶',
+ '7': '۷',
+ '8': '۸',
+ '9': '۹',
+ '0': '۰'
+ }, fa__numberMap = {
+ '۱': '1',
+ '۲': '2',
+ '۳': '3',
+ '۴': '4',
+ '۵': '5',
+ '۶': '6',
+ '۷': '7',
+ '۸': '8',
+ '۹': '9',
+ '۰': '0'
+ };
+
+ var fa = _moment__default.defineLocale('fa', {
+ months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
+ monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
+ weekdays : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'),
+ weekdaysShort : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'),
+ weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd, D MMMM YYYY HH:mm'
+ },
+ meridiemParse: /قبل از ظهر|بعد از ظهر/,
+ isPM: function (input) {
+ return /بعد از ظهر/.test(input);
+ },
+ meridiem : function (hour, minute, isLower) {
+ if (hour < 12) {
+ return 'قبل از ظهر';
+ } else {
+ return 'بعد از ظهر';
+ }
+ },
+ calendar : {
+ sameDay : '[امروز ساعت] LT',
+ nextDay : '[فردا ساعت] LT',
+ nextWeek : 'dddd [ساعت] LT',
+ lastDay : '[دیروز ساعت] LT',
+ lastWeek : 'dddd [پیش] [ساعت] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'در %s',
+ past : '%s پیش',
+ s : 'چندین ثانیه',
+ m : 'یک دقیقه',
+ mm : '%d دقیقه',
+ h : 'یک ساعت',
+ hh : '%d ساعت',
+ d : 'یک روز',
+ dd : '%d روز',
+ M : 'یک ماه',
+ MM : '%d ماه',
+ y : 'یک سال',
+ yy : '%d سال'
+ },
+ preparse: function (string) {
+ return string.replace(/[۰-۹]/g, function (match) {
+ return fa__numberMap[match];
+ }).replace(/،/g, ',');
+ },
+ postformat: function (string) {
+ return string.replace(/\d/g, function (match) {
+ return fa__symbolMap[match];
+ }).replace(/,/g, '،');
+ },
+ ordinalParse: /\d{1,2}م/,
+ ordinal : '%dم',
+ week : {
+ dow : 6, // Saturday is the first day of the week.
+ doy : 12 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : finnish (fi)
+ //! author : Tarmo Aidantausta : https://github.com/bleadof
+
+ var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '),
+ numbersFuture = [
+ 'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden',
+ numbersPast[7], numbersPast[8], numbersPast[9]
+ ];
+ function fi__translate(number, withoutSuffix, key, isFuture) {
+ var result = '';
+ switch (key) {
+ case 's':
+ return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
+ case 'm':
+ return isFuture ? 'minuutin' : 'minuutti';
+ case 'mm':
+ result = isFuture ? 'minuutin' : 'minuuttia';
+ break;
+ case 'h':
+ return isFuture ? 'tunnin' : 'tunti';
+ case 'hh':
+ result = isFuture ? 'tunnin' : 'tuntia';
+ break;
+ case 'd':
+ return isFuture ? 'päivän' : 'päivä';
+ case 'dd':
+ result = isFuture ? 'päivän' : 'päivää';
+ break;
+ case 'M':
+ return isFuture ? 'kuukauden' : 'kuukausi';
+ case 'MM':
+ result = isFuture ? 'kuukauden' : 'kuukautta';
+ break;
+ case 'y':
+ return isFuture ? 'vuoden' : 'vuosi';
+ case 'yy':
+ result = isFuture ? 'vuoden' : 'vuotta';
+ break;
+ }
+ result = verbalNumber(number, isFuture) + ' ' + result;
+ return result;
+ }
+ function verbalNumber(number, isFuture) {
+ return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number;
+ }
+
+ var fi = _moment__default.defineLocale('fi', {
+ months : 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),
+ monthsShort : 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),
+ weekdays : 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),
+ weekdaysShort : 'su_ma_ti_ke_to_pe_la'.split('_'),
+ weekdaysMin : 'su_ma_ti_ke_to_pe_la'.split('_'),
+ longDateFormat : {
+ LT : 'HH.mm',
+ LTS : 'HH.mm.ss',
+ L : 'DD.MM.YYYY',
+ LL : 'Do MMMM[ta] YYYY',
+ LLL : 'Do MMMM[ta] YYYY, [klo] HH.mm',
+ LLLL : 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',
+ l : 'D.M.YYYY',
+ ll : 'Do MMM YYYY',
+ lll : 'Do MMM YYYY, [klo] HH.mm',
+ llll : 'ddd, Do MMM YYYY, [klo] HH.mm'
+ },
+ calendar : {
+ sameDay : '[tänään] [klo] LT',
+ nextDay : '[huomenna] [klo] LT',
+ nextWeek : 'dddd [klo] LT',
+ lastDay : '[eilen] [klo] LT',
+ lastWeek : '[viime] dddd[na] [klo] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : '%s päästä',
+ past : '%s sitten',
+ s : fi__translate,
+ m : fi__translate,
+ mm : fi__translate,
+ h : fi__translate,
+ hh : fi__translate,
+ d : fi__translate,
+ dd : fi__translate,
+ M : fi__translate,
+ MM : fi__translate,
+ y : fi__translate,
+ yy : fi__translate
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : faroese (fo)
+ //! author : Ragnar Johannesen : https://github.com/ragnar123
+
+ var fo = _moment__default.defineLocale('fo', {
+ months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
+ monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
+ weekdays : 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'),
+ weekdaysShort : 'sun_mán_týs_mik_hós_frí_ley'.split('_'),
+ weekdaysMin : 'su_má_tý_mi_hó_fr_le'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd D. MMMM, YYYY HH:mm'
+ },
+ calendar : {
+ sameDay : '[Í dag kl.] LT',
+ nextDay : '[Í morgin kl.] LT',
+ nextWeek : 'dddd [kl.] LT',
+ lastDay : '[Í gjár kl.] LT',
+ lastWeek : '[síðstu] dddd [kl] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'um %s',
+ past : '%s síðani',
+ s : 'fá sekund',
+ m : 'ein minutt',
+ mm : '%d minuttir',
+ h : 'ein tími',
+ hh : '%d tímar',
+ d : 'ein dagur',
+ dd : '%d dagar',
+ M : 'ein mánaði',
+ MM : '%d mánaðir',
+ y : 'eitt ár',
+ yy : '%d ár'
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : canadian french (fr-ca)
+ //! author : Jonathan Abourbih : https://github.com/jonbca
+
+ var fr_ca = _moment__default.defineLocale('fr-ca', {
+ months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
+ monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
+ weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
+ weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
+ weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'YYYY-MM-DD',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd D MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay: '[Aujourd\'hui à] LT',
+ nextDay: '[Demain à] LT',
+ nextWeek: 'dddd [à] LT',
+ lastDay: '[Hier à] LT',
+ lastWeek: 'dddd [dernier à] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'dans %s',
+ past : 'il y a %s',
+ s : 'quelques secondes',
+ m : 'une minute',
+ mm : '%d minutes',
+ h : 'une heure',
+ hh : '%d heures',
+ d : 'un jour',
+ dd : '%d jours',
+ M : 'un mois',
+ MM : '%d mois',
+ y : 'un an',
+ yy : '%d ans'
+ },
+ ordinalParse: /\d{1,2}(er|e)/,
+ ordinal : function (number) {
+ return number + (number === 1 ? 'er' : 'e');
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : french (fr)
+ //! author : John Fischer : https://github.com/jfroffice
+
+ var fr = _moment__default.defineLocale('fr', {
+ months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
+ monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
+ weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
+ weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
+ weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd D MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay: '[Aujourd\'hui à] LT',
+ nextDay: '[Demain à] LT',
+ nextWeek: 'dddd [à] LT',
+ lastDay: '[Hier à] LT',
+ lastWeek: 'dddd [dernier à] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'dans %s',
+ past : 'il y a %s',
+ s : 'quelques secondes',
+ m : 'une minute',
+ mm : '%d minutes',
+ h : 'une heure',
+ hh : '%d heures',
+ d : 'un jour',
+ dd : '%d jours',
+ M : 'un mois',
+ MM : '%d mois',
+ y : 'un an',
+ yy : '%d ans'
+ },
+ ordinalParse: /\d{1,2}(er|)/,
+ ordinal : function (number) {
+ return number + (number === 1 ? 'er' : '');
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : frisian (fy)
+ //! author : Robin van der Vliet : https://github.com/robin0van0der0v
+
+ var fy__monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'),
+ fy__monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_');
+
+ var fy = _moment__default.defineLocale('fy', {
+ months : 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'),
+ monthsShort : function (m, format) {
+ if (/-MMM-/.test(format)) {
+ return fy__monthsShortWithoutDots[m.month()];
+ } else {
+ return fy__monthsShortWithDots[m.month()];
+ }
+ },
+ weekdays : 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'),
+ weekdaysShort : 'si._mo._ti._wo._to._fr._so.'.split('_'),
+ weekdaysMin : 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD-MM-YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd D MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay: '[hjoed om] LT',
+ nextDay: '[moarn om] LT',
+ nextWeek: 'dddd [om] LT',
+ lastDay: '[juster om] LT',
+ lastWeek: '[ôfrûne] dddd [om] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'oer %s',
+ past : '%s lyn',
+ s : 'in pear sekonden',
+ m : 'ien minút',
+ mm : '%d minuten',
+ h : 'ien oere',
+ hh : '%d oeren',
+ d : 'ien dei',
+ dd : '%d dagen',
+ M : 'ien moanne',
+ MM : '%d moannen',
+ y : 'ien jier',
+ yy : '%d jierren'
+ },
+ ordinalParse: /\d{1,2}(ste|de)/,
+ ordinal : function (number) {
+ return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : galician (gl)
+ //! author : Juan G. Hurtado : https://github.com/juanghurtado
+
+ var gl = _moment__default.defineLocale('gl', {
+ months : 'Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro'.split('_'),
+ monthsShort : 'Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.'.split('_'),
+ weekdays : 'Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado'.split('_'),
+ weekdaysShort : 'Dom._Lun._Mar._Mér._Xov._Ven._Sáb.'.split('_'),
+ weekdaysMin : 'Do_Lu_Ma_Mé_Xo_Ve_Sá'.split('_'),
+ longDateFormat : {
+ LT : 'H:mm',
+ LTS : 'H:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY H:mm',
+ LLLL : 'dddd D MMMM YYYY H:mm'
+ },
+ calendar : {
+ sameDay : function () {
+ return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';
+ },
+ nextDay : function () {
+ return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';
+ },
+ nextWeek : function () {
+ return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
+ },
+ lastDay : function () {
+ return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT';
+ },
+ lastWeek : function () {
+ return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
+ },
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : function (str) {
+ if (str === 'uns segundos') {
+ return 'nuns segundos';
+ }
+ return 'en ' + str;
+ },
+ past : 'hai %s',
+ s : 'uns segundos',
+ m : 'un minuto',
+ mm : '%d minutos',
+ h : 'unha hora',
+ hh : '%d horas',
+ d : 'un día',
+ dd : '%d días',
+ M : 'un mes',
+ MM : '%d meses',
+ y : 'un ano',
+ yy : '%d anos'
+ },
+ ordinalParse : /\d{1,2}º/,
+ ordinal : '%dº',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Hebrew (he)
+ //! author : Tomer Cohen : https://github.com/tomer
+ //! author : Moshe Simantov : https://github.com/DevelopmentIL
+ //! author : Tal Ater : https://github.com/TalAter
+
+ var he = _moment__default.defineLocale('he', {
+ months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),
+ monthsShort : 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),
+ weekdays : 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),
+ weekdaysShort : 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
+ weekdaysMin : 'א_ב_ג_ד_ה_ו_ש'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D [ב]MMMM YYYY',
+ LLL : 'D [ב]MMMM YYYY HH:mm',
+ LLLL : 'dddd, D [ב]MMMM YYYY HH:mm',
+ l : 'D/M/YYYY',
+ ll : 'D MMM YYYY',
+ lll : 'D MMM YYYY HH:mm',
+ llll : 'ddd, D MMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay : '[היום ב־]LT',
+ nextDay : '[מחר ב־]LT',
+ nextWeek : 'dddd [בשעה] LT',
+ lastDay : '[אתמול ב־]LT',
+ lastWeek : '[ביום] dddd [האחרון בשעה] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'בעוד %s',
+ past : 'לפני %s',
+ s : 'מספר שניות',
+ m : 'דקה',
+ mm : '%d דקות',
+ h : 'שעה',
+ hh : function (number) {
+ if (number === 2) {
+ return 'שעתיים';
+ }
+ return number + ' שעות';
+ },
+ d : 'יום',
+ dd : function (number) {
+ if (number === 2) {
+ return 'יומיים';
+ }
+ return number + ' ימים';
+ },
+ M : 'חודש',
+ MM : function (number) {
+ if (number === 2) {
+ return 'חודשיים';
+ }
+ return number + ' חודשים';
+ },
+ y : 'שנה',
+ yy : function (number) {
+ if (number === 2) {
+ return 'שנתיים';
+ } else if (number % 10 === 0 && number !== 10) {
+ return number + ' שנה';
+ }
+ return number + ' שנים';
+ }
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : hindi (hi)
+ //! author : Mayank Singhal : https://github.com/mayanksinghal
+
+ var hi__symbolMap = {
+ '1': '१',
+ '2': '२',
+ '3': '३',
+ '4': '४',
+ '5': '५',
+ '6': '६',
+ '7': '७',
+ '8': '८',
+ '9': '९',
+ '0': '०'
+ },
+ hi__numberMap = {
+ '१': '1',
+ '२': '2',
+ '३': '3',
+ '४': '4',
+ '५': '5',
+ '६': '6',
+ '७': '7',
+ '८': '8',
+ '९': '9',
+ '०': '0'
+ };
+
+ var hi = _moment__default.defineLocale('hi', {
+ months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),
+ monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),
+ weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
+ weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
+ weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),
+ longDateFormat : {
+ LT : 'A h:mm बजे',
+ LTS : 'A h:mm:ss बजे',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY, A h:mm बजे',
+ LLLL : 'dddd, D MMMM YYYY, A h:mm बजे'
+ },
+ calendar : {
+ sameDay : '[आज] LT',
+ nextDay : '[कल] LT',
+ nextWeek : 'dddd, LT',
+ lastDay : '[कल] LT',
+ lastWeek : '[पिछले] dddd, LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : '%s में',
+ past : '%s पहले',
+ s : 'कुछ ही क्षण',
+ m : 'एक मिनट',
+ mm : '%d मिनट',
+ h : 'एक घंटा',
+ hh : '%d घंटे',
+ d : 'एक दिन',
+ dd : '%d दिन',
+ M : 'एक महीने',
+ MM : '%d महीने',
+ y : 'एक वर्ष',
+ yy : '%d वर्ष'
+ },
+ preparse: function (string) {
+ return string.replace(/[१२३४५६७८९०]/g, function (match) {
+ return hi__numberMap[match];
+ });
+ },
+ postformat: function (string) {
+ return string.replace(/\d/g, function (match) {
+ return hi__symbolMap[match];
+ });
+ },
+ // Hindi notation for meridiems are quite fuzzy in practice. While there exists
+ // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
+ meridiemParse: /रात|सुबह|दोपहर|शाम/,
+ meridiemHour : function (hour, meridiem) {
+ if (hour === 12) {
+ hour = 0;
+ }
+ if (meridiem === 'रात') {
+ return hour < 4 ? hour : hour + 12;
+ } else if (meridiem === 'सुबह') {
+ return hour;
+ } else if (meridiem === 'दोपहर') {
+ return hour >= 10 ? hour : hour + 12;
+ } else if (meridiem === 'शाम') {
+ return hour + 12;
+ }
+ },
+ meridiem : function (hour, minute, isLower) {
+ if (hour < 4) {
+ return 'रात';
+ } else if (hour < 10) {
+ return 'सुबह';
+ } else if (hour < 17) {
+ return 'दोपहर';
+ } else if (hour < 20) {
+ return 'शाम';
+ } else {
+ return 'रात';
+ }
+ },
+ week : {
+ dow : 0, // Sunday is the first day of the week.
+ doy : 6 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : hrvatski (hr)
+ //! author : Bojan Marković : https://github.com/bmarkovic
+
+ function hr__translate(number, withoutSuffix, key) {
+ var result = number + ' ';
+ switch (key) {
+ case 'm':
+ return withoutSuffix ? 'jedna minuta' : 'jedne minute';
+ case 'mm':
+ if (number === 1) {
+ result += 'minuta';
+ } else if (number === 2 || number === 3 || number === 4) {
+ result += 'minute';
+ } else {
+ result += 'minuta';
+ }
+ return result;
+ case 'h':
+ return withoutSuffix ? 'jedan sat' : 'jednog sata';
+ case 'hh':
+ if (number === 1) {
+ result += 'sat';
+ } else if (number === 2 || number === 3 || number === 4) {
+ result += 'sata';
+ } else {
+ result += 'sati';
+ }
+ return result;
+ case 'dd':
+ if (number === 1) {
+ result += 'dan';
+ } else {
+ result += 'dana';
+ }
+ return result;
+ case 'MM':
+ if (number === 1) {
+ result += 'mjesec';
+ } else if (number === 2 || number === 3 || number === 4) {
+ result += 'mjeseca';
+ } else {
+ result += 'mjeseci';
+ }
+ return result;
+ case 'yy':
+ if (number === 1) {
+ result += 'godina';
+ } else if (number === 2 || number === 3 || number === 4) {
+ result += 'godine';
+ } else {
+ result += 'godina';
+ }
+ return result;
+ }
+ }
+
+ var hr = _moment__default.defineLocale('hr', {
+ months : 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_'),
+ monthsShort : 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'),
+ weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
+ weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
+ weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),
+ longDateFormat : {
+ LT : 'H:mm',
+ LTS : 'H:mm:ss',
+ L : 'DD. MM. YYYY',
+ LL : 'D. MMMM YYYY',
+ LLL : 'D. MMMM YYYY H:mm',
+ LLLL : 'dddd, D. MMMM YYYY H:mm'
+ },
+ calendar : {
+ sameDay : '[danas u] LT',
+ nextDay : '[sutra u] LT',
+ nextWeek : function () {
+ switch (this.day()) {
+ case 0:
+ return '[u] [nedjelju] [u] LT';
+ case 3:
+ return '[u] [srijedu] [u] LT';
+ case 6:
+ return '[u] [subotu] [u] LT';
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return '[u] dddd [u] LT';
+ }
+ },
+ lastDay : '[jučer u] LT',
+ lastWeek : function () {
+ switch (this.day()) {
+ case 0:
+ case 3:
+ return '[prošlu] dddd [u] LT';
+ case 6:
+ return '[prošle] [subote] [u] LT';
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return '[prošli] dddd [u] LT';
+ }
+ },
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'za %s',
+ past : 'prije %s',
+ s : 'par sekundi',
+ m : hr__translate,
+ mm : hr__translate,
+ h : hr__translate,
+ hh : hr__translate,
+ d : 'dan',
+ dd : hr__translate,
+ M : 'mjesec',
+ MM : hr__translate,
+ y : 'godinu',
+ yy : hr__translate
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : hungarian (hu)
+ //! author : Adam Brunner : https://github.com/adambrunner
+
+ var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');
+ function hu__translate(number, withoutSuffix, key, isFuture) {
+ var num = number,
+ suffix;
+ switch (key) {
+ case 's':
+ return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';
+ case 'm':
+ return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');
+ case 'mm':
+ return num + (isFuture || withoutSuffix ? ' perc' : ' perce');
+ case 'h':
+ return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');
+ case 'hh':
+ return num + (isFuture || withoutSuffix ? ' óra' : ' órája');
+ case 'd':
+ return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');
+ case 'dd':
+ return num + (isFuture || withoutSuffix ? ' nap' : ' napja');
+ case 'M':
+ return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
+ case 'MM':
+ return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
+ case 'y':
+ return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');
+ case 'yy':
+ return num + (isFuture || withoutSuffix ? ' év' : ' éve');
+ }
+ return '';
+ }
+ function week(isFuture) {
+ return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]';
+ }
+
+ var hu = _moment__default.defineLocale('hu', {
+ months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),
+ monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),
+ weekdays : 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
+ weekdaysShort : 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
+ weekdaysMin : 'v_h_k_sze_cs_p_szo'.split('_'),
+ longDateFormat : {
+ LT : 'H:mm',
+ LTS : 'H:mm:ss',
+ L : 'YYYY.MM.DD.',
+ LL : 'YYYY. MMMM D.',
+ LLL : 'YYYY. MMMM D. H:mm',
+ LLLL : 'YYYY. MMMM D., dddd H:mm'
+ },
+ meridiemParse: /de|du/i,
+ isPM: function (input) {
+ return input.charAt(1).toLowerCase() === 'u';
+ },
+ meridiem : function (hours, minutes, isLower) {
+ if (hours < 12) {
+ return isLower === true ? 'de' : 'DE';
+ } else {
+ return isLower === true ? 'du' : 'DU';
+ }
+ },
+ calendar : {
+ sameDay : '[ma] LT[-kor]',
+ nextDay : '[holnap] LT[-kor]',
+ nextWeek : function () {
+ return week.call(this, true);
+ },
+ lastDay : '[tegnap] LT[-kor]',
+ lastWeek : function () {
+ return week.call(this, false);
+ },
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : '%s múlva',
+ past : '%s',
+ s : hu__translate,
+ m : hu__translate,
+ mm : hu__translate,
+ h : hu__translate,
+ hh : hu__translate,
+ d : hu__translate,
+ dd : hu__translate,
+ M : hu__translate,
+ MM : hu__translate,
+ y : hu__translate,
+ yy : hu__translate
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Armenian (hy-am)
+ //! author : Armendarabyan : https://github.com/armendarabyan
+
+ function hy_am__monthsCaseReplace(m, format) {
+ var months = {
+ 'nominative': 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_'),
+ 'accusative': 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_')
+ },
+ nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ?
+ 'accusative' :
+ 'nominative';
+ return months[nounCase][m.month()];
+ }
+ function hy_am__monthsShortCaseReplace(m, format) {
+ var monthsShort = 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_');
+ return monthsShort[m.month()];
+ }
+ function hy_am__weekdaysCaseReplace(m, format) {
+ var weekdays = 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_');
+ return weekdays[m.day()];
+ }
+
+ var hy_am = _moment__default.defineLocale('hy-am', {
+ months : hy_am__monthsCaseReplace,
+ monthsShort : hy_am__monthsShortCaseReplace,
+ weekdays : hy_am__weekdaysCaseReplace,
+ weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
+ weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD.MM.YYYY',
+ LL : 'D MMMM YYYY թ.',
+ LLL : 'D MMMM YYYY թ., HH:mm',
+ LLLL : 'dddd, D MMMM YYYY թ., HH:mm'
+ },
+ calendar : {
+ sameDay: '[այսօր] LT',
+ nextDay: '[վաղը] LT',
+ lastDay: '[երեկ] LT',
+ nextWeek: function () {
+ return 'dddd [օրը ժամը] LT';
+ },
+ lastWeek: function () {
+ return '[անցած] dddd [օրը ժամը] LT';
+ },
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : '%s հետո',
+ past : '%s առաջ',
+ s : 'մի քանի վայրկյան',
+ m : 'րոպե',
+ mm : '%d րոպե',
+ h : 'ժամ',
+ hh : '%d ժամ',
+ d : 'օր',
+ dd : '%d օր',
+ M : 'ամիս',
+ MM : '%d ամիս',
+ y : 'տարի',
+ yy : '%d տարի'
+ },
+ meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,
+ isPM: function (input) {
+ return /^(ցերեկվա|երեկոյան)$/.test(input);
+ },
+ meridiem : function (hour) {
+ if (hour < 4) {
+ return 'գիշերվա';
+ } else if (hour < 12) {
+ return 'առավոտվա';
+ } else if (hour < 17) {
+ return 'ցերեկվա';
+ } else {
+ return 'երեկոյան';
+ }
+ },
+ ordinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/,
+ ordinal: function (number, period) {
+ switch (period) {
+ case 'DDD':
+ case 'w':
+ case 'W':
+ case 'DDDo':
+ if (number === 1) {
+ return number + '-ին';
+ }
+ return number + '-րդ';
+ default:
+ return number;
+ }
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Bahasa Indonesia (id)
+ //! author : Mohammad Satrio Utomo : https://github.com/tyok
+ //! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan
+
+ var id = _moment__default.defineLocale('id', {
+ months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),
+ monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'),
+ weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
+ weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
+ weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
+ longDateFormat : {
+ LT : 'HH.mm',
+ LTS : 'HH.mm.ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY [pukul] HH.mm',
+ LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
+ },
+ meridiemParse: /pagi|siang|sore|malam/,
+ meridiemHour : function (hour, meridiem) {
+ if (hour === 12) {
+ hour = 0;
+ }
+ if (meridiem === 'pagi') {
+ return hour;
+ } else if (meridiem === 'siang') {
+ return hour >= 11 ? hour : hour + 12;
+ } else if (meridiem === 'sore' || meridiem === 'malam') {
+ return hour + 12;
+ }
+ },
+ meridiem : function (hours, minutes, isLower) {
+ if (hours < 11) {
+ return 'pagi';
+ } else if (hours < 15) {
+ return 'siang';
+ } else if (hours < 19) {
+ return 'sore';
+ } else {
+ return 'malam';
+ }
+ },
+ calendar : {
+ sameDay : '[Hari ini pukul] LT',
+ nextDay : '[Besok pukul] LT',
+ nextWeek : 'dddd [pukul] LT',
+ lastDay : '[Kemarin pukul] LT',
+ lastWeek : 'dddd [lalu pukul] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'dalam %s',
+ past : '%s yang lalu',
+ s : 'beberapa detik',
+ m : 'semenit',
+ mm : '%d menit',
+ h : 'sejam',
+ hh : '%d jam',
+ d : 'sehari',
+ dd : '%d hari',
+ M : 'sebulan',
+ MM : '%d bulan',
+ y : 'setahun',
+ yy : '%d tahun'
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : icelandic (is)
+ //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik
+
+ function is__plural(n) {
+ if (n % 100 === 11) {
+ return true;
+ } else if (n % 10 === 1) {
+ return false;
+ }
+ return true;
+ }
+ function is__translate(number, withoutSuffix, key, isFuture) {
+ var result = number + ' ';
+ switch (key) {
+ case 's':
+ return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum';
+ case 'm':
+ return withoutSuffix ? 'mínúta' : 'mínútu';
+ case 'mm':
+ if (is__plural(number)) {
+ return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum');
+ } else if (withoutSuffix) {
+ return result + 'mínúta';
+ }
+ return result + 'mínútu';
+ case 'hh':
+ if (is__plural(number)) {
+ return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum');
+ }
+ return result + 'klukkustund';
+ case 'd':
+ if (withoutSuffix) {
+ return 'dagur';
+ }
+ return isFuture ? 'dag' : 'degi';
+ case 'dd':
+ if (is__plural(number)) {
+ if (withoutSuffix) {
+ return result + 'dagar';
+ }
+ return result + (isFuture ? 'daga' : 'dögum');
+ } else if (withoutSuffix) {
+ return result + 'dagur';
+ }
+ return result + (isFuture ? 'dag' : 'degi');
+ case 'M':
+ if (withoutSuffix) {
+ return 'mánuður';
+ }
+ return isFuture ? 'mánuð' : 'mánuði';
+ case 'MM':
+ if (is__plural(number)) {
+ if (withoutSuffix) {
+ return result + 'mánuðir';
+ }
+ return result + (isFuture ? 'mánuði' : 'mánuðum');
+ } else if (withoutSuffix) {
+ return result + 'mánuður';
+ }
+ return result + (isFuture ? 'mánuð' : 'mánuði');
+ case 'y':
+ return withoutSuffix || isFuture ? 'ár' : 'ári';
+ case 'yy':
+ if (is__plural(number)) {
+ return result + (withoutSuffix || isFuture ? 'ár' : 'árum');
+ }
+ return result + (withoutSuffix || isFuture ? 'ár' : 'ári');
+ }
+ }
+
+ var is = _moment__default.defineLocale('is', {
+ months : 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'),
+ monthsShort : 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),
+ weekdays : 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'),
+ weekdaysShort : 'sun_mán_þri_mið_fim_fös_lau'.split('_'),
+ weekdaysMin : 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),
+ longDateFormat : {
+ LT : 'H:mm',
+ LTS : 'H:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D. MMMM YYYY',
+ LLL : 'D. MMMM YYYY [kl.] H:mm',
+ LLLL : 'dddd, D. MMMM YYYY [kl.] H:mm'
+ },
+ calendar : {
+ sameDay : '[í dag kl.] LT',
+ nextDay : '[á morgun kl.] LT',
+ nextWeek : 'dddd [kl.] LT',
+ lastDay : '[í gær kl.] LT',
+ lastWeek : '[síðasta] dddd [kl.] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'eftir %s',
+ past : 'fyrir %s síðan',
+ s : is__translate,
+ m : is__translate,
+ mm : is__translate,
+ h : 'klukkustund',
+ hh : is__translate,
+ d : is__translate,
+ dd : is__translate,
+ M : is__translate,
+ MM : is__translate,
+ y : is__translate,
+ yy : is__translate
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : italian (it)
+ //! author : Lorenzo : https://github.com/aliem
+ //! author: Mattia Larentis: https://github.com/nostalgiaz
+
+ var it = _moment__default.defineLocale('it', {
+ months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
+ monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
+ weekdays : 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'),
+ weekdaysShort : 'Dom_Lun_Mar_Mer_Gio_Ven_Sab'.split('_'),
+ weekdaysMin : 'D_L_Ma_Me_G_V_S'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd, D MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay: '[Oggi alle] LT',
+ nextDay: '[Domani alle] LT',
+ nextWeek: 'dddd [alle] LT',
+ lastDay: '[Ieri alle] LT',
+ lastWeek: function () {
+ switch (this.day()) {
+ case 0:
+ return '[la scorsa] dddd [alle] LT';
+ default:
+ return '[lo scorso] dddd [alle] LT';
+ }
+ },
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : function (s) {
+ return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s;
+ },
+ past : '%s fa',
+ s : 'alcuni secondi',
+ m : 'un minuto',
+ mm : '%d minuti',
+ h : 'un\'ora',
+ hh : '%d ore',
+ d : 'un giorno',
+ dd : '%d giorni',
+ M : 'un mese',
+ MM : '%d mesi',
+ y : 'un anno',
+ yy : '%d anni'
+ },
+ ordinalParse : /\d{1,2}º/,
+ ordinal: '%dº',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : japanese (ja)
+ //! author : LI Long : https://github.com/baryon
+
+ var ja = _moment__default.defineLocale('ja', {
+ months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
+ monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
+ weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),
+ weekdaysShort : '日_月_火_水_木_金_土'.split('_'),
+ weekdaysMin : '日_月_火_水_木_金_土'.split('_'),
+ longDateFormat : {
+ LT : 'Ah時m分',
+ LTS : 'Ah時m分s秒',
+ L : 'YYYY/MM/DD',
+ LL : 'YYYY年M月D日',
+ LLL : 'YYYY年M月D日Ah時m分',
+ LLLL : 'YYYY年M月D日Ah時m分 dddd'
+ },
+ meridiemParse: /午前|午後/i,
+ isPM : function (input) {
+ return input === '午後';
+ },
+ meridiem : function (hour, minute, isLower) {
+ if (hour < 12) {
+ return '午前';
+ } else {
+ return '午後';
+ }
+ },
+ calendar : {
+ sameDay : '[今日] LT',
+ nextDay : '[明日] LT',
+ nextWeek : '[来週]dddd LT',
+ lastDay : '[昨日] LT',
+ lastWeek : '[前週]dddd LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : '%s後',
+ past : '%s前',
+ s : '数秒',
+ m : '1分',
+ mm : '%d分',
+ h : '1時間',
+ hh : '%d時間',
+ d : '1日',
+ dd : '%d日',
+ M : '1ヶ月',
+ MM : '%dヶ月',
+ y : '1年',
+ yy : '%d年'
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Boso Jowo (jv)
+ //! author : Rony Lantip : https://github.com/lantip
+ //! reference: http://jv.wikipedia.org/wiki/Basa_Jawa
+
+ var jv = _moment__default.defineLocale('jv', {
+ months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split('_'),
+ monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),
+ weekdays : 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'),
+ weekdaysShort : 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),
+ weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),
+ longDateFormat : {
+ LT : 'HH.mm',
+ LTS : 'HH.mm.ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY [pukul] HH.mm',
+ LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
+ },
+ meridiemParse: /enjing|siyang|sonten|ndalu/,
+ meridiemHour : function (hour, meridiem) {
+ if (hour === 12) {
+ hour = 0;
+ }
+ if (meridiem === 'enjing') {
+ return hour;
+ } else if (meridiem === 'siyang') {
+ return hour >= 11 ? hour : hour + 12;
+ } else if (meridiem === 'sonten' || meridiem === 'ndalu') {
+ return hour + 12;
+ }
+ },
+ meridiem : function (hours, minutes, isLower) {
+ if (hours < 11) {
+ return 'enjing';
+ } else if (hours < 15) {
+ return 'siyang';
+ } else if (hours < 19) {
+ return 'sonten';
+ } else {
+ return 'ndalu';
+ }
+ },
+ calendar : {
+ sameDay : '[Dinten puniko pukul] LT',
+ nextDay : '[Mbenjang pukul] LT',
+ nextWeek : 'dddd [pukul] LT',
+ lastDay : '[Kala wingi pukul] LT',
+ lastWeek : 'dddd [kepengker pukul] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'wonten ing %s',
+ past : '%s ingkang kepengker',
+ s : 'sawetawis detik',
+ m : 'setunggal menit',
+ mm : '%d menit',
+ h : 'setunggal jam',
+ hh : '%d jam',
+ d : 'sedinten',
+ dd : '%d dinten',
+ M : 'sewulan',
+ MM : '%d wulan',
+ y : 'setaun',
+ yy : '%d taun'
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Georgian (ka)
+ //! author : Irakli Janiashvili : https://github.com/irakli-janiashvili
+
+ function ka__monthsCaseReplace(m, format) {
+ var months = {
+ 'nominative': 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'),
+ 'accusative': 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_')
+ },
+ nounCase = (/D[oD] *MMMM?/).test(format) ?
+ 'accusative' :
+ 'nominative';
+ return months[nounCase][m.month()];
+ }
+ function ka__weekdaysCaseReplace(m, format) {
+ var weekdays = {
+ 'nominative': 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),
+ 'accusative': 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_')
+ },
+ nounCase = (/(წინა|შემდეგ)/).test(format) ?
+ 'accusative' :
+ 'nominative';
+ return weekdays[nounCase][m.day()];
+ }
+
+ var ka = _moment__default.defineLocale('ka', {
+ months : ka__monthsCaseReplace,
+ monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
+ weekdays : ka__weekdaysCaseReplace,
+ weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
+ weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
+ longDateFormat : {
+ LT : 'h:mm A',
+ LTS : 'h:mm:ss A',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY h:mm A',
+ LLLL : 'dddd, D MMMM YYYY h:mm A'
+ },
+ calendar : {
+ sameDay : '[დღეს] LT[-ზე]',
+ nextDay : '[ხვალ] LT[-ზე]',
+ lastDay : '[გუშინ] LT[-ზე]',
+ nextWeek : '[შემდეგ] dddd LT[-ზე]',
+ lastWeek : '[წინა] dddd LT-ზე',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : function (s) {
+ return (/(წამი|წუთი|საათი|წელი)/).test(s) ?
+ s.replace(/ი$/, 'ში') :
+ s + 'ში';
+ },
+ past : function (s) {
+ if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) {
+ return s.replace(/(ი|ე)$/, 'ის წინ');
+ }
+ if ((/წელი/).test(s)) {
+ return s.replace(/წელი$/, 'წლის წინ');
+ }
+ },
+ s : 'რამდენიმე წამი',
+ m : 'წუთი',
+ mm : '%d წუთი',
+ h : 'საათი',
+ hh : '%d საათი',
+ d : 'დღე',
+ dd : '%d დღე',
+ M : 'თვე',
+ MM : '%d თვე',
+ y : 'წელი',
+ yy : '%d წელი'
+ },
+ ordinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,
+ ordinal : function (number) {
+ if (number === 0) {
+ return number;
+ }
+ if (number === 1) {
+ return number + '-ლი';
+ }
+ if ((number < 20) || (number <= 100 && (number % 20 === 0)) || (number % 100 === 0)) {
+ return 'მე-' + number;
+ }
+ return number + '-ე';
+ },
+ week : {
+ dow : 1,
+ doy : 7
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : khmer (km)
+ //! author : Kruy Vanna : https://github.com/kruyvanna
+
+ var km = _moment__default.defineLocale('km', {
+ months: 'មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
+ monthsShort: 'មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
+ weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
+ weekdaysShort: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
+ weekdaysMin: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
+ longDateFormat: {
+ LT: 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ calendar: {
+ sameDay: '[ថ្ងៃនៈ ម៉ោង] LT',
+ nextDay: '[ស្អែក ម៉ោង] LT',
+ nextWeek: 'dddd [ម៉ោង] LT',
+ lastDay: '[ម្សិលមិញ ម៉ោង] LT',
+ lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',
+ sameElse: 'L'
+ },
+ relativeTime: {
+ future: '%sទៀត',
+ past: '%sមុន',
+ s: 'ប៉ុន្មានវិនាទី',
+ m: 'មួយនាទី',
+ mm: '%d នាទី',
+ h: 'មួយម៉ោង',
+ hh: '%d ម៉ោង',
+ d: 'មួយថ្ងៃ',
+ dd: '%d ថ្ងៃ',
+ M: 'មួយខែ',
+ MM: '%d ខែ',
+ y: 'មួយឆ្នាំ',
+ yy: '%d ឆ្នាំ'
+ },
+ week: {
+ dow: 1, // Monday is the first day of the week.
+ doy: 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : korean (ko)
+ //!
+ //! authors
+ //!
+ //! - Kyungwook, Park : https://github.com/kyungw00k
+ //! - Jeeeyul Lee
+
+ var ko = _moment__default.defineLocale('ko', {
+ months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
+ monthsShort : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
+ weekdays : '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),
+ weekdaysShort : '일_월_화_수_목_금_토'.split('_'),
+ weekdaysMin : '일_월_화_수_목_금_토'.split('_'),
+ longDateFormat : {
+ LT : 'A h시 m분',
+ LTS : 'A h시 m분 s초',
+ L : 'YYYY.MM.DD',
+ LL : 'YYYY년 MMMM D일',
+ LLL : 'YYYY년 MMMM D일 A h시 m분',
+ LLLL : 'YYYY년 MMMM D일 dddd A h시 m분'
+ },
+ calendar : {
+ sameDay : '오늘 LT',
+ nextDay : '내일 LT',
+ nextWeek : 'dddd LT',
+ lastDay : '어제 LT',
+ lastWeek : '지난주 dddd LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : '%s 후',
+ past : '%s 전',
+ s : '몇초',
+ ss : '%d초',
+ m : '일분',
+ mm : '%d분',
+ h : '한시간',
+ hh : '%d시간',
+ d : '하루',
+ dd : '%d일',
+ M : '한달',
+ MM : '%d달',
+ y : '일년',
+ yy : '%d년'
+ },
+ ordinalParse : /\d{1,2}일/,
+ ordinal : '%d일',
+ meridiemParse : /오전|오후/,
+ isPM : function (token) {
+ return token === '오후';
+ },
+ meridiem : function (hour, minute, isUpper) {
+ return hour < 12 ? '오전' : '오후';
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Luxembourgish (lb)
+ //! author : mweimerskirch : https://github.com/mweimerskirch, David Raison : https://github.com/kwisatz
+
+ function lb__processRelativeTime(number, withoutSuffix, key, isFuture) {
+ var format = {
+ 'm': ['eng Minutt', 'enger Minutt'],
+ 'h': ['eng Stonn', 'enger Stonn'],
+ 'd': ['een Dag', 'engem Dag'],
+ 'M': ['ee Mount', 'engem Mount'],
+ 'y': ['ee Joer', 'engem Joer']
+ };
+ return withoutSuffix ? format[key][0] : format[key][1];
+ }
+ function processFutureTime(string) {
+ var number = string.substr(0, string.indexOf(' '));
+ if (eifelerRegelAppliesToNumber(number)) {
+ return 'a ' + string;
+ }
+ return 'an ' + string;
+ }
+ function processPastTime(string) {
+ var number = string.substr(0, string.indexOf(' '));
+ if (eifelerRegelAppliesToNumber(number)) {
+ return 'viru ' + string;
+ }
+ return 'virun ' + string;
+ }
+ /**
+ * Returns true if the word before the given number loses the '-n' ending.
+ * e.g. 'an 10 Deeg' but 'a 5 Deeg'
+ *
+ * @param number {integer}
+ * @returns {boolean}
+ */
+ function eifelerRegelAppliesToNumber(number) {
+ number = parseInt(number, 10);
+ if (isNaN(number)) {
+ return false;
+ }
+ if (number < 0) {
+ // Negative Number --> always true
+ return true;
+ } else if (number < 10) {
+ // Only 1 digit
+ if (4 <= number && number <= 7) {
+ return true;
+ }
+ return false;
+ } else if (number < 100) {
+ // 2 digits
+ var lastDigit = number % 10, firstDigit = number / 10;
+ if (lastDigit === 0) {
+ return eifelerRegelAppliesToNumber(firstDigit);
+ }
+ return eifelerRegelAppliesToNumber(lastDigit);
+ } else if (number < 10000) {
+ // 3 or 4 digits --> recursively check first digit
+ while (number >= 10) {
+ number = number / 10;
+ }
+ return eifelerRegelAppliesToNumber(number);
+ } else {
+ // Anything larger than 4 digits: recursively check first n-3 digits
+ number = number / 1000;
+ return eifelerRegelAppliesToNumber(number);
+ }
+ }
+
+ var lb = _moment__default.defineLocale('lb', {
+ months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
+ monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
+ weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'),
+ weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
+ weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
+ longDateFormat: {
+ LT: 'H:mm [Auer]',
+ LTS: 'H:mm:ss [Auer]',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm [Auer]',
+ LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]'
+ },
+ calendar: {
+ sameDay: '[Haut um] LT',
+ sameElse: 'L',
+ nextDay: '[Muer um] LT',
+ nextWeek: 'dddd [um] LT',
+ lastDay: '[Gëschter um] LT',
+ lastWeek: function () {
+ // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
+ switch (this.day()) {
+ case 2:
+ case 4:
+ return '[Leschten] dddd [um] LT';
+ default:
+ return '[Leschte] dddd [um] LT';
+ }
+ }
+ },
+ relativeTime : {
+ future : processFutureTime,
+ past : processPastTime,
+ s : 'e puer Sekonnen',
+ m : lb__processRelativeTime,
+ mm : '%d Minutten',
+ h : lb__processRelativeTime,
+ hh : '%d Stonnen',
+ d : lb__processRelativeTime,
+ dd : '%d Deeg',
+ M : lb__processRelativeTime,
+ MM : '%d Méint',
+ y : lb__processRelativeTime,
+ yy : '%d Joer'
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal: '%d.',
+ week: {
+ dow: 1, // Monday is the first day of the week.
+ doy: 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Lithuanian (lt)
+ //! author : Mindaugas Mozūras : https://github.com/mmozuras
+
+ var lt__units = {
+ 'm' : 'minutė_minutės_minutę',
+ 'mm': 'minutės_minučių_minutes',
+ 'h' : 'valanda_valandos_valandą',
+ 'hh': 'valandos_valandų_valandas',
+ 'd' : 'diena_dienos_dieną',
+ 'dd': 'dienos_dienų_dienas',
+ 'M' : 'mėnuo_mėnesio_mėnesį',
+ 'MM': 'mėnesiai_mėnesių_mėnesius',
+ 'y' : 'metai_metų_metus',
+ 'yy': 'metai_metų_metus'
+ },
+ weekDays = 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_');
+ function translateSeconds(number, withoutSuffix, key, isFuture) {
+ if (withoutSuffix) {
+ return 'kelios sekundės';
+ } else {
+ return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
+ }
+ }
+ function lt__monthsCaseReplace(m, format) {
+ var months = {
+ 'nominative': 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'),
+ 'accusative': 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_')
+ },
+ nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ?
+ 'accusative' :
+ 'nominative';
+ return months[nounCase][m.month()];
+ }
+ function translateSingular(number, withoutSuffix, key, isFuture) {
+ return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]);
+ }
+ function special(number) {
+ return number % 10 === 0 || (number > 10 && number < 20);
+ }
+ function forms(key) {
+ return lt__units[key].split('_');
+ }
+ function lt__translate(number, withoutSuffix, key, isFuture) {
+ var result = number + ' ';
+ if (number === 1) {
+ return result + translateSingular(number, withoutSuffix, key[0], isFuture);
+ } else if (withoutSuffix) {
+ return result + (special(number) ? forms(key)[1] : forms(key)[0]);
+ } else {
+ if (isFuture) {
+ return result + forms(key)[1];
+ } else {
+ return result + (special(number) ? forms(key)[1] : forms(key)[2]);
+ }
+ }
+ }
+ function relativeWeekDay(moment, format) {
+ var nominative = format.indexOf('dddd HH:mm') === -1,
+ weekDay = weekDays[moment.day()];
+ return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + 'į';
+ }
+
+ var lt = _moment__default.defineLocale('lt', {
+ months : lt__monthsCaseReplace,
+ monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
+ weekdays : relativeWeekDay,
+ weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
+ weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'YYYY-MM-DD',
+ LL : 'YYYY [m.] MMMM D [d.]',
+ LLL : 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
+ LLLL : 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
+ l : 'YYYY-MM-DD',
+ ll : 'YYYY [m.] MMMM D [d.]',
+ lll : 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
+ llll : 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]'
+ },
+ calendar : {
+ sameDay : '[Šiandien] LT',
+ nextDay : '[Rytoj] LT',
+ nextWeek : 'dddd LT',
+ lastDay : '[Vakar] LT',
+ lastWeek : '[Praėjusį] dddd LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'po %s',
+ past : 'prieš %s',
+ s : translateSeconds,
+ m : translateSingular,
+ mm : lt__translate,
+ h : translateSingular,
+ hh : lt__translate,
+ d : translateSingular,
+ dd : lt__translate,
+ M : translateSingular,
+ MM : lt__translate,
+ y : translateSingular,
+ yy : lt__translate
+ },
+ ordinalParse: /\d{1,2}-oji/,
+ ordinal : function (number) {
+ return number + '-oji';
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : latvian (lv)
+ //! author : Kristaps Karlsons : https://github.com/skakri
+ //! author : Jānis Elmeris : https://github.com/JanisE
+
+ var lv__units = {
+ 'm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),
+ 'mm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),
+ 'h': 'stundas_stundām_stunda_stundas'.split('_'),
+ 'hh': 'stundas_stundām_stunda_stundas'.split('_'),
+ 'd': 'dienas_dienām_diena_dienas'.split('_'),
+ 'dd': 'dienas_dienām_diena_dienas'.split('_'),
+ 'M': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
+ 'MM': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
+ 'y': 'gada_gadiem_gads_gadi'.split('_'),
+ 'yy': 'gada_gadiem_gads_gadi'.split('_')
+ };
+ /**
+ * @param withoutSuffix boolean true = a length of time; false = before/after a period of time.
+ */
+ function lv__format(forms, number, withoutSuffix) {
+ if (withoutSuffix) {
+ // E.g. "21 minūte", "3 minūtes".
+ return number % 10 === 1 && number !== 11 ? forms[2] : forms[3];
+ } else {
+ // E.g. "21 minūtes" as in "pēc 21 minūtes".
+ // E.g. "3 minūtēm" as in "pēc 3 minūtēm".
+ return number % 10 === 1 && number !== 11 ? forms[0] : forms[1];
+ }
+ }
+ function lv__relativeTimeWithPlural(number, withoutSuffix, key) {
+ return number + ' ' + lv__format(lv__units[key], number, withoutSuffix);
+ }
+ function relativeTimeWithSingular(number, withoutSuffix, key) {
+ return lv__format(lv__units[key], number, withoutSuffix);
+ }
+ function relativeSeconds(number, withoutSuffix) {
+ return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';
+ }
+
+ var lv = _moment__default.defineLocale('lv', {
+ months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'),
+ monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
+ weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'),
+ weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'),
+ weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD.MM.YYYY.',
+ LL : 'YYYY. [gada] D. MMMM',
+ LLL : 'YYYY. [gada] D. MMMM, HH:mm',
+ LLLL : 'YYYY. [gada] D. MMMM, dddd, HH:mm'
+ },
+ calendar : {
+ sameDay : '[Šodien pulksten] LT',
+ nextDay : '[Rīt pulksten] LT',
+ nextWeek : 'dddd [pulksten] LT',
+ lastDay : '[Vakar pulksten] LT',
+ lastWeek : '[Pagājušā] dddd [pulksten] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'pēc %s',
+ past : 'pirms %s',
+ s : relativeSeconds,
+ m : relativeTimeWithSingular,
+ mm : lv__relativeTimeWithPlural,
+ h : relativeTimeWithSingular,
+ hh : lv__relativeTimeWithPlural,
+ d : relativeTimeWithSingular,
+ dd : lv__relativeTimeWithPlural,
+ M : relativeTimeWithSingular,
+ MM : lv__relativeTimeWithPlural,
+ y : relativeTimeWithSingular,
+ yy : lv__relativeTimeWithPlural
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Montenegrin (me)
+ //! author : Miodrag Nikač : https://github.com/miodragnikac
+
+ var me__translator = {
+ words: { //Different grammatical cases
+ m: ['jedan minut', 'jednog minuta'],
+ mm: ['minut', 'minuta', 'minuta'],
+ h: ['jedan sat', 'jednog sata'],
+ hh: ['sat', 'sata', 'sati'],
+ dd: ['dan', 'dana', 'dana'],
+ MM: ['mjesec', 'mjeseca', 'mjeseci'],
+ yy: ['godina', 'godine', 'godina']
+ },
+ correctGrammaticalCase: function (number, wordKey) {
+ return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
+ },
+ translate: function (number, withoutSuffix, key) {
+ var wordKey = me__translator.words[key];
+ if (key.length === 1) {
+ return withoutSuffix ? wordKey[0] : wordKey[1];
+ } else {
+ return number + ' ' + me__translator.correctGrammaticalCase(number, wordKey);
+ }
+ }
+ };
+
+ var me = _moment__default.defineLocale('me', {
+ months: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'],
+ monthsShort: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'],
+ weekdays: ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'],
+ weekdaysShort: ['ned.', 'pon.', 'uto.', 'sri.', 'čet.', 'pet.', 'sub.'],
+ weekdaysMin: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'],
+ longDateFormat: {
+ LT: 'H:mm',
+ LTS : 'H:mm:ss',
+ L: 'DD. MM. YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd, D. MMMM YYYY H:mm'
+ },
+ calendar: {
+ sameDay: '[danas u] LT',
+ nextDay: '[sjutra u] LT',
+
+ nextWeek: function () {
+ switch (this.day()) {
+ case 0:
+ return '[u] [nedjelju] [u] LT';
+ case 3:
+ return '[u] [srijedu] [u] LT';
+ case 6:
+ return '[u] [subotu] [u] LT';
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return '[u] dddd [u] LT';
+ }
+ },
+ lastDay : '[juče u] LT',
+ lastWeek : function () {
+ var lastWeekDays = [
+ '[prošle] [nedjelje] [u] LT',
+ '[prošlog] [ponedjeljka] [u] LT',
+ '[prošlog] [utorka] [u] LT',
+ '[prošle] [srijede] [u] LT',
+ '[prošlog] [četvrtka] [u] LT',
+ '[prošlog] [petka] [u] LT',
+ '[prošle] [subote] [u] LT'
+ ];
+ return lastWeekDays[this.day()];
+ },
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'za %s',
+ past : 'prije %s',
+ s : 'nekoliko sekundi',
+ m : me__translator.translate,
+ mm : me__translator.translate,
+ h : me__translator.translate,
+ hh : me__translator.translate,
+ d : 'dan',
+ dd : me__translator.translate,
+ M : 'mjesec',
+ MM : me__translator.translate,
+ y : 'godinu',
+ yy : me__translator.translate
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : macedonian (mk)
+ //! author : Borislav Mickov : https://github.com/B0k0
+
+ var mk = _moment__default.defineLocale('mk', {
+ months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'),
+ monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),
+ weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'),
+ weekdaysShort : 'нед_пон_вто_сре_чет_пет_саб'.split('_'),
+ weekdaysMin : 'нe_пo_вт_ср_че_пе_сa'.split('_'),
+ longDateFormat : {
+ LT : 'H:mm',
+ LTS : 'H:mm:ss',
+ L : 'D.MM.YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY H:mm',
+ LLLL : 'dddd, D MMMM YYYY H:mm'
+ },
+ calendar : {
+ sameDay : '[Денес во] LT',
+ nextDay : '[Утре во] LT',
+ nextWeek : 'dddd [во] LT',
+ lastDay : '[Вчера во] LT',
+ lastWeek : function () {
+ switch (this.day()) {
+ case 0:
+ case 3:
+ case 6:
+ return '[Во изминатата] dddd [во] LT';
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return '[Во изминатиот] dddd [во] LT';
+ }
+ },
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'после %s',
+ past : 'пред %s',
+ s : 'неколку секунди',
+ m : 'минута',
+ mm : '%d минути',
+ h : 'час',
+ hh : '%d часа',
+ d : 'ден',
+ dd : '%d дена',
+ M : 'месец',
+ MM : '%d месеци',
+ y : 'година',
+ yy : '%d години'
+ },
+ ordinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
+ ordinal : function (number) {
+ var lastDigit = number % 10,
+ last2Digits = number % 100;
+ if (number === 0) {
+ return number + '-ев';
+ } else if (last2Digits === 0) {
+ return number + '-ен';
+ } else if (last2Digits > 10 && last2Digits < 20) {
+ return number + '-ти';
+ } else if (lastDigit === 1) {
+ return number + '-ви';
+ } else if (lastDigit === 2) {
+ return number + '-ри';
+ } else if (lastDigit === 7 || lastDigit === 8) {
+ return number + '-ми';
+ } else {
+ return number + '-ти';
+ }
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : malayalam (ml)
+ //! author : Floyd Pink : https://github.com/floydpink
+
+ var ml = _moment__default.defineLocale('ml', {
+ months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'),
+ monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'),
+ weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'),
+ weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),
+ weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),
+ longDateFormat : {
+ LT : 'A h:mm -നു',
+ LTS : 'A h:mm:ss -നു',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY, A h:mm -നു',
+ LLLL : 'dddd, D MMMM YYYY, A h:mm -നു'
+ },
+ calendar : {
+ sameDay : '[ഇന്ന്] LT',
+ nextDay : '[നാളെ] LT',
+ nextWeek : 'dddd, LT',
+ lastDay : '[ഇന്നലെ] LT',
+ lastWeek : '[കഴിഞ്ഞ] dddd, LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : '%s കഴിഞ്ഞ്',
+ past : '%s മുൻപ്',
+ s : 'അൽപ നിമിഷങ്ങൾ',
+ m : 'ഒരു മിനിറ്റ്',
+ mm : '%d മിനിറ്റ്',
+ h : 'ഒരു മണിക്കൂർ',
+ hh : '%d മണിക്കൂർ',
+ d : 'ഒരു ദിവസം',
+ dd : '%d ദിവസം',
+ M : 'ഒരു മാസം',
+ MM : '%d മാസം',
+ y : 'ഒരു വർഷം',
+ yy : '%d വർഷം'
+ },
+ meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,
+ isPM : function (input) {
+ return /^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(input);
+ },
+ meridiem : function (hour, minute, isLower) {
+ if (hour < 4) {
+ return 'രാത്രി';
+ } else if (hour < 12) {
+ return 'രാവിലെ';
+ } else if (hour < 17) {
+ return 'ഉച്ച കഴിഞ്ഞ്';
+ } else if (hour < 20) {
+ return 'വൈകുന്നേരം';
+ } else {
+ return 'രാത്രി';
+ }
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Marathi (mr)
+ //! author : Harshad Kale : https://github.com/kalehv
+
+ var mr__symbolMap = {
+ '1': '१',
+ '2': '२',
+ '3': '३',
+ '4': '४',
+ '5': '५',
+ '6': '६',
+ '7': '७',
+ '8': '८',
+ '9': '९',
+ '0': '०'
+ },
+ mr__numberMap = {
+ '१': '1',
+ '२': '2',
+ '३': '3',
+ '४': '4',
+ '५': '5',
+ '६': '6',
+ '७': '7',
+ '८': '8',
+ '९': '9',
+ '०': '0'
+ };
+
+ var mr = _moment__default.defineLocale('mr', {
+ months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'),
+ monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'),
+ weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
+ weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),
+ weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),
+ longDateFormat : {
+ LT : 'A h:mm वाजता',
+ LTS : 'A h:mm:ss वाजता',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY, A h:mm वाजता',
+ LLLL : 'dddd, D MMMM YYYY, A h:mm वाजता'
+ },
+ calendar : {
+ sameDay : '[आज] LT',
+ nextDay : '[उद्या] LT',
+ nextWeek : 'dddd, LT',
+ lastDay : '[काल] LT',
+ lastWeek: '[मागील] dddd, LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : '%s नंतर',
+ past : '%s पूर्वी',
+ s : 'सेकंद',
+ m: 'एक मिनिट',
+ mm: '%d मिनिटे',
+ h : 'एक तास',
+ hh : '%d तास',
+ d : 'एक दिवस',
+ dd : '%d दिवस',
+ M : 'एक महिना',
+ MM : '%d महिने',
+ y : 'एक वर्ष',
+ yy : '%d वर्षे'
+ },
+ preparse: function (string) {
+ return string.replace(/[१२३४५६७८९०]/g, function (match) {
+ return mr__numberMap[match];
+ });
+ },
+ postformat: function (string) {
+ return string.replace(/\d/g, function (match) {
+ return mr__symbolMap[match];
+ });
+ },
+ meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/,
+ meridiemHour : function (hour, meridiem) {
+ if (hour === 12) {
+ hour = 0;
+ }
+ if (meridiem === 'रात्री') {
+ return hour < 4 ? hour : hour + 12;
+ } else if (meridiem === 'सकाळी') {
+ return hour;
+ } else if (meridiem === 'दुपारी') {
+ return hour >= 10 ? hour : hour + 12;
+ } else if (meridiem === 'सायंकाळी') {
+ return hour + 12;
+ }
+ },
+ meridiem: function (hour, minute, isLower) {
+ if (hour < 4) {
+ return 'रात्री';
+ } else if (hour < 10) {
+ return 'सकाळी';
+ } else if (hour < 17) {
+ return 'दुपारी';
+ } else if (hour < 20) {
+ return 'सायंकाळी';
+ } else {
+ return 'रात्री';
+ }
+ },
+ week : {
+ dow : 0, // Sunday is the first day of the week.
+ doy : 6 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Bahasa Malaysia (ms-MY)
+ //! author : Weldan Jamili : https://github.com/weldan
+
+ var ms_my = _moment__default.defineLocale('ms-my', {
+ months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
+ monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
+ weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
+ weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
+ weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
+ longDateFormat : {
+ LT : 'HH.mm',
+ LTS : 'HH.mm.ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY [pukul] HH.mm',
+ LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
+ },
+ meridiemParse: /pagi|tengahari|petang|malam/,
+ meridiemHour: function (hour, meridiem) {
+ if (hour === 12) {
+ hour = 0;
+ }
+ if (meridiem === 'pagi') {
+ return hour;
+ } else if (meridiem === 'tengahari') {
+ return hour >= 11 ? hour : hour + 12;
+ } else if (meridiem === 'petang' || meridiem === 'malam') {
+ return hour + 12;
+ }
+ },
+ meridiem : function (hours, minutes, isLower) {
+ if (hours < 11) {
+ return 'pagi';
+ } else if (hours < 15) {
+ return 'tengahari';
+ } else if (hours < 19) {
+ return 'petang';
+ } else {
+ return 'malam';
+ }
+ },
+ calendar : {
+ sameDay : '[Hari ini pukul] LT',
+ nextDay : '[Esok pukul] LT',
+ nextWeek : 'dddd [pukul] LT',
+ lastDay : '[Kelmarin pukul] LT',
+ lastWeek : 'dddd [lepas pukul] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'dalam %s',
+ past : '%s yang lepas',
+ s : 'beberapa saat',
+ m : 'seminit',
+ mm : '%d minit',
+ h : 'sejam',
+ hh : '%d jam',
+ d : 'sehari',
+ dd : '%d hari',
+ M : 'sebulan',
+ MM : '%d bulan',
+ y : 'setahun',
+ yy : '%d tahun'
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Bahasa Malaysia (ms-MY)
+ //! author : Weldan Jamili : https://github.com/weldan
+
+ var locale_ms = _moment__default.defineLocale('ms', {
+ months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
+ monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
+ weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
+ weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
+ weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
+ longDateFormat : {
+ LT : 'HH.mm',
+ LTS : 'HH.mm.ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY [pukul] HH.mm',
+ LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
+ },
+ meridiemParse: /pagi|tengahari|petang|malam/,
+ meridiemHour: function (hour, meridiem) {
+ if (hour === 12) {
+ hour = 0;
+ }
+ if (meridiem === 'pagi') {
+ return hour;
+ } else if (meridiem === 'tengahari') {
+ return hour >= 11 ? hour : hour + 12;
+ } else if (meridiem === 'petang' || meridiem === 'malam') {
+ return hour + 12;
+ }
+ },
+ meridiem : function (hours, minutes, isLower) {
+ if (hours < 11) {
+ return 'pagi';
+ } else if (hours < 15) {
+ return 'tengahari';
+ } else if (hours < 19) {
+ return 'petang';
+ } else {
+ return 'malam';
+ }
+ },
+ calendar : {
+ sameDay : '[Hari ini pukul] LT',
+ nextDay : '[Esok pukul] LT',
+ nextWeek : 'dddd [pukul] LT',
+ lastDay : '[Kelmarin pukul] LT',
+ lastWeek : 'dddd [lepas pukul] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'dalam %s',
+ past : '%s yang lepas',
+ s : 'beberapa saat',
+ m : 'seminit',
+ mm : '%d minit',
+ h : 'sejam',
+ hh : '%d jam',
+ d : 'sehari',
+ dd : '%d hari',
+ M : 'sebulan',
+ MM : '%d bulan',
+ y : 'setahun',
+ yy : '%d tahun'
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Burmese (my)
+ //! author : Squar team, mysquar.com
+
+ var my__symbolMap = {
+ '1': '၁',
+ '2': '၂',
+ '3': '၃',
+ '4': '၄',
+ '5': '၅',
+ '6': '၆',
+ '7': '၇',
+ '8': '၈',
+ '9': '၉',
+ '0': '၀'
+ }, my__numberMap = {
+ '၁': '1',
+ '၂': '2',
+ '၃': '3',
+ '၄': '4',
+ '၅': '5',
+ '၆': '6',
+ '၇': '7',
+ '၈': '8',
+ '၉': '9',
+ '၀': '0'
+ };
+
+ var my = _moment__default.defineLocale('my', {
+ months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'),
+ monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),
+ weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'),
+ weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
+ weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
+
+ longDateFormat: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ calendar: {
+ sameDay: '[ယနေ.] LT [မှာ]',
+ nextDay: '[မနက်ဖြန်] LT [မှာ]',
+ nextWeek: 'dddd LT [မှာ]',
+ lastDay: '[မနေ.က] LT [မှာ]',
+ lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',
+ sameElse: 'L'
+ },
+ relativeTime: {
+ future: 'လာမည့် %s မှာ',
+ past: 'လွန်ခဲ့သော %s က',
+ s: 'စက္ကန်.အနည်းငယ်',
+ m: 'တစ်မိနစ်',
+ mm: '%d မိနစ်',
+ h: 'တစ်နာရီ',
+ hh: '%d နာရီ',
+ d: 'တစ်ရက်',
+ dd: '%d ရက်',
+ M: 'တစ်လ',
+ MM: '%d လ',
+ y: 'တစ်နှစ်',
+ yy: '%d နှစ်'
+ },
+ preparse: function (string) {
+ return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {
+ return my__numberMap[match];
+ });
+ },
+ postformat: function (string) {
+ return string.replace(/\d/g, function (match) {
+ return my__symbolMap[match];
+ });
+ },
+ week: {
+ dow: 1, // Monday is the first day of the week.
+ doy: 4 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : norwegian bokmål (nb)
+ //! authors : Espen Hovlandsdal : https://github.com/rexxars
+ //! Sigurd Gartmann : https://github.com/sigurdga
+
+ var nb = _moment__default.defineLocale('nb', {
+ months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
+ monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
+ weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
+ weekdaysShort : 'søn_man_tirs_ons_tors_fre_lør'.split('_'),
+ weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),
+ longDateFormat : {
+ LT : 'H.mm',
+ LTS : 'H.mm.ss',
+ L : 'DD.MM.YYYY',
+ LL : 'D. MMMM YYYY',
+ LLL : 'D. MMMM YYYY [kl.] H.mm',
+ LLLL : 'dddd D. MMMM YYYY [kl.] H.mm'
+ },
+ calendar : {
+ sameDay: '[i dag kl.] LT',
+ nextDay: '[i morgen kl.] LT',
+ nextWeek: 'dddd [kl.] LT',
+ lastDay: '[i går kl.] LT',
+ lastWeek: '[forrige] dddd [kl.] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'om %s',
+ past : 'for %s siden',
+ s : 'noen sekunder',
+ m : 'ett minutt',
+ mm : '%d minutter',
+ h : 'en time',
+ hh : '%d timer',
+ d : 'en dag',
+ dd : '%d dager',
+ M : 'en måned',
+ MM : '%d måneder',
+ y : 'ett år',
+ yy : '%d år'
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : nepali/nepalese
+ //! author : suvash : https://github.com/suvash
+
+ var ne__symbolMap = {
+ '1': '१',
+ '2': '२',
+ '3': '३',
+ '4': '४',
+ '5': '५',
+ '6': '६',
+ '7': '७',
+ '8': '८',
+ '9': '९',
+ '0': '०'
+ },
+ ne__numberMap = {
+ '१': '1',
+ '२': '2',
+ '३': '3',
+ '४': '4',
+ '५': '5',
+ '६': '6',
+ '७': '7',
+ '८': '8',
+ '९': '9',
+ '०': '0'
+ };
+
+ var ne = _moment__default.defineLocale('ne', {
+ months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'),
+ monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'),
+ weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'),
+ weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),
+ weekdaysMin : 'आइ._सो._मङ्_बु._बि._शु._श.'.split('_'),
+ longDateFormat : {
+ LT : 'Aको h:mm बजे',
+ LTS : 'Aको h:mm:ss बजे',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY, Aको h:mm बजे',
+ LLLL : 'dddd, D MMMM YYYY, Aको h:mm बजे'
+ },
+ preparse: function (string) {
+ return string.replace(/[१२३४५६७८९०]/g, function (match) {
+ return ne__numberMap[match];
+ });
+ },
+ postformat: function (string) {
+ return string.replace(/\d/g, function (match) {
+ return ne__symbolMap[match];
+ });
+ },
+ meridiemParse: /राती|बिहान|दिउँसो|बेलुका|साँझ|राती/,
+ meridiemHour : function (hour, meridiem) {
+ if (hour === 12) {
+ hour = 0;
+ }
+ if (meridiem === 'राती') {
+ return hour < 3 ? hour : hour + 12;
+ } else if (meridiem === 'बिहान') {
+ return hour;
+ } else if (meridiem === 'दिउँसो') {
+ return hour >= 10 ? hour : hour + 12;
+ } else if (meridiem === 'बेलुका' || meridiem === 'साँझ') {
+ return hour + 12;
+ }
+ },
+ meridiem : function (hour, minute, isLower) {
+ if (hour < 3) {
+ return 'राती';
+ } else if (hour < 10) {
+ return 'बिहान';
+ } else if (hour < 15) {
+ return 'दिउँसो';
+ } else if (hour < 18) {
+ return 'बेलुका';
+ } else if (hour < 20) {
+ return 'साँझ';
+ } else {
+ return 'राती';
+ }
+ },
+ calendar : {
+ sameDay : '[आज] LT',
+ nextDay : '[भोली] LT',
+ nextWeek : '[आउँदो] dddd[,] LT',
+ lastDay : '[हिजो] LT',
+ lastWeek : '[गएको] dddd[,] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : '%sमा',
+ past : '%s अगाडी',
+ s : 'केही समय',
+ m : 'एक मिनेट',
+ mm : '%d मिनेट',
+ h : 'एक घण्टा',
+ hh : '%d घण्टा',
+ d : 'एक दिन',
+ dd : '%d दिन',
+ M : 'एक महिना',
+ MM : '%d महिना',
+ y : 'एक बर्ष',
+ yy : '%d बर्ष'
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : dutch (nl)
+ //! author : Joris Röling : https://github.com/jjupiter
+
+ var nl__monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),
+ nl__monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
+
+ var nl = _moment__default.defineLocale('nl', {
+ months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
+ monthsShort : function (m, format) {
+ if (/-MMM-/.test(format)) {
+ return nl__monthsShortWithoutDots[m.month()];
+ } else {
+ return nl__monthsShortWithDots[m.month()];
+ }
+ },
+ weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
+ weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),
+ weekdaysMin : 'Zo_Ma_Di_Wo_Do_Vr_Za'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD-MM-YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd D MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay: '[vandaag om] LT',
+ nextDay: '[morgen om] LT',
+ nextWeek: 'dddd [om] LT',
+ lastDay: '[gisteren om] LT',
+ lastWeek: '[afgelopen] dddd [om] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'over %s',
+ past : '%s geleden',
+ s : 'een paar seconden',
+ m : 'één minuut',
+ mm : '%d minuten',
+ h : 'één uur',
+ hh : '%d uur',
+ d : 'één dag',
+ dd : '%d dagen',
+ M : 'één maand',
+ MM : '%d maanden',
+ y : 'één jaar',
+ yy : '%d jaar'
+ },
+ ordinalParse: /\d{1,2}(ste|de)/,
+ ordinal : function (number) {
+ return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : norwegian nynorsk (nn)
+ //! author : https://github.com/mechuwind
+
+ var nn = _moment__default.defineLocale('nn', {
+ months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
+ monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
+ weekdays : 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),
+ weekdaysShort : 'sun_mån_tys_ons_tor_fre_lau'.split('_'),
+ weekdaysMin : 'su_må_ty_on_to_fr_lø'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD.MM.YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd D MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay: '[I dag klokka] LT',
+ nextDay: '[I morgon klokka] LT',
+ nextWeek: 'dddd [klokka] LT',
+ lastDay: '[I går klokka] LT',
+ lastWeek: '[Føregåande] dddd [klokka] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'om %s',
+ past : 'for %s sidan',
+ s : 'nokre sekund',
+ m : 'eit minutt',
+ mm : '%d minutt',
+ h : 'ein time',
+ hh : '%d timar',
+ d : 'ein dag',
+ dd : '%d dagar',
+ M : 'ein månad',
+ MM : '%d månader',
+ y : 'eit år',
+ yy : '%d år'
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : polish (pl)
+ //! author : Rafal Hirsz : https://github.com/evoL
+
+ var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'),
+ monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');
+ function pl__plural(n) {
+ return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1);
+ }
+ function pl__translate(number, withoutSuffix, key) {
+ var result = number + ' ';
+ switch (key) {
+ case 'm':
+ return withoutSuffix ? 'minuta' : 'minutę';
+ case 'mm':
+ return result + (pl__plural(number) ? 'minuty' : 'minut');
+ case 'h':
+ return withoutSuffix ? 'godzina' : 'godzinę';
+ case 'hh':
+ return result + (pl__plural(number) ? 'godziny' : 'godzin');
+ case 'MM':
+ return result + (pl__plural(number) ? 'miesiące' : 'miesięcy');
+ case 'yy':
+ return result + (pl__plural(number) ? 'lata' : 'lat');
+ }
+ }
+
+ var pl = _moment__default.defineLocale('pl', {
+ months : function (momentToFormat, format) {
+ if (format === '') {
+ // Hack: if format empty we know this is used to generate
+ // RegExp by moment. Give then back both valid forms of months
+ // in RegExp ready format.
+ return '(' + monthsSubjective[momentToFormat.month()] + '|' + monthsNominative[momentToFormat.month()] + ')';
+ } else if (/D MMMM/.test(format)) {
+ return monthsSubjective[momentToFormat.month()];
+ } else {
+ return monthsNominative[momentToFormat.month()];
+ }
+ },
+ monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
+ weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),
+ weekdaysShort : 'nie_pon_wt_śr_czw_pt_sb'.split('_'),
+ weekdaysMin : 'N_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD.MM.YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd, D MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay: '[Dziś o] LT',
+ nextDay: '[Jutro o] LT',
+ nextWeek: '[W] dddd [o] LT',
+ lastDay: '[Wczoraj o] LT',
+ lastWeek: function () {
+ switch (this.day()) {
+ case 0:
+ return '[W zeszłą niedzielę o] LT';
+ case 3:
+ return '[W zeszłą środę o] LT';
+ case 6:
+ return '[W zeszłą sobotę o] LT';
+ default:
+ return '[W zeszły] dddd [o] LT';
+ }
+ },
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'za %s',
+ past : '%s temu',
+ s : 'kilka sekund',
+ m : pl__translate,
+ mm : pl__translate,
+ h : pl__translate,
+ hh : pl__translate,
+ d : '1 dzień',
+ dd : '%d dni',
+ M : 'miesiąc',
+ MM : pl__translate,
+ y : 'rok',
+ yy : pl__translate
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : brazilian portuguese (pt-br)
+ //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira
+
+ var pt_br = _moment__default.defineLocale('pt-br', {
+ months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),
+ monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
+ weekdays : 'Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado'.split('_'),
+ weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
+ weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D [de] MMMM [de] YYYY',
+ LLL : 'D [de] MMMM [de] YYYY [às] HH:mm',
+ LLLL : 'dddd, D [de] MMMM [de] YYYY [às] HH:mm'
+ },
+ calendar : {
+ sameDay: '[Hoje às] LT',
+ nextDay: '[Amanhã às] LT',
+ nextWeek: 'dddd [às] LT',
+ lastDay: '[Ontem às] LT',
+ lastWeek: function () {
+ return (this.day() === 0 || this.day() === 6) ?
+ '[Último] dddd [às] LT' : // Saturday + Sunday
+ '[Última] dddd [às] LT'; // Monday - Friday
+ },
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'em %s',
+ past : '%s atrás',
+ s : 'poucos segundos',
+ m : 'um minuto',
+ mm : '%d minutos',
+ h : 'uma hora',
+ hh : '%d horas',
+ d : 'um dia',
+ dd : '%d dias',
+ M : 'um mês',
+ MM : '%d meses',
+ y : 'um ano',
+ yy : '%d anos'
+ },
+ ordinalParse: /\d{1,2}º/,
+ ordinal : '%dº'
+ });
+
+ //! moment.js locale configuration
+ //! locale : portuguese (pt)
+ //! author : Jefferson : https://github.com/jalex79
+
+ var pt = _moment__default.defineLocale('pt', {
+ months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),
+ monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
+ weekdays : 'Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado'.split('_'),
+ weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
+ weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D [de] MMMM [de] YYYY',
+ LLL : 'D [de] MMMM [de] YYYY HH:mm',
+ LLLL : 'dddd, D [de] MMMM [de] YYYY HH:mm'
+ },
+ calendar : {
+ sameDay: '[Hoje às] LT',
+ nextDay: '[Amanhã às] LT',
+ nextWeek: 'dddd [às] LT',
+ lastDay: '[Ontem às] LT',
+ lastWeek: function () {
+ return (this.day() === 0 || this.day() === 6) ?
+ '[Último] dddd [às] LT' : // Saturday + Sunday
+ '[Última] dddd [às] LT'; // Monday - Friday
+ },
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'em %s',
+ past : 'há %s',
+ s : 'segundos',
+ m : 'um minuto',
+ mm : '%d minutos',
+ h : 'uma hora',
+ hh : '%d horas',
+ d : 'um dia',
+ dd : '%d dias',
+ M : 'um mês',
+ MM : '%d meses',
+ y : 'um ano',
+ yy : '%d anos'
+ },
+ ordinalParse: /\d{1,2}º/,
+ ordinal : '%dº',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : romanian (ro)
+ //! author : Vlad Gurdiga : https://github.com/gurdiga
+ //! author : Valentin Agachi : https://github.com/avaly
+
+ function ro__relativeTimeWithPlural(number, withoutSuffix, key) {
+ var format = {
+ 'mm': 'minute',
+ 'hh': 'ore',
+ 'dd': 'zile',
+ 'MM': 'luni',
+ 'yy': 'ani'
+ },
+ separator = ' ';
+ if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {
+ separator = ' de ';
+ }
+ return number + separator + format[key];
+ }
+
+ var ro = _moment__default.defineLocale('ro', {
+ months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),
+ monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),
+ weekdays : 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
+ weekdaysShort : 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
+ weekdaysMin : 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
+ longDateFormat : {
+ LT : 'H:mm',
+ LTS : 'H:mm:ss',
+ L : 'DD.MM.YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY H:mm',
+ LLLL : 'dddd, D MMMM YYYY H:mm'
+ },
+ calendar : {
+ sameDay: '[azi la] LT',
+ nextDay: '[mâine la] LT',
+ nextWeek: 'dddd [la] LT',
+ lastDay: '[ieri la] LT',
+ lastWeek: '[fosta] dddd [la] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'peste %s',
+ past : '%s în urmă',
+ s : 'câteva secunde',
+ m : 'un minut',
+ mm : ro__relativeTimeWithPlural,
+ h : 'o oră',
+ hh : ro__relativeTimeWithPlural,
+ d : 'o zi',
+ dd : ro__relativeTimeWithPlural,
+ M : 'o lună',
+ MM : ro__relativeTimeWithPlural,
+ y : 'un an',
+ yy : ro__relativeTimeWithPlural
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : russian (ru)
+ //! author : Viktorminator : https://github.com/Viktorminator
+ //! Author : Menelion Elensúle : https://github.com/Oire
+
+ function ru__plural(word, num) {
+ var forms = word.split('_');
+ return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
+ }
+ function ru__relativeTimeWithPlural(number, withoutSuffix, key) {
+ var format = {
+ 'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
+ 'hh': 'час_часа_часов',
+ 'dd': 'день_дня_дней',
+ 'MM': 'месяц_месяца_месяцев',
+ 'yy': 'год_года_лет'
+ };
+ if (key === 'm') {
+ return withoutSuffix ? 'минута' : 'минуту';
+ }
+ else {
+ return number + ' ' + ru__plural(format[key], +number);
+ }
+ }
+ function ru__monthsCaseReplace(m, format) {
+ var months = {
+ 'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
+ 'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_')
+ },
+ nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ?
+ 'accusative' :
+ 'nominative';
+ return months[nounCase][m.month()];
+ }
+ function ru__monthsShortCaseReplace(m, format) {
+ var monthsShort = {
+ 'nominative': 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),
+ 'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_')
+ },
+ nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ?
+ 'accusative' :
+ 'nominative';
+ return monthsShort[nounCase][m.month()];
+ }
+ function ru__weekdaysCaseReplace(m, format) {
+ var weekdays = {
+ 'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
+ 'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_')
+ },
+ nounCase = (/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/).test(format) ?
+ 'accusative' :
+ 'nominative';
+ return weekdays[nounCase][m.day()];
+ }
+
+ var ru = _moment__default.defineLocale('ru', {
+ months : ru__monthsCaseReplace,
+ monthsShort : ru__monthsShortCaseReplace,
+ weekdays : ru__weekdaysCaseReplace,
+ weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
+ weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
+ monthsParse : [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i],
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD.MM.YYYY',
+ LL : 'D MMMM YYYY г.',
+ LLL : 'D MMMM YYYY г., HH:mm',
+ LLLL : 'dddd, D MMMM YYYY г., HH:mm'
+ },
+ calendar : {
+ sameDay: '[Сегодня в] LT',
+ nextDay: '[Завтра в] LT',
+ lastDay: '[Вчера в] LT',
+ nextWeek: function () {
+ return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT';
+ },
+ lastWeek: function (now) {
+ if (now.week() !== this.week()) {
+ switch (this.day()) {
+ case 0:
+ return '[В прошлое] dddd [в] LT';
+ case 1:
+ case 2:
+ case 4:
+ return '[В прошлый] dddd [в] LT';
+ case 3:
+ case 5:
+ case 6:
+ return '[В прошлую] dddd [в] LT';
+ }
+ } else {
+ if (this.day() === 2) {
+ return '[Во] dddd [в] LT';
+ } else {
+ return '[В] dddd [в] LT';
+ }
+ }
+ },
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'через %s',
+ past : '%s назад',
+ s : 'несколько секунд',
+ m : ru__relativeTimeWithPlural,
+ mm : ru__relativeTimeWithPlural,
+ h : 'час',
+ hh : ru__relativeTimeWithPlural,
+ d : 'день',
+ dd : ru__relativeTimeWithPlural,
+ M : 'месяц',
+ MM : ru__relativeTimeWithPlural,
+ y : 'год',
+ yy : ru__relativeTimeWithPlural
+ },
+ meridiemParse: /ночи|утра|дня|вечера/i,
+ isPM : function (input) {
+ return /^(дня|вечера)$/.test(input);
+ },
+ meridiem : function (hour, minute, isLower) {
+ if (hour < 4) {
+ return 'ночи';
+ } else if (hour < 12) {
+ return 'утра';
+ } else if (hour < 17) {
+ return 'дня';
+ } else {
+ return 'вечера';
+ }
+ },
+ ordinalParse: /\d{1,2}-(й|го|я)/,
+ ordinal: function (number, period) {
+ switch (period) {
+ case 'M':
+ case 'd':
+ case 'DDD':
+ return number + '-й';
+ case 'D':
+ return number + '-го';
+ case 'w':
+ case 'W':
+ return number + '-я';
+ default:
+ return number;
+ }
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Sinhalese (si)
+ //! author : Sampath Sitinamaluwa : https://github.com/sampathsris
+
+ var si = _moment__default.defineLocale('si', {
+ months : 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split('_'),
+ monthsShort : 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split('_'),
+ weekdays : 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split('_'),
+ weekdaysShort : 'ඉරි_සඳු_අඟ_බදා_බ්රහ_සිකු_සෙන'.split('_'),
+ weekdaysMin : 'ඉ_ස_අ_බ_බ්ර_සි_සෙ'.split('_'),
+ longDateFormat : {
+ LT : 'a h:mm',
+ LTS : 'a h:mm:ss',
+ L : 'YYYY/MM/DD',
+ LL : 'YYYY MMMM D',
+ LLL : 'YYYY MMMM D, a h:mm',
+ LLLL : 'YYYY MMMM D [වැනි] dddd, a h:mm:ss'
+ },
+ calendar : {
+ sameDay : '[අද] LT[ට]',
+ nextDay : '[හෙට] LT[ට]',
+ nextWeek : 'dddd LT[ට]',
+ lastDay : '[ඊයේ] LT[ට]',
+ lastWeek : '[පසුගිය] dddd LT[ට]',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : '%sකින්',
+ past : '%sකට පෙර',
+ s : 'තත්පර කිහිපය',
+ m : 'මිනිත්තුව',
+ mm : 'මිනිත්තු %d',
+ h : 'පැය',
+ hh : 'පැය %d',
+ d : 'දිනය',
+ dd : 'දින %d',
+ M : 'මාසය',
+ MM : 'මාස %d',
+ y : 'වසර',
+ yy : 'වසර %d'
+ },
+ ordinalParse: /\d{1,2} වැනි/,
+ ordinal : function (number) {
+ return number + ' වැනි';
+ },
+ meridiem : function (hours, minutes, isLower) {
+ if (hours > 11) {
+ return isLower ? 'ප.ව.' : 'පස් වරු';
+ } else {
+ return isLower ? 'පෙ.ව.' : 'පෙර වරු';
+ }
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : slovak (sk)
+ //! author : Martin Minka : https://github.com/k2s
+ //! based on work of petrbela : https://github.com/petrbela
+
+ var sk__months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'),
+ sk__monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
+ function sk__plural(n) {
+ return (n > 1) && (n < 5);
+ }
+ function sk__translate(number, withoutSuffix, key, isFuture) {
+ var result = number + ' ';
+ switch (key) {
+ case 's': // a few seconds / in a few seconds / a few seconds ago
+ return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami';
+ case 'm': // a minute / in a minute / a minute ago
+ return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou');
+ case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
+ if (withoutSuffix || isFuture) {
+ return result + (sk__plural(number) ? 'minúty' : 'minút');
+ } else {
+ return result + 'minútami';
+ }
+ break;
+ case 'h': // an hour / in an hour / an hour ago
+ return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
+ case 'hh': // 9 hours / in 9 hours / 9 hours ago
+ if (withoutSuffix || isFuture) {
+ return result + (sk__plural(number) ? 'hodiny' : 'hodín');
+ } else {
+ return result + 'hodinami';
+ }
+ break;
+ case 'd': // a day / in a day / a day ago
+ return (withoutSuffix || isFuture) ? 'deň' : 'dňom';
+ case 'dd': // 9 days / in 9 days / 9 days ago
+ if (withoutSuffix || isFuture) {
+ return result + (sk__plural(number) ? 'dni' : 'dní');
+ } else {
+ return result + 'dňami';
+ }
+ break;
+ case 'M': // a month / in a month / a month ago
+ return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom';
+ case 'MM': // 9 months / in 9 months / 9 months ago
+ if (withoutSuffix || isFuture) {
+ return result + (sk__plural(number) ? 'mesiace' : 'mesiacov');
+ } else {
+ return result + 'mesiacmi';
+ }
+ break;
+ case 'y': // a year / in a year / a year ago
+ return (withoutSuffix || isFuture) ? 'rok' : 'rokom';
+ case 'yy': // 9 years / in 9 years / 9 years ago
+ if (withoutSuffix || isFuture) {
+ return result + (sk__plural(number) ? 'roky' : 'rokov');
+ } else {
+ return result + 'rokmi';
+ }
+ break;
+ }
+ }
+
+ var sk = _moment__default.defineLocale('sk', {
+ months : sk__months,
+ monthsShort : sk__monthsShort,
+ monthsParse : (function (months, monthsShort) {
+ var i, _monthsParse = [];
+ for (i = 0; i < 12; i++) {
+ // use custom parser to solve problem with July (červenec)
+ _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');
+ }
+ return _monthsParse;
+ }(sk__months, sk__monthsShort)),
+ weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
+ weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'),
+ weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'),
+ longDateFormat : {
+ LT: 'H:mm',
+ LTS : 'H:mm:ss',
+ L : 'DD.MM.YYYY',
+ LL : 'D. MMMM YYYY',
+ LLL : 'D. MMMM YYYY H:mm',
+ LLLL : 'dddd D. MMMM YYYY H:mm'
+ },
+ calendar : {
+ sameDay: '[dnes o] LT',
+ nextDay: '[zajtra o] LT',
+ nextWeek: function () {
+ switch (this.day()) {
+ case 0:
+ return '[v nedeľu o] LT';
+ case 1:
+ case 2:
+ return '[v] dddd [o] LT';
+ case 3:
+ return '[v stredu o] LT';
+ case 4:
+ return '[vo štvrtok o] LT';
+ case 5:
+ return '[v piatok o] LT';
+ case 6:
+ return '[v sobotu o] LT';
+ }
+ },
+ lastDay: '[včera o] LT',
+ lastWeek: function () {
+ switch (this.day()) {
+ case 0:
+ return '[minulú nedeľu o] LT';
+ case 1:
+ case 2:
+ return '[minulý] dddd [o] LT';
+ case 3:
+ return '[minulú stredu o] LT';
+ case 4:
+ case 5:
+ return '[minulý] dddd [o] LT';
+ case 6:
+ return '[minulú sobotu o] LT';
+ }
+ },
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'za %s',
+ past : 'pred %s',
+ s : sk__translate,
+ m : sk__translate,
+ mm : sk__translate,
+ h : sk__translate,
+ hh : sk__translate,
+ d : sk__translate,
+ dd : sk__translate,
+ M : sk__translate,
+ MM : sk__translate,
+ y : sk__translate,
+ yy : sk__translate
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : slovenian (sl)
+ //! author : Robert Sedovšek : https://github.com/sedovsek
+
+ function sl__processRelativeTime(number, withoutSuffix, key, isFuture) {
+ var result = number + ' ';
+ switch (key) {
+ case 's':
+ return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';
+ case 'm':
+ return withoutSuffix ? 'ena minuta' : 'eno minuto';
+ case 'mm':
+ if (number === 1) {
+ result += withoutSuffix ? 'minuta' : 'minuto';
+ } else if (number === 2) {
+ result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
+ } else if (number < 5) {
+ result += withoutSuffix || isFuture ? 'minute' : 'minutami';
+ } else {
+ result += withoutSuffix || isFuture ? 'minut' : 'minutami';
+ }
+ return result;
+ case 'h':
+ return withoutSuffix ? 'ena ura' : 'eno uro';
+ case 'hh':
+ if (number === 1) {
+ result += withoutSuffix ? 'ura' : 'uro';
+ } else if (number === 2) {
+ result += withoutSuffix || isFuture ? 'uri' : 'urama';
+ } else if (number < 5) {
+ result += withoutSuffix || isFuture ? 'ure' : 'urami';
+ } else {
+ result += withoutSuffix || isFuture ? 'ur' : 'urami';
+ }
+ return result;
+ case 'd':
+ return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
+ case 'dd':
+ if (number === 1) {
+ result += withoutSuffix || isFuture ? 'dan' : 'dnem';
+ } else if (number === 2) {
+ result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
+ } else {
+ result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
+ }
+ return result;
+ case 'M':
+ return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
+ case 'MM':
+ if (number === 1) {
+ result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
+ } else if (number === 2) {
+ result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
+ } else if (number < 5) {
+ result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
+ } else {
+ result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
+ }
+ return result;
+ case 'y':
+ return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
+ case 'yy':
+ if (number === 1) {
+ result += withoutSuffix || isFuture ? 'leto' : 'letom';
+ } else if (number === 2) {
+ result += withoutSuffix || isFuture ? 'leti' : 'letoma';
+ } else if (number < 5) {
+ result += withoutSuffix || isFuture ? 'leta' : 'leti';
+ } else {
+ result += withoutSuffix || isFuture ? 'let' : 'leti';
+ }
+ return result;
+ }
+ }
+
+ var sl = _moment__default.defineLocale('sl', {
+ months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'),
+ monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),
+ weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
+ weekdaysShort : 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
+ weekdaysMin : 'ne_po_to_sr_če_pe_so'.split('_'),
+ longDateFormat : {
+ LT : 'H:mm',
+ LTS : 'H:mm:ss',
+ L : 'DD. MM. YYYY',
+ LL : 'D. MMMM YYYY',
+ LLL : 'D. MMMM YYYY H:mm',
+ LLLL : 'dddd, D. MMMM YYYY H:mm'
+ },
+ calendar : {
+ sameDay : '[danes ob] LT',
+ nextDay : '[jutri ob] LT',
+
+ nextWeek : function () {
+ switch (this.day()) {
+ case 0:
+ return '[v] [nedeljo] [ob] LT';
+ case 3:
+ return '[v] [sredo] [ob] LT';
+ case 6:
+ return '[v] [soboto] [ob] LT';
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return '[v] dddd [ob] LT';
+ }
+ },
+ lastDay : '[včeraj ob] LT',
+ lastWeek : function () {
+ switch (this.day()) {
+ case 0:
+ return '[prejšnjo] [nedeljo] [ob] LT';
+ case 3:
+ return '[prejšnjo] [sredo] [ob] LT';
+ case 6:
+ return '[prejšnjo] [soboto] [ob] LT';
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return '[prejšnji] dddd [ob] LT';
+ }
+ },
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'čez %s',
+ past : 'pred %s',
+ s : sl__processRelativeTime,
+ m : sl__processRelativeTime,
+ mm : sl__processRelativeTime,
+ h : sl__processRelativeTime,
+ hh : sl__processRelativeTime,
+ d : sl__processRelativeTime,
+ dd : sl__processRelativeTime,
+ M : sl__processRelativeTime,
+ MM : sl__processRelativeTime,
+ y : sl__processRelativeTime,
+ yy : sl__processRelativeTime
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Albanian (sq)
+ //! author : Flakërim Ismani : https://github.com/flakerimi
+ //! author: Menelion Elensúle: https://github.com/Oire (tests)
+ //! author : Oerd Cukalla : https://github.com/oerd (fixes)
+
+ var sq = _moment__default.defineLocale('sq', {
+ months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'),
+ monthsShort : 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),
+ weekdays : 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'),
+ weekdaysShort : 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),
+ weekdaysMin : 'D_H_Ma_Më_E_P_Sh'.split('_'),
+ meridiemParse: /PD|MD/,
+ isPM: function (input) {
+ return input.charAt(0) === 'M';
+ },
+ meridiem : function (hours, minutes, isLower) {
+ return hours < 12 ? 'PD' : 'MD';
+ },
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd, D MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay : '[Sot në] LT',
+ nextDay : '[Nesër në] LT',
+ nextWeek : 'dddd [në] LT',
+ lastDay : '[Dje në] LT',
+ lastWeek : 'dddd [e kaluar në] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'në %s',
+ past : '%s më parë',
+ s : 'disa sekonda',
+ m : 'një minutë',
+ mm : '%d minuta',
+ h : 'një orë',
+ hh : '%d orë',
+ d : 'një ditë',
+ dd : '%d ditë',
+ M : 'një muaj',
+ MM : '%d muaj',
+ y : 'një vit',
+ yy : '%d vite'
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Serbian-cyrillic (sr-cyrl)
+ //! author : Milan Janačković : https://github.com/milan-j
+
+ var sr_cyrl__translator = {
+ words: { //Different grammatical cases
+ m: ['један минут', 'једне минуте'],
+ mm: ['минут', 'минуте', 'минута'],
+ h: ['један сат', 'једног сата'],
+ hh: ['сат', 'сата', 'сати'],
+ dd: ['дан', 'дана', 'дана'],
+ MM: ['месец', 'месеца', 'месеци'],
+ yy: ['година', 'године', 'година']
+ },
+ correctGrammaticalCase: function (number, wordKey) {
+ return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
+ },
+ translate: function (number, withoutSuffix, key) {
+ var wordKey = sr_cyrl__translator.words[key];
+ if (key.length === 1) {
+ return withoutSuffix ? wordKey[0] : wordKey[1];
+ } else {
+ return number + ' ' + sr_cyrl__translator.correctGrammaticalCase(number, wordKey);
+ }
+ }
+ };
+
+ var sr_cyrl = _moment__default.defineLocale('sr-cyrl', {
+ months: ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'],
+ monthsShort: ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'],
+ weekdays: ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'],
+ weekdaysShort: ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'],
+ weekdaysMin: ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'],
+ longDateFormat: {
+ LT: 'H:mm',
+ LTS : 'H:mm:ss',
+ L: 'DD. MM. YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd, D. MMMM YYYY H:mm'
+ },
+ calendar: {
+ sameDay: '[данас у] LT',
+ nextDay: '[сутра у] LT',
+ nextWeek: function () {
+ switch (this.day()) {
+ case 0:
+ return '[у] [недељу] [у] LT';
+ case 3:
+ return '[у] [среду] [у] LT';
+ case 6:
+ return '[у] [суботу] [у] LT';
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return '[у] dddd [у] LT';
+ }
+ },
+ lastDay : '[јуче у] LT',
+ lastWeek : function () {
+ var lastWeekDays = [
+ '[прошле] [недеље] [у] LT',
+ '[прошлог] [понедељка] [у] LT',
+ '[прошлог] [уторка] [у] LT',
+ '[прошле] [среде] [у] LT',
+ '[прошлог] [четвртка] [у] LT',
+ '[прошлог] [петка] [у] LT',
+ '[прошле] [суботе] [у] LT'
+ ];
+ return lastWeekDays[this.day()];
+ },
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'за %s',
+ past : 'пре %s',
+ s : 'неколико секунди',
+ m : sr_cyrl__translator.translate,
+ mm : sr_cyrl__translator.translate,
+ h : sr_cyrl__translator.translate,
+ hh : sr_cyrl__translator.translate,
+ d : 'дан',
+ dd : sr_cyrl__translator.translate,
+ M : 'месец',
+ MM : sr_cyrl__translator.translate,
+ y : 'годину',
+ yy : sr_cyrl__translator.translate
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Serbian-latin (sr)
+ //! author : Milan Janačković : https://github.com/milan-j
+
+ var sr__translator = {
+ words: { //Different grammatical cases
+ m: ['jedan minut', 'jedne minute'],
+ mm: ['minut', 'minute', 'minuta'],
+ h: ['jedan sat', 'jednog sata'],
+ hh: ['sat', 'sata', 'sati'],
+ dd: ['dan', 'dana', 'dana'],
+ MM: ['mesec', 'meseca', 'meseci'],
+ yy: ['godina', 'godine', 'godina']
+ },
+ correctGrammaticalCase: function (number, wordKey) {
+ return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
+ },
+ translate: function (number, withoutSuffix, key) {
+ var wordKey = sr__translator.words[key];
+ if (key.length === 1) {
+ return withoutSuffix ? wordKey[0] : wordKey[1];
+ } else {
+ return number + ' ' + sr__translator.correctGrammaticalCase(number, wordKey);
+ }
+ }
+ };
+
+ var sr = _moment__default.defineLocale('sr', {
+ months: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'],
+ monthsShort: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'],
+ weekdays: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'],
+ weekdaysShort: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'],
+ weekdaysMin: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'],
+ longDateFormat: {
+ LT: 'H:mm',
+ LTS : 'H:mm:ss',
+ L: 'DD. MM. YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd, D. MMMM YYYY H:mm'
+ },
+ calendar: {
+ sameDay: '[danas u] LT',
+ nextDay: '[sutra u] LT',
+ nextWeek: function () {
+ switch (this.day()) {
+ case 0:
+ return '[u] [nedelju] [u] LT';
+ case 3:
+ return '[u] [sredu] [u] LT';
+ case 6:
+ return '[u] [subotu] [u] LT';
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return '[u] dddd [u] LT';
+ }
+ },
+ lastDay : '[juče u] LT',
+ lastWeek : function () {
+ var lastWeekDays = [
+ '[prošle] [nedelje] [u] LT',
+ '[prošlog] [ponedeljka] [u] LT',
+ '[prošlog] [utorka] [u] LT',
+ '[prošle] [srede] [u] LT',
+ '[prošlog] [četvrtka] [u] LT',
+ '[prošlog] [petka] [u] LT',
+ '[prošle] [subote] [u] LT'
+ ];
+ return lastWeekDays[this.day()];
+ },
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'za %s',
+ past : 'pre %s',
+ s : 'nekoliko sekundi',
+ m : sr__translator.translate,
+ mm : sr__translator.translate,
+ h : sr__translator.translate,
+ hh : sr__translator.translate,
+ d : 'dan',
+ dd : sr__translator.translate,
+ M : 'mesec',
+ MM : sr__translator.translate,
+ y : 'godinu',
+ yy : sr__translator.translate
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : swedish (sv)
+ //! author : Jens Alm : https://github.com/ulmus
+
+ var sv = _moment__default.defineLocale('sv', {
+ months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),
+ monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
+ weekdays : 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),
+ weekdaysShort : 'sön_mån_tis_ons_tor_fre_lör'.split('_'),
+ weekdaysMin : 'sö_må_ti_on_to_fr_lö'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'YYYY-MM-DD',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd D MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay: '[Idag] LT',
+ nextDay: '[Imorgon] LT',
+ lastDay: '[Igår] LT',
+ nextWeek: '[På] dddd LT',
+ lastWeek: '[I] dddd[s] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'om %s',
+ past : 'för %s sedan',
+ s : 'några sekunder',
+ m : 'en minut',
+ mm : '%d minuter',
+ h : 'en timme',
+ hh : '%d timmar',
+ d : 'en dag',
+ dd : '%d dagar',
+ M : 'en månad',
+ MM : '%d månader',
+ y : 'ett år',
+ yy : '%d år'
+ },
+ ordinalParse: /\d{1,2}(e|a)/,
+ ordinal : function (number) {
+ var b = number % 10,
+ output = (~~(number % 100 / 10) === 1) ? 'e' :
+ (b === 1) ? 'a' :
+ (b === 2) ? 'a' :
+ (b === 3) ? 'e' : 'e';
+ return number + output;
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : tamil (ta)
+ //! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404
+
+ var ta = _moment__default.defineLocale('ta', {
+ months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
+ monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
+ weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'),
+ weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'),
+ weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY, HH:mm',
+ LLLL : 'dddd, D MMMM YYYY, HH:mm'
+ },
+ calendar : {
+ sameDay : '[இன்று] LT',
+ nextDay : '[நாளை] LT',
+ nextWeek : 'dddd, LT',
+ lastDay : '[நேற்று] LT',
+ lastWeek : '[கடந்த வாரம்] dddd, LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : '%s இல்',
+ past : '%s முன்',
+ s : 'ஒரு சில விநாடிகள்',
+ m : 'ஒரு நிமிடம்',
+ mm : '%d நிமிடங்கள்',
+ h : 'ஒரு மணி நேரம்',
+ hh : '%d மணி நேரம்',
+ d : 'ஒரு நாள்',
+ dd : '%d நாட்கள்',
+ M : 'ஒரு மாதம்',
+ MM : '%d மாதங்கள்',
+ y : 'ஒரு வருடம்',
+ yy : '%d ஆண்டுகள்'
+ },
+ ordinalParse: /\d{1,2}வது/,
+ ordinal : function (number) {
+ return number + 'வது';
+ },
+ // refer http://ta.wikipedia.org/s/1er1
+ meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,
+ meridiem : function (hour, minute, isLower) {
+ if (hour < 2) {
+ return ' யாமம்';
+ } else if (hour < 6) {
+ return ' வைகறை'; // வைகறை
+ } else if (hour < 10) {
+ return ' காலை'; // காலை
+ } else if (hour < 14) {
+ return ' நண்பகல்'; // நண்பகல்
+ } else if (hour < 18) {
+ return ' எற்பாடு'; // எற்பாடு
+ } else if (hour < 22) {
+ return ' மாலை'; // மாலை
+ } else {
+ return ' யாமம்';
+ }
+ },
+ meridiemHour : function (hour, meridiem) {
+ if (hour === 12) {
+ hour = 0;
+ }
+ if (meridiem === 'யாமம்') {
+ return hour < 2 ? hour : hour + 12;
+ } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {
+ return hour;
+ } else if (meridiem === 'நண்பகல்') {
+ return hour >= 10 ? hour : hour + 12;
+ } else {
+ return hour + 12;
+ }
+ },
+ week : {
+ dow : 0, // Sunday is the first day of the week.
+ doy : 6 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : thai (th)
+ //! author : Kridsada Thanabulpong : https://github.com/sirn
+
+ var th = _moment__default.defineLocale('th', {
+ months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),
+ monthsShort : 'มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา'.split('_'),
+ weekdays : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),
+ weekdaysShort : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference
+ weekdaysMin : 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
+ longDateFormat : {
+ LT : 'H นาฬิกา m นาที',
+ LTS : 'H นาฬิกา m นาที s วินาที',
+ L : 'YYYY/MM/DD',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY เวลา H นาฬิกา m นาที',
+ LLLL : 'วันddddที่ D MMMM YYYY เวลา H นาฬิกา m นาที'
+ },
+ meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,
+ isPM: function (input) {
+ return input === 'หลังเที่ยง';
+ },
+ meridiem : function (hour, minute, isLower) {
+ if (hour < 12) {
+ return 'ก่อนเที่ยง';
+ } else {
+ return 'หลังเที่ยง';
+ }
+ },
+ calendar : {
+ sameDay : '[วันนี้ เวลา] LT',
+ nextDay : '[พรุ่งนี้ เวลา] LT',
+ nextWeek : 'dddd[หน้า เวลา] LT',
+ lastDay : '[เมื่อวานนี้ เวลา] LT',
+ lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'อีก %s',
+ past : '%sที่แล้ว',
+ s : 'ไม่กี่วินาที',
+ m : '1 นาที',
+ mm : '%d นาที',
+ h : '1 ชั่วโมง',
+ hh : '%d ชั่วโมง',
+ d : '1 วัน',
+ dd : '%d วัน',
+ M : '1 เดือน',
+ MM : '%d เดือน',
+ y : '1 ปี',
+ yy : '%d ปี'
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Tagalog/Filipino (tl-ph)
+ //! author : Dan Hagman
+
+ var tl_ph = _moment__default.defineLocale('tl-ph', {
+ months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'),
+ monthsShort : 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
+ weekdays : 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'),
+ weekdaysShort : 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
+ weekdaysMin : 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'MM/D/YYYY',
+ LL : 'MMMM D, YYYY',
+ LLL : 'MMMM D, YYYY HH:mm',
+ LLLL : 'dddd, MMMM DD, YYYY HH:mm'
+ },
+ calendar : {
+ sameDay: '[Ngayon sa] LT',
+ nextDay: '[Bukas sa] LT',
+ nextWeek: 'dddd [sa] LT',
+ lastDay: '[Kahapon sa] LT',
+ lastWeek: 'dddd [huling linggo] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'sa loob ng %s',
+ past : '%s ang nakalipas',
+ s : 'ilang segundo',
+ m : 'isang minuto',
+ mm : '%d minuto',
+ h : 'isang oras',
+ hh : '%d oras',
+ d : 'isang araw',
+ dd : '%d araw',
+ M : 'isang buwan',
+ MM : '%d buwan',
+ y : 'isang taon',
+ yy : '%d taon'
+ },
+ ordinalParse: /\d{1,2}/,
+ ordinal : function (number) {
+ return number;
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : turkish (tr)
+ //! authors : Erhan Gundogan : https://github.com/erhangundogan,
+ //! Burak Yiğit Kaya: https://github.com/BYK
+
+ var tr__suffixes = {
+ 1: '\'inci',
+ 5: '\'inci',
+ 8: '\'inci',
+ 70: '\'inci',
+ 80: '\'inci',
+ 2: '\'nci',
+ 7: '\'nci',
+ 20: '\'nci',
+ 50: '\'nci',
+ 3: '\'üncü',
+ 4: '\'üncü',
+ 100: '\'üncü',
+ 6: '\'ncı',
+ 9: '\'uncu',
+ 10: '\'uncu',
+ 30: '\'uncu',
+ 60: '\'ıncı',
+ 90: '\'ıncı'
+ };
+
+ var tr = _moment__default.defineLocale('tr', {
+ months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),
+ monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
+ weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),
+ weekdaysShort : 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
+ weekdaysMin : 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD.MM.YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd, D MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay : '[bugün saat] LT',
+ nextDay : '[yarın saat] LT',
+ nextWeek : '[haftaya] dddd [saat] LT',
+ lastDay : '[dün] LT',
+ lastWeek : '[geçen hafta] dddd [saat] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : '%s sonra',
+ past : '%s önce',
+ s : 'birkaç saniye',
+ m : 'bir dakika',
+ mm : '%d dakika',
+ h : 'bir saat',
+ hh : '%d saat',
+ d : 'bir gün',
+ dd : '%d gün',
+ M : 'bir ay',
+ MM : '%d ay',
+ y : 'bir yıl',
+ yy : '%d yıl'
+ },
+ ordinalParse: /\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,
+ ordinal : function (number) {
+ if (number === 0) { // special case for zero
+ return number + '\'ıncı';
+ }
+ var a = number % 10,
+ b = number % 100 - a,
+ c = number >= 100 ? 100 : null;
+ return number + (tr__suffixes[a] || tr__suffixes[b] || tr__suffixes[c]);
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : talossan (tzl)
+ //! author : Robin van der Vliet : https://github.com/robin0van0der0v with the help of Iustì Canun
+
+
+ var tzl = _moment__default.defineLocale('tzl', {
+ months : 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split('_'),
+ monthsShort : 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),
+ weekdays : 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'),
+ weekdaysShort : 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),
+ weekdaysMin : 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),
+ longDateFormat : {
+ LT : 'HH.mm',
+ LTS : 'LT.ss',
+ L : 'DD.MM.YYYY',
+ LL : 'D. MMMM [dallas] YYYY',
+ LLL : 'D. MMMM [dallas] YYYY LT',
+ LLLL : 'dddd, [li] D. MMMM [dallas] YYYY LT'
+ },
+ meridiem : function (hours, minutes, isLower) {
+ if (hours > 11) {
+ return isLower ? 'd\'o' : 'D\'O';
+ } else {
+ return isLower ? 'd\'a' : 'D\'A';
+ }
+ },
+ calendar : {
+ sameDay : '[oxhi à] LT',
+ nextDay : '[demà à] LT',
+ nextWeek : 'dddd [à] LT',
+ lastDay : '[ieiri à] LT',
+ lastWeek : '[sür el] dddd [lasteu à] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'osprei %s',
+ past : 'ja%s',
+ s : tzl__processRelativeTime,
+ m : tzl__processRelativeTime,
+ mm : tzl__processRelativeTime,
+ h : tzl__processRelativeTime,
+ hh : tzl__processRelativeTime,
+ d : tzl__processRelativeTime,
+ dd : tzl__processRelativeTime,
+ M : tzl__processRelativeTime,
+ MM : tzl__processRelativeTime,
+ y : tzl__processRelativeTime,
+ yy : tzl__processRelativeTime
+ },
+ ordinalParse: /\d{1,2}\./,
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ function tzl__processRelativeTime(number, withoutSuffix, key, isFuture) {
+ var format = {
+ 's': ['viensas secunds', '\'iensas secunds'],
+ 'm': ['\'n míut', '\'iens míut'],
+ 'mm': [number + ' míuts', ' ' + number + ' míuts'],
+ 'h': ['\'n þora', '\'iensa þora'],
+ 'hh': [number + ' þoras', ' ' + number + ' þoras'],
+ 'd': ['\'n ziua', '\'iensa ziua'],
+ 'dd': [number + ' ziuas', ' ' + number + ' ziuas'],
+ 'M': ['\'n mes', '\'iens mes'],
+ 'MM': [number + ' mesen', ' ' + number + ' mesen'],
+ 'y': ['\'n ar', '\'iens ar'],
+ 'yy': [number + ' ars', ' ' + number + ' ars']
+ };
+ return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1].trim());
+ }
+
+ //! moment.js locale configuration
+ //! locale : Morocco Central Atlas Tamaziɣt in Latin (tzm-latn)
+ //! author : Abdel Said : https://github.com/abdelsaid
+
+ var tzm_latn = _moment__default.defineLocale('tzm-latn', {
+ months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
+ monthsShort : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
+ weekdays : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
+ weekdaysShort : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
+ weekdaysMin : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd D MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay: '[asdkh g] LT',
+ nextDay: '[aska g] LT',
+ nextWeek: 'dddd [g] LT',
+ lastDay: '[assant g] LT',
+ lastWeek: 'dddd [g] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'dadkh s yan %s',
+ past : 'yan %s',
+ s : 'imik',
+ m : 'minuḍ',
+ mm : '%d minuḍ',
+ h : 'saɛa',
+ hh : '%d tassaɛin',
+ d : 'ass',
+ dd : '%d ossan',
+ M : 'ayowr',
+ MM : '%d iyyirn',
+ y : 'asgas',
+ yy : '%d isgasn'
+ },
+ week : {
+ dow : 6, // Saturday is the first day of the week.
+ doy : 12 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : Morocco Central Atlas Tamaziɣt (tzm)
+ //! author : Abdel Said : https://github.com/abdelsaid
+
+ var tzm = _moment__default.defineLocale('tzm', {
+ months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
+ monthsShort : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
+ weekdays : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
+ weekdaysShort : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
+ weekdaysMin : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'dddd D MMMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',
+ nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',
+ nextWeek: 'dddd [ⴴ] LT',
+ lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',
+ lastWeek: 'dddd [ⴴ] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',
+ past : 'ⵢⴰⵏ %s',
+ s : 'ⵉⵎⵉⴽ',
+ m : 'ⵎⵉⵏⵓⴺ',
+ mm : '%d ⵎⵉⵏⵓⴺ',
+ h : 'ⵙⴰⵄⴰ',
+ hh : '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',
+ d : 'ⴰⵙⵙ',
+ dd : '%d oⵙⵙⴰⵏ',
+ M : 'ⴰⵢoⵓⵔ',
+ MM : '%d ⵉⵢⵢⵉⵔⵏ',
+ y : 'ⴰⵙⴳⴰⵙ',
+ yy : '%d ⵉⵙⴳⴰⵙⵏ'
+ },
+ week : {
+ dow : 6, // Saturday is the first day of the week.
+ doy : 12 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : ukrainian (uk)
+ //! author : zemlanin : https://github.com/zemlanin
+ //! Author : Menelion Elensúle : https://github.com/Oire
+
+ function uk__plural(word, num) {
+ var forms = word.split('_');
+ return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
+ }
+ function uk__relativeTimeWithPlural(number, withoutSuffix, key) {
+ var format = {
+ 'mm': 'хвилина_хвилини_хвилин',
+ 'hh': 'година_години_годин',
+ 'dd': 'день_дні_днів',
+ 'MM': 'місяць_місяці_місяців',
+ 'yy': 'рік_роки_років'
+ };
+ if (key === 'm') {
+ return withoutSuffix ? 'хвилина' : 'хвилину';
+ }
+ else if (key === 'h') {
+ return withoutSuffix ? 'година' : 'годину';
+ }
+ else {
+ return number + ' ' + uk__plural(format[key], +number);
+ }
+ }
+ function uk__monthsCaseReplace(m, format) {
+ var months = {
+ 'nominative': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_'),
+ 'accusative': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_')
+ },
+ nounCase = (/D[oD]? *MMMM?/).test(format) ?
+ 'accusative' :
+ 'nominative';
+ return months[nounCase][m.month()];
+ }
+ function uk__weekdaysCaseReplace(m, format) {
+ var weekdays = {
+ 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),
+ 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),
+ 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')
+ },
+ nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ?
+ 'accusative' :
+ ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ?
+ 'genitive' :
+ 'nominative');
+ return weekdays[nounCase][m.day()];
+ }
+ function processHoursFunction(str) {
+ return function () {
+ return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
+ };
+ }
+
+ var uk = _moment__default.defineLocale('uk', {
+ months : uk__monthsCaseReplace,
+ monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),
+ weekdays : uk__weekdaysCaseReplace,
+ weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
+ weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD.MM.YYYY',
+ LL : 'D MMMM YYYY р.',
+ LLL : 'D MMMM YYYY р., HH:mm',
+ LLLL : 'dddd, D MMMM YYYY р., HH:mm'
+ },
+ calendar : {
+ sameDay: processHoursFunction('[Сьогодні '),
+ nextDay: processHoursFunction('[Завтра '),
+ lastDay: processHoursFunction('[Вчора '),
+ nextWeek: processHoursFunction('[У] dddd ['),
+ lastWeek: function () {
+ switch (this.day()) {
+ case 0:
+ case 3:
+ case 5:
+ case 6:
+ return processHoursFunction('[Минулої] dddd [').call(this);
+ case 1:
+ case 2:
+ case 4:
+ return processHoursFunction('[Минулого] dddd [').call(this);
+ }
+ },
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : 'за %s',
+ past : '%s тому',
+ s : 'декілька секунд',
+ m : uk__relativeTimeWithPlural,
+ mm : uk__relativeTimeWithPlural,
+ h : 'годину',
+ hh : uk__relativeTimeWithPlural,
+ d : 'день',
+ dd : uk__relativeTimeWithPlural,
+ M : 'місяць',
+ MM : uk__relativeTimeWithPlural,
+ y : 'рік',
+ yy : uk__relativeTimeWithPlural
+ },
+ // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
+ meridiemParse: /ночі|ранку|дня|вечора/,
+ isPM: function (input) {
+ return /^(дня|вечора)$/.test(input);
+ },
+ meridiem : function (hour, minute, isLower) {
+ if (hour < 4) {
+ return 'ночі';
+ } else if (hour < 12) {
+ return 'ранку';
+ } else if (hour < 17) {
+ return 'дня';
+ } else {
+ return 'вечора';
+ }
+ },
+ ordinalParse: /\d{1,2}-(й|го)/,
+ ordinal: function (number, period) {
+ switch (period) {
+ case 'M':
+ case 'd':
+ case 'DDD':
+ case 'w':
+ case 'W':
+ return number + '-й';
+ case 'D':
+ return number + '-го';
+ default:
+ return number;
+ }
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : uzbek (uz)
+ //! author : Sardor Muminov : https://github.com/muminoff
+
+ var uz = _moment__default.defineLocale('uz', {
+ months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
+ monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
+ weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),
+ weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),
+ weekdaysMin : 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM YYYY',
+ LLL : 'D MMMM YYYY HH:mm',
+ LLLL : 'D MMMM YYYY, dddd HH:mm'
+ },
+ calendar : {
+ sameDay : '[Бугун соат] LT [да]',
+ nextDay : '[Эртага] LT [да]',
+ nextWeek : 'dddd [куни соат] LT [да]',
+ lastDay : '[Кеча соат] LT [да]',
+ lastWeek : '[Утган] dddd [куни соат] LT [да]',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : 'Якин %s ичида',
+ past : 'Бир неча %s олдин',
+ s : 'фурсат',
+ m : 'бир дакика',
+ mm : '%d дакика',
+ h : 'бир соат',
+ hh : '%d соат',
+ d : 'бир кун',
+ dd : '%d кун',
+ M : 'бир ой',
+ MM : '%d ой',
+ y : 'бир йил',
+ yy : '%d йил'
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : vietnamese (vi)
+ //! author : Bang Nguyen : https://github.com/bangnk
+
+ var vi = _moment__default.defineLocale('vi', {
+ months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'),
+ monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),
+ weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'),
+ weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
+ weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
+ longDateFormat : {
+ LT : 'HH:mm',
+ LTS : 'HH:mm:ss',
+ L : 'DD/MM/YYYY',
+ LL : 'D MMMM [năm] YYYY',
+ LLL : 'D MMMM [năm] YYYY HH:mm',
+ LLLL : 'dddd, D MMMM [năm] YYYY HH:mm',
+ l : 'DD/M/YYYY',
+ ll : 'D MMM YYYY',
+ lll : 'D MMM YYYY HH:mm',
+ llll : 'ddd, D MMM YYYY HH:mm'
+ },
+ calendar : {
+ sameDay: '[Hôm nay lúc] LT',
+ nextDay: '[Ngày mai lúc] LT',
+ nextWeek: 'dddd [tuần tới lúc] LT',
+ lastDay: '[Hôm qua lúc] LT',
+ lastWeek: 'dddd [tuần rồi lúc] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : '%s tới',
+ past : '%s trước',
+ s : 'vài giây',
+ m : 'một phút',
+ mm : '%d phút',
+ h : 'một giờ',
+ hh : '%d giờ',
+ d : 'một ngày',
+ dd : '%d ngày',
+ M : 'một tháng',
+ MM : '%d tháng',
+ y : 'một năm',
+ yy : '%d năm'
+ },
+ ordinalParse: /\d{1,2}/,
+ ordinal : function (number) {
+ return number;
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : chinese (zh-cn)
+ //! author : suupic : https://github.com/suupic
+ //! author : Zeno Zeng : https://github.com/zenozeng
+
+ var zh_cn = _moment__default.defineLocale('zh-cn', {
+ months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
+ monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
+ weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
+ weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'),
+ weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
+ longDateFormat : {
+ LT : 'Ah点mm分',
+ LTS : 'Ah点m分s秒',
+ L : 'YYYY-MM-DD',
+ LL : 'YYYY年MMMD日',
+ LLL : 'YYYY年MMMD日Ah点mm分',
+ LLLL : 'YYYY年MMMD日ddddAh点mm分',
+ l : 'YYYY-MM-DD',
+ ll : 'YYYY年MMMD日',
+ lll : 'YYYY年MMMD日Ah点mm分',
+ llll : 'YYYY年MMMD日ddddAh点mm分'
+ },
+ meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
+ meridiemHour: function (hour, meridiem) {
+ if (hour === 12) {
+ hour = 0;
+ }
+ if (meridiem === '凌晨' || meridiem === '早上' ||
+ meridiem === '上午') {
+ return hour;
+ } else if (meridiem === '下午' || meridiem === '晚上') {
+ return hour + 12;
+ } else {
+ // '中午'
+ return hour >= 11 ? hour : hour + 12;
+ }
+ },
+ meridiem : function (hour, minute, isLower) {
+ var hm = hour * 100 + minute;
+ if (hm < 600) {
+ return '凌晨';
+ } else if (hm < 900) {
+ return '早上';
+ } else if (hm < 1130) {
+ return '上午';
+ } else if (hm < 1230) {
+ return '中午';
+ } else if (hm < 1800) {
+ return '下午';
+ } else {
+ return '晚上';
+ }
+ },
+ calendar : {
+ sameDay : function () {
+ return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT';
+ },
+ nextDay : function () {
+ return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT';
+ },
+ lastDay : function () {
+ return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT';
+ },
+ nextWeek : function () {
+ var startOfWeek, prefix;
+ startOfWeek = _moment__default().startOf('week');
+ prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]';
+ return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';
+ },
+ lastWeek : function () {
+ var startOfWeek, prefix;
+ startOfWeek = _moment__default().startOf('week');
+ prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]';
+ return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';
+ },
+ sameElse : 'LL'
+ },
+ ordinalParse: /\d{1,2}(日|月|周)/,
+ ordinal : function (number, period) {
+ switch (period) {
+ case 'd':
+ case 'D':
+ case 'DDD':
+ return number + '日';
+ case 'M':
+ return number + '月';
+ case 'w':
+ case 'W':
+ return number + '周';
+ default:
+ return number;
+ }
+ },
+ relativeTime : {
+ future : '%s内',
+ past : '%s前',
+ s : '几秒',
+ m : '1 分钟',
+ mm : '%d 分钟',
+ h : '1 小时',
+ hh : '%d 小时',
+ d : '1 天',
+ dd : '%d 天',
+ M : '1 个月',
+ MM : '%d 个月',
+ y : '1 年',
+ yy : '%d 年'
+ },
+ week : {
+ // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+ });
+
+ //! moment.js locale configuration
+ //! locale : traditional chinese (zh-tw)
+ //! author : Ben : https://github.com/ben-lin
+
+ var zh_tw = _moment__default.defineLocale('zh-tw', {
+ months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
+ monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
+ weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
+ weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),
+ weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
+ longDateFormat : {
+ LT : 'Ah點mm分',
+ LTS : 'Ah點m分s秒',
+ L : 'YYYY年MMMD日',
+ LL : 'YYYY年MMMD日',
+ LLL : 'YYYY年MMMD日Ah點mm分',
+ LLLL : 'YYYY年MMMD日ddddAh點mm分',
+ l : 'YYYY年MMMD日',
+ ll : 'YYYY年MMMD日',
+ lll : 'YYYY年MMMD日Ah點mm分',
+ llll : 'YYYY年MMMD日ddddAh點mm分'
+ },
+ meridiemParse: /早上|上午|中午|下午|晚上/,
+ meridiemHour : function (hour, meridiem) {
+ if (hour === 12) {
+ hour = 0;
+ }
+ if (meridiem === '早上' || meridiem === '上午') {
+ return hour;
+ } else if (meridiem === '中午') {
+ return hour >= 11 ? hour : hour + 12;
+ } else if (meridiem === '下午' || meridiem === '晚上') {
+ return hour + 12;
+ }
+ },
+ meridiem : function (hour, minute, isLower) {
+ var hm = hour * 100 + minute;
+ if (hm < 900) {
+ return '早上';
+ } else if (hm < 1130) {
+ return '上午';
+ } else if (hm < 1230) {
+ return '中午';
+ } else if (hm < 1800) {
+ return '下午';
+ } else {
+ return '晚上';
+ }
+ },
+ calendar : {
+ sameDay : '[今天]LT',
+ nextDay : '[明天]LT',
+ nextWeek : '[下]ddddLT',
+ lastDay : '[昨天]LT',
+ lastWeek : '[上]ddddLT',
+ sameElse : 'L'
+ },
+ ordinalParse: /\d{1,2}(日|月|週)/,
+ ordinal : function (number, period) {
+ switch (period) {
+ case 'd' :
+ case 'D' :
+ case 'DDD' :
+ return number + '日';
+ case 'M' :
+ return number + '月';
+ case 'w' :
+ case 'W' :
+ return number + '週';
+ default :
+ return number;
+ }
+ },
+ relativeTime : {
+ future : '%s內',
+ past : '%s前',
+ s : '幾秒',
+ m : '一分鐘',
+ mm : '%d分鐘',
+ h : '一小時',
+ hh : '%d小時',
+ d : '一天',
+ dd : '%d天',
+ M : '一個月',
+ MM : '%d個月',
+ y : '一年',
+ yy : '%d年'
+ }
+ });
+
+ var moment_with_locales = _moment__default;
+ moment_with_locales.locale('en');
+
+ return moment_with_locales;
+
+}));
\ No newline at end of file
diff --git a/resources/momentjs/moment-with-locales.min.js b/resources/momentjs/moment-with-locales.min.js
new file mode 100644
index 00000000..90eb91b3
--- /dev/null
+++ b/resources/momentjs/moment-with-locales.min.js
@@ -0,0 +1,80 @@
+!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Md.apply(null,arguments)}function b(a){Md=a}function c(a){return"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c0)for(c in Od)d=Od[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function n(b){m(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),Pd===!1&&(Pd=!0,a.updateOffset(this),Pd=!1)}function o(a){return a instanceof n||null!=a&&null!=a._isAMomentObject}function p(a){return 0>a?Math.ceil(a):Math.floor(a)}function q(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=p(b)),c}function r(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&q(a[d])!==q(b[d]))&&g++;return g+f}function s(){}function t(a){return a?a.toLowerCase().replace("_","-"):a}function u(a){for(var b,c,d,e,f=0;f0;){if(d=v(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&r(e,c,!0)>=b-1)break;b--}f++}return null}function v(a){var b=null;if(!Qd[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Nd._abbr,require("./locale/"+a),w(b)}catch(c){}return Qd[a]}function w(a,b){var c;return a&&(c="undefined"==typeof b?y(a):x(a,b),c&&(Nd=c)),Nd._abbr}function x(a,b){return null!==b?(b.abbr=a,Qd[a]=Qd[a]||new s,Qd[a].set(b),w(a),Qd[a]):(delete Qd[a],null)}function y(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Nd;if(!c(a)){if(b=v(a))return b;a=[a]}return u(a)}function z(a,b){var c=a.toLowerCase();Rd[c]=Rd[c+"s"]=Rd[b]=a}function A(a){return"string"==typeof a?Rd[a]||Rd[a.toLowerCase()]:void 0}function B(a){var b,c,d={};for(c in a)f(a,c)&&(b=A(c),b&&(d[b]=a[c]));return d}function C(b,c){return function(d){return null!=d?(E(this,b,d),a.updateOffset(this,c),this):D(this,b)}}function D(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function E(a,b,c){return a._d["set"+(a._isUTC?"UTC":"")+b](c)}function F(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=A(a),"function"==typeof this[a])return this[a](b);return this}function G(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function H(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(Vd[a]=e),b&&(Vd[b[0]]=function(){return G(e.apply(this,arguments),b[1],b[2])}),c&&(Vd[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function I(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function J(a){var b,c,d=a.match(Sd);for(b=0,c=d.length;c>b;b++)Vd[d[b]]?d[b]=Vd[d[b]]:d[b]=I(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function K(a,b){return a.isValid()?(b=L(b,a.localeData()),Ud[b]=Ud[b]||J(b),Ud[b](a)):a.localeData().invalidDate()}function L(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Td.lastIndex=0;d>=0&&Td.test(a);)a=a.replace(Td,c),Td.lastIndex=0,d-=1;return a}function M(a){return"function"==typeof a&&"[object Function]"===Object.prototype.toString.call(a)}function N(a,b,c){ie[a]=M(b)?b:function(a){return a&&c?c:b}}function O(a,b){return f(ie,a)?ie[a](b._strict,b._locale):new RegExp(P(a))}function P(a){return a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Q(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=q(a)}),c=0;cd;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function X(a,b){var c;return"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),T(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function Y(b){return null!=b?(X(this,b),a.updateOffset(this,!0),this):D(this,"Month")}function Z(){return T(this.year(),this.month())}function $(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[le]<0||c[le]>11?le:c[me]<1||c[me]>T(c[ke],c[le])?me:c[ne]<0||c[ne]>24||24===c[ne]&&(0!==c[oe]||0!==c[pe]||0!==c[qe])?ne:c[oe]<0||c[oe]>59?oe:c[pe]<0||c[pe]>59?pe:c[qe]<0||c[qe]>999?qe:-1,j(a)._overflowDayOfYear&&(ke>b||b>me)&&(b=me),j(a).overflow=b),a}function _(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function aa(a,b){var c=!0;return g(function(){return c&&(_(a+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function ba(a,b){te[a]||(_(b),te[a]=!0)}function ca(a){var b,c,d=a._i,e=ue.exec(d);if(e){for(j(a).iso=!0,b=0,c=ve.length;c>b;b++)if(ve[b][1].exec(d)){a._f=ve[b][0];break}for(b=0,c=we.length;c>b;b++)if(we[b][1].exec(d)){a._f+=(e[6]||" ")+we[b][0];break}d.match(fe)&&(a._f+="Z"),va(a)}else a._isValid=!1}function da(b){var c=xe.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ca(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function ea(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function fa(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function ga(a){return ha(a)?366:365}function ha(a){return a%4===0&&a%100!==0||a%400===0}function ia(){return ha(this.year())}function ja(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=Da(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function ka(a){return ja(a,this._week.dow,this._week.doy).week}function la(){return this._week.dow}function ma(){return this._week.doy}function na(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function oa(a){var b=ja(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function pa(a,b,c,d,e){var f,g=6+e-d,h=fa(a,0,1+g),i=h.getUTCDay();return e>i&&(i+=7),c=null!=c?1*c:e,f=1+g+7*(b-1)-i+c,{year:f>0?a:a-1,dayOfYear:f>0?f:ga(a-1)+f}}function qa(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function ra(a,b,c){return null!=a?a:null!=b?b:c}function sa(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function ta(a){var b,c,d,e,f=[];if(!a._d){for(d=sa(a),a._w&&null==a._a[me]&&null==a._a[le]&&ua(a),a._dayOfYear&&(e=ra(a._a[ke],d[ke]),a._dayOfYear>ga(e)&&(j(a)._overflowDayOfYear=!0),c=fa(e,0,a._dayOfYear),a._a[le]=c.getUTCMonth(),a._a[me]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[ne]&&0===a._a[oe]&&0===a._a[pe]&&0===a._a[qe]&&(a._nextDay=!0,a._a[ne]=0),a._d=(a._useUTC?fa:ea).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[ne]=24)}}function ua(a){var b,c,d,e,f,g,h;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=ra(b.GG,a._a[ke],ja(Da(),1,4).year),d=ra(b.W,1),e=ra(b.E,1)):(f=a._locale._week.dow,g=a._locale._week.doy,c=ra(b.gg,a._a[ke],ja(Da(),f,g).year),d=ra(b.w,1),null!=b.d?(e=b.d,f>e&&++d):e=null!=b.e?b.e+f:f),h=pa(c,d,e,g,f),a._a[ke]=h.year,a._dayOfYear=h.dayOfYear}function va(b){if(b._f===a.ISO_8601)return void ca(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=L(b._f,b._locale).match(Sd)||[],c=0;c0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),Vd[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),S(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[ne]<=12&&b._a[ne]>0&&(j(b).bigHour=void 0),b._a[ne]=wa(b._locale,b._a[ne],b._meridiem),ta(b),$(b)}function wa(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function xa(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;ef)&&(d=f,c=b));g(a,c||b)}function ya(a){if(!a._d){var b=B(a._i);a._a=[b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],ta(a)}}function za(a){var b=new n($(Aa(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Aa(a){var b=a._i,e=a._f;return a._locale=a._locale||y(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),o(b)?new n($(b)):(c(e)?xa(a):e?va(a):d(b)?a._d=b:Ba(a),a))}function Ba(b){var f=b._i;void 0===f?b._d=new Date:d(f)?b._d=new Date(+f):"string"==typeof f?da(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ta(b)):"object"==typeof f?ya(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Ca(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,za(f)}function Da(a,b,c,d){return Ca(a,b,c,d,!1)}function Ea(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Da();for(d=b[0],e=1;ea&&(a=-a,c="-"),c+G(~~(a/60),2)+b+G(~~a%60,2)})}function Ka(a){var b=(a||"").match(fe)||[],c=b[b.length-1]||[],d=(c+"").match(Ce)||["-",0,0],e=+(60*d[1])+q(d[2]);return"+"===d[0]?e:-e}function La(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(o(b)||d(b)?+b:+Da(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Da(b).local()}function Ma(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Na(b,c){var d,e=this._offset||0;return null!=b?("string"==typeof b&&(b=Ka(b)),Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Ma(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?bb(this,Ya(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Ma(this)}function Oa(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Pa(a){return this.utcOffset(0,a)}function Qa(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Ma(this),"m")),this}function Ra(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ka(this._i)),this}function Sa(a){return a=a?Da(a).utcOffset():0,(this.utcOffset()-a)%60===0}function Ta(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ua(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var a={};if(m(a,this),a=Aa(a),a._a){var b=a._isUTC?h(a._a):Da(a._a);this._isDSTShifted=this.isValid()&&r(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Va(){return!this._isUTC}function Wa(){return this._isUTC}function Xa(){return this._isUTC&&0===this._offset}function Ya(a,b){var c,d,e,g=a,h=null;return Ia(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=De.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:q(h[me])*c,h:q(h[ne])*c,m:q(h[oe])*c,s:q(h[pe])*c,ms:q(h[qe])*c}):(h=Ee.exec(a))?(c="-"===h[1]?-1:1,g={y:Za(h[2],c),M:Za(h[3],c),d:Za(h[4],c),h:Za(h[5],c),m:Za(h[6],c),s:Za(h[7],c),w:Za(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=_a(Da(g.from),Da(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ha(g),Ia(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function Za(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function $a(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function _a(a,b){var c;return b=La(b,a),a.isBefore(b)?c=$a(a,b):(c=$a(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c}function ab(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(ba(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Ya(c,d),bb(this,e,a),this}}function bb(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&E(b,"Date",D(b,"Date")+g*d),h&&X(b,D(b,"Month")+h*d),e&&a.updateOffset(b,g||h)}function cb(a,b){var c=a||Da(),d=La(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse";return this.format(b&&b[f]||this.localeData().calendar(f,this,Da(c)))}function db(){return new n(this)}function eb(a,b){var c;return b=A("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+this>+a):(c=o(a)?+a:+Da(a),c<+this.clone().startOf(b))}function fb(a,b){var c;return b=A("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+a>+this):(c=o(a)?+a:+Da(a),+this.clone().endOf(b)b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function kb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function lb(){var a=this.clone().utc();return 0b;b++)if(this._weekdaysParse[b]||(c=Da([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b}function Pb(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Kb(a,this.localeData()),this.add(a-b,"d")):b}function Qb(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function Rb(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)}function Sb(a,b){H(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function Tb(a,b){return b._meridiemParse}function Ub(a){return"p"===(a+"").toLowerCase().charAt(0)}function Vb(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function Wb(a,b){b[qe]=q(1e3*("0."+a))}function Xb(){return this._isUTC?"UTC":""}function Yb(){return this._isUTC?"Coordinated Universal Time":""}function Zb(a){return Da(1e3*a)}function $b(){return Da.apply(null,arguments).parseZone()}function _b(a,b,c){var d=this._calendar[a];return"function"==typeof d?d.call(b,c):d}function ac(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function bc(){return this._invalidDate}function cc(a){return this._ordinal.replace("%d",a)}function dc(a){return a}function ec(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)}function fc(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)}function gc(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function hc(a,b,c,d){var e=y(),f=h().set(d,b);return e[c](f,a)}function ic(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return hc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=hc(a,f,c,e);return g}function jc(a,b){return ic(a,b,"months",12,"month")}function kc(a,b){return ic(a,b,"monthsShort",12,"month")}function lc(a,b){return ic(a,b,"weekdays",7,"day")}function mc(a,b){return ic(a,b,"weekdaysShort",7,"day")}function nc(a,b){return ic(a,b,"weekdaysMin",7,"day")}function oc(){var a=this._data;return this._milliseconds=_e(this._milliseconds),this._days=_e(this._days),this._months=_e(this._months),a.milliseconds=_e(a.milliseconds),a.seconds=_e(a.seconds),a.minutes=_e(a.minutes),a.hours=_e(a.hours),a.months=_e(a.months),a.years=_e(a.years),this}function pc(a,b,c,d){var e=Ya(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function qc(a,b){return pc(this,a,b,1)}function rc(a,b){return pc(this,a,b,-1)}function sc(a){return 0>a?Math.floor(a):Math.ceil(a)}function tc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*sc(vc(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=p(f/1e3),i.seconds=a%60,b=p(a/60),i.minutes=b%60,c=p(b/60),i.hours=c%24,g+=p(c/24),e=p(uc(g)),h+=e,g-=sc(vc(e)),d=p(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function uc(a){return 4800*a/146097}function vc(a){return 146097*a/4800}function wc(a){var b,c,d=this._milliseconds;if(a=A(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+uc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(vc(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function xc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*q(this._months/12)}function yc(a){return function(){return this.as(a)}}function zc(a){return a=A(a),this[a+"s"]()}function Ac(a){return function(){return this._data[a]}}function Bc(){return p(this.days()/7)}function Cc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Dc(a,b,c){var d=Ya(a).abs(),e=qf(d.as("s")),f=qf(d.as("m")),g=qf(d.as("h")),h=qf(d.as("d")),i=qf(d.as("M")),j=qf(d.as("y")),k=e0,k[4]=c,Cc.apply(null,k)}function Ec(a,b){return void 0===rf[a]?!1:void 0===b?rf[a]:(rf[a]=b,!0)}function Fc(a){var b=this.localeData(),c=Dc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Gc(){var a,b,c,d=sf(this._milliseconds)/1e3,e=sf(this._days),f=sf(this._months);a=p(d/60),b=p(a/60),d%=60,a%=60,c=p(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}
+//! moment.js locale configuration
+//! locale : belarusian (be)
+//! author : Dmitry Demidov : https://github.com/demidov91
+//! author: Praleska: http://praleska.pro/
+//! Author : Menelion Elensúle : https://github.com/Oire
+function Hc(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function Ic(a,b,c){var d={mm:b?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:b?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"};return"m"===c?b?"хвіліна":"хвіліну":"h"===c?b?"гадзіна":"гадзіну":a+" "+Hc(d[c],+a)}function Jc(a,b){var c={nominative:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_"),accusative:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function Kc(a,b){var c={nominative:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),accusative:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_")},d=/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/.test(b)?"accusative":"nominative";return c[d][a.day()]}
+//! moment.js locale configuration
+//! locale : breton (br)
+//! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou
+function Lc(a,b,c){var d={mm:"munutenn",MM:"miz",dd:"devezh"};return a+" "+Oc(d[c],a)}function Mc(a){switch(Nc(a)){case 1:case 3:case 4:case 5:case 9:return a+" bloaz";default:return a+" vloaz"}}function Nc(a){return a>9?Nc(a%10):a}function Oc(a,b){return 2===b?Pc(a):a}function Pc(a){var b={m:"v",b:"v",d:"z"};return void 0===b[a.charAt(0)]?a:b[a.charAt(0)]+a.substring(1)}
+//! moment.js locale configuration
+//! locale : bosnian (bs)
+//! author : Nedim Cholich : https://github.com/frontyard
+//! based on (hr) translation by Bojan Marković
+function Qc(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}function Rc(a){return a>1&&5>a&&1!==~~(a/10)}function Sc(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"pár sekund":"pár sekundami";case"m":return b?"minuta":d?"minutu":"minutou";case"mm":return b||d?e+(Rc(a)?"minuty":"minut"):e+"minutami";break;case"h":return b?"hodina":d?"hodinu":"hodinou";case"hh":return b||d?e+(Rc(a)?"hodiny":"hodin"):e+"hodinami";break;case"d":return b||d?"den":"dnem";case"dd":return b||d?e+(Rc(a)?"dny":"dní"):e+"dny";break;case"M":return b||d?"měsíc":"měsícem";case"MM":return b||d?e+(Rc(a)?"měsíce":"měsíců"):e+"měsíci";break;case"y":return b||d?"rok":"rokem";case"yy":return b||d?e+(Rc(a)?"roky":"let"):e+"lety"}}
+//! moment.js locale configuration
+//! locale : austrian german (de-at)
+//! author : lluchs : https://github.com/lluchs
+//! author: Menelion Elensúle: https://github.com/Oire
+//! author : Martin Groller : https://github.com/MadMG
+function Tc(a,b,c,d){var e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?e[c][0]:e[c][1]}
+//! moment.js locale configuration
+//! locale : german (de)
+//! author : lluchs : https://github.com/lluchs
+//! author: Menelion Elensúle: https://github.com/Oire
+function Uc(a,b,c,d){var e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?e[c][0]:e[c][1]}
+//! moment.js locale configuration
+//! locale : estonian (et)
+//! author : Henry Kehlmann : https://github.com/madhenry
+//! improvements : Illimar Tambek : https://github.com/ragulka
+function Vc(a,b,c,d){var e={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:[a+" minuti",a+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[a+" tunni",a+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[a+" kuu",a+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[a+" aasta",a+" aastat"]};return b?e[c][2]?e[c][2]:e[c][1]:d?e[c][0]:e[c][1]}function Wc(a,b,c,d){var e="";switch(c){case"s":return d?"muutaman sekunnin":"muutama sekunti";case"m":return d?"minuutin":"minuutti";case"mm":e=d?"minuutin":"minuuttia";break;case"h":return d?"tunnin":"tunti";case"hh":e=d?"tunnin":"tuntia";break;case"d":return d?"päivän":"päivä";case"dd":e=d?"päivän":"päivää";break;case"M":return d?"kuukauden":"kuukausi";case"MM":e=d?"kuukauden":"kuukautta";break;case"y":return d?"vuoden":"vuosi";case"yy":e=d?"vuoden":"vuotta"}return e=Xc(a,d)+" "+e}function Xc(a,b){return 10>a?b?Pf[a]:Of[a]:a}
+//! moment.js locale configuration
+//! locale : hrvatski (hr)
+//! author : Bojan Marković : https://github.com/bmarkovic
+function Yc(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}function Zc(a,b,c,d){var e=a;switch(c){case"s":return d||b?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(d||b?" perc":" perce");case"mm":return e+(d||b?" perc":" perce");case"h":return"egy"+(d||b?" óra":" órája");case"hh":return e+(d||b?" óra":" órája");case"d":return"egy"+(d||b?" nap":" napja");case"dd":return e+(d||b?" nap":" napja");case"M":return"egy"+(d||b?" hónap":" hónapja");case"MM":return e+(d||b?" hónap":" hónapja");case"y":return"egy"+(d||b?" év":" éve");case"yy":return e+(d||b?" év":" éve")}return""}function $c(a){return(a?"":"[múlt] ")+"["+Uf[this.day()]+"] LT[-kor]"}
+//! moment.js locale configuration
+//! locale : Armenian (hy-am)
+//! author : Armendarabyan : https://github.com/armendarabyan
+function _c(a,b){var c={nominative:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_"),accusative:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function ad(a,b){var c="հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_");return c[a.month()]}function bd(a,b){var c="կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_");return c[a.day()]}
+//! moment.js locale configuration
+//! locale : icelandic (is)
+//! author : Hinrik Örn Sigurðsson : https://github.com/hinrik
+function cd(a){return a%100===11?!0:a%10===1?!1:!0}function dd(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return b?"mínúta":"mínútu";case"mm":return cd(a)?e+(b||d?"mínútur":"mínútum"):b?e+"mínúta":e+"mínútu";case"hh":return cd(a)?e+(b||d?"klukkustundir":"klukkustundum"):e+"klukkustund";case"d":return b?"dagur":d?"dag":"degi";case"dd":return cd(a)?b?e+"dagar":e+(d?"daga":"dögum"):b?e+"dagur":e+(d?"dag":"degi");case"M":return b?"mánuður":d?"mánuð":"mánuði";case"MM":return cd(a)?b?e+"mánuðir":e+(d?"mánuði":"mánuðum"):b?e+"mánuður":e+(d?"mánuð":"mánuði");case"y":return b||d?"ár":"ári";case"yy":return cd(a)?e+(b||d?"ár":"árum"):e+(b||d?"ár":"ári")}}
+//! moment.js locale configuration
+//! locale : Georgian (ka)
+//! author : Irakli Janiashvili : https://github.com/irakli-janiashvili
+function ed(a,b){var c={nominative:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),accusative:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},d=/D[oD] *MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function fd(a,b){var c={nominative:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),accusative:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_")},d=/(წინა|შემდეგ)/.test(b)?"accusative":"nominative";return c[d][a.day()]}
+//! moment.js locale configuration
+//! locale : Luxembourgish (lb)
+//! author : mweimerskirch : https://github.com/mweimerskirch, David Raison : https://github.com/kwisatz
+function gd(a,b,c,d){var e={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return b?e[c][0]:e[c][1]}function hd(a){var b=a.substr(0,a.indexOf(" "));return jd(b)?"a "+a:"an "+a}function id(a){var b=a.substr(0,a.indexOf(" "));return jd(b)?"viru "+a:"virun "+a}function jd(a){if(a=parseInt(a,10),isNaN(a))return!1;if(0>a)return!0;if(10>a)return a>=4&&7>=a?!0:!1;if(100>a){var b=a%10,c=a/10;return jd(0===b?c:b)}if(1e4>a){for(;a>=10;)a/=10;return jd(a)}return a/=1e3,jd(a)}function kd(a,b,c,d){return b?"kelios sekundės":d?"kelių sekundžių":"kelias sekundes"}function ld(a,b){var c={nominative:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),accusative:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function md(a,b,c,d){return b?od(c)[0]:d?od(c)[1]:od(c)[2]}function nd(a){return a%10===0||a>10&&20>a}function od(a){return Vf[a].split("_")}function pd(a,b,c,d){var e=a+" ";return 1===a?e+md(a,b,c[0],d):b?e+(nd(a)?od(c)[1]:od(c)[0]):d?e+od(c)[1]:e+(nd(a)?od(c)[1]:od(c)[2])}function qd(a,b){var c=-1===b.indexOf("dddd HH:mm"),d=Wf[a.day()];return c?d:d.substring(0,d.length-2)+"į"}function rd(a,b,c){return c?b%10===1&&11!==b?a[2]:a[3]:b%10===1&&11!==b?a[0]:a[1]}function sd(a,b,c){return a+" "+rd(Xf[c],a,b)}function td(a,b,c){return rd(Xf[c],a,b)}function ud(a,b){return b?"dažas sekundes":"dažām sekundēm"}function vd(a){return 5>a%10&&a%10>1&&~~(a/10)%10!==1}function wd(a,b,c){var d=a+" ";switch(c){case"m":return b?"minuta":"minutę";case"mm":return d+(vd(a)?"minuty":"minut");case"h":return b?"godzina":"godzinę";case"hh":return d+(vd(a)?"godziny":"godzin");case"MM":return d+(vd(a)?"miesiące":"miesięcy");case"yy":return d+(vd(a)?"lata":"lat")}}
+//! moment.js locale configuration
+//! locale : romanian (ro)
+//! author : Vlad Gurdiga : https://github.com/gurdiga
+//! author : Valentin Agachi : https://github.com/avaly
+function xd(a,b,c){var d={mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"},e=" ";return(a%100>=20||a>=100&&a%100===0)&&(e=" de "),a+e+d[c]}
+//! moment.js locale configuration
+//! locale : russian (ru)
+//! author : Viktorminator : https://github.com/Viktorminator
+//! Author : Menelion Elensúle : https://github.com/Oire
+function yd(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function zd(a,b,c){var d={mm:b?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===c?b?"минута":"минуту":a+" "+yd(d[c],+a)}function Ad(a,b){var c={nominative:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),accusative:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function Bd(a,b){var c={nominative:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),accusative:"янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек".split("_")},d=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function Cd(a,b){var c={nominative:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),accusative:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_")},d=/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/.test(b)?"accusative":"nominative";return c[d][a.day()]}function Dd(a){return a>1&&5>a}function Ed(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"pár sekúnd":"pár sekundami";case"m":return b?"minúta":d?"minútu":"minútou";case"mm":return b||d?e+(Dd(a)?"minúty":"minút"):e+"minútami";break;case"h":return b?"hodina":d?"hodinu":"hodinou";case"hh":return b||d?e+(Dd(a)?"hodiny":"hodín"):e+"hodinami";break;case"d":return b||d?"deň":"dňom";case"dd":return b||d?e+(Dd(a)?"dni":"dní"):e+"dňami";break;case"M":return b||d?"mesiac":"mesiacom";case"MM":return b||d?e+(Dd(a)?"mesiace":"mesiacov"):e+"mesiacmi";break;case"y":return b||d?"rok":"rokom";case"yy":return b||d?e+(Dd(a)?"roky":"rokov"):e+"rokmi"}}
+//! moment.js locale configuration
+//! locale : slovenian (sl)
+//! author : Robert Sedovšek : https://github.com/sedovsek
+function Fd(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"nekaj sekund":"nekaj sekundami";case"m":return b?"ena minuta":"eno minuto";case"mm":return e+=1===a?b?"minuta":"minuto":2===a?b||d?"minuti":"minutama":5>a?b||d?"minute":"minutami":b||d?"minut":"minutami";case"h":return b?"ena ura":"eno uro";case"hh":return e+=1===a?b?"ura":"uro":2===a?b||d?"uri":"urama":5>a?b||d?"ure":"urami":b||d?"ur":"urami";case"d":return b||d?"en dan":"enim dnem";case"dd":return e+=1===a?b||d?"dan":"dnem":2===a?b||d?"dni":"dnevoma":b||d?"dni":"dnevi";case"M":return b||d?"en mesec":"enim mesecem";case"MM":return e+=1===a?b||d?"mesec":"mesecem":2===a?b||d?"meseca":"mesecema":5>a?b||d?"mesece":"meseci":b||d?"mesecev":"meseci";case"y":return b||d?"eno leto":"enim letom";case"yy":return e+=1===a?b||d?"leto":"letom":2===a?b||d?"leti":"letoma":5>a?b||d?"leta":"leti":b||d?"let":"leti"}}function Gd(a,b,c,d){var e={s:["viensas secunds","'iensas secunds"],m:["'n míut","'iens míut"],mm:[a+" míuts"," "+a+" míuts"],h:["'n þora","'iensa þora"],hh:[a+" þoras"," "+a+" þoras"],d:["'n ziua","'iensa ziua"],dd:[a+" ziuas"," "+a+" ziuas"],M:["'n mes","'iens mes"],MM:[a+" mesen"," "+a+" mesen"],y:["'n ar","'iens ar"],yy:[a+" ars"," "+a+" ars"]};return d?e[c][0]:b?e[c][0]:e[c][1].trim()}
+//! moment.js locale configuration
+//! locale : ukrainian (uk)
+//! author : zemlanin : https://github.com/zemlanin
+//! Author : Menelion Elensúle : https://github.com/Oire
+function Hd(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function Id(a,b,c){var d={mm:"хвилина_хвилини_хвилин",hh:"година_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===c?b?"хвилина":"хвилину":"h"===c?b?"година":"годину":a+" "+Hd(d[c],+a)}function Jd(a,b){var c={nominative:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_"),accusative:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_")},d=/D[oD]? *MMMM?/.test(b)?"accusative":"nominative";return c[d][a.month()]}function Kd(a,b){var c={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")},d=/(\[[ВвУу]\]) ?dddd/.test(b)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(b)?"genitive":"nominative";return c[d][a.day()]}function Ld(a){return function(){return a+"о"+(11===this.hours()?"б":"")+"] LT"}}var Md,Nd,Od=a.momentProperties=[],Pd=!1,Qd={},Rd={},Sd=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Td=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ud={},Vd={},Wd=/\d/,Xd=/\d\d/,Yd=/\d{3}/,Zd=/\d{4}/,$d=/[+-]?\d{6}/,_d=/\d\d?/,ae=/\d{1,3}/,be=/\d{1,4}/,ce=/[+-]?\d{1,6}/,de=/\d+/,ee=/[+-]?\d+/,fe=/Z|[+-]\d\d:?\d\d/gi,ge=/[+-]?\d+(\.\d{1,3})?/,he=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,ie={},je={},ke=0,le=1,me=2,ne=3,oe=4,pe=5,qe=6;H("M",["MM",2],"Mo",function(){return this.month()+1}),H("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),H("MMMM",0,0,function(a){return this.localeData().months(this,a)}),z("month","M"),N("M",_d),N("MM",_d,Xd),N("MMM",he),N("MMMM",he),Q(["M","MM"],function(a,b){b[le]=q(a)-1}),Q(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[le]=e:j(c).invalidMonth=a});var re="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),se="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),te={};a.suppressDeprecationWarnings=!1;var ue=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ve=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],we=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],xe=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=aa("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),H(0,["YY",2],0,function(){return this.year()%100}),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),z("year","y"),N("Y",ee),N("YY",_d,Xd),N("YYYY",be,Zd),N("YYYYY",ce,$d),N("YYYYYY",ce,$d),Q(["YYYYY","YYYYYY"],ke),Q("YYYY",function(b,c){c[ke]=2===b.length?a.parseTwoDigitYear(b):q(b)}),Q("YY",function(b,c){c[ke]=a.parseTwoDigitYear(b)}),a.parseTwoDigitYear=function(a){return q(a)+(q(a)>68?1900:2e3)};var ye=C("FullYear",!1);H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),z("week","w"),z("isoWeek","W"),N("w",_d),N("ww",_d,Xd),N("W",_d),N("WW",_d,Xd),R(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=q(a)});var ze={dow:0,doy:6};H("DDD",["DDDD",3],"DDDo","dayOfYear"),z("dayOfYear","DDD"),N("DDD",ae),N("DDDD",Yd),Q(["DDD","DDDD"],function(a,b,c){c._dayOfYear=q(a)}),a.ISO_8601=function(){};var Ae=aa("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Da.apply(null,arguments);return this>a?this:a}),Be=aa("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Da.apply(null,arguments);return a>this?this:a});Ja("Z",":"),Ja("ZZ",""),N("Z",fe),N("ZZ",fe),Q(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ka(a)});var Ce=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var De=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Ee=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Ya.fn=Ha.prototype;var Fe=ab(1,"add"),Ge=ab(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var He=aa("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Db("gggg","weekYear"),Db("ggggg","weekYear"),Db("GGGG","isoWeekYear"),Db("GGGGG","isoWeekYear"),z("weekYear","gg"),z("isoWeekYear","GG"),N("G",ee),N("g",ee),N("GG",_d,Xd),N("gg",_d,Xd),N("GGGG",be,Zd),N("gggg",be,Zd),N("GGGGG",ce,$d),N("ggggg",ce,$d),R(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=q(a)}),R(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),H("Q",0,0,"quarter"),z("quarter","Q"),N("Q",Wd),Q("Q",function(a,b){b[le]=3*(q(a)-1)}),H("D",["DD",2],"Do","date"),z("date","D"),N("D",_d),N("DD",_d,Xd),N("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),Q(["D","DD"],me),Q("Do",function(a,b){b[me]=q(a.match(_d)[0],10)});var Ie=C("Date",!0);H("d",0,"do","day"),H("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),H("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),H("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),z("day","d"),z("weekday","e"),z("isoWeekday","E"),N("d",_d),N("e",_d),N("E",_d),N("dd",he),N("ddd",he),N("dddd",he),R(["dd","ddd","dddd"],function(a,b,c){var d=c._locale.weekdaysParse(a);null!=d?b.d=d:j(c).invalidWeekday=a}),R(["d","e","E"],function(a,b,c,d){b[d]=q(a)});var Je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ke="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Le="Su_Mo_Tu_We_Th_Fr_Sa".split("_");H("H",["HH",2],0,"hour"),H("h",["hh",2],0,function(){return this.hours()%12||12}),Sb("a",!0),Sb("A",!1),z("hour","h"),N("a",Tb),N("A",Tb),N("H",_d),N("h",_d),N("HH",_d,Xd),N("hh",_d,Xd),Q(["H","HH"],ne),Q(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),Q(["h","hh"],function(a,b,c){b[ne]=q(a),j(c).bigHour=!0});var Me=/[ap]\.?m?\.?/i,Ne=C("Hours",!0);H("m",["mm",2],0,"minute"),z("minute","m"),N("m",_d),N("mm",_d,Xd),Q(["m","mm"],oe);var Oe=C("Minutes",!1);H("s",["ss",2],0,"second"),z("second","s"),N("s",_d),N("ss",_d,Xd),Q(["s","ss"],pe);var Pe=C("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return 10*this.millisecond()}),H(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),H(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),H(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),H(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),H(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),z("millisecond","ms"),N("S",ae,Wd),N("SS",ae,Xd),N("SSS",ae,Yd);var Qe;for(Qe="SSSS";Qe.length<=9;Qe+="S")N(Qe,de);for(Qe="S";Qe.length<=9;Qe+="S")Q(Qe,Wb);var Re=C("Milliseconds",!1);H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var Se=n.prototype;Se.add=Fe,Se.calendar=cb,Se.clone=db,Se.diff=ib,Se.endOf=ub,Se.format=mb,Se.from=nb,Se.fromNow=ob,Se.to=pb,Se.toNow=qb,Se.get=F,Se.invalidAt=Cb,Se.isAfter=eb,Se.isBefore=fb,Se.isBetween=gb,Se.isSame=hb,Se.isValid=Ab,Se.lang=He,Se.locale=rb,Se.localeData=sb,Se.max=Be,Se.min=Ae,Se.parsingFlags=Bb,Se.set=F,Se.startOf=tb,Se.subtract=Ge,Se.toArray=yb,Se.toObject=zb,Se.toDate=xb,Se.toISOString=lb,Se.toJSON=lb,Se.toString=kb,Se.unix=wb,Se.valueOf=vb,Se.year=ye,Se.isLeapYear=ia,Se.weekYear=Fb,Se.isoWeekYear=Gb,Se.quarter=Se.quarters=Jb,Se.month=Y,Se.daysInMonth=Z,Se.week=Se.weeks=na,Se.isoWeek=Se.isoWeeks=oa,Se.weeksInYear=Ib,Se.isoWeeksInYear=Hb,Se.date=Ie,Se.day=Se.days=Pb,Se.weekday=Qb,Se.isoWeekday=Rb,Se.dayOfYear=qa,Se.hour=Se.hours=Ne,Se.minute=Se.minutes=Oe,Se.second=Se.seconds=Pe,Se.millisecond=Se.milliseconds=Re,Se.utcOffset=Na,Se.utc=Pa,Se.local=Qa,Se.parseZone=Ra,Se.hasAlignedHourOffset=Sa,Se.isDST=Ta,Se.isDSTShifted=Ua,Se.isLocal=Va,Se.isUtcOffset=Wa,Se.isUtc=Xa,Se.isUTC=Xa,Se.zoneAbbr=Xb,Se.zoneName=Yb,Se.dates=aa("dates accessor is deprecated. Use date instead.",Ie),Se.months=aa("months accessor is deprecated. Use month instead",Y),Se.years=aa("years accessor is deprecated. Use year instead",ye),Se.zone=aa("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Oa);var Te=Se,Ue={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Ve={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},We="Invalid date",Xe="%d",Ye=/\d{1,2}/,Ze={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},$e=s.prototype;$e._calendar=Ue,$e.calendar=_b,$e._longDateFormat=Ve,$e.longDateFormat=ac,$e._invalidDate=We,$e.invalidDate=bc,$e._ordinal=Xe,$e.ordinal=cc,$e._ordinalParse=Ye,$e.preparse=dc,$e.postformat=dc,$e._relativeTime=Ze,$e.relativeTime=ec,$e.pastFuture=fc,$e.set=gc,$e.months=U,$e._months=re,$e.monthsShort=V,$e._monthsShort=se,$e.monthsParse=W,$e.week=ka,$e._week=ze,$e.firstDayOfYear=ma,$e.firstDayOfWeek=la,$e.weekdays=Lb,$e._weekdays=Je,$e.weekdaysMin=Nb,$e._weekdaysMin=Le,$e.weekdaysShort=Mb,$e._weekdaysShort=Ke,$e.weekdaysParse=Ob,$e.isPM=Ub,$e._meridiemParse=Me,$e.meridiem=Vb,w("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===q(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=aa("moment.lang is deprecated. Use moment.locale instead.",w),a.langData=aa("moment.langData is deprecated. Use moment.localeData instead.",y);var _e=Math.abs,af=yc("ms"),bf=yc("s"),cf=yc("m"),df=yc("h"),ef=yc("d"),ff=yc("w"),gf=yc("M"),hf=yc("y"),jf=Ac("milliseconds"),kf=Ac("seconds"),lf=Ac("minutes"),mf=Ac("hours"),nf=Ac("days"),of=Ac("months"),pf=Ac("years"),qf=Math.round,rf={s:45,m:45,h:22,d:26,M:11},sf=Math.abs,tf=Ha.prototype;tf.abs=oc,tf.add=qc,tf.subtract=rc,tf.as=wc,tf.asMilliseconds=af,tf.asSeconds=bf,tf.asMinutes=cf,tf.asHours=df,tf.asDays=ef,tf.asWeeks=ff,tf.asMonths=gf,tf.asYears=hf,tf.valueOf=xc,tf._bubble=tc,tf.get=zc,tf.milliseconds=jf,tf.seconds=kf,tf.minutes=lf,tf.hours=mf,tf.days=nf,tf.weeks=Bc,tf.months=of,tf.years=pf,tf.humanize=Fc,tf.toISOString=Gc,tf.toString=Gc,tf.toJSON=Gc,tf.locale=rb,tf.localeData=sb,tf.toIsoString=aa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Gc),tf.lang=He,H("X",0,0,"unix"),H("x",0,0,"valueOf"),N("x",ee),N("X",ge),Q("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),Q("x",function(a,b,c){c._d=new Date(q(a))}),
+//! moment.js
+//! version : 2.10.6
+//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
+//! license : MIT
+//! momentjs.com
+a.version="2.10.6",b(Da),a.fn=Te,a.min=Fa,a.max=Ga,a.utc=h,a.unix=Zb,a.months=jc,a.isDate=d,a.locale=w,a.invalid=l,a.duration=Ya,a.isMoment=o,a.weekdays=lc,a.parseZone=$b,a.localeData=y,a.isDuration=Ia,a.monthsShort=kc,a.weekdaysMin=nc,a.defineLocale=x,a.weekdaysShort=mc,a.normalizeUnits=A,a.relativeTimeThreshold=Ec;var uf=a,vf=(uf.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(a){return/^nm$/i.test(a)},meridiem:function(a,b,c){return 12>a?c?"vm":"VM":c?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),uf.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),wf={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},xf=(uf.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(a){return a.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return wf[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return vf[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),uf.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),yf={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},zf=function(a){return 0===a?0:1===a?1:2===a?2:a%100>=3&&10>=a%100?3:a%100>=11?4:5},Af={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},Bf=function(a){return function(b,c,d,e){var f=zf(b),g=Af[a][zf(b)];return 2===f&&(g=g[c?0:1]),g.replace(/%d/i,b)}},Cf=["كانون الثاني يناير","شباط فبراير","آذار مارس","نيسان أبريل","أيار مايو","حزيران يونيو","تموز يوليو","آب أغسطس","أيلول سبتمبر","تشرين الأول أكتوبر","تشرين الثاني نوفمبر","كانون الأول ديسمبر"],Df=(uf.defineLocale("ar",{months:Cf,monthsShort:Cf,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:Bf("s"),m:Bf("m"),mm:Bf("m"),h:Bf("h"),hh:Bf("h"),d:Bf("d"),dd:Bf("d"),M:Bf("M"),MM:Bf("M"),y:Bf("y"),yy:Bf("y")},preparse:function(a){return a.replace(/\u200f/g,"").replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return yf[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return xf[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),{1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"}),Ef=(uf.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(a){return/^(gündüz|axşam)$/.test(a)},meridiem:function(a,b,c){return 4>a?"gecə":12>a?"səhər":17>a?"gündüz":"axşam"},ordinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(a){if(0===a)return a+"-ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(Df[b]||Df[c]||Df[d])},week:{dow:1,doy:7}}),uf.defineLocale("be",{months:Jc,monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:Kc,weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:Ic,mm:Ic,h:Ic,hh:Ic,d:"дзень",dd:Ic,M:"месяц",MM:Ic,y:"год",yy:Ic},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(a){return/^(дня|вечара)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночы":12>a?"раніцы":17>a?"дня":"вечара"},ordinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a%10!==2&&a%10!==3||a%100===12||a%100===13?a+"-ы":a+"-і";case"D":return a+"-га";default:return a}},week:{dow:1,doy:7}}),uf.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),{1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"}),Ff={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},Gf=(uf.defineLocale("bn",{months:"জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রুবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্রু_শনি".split("_"),weekdaysMin:"রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কএক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(a){return a.replace(/[১২৩৪৫৬৭৮৯০]/g,function(a){return Ff[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Ef[a]})},meridiemParse:/রাত|সকাল|দুপুর|বিকেল|রাত/,isPM:function(a){return/^(দুপুর|বিকেল|রাত)$/.test(a)},meridiem:function(a,b,c){return 4>a?"রাত":10>a?"সকাল":17>a?"দুপুর":20>a?"বিকেল":"রাত"},week:{dow:0,doy:6}}),{1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"}),Hf={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"},If=(uf.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(a){return a.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(a){return Hf[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Gf[a]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,isPM:function(a){return/^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(a)},meridiem:function(a,b,c){return 4>a?"མཚན་མོ":10>a?"ཞོགས་ཀས":17>a?"ཉིན་གུང":20>a?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}}),uf.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:Lc,h:"un eur",hh:"%d eur",d:"un devezh",dd:Lc,M:"ur miz",MM:Lc,y:"ur bloaz",yy:Mc},ordinalParse:/\d{1,2}(añ|vet)/,ordinal:function(a){var b=1===a?"añ":"vet";return a+b},week:{dow:1,doy:4}}),uf.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:Qc,mm:Qc,h:Qc,hh:Qc,d:"dan",dd:Qc,M:"mjesec",MM:Qc,y:"godinu",yy:Qc},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),uf.defineLocale("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),longDateFormat:{LT:"H:mm",LTS:"LT:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(a,b){var c=1===a?"r":2===a?"n":3===a?"r":4===a?"t":"è";return("w"===b||"W"===b)&&(c="a"),a+c},week:{dow:1,doy:4}}),"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_")),Jf="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),Kf=(uf.defineLocale("cs",{months:If,monthsShort:Jf,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(If,Jf),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:Sc,m:Sc,mm:Sc,h:Sc,hh:Sc,d:Sc,dd:Sc,M:Sc,MM:Sc,y:Sc,yy:Sc},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(a){var b=/сехет$/i.exec(a)?"рен":/ҫул$/i.exec(a)?"тан":"ран";return a+b},past:"%s каялла",s:"пӗр-ик ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},ordinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}}),uf.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(a){var b=a,c="",d=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return b>20?c=40===b||50===b||60===b||80===b||100===b?"fed":"ain":b>0&&(c=d[b]),a+c},week:{dow:1,doy:4}}),uf.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY HH:mm"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[Heute um] LT [Uhr]",sameElse:"L",nextDay:"[Morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[Gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:Tc,mm:"%d Minuten",h:Tc,hh:"%d Stunden",d:Tc,dd:Tc,M:Tc,MM:Tc,y:Tc,yy:Tc},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[Heute um] LT [Uhr]",sameElse:"L",nextDay:"[Morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[Gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:Uc,mm:"%d Minuten",h:Uc,hh:"%d Stunden",d:Uc,dd:Uc,M:Uc,MM:Uc,y:Uc,yy:Uc},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(a,b){return/D/.test(b.substring(0,b.indexOf("MMMM")))?this._monthsGenitiveEl[a.month()]:this._monthsNominativeEl[a.month()]},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(a,b,c){return a>11?c?"μμ":"ΜΜ":c?"πμ":"ΠΜ"},isPM:function(a){return"μ"===(a+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(a,b){var c=this._calendarEl[a],d=b&&b.hours();return"function"==typeof c&&(c=c.apply(b)),c.replace("{}",d%12===1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},ordinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}}),uf.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),uf.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"D MMMM, YYYY",LLL:"D MMMM, YYYY h:mm A",LLLL:"dddd, D MMMM, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),uf.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),uf.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"),weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-an de] MMMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(a){return"p"===a.charAt(0).toLowerCase()},meridiem:function(a,b,c){return a>11?c?"p.t.m.":"P.T.M.":c?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}}),"Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.".split("_")),Lf="Ene_Feb_Mar_Abr_May_Jun_Jul_Ago_Sep_Oct_Nov_Dic".split("_"),Mf=(uf.defineLocale("es",{months:"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?Lf[a.month()]:Kf[a.month()]},weekdays:"Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mié._Jue._Vie._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),uf.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:Vc,m:Vc,mm:Vc,h:Vc,hh:Vc,d:Vc,dd:"%d päeva",M:Vc,MM:Vc,y:Vc,yy:Vc},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",
+lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"}),Nf={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},Of=(uf.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysShort:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(a){return/بعد از ظهر/.test(a)},meridiem:function(a,b,c){return 12>a?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چندین ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(a){return a.replace(/[۰-۹]/g,function(a){return Nf[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return Mf[a]}).replace(/,/g,"،")},ordinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}}),"nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" ")),Pf=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",Of[7],Of[8],Of[9]],Qf=(uf.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:Wc,m:Wc,mm:Wc,h:Wc,hh:Wc,d:Wc,dd:Wc,M:Wc,MM:Wc,y:Wc,yy:Wc},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minutt",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaði",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(a){return a+(1===a?"er":"e")}}),uf.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|)/,ordinal:function(a){return a+(1===a?"er":"")},week:{dow:1,doy:4}}),"jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_")),Rf="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),Sf=(uf.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?Rf[a.month()]:Qf[a.month()]},weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),uf.defineLocale("gl",{months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(a){return"uns segundos"===a?"nuns segundos":"en "+a},past:"hai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:7}}),uf.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(a){return 2===a?"שעתיים":a+" שעות"},d:"יום",dd:function(a){return 2===a?"יומיים":a+" ימים"},M:"חודש",MM:function(a){return 2===a?"חודשיים":a+" חודשים"},y:"שנה",yy:function(a){return 2===a?"שנתיים":a%10===0&&10!==a?a+" שנה":a+" שנים"}}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),Tf={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Uf=(uf.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return Tf[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Sf[a]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात"===b?4>a?a:a+12:"सुबह"===b?a:"दोपहर"===b?a>=10?a:a+12:"शाम"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात":10>a?"सुबह":17>a?"दोपहर":20>a?"शाम":"रात"},week:{dow:0,doy:6}}),uf.defineLocale("hr",{months:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"),monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:Yc,mm:Yc,h:Yc,hh:Yc,d:"dan",dd:Yc,M:"mjesec",MM:Yc,y:"godinu",yy:Yc},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),"vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ")),Vf=(uf.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(a){return"u"===a.charAt(1).toLowerCase()},meridiem:function(a,b,c){return 12>a?c===!0?"de":"DE":c===!0?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return $c.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return $c.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:Zc,m:Zc,mm:Zc,h:Zc,hh:Zc,d:Zc,dd:Zc,M:Zc,MM:Zc,y:Zc,yy:Zc},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),uf.defineLocale("hy-am",{months:_c,monthsShort:ad,weekdays:bd,weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(a){return/^(ցերեկվա|երեկոյան)$/.test(a)},meridiem:function(a){return 4>a?"գիշերվա":12>a?"առավոտվա":17>a?"ցերեկվա":"երեկոյան"},ordinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(a,b){switch(b){case"DDD":case"w":case"W":case"DDDo":return 1===a?a+"-ին":a+"-րդ";default:return a}},week:{dow:1,doy:7}}),uf.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"siang"===b?a>=11?a:a+12:"sore"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"siang":19>a?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),uf.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:dd,m:dd,mm:dd,h:"klukkustund",hh:dd,d:dd,dd:dd,M:dd,MM:dd,y:dd,yy:dd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"D_L_Ma_Me_G_V_S".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(a){return(/^[0-9].+$/.test(a)?"tra":"in")+" "+a},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),uf.defineLocale("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",LTS:"Ah時m分s秒",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah時m分",LLLL:"YYYY年M月D日Ah時m分 dddd"},meridiemParse:/午前|午後/i,isPM:function(a){return"午後"===a},meridiem:function(a,b,c){return 12>a?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}}),uf.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(a,b){return 12===a&&(a=0),"enjing"===b?a:"siyang"===b?a>=11?a:a+12:"sonten"===b||"ndalu"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"enjing":15>a?"siyang":19>a?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}}),uf.defineLocale("ka",{months:ed,monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:fd,weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(a){return/(წამი|წუთი|საათი|წელი)/.test(a)?a.replace(/ი$/,"ში"):a+"ში"},past:function(a){return/(წამი|წუთი|საათი|დღე|თვე)/.test(a)?a.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(a)?a.replace(/წელი$/,"წლის წინ"):void 0},s:"რამდენიმე წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},ordinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(a){return 0===a?a:1===a?a+"-ლი":20>a||100>=a&&a%20===0||a%100===0?"მე-"+a:a+"-ე"},week:{dow:1,doy:7}}),uf.defineLocale("km",{months:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysMin:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[ថ្ងៃនៈ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},week:{dow:1,doy:4}}),uf.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 m분",LTS:"A h시 m분 s초",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h시 m분",LLLL:"YYYY년 MMMM D일 dddd A h시 m분"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinalParse:/\d{1,2}일/,ordinal:"%d일",meridiemParse:/오전|오후/,isPM:function(a){return"오후"===a},meridiem:function(a,b,c){return 12>a?"오전":"오후"}}),uf.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:hd,past:id,s:"e puer Sekonnen",m:gd,mm:"%d Minutten",h:gd,hh:"%d Stonnen",d:gd,dd:"%d Deeg",M:gd,MM:"%d Méint",y:gd,yy:"%d Joer"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"}),Wf="sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),Xf=(uf.defineLocale("lt",{months:ld,monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:qd,weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:kd,m:md,mm:pd,h:md,hh:pd,d:md,dd:pd,M:md,MM:pd,y:md,yy:pd},ordinalParse:/\d{1,2}-oji/,ordinal:function(a){return a+"-oji"},week:{dow:1,doy:4}}),{m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")}),Yf=(uf.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:ud,m:td,mm:sd,h:td,hh:sd,d:td,dd:sd,M:td,MM:sd,y:td,yy:sd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Yf.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Yf.correctGrammaticalCase(a,d)}}),Zf=(uf.defineLocale("me",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedjelja","ponedjeljak","utorak","srijeda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sri.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",m:Yf.translate,mm:Yf.translate,h:Yf.translate,hh:Yf.translate,d:"dan",dd:Yf.translate,M:"mjesec",MM:Yf.translate,y:"godinu",yy:Yf.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),uf.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Во изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Во изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),uf.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,isPM:function(a){return/^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(a)},meridiem:function(a,b,c){return 4>a?"രാത്രി":12>a?"രാവിലെ":17>a?"ഉച്ച കഴിഞ്ഞ്":20>a?"വൈകുന്നേരം":"രാത്രി"}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),$f={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},_f=(uf.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%s नंतर",past:"%s पूर्वी",s:"सेकंद",m:"एक मिनिट",mm:"%d मिनिटे",h:"एक तास",hh:"%d तास",d:"एक दिवस",dd:"%d दिवस",M:"एक महिना",MM:"%d महिने",y:"एक वर्ष",yy:"%d वर्षे"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return $f[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Zf[a]})},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात्री"===b?4>a?a:a+12:"सकाळी"===b?a:"दुपारी"===b?a>=10?a:a+12:"सायंकाळी"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात्री":10>a?"सकाळी":17>a?"दुपारी":20>a?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}}),uf.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",
+lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),uf.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),{1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"}),ag={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"},bg=(uf.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(a){return a.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,function(a){return ag[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return _f[a]})},week:{dow:1,doy:4}}),uf.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tirs_ons_tors_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"H.mm",LTS:"H.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H.mm",LLLL:"dddd D. MMMM YYYY [kl.] H.mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),cg={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},dg=(uf.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आइ._सो._मङ्_बु._बि._शु._श.".split("_"),longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return cg[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return bg[a]})},meridiemParse:/राती|बिहान|दिउँसो|बेलुका|साँझ|राती/,meridiemHour:function(a,b){return 12===a&&(a=0),"राती"===b?3>a?a:a+12:"बिहान"===b?a:"दिउँसो"===b?a>=10?a:a+12:"बेलुका"===b||"साँझ"===b?a+12:void 0},meridiem:function(a,b,c){return 3>a?"राती":10>a?"बिहान":15>a?"दिउँसो":18>a?"बेलुका":20>a?"साँझ":"राती"},calendar:{sameDay:"[आज] LT",nextDay:"[भोली] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडी",s:"केही समय",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:1,doy:7}}),"jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_")),eg="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),fg=(uf.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?eg[a.month()]:dg[a.month()]},weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),uf.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),"styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_")),gg="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),hg=(uf.defineLocale("pl",{months:function(a,b){return""===b?"("+gg[a.month()]+"|"+fg[a.month()]+")":/D MMMM/.test(b)?gg[a.month()]:fg[a.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"N_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:wd,mm:wd,h:wd,hh:wd,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:wd,y:"rok",yy:wd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("pt-br",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº"}),uf.defineLocale("pt",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),uf.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:xd,h:"o oră",hh:xd,d:"o zi",dd:xd,M:"o lună",MM:xd,y:"un an",yy:xd},week:{dow:1,doy:7}}),uf.defineLocale("ru",{months:Ad,monthsShort:Bd,weekdays:Cd,weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[й|я]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(){return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT"},lastWeek:function(a){if(a.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:zd,mm:zd,h:"час",hh:zd,d:"день",dd:zd,M:"месяц",MM:zd,y:"год",yy:zd},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(a){return/^(дня|вечера)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночи":12>a?"утра":17>a?"дня":"вечера"},ordinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":return a+"-й";case"D":return a+"-го";case"w":case"W":return a+"-я";default:return a}},week:{dow:1,doy:7}}),uf.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්ර_සි_සෙ".split("_"),longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},ordinalParse:/\d{1,2} වැනි/,ordinal:function(a){return a+" වැනි"},meridiem:function(a,b,c){return a>11?c?"ප.ව.":"පස් වරු":c?"පෙ.ව.":"පෙර වරු"}}),"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_")),ig="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),jg=(uf.defineLocale("sk",{months:hg,monthsShort:ig,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(hg,ig),weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:Ed,m:Ed,mm:Ed,h:Ed,hh:Ed,d:Ed,dd:Ed,M:Ed,MM:Ed,y:Ed,yy:Ed},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:Fd,m:Fd,mm:Fd,h:Fd,hh:Fd,d:Fd,dd:Fd,M:Fd,MM:Fd,y:Fd,yy:Fd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),uf.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),meridiemParse:/PD|MD/,isPM:function(a){return"M"===a.charAt(0)},meridiem:function(a,b,c){return 12>a?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=jg.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+jg.correctGrammaticalCase(a,d)}}),kg=(uf.defineLocale("sr-cyrl",{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],monthsShort:["јан.","феб.","мар.","апр.","мај","јун","јул","авг.","сеп.","окт.","нов.","дец."],weekdays:["недеља","понедељак","уторак","среда","четвртак","петак","субота"],weekdaysShort:["нед.","пон.","уто.","сре.","чет.","пет.","суб."],weekdaysMin:["не","по","ут","ср","че","пе","су"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){var a=["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:jg.translate,mm:jg.translate,h:jg.translate,hh:jg.translate,d:"дан",dd:jg.translate,M:"месец",MM:jg.translate,y:"годину",yy:jg.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{words:{m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=kg.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+kg.correctGrammaticalCase(a,d)}}),lg=(uf.defineLocale("sr",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedelja","ponedeljak","utorak","sreda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sre.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:kg.translate,mm:kg.translate,h:kg.translate,hh:kg.translate,d:"dan",dd:kg.translate,M:"mesec",MM:kg.translate,y:"godinu",yy:kg.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),uf.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}(e|a)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"e":1===b?"a":2===b?"a":"e";return a+c},week:{dow:1,doy:4}}),uf.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinalParse:/\d{1,2}வது/,ordinal:function(a){return a+"வது"},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(a,b,c){return 2>a?" யாமம்":6>a?" வைகறை":10>a?" காலை":14>a?" நண்பகல்":18>a?" எற்பாடு":22>a?" மாலை":" யாமம்"},meridiemHour:function(a,b){return 12===a&&(a=0),"யாமம்"===b?2>a?a:a+12:"வைகறை"===b||"காலை"===b?a:"நண்பகல்"===b&&a>=10?a:a+12},week:{dow:0,doy:6}}),uf.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"),weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),longDateFormat:{LT:"H นาฬิกา m นาที",LTS:"H นาฬิกา m นาที s วินาที",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H นาฬิกา m นาที",LLLL:"วันddddที่ D MMMM YYYY เวลา H นาฬิกา m นาที"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(a){return"หลังเที่ยง"===a},meridiem:function(a,b,c){return 12>a?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}}),uf.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"[Ngayon sa] LT",nextDay:"[Bukas sa] LT",nextWeek:"dddd [sa] LT",lastDay:"[Kahapon sa] LT",lastWeek:"dddd [huling linggo] LT",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),{1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"}),mg=(uf.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(a){if(0===a)return a+"'ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(lg[b]||lg[c]||lg[d])},week:{dow:1,doy:7}}),uf.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"LT.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY LT",LLLL:"dddd, [li] D. MMMM [dallas] YYYY LT"},meridiem:function(a,b,c){return a>11?c?"d'o":"D'O":c?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:Gd,m:Gd,mm:Gd,h:Gd,hh:Gd,d:Gd,dd:Gd,M:Gd,MM:Gd,y:Gd,yy:Gd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uf.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}}),uf.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}}),uf.defineLocale("uk",{months:Jd,monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:Kd,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:Ld("[Сьогодні "),nextDay:Ld("[Завтра "),lastDay:Ld("[Вчора "),nextWeek:Ld("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return Ld("[Минулої] dddd [").call(this);case 1:case 2:case 4:return Ld("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:Id,mm:Id,h:"годину",hh:Id,d:"день",dd:Id,M:"місяць",MM:Id,y:"рік",yy:Id},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(a){return/^(дня|вечора)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночі":12>a?"ранку":17>a?"дня":"вечора"},ordinalParse:/\d{1,2}-(й|го)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a+"-й";case"D":return a+"-го";default:return a}},week:{dow:1,doy:7}}),uf.defineLocale("uz",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}}),uf.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",
+llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần rồi lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),uf.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm分",LTS:"Ah点m分s秒",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah点mm分",llll:"YYYY年MMMD日ddddAh点mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(a,b){return 12===a&&(a=0),"凌晨"===b||"早上"===b||"上午"===b?a:"下午"===b||"晚上"===b?a+12:a>=11?a:a+12},meridiem:function(a,b,c){var d=100*a+b;return 600>d?"凌晨":900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var a,b;return a=uf().startOf("week"),b=this.unix()-a.unix()>=604800?"[下]":"[本]",0===this.minutes()?b+"dddAh点整":b+"dddAh点mm"},lastWeek:function(){var a,b;return a=uf().startOf("week"),b=this.unix()=11?a:a+12:"下午"===b||"晚上"===b?a+12:void 0},meridiem:function(a,b,c){var d=100*a+b;return 900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(a,b){switch(b){case"d":case"D":case"DDD":return a+"日";case"M":return a+"月";case"w":case"W":return a+"週";default:return a}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d分鐘",h:"一小時",hh:"%d小時",d:"一天",dd:"%d天",M:"一個月",MM:"%d個月",y:"一年",yy:"%d年"}}),uf);return mg.locale("en"),mg});
\ No newline at end of file
diff --git a/resources/momentjs/moment.js b/resources/momentjs/moment.js
new file mode 100644
index 00000000..23cd3ede
--- /dev/null
+++ b/resources/momentjs/moment.js
@@ -0,0 +1,3195 @@
+//! moment.js
+//! version : 2.10.6
+//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
+//! license : MIT
+//! momentjs.com
+
+(function (global, factory) {
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define(factory) :
+ global.moment = factory()
+}(this, function () { 'use strict';
+
+ var hookCallback;
+
+ function utils_hooks__hooks () {
+ return hookCallback.apply(null, arguments);
+ }
+
+ // This is done to register the method called with moment()
+ // without creating circular dependencies.
+ function setHookCallback (callback) {
+ hookCallback = callback;
+ }
+
+ function isArray(input) {
+ return Object.prototype.toString.call(input) === '[object Array]';
+ }
+
+ function isDate(input) {
+ return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
+ }
+
+ function map(arr, fn) {
+ var res = [], i;
+ for (i = 0; i < arr.length; ++i) {
+ res.push(fn(arr[i], i));
+ }
+ return res;
+ }
+
+ function hasOwnProp(a, b) {
+ return Object.prototype.hasOwnProperty.call(a, b);
+ }
+
+ function extend(a, b) {
+ for (var i in b) {
+ if (hasOwnProp(b, i)) {
+ a[i] = b[i];
+ }
+ }
+
+ if (hasOwnProp(b, 'toString')) {
+ a.toString = b.toString;
+ }
+
+ if (hasOwnProp(b, 'valueOf')) {
+ a.valueOf = b.valueOf;
+ }
+
+ return a;
+ }
+
+ function create_utc__createUTC (input, format, locale, strict) {
+ return createLocalOrUTC(input, format, locale, strict, true).utc();
+ }
+
+ function defaultParsingFlags() {
+ // We need to deep clone this object.
+ return {
+ empty : false,
+ unusedTokens : [],
+ unusedInput : [],
+ overflow : -2,
+ charsLeftOver : 0,
+ nullInput : false,
+ invalidMonth : null,
+ invalidFormat : false,
+ userInvalidated : false,
+ iso : false
+ };
+ }
+
+ function getParsingFlags(m) {
+ if (m._pf == null) {
+ m._pf = defaultParsingFlags();
+ }
+ return m._pf;
+ }
+
+ function valid__isValid(m) {
+ if (m._isValid == null) {
+ var flags = getParsingFlags(m);
+ m._isValid = !isNaN(m._d.getTime()) &&
+ flags.overflow < 0 &&
+ !flags.empty &&
+ !flags.invalidMonth &&
+ !flags.invalidWeekday &&
+ !flags.nullInput &&
+ !flags.invalidFormat &&
+ !flags.userInvalidated;
+
+ if (m._strict) {
+ m._isValid = m._isValid &&
+ flags.charsLeftOver === 0 &&
+ flags.unusedTokens.length === 0 &&
+ flags.bigHour === undefined;
+ }
+ }
+ return m._isValid;
+ }
+
+ function valid__createInvalid (flags) {
+ var m = create_utc__createUTC(NaN);
+ if (flags != null) {
+ extend(getParsingFlags(m), flags);
+ }
+ else {
+ getParsingFlags(m).userInvalidated = true;
+ }
+
+ return m;
+ }
+
+ var momentProperties = utils_hooks__hooks.momentProperties = [];
+
+ function copyConfig(to, from) {
+ var i, prop, val;
+
+ if (typeof from._isAMomentObject !== 'undefined') {
+ to._isAMomentObject = from._isAMomentObject;
+ }
+ if (typeof from._i !== 'undefined') {
+ to._i = from._i;
+ }
+ if (typeof from._f !== 'undefined') {
+ to._f = from._f;
+ }
+ if (typeof from._l !== 'undefined') {
+ to._l = from._l;
+ }
+ if (typeof from._strict !== 'undefined') {
+ to._strict = from._strict;
+ }
+ if (typeof from._tzm !== 'undefined') {
+ to._tzm = from._tzm;
+ }
+ if (typeof from._isUTC !== 'undefined') {
+ to._isUTC = from._isUTC;
+ }
+ if (typeof from._offset !== 'undefined') {
+ to._offset = from._offset;
+ }
+ if (typeof from._pf !== 'undefined') {
+ to._pf = getParsingFlags(from);
+ }
+ if (typeof from._locale !== 'undefined') {
+ to._locale = from._locale;
+ }
+
+ if (momentProperties.length > 0) {
+ for (i in momentProperties) {
+ prop = momentProperties[i];
+ val = from[prop];
+ if (typeof val !== 'undefined') {
+ to[prop] = val;
+ }
+ }
+ }
+
+ return to;
+ }
+
+ var updateInProgress = false;
+
+ // Moment prototype object
+ function Moment(config) {
+ copyConfig(this, config);
+ this._d = new Date(config._d != null ? config._d.getTime() : NaN);
+ // Prevent infinite loop in case updateOffset creates new moment
+ // objects.
+ if (updateInProgress === false) {
+ updateInProgress = true;
+ utils_hooks__hooks.updateOffset(this);
+ updateInProgress = false;
+ }
+ }
+
+ function isMoment (obj) {
+ return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
+ }
+
+ function absFloor (number) {
+ if (number < 0) {
+ return Math.ceil(number);
+ } else {
+ return Math.floor(number);
+ }
+ }
+
+ function toInt(argumentForCoercion) {
+ var coercedNumber = +argumentForCoercion,
+ value = 0;
+
+ if (coercedNumber !== 0 && isFinite(coercedNumber)) {
+ value = absFloor(coercedNumber);
+ }
+
+ return value;
+ }
+
+ function compareArrays(array1, array2, dontConvert) {
+ var len = Math.min(array1.length, array2.length),
+ lengthDiff = Math.abs(array1.length - array2.length),
+ diffs = 0,
+ i;
+ for (i = 0; i < len; i++) {
+ if ((dontConvert && array1[i] !== array2[i]) ||
+ (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
+ diffs++;
+ }
+ }
+ return diffs + lengthDiff;
+ }
+
+ function Locale() {
+ }
+
+ var locales = {};
+ var globalLocale;
+
+ function normalizeLocale(key) {
+ return key ? key.toLowerCase().replace('_', '-') : key;
+ }
+
+ // pick the locale from the array
+ // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
+ // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
+ function chooseLocale(names) {
+ var i = 0, j, next, locale, split;
+
+ while (i < names.length) {
+ split = normalizeLocale(names[i]).split('-');
+ j = split.length;
+ next = normalizeLocale(names[i + 1]);
+ next = next ? next.split('-') : null;
+ while (j > 0) {
+ locale = loadLocale(split.slice(0, j).join('-'));
+ if (locale) {
+ return locale;
+ }
+ if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
+ //the next array item is better than a shallower substring of this one
+ break;
+ }
+ j--;
+ }
+ i++;
+ }
+ return null;
+ }
+
+ function loadLocale(name) {
+ var oldLocale = null;
+ // TODO: Find a better way to register and load all the locales in Node
+ if (!locales[name] && typeof module !== 'undefined' &&
+ module && module.exports) {
+ try {
+ oldLocale = globalLocale._abbr;
+ require('./locale/' + name);
+ // because defineLocale currently also sets the global locale, we
+ // want to undo that for lazy loaded locales
+ locale_locales__getSetGlobalLocale(oldLocale);
+ } catch (e) { }
+ }
+ return locales[name];
+ }
+
+ // This function will load locale and then set the global locale. If
+ // no arguments are passed in, it will simply return the current global
+ // locale key.
+ function locale_locales__getSetGlobalLocale (key, values) {
+ var data;
+ if (key) {
+ if (typeof values === 'undefined') {
+ data = locale_locales__getLocale(key);
+ }
+ else {
+ data = defineLocale(key, values);
+ }
+
+ if (data) {
+ // moment.duration._locale = moment._locale = data;
+ globalLocale = data;
+ }
+ }
+
+ return globalLocale._abbr;
+ }
+
+ function defineLocale (name, values) {
+ if (values !== null) {
+ values.abbr = name;
+ locales[name] = locales[name] || new Locale();
+ locales[name].set(values);
+
+ // backwards compat for now: also set the locale
+ locale_locales__getSetGlobalLocale(name);
+
+ return locales[name];
+ } else {
+ // useful for testing
+ delete locales[name];
+ return null;
+ }
+ }
+
+ // returns locale data
+ function locale_locales__getLocale (key) {
+ var locale;
+
+ if (key && key._locale && key._locale._abbr) {
+ key = key._locale._abbr;
+ }
+
+ if (!key) {
+ return globalLocale;
+ }
+
+ if (!isArray(key)) {
+ //short-circuit everything else
+ locale = loadLocale(key);
+ if (locale) {
+ return locale;
+ }
+ key = [key];
+ }
+
+ return chooseLocale(key);
+ }
+
+ var aliases = {};
+
+ function addUnitAlias (unit, shorthand) {
+ var lowerCase = unit.toLowerCase();
+ aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
+ }
+
+ function normalizeUnits(units) {
+ return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
+ }
+
+ function normalizeObjectUnits(inputObject) {
+ var normalizedInput = {},
+ normalizedProp,
+ prop;
+
+ for (prop in inputObject) {
+ if (hasOwnProp(inputObject, prop)) {
+ normalizedProp = normalizeUnits(prop);
+ if (normalizedProp) {
+ normalizedInput[normalizedProp] = inputObject[prop];
+ }
+ }
+ }
+
+ return normalizedInput;
+ }
+
+ function makeGetSet (unit, keepTime) {
+ return function (value) {
+ if (value != null) {
+ get_set__set(this, unit, value);
+ utils_hooks__hooks.updateOffset(this, keepTime);
+ return this;
+ } else {
+ return get_set__get(this, unit);
+ }
+ };
+ }
+
+ function get_set__get (mom, unit) {
+ return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]();
+ }
+
+ function get_set__set (mom, unit, value) {
+ return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
+ }
+
+ // MOMENTS
+
+ function getSet (units, value) {
+ var unit;
+ if (typeof units === 'object') {
+ for (unit in units) {
+ this.set(unit, units[unit]);
+ }
+ } else {
+ units = normalizeUnits(units);
+ if (typeof this[units] === 'function') {
+ return this[units](value);
+ }
+ }
+ return this;
+ }
+
+ function zeroFill(number, targetLength, forceSign) {
+ var absNumber = '' + Math.abs(number),
+ zerosToFill = targetLength - absNumber.length,
+ sign = number >= 0;
+ return (sign ? (forceSign ? '+' : '') : '-') +
+ Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
+ }
+
+ var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
+
+ var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
+
+ var formatFunctions = {};
+
+ var formatTokenFunctions = {};
+
+ // token: 'M'
+ // padded: ['MM', 2]
+ // ordinal: 'Mo'
+ // callback: function () { this.month() + 1 }
+ function addFormatToken (token, padded, ordinal, callback) {
+ var func = callback;
+ if (typeof callback === 'string') {
+ func = function () {
+ return this[callback]();
+ };
+ }
+ if (token) {
+ formatTokenFunctions[token] = func;
+ }
+ if (padded) {
+ formatTokenFunctions[padded[0]] = function () {
+ return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
+ };
+ }
+ if (ordinal) {
+ formatTokenFunctions[ordinal] = function () {
+ return this.localeData().ordinal(func.apply(this, arguments), token);
+ };
+ }
+ }
+
+ function removeFormattingTokens(input) {
+ if (input.match(/\[[\s\S]/)) {
+ return input.replace(/^\[|\]$/g, '');
+ }
+ return input.replace(/\\/g, '');
+ }
+
+ function makeFormatFunction(format) {
+ var array = format.match(formattingTokens), i, length;
+
+ for (i = 0, length = array.length; i < length; i++) {
+ if (formatTokenFunctions[array[i]]) {
+ array[i] = formatTokenFunctions[array[i]];
+ } else {
+ array[i] = removeFormattingTokens(array[i]);
+ }
+ }
+
+ return function (mom) {
+ var output = '';
+ for (i = 0; i < length; i++) {
+ output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
+ }
+ return output;
+ };
+ }
+
+ // format date using native date object
+ function formatMoment(m, format) {
+ if (!m.isValid()) {
+ return m.localeData().invalidDate();
+ }
+
+ format = expandFormat(format, m.localeData());
+ formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
+
+ return formatFunctions[format](m);
+ }
+
+ function expandFormat(format, locale) {
+ var i = 5;
+
+ function replaceLongDateFormatTokens(input) {
+ return locale.longDateFormat(input) || input;
+ }
+
+ localFormattingTokens.lastIndex = 0;
+ while (i >= 0 && localFormattingTokens.test(format)) {
+ format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
+ localFormattingTokens.lastIndex = 0;
+ i -= 1;
+ }
+
+ return format;
+ }
+
+ var match1 = /\d/; // 0 - 9
+ var match2 = /\d\d/; // 00 - 99
+ var match3 = /\d{3}/; // 000 - 999
+ var match4 = /\d{4}/; // 0000 - 9999
+ var match6 = /[+-]?\d{6}/; // -999999 - 999999
+ var match1to2 = /\d\d?/; // 0 - 99
+ var match1to3 = /\d{1,3}/; // 0 - 999
+ var match1to4 = /\d{1,4}/; // 0 - 9999
+ var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
+
+ var matchUnsigned = /\d+/; // 0 - inf
+ var matchSigned = /[+-]?\d+/; // -inf - inf
+
+ var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
+
+ var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
+
+ // any word (or two) characters or numbers including two/three word month in arabic.
+ var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
+
+ var regexes = {};
+
+ function isFunction (sth) {
+ // https://github.com/moment/moment/issues/2325
+ return typeof sth === 'function' &&
+ Object.prototype.toString.call(sth) === '[object Function]';
+ }
+
+
+ function addRegexToken (token, regex, strictRegex) {
+ regexes[token] = isFunction(regex) ? regex : function (isStrict) {
+ return (isStrict && strictRegex) ? strictRegex : regex;
+ };
+ }
+
+ function getParseRegexForToken (token, config) {
+ if (!hasOwnProp(regexes, token)) {
+ return new RegExp(unescapeFormat(token));
+ }
+
+ return regexes[token](config._strict, config._locale);
+ }
+
+ // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
+ function unescapeFormat(s) {
+ return s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
+ return p1 || p2 || p3 || p4;
+ }).replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
+ }
+
+ var tokens = {};
+
+ function addParseToken (token, callback) {
+ var i, func = callback;
+ if (typeof token === 'string') {
+ token = [token];
+ }
+ if (typeof callback === 'number') {
+ func = function (input, array) {
+ array[callback] = toInt(input);
+ };
+ }
+ for (i = 0; i < token.length; i++) {
+ tokens[token[i]] = func;
+ }
+ }
+
+ function addWeekParseToken (token, callback) {
+ addParseToken(token, function (input, array, config, token) {
+ config._w = config._w || {};
+ callback(input, config._w, config, token);
+ });
+ }
+
+ function addTimeToArrayFromToken(token, input, config) {
+ if (input != null && hasOwnProp(tokens, token)) {
+ tokens[token](input, config._a, config, token);
+ }
+ }
+
+ var YEAR = 0;
+ var MONTH = 1;
+ var DATE = 2;
+ var HOUR = 3;
+ var MINUTE = 4;
+ var SECOND = 5;
+ var MILLISECOND = 6;
+
+ function daysInMonth(year, month) {
+ return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
+ }
+
+ // FORMATTING
+
+ addFormatToken('M', ['MM', 2], 'Mo', function () {
+ return this.month() + 1;
+ });
+
+ addFormatToken('MMM', 0, 0, function (format) {
+ return this.localeData().monthsShort(this, format);
+ });
+
+ addFormatToken('MMMM', 0, 0, function (format) {
+ return this.localeData().months(this, format);
+ });
+
+ // ALIASES
+
+ addUnitAlias('month', 'M');
+
+ // PARSING
+
+ addRegexToken('M', match1to2);
+ addRegexToken('MM', match1to2, match2);
+ addRegexToken('MMM', matchWord);
+ addRegexToken('MMMM', matchWord);
+
+ addParseToken(['M', 'MM'], function (input, array) {
+ array[MONTH] = toInt(input) - 1;
+ });
+
+ addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
+ var month = config._locale.monthsParse(input, token, config._strict);
+ // if we didn't find a month name, mark the date as invalid.
+ if (month != null) {
+ array[MONTH] = month;
+ } else {
+ getParsingFlags(config).invalidMonth = input;
+ }
+ });
+
+ // LOCALES
+
+ var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
+ function localeMonths (m) {
+ return this._months[m.month()];
+ }
+
+ var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
+ function localeMonthsShort (m) {
+ return this._monthsShort[m.month()];
+ }
+
+ function localeMonthsParse (monthName, format, strict) {
+ var i, mom, regex;
+
+ if (!this._monthsParse) {
+ this._monthsParse = [];
+ this._longMonthsParse = [];
+ this._shortMonthsParse = [];
+ }
+
+ for (i = 0; i < 12; i++) {
+ // make the regex if we don't have it already
+ mom = create_utc__createUTC([2000, i]);
+ if (strict && !this._longMonthsParse[i]) {
+ this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
+ this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
+ }
+ if (!strict && !this._monthsParse[i]) {
+ regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
+ this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
+ }
+ // test the regex
+ if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
+ return i;
+ } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
+ return i;
+ } else if (!strict && this._monthsParse[i].test(monthName)) {
+ return i;
+ }
+ }
+ }
+
+ // MOMENTS
+
+ function setMonth (mom, value) {
+ var dayOfMonth;
+
+ // TODO: Move this out of here!
+ if (typeof value === 'string') {
+ value = mom.localeData().monthsParse(value);
+ // TODO: Another silent failure?
+ if (typeof value !== 'number') {
+ return mom;
+ }
+ }
+
+ dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
+ mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
+ return mom;
+ }
+
+ function getSetMonth (value) {
+ if (value != null) {
+ setMonth(this, value);
+ utils_hooks__hooks.updateOffset(this, true);
+ return this;
+ } else {
+ return get_set__get(this, 'Month');
+ }
+ }
+
+ function getDaysInMonth () {
+ return daysInMonth(this.year(), this.month());
+ }
+
+ function checkOverflow (m) {
+ var overflow;
+ var a = m._a;
+
+ if (a && getParsingFlags(m).overflow === -2) {
+ overflow =
+ a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
+ a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
+ a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
+ a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
+ a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
+ a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
+ -1;
+
+ if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
+ overflow = DATE;
+ }
+
+ getParsingFlags(m).overflow = overflow;
+ }
+
+ return m;
+ }
+
+ function warn(msg) {
+ if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) {
+ console.warn('Deprecation warning: ' + msg);
+ }
+ }
+
+ function deprecate(msg, fn) {
+ var firstTime = true;
+
+ return extend(function () {
+ if (firstTime) {
+ warn(msg + '\n' + (new Error()).stack);
+ firstTime = false;
+ }
+ return fn.apply(this, arguments);
+ }, fn);
+ }
+
+ var deprecations = {};
+
+ function deprecateSimple(name, msg) {
+ if (!deprecations[name]) {
+ warn(msg);
+ deprecations[name] = true;
+ }
+ }
+
+ utils_hooks__hooks.suppressDeprecationWarnings = false;
+
+ var from_string__isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
+
+ var isoDates = [
+ ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/],
+ ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/],
+ ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/],
+ ['GGGG-[W]WW', /\d{4}-W\d{2}/],
+ ['YYYY-DDD', /\d{4}-\d{3}/]
+ ];
+
+ // iso time formats and regexes
+ var isoTimes = [
+ ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/],
+ ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/],
+ ['HH:mm', /(T| )\d\d:\d\d/],
+ ['HH', /(T| )\d\d/]
+ ];
+
+ var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
+
+ // date from iso format
+ function configFromISO(config) {
+ var i, l,
+ string = config._i,
+ match = from_string__isoRegex.exec(string);
+
+ if (match) {
+ getParsingFlags(config).iso = true;
+ for (i = 0, l = isoDates.length; i < l; i++) {
+ if (isoDates[i][1].exec(string)) {
+ config._f = isoDates[i][0];
+ break;
+ }
+ }
+ for (i = 0, l = isoTimes.length; i < l; i++) {
+ if (isoTimes[i][1].exec(string)) {
+ // match[6] should be 'T' or space
+ config._f += (match[6] || ' ') + isoTimes[i][0];
+ break;
+ }
+ }
+ if (string.match(matchOffset)) {
+ config._f += 'Z';
+ }
+ configFromStringAndFormat(config);
+ } else {
+ config._isValid = false;
+ }
+ }
+
+ // date from iso format or fallback
+ function configFromString(config) {
+ var matched = aspNetJsonRegex.exec(config._i);
+
+ if (matched !== null) {
+ config._d = new Date(+matched[1]);
+ return;
+ }
+
+ configFromISO(config);
+ if (config._isValid === false) {
+ delete config._isValid;
+ utils_hooks__hooks.createFromInputFallback(config);
+ }
+ }
+
+ utils_hooks__hooks.createFromInputFallback = deprecate(
+ 'moment construction falls back to js Date. This is ' +
+ 'discouraged and will be removed in upcoming major ' +
+ 'release. Please refer to ' +
+ 'https://github.com/moment/moment/issues/1407 for more info.',
+ function (config) {
+ config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
+ }
+ );
+
+ function createDate (y, m, d, h, M, s, ms) {
+ //can't just apply() to create a date:
+ //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
+ var date = new Date(y, m, d, h, M, s, ms);
+
+ //the date constructor doesn't accept years < 1970
+ if (y < 1970) {
+ date.setFullYear(y);
+ }
+ return date;
+ }
+
+ function createUTCDate (y) {
+ var date = new Date(Date.UTC.apply(null, arguments));
+ if (y < 1970) {
+ date.setUTCFullYear(y);
+ }
+ return date;
+ }
+
+ addFormatToken(0, ['YY', 2], 0, function () {
+ return this.year() % 100;
+ });
+
+ addFormatToken(0, ['YYYY', 4], 0, 'year');
+ addFormatToken(0, ['YYYYY', 5], 0, 'year');
+ addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
+
+ // ALIASES
+
+ addUnitAlias('year', 'y');
+
+ // PARSING
+
+ addRegexToken('Y', matchSigned);
+ addRegexToken('YY', match1to2, match2);
+ addRegexToken('YYYY', match1to4, match4);
+ addRegexToken('YYYYY', match1to6, match6);
+ addRegexToken('YYYYYY', match1to6, match6);
+
+ addParseToken(['YYYYY', 'YYYYYY'], YEAR);
+ addParseToken('YYYY', function (input, array) {
+ array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input);
+ });
+ addParseToken('YY', function (input, array) {
+ array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input);
+ });
+
+ // HELPERS
+
+ function daysInYear(year) {
+ return isLeapYear(year) ? 366 : 365;
+ }
+
+ function isLeapYear(year) {
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
+ }
+
+ // HOOKS
+
+ utils_hooks__hooks.parseTwoDigitYear = function (input) {
+ return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
+ };
+
+ // MOMENTS
+
+ var getSetYear = makeGetSet('FullYear', false);
+
+ function getIsLeapYear () {
+ return isLeapYear(this.year());
+ }
+
+ addFormatToken('w', ['ww', 2], 'wo', 'week');
+ addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
+
+ // ALIASES
+
+ addUnitAlias('week', 'w');
+ addUnitAlias('isoWeek', 'W');
+
+ // PARSING
+
+ addRegexToken('w', match1to2);
+ addRegexToken('ww', match1to2, match2);
+ addRegexToken('W', match1to2);
+ addRegexToken('WW', match1to2, match2);
+
+ addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
+ week[token.substr(0, 1)] = toInt(input);
+ });
+
+ // HELPERS
+
+ // firstDayOfWeek 0 = sun, 6 = sat
+ // the day of the week that starts the week
+ // (usually sunday or monday)
+ // firstDayOfWeekOfYear 0 = sun, 6 = sat
+ // the first week is the week that contains the first
+ // of this day of the week
+ // (eg. ISO weeks use thursday (4))
+ function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {
+ var end = firstDayOfWeekOfYear - firstDayOfWeek,
+ daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(),
+ adjustedMoment;
+
+
+ if (daysToDayOfWeek > end) {
+ daysToDayOfWeek -= 7;
+ }
+
+ if (daysToDayOfWeek < end - 7) {
+ daysToDayOfWeek += 7;
+ }
+
+ adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd');
+ return {
+ week: Math.ceil(adjustedMoment.dayOfYear() / 7),
+ year: adjustedMoment.year()
+ };
+ }
+
+ // LOCALES
+
+ function localeWeek (mom) {
+ return weekOfYear(mom, this._week.dow, this._week.doy).week;
+ }
+
+ var defaultLocaleWeek = {
+ dow : 0, // Sunday is the first day of the week.
+ doy : 6 // The week that contains Jan 1st is the first week of the year.
+ };
+
+ function localeFirstDayOfWeek () {
+ return this._week.dow;
+ }
+
+ function localeFirstDayOfYear () {
+ return this._week.doy;
+ }
+
+ // MOMENTS
+
+ function getSetWeek (input) {
+ var week = this.localeData().week(this);
+ return input == null ? week : this.add((input - week) * 7, 'd');
+ }
+
+ function getSetISOWeek (input) {
+ var week = weekOfYear(this, 1, 4).week;
+ return input == null ? week : this.add((input - week) * 7, 'd');
+ }
+
+ addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
+
+ // ALIASES
+
+ addUnitAlias('dayOfYear', 'DDD');
+
+ // PARSING
+
+ addRegexToken('DDD', match1to3);
+ addRegexToken('DDDD', match3);
+ addParseToken(['DDD', 'DDDD'], function (input, array, config) {
+ config._dayOfYear = toInt(input);
+ });
+
+ // HELPERS
+
+ //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
+ function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) {
+ var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear;
+ if (d < firstDayOfWeek) {
+ d += 7;
+ }
+
+ weekday = weekday != null ? 1 * weekday : firstDayOfWeek;
+
+ dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday;
+
+ return {
+ year: dayOfYear > 0 ? year : year - 1,
+ dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear
+ };
+ }
+
+ // MOMENTS
+
+ function getSetDayOfYear (input) {
+ var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
+ return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
+ }
+
+ // Pick the first defined of two or three arguments.
+ function defaults(a, b, c) {
+ if (a != null) {
+ return a;
+ }
+ if (b != null) {
+ return b;
+ }
+ return c;
+ }
+
+ function currentDateArray(config) {
+ var now = new Date();
+ if (config._useUTC) {
+ return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()];
+ }
+ return [now.getFullYear(), now.getMonth(), now.getDate()];
+ }
+
+ // convert an array to a date.
+ // the array should mirror the parameters below
+ // note: all values past the year are optional and will default to the lowest possible value.
+ // [year, month, day , hour, minute, second, millisecond]
+ function configFromArray (config) {
+ var i, date, input = [], currentDate, yearToUse;
+
+ if (config._d) {
+ return;
+ }
+
+ currentDate = currentDateArray(config);
+
+ //compute day of the year from weeks and weekdays
+ if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
+ dayOfYearFromWeekInfo(config);
+ }
+
+ //if the day of the year is set, figure out what it is
+ if (config._dayOfYear) {
+ yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
+
+ if (config._dayOfYear > daysInYear(yearToUse)) {
+ getParsingFlags(config)._overflowDayOfYear = true;
+ }
+
+ date = createUTCDate(yearToUse, 0, config._dayOfYear);
+ config._a[MONTH] = date.getUTCMonth();
+ config._a[DATE] = date.getUTCDate();
+ }
+
+ // Default to current date.
+ // * if no year, month, day of month are given, default to today
+ // * if day of month is given, default month and year
+ // * if month is given, default only year
+ // * if year is given, don't default anything
+ for (i = 0; i < 3 && config._a[i] == null; ++i) {
+ config._a[i] = input[i] = currentDate[i];
+ }
+
+ // Zero out whatever was not defaulted, including time
+ for (; i < 7; i++) {
+ config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
+ }
+
+ // Check for 24:00:00.000
+ if (config._a[HOUR] === 24 &&
+ config._a[MINUTE] === 0 &&
+ config._a[SECOND] === 0 &&
+ config._a[MILLISECOND] === 0) {
+ config._nextDay = true;
+ config._a[HOUR] = 0;
+ }
+
+ config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
+ // Apply timezone offset from input. The actual utcOffset can be changed
+ // with parseZone.
+ if (config._tzm != null) {
+ config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
+ }
+
+ if (config._nextDay) {
+ config._a[HOUR] = 24;
+ }
+ }
+
+ function dayOfYearFromWeekInfo(config) {
+ var w, weekYear, week, weekday, dow, doy, temp;
+
+ w = config._w;
+ if (w.GG != null || w.W != null || w.E != null) {
+ dow = 1;
+ doy = 4;
+
+ // TODO: We need to take the current isoWeekYear, but that depends on
+ // how we interpret now (local, utc, fixed offset). So create
+ // a now version of current config (take local/utc/offset flags, and
+ // create now).
+ weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year);
+ week = defaults(w.W, 1);
+ weekday = defaults(w.E, 1);
+ } else {
+ dow = config._locale._week.dow;
+ doy = config._locale._week.doy;
+
+ weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year);
+ week = defaults(w.w, 1);
+
+ if (w.d != null) {
+ // weekday -- low day numbers are considered next week
+ weekday = w.d;
+ if (weekday < dow) {
+ ++week;
+ }
+ } else if (w.e != null) {
+ // local weekday -- counting starts from begining of week
+ weekday = w.e + dow;
+ } else {
+ // default to begining of week
+ weekday = dow;
+ }
+ }
+ temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow);
+
+ config._a[YEAR] = temp.year;
+ config._dayOfYear = temp.dayOfYear;
+ }
+
+ utils_hooks__hooks.ISO_8601 = function () {};
+
+ // date from string and format string
+ function configFromStringAndFormat(config) {
+ // TODO: Move this to another part of the creation flow to prevent circular deps
+ if (config._f === utils_hooks__hooks.ISO_8601) {
+ configFromISO(config);
+ return;
+ }
+
+ config._a = [];
+ getParsingFlags(config).empty = true;
+
+ // This array is used to make a Date, either with `new Date` or `Date.UTC`
+ var string = '' + config._i,
+ i, parsedInput, tokens, token, skipped,
+ stringLength = string.length,
+ totalParsedInputLength = 0;
+
+ tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
+
+ for (i = 0; i < tokens.length; i++) {
+ token = tokens[i];
+ parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
+ if (parsedInput) {
+ skipped = string.substr(0, string.indexOf(parsedInput));
+ if (skipped.length > 0) {
+ getParsingFlags(config).unusedInput.push(skipped);
+ }
+ string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
+ totalParsedInputLength += parsedInput.length;
+ }
+ // don't parse if it's not a known token
+ if (formatTokenFunctions[token]) {
+ if (parsedInput) {
+ getParsingFlags(config).empty = false;
+ }
+ else {
+ getParsingFlags(config).unusedTokens.push(token);
+ }
+ addTimeToArrayFromToken(token, parsedInput, config);
+ }
+ else if (config._strict && !parsedInput) {
+ getParsingFlags(config).unusedTokens.push(token);
+ }
+ }
+
+ // add remaining unparsed input length to the string
+ getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
+ if (string.length > 0) {
+ getParsingFlags(config).unusedInput.push(string);
+ }
+
+ // clear _12h flag if hour is <= 12
+ if (getParsingFlags(config).bigHour === true &&
+ config._a[HOUR] <= 12 &&
+ config._a[HOUR] > 0) {
+ getParsingFlags(config).bigHour = undefined;
+ }
+ // handle meridiem
+ config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
+
+ configFromArray(config);
+ checkOverflow(config);
+ }
+
+
+ function meridiemFixWrap (locale, hour, meridiem) {
+ var isPm;
+
+ if (meridiem == null) {
+ // nothing to do
+ return hour;
+ }
+ if (locale.meridiemHour != null) {
+ return locale.meridiemHour(hour, meridiem);
+ } else if (locale.isPM != null) {
+ // Fallback
+ isPm = locale.isPM(meridiem);
+ if (isPm && hour < 12) {
+ hour += 12;
+ }
+ if (!isPm && hour === 12) {
+ hour = 0;
+ }
+ return hour;
+ } else {
+ // this is not supposed to happen
+ return hour;
+ }
+ }
+
+ function configFromStringAndArray(config) {
+ var tempConfig,
+ bestMoment,
+
+ scoreToBeat,
+ i,
+ currentScore;
+
+ if (config._f.length === 0) {
+ getParsingFlags(config).invalidFormat = true;
+ config._d = new Date(NaN);
+ return;
+ }
+
+ for (i = 0; i < config._f.length; i++) {
+ currentScore = 0;
+ tempConfig = copyConfig({}, config);
+ if (config._useUTC != null) {
+ tempConfig._useUTC = config._useUTC;
+ }
+ tempConfig._f = config._f[i];
+ configFromStringAndFormat(tempConfig);
+
+ if (!valid__isValid(tempConfig)) {
+ continue;
+ }
+
+ // if there is any input that was not parsed add a penalty for that format
+ currentScore += getParsingFlags(tempConfig).charsLeftOver;
+
+ //or tokens
+ currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
+
+ getParsingFlags(tempConfig).score = currentScore;
+
+ if (scoreToBeat == null || currentScore < scoreToBeat) {
+ scoreToBeat = currentScore;
+ bestMoment = tempConfig;
+ }
+ }
+
+ extend(config, bestMoment || tempConfig);
+ }
+
+ function configFromObject(config) {
+ if (config._d) {
+ return;
+ }
+
+ var i = normalizeObjectUnits(config._i);
+ config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond];
+
+ configFromArray(config);
+ }
+
+ function createFromConfig (config) {
+ var res = new Moment(checkOverflow(prepareConfig(config)));
+ if (res._nextDay) {
+ // Adding is smart enough around DST
+ res.add(1, 'd');
+ res._nextDay = undefined;
+ }
+
+ return res;
+ }
+
+ function prepareConfig (config) {
+ var input = config._i,
+ format = config._f;
+
+ config._locale = config._locale || locale_locales__getLocale(config._l);
+
+ if (input === null || (format === undefined && input === '')) {
+ return valid__createInvalid({nullInput: true});
+ }
+
+ if (typeof input === 'string') {
+ config._i = input = config._locale.preparse(input);
+ }
+
+ if (isMoment(input)) {
+ return new Moment(checkOverflow(input));
+ } else if (isArray(format)) {
+ configFromStringAndArray(config);
+ } else if (format) {
+ configFromStringAndFormat(config);
+ } else if (isDate(input)) {
+ config._d = input;
+ } else {
+ configFromInput(config);
+ }
+
+ return config;
+ }
+
+ function configFromInput(config) {
+ var input = config._i;
+ if (input === undefined) {
+ config._d = new Date();
+ } else if (isDate(input)) {
+ config._d = new Date(+input);
+ } else if (typeof input === 'string') {
+ configFromString(config);
+ } else if (isArray(input)) {
+ config._a = map(input.slice(0), function (obj) {
+ return parseInt(obj, 10);
+ });
+ configFromArray(config);
+ } else if (typeof(input) === 'object') {
+ configFromObject(config);
+ } else if (typeof(input) === 'number') {
+ // from milliseconds
+ config._d = new Date(input);
+ } else {
+ utils_hooks__hooks.createFromInputFallback(config);
+ }
+ }
+
+ function createLocalOrUTC (input, format, locale, strict, isUTC) {
+ var c = {};
+
+ if (typeof(locale) === 'boolean') {
+ strict = locale;
+ locale = undefined;
+ }
+ // object construction must be done this way.
+ // https://github.com/moment/moment/issues/1423
+ c._isAMomentObject = true;
+ c._useUTC = c._isUTC = isUTC;
+ c._l = locale;
+ c._i = input;
+ c._f = format;
+ c._strict = strict;
+
+ return createFromConfig(c);
+ }
+
+ function local__createLocal (input, format, locale, strict) {
+ return createLocalOrUTC(input, format, locale, strict, false);
+ }
+
+ var prototypeMin = deprecate(
+ 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548',
+ function () {
+ var other = local__createLocal.apply(null, arguments);
+ return other < this ? this : other;
+ }
+ );
+
+ var prototypeMax = deprecate(
+ 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548',
+ function () {
+ var other = local__createLocal.apply(null, arguments);
+ return other > this ? this : other;
+ }
+ );
+
+ // Pick a moment m from moments so that m[fn](other) is true for all
+ // other. This relies on the function fn to be transitive.
+ //
+ // moments should either be an array of moment objects or an array, whose
+ // first element is an array of moment objects.
+ function pickBy(fn, moments) {
+ var res, i;
+ if (moments.length === 1 && isArray(moments[0])) {
+ moments = moments[0];
+ }
+ if (!moments.length) {
+ return local__createLocal();
+ }
+ res = moments[0];
+ for (i = 1; i < moments.length; ++i) {
+ if (!moments[i].isValid() || moments[i][fn](res)) {
+ res = moments[i];
+ }
+ }
+ return res;
+ }
+
+ // TODO: Use [].sort instead?
+ function min () {
+ var args = [].slice.call(arguments, 0);
+
+ return pickBy('isBefore', args);
+ }
+
+ function max () {
+ var args = [].slice.call(arguments, 0);
+
+ return pickBy('isAfter', args);
+ }
+
+ function Duration (duration) {
+ var normalizedInput = normalizeObjectUnits(duration),
+ years = normalizedInput.year || 0,
+ quarters = normalizedInput.quarter || 0,
+ months = normalizedInput.month || 0,
+ weeks = normalizedInput.week || 0,
+ days = normalizedInput.day || 0,
+ hours = normalizedInput.hour || 0,
+ minutes = normalizedInput.minute || 0,
+ seconds = normalizedInput.second || 0,
+ milliseconds = normalizedInput.millisecond || 0;
+
+ // representation for dateAddRemove
+ this._milliseconds = +milliseconds +
+ seconds * 1e3 + // 1000
+ minutes * 6e4 + // 1000 * 60
+ hours * 36e5; // 1000 * 60 * 60
+ // Because of dateAddRemove treats 24 hours as different from a
+ // day when working around DST, we need to store them separately
+ this._days = +days +
+ weeks * 7;
+ // It is impossible translate months into days without knowing
+ // which months you are are talking about, so we have to store
+ // it separately.
+ this._months = +months +
+ quarters * 3 +
+ years * 12;
+
+ this._data = {};
+
+ this._locale = locale_locales__getLocale();
+
+ this._bubble();
+ }
+
+ function isDuration (obj) {
+ return obj instanceof Duration;
+ }
+
+ function offset (token, separator) {
+ addFormatToken(token, 0, 0, function () {
+ var offset = this.utcOffset();
+ var sign = '+';
+ if (offset < 0) {
+ offset = -offset;
+ sign = '-';
+ }
+ return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
+ });
+ }
+
+ offset('Z', ':');
+ offset('ZZ', '');
+
+ // PARSING
+
+ addRegexToken('Z', matchOffset);
+ addRegexToken('ZZ', matchOffset);
+ addParseToken(['Z', 'ZZ'], function (input, array, config) {
+ config._useUTC = true;
+ config._tzm = offsetFromString(input);
+ });
+
+ // HELPERS
+
+ // timezone chunker
+ // '+10:00' > ['10', '00']
+ // '-1530' > ['-15', '30']
+ var chunkOffset = /([\+\-]|\d\d)/gi;
+
+ function offsetFromString(string) {
+ var matches = ((string || '').match(matchOffset) || []);
+ var chunk = matches[matches.length - 1] || [];
+ var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
+ var minutes = +(parts[1] * 60) + toInt(parts[2]);
+
+ return parts[0] === '+' ? minutes : -minutes;
+ }
+
+ // Return a moment from input, that is local/utc/zone equivalent to model.
+ function cloneWithOffset(input, model) {
+ var res, diff;
+ if (model._isUTC) {
+ res = model.clone();
+ diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);
+ // Use low-level api, because this fn is low-level api.
+ res._d.setTime(+res._d + diff);
+ utils_hooks__hooks.updateOffset(res, false);
+ return res;
+ } else {
+ return local__createLocal(input).local();
+ }
+ }
+
+ function getDateOffset (m) {
+ // On Firefox.24 Date#getTimezoneOffset returns a floating point.
+ // https://github.com/moment/moment/pull/1871
+ return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
+ }
+
+ // HOOKS
+
+ // This function will be called whenever a moment is mutated.
+ // It is intended to keep the offset in sync with the timezone.
+ utils_hooks__hooks.updateOffset = function () {};
+
+ // MOMENTS
+
+ // keepLocalTime = true means only change the timezone, without
+ // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
+ // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
+ // +0200, so we adjust the time as needed, to be valid.
+ //
+ // Keeping the time actually adds/subtracts (one hour)
+ // from the actual represented time. That is why we call updateOffset
+ // a second time. In case it wants us to change the offset again
+ // _changeInProgress == true case, then we have to adjust, because
+ // there is no such time in the given timezone.
+ function getSetOffset (input, keepLocalTime) {
+ var offset = this._offset || 0,
+ localAdjust;
+ if (input != null) {
+ if (typeof input === 'string') {
+ input = offsetFromString(input);
+ }
+ if (Math.abs(input) < 16) {
+ input = input * 60;
+ }
+ if (!this._isUTC && keepLocalTime) {
+ localAdjust = getDateOffset(this);
+ }
+ this._offset = input;
+ this._isUTC = true;
+ if (localAdjust != null) {
+ this.add(localAdjust, 'm');
+ }
+ if (offset !== input) {
+ if (!keepLocalTime || this._changeInProgress) {
+ add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);
+ } else if (!this._changeInProgress) {
+ this._changeInProgress = true;
+ utils_hooks__hooks.updateOffset(this, true);
+ this._changeInProgress = null;
+ }
+ }
+ return this;
+ } else {
+ return this._isUTC ? offset : getDateOffset(this);
+ }
+ }
+
+ function getSetZone (input, keepLocalTime) {
+ if (input != null) {
+ if (typeof input !== 'string') {
+ input = -input;
+ }
+
+ this.utcOffset(input, keepLocalTime);
+
+ return this;
+ } else {
+ return -this.utcOffset();
+ }
+ }
+
+ function setOffsetToUTC (keepLocalTime) {
+ return this.utcOffset(0, keepLocalTime);
+ }
+
+ function setOffsetToLocal (keepLocalTime) {
+ if (this._isUTC) {
+ this.utcOffset(0, keepLocalTime);
+ this._isUTC = false;
+
+ if (keepLocalTime) {
+ this.subtract(getDateOffset(this), 'm');
+ }
+ }
+ return this;
+ }
+
+ function setOffsetToParsedOffset () {
+ if (this._tzm) {
+ this.utcOffset(this._tzm);
+ } else if (typeof this._i === 'string') {
+ this.utcOffset(offsetFromString(this._i));
+ }
+ return this;
+ }
+
+ function hasAlignedHourOffset (input) {
+ input = input ? local__createLocal(input).utcOffset() : 0;
+
+ return (this.utcOffset() - input) % 60 === 0;
+ }
+
+ function isDaylightSavingTime () {
+ return (
+ this.utcOffset() > this.clone().month(0).utcOffset() ||
+ this.utcOffset() > this.clone().month(5).utcOffset()
+ );
+ }
+
+ function isDaylightSavingTimeShifted () {
+ if (typeof this._isDSTShifted !== 'undefined') {
+ return this._isDSTShifted;
+ }
+
+ var c = {};
+
+ copyConfig(c, this);
+ c = prepareConfig(c);
+
+ if (c._a) {
+ var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a);
+ this._isDSTShifted = this.isValid() &&
+ compareArrays(c._a, other.toArray()) > 0;
+ } else {
+ this._isDSTShifted = false;
+ }
+
+ return this._isDSTShifted;
+ }
+
+ function isLocal () {
+ return !this._isUTC;
+ }
+
+ function isUtcOffset () {
+ return this._isUTC;
+ }
+
+ function isUtc () {
+ return this._isUTC && this._offset === 0;
+ }
+
+ var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/;
+
+ // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
+ // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
+ var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;
+
+ function create__createDuration (input, key) {
+ var duration = input,
+ // matching against regexp is expensive, do it on demand
+ match = null,
+ sign,
+ ret,
+ diffRes;
+
+ if (isDuration(input)) {
+ duration = {
+ ms : input._milliseconds,
+ d : input._days,
+ M : input._months
+ };
+ } else if (typeof input === 'number') {
+ duration = {};
+ if (key) {
+ duration[key] = input;
+ } else {
+ duration.milliseconds = input;
+ }
+ } else if (!!(match = aspNetRegex.exec(input))) {
+ sign = (match[1] === '-') ? -1 : 1;
+ duration = {
+ y : 0,
+ d : toInt(match[DATE]) * sign,
+ h : toInt(match[HOUR]) * sign,
+ m : toInt(match[MINUTE]) * sign,
+ s : toInt(match[SECOND]) * sign,
+ ms : toInt(match[MILLISECOND]) * sign
+ };
+ } else if (!!(match = create__isoRegex.exec(input))) {
+ sign = (match[1] === '-') ? -1 : 1;
+ duration = {
+ y : parseIso(match[2], sign),
+ M : parseIso(match[3], sign),
+ d : parseIso(match[4], sign),
+ h : parseIso(match[5], sign),
+ m : parseIso(match[6], sign),
+ s : parseIso(match[7], sign),
+ w : parseIso(match[8], sign)
+ };
+ } else if (duration == null) {// checks for null or undefined
+ duration = {};
+ } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
+ diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to));
+
+ duration = {};
+ duration.ms = diffRes.milliseconds;
+ duration.M = diffRes.months;
+ }
+
+ ret = new Duration(duration);
+
+ if (isDuration(input) && hasOwnProp(input, '_locale')) {
+ ret._locale = input._locale;
+ }
+
+ return ret;
+ }
+
+ create__createDuration.fn = Duration.prototype;
+
+ function parseIso (inp, sign) {
+ // We'd normally use ~~inp for this, but unfortunately it also
+ // converts floats to ints.
+ // inp may be undefined, so careful calling replace on it.
+ var res = inp && parseFloat(inp.replace(',', '.'));
+ // apply sign while we're at it
+ return (isNaN(res) ? 0 : res) * sign;
+ }
+
+ function positiveMomentsDifference(base, other) {
+ var res = {milliseconds: 0, months: 0};
+
+ res.months = other.month() - base.month() +
+ (other.year() - base.year()) * 12;
+ if (base.clone().add(res.months, 'M').isAfter(other)) {
+ --res.months;
+ }
+
+ res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
+
+ return res;
+ }
+
+ function momentsDifference(base, other) {
+ var res;
+ other = cloneWithOffset(other, base);
+ if (base.isBefore(other)) {
+ res = positiveMomentsDifference(base, other);
+ } else {
+ res = positiveMomentsDifference(other, base);
+ res.milliseconds = -res.milliseconds;
+ res.months = -res.months;
+ }
+
+ return res;
+ }
+
+ function createAdder(direction, name) {
+ return function (val, period) {
+ var dur, tmp;
+ //invert the arguments, but complain about it
+ if (period !== null && !isNaN(+period)) {
+ deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).');
+ tmp = val; val = period; period = tmp;
+ }
+
+ val = typeof val === 'string' ? +val : val;
+ dur = create__createDuration(val, period);
+ add_subtract__addSubtract(this, dur, direction);
+ return this;
+ };
+ }
+
+ function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) {
+ var milliseconds = duration._milliseconds,
+ days = duration._days,
+ months = duration._months;
+ updateOffset = updateOffset == null ? true : updateOffset;
+
+ if (milliseconds) {
+ mom._d.setTime(+mom._d + milliseconds * isAdding);
+ }
+ if (days) {
+ get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding);
+ }
+ if (months) {
+ setMonth(mom, get_set__get(mom, 'Month') + months * isAdding);
+ }
+ if (updateOffset) {
+ utils_hooks__hooks.updateOffset(mom, days || months);
+ }
+ }
+
+ var add_subtract__add = createAdder(1, 'add');
+ var add_subtract__subtract = createAdder(-1, 'subtract');
+
+ function moment_calendar__calendar (time, formats) {
+ // We want to compare the start of today, vs this.
+ // Getting start-of-today depends on whether we're local/utc/offset or not.
+ var now = time || local__createLocal(),
+ sod = cloneWithOffset(now, this).startOf('day'),
+ diff = this.diff(sod, 'days', true),
+ format = diff < -6 ? 'sameElse' :
+ diff < -1 ? 'lastWeek' :
+ diff < 0 ? 'lastDay' :
+ diff < 1 ? 'sameDay' :
+ diff < 2 ? 'nextDay' :
+ diff < 7 ? 'nextWeek' : 'sameElse';
+ return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now)));
+ }
+
+ function clone () {
+ return new Moment(this);
+ }
+
+ function isAfter (input, units) {
+ var inputMs;
+ units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');
+ if (units === 'millisecond') {
+ input = isMoment(input) ? input : local__createLocal(input);
+ return +this > +input;
+ } else {
+ inputMs = isMoment(input) ? +input : +local__createLocal(input);
+ return inputMs < +this.clone().startOf(units);
+ }
+ }
+
+ function isBefore (input, units) {
+ var inputMs;
+ units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');
+ if (units === 'millisecond') {
+ input = isMoment(input) ? input : local__createLocal(input);
+ return +this < +input;
+ } else {
+ inputMs = isMoment(input) ? +input : +local__createLocal(input);
+ return +this.clone().endOf(units) < inputMs;
+ }
+ }
+
+ function isBetween (from, to, units) {
+ return this.isAfter(from, units) && this.isBefore(to, units);
+ }
+
+ function isSame (input, units) {
+ var inputMs;
+ units = normalizeUnits(units || 'millisecond');
+ if (units === 'millisecond') {
+ input = isMoment(input) ? input : local__createLocal(input);
+ return +this === +input;
+ } else {
+ inputMs = +local__createLocal(input);
+ return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units));
+ }
+ }
+
+ function diff (input, units, asFloat) {
+ var that = cloneWithOffset(input, this),
+ zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4,
+ delta, output;
+
+ units = normalizeUnits(units);
+
+ if (units === 'year' || units === 'month' || units === 'quarter') {
+ output = monthDiff(this, that);
+ if (units === 'quarter') {
+ output = output / 3;
+ } else if (units === 'year') {
+ output = output / 12;
+ }
+ } else {
+ delta = this - that;
+ output = units === 'second' ? delta / 1e3 : // 1000
+ units === 'minute' ? delta / 6e4 : // 1000 * 60
+ units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
+ units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
+ units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
+ delta;
+ }
+ return asFloat ? output : absFloor(output);
+ }
+
+ function monthDiff (a, b) {
+ // difference in months
+ var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
+ // b is in (anchor - 1 month, anchor + 1 month)
+ anchor = a.clone().add(wholeMonthDiff, 'months'),
+ anchor2, adjust;
+
+ if (b - anchor < 0) {
+ anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
+ // linear across the month
+ adjust = (b - anchor) / (anchor - anchor2);
+ } else {
+ anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
+ // linear across the month
+ adjust = (b - anchor) / (anchor2 - anchor);
+ }
+
+ return -(wholeMonthDiff + adjust);
+ }
+
+ utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
+
+ function toString () {
+ return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
+ }
+
+ function moment_format__toISOString () {
+ var m = this.clone().utc();
+ if (0 < m.year() && m.year() <= 9999) {
+ if ('function' === typeof Date.prototype.toISOString) {
+ // native implementation is ~50x faster, use it when we can
+ return this.toDate().toISOString();
+ } else {
+ return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
+ }
+ } else {
+ return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
+ }
+ }
+
+ function format (inputString) {
+ var output = formatMoment(this, inputString || utils_hooks__hooks.defaultFormat);
+ return this.localeData().postformat(output);
+ }
+
+ function from (time, withoutSuffix) {
+ if (!this.isValid()) {
+ return this.localeData().invalidDate();
+ }
+ return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
+ }
+
+ function fromNow (withoutSuffix) {
+ return this.from(local__createLocal(), withoutSuffix);
+ }
+
+ function to (time, withoutSuffix) {
+ if (!this.isValid()) {
+ return this.localeData().invalidDate();
+ }
+ return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
+ }
+
+ function toNow (withoutSuffix) {
+ return this.to(local__createLocal(), withoutSuffix);
+ }
+
+ function locale (key) {
+ var newLocaleData;
+
+ if (key === undefined) {
+ return this._locale._abbr;
+ } else {
+ newLocaleData = locale_locales__getLocale(key);
+ if (newLocaleData != null) {
+ this._locale = newLocaleData;
+ }
+ return this;
+ }
+ }
+
+ var lang = deprecate(
+ 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
+ function (key) {
+ if (key === undefined) {
+ return this.localeData();
+ } else {
+ return this.locale(key);
+ }
+ }
+ );
+
+ function localeData () {
+ return this._locale;
+ }
+
+ function startOf (units) {
+ units = normalizeUnits(units);
+ // the following switch intentionally omits break keywords
+ // to utilize falling through the cases.
+ switch (units) {
+ case 'year':
+ this.month(0);
+ /* falls through */
+ case 'quarter':
+ case 'month':
+ this.date(1);
+ /* falls through */
+ case 'week':
+ case 'isoWeek':
+ case 'day':
+ this.hours(0);
+ /* falls through */
+ case 'hour':
+ this.minutes(0);
+ /* falls through */
+ case 'minute':
+ this.seconds(0);
+ /* falls through */
+ case 'second':
+ this.milliseconds(0);
+ }
+
+ // weeks are a special case
+ if (units === 'week') {
+ this.weekday(0);
+ }
+ if (units === 'isoWeek') {
+ this.isoWeekday(1);
+ }
+
+ // quarters are also special
+ if (units === 'quarter') {
+ this.month(Math.floor(this.month() / 3) * 3);
+ }
+
+ return this;
+ }
+
+ function endOf (units) {
+ units = normalizeUnits(units);
+ if (units === undefined || units === 'millisecond') {
+ return this;
+ }
+ return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
+ }
+
+ function to_type__valueOf () {
+ return +this._d - ((this._offset || 0) * 60000);
+ }
+
+ function unix () {
+ return Math.floor(+this / 1000);
+ }
+
+ function toDate () {
+ return this._offset ? new Date(+this) : this._d;
+ }
+
+ function toArray () {
+ var m = this;
+ return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
+ }
+
+ function toObject () {
+ var m = this;
+ return {
+ years: m.year(),
+ months: m.month(),
+ date: m.date(),
+ hours: m.hours(),
+ minutes: m.minutes(),
+ seconds: m.seconds(),
+ milliseconds: m.milliseconds()
+ };
+ }
+
+ function moment_valid__isValid () {
+ return valid__isValid(this);
+ }
+
+ function parsingFlags () {
+ return extend({}, getParsingFlags(this));
+ }
+
+ function invalidAt () {
+ return getParsingFlags(this).overflow;
+ }
+
+ addFormatToken(0, ['gg', 2], 0, function () {
+ return this.weekYear() % 100;
+ });
+
+ addFormatToken(0, ['GG', 2], 0, function () {
+ return this.isoWeekYear() % 100;
+ });
+
+ function addWeekYearFormatToken (token, getter) {
+ addFormatToken(0, [token, token.length], 0, getter);
+ }
+
+ addWeekYearFormatToken('gggg', 'weekYear');
+ addWeekYearFormatToken('ggggg', 'weekYear');
+ addWeekYearFormatToken('GGGG', 'isoWeekYear');
+ addWeekYearFormatToken('GGGGG', 'isoWeekYear');
+
+ // ALIASES
+
+ addUnitAlias('weekYear', 'gg');
+ addUnitAlias('isoWeekYear', 'GG');
+
+ // PARSING
+
+ addRegexToken('G', matchSigned);
+ addRegexToken('g', matchSigned);
+ addRegexToken('GG', match1to2, match2);
+ addRegexToken('gg', match1to2, match2);
+ addRegexToken('GGGG', match1to4, match4);
+ addRegexToken('gggg', match1to4, match4);
+ addRegexToken('GGGGG', match1to6, match6);
+ addRegexToken('ggggg', match1to6, match6);
+
+ addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
+ week[token.substr(0, 2)] = toInt(input);
+ });
+
+ addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
+ week[token] = utils_hooks__hooks.parseTwoDigitYear(input);
+ });
+
+ // HELPERS
+
+ function weeksInYear(year, dow, doy) {
+ return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week;
+ }
+
+ // MOMENTS
+
+ function getSetWeekYear (input) {
+ var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year;
+ return input == null ? year : this.add((input - year), 'y');
+ }
+
+ function getSetISOWeekYear (input) {
+ var year = weekOfYear(this, 1, 4).year;
+ return input == null ? year : this.add((input - year), 'y');
+ }
+
+ function getISOWeeksInYear () {
+ return weeksInYear(this.year(), 1, 4);
+ }
+
+ function getWeeksInYear () {
+ var weekInfo = this.localeData()._week;
+ return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
+ }
+
+ addFormatToken('Q', 0, 0, 'quarter');
+
+ // ALIASES
+
+ addUnitAlias('quarter', 'Q');
+
+ // PARSING
+
+ addRegexToken('Q', match1);
+ addParseToken('Q', function (input, array) {
+ array[MONTH] = (toInt(input) - 1) * 3;
+ });
+
+ // MOMENTS
+
+ function getSetQuarter (input) {
+ return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
+ }
+
+ addFormatToken('D', ['DD', 2], 'Do', 'date');
+
+ // ALIASES
+
+ addUnitAlias('date', 'D');
+
+ // PARSING
+
+ addRegexToken('D', match1to2);
+ addRegexToken('DD', match1to2, match2);
+ addRegexToken('Do', function (isStrict, locale) {
+ return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
+ });
+
+ addParseToken(['D', 'DD'], DATE);
+ addParseToken('Do', function (input, array) {
+ array[DATE] = toInt(input.match(match1to2)[0], 10);
+ });
+
+ // MOMENTS
+
+ var getSetDayOfMonth = makeGetSet('Date', true);
+
+ addFormatToken('d', 0, 'do', 'day');
+
+ addFormatToken('dd', 0, 0, function (format) {
+ return this.localeData().weekdaysMin(this, format);
+ });
+
+ addFormatToken('ddd', 0, 0, function (format) {
+ return this.localeData().weekdaysShort(this, format);
+ });
+
+ addFormatToken('dddd', 0, 0, function (format) {
+ return this.localeData().weekdays(this, format);
+ });
+
+ addFormatToken('e', 0, 0, 'weekday');
+ addFormatToken('E', 0, 0, 'isoWeekday');
+
+ // ALIASES
+
+ addUnitAlias('day', 'd');
+ addUnitAlias('weekday', 'e');
+ addUnitAlias('isoWeekday', 'E');
+
+ // PARSING
+
+ addRegexToken('d', match1to2);
+ addRegexToken('e', match1to2);
+ addRegexToken('E', match1to2);
+ addRegexToken('dd', matchWord);
+ addRegexToken('ddd', matchWord);
+ addRegexToken('dddd', matchWord);
+
+ addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) {
+ var weekday = config._locale.weekdaysParse(input);
+ // if we didn't get a weekday name, mark the date as invalid
+ if (weekday != null) {
+ week.d = weekday;
+ } else {
+ getParsingFlags(config).invalidWeekday = input;
+ }
+ });
+
+ addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
+ week[token] = toInt(input);
+ });
+
+ // HELPERS
+
+ function parseWeekday(input, locale) {
+ if (typeof input !== 'string') {
+ return input;
+ }
+
+ if (!isNaN(input)) {
+ return parseInt(input, 10);
+ }
+
+ input = locale.weekdaysParse(input);
+ if (typeof input === 'number') {
+ return input;
+ }
+
+ return null;
+ }
+
+ // LOCALES
+
+ var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
+ function localeWeekdays (m) {
+ return this._weekdays[m.day()];
+ }
+
+ var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
+ function localeWeekdaysShort (m) {
+ return this._weekdaysShort[m.day()];
+ }
+
+ var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
+ function localeWeekdaysMin (m) {
+ return this._weekdaysMin[m.day()];
+ }
+
+ function localeWeekdaysParse (weekdayName) {
+ var i, mom, regex;
+
+ this._weekdaysParse = this._weekdaysParse || [];
+
+ for (i = 0; i < 7; i++) {
+ // make the regex if we don't have it already
+ if (!this._weekdaysParse[i]) {
+ mom = local__createLocal([2000, 1]).day(i);
+ regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
+ this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
+ }
+ // test the regex
+ if (this._weekdaysParse[i].test(weekdayName)) {
+ return i;
+ }
+ }
+ }
+
+ // MOMENTS
+
+ function getSetDayOfWeek (input) {
+ var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
+ if (input != null) {
+ input = parseWeekday(input, this.localeData());
+ return this.add(input - day, 'd');
+ } else {
+ return day;
+ }
+ }
+
+ function getSetLocaleDayOfWeek (input) {
+ var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
+ return input == null ? weekday : this.add(input - weekday, 'd');
+ }
+
+ function getSetISODayOfWeek (input) {
+ // behaves the same as moment#day except
+ // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
+ // as a setter, sunday should belong to the previous week.
+ return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7);
+ }
+
+ addFormatToken('H', ['HH', 2], 0, 'hour');
+ addFormatToken('h', ['hh', 2], 0, function () {
+ return this.hours() % 12 || 12;
+ });
+
+ function meridiem (token, lowercase) {
+ addFormatToken(token, 0, 0, function () {
+ return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
+ });
+ }
+
+ meridiem('a', true);
+ meridiem('A', false);
+
+ // ALIASES
+
+ addUnitAlias('hour', 'h');
+
+ // PARSING
+
+ function matchMeridiem (isStrict, locale) {
+ return locale._meridiemParse;
+ }
+
+ addRegexToken('a', matchMeridiem);
+ addRegexToken('A', matchMeridiem);
+ addRegexToken('H', match1to2);
+ addRegexToken('h', match1to2);
+ addRegexToken('HH', match1to2, match2);
+ addRegexToken('hh', match1to2, match2);
+
+ addParseToken(['H', 'HH'], HOUR);
+ addParseToken(['a', 'A'], function (input, array, config) {
+ config._isPm = config._locale.isPM(input);
+ config._meridiem = input;
+ });
+ addParseToken(['h', 'hh'], function (input, array, config) {
+ array[HOUR] = toInt(input);
+ getParsingFlags(config).bigHour = true;
+ });
+
+ // LOCALES
+
+ function localeIsPM (input) {
+ // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
+ // Using charAt should be more compatible.
+ return ((input + '').toLowerCase().charAt(0) === 'p');
+ }
+
+ var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
+ function localeMeridiem (hours, minutes, isLower) {
+ if (hours > 11) {
+ return isLower ? 'pm' : 'PM';
+ } else {
+ return isLower ? 'am' : 'AM';
+ }
+ }
+
+
+ // MOMENTS
+
+ // Setting the hour should keep the time, because the user explicitly
+ // specified which hour he wants. So trying to maintain the same hour (in
+ // a new timezone) makes sense. Adding/subtracting hours does not follow
+ // this rule.
+ var getSetHour = makeGetSet('Hours', true);
+
+ addFormatToken('m', ['mm', 2], 0, 'minute');
+
+ // ALIASES
+
+ addUnitAlias('minute', 'm');
+
+ // PARSING
+
+ addRegexToken('m', match1to2);
+ addRegexToken('mm', match1to2, match2);
+ addParseToken(['m', 'mm'], MINUTE);
+
+ // MOMENTS
+
+ var getSetMinute = makeGetSet('Minutes', false);
+
+ addFormatToken('s', ['ss', 2], 0, 'second');
+
+ // ALIASES
+
+ addUnitAlias('second', 's');
+
+ // PARSING
+
+ addRegexToken('s', match1to2);
+ addRegexToken('ss', match1to2, match2);
+ addParseToken(['s', 'ss'], SECOND);
+
+ // MOMENTS
+
+ var getSetSecond = makeGetSet('Seconds', false);
+
+ addFormatToken('S', 0, 0, function () {
+ return ~~(this.millisecond() / 100);
+ });
+
+ addFormatToken(0, ['SS', 2], 0, function () {
+ return ~~(this.millisecond() / 10);
+ });
+
+ addFormatToken(0, ['SSS', 3], 0, 'millisecond');
+ addFormatToken(0, ['SSSS', 4], 0, function () {
+ return this.millisecond() * 10;
+ });
+ addFormatToken(0, ['SSSSS', 5], 0, function () {
+ return this.millisecond() * 100;
+ });
+ addFormatToken(0, ['SSSSSS', 6], 0, function () {
+ return this.millisecond() * 1000;
+ });
+ addFormatToken(0, ['SSSSSSS', 7], 0, function () {
+ return this.millisecond() * 10000;
+ });
+ addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
+ return this.millisecond() * 100000;
+ });
+ addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
+ return this.millisecond() * 1000000;
+ });
+
+
+ // ALIASES
+
+ addUnitAlias('millisecond', 'ms');
+
+ // PARSING
+
+ addRegexToken('S', match1to3, match1);
+ addRegexToken('SS', match1to3, match2);
+ addRegexToken('SSS', match1to3, match3);
+
+ var token;
+ for (token = 'SSSS'; token.length <= 9; token += 'S') {
+ addRegexToken(token, matchUnsigned);
+ }
+
+ function parseMs(input, array) {
+ array[MILLISECOND] = toInt(('0.' + input) * 1000);
+ }
+
+ for (token = 'S'; token.length <= 9; token += 'S') {
+ addParseToken(token, parseMs);
+ }
+ // MOMENTS
+
+ var getSetMillisecond = makeGetSet('Milliseconds', false);
+
+ addFormatToken('z', 0, 0, 'zoneAbbr');
+ addFormatToken('zz', 0, 0, 'zoneName');
+
+ // MOMENTS
+
+ function getZoneAbbr () {
+ return this._isUTC ? 'UTC' : '';
+ }
+
+ function getZoneName () {
+ return this._isUTC ? 'Coordinated Universal Time' : '';
+ }
+
+ var momentPrototype__proto = Moment.prototype;
+
+ momentPrototype__proto.add = add_subtract__add;
+ momentPrototype__proto.calendar = moment_calendar__calendar;
+ momentPrototype__proto.clone = clone;
+ momentPrototype__proto.diff = diff;
+ momentPrototype__proto.endOf = endOf;
+ momentPrototype__proto.format = format;
+ momentPrototype__proto.from = from;
+ momentPrototype__proto.fromNow = fromNow;
+ momentPrototype__proto.to = to;
+ momentPrototype__proto.toNow = toNow;
+ momentPrototype__proto.get = getSet;
+ momentPrototype__proto.invalidAt = invalidAt;
+ momentPrototype__proto.isAfter = isAfter;
+ momentPrototype__proto.isBefore = isBefore;
+ momentPrototype__proto.isBetween = isBetween;
+ momentPrototype__proto.isSame = isSame;
+ momentPrototype__proto.isValid = moment_valid__isValid;
+ momentPrototype__proto.lang = lang;
+ momentPrototype__proto.locale = locale;
+ momentPrototype__proto.localeData = localeData;
+ momentPrototype__proto.max = prototypeMax;
+ momentPrototype__proto.min = prototypeMin;
+ momentPrototype__proto.parsingFlags = parsingFlags;
+ momentPrototype__proto.set = getSet;
+ momentPrototype__proto.startOf = startOf;
+ momentPrototype__proto.subtract = add_subtract__subtract;
+ momentPrototype__proto.toArray = toArray;
+ momentPrototype__proto.toObject = toObject;
+ momentPrototype__proto.toDate = toDate;
+ momentPrototype__proto.toISOString = moment_format__toISOString;
+ momentPrototype__proto.toJSON = moment_format__toISOString;
+ momentPrototype__proto.toString = toString;
+ momentPrototype__proto.unix = unix;
+ momentPrototype__proto.valueOf = to_type__valueOf;
+
+ // Year
+ momentPrototype__proto.year = getSetYear;
+ momentPrototype__proto.isLeapYear = getIsLeapYear;
+
+ // Week Year
+ momentPrototype__proto.weekYear = getSetWeekYear;
+ momentPrototype__proto.isoWeekYear = getSetISOWeekYear;
+
+ // Quarter
+ momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter;
+
+ // Month
+ momentPrototype__proto.month = getSetMonth;
+ momentPrototype__proto.daysInMonth = getDaysInMonth;
+
+ // Week
+ momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek;
+ momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek;
+ momentPrototype__proto.weeksInYear = getWeeksInYear;
+ momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear;
+
+ // Day
+ momentPrototype__proto.date = getSetDayOfMonth;
+ momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek;
+ momentPrototype__proto.weekday = getSetLocaleDayOfWeek;
+ momentPrototype__proto.isoWeekday = getSetISODayOfWeek;
+ momentPrototype__proto.dayOfYear = getSetDayOfYear;
+
+ // Hour
+ momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour;
+
+ // Minute
+ momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute;
+
+ // Second
+ momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond;
+
+ // Millisecond
+ momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond;
+
+ // Offset
+ momentPrototype__proto.utcOffset = getSetOffset;
+ momentPrototype__proto.utc = setOffsetToUTC;
+ momentPrototype__proto.local = setOffsetToLocal;
+ momentPrototype__proto.parseZone = setOffsetToParsedOffset;
+ momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset;
+ momentPrototype__proto.isDST = isDaylightSavingTime;
+ momentPrototype__proto.isDSTShifted = isDaylightSavingTimeShifted;
+ momentPrototype__proto.isLocal = isLocal;
+ momentPrototype__proto.isUtcOffset = isUtcOffset;
+ momentPrototype__proto.isUtc = isUtc;
+ momentPrototype__proto.isUTC = isUtc;
+
+ // Timezone
+ momentPrototype__proto.zoneAbbr = getZoneAbbr;
+ momentPrototype__proto.zoneName = getZoneName;
+
+ // Deprecations
+ momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
+ momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
+ momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
+ momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone);
+
+ var momentPrototype = momentPrototype__proto;
+
+ function moment__createUnix (input) {
+ return local__createLocal(input * 1000);
+ }
+
+ function moment__createInZone () {
+ return local__createLocal.apply(null, arguments).parseZone();
+ }
+
+ var defaultCalendar = {
+ sameDay : '[Today at] LT',
+ nextDay : '[Tomorrow at] LT',
+ nextWeek : 'dddd [at] LT',
+ lastDay : '[Yesterday at] LT',
+ lastWeek : '[Last] dddd [at] LT',
+ sameElse : 'L'
+ };
+
+ function locale_calendar__calendar (key, mom, now) {
+ var output = this._calendar[key];
+ return typeof output === 'function' ? output.call(mom, now) : output;
+ }
+
+ var defaultLongDateFormat = {
+ LTS : 'h:mm:ss A',
+ LT : 'h:mm A',
+ L : 'MM/DD/YYYY',
+ LL : 'MMMM D, YYYY',
+ LLL : 'MMMM D, YYYY h:mm A',
+ LLLL : 'dddd, MMMM D, YYYY h:mm A'
+ };
+
+ function longDateFormat (key) {
+ var format = this._longDateFormat[key],
+ formatUpper = this._longDateFormat[key.toUpperCase()];
+
+ if (format || !formatUpper) {
+ return format;
+ }
+
+ this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
+ return val.slice(1);
+ });
+
+ return this._longDateFormat[key];
+ }
+
+ var defaultInvalidDate = 'Invalid date';
+
+ function invalidDate () {
+ return this._invalidDate;
+ }
+
+ var defaultOrdinal = '%d';
+ var defaultOrdinalParse = /\d{1,2}/;
+
+ function ordinal (number) {
+ return this._ordinal.replace('%d', number);
+ }
+
+ function preParsePostFormat (string) {
+ return string;
+ }
+
+ var defaultRelativeTime = {
+ future : 'in %s',
+ past : '%s ago',
+ s : 'a few seconds',
+ m : 'a minute',
+ mm : '%d minutes',
+ h : 'an hour',
+ hh : '%d hours',
+ d : 'a day',
+ dd : '%d days',
+ M : 'a month',
+ MM : '%d months',
+ y : 'a year',
+ yy : '%d years'
+ };
+
+ function relative__relativeTime (number, withoutSuffix, string, isFuture) {
+ var output = this._relativeTime[string];
+ return (typeof output === 'function') ?
+ output(number, withoutSuffix, string, isFuture) :
+ output.replace(/%d/i, number);
+ }
+
+ function pastFuture (diff, output) {
+ var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
+ return typeof format === 'function' ? format(output) : format.replace(/%s/i, output);
+ }
+
+ function locale_set__set (config) {
+ var prop, i;
+ for (i in config) {
+ prop = config[i];
+ if (typeof prop === 'function') {
+ this[i] = prop;
+ } else {
+ this['_' + i] = prop;
+ }
+ }
+ // Lenient ordinal parsing accepts just a number in addition to
+ // number + (possibly) stuff coming from _ordinalParseLenient.
+ this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
+ }
+
+ var prototype__proto = Locale.prototype;
+
+ prototype__proto._calendar = defaultCalendar;
+ prototype__proto.calendar = locale_calendar__calendar;
+ prototype__proto._longDateFormat = defaultLongDateFormat;
+ prototype__proto.longDateFormat = longDateFormat;
+ prototype__proto._invalidDate = defaultInvalidDate;
+ prototype__proto.invalidDate = invalidDate;
+ prototype__proto._ordinal = defaultOrdinal;
+ prototype__proto.ordinal = ordinal;
+ prototype__proto._ordinalParse = defaultOrdinalParse;
+ prototype__proto.preparse = preParsePostFormat;
+ prototype__proto.postformat = preParsePostFormat;
+ prototype__proto._relativeTime = defaultRelativeTime;
+ prototype__proto.relativeTime = relative__relativeTime;
+ prototype__proto.pastFuture = pastFuture;
+ prototype__proto.set = locale_set__set;
+
+ // Month
+ prototype__proto.months = localeMonths;
+ prototype__proto._months = defaultLocaleMonths;
+ prototype__proto.monthsShort = localeMonthsShort;
+ prototype__proto._monthsShort = defaultLocaleMonthsShort;
+ prototype__proto.monthsParse = localeMonthsParse;
+
+ // Week
+ prototype__proto.week = localeWeek;
+ prototype__proto._week = defaultLocaleWeek;
+ prototype__proto.firstDayOfYear = localeFirstDayOfYear;
+ prototype__proto.firstDayOfWeek = localeFirstDayOfWeek;
+
+ // Day of Week
+ prototype__proto.weekdays = localeWeekdays;
+ prototype__proto._weekdays = defaultLocaleWeekdays;
+ prototype__proto.weekdaysMin = localeWeekdaysMin;
+ prototype__proto._weekdaysMin = defaultLocaleWeekdaysMin;
+ prototype__proto.weekdaysShort = localeWeekdaysShort;
+ prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort;
+ prototype__proto.weekdaysParse = localeWeekdaysParse;
+
+ // Hours
+ prototype__proto.isPM = localeIsPM;
+ prototype__proto._meridiemParse = defaultLocaleMeridiemParse;
+ prototype__proto.meridiem = localeMeridiem;
+
+ function lists__get (format, index, field, setter) {
+ var locale = locale_locales__getLocale();
+ var utc = create_utc__createUTC().set(setter, index);
+ return locale[field](utc, format);
+ }
+
+ function list (format, index, field, count, setter) {
+ if (typeof format === 'number') {
+ index = format;
+ format = undefined;
+ }
+
+ format = format || '';
+
+ if (index != null) {
+ return lists__get(format, index, field, setter);
+ }
+
+ var i;
+ var out = [];
+ for (i = 0; i < count; i++) {
+ out[i] = lists__get(format, i, field, setter);
+ }
+ return out;
+ }
+
+ function lists__listMonths (format, index) {
+ return list(format, index, 'months', 12, 'month');
+ }
+
+ function lists__listMonthsShort (format, index) {
+ return list(format, index, 'monthsShort', 12, 'month');
+ }
+
+ function lists__listWeekdays (format, index) {
+ return list(format, index, 'weekdays', 7, 'day');
+ }
+
+ function lists__listWeekdaysShort (format, index) {
+ return list(format, index, 'weekdaysShort', 7, 'day');
+ }
+
+ function lists__listWeekdaysMin (format, index) {
+ return list(format, index, 'weekdaysMin', 7, 'day');
+ }
+
+ locale_locales__getSetGlobalLocale('en', {
+ ordinalParse: /\d{1,2}(th|st|nd|rd)/,
+ ordinal : function (number) {
+ var b = number % 10,
+ output = (toInt(number % 100 / 10) === 1) ? 'th' :
+ (b === 1) ? 'st' :
+ (b === 2) ? 'nd' :
+ (b === 3) ? 'rd' : 'th';
+ return number + output;
+ }
+ });
+
+ // Side effect imports
+ utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale);
+ utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale);
+
+ var mathAbs = Math.abs;
+
+ function duration_abs__abs () {
+ var data = this._data;
+
+ this._milliseconds = mathAbs(this._milliseconds);
+ this._days = mathAbs(this._days);
+ this._months = mathAbs(this._months);
+
+ data.milliseconds = mathAbs(data.milliseconds);
+ data.seconds = mathAbs(data.seconds);
+ data.minutes = mathAbs(data.minutes);
+ data.hours = mathAbs(data.hours);
+ data.months = mathAbs(data.months);
+ data.years = mathAbs(data.years);
+
+ return this;
+ }
+
+ function duration_add_subtract__addSubtract (duration, input, value, direction) {
+ var other = create__createDuration(input, value);
+
+ duration._milliseconds += direction * other._milliseconds;
+ duration._days += direction * other._days;
+ duration._months += direction * other._months;
+
+ return duration._bubble();
+ }
+
+ // supports only 2.0-style add(1, 's') or add(duration)
+ function duration_add_subtract__add (input, value) {
+ return duration_add_subtract__addSubtract(this, input, value, 1);
+ }
+
+ // supports only 2.0-style subtract(1, 's') or subtract(duration)
+ function duration_add_subtract__subtract (input, value) {
+ return duration_add_subtract__addSubtract(this, input, value, -1);
+ }
+
+ function absCeil (number) {
+ if (number < 0) {
+ return Math.floor(number);
+ } else {
+ return Math.ceil(number);
+ }
+ }
+
+ function bubble () {
+ var milliseconds = this._milliseconds;
+ var days = this._days;
+ var months = this._months;
+ var data = this._data;
+ var seconds, minutes, hours, years, monthsFromDays;
+
+ // if we have a mix of positive and negative values, bubble down first
+ // check: https://github.com/moment/moment/issues/2166
+ if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
+ (milliseconds <= 0 && days <= 0 && months <= 0))) {
+ milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
+ days = 0;
+ months = 0;
+ }
+
+ // The following code bubbles up values, see the tests for
+ // examples of what that means.
+ data.milliseconds = milliseconds % 1000;
+
+ seconds = absFloor(milliseconds / 1000);
+ data.seconds = seconds % 60;
+
+ minutes = absFloor(seconds / 60);
+ data.minutes = minutes % 60;
+
+ hours = absFloor(minutes / 60);
+ data.hours = hours % 24;
+
+ days += absFloor(hours / 24);
+
+ // convert days to months
+ monthsFromDays = absFloor(daysToMonths(days));
+ months += monthsFromDays;
+ days -= absCeil(monthsToDays(monthsFromDays));
+
+ // 12 months -> 1 year
+ years = absFloor(months / 12);
+ months %= 12;
+
+ data.days = days;
+ data.months = months;
+ data.years = years;
+
+ return this;
+ }
+
+ function daysToMonths (days) {
+ // 400 years have 146097 days (taking into account leap year rules)
+ // 400 years have 12 months === 4800
+ return days * 4800 / 146097;
+ }
+
+ function monthsToDays (months) {
+ // the reverse of daysToMonths
+ return months * 146097 / 4800;
+ }
+
+ function as (units) {
+ var days;
+ var months;
+ var milliseconds = this._milliseconds;
+
+ units = normalizeUnits(units);
+
+ if (units === 'month' || units === 'year') {
+ days = this._days + milliseconds / 864e5;
+ months = this._months + daysToMonths(days);
+ return units === 'month' ? months : months / 12;
+ } else {
+ // handle milliseconds separately because of floating point math errors (issue #1867)
+ days = this._days + Math.round(monthsToDays(this._months));
+ switch (units) {
+ case 'week' : return days / 7 + milliseconds / 6048e5;
+ case 'day' : return days + milliseconds / 864e5;
+ case 'hour' : return days * 24 + milliseconds / 36e5;
+ case 'minute' : return days * 1440 + milliseconds / 6e4;
+ case 'second' : return days * 86400 + milliseconds / 1000;
+ // Math.floor prevents floating point math errors here
+ case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
+ default: throw new Error('Unknown unit ' + units);
+ }
+ }
+ }
+
+ // TODO: Use this.as('ms')?
+ function duration_as__valueOf () {
+ return (
+ this._milliseconds +
+ this._days * 864e5 +
+ (this._months % 12) * 2592e6 +
+ toInt(this._months / 12) * 31536e6
+ );
+ }
+
+ function makeAs (alias) {
+ return function () {
+ return this.as(alias);
+ };
+ }
+
+ var asMilliseconds = makeAs('ms');
+ var asSeconds = makeAs('s');
+ var asMinutes = makeAs('m');
+ var asHours = makeAs('h');
+ var asDays = makeAs('d');
+ var asWeeks = makeAs('w');
+ var asMonths = makeAs('M');
+ var asYears = makeAs('y');
+
+ function duration_get__get (units) {
+ units = normalizeUnits(units);
+ return this[units + 's']();
+ }
+
+ function makeGetter(name) {
+ return function () {
+ return this._data[name];
+ };
+ }
+
+ var milliseconds = makeGetter('milliseconds');
+ var seconds = makeGetter('seconds');
+ var minutes = makeGetter('minutes');
+ var hours = makeGetter('hours');
+ var days = makeGetter('days');
+ var months = makeGetter('months');
+ var years = makeGetter('years');
+
+ function weeks () {
+ return absFloor(this.days() / 7);
+ }
+
+ var round = Math.round;
+ var thresholds = {
+ s: 45, // seconds to minute
+ m: 45, // minutes to hour
+ h: 22, // hours to day
+ d: 26, // days to month
+ M: 11 // months to year
+ };
+
+ // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
+ function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
+ return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
+ }
+
+ function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) {
+ var duration = create__createDuration(posNegDuration).abs();
+ var seconds = round(duration.as('s'));
+ var minutes = round(duration.as('m'));
+ var hours = round(duration.as('h'));
+ var days = round(duration.as('d'));
+ var months = round(duration.as('M'));
+ var years = round(duration.as('y'));
+
+ var a = seconds < thresholds.s && ['s', seconds] ||
+ minutes === 1 && ['m'] ||
+ minutes < thresholds.m && ['mm', minutes] ||
+ hours === 1 && ['h'] ||
+ hours < thresholds.h && ['hh', hours] ||
+ days === 1 && ['d'] ||
+ days < thresholds.d && ['dd', days] ||
+ months === 1 && ['M'] ||
+ months < thresholds.M && ['MM', months] ||
+ years === 1 && ['y'] || ['yy', years];
+
+ a[2] = withoutSuffix;
+ a[3] = +posNegDuration > 0;
+ a[4] = locale;
+ return substituteTimeAgo.apply(null, a);
+ }
+
+ // This function allows you to set a threshold for relative time strings
+ function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {
+ if (thresholds[threshold] === undefined) {
+ return false;
+ }
+ if (limit === undefined) {
+ return thresholds[threshold];
+ }
+ thresholds[threshold] = limit;
+ return true;
+ }
+
+ function humanize (withSuffix) {
+ var locale = this.localeData();
+ var output = duration_humanize__relativeTime(this, !withSuffix, locale);
+
+ if (withSuffix) {
+ output = locale.pastFuture(+this, output);
+ }
+
+ return locale.postformat(output);
+ }
+
+ var iso_string__abs = Math.abs;
+
+ function iso_string__toISOString() {
+ // for ISO strings we do not use the normal bubbling rules:
+ // * milliseconds bubble up until they become hours
+ // * days do not bubble at all
+ // * months bubble up until they become years
+ // This is because there is no context-free conversion between hours and days
+ // (think of clock changes)
+ // and also not between days and months (28-31 days per month)
+ var seconds = iso_string__abs(this._milliseconds) / 1000;
+ var days = iso_string__abs(this._days);
+ var months = iso_string__abs(this._months);
+ var minutes, hours, years;
+
+ // 3600 seconds -> 60 minutes -> 1 hour
+ minutes = absFloor(seconds / 60);
+ hours = absFloor(minutes / 60);
+ seconds %= 60;
+ minutes %= 60;
+
+ // 12 months -> 1 year
+ years = absFloor(months / 12);
+ months %= 12;
+
+
+ // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
+ var Y = years;
+ var M = months;
+ var D = days;
+ var h = hours;
+ var m = minutes;
+ var s = seconds;
+ var total = this.asSeconds();
+
+ if (!total) {
+ // this is the same as C#'s (Noda) and python (isodate)...
+ // but not other JS (goog.date)
+ return 'P0D';
+ }
+
+ return (total < 0 ? '-' : '') +
+ 'P' +
+ (Y ? Y + 'Y' : '') +
+ (M ? M + 'M' : '') +
+ (D ? D + 'D' : '') +
+ ((h || m || s) ? 'T' : '') +
+ (h ? h + 'H' : '') +
+ (m ? m + 'M' : '') +
+ (s ? s + 'S' : '');
+ }
+
+ var duration_prototype__proto = Duration.prototype;
+
+ duration_prototype__proto.abs = duration_abs__abs;
+ duration_prototype__proto.add = duration_add_subtract__add;
+ duration_prototype__proto.subtract = duration_add_subtract__subtract;
+ duration_prototype__proto.as = as;
+ duration_prototype__proto.asMilliseconds = asMilliseconds;
+ duration_prototype__proto.asSeconds = asSeconds;
+ duration_prototype__proto.asMinutes = asMinutes;
+ duration_prototype__proto.asHours = asHours;
+ duration_prototype__proto.asDays = asDays;
+ duration_prototype__proto.asWeeks = asWeeks;
+ duration_prototype__proto.asMonths = asMonths;
+ duration_prototype__proto.asYears = asYears;
+ duration_prototype__proto.valueOf = duration_as__valueOf;
+ duration_prototype__proto._bubble = bubble;
+ duration_prototype__proto.get = duration_get__get;
+ duration_prototype__proto.milliseconds = milliseconds;
+ duration_prototype__proto.seconds = seconds;
+ duration_prototype__proto.minutes = minutes;
+ duration_prototype__proto.hours = hours;
+ duration_prototype__proto.days = days;
+ duration_prototype__proto.weeks = weeks;
+ duration_prototype__proto.months = months;
+ duration_prototype__proto.years = years;
+ duration_prototype__proto.humanize = humanize;
+ duration_prototype__proto.toISOString = iso_string__toISOString;
+ duration_prototype__proto.toString = iso_string__toISOString;
+ duration_prototype__proto.toJSON = iso_string__toISOString;
+ duration_prototype__proto.locale = locale;
+ duration_prototype__proto.localeData = localeData;
+
+ // Deprecations
+ duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString);
+ duration_prototype__proto.lang = lang;
+
+ // Side effect imports
+
+ addFormatToken('X', 0, 0, 'unix');
+ addFormatToken('x', 0, 0, 'valueOf');
+
+ // PARSING
+
+ addRegexToken('x', matchSigned);
+ addRegexToken('X', matchTimestamp);
+ addParseToken('X', function (input, array, config) {
+ config._d = new Date(parseFloat(input, 10) * 1000);
+ });
+ addParseToken('x', function (input, array, config) {
+ config._d = new Date(toInt(input));
+ });
+
+ // Side effect imports
+
+
+ utils_hooks__hooks.version = '2.10.6';
+
+ setHookCallback(local__createLocal);
+
+ utils_hooks__hooks.fn = momentPrototype;
+ utils_hooks__hooks.min = min;
+ utils_hooks__hooks.max = max;
+ utils_hooks__hooks.utc = create_utc__createUTC;
+ utils_hooks__hooks.unix = moment__createUnix;
+ utils_hooks__hooks.months = lists__listMonths;
+ utils_hooks__hooks.isDate = isDate;
+ utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale;
+ utils_hooks__hooks.invalid = valid__createInvalid;
+ utils_hooks__hooks.duration = create__createDuration;
+ utils_hooks__hooks.isMoment = isMoment;
+ utils_hooks__hooks.weekdays = lists__listWeekdays;
+ utils_hooks__hooks.parseZone = moment__createInZone;
+ utils_hooks__hooks.localeData = locale_locales__getLocale;
+ utils_hooks__hooks.isDuration = isDuration;
+ utils_hooks__hooks.monthsShort = lists__listMonthsShort;
+ utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin;
+ utils_hooks__hooks.defineLocale = defineLocale;
+ utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort;
+ utils_hooks__hooks.normalizeUnits = normalizeUnits;
+ utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold;
+
+ var _moment = utils_hooks__hooks;
+
+ return _moment;
+
+}));
\ No newline at end of file
diff --git a/resources/momentjs/moment.min.js b/resources/momentjs/moment.min.js
new file mode 100644
index 00000000..8e6866af
--- /dev/null
+++ b/resources/momentjs/moment.min.js
@@ -0,0 +1,7 @@
+//! moment.js
+//! version : 2.10.6
+//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
+//! license : MIT
+//! momentjs.com
+!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Hc.apply(null,arguments)}function b(a){Hc=a}function c(a){return"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c0)for(c in Jc)d=Jc[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function n(b){m(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),Kc===!1&&(Kc=!0,a.updateOffset(this),Kc=!1)}function o(a){return a instanceof n||null!=a&&null!=a._isAMomentObject}function p(a){return 0>a?Math.ceil(a):Math.floor(a)}function q(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=p(b)),c}function r(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&q(a[d])!==q(b[d]))&&g++;return g+f}function s(){}function t(a){return a?a.toLowerCase().replace("_","-"):a}function u(a){for(var b,c,d,e,f=0;f0;){if(d=v(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&r(e,c,!0)>=b-1)break;b--}f++}return null}function v(a){var b=null;if(!Lc[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Ic._abbr,require("./locale/"+a),w(b)}catch(c){}return Lc[a]}function w(a,b){var c;return a&&(c="undefined"==typeof b?y(a):x(a,b),c&&(Ic=c)),Ic._abbr}function x(a,b){return null!==b?(b.abbr=a,Lc[a]=Lc[a]||new s,Lc[a].set(b),w(a),Lc[a]):(delete Lc[a],null)}function y(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Ic;if(!c(a)){if(b=v(a))return b;a=[a]}return u(a)}function z(a,b){var c=a.toLowerCase();Mc[c]=Mc[c+"s"]=Mc[b]=a}function A(a){return"string"==typeof a?Mc[a]||Mc[a.toLowerCase()]:void 0}function B(a){var b,c,d={};for(c in a)f(a,c)&&(b=A(c),b&&(d[b]=a[c]));return d}function C(b,c){return function(d){return null!=d?(E(this,b,d),a.updateOffset(this,c),this):D(this,b)}}function D(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function E(a,b,c){return a._d["set"+(a._isUTC?"UTC":"")+b](c)}function F(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=A(a),"function"==typeof this[a])return this[a](b);return this}function G(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function H(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(Qc[a]=e),b&&(Qc[b[0]]=function(){return G(e.apply(this,arguments),b[1],b[2])}),c&&(Qc[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function I(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function J(a){var b,c,d=a.match(Nc);for(b=0,c=d.length;c>b;b++)Qc[d[b]]?d[b]=Qc[d[b]]:d[b]=I(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function K(a,b){return a.isValid()?(b=L(b,a.localeData()),Pc[b]=Pc[b]||J(b),Pc[b](a)):a.localeData().invalidDate()}function L(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Oc.lastIndex=0;d>=0&&Oc.test(a);)a=a.replace(Oc,c),Oc.lastIndex=0,d-=1;return a}function M(a){return"function"==typeof a&&"[object Function]"===Object.prototype.toString.call(a)}function N(a,b,c){dd[a]=M(b)?b:function(a){return a&&c?c:b}}function O(a,b){return f(dd,a)?dd[a](b._strict,b._locale):new RegExp(P(a))}function P(a){return a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Q(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=q(a)}),c=0;cd;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function X(a,b){var c;return"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),T(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function Y(b){return null!=b?(X(this,b),a.updateOffset(this,!0),this):D(this,"Month")}function Z(){return T(this.year(),this.month())}function $(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[gd]<0||c[gd]>11?gd:c[hd]<1||c[hd]>T(c[fd],c[gd])?hd:c[id]<0||c[id]>24||24===c[id]&&(0!==c[jd]||0!==c[kd]||0!==c[ld])?id:c[jd]<0||c[jd]>59?jd:c[kd]<0||c[kd]>59?kd:c[ld]<0||c[ld]>999?ld:-1,j(a)._overflowDayOfYear&&(fd>b||b>hd)&&(b=hd),j(a).overflow=b),a}function _(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function aa(a,b){var c=!0;return g(function(){return c&&(_(a+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function ba(a,b){od[a]||(_(b),od[a]=!0)}function ca(a){var b,c,d=a._i,e=pd.exec(d);if(e){for(j(a).iso=!0,b=0,c=qd.length;c>b;b++)if(qd[b][1].exec(d)){a._f=qd[b][0];break}for(b=0,c=rd.length;c>b;b++)if(rd[b][1].exec(d)){a._f+=(e[6]||" ")+rd[b][0];break}d.match(ad)&&(a._f+="Z"),va(a)}else a._isValid=!1}function da(b){var c=sd.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ca(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function ea(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function fa(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function ga(a){return ha(a)?366:365}function ha(a){return a%4===0&&a%100!==0||a%400===0}function ia(){return ha(this.year())}function ja(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=Da(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function ka(a){return ja(a,this._week.dow,this._week.doy).week}function la(){return this._week.dow}function ma(){return this._week.doy}function na(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function oa(a){var b=ja(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function pa(a,b,c,d,e){var f,g=6+e-d,h=fa(a,0,1+g),i=h.getUTCDay();return e>i&&(i+=7),c=null!=c?1*c:e,f=1+g+7*(b-1)-i+c,{year:f>0?a:a-1,dayOfYear:f>0?f:ga(a-1)+f}}function qa(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function ra(a,b,c){return null!=a?a:null!=b?b:c}function sa(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function ta(a){var b,c,d,e,f=[];if(!a._d){for(d=sa(a),a._w&&null==a._a[hd]&&null==a._a[gd]&&ua(a),a._dayOfYear&&(e=ra(a._a[fd],d[fd]),a._dayOfYear>ga(e)&&(j(a)._overflowDayOfYear=!0),c=fa(e,0,a._dayOfYear),a._a[gd]=c.getUTCMonth(),a._a[hd]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[id]&&0===a._a[jd]&&0===a._a[kd]&&0===a._a[ld]&&(a._nextDay=!0,a._a[id]=0),a._d=(a._useUTC?fa:ea).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[id]=24)}}function ua(a){var b,c,d,e,f,g,h;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=ra(b.GG,a._a[fd],ja(Da(),1,4).year),d=ra(b.W,1),e=ra(b.E,1)):(f=a._locale._week.dow,g=a._locale._week.doy,c=ra(b.gg,a._a[fd],ja(Da(),f,g).year),d=ra(b.w,1),null!=b.d?(e=b.d,f>e&&++d):e=null!=b.e?b.e+f:f),h=pa(c,d,e,g,f),a._a[fd]=h.year,a._dayOfYear=h.dayOfYear}function va(b){if(b._f===a.ISO_8601)return void ca(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=L(b._f,b._locale).match(Nc)||[],c=0;c0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),Qc[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),S(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[id]<=12&&b._a[id]>0&&(j(b).bigHour=void 0),b._a[id]=wa(b._locale,b._a[id],b._meridiem),ta(b),$(b)}function wa(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function xa(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;ef)&&(d=f,c=b));g(a,c||b)}function ya(a){if(!a._d){var b=B(a._i);a._a=[b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],ta(a)}}function za(a){var b=new n($(Aa(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Aa(a){var b=a._i,e=a._f;return a._locale=a._locale||y(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),o(b)?new n($(b)):(c(e)?xa(a):e?va(a):d(b)?a._d=b:Ba(a),a))}function Ba(b){var f=b._i;void 0===f?b._d=new Date:d(f)?b._d=new Date(+f):"string"==typeof f?da(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ta(b)):"object"==typeof f?ya(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Ca(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,za(f)}function Da(a,b,c,d){return Ca(a,b,c,d,!1)}function Ea(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Da();for(d=b[0],e=1;ea&&(a=-a,c="-"),c+G(~~(a/60),2)+b+G(~~a%60,2)})}function Ka(a){var b=(a||"").match(ad)||[],c=b[b.length-1]||[],d=(c+"").match(xd)||["-",0,0],e=+(60*d[1])+q(d[2]);return"+"===d[0]?e:-e}function La(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(o(b)||d(b)?+b:+Da(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Da(b).local()}function Ma(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Na(b,c){var d,e=this._offset||0;return null!=b?("string"==typeof b&&(b=Ka(b)),Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Ma(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?bb(this,Ya(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Ma(this)}function Oa(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Pa(a){return this.utcOffset(0,a)}function Qa(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Ma(this),"m")),this}function Ra(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ka(this._i)),this}function Sa(a){return a=a?Da(a).utcOffset():0,(this.utcOffset()-a)%60===0}function Ta(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ua(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var a={};if(m(a,this),a=Aa(a),a._a){var b=a._isUTC?h(a._a):Da(a._a);this._isDSTShifted=this.isValid()&&r(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Va(){return!this._isUTC}function Wa(){return this._isUTC}function Xa(){return this._isUTC&&0===this._offset}function Ya(a,b){var c,d,e,g=a,h=null;return Ia(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=yd.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:q(h[hd])*c,h:q(h[id])*c,m:q(h[jd])*c,s:q(h[kd])*c,ms:q(h[ld])*c}):(h=zd.exec(a))?(c="-"===h[1]?-1:1,g={y:Za(h[2],c),M:Za(h[3],c),d:Za(h[4],c),h:Za(h[5],c),m:Za(h[6],c),s:Za(h[7],c),w:Za(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=_a(Da(g.from),Da(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ha(g),Ia(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function Za(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function $a(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function _a(a,b){var c;return b=La(b,a),a.isBefore(b)?c=$a(a,b):(c=$a(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c}function ab(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(ba(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Ya(c,d),bb(this,e,a),this}}function bb(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&E(b,"Date",D(b,"Date")+g*d),h&&X(b,D(b,"Month")+h*d),e&&a.updateOffset(b,g||h)}function cb(a,b){var c=a||Da(),d=La(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse";return this.format(b&&b[f]||this.localeData().calendar(f,this,Da(c)))}function db(){return new n(this)}function eb(a,b){var c;return b=A("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+this>+a):(c=o(a)?+a:+Da(a),c<+this.clone().startOf(b))}function fb(a,b){var c;return b=A("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+a>+this):(c=o(a)?+a:+Da(a),+this.clone().endOf(b)b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function kb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function lb(){var a=this.clone().utc();return 0b;b++)if(this._weekdaysParse[b]||(c=Da([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b}function Pb(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Kb(a,this.localeData()),this.add(a-b,"d")):b}function Qb(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function Rb(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)}function Sb(a,b){H(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function Tb(a,b){return b._meridiemParse}function Ub(a){return"p"===(a+"").toLowerCase().charAt(0)}function Vb(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function Wb(a,b){b[ld]=q(1e3*("0."+a))}function Xb(){return this._isUTC?"UTC":""}function Yb(){return this._isUTC?"Coordinated Universal Time":""}function Zb(a){return Da(1e3*a)}function $b(){return Da.apply(null,arguments).parseZone()}function _b(a,b,c){var d=this._calendar[a];return"function"==typeof d?d.call(b,c):d}function ac(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function bc(){return this._invalidDate}function cc(a){return this._ordinal.replace("%d",a)}function dc(a){return a}function ec(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)}function fc(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)}function gc(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function hc(a,b,c,d){var e=y(),f=h().set(d,b);return e[c](f,a)}function ic(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return hc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=hc(a,f,c,e);return g}function jc(a,b){return ic(a,b,"months",12,"month")}function kc(a,b){return ic(a,b,"monthsShort",12,"month")}function lc(a,b){return ic(a,b,"weekdays",7,"day")}function mc(a,b){return ic(a,b,"weekdaysShort",7,"day")}function nc(a,b){return ic(a,b,"weekdaysMin",7,"day")}function oc(){var a=this._data;return this._milliseconds=Wd(this._milliseconds),this._days=Wd(this._days),this._months=Wd(this._months),a.milliseconds=Wd(a.milliseconds),a.seconds=Wd(a.seconds),a.minutes=Wd(a.minutes),a.hours=Wd(a.hours),a.months=Wd(a.months),a.years=Wd(a.years),this}function pc(a,b,c,d){var e=Ya(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function qc(a,b){return pc(this,a,b,1)}function rc(a,b){return pc(this,a,b,-1)}function sc(a){return 0>a?Math.floor(a):Math.ceil(a)}function tc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*sc(vc(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=p(f/1e3),i.seconds=a%60,b=p(a/60),i.minutes=b%60,c=p(b/60),i.hours=c%24,g+=p(c/24),e=p(uc(g)),h+=e,g-=sc(vc(e)),d=p(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function uc(a){return 4800*a/146097}function vc(a){return 146097*a/4800}function wc(a){var b,c,d=this._milliseconds;if(a=A(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+uc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(vc(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function xc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*q(this._months/12)}function yc(a){return function(){return this.as(a)}}function zc(a){return a=A(a),this[a+"s"]()}function Ac(a){return function(){return this._data[a]}}function Bc(){return p(this.days()/7)}function Cc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Dc(a,b,c){var d=Ya(a).abs(),e=ke(d.as("s")),f=ke(d.as("m")),g=ke(d.as("h")),h=ke(d.as("d")),i=ke(d.as("M")),j=ke(d.as("y")),k=e0,k[4]=c,Cc.apply(null,k)}function Ec(a,b){return void 0===le[a]?!1:void 0===b?le[a]:(le[a]=b,!0)}function Fc(a){var b=this.localeData(),c=Dc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Gc(){var a,b,c,d=me(this._milliseconds)/1e3,e=me(this._days),f=me(this._months);a=p(d/60),b=p(a/60),d%=60,a%=60,c=p(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var Hc,Ic,Jc=a.momentProperties=[],Kc=!1,Lc={},Mc={},Nc=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Oc=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Pc={},Qc={},Rc=/\d/,Sc=/\d\d/,Tc=/\d{3}/,Uc=/\d{4}/,Vc=/[+-]?\d{6}/,Wc=/\d\d?/,Xc=/\d{1,3}/,Yc=/\d{1,4}/,Zc=/[+-]?\d{1,6}/,$c=/\d+/,_c=/[+-]?\d+/,ad=/Z|[+-]\d\d:?\d\d/gi,bd=/[+-]?\d+(\.\d{1,3})?/,cd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,dd={},ed={},fd=0,gd=1,hd=2,id=3,jd=4,kd=5,ld=6;H("M",["MM",2],"Mo",function(){return this.month()+1}),H("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),H("MMMM",0,0,function(a){return this.localeData().months(this,a)}),z("month","M"),N("M",Wc),N("MM",Wc,Sc),N("MMM",cd),N("MMMM",cd),Q(["M","MM"],function(a,b){b[gd]=q(a)-1}),Q(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[gd]=e:j(c).invalidMonth=a});var md="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),nd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),od={};a.suppressDeprecationWarnings=!1;var pd=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,qd=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],rd=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],sd=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=aa("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),H(0,["YY",2],0,function(){return this.year()%100}),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),z("year","y"),N("Y",_c),N("YY",Wc,Sc),N("YYYY",Yc,Uc),N("YYYYY",Zc,Vc),N("YYYYYY",Zc,Vc),Q(["YYYYY","YYYYYY"],fd),Q("YYYY",function(b,c){c[fd]=2===b.length?a.parseTwoDigitYear(b):q(b)}),Q("YY",function(b,c){c[fd]=a.parseTwoDigitYear(b)}),a.parseTwoDigitYear=function(a){return q(a)+(q(a)>68?1900:2e3)};var td=C("FullYear",!1);H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),z("week","w"),z("isoWeek","W"),N("w",Wc),N("ww",Wc,Sc),N("W",Wc),N("WW",Wc,Sc),R(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=q(a)});var ud={dow:0,doy:6};H("DDD",["DDDD",3],"DDDo","dayOfYear"),z("dayOfYear","DDD"),N("DDD",Xc),N("DDDD",Tc),Q(["DDD","DDDD"],function(a,b,c){c._dayOfYear=q(a)}),a.ISO_8601=function(){};var vd=aa("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Da.apply(null,arguments);return this>a?this:a}),wd=aa("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Da.apply(null,arguments);return a>this?this:a});Ja("Z",":"),Ja("ZZ",""),N("Z",ad),N("ZZ",ad),Q(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ka(a)});var xd=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var yd=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,zd=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Ya.fn=Ha.prototype;var Ad=ab(1,"add"),Bd=ab(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Cd=aa("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Db("gggg","weekYear"),Db("ggggg","weekYear"),Db("GGGG","isoWeekYear"),Db("GGGGG","isoWeekYear"),z("weekYear","gg"),z("isoWeekYear","GG"),N("G",_c),N("g",_c),N("GG",Wc,Sc),N("gg",Wc,Sc),N("GGGG",Yc,Uc),N("gggg",Yc,Uc),N("GGGGG",Zc,Vc),N("ggggg",Zc,Vc),R(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=q(a)}),R(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),H("Q",0,0,"quarter"),z("quarter","Q"),N("Q",Rc),Q("Q",function(a,b){b[gd]=3*(q(a)-1)}),H("D",["DD",2],"Do","date"),z("date","D"),N("D",Wc),N("DD",Wc,Sc),N("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),Q(["D","DD"],hd),Q("Do",function(a,b){b[hd]=q(a.match(Wc)[0],10)});var Dd=C("Date",!0);H("d",0,"do","day"),H("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),H("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),H("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),z("day","d"),z("weekday","e"),z("isoWeekday","E"),N("d",Wc),N("e",Wc),N("E",Wc),N("dd",cd),N("ddd",cd),N("dddd",cd),R(["dd","ddd","dddd"],function(a,b,c){var d=c._locale.weekdaysParse(a);null!=d?b.d=d:j(c).invalidWeekday=a}),R(["d","e","E"],function(a,b,c,d){b[d]=q(a)});var Ed="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Fd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Gd="Su_Mo_Tu_We_Th_Fr_Sa".split("_");H("H",["HH",2],0,"hour"),H("h",["hh",2],0,function(){return this.hours()%12||12}),Sb("a",!0),Sb("A",!1),z("hour","h"),N("a",Tb),N("A",Tb),N("H",Wc),N("h",Wc),N("HH",Wc,Sc),N("hh",Wc,Sc),Q(["H","HH"],id),Q(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),Q(["h","hh"],function(a,b,c){b[id]=q(a),j(c).bigHour=!0});var Hd=/[ap]\.?m?\.?/i,Id=C("Hours",!0);H("m",["mm",2],0,"minute"),z("minute","m"),N("m",Wc),N("mm",Wc,Sc),Q(["m","mm"],jd);var Jd=C("Minutes",!1);H("s",["ss",2],0,"second"),z("second","s"),N("s",Wc),N("ss",Wc,Sc),Q(["s","ss"],kd);var Kd=C("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return 10*this.millisecond()}),H(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),H(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),H(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),H(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),H(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),z("millisecond","ms"),N("S",Xc,Rc),N("SS",Xc,Sc),N("SSS",Xc,Tc);var Ld;for(Ld="SSSS";Ld.length<=9;Ld+="S")N(Ld,$c);for(Ld="S";Ld.length<=9;Ld+="S")Q(Ld,Wb);var Md=C("Milliseconds",!1);H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var Nd=n.prototype;Nd.add=Ad,Nd.calendar=cb,Nd.clone=db,Nd.diff=ib,Nd.endOf=ub,Nd.format=mb,Nd.from=nb,Nd.fromNow=ob,Nd.to=pb,Nd.toNow=qb,Nd.get=F,Nd.invalidAt=Cb,Nd.isAfter=eb,Nd.isBefore=fb,Nd.isBetween=gb,Nd.isSame=hb,Nd.isValid=Ab,Nd.lang=Cd,Nd.locale=rb,Nd.localeData=sb,Nd.max=wd,Nd.min=vd,Nd.parsingFlags=Bb,Nd.set=F,Nd.startOf=tb,Nd.subtract=Bd,Nd.toArray=yb,Nd.toObject=zb,Nd.toDate=xb,Nd.toISOString=lb,Nd.toJSON=lb,Nd.toString=kb,Nd.unix=wb,Nd.valueOf=vb,Nd.year=td,Nd.isLeapYear=ia,Nd.weekYear=Fb,Nd.isoWeekYear=Gb,Nd.quarter=Nd.quarters=Jb,Nd.month=Y,Nd.daysInMonth=Z,Nd.week=Nd.weeks=na,Nd.isoWeek=Nd.isoWeeks=oa,Nd.weeksInYear=Ib,Nd.isoWeeksInYear=Hb,Nd.date=Dd,Nd.day=Nd.days=Pb,Nd.weekday=Qb,Nd.isoWeekday=Rb,Nd.dayOfYear=qa,Nd.hour=Nd.hours=Id,Nd.minute=Nd.minutes=Jd,Nd.second=Nd.seconds=Kd,
+Nd.millisecond=Nd.milliseconds=Md,Nd.utcOffset=Na,Nd.utc=Pa,Nd.local=Qa,Nd.parseZone=Ra,Nd.hasAlignedHourOffset=Sa,Nd.isDST=Ta,Nd.isDSTShifted=Ua,Nd.isLocal=Va,Nd.isUtcOffset=Wa,Nd.isUtc=Xa,Nd.isUTC=Xa,Nd.zoneAbbr=Xb,Nd.zoneName=Yb,Nd.dates=aa("dates accessor is deprecated. Use date instead.",Dd),Nd.months=aa("months accessor is deprecated. Use month instead",Y),Nd.years=aa("years accessor is deprecated. Use year instead",td),Nd.zone=aa("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Oa);var Od=Nd,Pd={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Qd={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Rd="Invalid date",Sd="%d",Td=/\d{1,2}/,Ud={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Vd=s.prototype;Vd._calendar=Pd,Vd.calendar=_b,Vd._longDateFormat=Qd,Vd.longDateFormat=ac,Vd._invalidDate=Rd,Vd.invalidDate=bc,Vd._ordinal=Sd,Vd.ordinal=cc,Vd._ordinalParse=Td,Vd.preparse=dc,Vd.postformat=dc,Vd._relativeTime=Ud,Vd.relativeTime=ec,Vd.pastFuture=fc,Vd.set=gc,Vd.months=U,Vd._months=md,Vd.monthsShort=V,Vd._monthsShort=nd,Vd.monthsParse=W,Vd.week=ka,Vd._week=ud,Vd.firstDayOfYear=ma,Vd.firstDayOfWeek=la,Vd.weekdays=Lb,Vd._weekdays=Ed,Vd.weekdaysMin=Nb,Vd._weekdaysMin=Gd,Vd.weekdaysShort=Mb,Vd._weekdaysShort=Fd,Vd.weekdaysParse=Ob,Vd.isPM=Ub,Vd._meridiemParse=Hd,Vd.meridiem=Vb,w("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===q(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=aa("moment.lang is deprecated. Use moment.locale instead.",w),a.langData=aa("moment.langData is deprecated. Use moment.localeData instead.",y);var Wd=Math.abs,Xd=yc("ms"),Yd=yc("s"),Zd=yc("m"),$d=yc("h"),_d=yc("d"),ae=yc("w"),be=yc("M"),ce=yc("y"),de=Ac("milliseconds"),ee=Ac("seconds"),fe=Ac("minutes"),ge=Ac("hours"),he=Ac("days"),ie=Ac("months"),je=Ac("years"),ke=Math.round,le={s:45,m:45,h:22,d:26,M:11},me=Math.abs,ne=Ha.prototype;ne.abs=oc,ne.add=qc,ne.subtract=rc,ne.as=wc,ne.asMilliseconds=Xd,ne.asSeconds=Yd,ne.asMinutes=Zd,ne.asHours=$d,ne.asDays=_d,ne.asWeeks=ae,ne.asMonths=be,ne.asYears=ce,ne.valueOf=xc,ne._bubble=tc,ne.get=zc,ne.milliseconds=de,ne.seconds=ee,ne.minutes=fe,ne.hours=ge,ne.days=he,ne.weeks=Bc,ne.months=ie,ne.years=je,ne.humanize=Fc,ne.toISOString=Gc,ne.toString=Gc,ne.toJSON=Gc,ne.locale=rb,ne.localeData=sb,ne.toIsoString=aa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Gc),ne.lang=Cd,H("X",0,0,"unix"),H("x",0,0,"valueOf"),N("x",_c),N("X",bd),Q("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),Q("x",function(a,b,c){c._d=new Date(q(a))}),a.version="2.10.6",b(Da),a.fn=Od,a.min=Fa,a.max=Ga,a.utc=h,a.unix=Zb,a.months=jc,a.isDate=d,a.locale=w,a.invalid=l,a.duration=Ya,a.isMoment=o,a.weekdays=lc,a.parseZone=$b,a.localeData=y,a.isDuration=Ia,a.monthsShort=kc,a.weekdaysMin=nc,a.defineLocale=x,a.weekdaysShort=mc,a.normalizeUnits=A,a.relativeTimeThreshold=Ec;var oe=a;return oe});
\ No newline at end of file
diff --git a/resources/visjs/img/network/acceptDeleteIcon.png b/resources/visjs/img/network/acceptDeleteIcon.png
new file mode 100644
index 00000000..02a06285
Binary files /dev/null and b/resources/visjs/img/network/acceptDeleteIcon.png differ
diff --git a/resources/visjs/img/network/addNodeIcon.png b/resources/visjs/img/network/addNodeIcon.png
new file mode 100644
index 00000000..6fa30613
Binary files /dev/null and b/resources/visjs/img/network/addNodeIcon.png differ
diff --git a/resources/visjs/img/network/backIcon.png b/resources/visjs/img/network/backIcon.png
new file mode 100644
index 00000000..e2f99126
Binary files /dev/null and b/resources/visjs/img/network/backIcon.png differ
diff --git a/resources/visjs/img/network/connectIcon.png b/resources/visjs/img/network/connectIcon.png
new file mode 100644
index 00000000..4164da1f
Binary files /dev/null and b/resources/visjs/img/network/connectIcon.png differ
diff --git a/resources/visjs/img/network/cross.png b/resources/visjs/img/network/cross.png
new file mode 100644
index 00000000..9cbd189a
Binary files /dev/null and b/resources/visjs/img/network/cross.png differ
diff --git a/resources/visjs/img/network/cross2.png b/resources/visjs/img/network/cross2.png
new file mode 100644
index 00000000..9fc4b95c
Binary files /dev/null and b/resources/visjs/img/network/cross2.png differ
diff --git a/resources/visjs/img/network/deleteIcon.png b/resources/visjs/img/network/deleteIcon.png
new file mode 100644
index 00000000..54025647
Binary files /dev/null and b/resources/visjs/img/network/deleteIcon.png differ
diff --git a/resources/visjs/img/network/downArrow.png b/resources/visjs/img/network/downArrow.png
new file mode 100644
index 00000000..e77d5e6d
Binary files /dev/null and b/resources/visjs/img/network/downArrow.png differ
diff --git a/resources/visjs/img/network/editIcon.png b/resources/visjs/img/network/editIcon.png
new file mode 100644
index 00000000..494d0f00
Binary files /dev/null and b/resources/visjs/img/network/editIcon.png differ
diff --git a/resources/visjs/img/network/leftArrow.png b/resources/visjs/img/network/leftArrow.png
new file mode 100644
index 00000000..3823536e
Binary files /dev/null and b/resources/visjs/img/network/leftArrow.png differ
diff --git a/resources/visjs/img/network/minus.png b/resources/visjs/img/network/minus.png
new file mode 100644
index 00000000..30698076
Binary files /dev/null and b/resources/visjs/img/network/minus.png differ
diff --git a/resources/visjs/img/network/plus.png b/resources/visjs/img/network/plus.png
new file mode 100644
index 00000000..f7ab2a33
Binary files /dev/null and b/resources/visjs/img/network/plus.png differ
diff --git a/resources/visjs/img/network/rightArrow.png b/resources/visjs/img/network/rightArrow.png
new file mode 100644
index 00000000..c3a209d8
Binary files /dev/null and b/resources/visjs/img/network/rightArrow.png differ
diff --git a/resources/visjs/img/network/upArrow.png b/resources/visjs/img/network/upArrow.png
new file mode 100644
index 00000000..8aedced7
Binary files /dev/null and b/resources/visjs/img/network/upArrow.png differ
diff --git a/resources/visjs/img/network/zoomExtends.png b/resources/visjs/img/network/zoomExtends.png
new file mode 100644
index 00000000..74595c63
Binary files /dev/null and b/resources/visjs/img/network/zoomExtends.png differ
diff --git a/resources/visjs/img/timeline/delete.png b/resources/visjs/img/timeline/delete.png
new file mode 100644
index 00000000..d54d0e06
Binary files /dev/null and b/resources/visjs/img/timeline/delete.png differ
diff --git a/resources/visjs/vis.css b/resources/visjs/vis.css
new file mode 100644
index 00000000..23cd790f
--- /dev/null
+++ b/resources/visjs/vis.css
@@ -0,0 +1,1295 @@
+.vis .overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+
+ /* Must be displayed above for example selected Timeline items */
+ z-index: 10;
+}
+
+.vis-active {
+ box-shadow: 0 0 10px #86d5f8;
+}
+
+/* override some bootstrap styles screwing up the timelines css */
+
+.vis [class*="span"] {
+ min-height: 0;
+ width: auto;
+}
+
+div.vis-configuration {
+ position:relative;
+ display:block;
+ float:left;
+ font-size:12px;
+}
+
+div.vis-configuration-wrapper {
+ display:block;
+ width:700px;
+}
+
+
+div.vis-configuration.vis-config-option-container{
+ display:block;
+ width:495px;
+ background-color: #ffffff;
+ border:2px solid #f7f8fa;
+ border-radius:4px;
+ margin-top:20px;
+ left:10px;
+ padding-left:5px;
+}
+
+div.vis-configuration.vis-config-button{
+ display:block;
+ width:495px;
+ height:25px;
+ vertical-align: middle;
+ line-height:25px;
+ background-color: #f7f8fa;
+ border:2px solid #ceced0;
+ border-radius:4px;
+ margin-top:20px;
+ left:10px;
+ padding-left:5px;
+ cursor: pointer;
+ margin-bottom:30px;
+}
+
+div.vis-configuration.vis-config-button.hover{
+ background-color: #4588e6;
+ border:2px solid #214373;
+ color:#ffffff;
+}
+
+div.vis-configuration.vis-config-item{
+ display:block;
+ float:left;
+ width:495px;
+ height:25px;
+ vertical-align: middle;
+ line-height:25px;
+}
+
+
+div.vis-configuration.vis-config-item.vis-config-s2{
+ left:10px;
+ background-color: #f7f8fa;
+ padding-left:5px;
+ border-radius:3px;
+}
+div.vis-configuration.vis-config-item.vis-config-s3{
+ left:20px;
+ background-color: #e4e9f0;
+ padding-left:5px;
+ border-radius:3px;
+}
+div.vis-configuration.vis-config-item.vis-config-s4{
+ left:30px;
+ background-color: #cfd8e6;
+ padding-left:5px;
+ border-radius:3px;
+}
+
+div.vis-configuration.vis-config-header{
+ font-size:18px;
+ font-weight: bold;
+}
+
+div.vis-configuration.vis-config-label{
+ width:120px;
+ height:25px;
+ line-height: 25px;
+}
+
+div.vis-configuration.vis-config-label.vis-config-s3{
+ width:110px;
+}
+div.vis-configuration.vis-config-label.vis-config-s4{
+ width:100px;
+}
+
+div.vis-configuration.vis-config-colorBlock{
+ top:1px;
+ width:30px;
+ height:19px;
+ border:1px solid #444444;
+ border-radius:2px;
+ padding:0px;
+ margin:0px;
+ cursor:pointer;
+}
+
+input.vis-configuration.vis-config-checkbox {
+ left:-5px;
+}
+
+
+input.vis-configuration.vis-config-rangeinput{
+ position:relative;
+ top:-5px;
+ width:60px;
+ height:13px;
+ padding:1px;
+ margin:0;
+ pointer-events:none;
+}
+
+input.vis-configuration.vis-config-range{
+ /*removes default webkit styles*/
+ -webkit-appearance: none;
+
+ /*fix for FF unable to apply focus style bug */
+ border: 0px solid white;
+ background-color:rgba(0,0,0,0);
+
+ /*required for proper track sizing in FF*/
+ width: 300px;
+ height:20px;
+}
+input.vis-configuration.vis-config-range::-webkit-slider-runnable-track {
+ width: 300px;
+ height: 5px;
+ background: #dedede; /* Old browsers */
+ background: -moz-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dedede), color-stop(99%,#c8c8c8)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #dedede 0%,#c8c8c8 99%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #dedede 0%,#c8c8c8 99%); /* IE10+ */
+ background: linear-gradient(to bottom, #dedede 0%,#c8c8c8 99%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8',GradientType=0 ); /* IE6-9 */
+
+ border: 1px solid #999999;
+ box-shadow: #aaaaaa 0px 0px 3px 0px;
+ border-radius: 3px;
+}
+input.vis-configuration.vis-config-range::-webkit-slider-thumb {
+ -webkit-appearance: none;
+ border: 1px solid #14334b;
+ height: 17px;
+ width: 17px;
+ border-radius: 50%;
+ background: #3876c2; /* Old browsers */
+ background: -moz-linear-gradient(top, #3876c2 0%, #385380 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#3876c2), color-stop(100%,#385380)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #3876c2 0%,#385380 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #3876c2 0%,#385380 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #3876c2 0%,#385380 100%); /* IE10+ */
+ background: linear-gradient(to bottom, #3876c2 0%,#385380 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3876c2', endColorstr='#385380',GradientType=0 ); /* IE6-9 */
+ box-shadow: #111927 0px 0px 1px 0px;
+ margin-top: -7px;
+}
+input.vis-configuration.vis-config-range:focus {
+ outline: none;
+}
+input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track {
+ background: #9d9d9d; /* Old browsers */
+ background: -moz-linear-gradient(top, #9d9d9d 0%, #c8c8c8 99%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#9d9d9d), color-stop(99%,#c8c8c8)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #9d9d9d 0%,#c8c8c8 99%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #9d9d9d 0%,#c8c8c8 99%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #9d9d9d 0%,#c8c8c8 99%); /* IE10+ */
+ background: linear-gradient(to bottom, #9d9d9d 0%,#c8c8c8 99%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9d9d9d', endColorstr='#c8c8c8',GradientType=0 ); /* IE6-9 */
+}
+
+input.vis-configuration.vis-config-range::-moz-range-track {
+ width: 300px;
+ height: 10px;
+ background: #dedede; /* Old browsers */
+ background: -moz-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dedede), color-stop(99%,#c8c8c8)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #dedede 0%,#c8c8c8 99%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #dedede 0%,#c8c8c8 99%); /* IE10+ */
+ background: linear-gradient(to bottom, #dedede 0%,#c8c8c8 99%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8',GradientType=0 ); /* IE6-9 */
+
+ border: 1px solid #999999;
+ box-shadow: #aaaaaa 0px 0px 3px 0px;
+ border-radius: 3px;
+}
+input.vis-configuration.vis-config-range::-moz-range-thumb {
+ border: none;
+ height: 16px;
+ width: 16px;
+
+ border-radius: 50%;
+ background: #385380;
+}
+
+/*hide the outline behind the border*/
+input.vis-configuration.vis-config-range:-moz-focusring{
+ outline: 1px solid white;
+ outline-offset: -1px;
+}
+
+input.vis-configuration.vis-config-range::-ms-track {
+ width: 300px;
+ height: 5px;
+
+ /*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
+ background: transparent;
+
+ /*leave room for the larger thumb to overflow with a transparent border */
+ border-color: transparent;
+ border-width: 6px 0;
+
+ /*remove default tick marks*/
+ color: transparent;
+}
+input.vis-configuration.vis-config-range::-ms-fill-lower {
+ background: #777;
+ border-radius: 10px;
+}
+input.vis-configuration.vis-config-range::-ms-fill-upper {
+ background: #ddd;
+ border-radius: 10px;
+}
+input.vis-configuration.vis-config-range::-ms-thumb {
+ border: none;
+ height: 16px;
+ width: 16px;
+ border-radius: 50%;
+ background: #385380;
+}
+input.vis-configuration.vis-config-range:focus::-ms-fill-lower {
+ background: #888;
+}
+input.vis-configuration.vis-config-range:focus::-ms-fill-upper {
+ background: #ccc;
+}
+
+.vis-configuration-popup {
+ position: absolute;
+ background: rgba(57, 76, 89, 0.85);
+ border: 2px solid #f2faff;
+ line-height:30px;
+ height:30px;
+ width:150px;
+ text-align:center;
+ color: #ffffff;
+ font-size:14px;
+ border-radius:4px;
+ -webkit-transition: opacity 0.3s ease-in-out;
+ -moz-transition: opacity 0.3s ease-in-out;
+ transition: opacity 0.3s ease-in-out;
+}
+.vis-configuration-popup:after, .vis-configuration-popup:before {
+ left: 100%;
+ top: 50%;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+}
+
+.vis-configuration-popup:after {
+ border-color: rgba(136, 183, 213, 0);
+ border-left-color: rgba(57, 76, 89, 0.85);
+ border-width: 8px;
+ margin-top: -8px;
+}
+.vis-configuration-popup:before {
+ border-color: rgba(194, 225, 245, 0);
+ border-left-color: #f2faff;
+ border-width: 12px;
+ margin-top: -12px;
+}
+
+.vis-timeline {
+ position: relative;
+ border: 1px solid #bfbfbf;
+
+ overflow: hidden;
+ padding: 0;
+ margin: 0;
+
+ box-sizing: border-box;
+}
+
+
+.vis-panel {
+ position: absolute;
+
+ padding: 0;
+ margin: 0;
+
+ box-sizing: border-box;
+}
+
+.vis-panel.vis-center,
+.vis-panel.vis-left,
+.vis-panel.vis-right,
+.vis-panel.vis-top,
+.vis-panel.vis-bottom {
+ border: 1px #bfbfbf;
+}
+
+.vis-panel.vis-center,
+.vis-panel.vis-left,
+.vis-panel.vis-right {
+ border-top-style: solid;
+ border-bottom-style: solid;
+ overflow: hidden;
+}
+
+.vis-panel.vis-center,
+.vis-panel.vis-top,
+.vis-panel.vis-bottom {
+ border-left-style: solid;
+ border-right-style: solid;
+}
+
+.vis-background {
+ overflow: hidden;
+}
+
+.vis-panel > .vis-content {
+ position: relative;
+}
+
+.vis-panel .vis-shadow {
+ position: absolute;
+ width: 100%;
+ height: 1px;
+ box-shadow: 0 0 10px rgba(0,0,0,0.8);
+ /* TODO: find a nice way to ensure vis-shadows are drawn on top of items
+ z-index: 1;
+ */
+}
+
+.vis-panel .vis-shadow.vis-top {
+ top: -1px;
+ left: 0;
+}
+
+.vis-panel .vis-shadow.vis-bottom {
+ bottom: -1px;
+ left: 0;
+}
+
+.vis-labelset {
+ position: relative;
+
+ overflow: hidden;
+
+ box-sizing: border-box;
+}
+
+.vis-labelset .vis-label {
+ position: relative;
+ left: 0;
+ top: 0;
+ width: 100%;
+ color: #4d4d4d;
+
+ box-sizing: border-box;
+}
+
+.vis-labelset .vis-label {
+ border-bottom: 1px solid #bfbfbf;
+}
+
+.vis-labelset .vis-label.draggable {
+ cursor: pointer;
+}
+
+.vis-labelset .vis-label:last-child {
+ border-bottom: none;
+}
+
+.vis-labelset .vis-label .vis-inner {
+ display: inline-block;
+ padding: 5px;
+}
+
+.vis-labelset .vis-label .vis-inner.vis-hidden {
+ padding: 0;
+}
+
+
+.vis-itemset {
+ position: relative;
+ padding: 0;
+ margin: 0;
+
+ box-sizing: border-box;
+}
+
+.vis-itemset .vis-background,
+.vis-itemset .vis-foreground {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ overflow: visible;
+}
+
+.vis-axis {
+ position: absolute;
+ width: 100%;
+ height: 0;
+ left: 0;
+ z-index: 1;
+}
+
+.vis-foreground .vis-group {
+ position: relative;
+ box-sizing: border-box;
+ border-bottom: 1px solid #bfbfbf;
+}
+
+.vis-foreground .vis-group:last-child {
+ border-bottom: none;
+}
+
+.vis-overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 10;
+}
+
+.vis-item {
+ position: absolute;
+ color: #1A1A1A;
+ border-color: #97B0F8;
+ border-width: 1px;
+ background-color: #D5DDF6;
+ display: inline-block;
+ /*overflow: hidden;*/
+}
+
+.vis-item.vis-selected {
+ border-color: #FFC200;
+ background-color: #FFF785;
+
+ /* z-index must be higher than the z-index of custom time bar and current time bar */
+ z-index: 2;
+}
+
+.vis-editable.vis-selected {
+ cursor: move;
+}
+
+.vis-item.vis-point.vis-selected {
+ background-color: #FFF785;
+}
+
+.vis-item.vis-box {
+ text-align: center;
+ border-style: solid;
+ border-radius: 2px;
+}
+
+.vis-item.vis-point {
+ background: none;
+}
+
+.vis-item.vis-dot {
+ position: absolute;
+ padding: 0;
+ border-width: 4px;
+ border-style: solid;
+ border-radius: 4px;
+}
+
+.vis-item.vis-range {
+ border-style: solid;
+ border-radius: 2px;
+ box-sizing: border-box;
+}
+
+.vis-item.vis-background {
+ border: none;
+ background-color: rgba(213, 221, 246, 0.4);
+ box-sizing: border-box;
+ padding: 0;
+ margin: 0;
+}
+
+.vis-item .vis-item-overflow {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ padding: 0;
+ margin: 0;
+ overflow: hidden;
+}
+
+.vis-item.vis-range .vis-item-content {
+ position: relative;
+ display: inline-block;
+}
+
+.vis-item.vis-background .vis-item-content {
+ position: absolute;
+ display: inline-block;
+}
+
+.vis-item.vis-line {
+ padding: 0;
+ position: absolute;
+ width: 0;
+ border-left-width: 1px;
+ border-left-style: solid;
+}
+
+.vis-item .vis-item-content {
+ white-space: nowrap;
+ box-sizing: border-box;
+ padding: 5px;
+}
+
+.vis-item .vis-delete {
+ background: url('img/timeline/delete.png') no-repeat center;
+ position: absolute;
+ width: 24px;
+ height: 24px;
+ top: -4px;
+ right: -24px;
+ cursor: pointer;
+}
+
+.vis-item.vis-range .vis-drag-left {
+ position: absolute;
+ width: 24px;
+ max-width: 20%;
+ min-width: 2px;
+ height: 100%;
+ top: 0;
+ left: -4px;
+
+ cursor: w-resize;
+}
+
+.vis-item.vis-range .vis-drag-right {
+ position: absolute;
+ width: 24px;
+ max-width: 20%;
+ min-width: 2px;
+ height: 100%;
+ top: 0;
+ right: -4px;
+
+ cursor: e-resize;
+}
+
+.vis-time-axis {
+ position: relative;
+ overflow: hidden;
+}
+
+.vis-time-axis.vis-foreground {
+ top: 0;
+ left: 0;
+ width: 100%;
+}
+
+.vis-time-axis.vis-background {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+
+.vis-time-axis .vis-text {
+ position: absolute;
+ color: #4d4d4d;
+ padding: 3px;
+ overflow: hidden;
+ box-sizing: border-box;
+
+ white-space: nowrap;
+}
+
+.vis-time-axis .vis-text.vis-measure {
+ position: absolute;
+ padding-left: 0;
+ padding-right: 0;
+ margin-left: 0;
+ margin-right: 0;
+ visibility: hidden;
+}
+
+.vis-time-axis .vis-grid.vis-vertical {
+ position: absolute;
+ border-left: 1px solid;
+}
+
+.vis-time-axis .vis-grid.vis-minor {
+ border-color: #e5e5e5;
+}
+
+.vis-time-axis .vis-grid.vis-major {
+ border-color: #bfbfbf;
+}
+
+.vis-current-time {
+ background-color: #FF7F6E;
+ width: 2px;
+ z-index: 1;
+}
+.vis-custom-time {
+ background-color: #6E94FF;
+ width: 2px;
+ cursor: move;
+ z-index: 1;
+}
+.vis-timeline {
+ /*
+ -webkit-transition: height .4s ease-in-out;
+ transition: height .4s ease-in-out;
+ */
+}
+
+.vis-panel {
+ /*
+ -webkit-transition: height .4s ease-in-out, top .4s ease-in-out;
+ transition: height .4s ease-in-out, top .4s ease-in-out;
+ */
+}
+
+.vis-axis {
+ /*
+ -webkit-transition: top .4s ease-in-out;
+ transition: top .4s ease-in-out;
+ */
+}
+
+/* TODO: get animation working nicely
+
+.vis-item {
+ -webkit-transition: top .4s ease-in-out;
+ transition: top .4s ease-in-out;
+}
+
+.vis-item.line {
+ -webkit-transition: height .4s ease-in-out, top .4s ease-in-out;
+ transition: height .4s ease-in-out, top .4s ease-in-out;
+}
+/**/
+
+.vis-panel.vis-background.vis-horizontal .vis-grid.vis-horizontal {
+ position: absolute;
+ width: 100%;
+ height: 0;
+ border-bottom: 1px solid;
+}
+
+.vis-panel.vis-background.vis-horizontal .vis-grid.vis-minor {
+ border-color: #e5e5e5;
+}
+
+.vis-panel.vis-background.vis-horizontal .vis-grid.vis-major {
+ border-color: #bfbfbf;
+}
+
+
+.vis-data-axis .vis-y-axis.vis-major {
+ width: 100%;
+ position: absolute;
+ color: #4d4d4d;
+ white-space: nowrap;
+}
+
+.vis-data-axis .vis-y-axis.vis-major.vis-measure {
+ padding: 0;
+ margin: 0;
+ border: 0;
+ visibility: hidden;
+ width: auto;
+}
+
+
+.vis-data-axis .vis-y-axis.vis-minor {
+ position: absolute;
+ width: 100%;
+ color: #bebebe;
+ white-space: nowrap;
+}
+
+.vis-data-axis .vis-y-axis.vis-minor.vis-measure {
+ padding: 0;
+ margin: 0;
+ border: 0;
+ visibility: hidden;
+ width: auto;
+}
+
+.vis-data-axis .vis-y-axis.vis-title {
+ position: absolute;
+ color: #4d4d4d;
+ white-space: nowrap;
+ bottom: 20px;
+ text-align: center;
+}
+
+.vis-data-axis .vis-y-axis.vis-title.vis-measure {
+ padding: 0;
+ margin: 0;
+ visibility: hidden;
+ width: auto;
+}
+
+.vis-data-axis .vis-y-axis.vis-title.vis-left {
+ bottom: 0;
+ -webkit-transform-origin: left top;
+ -moz-transform-origin: left top;
+ -ms-transform-origin: left top;
+ -o-transform-origin: left top;
+ transform-origin: left bottom;
+ -webkit-transform: rotate(-90deg);
+ -moz-transform: rotate(-90deg);
+ -ms-transform: rotate(-90deg);
+ -o-transform: rotate(-90deg);
+ transform: rotate(-90deg);
+}
+
+.vis-data-axis .vis-y-axis.vis-title.vis-right {
+ bottom: 0;
+ -webkit-transform-origin: right bottom;
+ -moz-transform-origin: right bottom;
+ -ms-transform-origin: right bottom;
+ -o-transform-origin: right bottom;
+ transform-origin: right bottom;
+ -webkit-transform: rotate(90deg);
+ -moz-transform: rotate(90deg);
+ -ms-transform: rotate(90deg);
+ -o-transform: rotate(90deg);
+ transform: rotate(90deg);
+}
+
+.vis-legend {
+ background-color: rgba(247, 252, 255, 0.65);
+ padding: 5px;
+ border: 1px solid #b3b3b3;
+ box-shadow: 2px 2px 10px rgba(154, 154, 154, 0.55);
+}
+
+.vis-legend-text {
+ /*font-size: 10px;*/
+ white-space: nowrap;
+ display: inline-block
+}
+.vis-graph-group0 {
+ fill:#4f81bd;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #4f81bd;
+}
+
+.vis-graph-group1 {
+ fill:#f79646;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #f79646;
+}
+
+.vis-graph-group2 {
+ fill: #8c51cf;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #8c51cf;
+}
+
+.vis-graph-group3 {
+ fill: #75c841;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #75c841;
+}
+
+.vis-graph-group4 {
+ fill: #ff0100;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #ff0100;
+}
+
+.vis-graph-group5 {
+ fill: #37d8e6;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #37d8e6;
+}
+
+.vis-graph-group6 {
+ fill: #042662;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #042662;
+}
+
+.vis-graph-group7 {
+ fill:#00ff26;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #00ff26;
+}
+
+.vis-graph-group8 {
+ fill:#ff00ff;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #ff00ff;
+}
+
+.vis-graph-group9 {
+ fill: #8f3938;
+ fill-opacity:0;
+ stroke-width:2px;
+ stroke: #8f3938;
+}
+
+.vis-timeline .vis-fill {
+ fill-opacity:0.1;
+ stroke: none;
+}
+
+
+.vis-timeline .vis-bar {
+ fill-opacity:0.5;
+ stroke-width:1px;
+}
+
+.vis-timeline .vis-point {
+ stroke-width:2px;
+ fill-opacity:1.0;
+}
+
+
+.vis-timeline .vis-legend-background {
+ stroke-width:1px;
+ fill-opacity:0.9;
+ fill: #ffffff;
+ stroke: #c2c2c2;
+}
+
+
+.vis-timeline .vis-outline {
+ stroke-width:1px;
+ fill-opacity:1;
+ fill: #ffffff;
+ stroke: #e5e5e5;
+}
+
+.vis-timeline .vis-icon-fill {
+ fill-opacity:0.3;
+ stroke: none;
+}
+
+div.vis-network div.vis-manipulation {
+ border-width: 0;
+ border-bottom: 1px;
+ border-style:solid;
+ border-color: #d6d9d8;
+ background: #ffffff; /* Old browsers */
+ background: -moz-linear-gradient(top, #ffffff 0%, #fcfcfc 48%, #fafafa 50%, #fcfcfc 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(48%,#fcfcfc), color-stop(50%,#fafafa), color-stop(100%,#fcfcfc)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #ffffff 0%,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #ffffff 0%,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #ffffff 0%,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%); /* IE10+ */
+ background: linear-gradient(to bottom, #ffffff 0%,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#fcfcfc',GradientType=0 ); /* IE6-9 */
+
+ padding-top:4px;
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 28px;
+}
+
+div.vis-network div.vis-edit-mode {
+ position:absolute;
+ left: 0;
+ top: 5px;
+ height: 30px;
+}
+
+/* FIXME: shouldn't the vis-close button be a child of the vis-manipulation div? */
+
+div.vis-network div.vis-close {
+ position:absolute;
+ right: 0;
+ top: 0;
+ width: 30px;
+ height: 30px;
+
+ background-position: 20px 3px;
+ background-repeat: no-repeat;
+ background-image: url("img/network/cross.png");
+ cursor: pointer;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+div.vis-network div.vis-close:hover {
+ opacity: 0.6;
+}
+
+div.vis-network div.vis-manipulation div.vis-button,
+div.vis-network div.vis-edit-mode div.vis-button {
+ float:left;
+ font-family: verdana;
+ font-size: 12px;
+ -moz-border-radius: 15px;
+ border-radius: 15px;
+ display:inline-block;
+ background-position: 0px 0px;
+ background-repeat:no-repeat;
+ height:24px;
+ margin-left: 10px;
+ /*vertical-align:middle;*/
+ cursor: pointer;
+ padding: 0px 8px 0px 8px;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+div.vis-network div.vis-manipulation div.vis-button:hover {
+ box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.20);
+}
+
+div.vis-network div.vis-manipulation div.vis-button:active {
+ box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.50);
+}
+
+div.vis-network div.vis-manipulation div.vis-button.vis-back {
+ background-image: url("img/network/backIcon.png");
+}
+
+div.vis-network div.vis-manipulation div.vis-button.vis-none:hover {
+ box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.0);
+ cursor: default;
+}
+div.vis-network div.vis-manipulation div.vis-button.vis-none:active {
+ box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.0);
+}
+div.vis-network div.vis-manipulation div.vis-button.vis-none {
+ padding: 0;
+}
+div.vis-network div.vis-manipulation div.notification {
+ margin: 2px;
+ font-weight: bold;
+}
+
+div.vis-network div.vis-manipulation div.vis-button.vis-add {
+ background-image: url("img/network/addNodeIcon.png");
+}
+
+div.vis-network div.vis-manipulation div.vis-button.vis-edit,
+div.vis-network div.vis-edit-mode div.vis-button.vis-edit {
+ background-image: url("img/network/editIcon.png");
+}
+
+div.vis-network div.vis-edit-mode div.vis-button.vis-edit.vis-edit-mode {
+ background-color: #fcfcfc;
+ border: 1px solid #cccccc;
+}
+
+div.vis-network div.vis-manipulation div.vis-button.vis-connect {
+ background-image: url("img/network/connectIcon.png");
+}
+
+div.vis-network div.vis-manipulation div.vis-button.vis-delete {
+ background-image: url("img/network/deleteIcon.png");
+}
+/* top right bottom left */
+div.vis-network div.vis-manipulation div.vis-label,
+div.vis-network div.vis-edit-mode div.vis-label {
+ margin: 0 0 0 23px;
+ line-height: 25px;
+}
+div.vis-network div.vis-manipulation div.vis-separator-line {
+ float:left;
+ display:inline-block;
+ width:1px;
+ height:21px;
+ background-color: #bdbdbd;
+ margin: 0px 7px 0 15px; /*top right bottom left*/
+}
+
+/* TODO: is this redundant?
+div.network-navigation_wrapper {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+}
+*/
+div.vis-network-tooltip {
+ position: absolute;
+ visibility: hidden;
+ padding: 5px;
+ white-space: nowrap;
+
+ font-family: verdana;
+ font-size:14px;
+ font-color:#000000;
+ background-color: #f5f4ed;
+
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ border: 1px solid #808074;
+
+ box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
+ pointer-events: none;
+}
+div.vis-network div.vis-navigation div.vis-button {
+ width:34px;
+ height:34px;
+ -moz-border-radius: 17px;
+ border-radius: 17px;
+ position:absolute;
+ display:inline-block;
+ background-position: 2px 2px;
+ background-repeat:no-repeat;
+ cursor: pointer;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+div.vis-network div.vis-navigation div.vis-button:hover {
+ box-shadow: 0 0 3px 3px rgba(56, 207, 21, 0.30);
+}
+
+div.vis-network div.vis-navigation div.vis-button:active {
+ box-shadow: 0 0 1px 3px rgba(56, 207, 21, 0.95);
+}
+
+div.vis-network div.vis-navigation div.vis-button.vis-up {
+ background-image: url("img/network/upArrow.png");
+ bottom:50px;
+ left:55px;
+}
+div.vis-network div.vis-navigation div.vis-button.vis-down {
+ background-image: url("img/network/downArrow.png");
+ bottom:10px;
+ left:55px;
+}
+div.vis-network div.vis-navigation div.vis-button.vis-left {
+ background-image: url("img/network/leftArrow.png");
+ bottom:10px;
+ left:15px;
+}
+div.vis-network div.vis-navigation div.vis-button.vis-right {
+ background-image: url("img/network/rightArrow.png");
+ bottom:10px;
+ left:95px;
+}
+div.vis-network div.vis-navigation div.vis-button.vis-zoomIn {
+ background-image: url("img/network/plus.png");
+ bottom:10px;
+ right:15px;
+}
+div.vis-network div.vis-navigation div.vis-button.vis-zoomOut {
+ background-image: url("img/network/minus.png");
+ bottom:10px;
+ right:55px;
+}
+div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends {
+ background-image: url("img/network/zoomExtends.png");
+ bottom:50px;
+ right:15px;
+}
+
+div.vis-color-picker {
+ position:absolute;
+ margin-top:-140px;
+ margin-left:30px;
+ width:293px;
+ height:425px;
+ padding: 10px;
+ border-radius:15px;
+ background-color:#ffffff;
+ display:none;
+ box-shadow: rgba(0,0,0,0.5) 0px 0px 10px 0px;
+}
+
+div.vis-color-picker div.vis-arrow {
+ position: absolute;
+ top:147px;
+ left:5px;
+}
+
+div.vis-color-picker div.vis-arrow:after,
+div.vis-color-picker div.vis-arrow:before {
+ right: 100%;
+ top: 50%;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+}
+
+div.vis-color-picker div.vis-arrow:after {
+ border-color: rgba(255, 255, 255, 0);
+ border-right-color: #ffffff;
+ border-width: 30px;
+ margin-top: -30px;
+}
+
+div.vis-color-picker div.vis-color {
+ position:absolute;
+ width: 289px;
+ height: 289px;
+ cursor: pointer;
+}
+
+
+
+div.vis-color-picker div.vis-brightness {
+ position: absolute;
+ top:313px;
+}
+
+div.vis-color-picker div.vis-opacity {
+ position:absolute;
+ top:350px;
+}
+
+div.vis-color-picker div.vis-selector {
+ position:absolute;
+ top:137px;
+ left:137px;
+ width:15px;
+ height:15px;
+ border-radius:15px;
+ border:1px solid #ffffff;
+ background: #4c4c4c; /* Old browsers */
+ background: -moz-linear-gradient(top, #4c4c4c 0%, #595959 12%, #666666 25%, #474747 39%, #2c2c2c 50%, #000000 51%, #111111 60%, #2b2b2b 76%, #1c1c1c 91%, #131313 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4c4c4c), color-stop(12%,#595959), color-stop(25%,#666666), color-stop(39%,#474747), color-stop(50%,#2c2c2c), color-stop(51%,#000000), color-stop(60%,#111111), color-stop(76%,#2b2b2b), color-stop(91%,#1c1c1c), color-stop(100%,#131313)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #4c4c4c 0%,#595959 12%,#666666 25%,#474747 39%,#2c2c2c 50%,#000000 51%,#111111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #4c4c4c 0%,#595959 12%,#666666 25%,#474747 39%,#2c2c2c 50%,#000000 51%,#111111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #4c4c4c 0%,#595959 12%,#666666 25%,#474747 39%,#2c2c2c 50%,#000000 51%,#111111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%); /* IE10+ */
+ background: linear-gradient(to bottom, #4c4c4c 0%,#595959 12%,#666666 25%,#474747 39%,#2c2c2c 50%,#000000 51%,#111111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4c4c4c', endColorstr='#131313',GradientType=0 ); /* IE6-9 */
+}
+
+
+
+div.vis-color-picker div.vis-new-color {
+ position:absolute;
+ width:140px;
+ height:20px;
+ border:1px solid rgba(0,0,0,0.1);
+ border-radius:5px;
+ top:380px;
+ left:159px;
+ text-align:right;
+ padding-right:2px;
+ font-size:10px;
+ color:rgba(0,0,0,0.4);
+ vertical-align:middle;
+ line-height:20px;
+
+}
+
+div.vis-color-picker div.vis-initial-color {
+ position:absolute;
+ width:140px;
+ height:20px;
+ border:1px solid rgba(0,0,0,0.1);
+ border-radius:5px;
+ top:380px;
+ left:10px;
+ text-align:left;
+ padding-left:2px;
+ font-size:10px;
+ color:rgba(0,0,0,0.4);
+ vertical-align:middle;
+ line-height:20px;
+}
+
+div.vis-color-picker div.vis-label {
+ position:absolute;
+ width:300px;
+ left:10px;
+}
+
+div.vis-color-picker div.vis-label.vis-brightness {
+ top:300px;
+}
+
+div.vis-color-picker div.vis-label.vis-opacity {
+ top:338px;
+}
+
+div.vis-color-picker div.vis-button {
+ position:absolute;
+ width:68px;
+ height:25px;
+ border-radius:10px;
+ vertical-align: middle;
+ text-align:center;
+ line-height: 25px;
+ top:410px;
+ border:2px solid #d9d9d9;
+ background-color: #f7f7f7;
+ cursor:pointer;
+}
+
+div.vis-color-picker div.vis-button.vis-cancel {
+ /*border:2px solid #ff4e33;*/
+ /*background-color: #ff7761;*/
+ left:5px;
+}
+div.vis-color-picker div.vis-button.vis-load {
+ /*border:2px solid #a153e6;*/
+ /*background-color: #cb8dff;*/
+ left:82px;
+}
+div.vis-color-picker div.vis-button.vis-apply {
+ /*border:2px solid #4588e6;*/
+ /*background-color: #82b6ff;*/
+ left:159px;
+}
+div.vis-color-picker div.vis-button.vis-save {
+ /*border:2px solid #45e655;*/
+ /*background-color: #6dff7c;*/
+ left:236px;
+}
+
+
+div.vis-color-picker input.vis-range {
+ width: 290px;
+ height:20px;
+}
+
+/* TODO: is this redundant?
+div.vis-color-picker input.vis-range-brightness {
+ width: 289px !important;
+}
+
+
+div.vis-color-picker input.vis-saturation-range {
+ width: 289px !important;
+}*/
\ No newline at end of file
diff --git a/resources/visjs/vis.js b/resources/visjs/vis.js
new file mode 100644
index 00000000..3388fc4b
--- /dev/null
+++ b/resources/visjs/vis.js
@@ -0,0 +1,43387 @@
+/**
+ * vis.js
+ * https://github.com/almende/vis
+ *
+ * A dynamic, browser-based visualization library.
+ *
+ * @version 4.9.0
+ * @date 2015-10-01
+ *
+ * @license
+ * Copyright (C) 2011-2015 Almende B.V, http://almende.com
+ *
+ * Vis.js is dual licensed under both
+ *
+ * * The Apache 2.0 License
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * and
+ *
+ * * The MIT License
+ * http://opensource.org/licenses/MIT
+ *
+ * Vis.js may be distributed under either license.
+ */
+
+"use strict";
+
+(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["vis"] = factory();
+ else
+ root["vis"] = 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__) {
+
+ // utils
+ 'use strict';
+
+ exports.util = __webpack_require__(1);
+ exports.DOMutil = __webpack_require__(7);
+
+ // data
+ exports.DataSet = __webpack_require__(8);
+ exports.DataView = __webpack_require__(10);
+ exports.Queue = __webpack_require__(9);
+
+ // Graph3d
+ exports.Graph3d = __webpack_require__(11);
+ exports.graph3d = {
+ Camera: __webpack_require__(15),
+ Filter: __webpack_require__(16),
+ Point2d: __webpack_require__(14),
+ Point3d: __webpack_require__(13),
+ Slider: __webpack_require__(17),
+ StepNumber: __webpack_require__(18)
+ };
+
+ // Timeline
+ exports.Timeline = __webpack_require__(19);
+ exports.Graph2d = __webpack_require__(49);
+ exports.timeline = {
+ DateUtil: __webpack_require__(27),
+ DataStep: __webpack_require__(52),
+ Range: __webpack_require__(24),
+ stack: __webpack_require__(32),
+ TimeStep: __webpack_require__(30),
+
+ components: {
+ items: {
+ Item: __webpack_require__(34),
+ BackgroundItem: __webpack_require__(38),
+ BoxItem: __webpack_require__(36),
+ PointItem: __webpack_require__(37),
+ RangeItem: __webpack_require__(33)
+ },
+
+ Component: __webpack_require__(26),
+ CurrentTime: __webpack_require__(44),
+ CustomTime: __webpack_require__(42),
+ DataAxis: __webpack_require__(51),
+ GraphGroup: __webpack_require__(53),
+ Group: __webpack_require__(31),
+ BackgroundGroup: __webpack_require__(35),
+ ItemSet: __webpack_require__(29),
+ Legend: __webpack_require__(57),
+ LineGraph: __webpack_require__(50),
+ TimeAxis: __webpack_require__(39)
+ }
+ };
+
+ // Network
+ exports.Network = __webpack_require__(59);
+ exports.network = {
+ Images: __webpack_require__(117),
+ dotparser: __webpack_require__(115),
+ gephiParser: __webpack_require__(116),
+ allOptions: __webpack_require__(111)
+ };
+ exports.network.convertDot = function (input) {
+ return exports.network.dotparser.DOTToGraph(input);
+ };
+ exports.network.convertGephi = function (input, options) {
+ return exports.network.gephiParser.parseGephi(input, options);
+ };
+
+ // bundled external libraries
+ exports.moment = __webpack_require__(2);
+ exports.Hammer = __webpack_require__(20);
+ exports.keycharm = __webpack_require__(41);
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ // utility functions
+
+ // first check if moment.js is already loaded in the browser window, if so,
+ // use this instance. Else, load via commonjs.
+
+ 'use strict';
+
+ var moment = __webpack_require__(2);
+ var uuid = __webpack_require__(6);
+
+ /**
+ * Test whether given object is a number
+ * @param {*} object
+ * @return {Boolean} isNumber
+ */
+ exports.isNumber = function (object) {
+ return object instanceof Number || typeof object == 'number';
+ };
+
+ /**
+ * Remove everything in the DOM object
+ * @param DOMobject
+ */
+ exports.recursiveDOMDelete = function (DOMobject) {
+ if (DOMobject) {
+ while (DOMobject.hasChildNodes() === true) {
+ exports.recursiveDOMDelete(DOMobject.firstChild);
+ DOMobject.removeChild(DOMobject.firstChild);
+ }
+ }
+ };
+
+ /**
+ * this function gives you a range between 0 and 1 based on the min and max values in the set, the total sum of all values and the current value.
+ *
+ * @param min
+ * @param max
+ * @param total
+ * @param value
+ * @returns {number}
+ */
+ exports.giveRange = function (min, max, total, value) {
+ if (max == min) {
+ return 0.5;
+ } else {
+ var scale = 1 / (max - min);
+ return Math.max(0, (value - min) * scale);
+ }
+ };
+
+ /**
+ * Test whether given object is a string
+ * @param {*} object
+ * @return {Boolean} isString
+ */
+ exports.isString = function (object) {
+ return object instanceof String || typeof object == 'string';
+ };
+
+ /**
+ * Test whether given object is a Date, or a String containing a Date
+ * @param {Date | String} object
+ * @return {Boolean} isDate
+ */
+ exports.isDate = function (object) {
+ if (object instanceof Date) {
+ return true;
+ } else if (exports.isString(object)) {
+ // test whether this string contains a date
+ var match = ASPDateRegex.exec(object);
+ if (match) {
+ return true;
+ } else if (!isNaN(Date.parse(object))) {
+ return true;
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * Create a semi UUID
+ * source: http://stackoverflow.com/a/105074/1262753
+ * @return {String} uuid
+ */
+ exports.randomUUID = function () {
+ return uuid.v4();
+ };
+
+ /**
+ * assign all keys of an object that are not nested objects to a certain value (used for color objects).
+ * @param obj
+ * @param value
+ */
+ exports.assignAllKeys = function (obj, value) {
+ for (var prop in obj) {
+ if (obj.hasOwnProperty(prop)) {
+ if (typeof obj[prop] !== 'object') {
+ obj[prop] = value;
+ }
+ }
+ }
+ };
+
+ /**
+ * Fill an object with a possibly partially defined other object. Only copies values if the a object has an object requiring values.
+ * That means an object is not created on a property if only the b object has it.
+ * @param obj
+ * @param value
+ */
+ exports.fillIfDefined = function (a, b) {
+ var allowDeletion = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+
+ for (var prop in a) {
+ if (b[prop] !== undefined) {
+ if (typeof b[prop] !== 'object') {
+ if ((b[prop] === undefined || b[prop] === null) && a[prop] !== undefined && allowDeletion === true) {
+ delete a[prop];
+ } else {
+ a[prop] = b[prop];
+ }
+ } else {
+ if (typeof a[prop] === 'object') {
+ exports.fillIfDefined(a[prop], b[prop], allowDeletion);
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * Extend object a with the properties of object b or a series of objects
+ * Only properties with defined values are copied
+ * @param {Object} a
+ * @param {... Object} b
+ * @return {Object} a
+ */
+ exports.protoExtend = function (a, b) {
+ for (var i = 1; i < arguments.length; i++) {
+ var other = arguments[i];
+ for (var prop in other) {
+ a[prop] = other[prop];
+ }
+ }
+ return a;
+ };
+
+ /**
+ * Extend object a with the properties of object b or a series of objects
+ * Only properties with defined values are copied
+ * @param {Object} a
+ * @param {... Object} b
+ * @return {Object} a
+ */
+ exports.extend = function (a, b) {
+ for (var i = 1; i < arguments.length; i++) {
+ var other = arguments[i];
+ for (var prop in other) {
+ if (other.hasOwnProperty(prop)) {
+ a[prop] = other[prop];
+ }
+ }
+ }
+ return a;
+ };
+
+ /**
+ * Extend object a with selected properties of object b or a series of objects
+ * Only properties with defined values are copied
+ * @param {Array.} props
+ * @param {Object} a
+ * @param {Object} b
+ * @return {Object} a
+ */
+ exports.selectiveExtend = function (props, a, b) {
+ if (!Array.isArray(props)) {
+ throw new Error('Array with property names expected as first argument');
+ }
+
+ for (var i = 2; i < arguments.length; i++) {
+ var other = arguments[i];
+
+ for (var p = 0; p < props.length; p++) {
+ var prop = props[p];
+ if (other.hasOwnProperty(prop)) {
+ a[prop] = other[prop];
+ }
+ }
+ }
+ return a;
+ };
+
+ /**
+ * Extend object a with selected properties of object b or a series of objects
+ * Only properties with defined values are copied
+ * @param {Array.} props
+ * @param {Object} a
+ * @param {Object} b
+ * @return {Object} a
+ */
+ exports.selectiveDeepExtend = function (props, a, b) {
+ var allowDeletion = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
+
+ // TODO: add support for Arrays to deepExtend
+ if (Array.isArray(b)) {
+ throw new TypeError('Arrays are not supported by deepExtend');
+ }
+ for (var i = 2; i < arguments.length; i++) {
+ var other = arguments[i];
+ for (var p = 0; p < props.length; p++) {
+ var prop = props[p];
+ if (other.hasOwnProperty(prop)) {
+ if (b[prop] && b[prop].constructor === Object) {
+ if (a[prop] === undefined) {
+ a[prop] = {};
+ }
+ if (a[prop].constructor === Object) {
+ exports.deepExtend(a[prop], b[prop], false, allowDeletion);
+ } else {
+ if (b[prop] === null && a[prop] !== undefined && allowDeletion === true) {
+ delete a[prop];
+ } else {
+ a[prop] = b[prop];
+ }
+ }
+ } else if (Array.isArray(b[prop])) {
+ throw new TypeError('Arrays are not supported by deepExtend');
+ } else {
+ if (b[prop] === null && a[prop] !== undefined && allowDeletion === true) {
+ delete a[prop];
+ } else {
+ a[prop] = b[prop];
+ }
+ }
+ }
+ }
+ }
+ return a;
+ };
+
+ /**
+ * Extend object a with selected properties of object b or a series of objects
+ * Only properties with defined values are copied
+ * @param {Array.} props
+ * @param {Object} a
+ * @param {Object} b
+ * @return {Object} a
+ */
+ exports.selectiveNotDeepExtend = function (props, a, b) {
+ var allowDeletion = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
+
+ // TODO: add support for Arrays to deepExtend
+ if (Array.isArray(b)) {
+ throw new TypeError('Arrays are not supported by deepExtend');
+ }
+ for (var prop in b) {
+ if (b.hasOwnProperty(prop)) {
+ if (props.indexOf(prop) == -1) {
+ if (b[prop] && b[prop].constructor === Object) {
+ if (a[prop] === undefined) {
+ a[prop] = {};
+ }
+ if (a[prop].constructor === Object) {
+ exports.deepExtend(a[prop], b[prop]);
+ } else {
+ if (b[prop] === null && a[prop] !== undefined && allowDeletion === true) {
+ delete a[prop];
+ } else {
+ a[prop] = b[prop];
+ }
+ }
+ } else if (Array.isArray(b[prop])) {
+ a[prop] = [];
+ for (var i = 0; i < b[prop].length; i++) {
+ a[prop].push(b[prop][i]);
+ }
+ } else {
+ if (b[prop] === null && a[prop] !== undefined && allowDeletion === true) {
+ delete a[prop];
+ } else {
+ a[prop] = b[prop];
+ }
+ }
+ }
+ }
+ }
+ return a;
+ };
+
+ /**
+ * Deep extend an object a with the properties of object b
+ * @param {Object} a
+ * @param {Object} b
+ * @param [Boolean] protoExtend --> optional parameter. If true, the prototype values will also be extended.
+ * (ie. the options objects that inherit from others will also get the inherited options)
+ * @param [Boolean] global --> optional parameter. If true, the values of fields that are null will not deleted
+ * @returns {Object}
+ */
+ exports.deepExtend = function (a, b, protoExtend, allowDeletion) {
+ for (var prop in b) {
+ if (b.hasOwnProperty(prop) || protoExtend === true) {
+ if (b[prop] && b[prop].constructor === Object) {
+ if (a[prop] === undefined) {
+ a[prop] = {};
+ }
+ if (a[prop].constructor === Object) {
+ exports.deepExtend(a[prop], b[prop], protoExtend);
+ } else {
+ if (b[prop] === null && a[prop] !== undefined && allowDeletion === true) {
+ delete a[prop];
+ } else {
+ a[prop] = b[prop];
+ }
+ }
+ } else if (Array.isArray(b[prop])) {
+ a[prop] = [];
+ for (var i = 0; i < b[prop].length; i++) {
+ a[prop].push(b[prop][i]);
+ }
+ } else {
+ if (b[prop] === null && a[prop] !== undefined && allowDeletion === true) {
+ delete a[prop];
+ } else {
+ a[prop] = b[prop];
+ }
+ }
+ }
+ }
+ return a;
+ };
+
+ /**
+ * Test whether all elements in two arrays are equal.
+ * @param {Array} a
+ * @param {Array} b
+ * @return {boolean} Returns true if both arrays have the same length and same
+ * elements.
+ */
+ exports.equalArray = function (a, b) {
+ if (a.length != b.length) return false;
+
+ for (var i = 0, len = a.length; i < len; i++) {
+ if (a[i] != b[i]) return false;
+ }
+
+ return true;
+ };
+
+ /**
+ * Convert an object to another type
+ * @param {Boolean | Number | String | Date | Moment | Null | undefined} object
+ * @param {String | undefined} type Name of the type. Available types:
+ * 'Boolean', 'Number', 'String',
+ * 'Date', 'Moment', ISODate', 'ASPDate'.
+ * @return {*} object
+ * @throws Error
+ */
+ exports.convert = function (object, type) {
+ var match;
+
+ if (object === undefined) {
+ return undefined;
+ }
+ if (object === null) {
+ return null;
+ }
+
+ if (!type) {
+ return object;
+ }
+ if (!(typeof type === 'string') && !(type instanceof String)) {
+ throw new Error('Type must be a string');
+ }
+
+ //noinspection FallthroughInSwitchStatementJS
+ switch (type) {
+ case 'boolean':
+ case 'Boolean':
+ return Boolean(object);
+
+ case 'number':
+ case 'Number':
+ return Number(object.valueOf());
+
+ case 'string':
+ case 'String':
+ return String(object);
+
+ case 'Date':
+ if (exports.isNumber(object)) {
+ return new Date(object);
+ }
+ if (object instanceof Date) {
+ return new Date(object.valueOf());
+ } else if (moment.isMoment(object)) {
+ return new Date(object.valueOf());
+ }
+ if (exports.isString(object)) {
+ match = ASPDateRegex.exec(object);
+ if (match) {
+ // object is an ASP date
+ return new Date(Number(match[1])); // parse number
+ } else {
+ return moment(object).toDate(); // parse string
+ }
+ } else {
+ throw new Error('Cannot convert object of type ' + exports.getType(object) + ' to type Date');
+ }
+
+ case 'Moment':
+ if (exports.isNumber(object)) {
+ return moment(object);
+ }
+ if (object instanceof Date) {
+ return moment(object.valueOf());
+ } else if (moment.isMoment(object)) {
+ return moment(object);
+ }
+ if (exports.isString(object)) {
+ match = ASPDateRegex.exec(object);
+ if (match) {
+ // object is an ASP date
+ return moment(Number(match[1])); // parse number
+ } else {
+ return moment(object); // parse string
+ }
+ } else {
+ throw new Error('Cannot convert object of type ' + exports.getType(object) + ' to type Date');
+ }
+
+ case 'ISODate':
+ if (exports.isNumber(object)) {
+ return new Date(object);
+ } else if (object instanceof Date) {
+ return object.toISOString();
+ } else if (moment.isMoment(object)) {
+ return object.toDate().toISOString();
+ } else if (exports.isString(object)) {
+ match = ASPDateRegex.exec(object);
+ if (match) {
+ // object is an ASP date
+ return new Date(Number(match[1])).toISOString(); // parse number
+ } else {
+ return new Date(object).toISOString(); // parse string
+ }
+ } else {
+ throw new Error('Cannot convert object of type ' + exports.getType(object) + ' to type ISODate');
+ }
+
+ case 'ASPDate':
+ if (exports.isNumber(object)) {
+ return '/Date(' + object + ')/';
+ } else if (object instanceof Date) {
+ return '/Date(' + object.valueOf() + ')/';
+ } else if (exports.isString(object)) {
+ match = ASPDateRegex.exec(object);
+ var value;
+ if (match) {
+ // object is an ASP date
+ value = new Date(Number(match[1])).valueOf(); // parse number
+ } else {
+ value = new Date(object).valueOf(); // parse string
+ }
+ return '/Date(' + value + ')/';
+ } else {
+ throw new Error('Cannot convert object of type ' + exports.getType(object) + ' to type ASPDate');
+ }
+
+ default:
+ throw new Error('Unknown type "' + type + '"');
+ }
+ };
+
+ // parse ASP.Net Date pattern,
+ // for example '/Date(1198908717056)/' or '/Date(1198908717056-0700)/'
+ // code from http://momentjs.com/
+ var ASPDateRegex = /^\/?Date\((\-?\d+)/i;
+
+ /**
+ * Get the type of an object, for example exports.getType([]) returns 'Array'
+ * @param {*} object
+ * @return {String} type
+ */
+ exports.getType = function (object) {
+ var type = typeof object;
+
+ if (type == 'object') {
+ if (object === null) {
+ return 'null';
+ }
+ if (object instanceof Boolean) {
+ return 'Boolean';
+ }
+ if (object instanceof Number) {
+ return 'Number';
+ }
+ if (object instanceof String) {
+ return 'String';
+ }
+ if (Array.isArray(object)) {
+ return 'Array';
+ }
+ if (object instanceof Date) {
+ return 'Date';
+ }
+ return 'Object';
+ } else if (type == 'number') {
+ return 'Number';
+ } else if (type == 'boolean') {
+ return 'Boolean';
+ } else if (type == 'string') {
+ return 'String';
+ } else if (type === undefined) {
+ return 'undefined';
+ }
+
+ return type;
+ };
+
+ /**
+ * Used to extend an array and copy it. This is used to propagate paths recursively.
+ *
+ * @param arr
+ * @param newValue
+ * @returns {Array}
+ */
+ exports.copyAndExtendArray = function (arr, newValue) {
+ var newArr = [];
+ for (var i = 0; i < arr.length; i++) {
+ newArr.push(arr[i]);
+ }
+ newArr.push(newValue);
+ return newArr;
+ };
+
+ /**
+ * Used to extend an array and copy it. This is used to propagate paths recursively.
+ *
+ * @param arr
+ * @param newValue
+ * @returns {Array}
+ */
+ exports.copyArray = function (arr) {
+ var newArr = [];
+ for (var i = 0; i < arr.length; i++) {
+ newArr.push(arr[i]);
+ }
+ return newArr;
+ };
+
+ /**
+ * Retrieve the absolute left value of a DOM element
+ * @param {Element} elem A dom element, for example a div
+ * @return {number} left The absolute left position of this element
+ * in the browser page.
+ */
+ exports.getAbsoluteLeft = function (elem) {
+ return elem.getBoundingClientRect().left;
+ };
+
+ /**
+ * Retrieve the absolute top value of a DOM element
+ * @param {Element} elem A dom element, for example a div
+ * @return {number} top The absolute top position of this element
+ * in the browser page.
+ */
+ exports.getAbsoluteTop = function (elem) {
+ return elem.getBoundingClientRect().top;
+ };
+
+ /**
+ * add a className to the given elements style
+ * @param {Element} elem
+ * @param {String} className
+ */
+ exports.addClassName = function (elem, className) {
+ var classes = elem.className.split(' ');
+ if (classes.indexOf(className) == -1) {
+ classes.push(className); // add the class to the array
+ elem.className = classes.join(' ');
+ }
+ };
+
+ /**
+ * add a className to the given elements style
+ * @param {Element} elem
+ * @param {String} className
+ */
+ exports.removeClassName = function (elem, className) {
+ var classes = elem.className.split(' ');
+ var index = classes.indexOf(className);
+ if (index != -1) {
+ classes.splice(index, 1); // remove the class from the array
+ elem.className = classes.join(' ');
+ }
+ };
+
+ /**
+ * For each method for both arrays and objects.
+ * In case of an array, the built-in Array.forEach() is applied.
+ * In case of an Object, the method loops over all properties of the object.
+ * @param {Object | Array} object An Object or Array
+ * @param {function} callback Callback method, called for each item in
+ * the object or array with three parameters:
+ * callback(value, index, object)
+ */
+ exports.forEach = function (object, callback) {
+ var i, len;
+ if (Array.isArray(object)) {
+ // array
+ for (i = 0, len = object.length; i < len; i++) {
+ callback(object[i], i, object);
+ }
+ } else {
+ // object
+ for (i in object) {
+ if (object.hasOwnProperty(i)) {
+ callback(object[i], i, object);
+ }
+ }
+ }
+ };
+
+ /**
+ * Convert an object into an array: all objects properties are put into the
+ * array. The resulting array is unordered.
+ * @param {Object} object
+ * @param {Array} array
+ */
+ exports.toArray = function (object) {
+ var array = [];
+
+ for (var prop in object) {
+ if (object.hasOwnProperty(prop)) array.push(object[prop]);
+ }
+
+ return array;
+ };
+
+ /**
+ * Update a property in an object
+ * @param {Object} object
+ * @param {String} key
+ * @param {*} value
+ * @return {Boolean} changed
+ */
+ exports.updateProperty = function (object, key, value) {
+ if (object[key] !== value) {
+ object[key] = value;
+ return true;
+ } else {
+ return false;
+ }
+ };
+
+ /**
+ * Throttle the given function to be only executed once every `wait` milliseconds
+ * @param {function} fn
+ * @param {number} wait Time in milliseconds
+ * @returns {function} Returns the throttled function
+ */
+ exports.throttle = function (fn, wait) {
+ var timeout = null;
+ var needExecution = false;
+
+ return function throttled() {
+ if (!timeout) {
+ needExecution = false;
+ fn();
+
+ timeout = setTimeout(function () {
+ timeout = null;
+ if (needExecution) {
+ throttled();
+ }
+ }, wait);
+ } else {
+ needExecution = true;
+ }
+ };
+ };
+
+ /**
+ * Add and event listener. Works for all browsers
+ * @param {Element} element An html element
+ * @param {string} action The action, for example "click",
+ * without the prefix "on"
+ * @param {function} listener The callback function to be executed
+ * @param {boolean} [useCapture]
+ */
+ exports.addEventListener = function (element, action, listener, useCapture) {
+ if (element.addEventListener) {
+ if (useCapture === undefined) useCapture = false;
+
+ if (action === 'mousewheel' && navigator.userAgent.indexOf('Firefox') >= 0) {
+ action = 'DOMMouseScroll'; // For Firefox
+ }
+
+ element.addEventListener(action, listener, useCapture);
+ } else {
+ element.attachEvent('on' + action, listener); // IE browsers
+ }
+ };
+
+ /**
+ * Remove an event listener from an element
+ * @param {Element} element An html dom element
+ * @param {string} action The name of the event, for example "mousedown"
+ * @param {function} listener The listener function
+ * @param {boolean} [useCapture]
+ */
+ exports.removeEventListener = function (element, action, listener, useCapture) {
+ if (element.removeEventListener) {
+ // non-IE browsers
+ if (useCapture === undefined) useCapture = false;
+
+ if (action === 'mousewheel' && navigator.userAgent.indexOf('Firefox') >= 0) {
+ action = 'DOMMouseScroll'; // For Firefox
+ }
+
+ element.removeEventListener(action, listener, useCapture);
+ } else {
+ // IE browsers
+ element.detachEvent('on' + action, listener);
+ }
+ };
+
+ /**
+ * Cancels the event if it is cancelable, without stopping further propagation of the event.
+ */
+ exports.preventDefault = function (event) {
+ if (!event) event = window.event;
+
+ if (event.preventDefault) {
+ event.preventDefault(); // non-IE browsers
+ } else {
+ event.returnValue = false; // IE browsers
+ }
+ };
+
+ /**
+ * Get HTML element which is the target of the event
+ * @param {Event} event
+ * @return {Element} target element
+ */
+ exports.getTarget = function (event) {
+ // code from http://www.quirksmode.org/js/events_properties.html
+ if (!event) {
+ event = window.event;
+ }
+
+ var target;
+
+ if (event.target) {
+ target = event.target;
+ } else if (event.srcElement) {
+ target = event.srcElement;
+ }
+
+ if (target.nodeType != undefined && target.nodeType == 3) {
+ // defeat Safari bug
+ target = target.parentNode;
+ }
+
+ return target;
+ };
+
+ /**
+ * Check if given element contains given parent somewhere in the DOM tree
+ * @param {Element} element
+ * @param {Element} parent
+ */
+ exports.hasParent = function (element, parent) {
+ var e = element;
+
+ while (e) {
+ if (e === parent) {
+ return true;
+ }
+ e = e.parentNode;
+ }
+
+ return false;
+ };
+
+ exports.option = {};
+
+ /**
+ * Convert a value into a boolean
+ * @param {Boolean | function | undefined} value
+ * @param {Boolean} [defaultValue]
+ * @returns {Boolean} bool
+ */
+ exports.option.asBoolean = function (value, defaultValue) {
+ if (typeof value == 'function') {
+ value = value();
+ }
+
+ if (value != null) {
+ return value != false;
+ }
+
+ return defaultValue || null;
+ };
+
+ /**
+ * Convert a value into a number
+ * @param {Boolean | function | undefined} value
+ * @param {Number} [defaultValue]
+ * @returns {Number} number
+ */
+ exports.option.asNumber = function (value, defaultValue) {
+ if (typeof value == 'function') {
+ value = value();
+ }
+
+ if (value != null) {
+ return Number(value) || defaultValue || null;
+ }
+
+ return defaultValue || null;
+ };
+
+ /**
+ * Convert a value into a string
+ * @param {String | function | undefined} value
+ * @param {String} [defaultValue]
+ * @returns {String} str
+ */
+ exports.option.asString = function (value, defaultValue) {
+ if (typeof value == 'function') {
+ value = value();
+ }
+
+ if (value != null) {
+ return String(value);
+ }
+
+ return defaultValue || null;
+ };
+
+ /**
+ * Convert a size or location into a string with pixels or a percentage
+ * @param {String | Number | function | undefined} value
+ * @param {String} [defaultValue]
+ * @returns {String} size
+ */
+ exports.option.asSize = function (value, defaultValue) {
+ if (typeof value == 'function') {
+ value = value();
+ }
+
+ if (exports.isString(value)) {
+ return value;
+ } else if (exports.isNumber(value)) {
+ return value + 'px';
+ } else {
+ return defaultValue || null;
+ }
+ };
+
+ /**
+ * Convert a value into a DOM element
+ * @param {HTMLElement | function | undefined} value
+ * @param {HTMLElement} [defaultValue]
+ * @returns {HTMLElement | null} dom
+ */
+ exports.option.asElement = function (value, defaultValue) {
+ if (typeof value == 'function') {
+ value = value();
+ }
+
+ return value || defaultValue || null;
+ };
+
+ /**
+ * http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb
+ *
+ * @param {String} hex
+ * @returns {{r: *, g: *, b: *}} | 255 range
+ */
+ exports.hexToRGB = function (hex) {
+ // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
+ var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
+ hex = hex.replace(shorthandRegex, function (m, r, g, b) {
+ return r + r + g + g + b + b;
+ });
+ var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
+ return result ? {
+ r: parseInt(result[1], 16),
+ g: parseInt(result[2], 16),
+ b: parseInt(result[3], 16)
+ } : null;
+ };
+
+ /**
+ * This function takes color in hex format or rgb() or rgba() format and overrides the opacity. Returns rgba() string.
+ * @param color
+ * @param opacity
+ * @returns {*}
+ */
+ exports.overrideOpacity = function (color, opacity) {
+ if (color.indexOf('rgba') != -1) {
+ return color;
+ } else if (color.indexOf('rgb') != -1) {
+ var rgb = color.substr(color.indexOf('(') + 1).replace(')', '').split(',');
+ return 'rgba(' + rgb[0] + ',' + rgb[1] + ',' + rgb[2] + ',' + opacity + ')';
+ } else {
+ var rgb = exports.hexToRGB(color);
+ if (rgb == null) {
+ return color;
+ } else {
+ return 'rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ',' + opacity + ')';
+ }
+ }
+ };
+
+ /**
+ *
+ * @param red 0 -- 255
+ * @param green 0 -- 255
+ * @param blue 0 -- 255
+ * @returns {string}
+ * @constructor
+ */
+ exports.RGBToHex = function (red, green, blue) {
+ return '#' + ((1 << 24) + (red << 16) + (green << 8) + blue).toString(16).slice(1);
+ };
+
+ /**
+ * Parse a color property into an object with border, background, and
+ * highlight colors
+ * @param {Object | String} color
+ * @return {Object} colorObject
+ */
+ exports.parseColor = function (color) {
+ var c;
+ if (exports.isString(color) === true) {
+ if (exports.isValidRGB(color) === true) {
+ var rgb = color.substr(4).substr(0, color.length - 5).split(',').map(function (value) {
+ return parseInt(value);
+ });
+ color = exports.RGBToHex(rgb[0], rgb[1], rgb[2]);
+ }
+ if (exports.isValidHex(color) === true) {
+ var hsv = exports.hexToHSV(color);
+ var lighterColorHSV = { h: hsv.h, s: hsv.s * 0.8, v: Math.min(1, hsv.v * 1.02) };
+ var darkerColorHSV = { h: hsv.h, s: Math.min(1, hsv.s * 1.25), v: hsv.v * 0.8 };
+ var darkerColorHex = exports.HSVToHex(darkerColorHSV.h, darkerColorHSV.s, darkerColorHSV.v);
+ var lighterColorHex = exports.HSVToHex(lighterColorHSV.h, lighterColorHSV.s, lighterColorHSV.v);
+ c = {
+ background: color,
+ border: darkerColorHex,
+ highlight: {
+ background: lighterColorHex,
+ border: darkerColorHex
+ },
+ hover: {
+ background: lighterColorHex,
+ border: darkerColorHex
+ }
+ };
+ } else {
+ c = {
+ background: color,
+ border: color,
+ highlight: {
+ background: color,
+ border: color
+ },
+ hover: {
+ background: color,
+ border: color
+ }
+ };
+ }
+ } else {
+ c = {};
+ c.background = color.background || undefined;
+ c.border = color.border || undefined;
+
+ if (exports.isString(color.highlight)) {
+ c.highlight = {
+ border: color.highlight,
+ background: color.highlight
+ };
+ } else {
+ c.highlight = {};
+ c.highlight.background = color.highlight && color.highlight.background || undefined;
+ c.highlight.border = color.highlight && color.highlight.border || undefined;
+ }
+
+ if (exports.isString(color.hover)) {
+ c.hover = {
+ border: color.hover,
+ background: color.hover
+ };
+ } else {
+ c.hover = {};
+ c.hover.background = color.hover && color.hover.background || undefined;
+ c.hover.border = color.hover && color.hover.border || undefined;
+ }
+ }
+
+ return c;
+ };
+
+ /**
+ * http://www.javascripter.net/faq/rgb2hsv.htm
+ *
+ * @param red
+ * @param green
+ * @param blue
+ * @returns {*}
+ * @constructor
+ */
+ exports.RGBToHSV = function (red, green, blue) {
+ red = red / 255;green = green / 255;blue = blue / 255;
+ var minRGB = Math.min(red, Math.min(green, blue));
+ var maxRGB = Math.max(red, Math.max(green, blue));
+
+ // Black-gray-white
+ if (minRGB == maxRGB) {
+ return { h: 0, s: 0, v: minRGB };
+ }
+
+ // Colors other than black-gray-white:
+ var d = red == minRGB ? green - blue : blue == minRGB ? red - green : blue - red;
+ var h = red == minRGB ? 3 : blue == minRGB ? 1 : 5;
+ var hue = 60 * (h - d / (maxRGB - minRGB)) / 360;
+ var saturation = (maxRGB - minRGB) / maxRGB;
+ var value = maxRGB;
+ return { h: hue, s: saturation, v: value };
+ };
+
+ var cssUtil = {
+ // split a string with css styles into an object with key/values
+ split: function split(cssText) {
+ var styles = {};
+
+ cssText.split(';').forEach(function (style) {
+ if (style.trim() != '') {
+ var parts = style.split(':');
+ var key = parts[0].trim();
+ var value = parts[1].trim();
+ styles[key] = value;
+ }
+ });
+
+ return styles;
+ },
+
+ // build a css text string from an object with key/values
+ join: function join(styles) {
+ return Object.keys(styles).map(function (key) {
+ return key + ': ' + styles[key];
+ }).join('; ');
+ }
+ };
+
+ /**
+ * Append a string with css styles to an element
+ * @param {Element} element
+ * @param {String} cssText
+ */
+ exports.addCssText = function (element, cssText) {
+ var currentStyles = cssUtil.split(element.style.cssText);
+ var newStyles = cssUtil.split(cssText);
+ var styles = exports.extend(currentStyles, newStyles);
+
+ element.style.cssText = cssUtil.join(styles);
+ };
+
+ /**
+ * Remove a string with css styles from an element
+ * @param {Element} element
+ * @param {String} cssText
+ */
+ exports.removeCssText = function (element, cssText) {
+ var styles = cssUtil.split(element.style.cssText);
+ var removeStyles = cssUtil.split(cssText);
+
+ for (var key in removeStyles) {
+ if (removeStyles.hasOwnProperty(key)) {
+ delete styles[key];
+ }
+ }
+
+ element.style.cssText = cssUtil.join(styles);
+ };
+
+ /**
+ * https://gist.github.com/mjijackson/5311256
+ * @param h
+ * @param s
+ * @param v
+ * @returns {{r: number, g: number, b: number}}
+ * @constructor
+ */
+ exports.HSVToRGB = function (h, s, v) {
+ var r, g, b;
+
+ var i = Math.floor(h * 6);
+ var f = h * 6 - i;
+ var p = v * (1 - s);
+ var q = v * (1 - f * s);
+ var t = v * (1 - (1 - f) * s);
+
+ switch (i % 6) {
+ case 0:
+ r = v, g = t, b = p;break;
+ case 1:
+ r = q, g = v, b = p;break;
+ case 2:
+ r = p, g = v, b = t;break;
+ case 3:
+ r = p, g = q, b = v;break;
+ case 4:
+ r = t, g = p, b = v;break;
+ case 5:
+ r = v, g = p, b = q;break;
+ }
+
+ return { r: Math.floor(r * 255), g: Math.floor(g * 255), b: Math.floor(b * 255) };
+ };
+
+ exports.HSVToHex = function (h, s, v) {
+ var rgb = exports.HSVToRGB(h, s, v);
+ return exports.RGBToHex(rgb.r, rgb.g, rgb.b);
+ };
+
+ exports.hexToHSV = function (hex) {
+ var rgb = exports.hexToRGB(hex);
+ return exports.RGBToHSV(rgb.r, rgb.g, rgb.b);
+ };
+
+ exports.isValidHex = function (hex) {
+ var isOk = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex);
+ return isOk;
+ };
+
+ exports.isValidRGB = function (rgb) {
+ rgb = rgb.replace(' ', '');
+ var isOk = /rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(rgb);
+ return isOk;
+ };
+ exports.isValidRGBA = function (rgba) {
+ rgba = rgba.replace(' ', '');
+ var isOk = /rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(rgba);
+ return isOk;
+ };
+
+ /**
+ * This recursively redirects the prototype of JSON objects to the referenceObject
+ * This is used for default options.
+ *
+ * @param referenceObject
+ * @returns {*}
+ */
+ exports.selectiveBridgeObject = function (fields, referenceObject) {
+ if (typeof referenceObject == 'object') {
+ var objectTo = Object.create(referenceObject);
+ for (var i = 0; i < fields.length; i++) {
+ if (referenceObject.hasOwnProperty(fields[i])) {
+ if (typeof referenceObject[fields[i]] == 'object') {
+ objectTo[fields[i]] = exports.bridgeObject(referenceObject[fields[i]]);
+ }
+ }
+ }
+ return objectTo;
+ } else {
+ return null;
+ }
+ };
+
+ /**
+ * This recursively redirects the prototype of JSON objects to the referenceObject
+ * This is used for default options.
+ *
+ * @param referenceObject
+ * @returns {*}
+ */
+ exports.bridgeObject = function (referenceObject) {
+ if (typeof referenceObject == 'object') {
+ var objectTo = Object.create(referenceObject);
+ for (var i in referenceObject) {
+ if (referenceObject.hasOwnProperty(i)) {
+ if (typeof referenceObject[i] == 'object') {
+ objectTo[i] = exports.bridgeObject(referenceObject[i]);
+ }
+ }
+ }
+ return objectTo;
+ } else {
+ return null;
+ }
+ };
+
+ /**
+ * this is used to set the options of subobjects in the options object. A requirement of these subobjects
+ * is that they have an 'enabled' element which is optional for the user but mandatory for the program.
+ *
+ * @param [object] mergeTarget | this is either this.options or the options used for the groups.
+ * @param [object] options | options
+ * @param [String] option | this is the option key in the options argument
+ * @private
+ */
+ exports.mergeOptions = function (mergeTarget, options, option) {
+ var allowDeletion = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
+ var globalOptions = arguments.length <= 4 || arguments[4] === undefined ? {} : arguments[4];
+
+ if (options[option] === null) {
+ mergeTarget[option] = Object.create(globalOptions[option]);
+ } else {
+ if (options[option] !== undefined) {
+ if (typeof options[option] === 'boolean') {
+ mergeTarget[option].enabled = options[option];
+ } else {
+ if (options[option].enabled === undefined) {
+ mergeTarget[option].enabled = true;
+ }
+ for (var prop in options[option]) {
+ if (options[option].hasOwnProperty(prop)) {
+ mergeTarget[option][prop] = options[option][prop];
+ }
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * This function does a binary search for a visible item in a sorted list. If we find a visible item, the code that uses
+ * this function will then iterate in both directions over this sorted list to find all visible items.
+ *
+ * @param {Item[]} orderedItems | Items ordered by start
+ * @param {function} searchFunction | -1 is lower, 0 is found, 1 is higher
+ * @param {String} field
+ * @param {String} field2
+ * @returns {number}
+ * @private
+ */
+ exports.binarySearchCustom = function (orderedItems, searchFunction, field, field2) {
+ var maxIterations = 10000;
+ var iteration = 0;
+ var low = 0;
+ var high = orderedItems.length - 1;
+
+ while (low <= high && iteration < maxIterations) {
+ var middle = Math.floor((low + high) / 2);
+
+ var item = orderedItems[middle];
+ var value = field2 === undefined ? item[field] : item[field][field2];
+
+ var searchResult = searchFunction(value);
+ if (searchResult == 0) {
+ // jihaa, found a visible item!
+ return middle;
+ } else if (searchResult == -1) {
+ // it is too small --> increase low
+ low = middle + 1;
+ } else {
+ // it is too big --> decrease high
+ high = middle - 1;
+ }
+
+ iteration++;
+ }
+
+ return -1;
+ };
+
+ /**
+ * This function does a binary search for a specific value in a sorted array. If it does not exist but is in between of
+ * two values, we return either the one before or the one after, depending on user input
+ * If it is found, we return the index, else -1.
+ *
+ * @param {Array} orderedItems
+ * @param {{start: number, end: number}} target
+ * @param {String} field
+ * @param {String} sidePreference 'before' or 'after'
+ * @returns {number}
+ * @private
+ */
+ exports.binarySearchValue = function (orderedItems, target, field, sidePreference) {
+ var maxIterations = 10000;
+ var iteration = 0;
+ var low = 0;
+ var high = orderedItems.length - 1;
+ var prevValue, value, nextValue, middle;
+
+ while (low <= high && iteration < maxIterations) {
+ // get a new guess
+ middle = Math.floor(0.5 * (high + low));
+ prevValue = orderedItems[Math.max(0, middle - 1)][field];
+ value = orderedItems[middle][field];
+ nextValue = orderedItems[Math.min(orderedItems.length - 1, middle + 1)][field];
+
+ if (value == target) {
+ // we found the target
+ return middle;
+ } else if (prevValue < target && value > target) {
+ // target is in between of the previous and the current
+ return sidePreference == 'before' ? Math.max(0, middle - 1) : middle;
+ } else if (value < target && nextValue > target) {
+ // target is in between of the current and the next
+ return sidePreference == 'before' ? middle : Math.min(orderedItems.length - 1, middle + 1);
+ } else {
+ // didnt find the target, we need to change our boundaries.
+ if (value < target) {
+ // it is too small --> increase low
+ low = middle + 1;
+ } else {
+ // it is too big --> decrease high
+ high = middle - 1;
+ }
+ }
+ iteration++;
+ }
+
+ // didnt find anything. Return -1.
+ return -1;
+ };
+
+ /*
+ * Easing Functions - inspired from http://gizma.com/easing/
+ * only considering the t value for the range [0, 1] => [0, 1]
+ * https://gist.github.com/gre/1650294
+ */
+ exports.easingFunctions = {
+ // no easing, no acceleration
+ linear: function linear(t) {
+ return t;
+ },
+ // accelerating from zero velocity
+ easeInQuad: function easeInQuad(t) {
+ return t * t;
+ },
+ // decelerating to zero velocity
+ easeOutQuad: function easeOutQuad(t) {
+ return t * (2 - t);
+ },
+ // acceleration until halfway, then deceleration
+ easeInOutQuad: function easeInOutQuad(t) {
+ return t < .5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
+ },
+ // accelerating from zero velocity
+ easeInCubic: function easeInCubic(t) {
+ return t * t * t;
+ },
+ // decelerating to zero velocity
+ easeOutCubic: function easeOutCubic(t) {
+ return --t * t * t + 1;
+ },
+ // acceleration until halfway, then deceleration
+ easeInOutCubic: function easeInOutCubic(t) {
+ return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
+ },
+ // accelerating from zero velocity
+ easeInQuart: function easeInQuart(t) {
+ return t * t * t * t;
+ },
+ // decelerating to zero velocity
+ easeOutQuart: function easeOutQuart(t) {
+ return 1 - --t * t * t * t;
+ },
+ // acceleration until halfway, then deceleration
+ easeInOutQuart: function easeInOutQuart(t) {
+ return t < .5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
+ },
+ // accelerating from zero velocity
+ easeInQuint: function easeInQuint(t) {
+ return t * t * t * t * t;
+ },
+ // decelerating to zero velocity
+ easeOutQuint: function easeOutQuint(t) {
+ return 1 + --t * t * t * t * t;
+ },
+ // acceleration until halfway, then deceleration
+ easeInOutQuint: function easeInOutQuint(t) {
+ return t < .5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
+ }
+ };
+
+/***/ },
+/* 2 */
+/***/ function(module, exports, __webpack_require__) {
+
+ // first check if moment.js is already loaded in the browser window, if so,
+ // use this instance. Else, load via commonjs.
+ 'use strict';
+
+ module.exports = typeof window !== 'undefined' && window['moment'] || __webpack_require__(3);
+
+/***/ },
+/* 3 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /* WEBPACK VAR INJECTION */(function(module) {//! moment.js
+ //! version : 2.10.6
+ //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
+ //! license : MIT
+ //! momentjs.com
+
+ (function (global, factory) {
+ true ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define(factory) :
+ global.moment = factory()
+ }(this, function () { 'use strict';
+
+ var hookCallback;
+
+ function utils_hooks__hooks () {
+ return hookCallback.apply(null, arguments);
+ }
+
+ // This is done to register the method called with moment()
+ // without creating circular dependencies.
+ function setHookCallback (callback) {
+ hookCallback = callback;
+ }
+
+ function isArray(input) {
+ return Object.prototype.toString.call(input) === '[object Array]';
+ }
+
+ function isDate(input) {
+ return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
+ }
+
+ function map(arr, fn) {
+ var res = [], i;
+ for (i = 0; i < arr.length; ++i) {
+ res.push(fn(arr[i], i));
+ }
+ return res;
+ }
+
+ function hasOwnProp(a, b) {
+ return Object.prototype.hasOwnProperty.call(a, b);
+ }
+
+ function extend(a, b) {
+ for (var i in b) {
+ if (hasOwnProp(b, i)) {
+ a[i] = b[i];
+ }
+ }
+
+ if (hasOwnProp(b, 'toString')) {
+ a.toString = b.toString;
+ }
+
+ if (hasOwnProp(b, 'valueOf')) {
+ a.valueOf = b.valueOf;
+ }
+
+ return a;
+ }
+
+ function create_utc__createUTC (input, format, locale, strict) {
+ return createLocalOrUTC(input, format, locale, strict, true).utc();
+ }
+
+ function defaultParsingFlags() {
+ // We need to deep clone this object.
+ return {
+ empty : false,
+ unusedTokens : [],
+ unusedInput : [],
+ overflow : -2,
+ charsLeftOver : 0,
+ nullInput : false,
+ invalidMonth : null,
+ invalidFormat : false,
+ userInvalidated : false,
+ iso : false
+ };
+ }
+
+ function getParsingFlags(m) {
+ if (m._pf == null) {
+ m._pf = defaultParsingFlags();
+ }
+ return m._pf;
+ }
+
+ function valid__isValid(m) {
+ if (m._isValid == null) {
+ var flags = getParsingFlags(m);
+ m._isValid = !isNaN(m._d.getTime()) &&
+ flags.overflow < 0 &&
+ !flags.empty &&
+ !flags.invalidMonth &&
+ !flags.invalidWeekday &&
+ !flags.nullInput &&
+ !flags.invalidFormat &&
+ !flags.userInvalidated;
+
+ if (m._strict) {
+ m._isValid = m._isValid &&
+ flags.charsLeftOver === 0 &&
+ flags.unusedTokens.length === 0 &&
+ flags.bigHour === undefined;
+ }
+ }
+ return m._isValid;
+ }
+
+ function valid__createInvalid (flags) {
+ var m = create_utc__createUTC(NaN);
+ if (flags != null) {
+ extend(getParsingFlags(m), flags);
+ }
+ else {
+ getParsingFlags(m).userInvalidated = true;
+ }
+
+ return m;
+ }
+
+ var momentProperties = utils_hooks__hooks.momentProperties = [];
+
+ function copyConfig(to, from) {
+ var i, prop, val;
+
+ if (typeof from._isAMomentObject !== 'undefined') {
+ to._isAMomentObject = from._isAMomentObject;
+ }
+ if (typeof from._i !== 'undefined') {
+ to._i = from._i;
+ }
+ if (typeof from._f !== 'undefined') {
+ to._f = from._f;
+ }
+ if (typeof from._l !== 'undefined') {
+ to._l = from._l;
+ }
+ if (typeof from._strict !== 'undefined') {
+ to._strict = from._strict;
+ }
+ if (typeof from._tzm !== 'undefined') {
+ to._tzm = from._tzm;
+ }
+ if (typeof from._isUTC !== 'undefined') {
+ to._isUTC = from._isUTC;
+ }
+ if (typeof from._offset !== 'undefined') {
+ to._offset = from._offset;
+ }
+ if (typeof from._pf !== 'undefined') {
+ to._pf = getParsingFlags(from);
+ }
+ if (typeof from._locale !== 'undefined') {
+ to._locale = from._locale;
+ }
+
+ if (momentProperties.length > 0) {
+ for (i in momentProperties) {
+ prop = momentProperties[i];
+ val = from[prop];
+ if (typeof val !== 'undefined') {
+ to[prop] = val;
+ }
+ }
+ }
+
+ return to;
+ }
+
+ var updateInProgress = false;
+
+ // Moment prototype object
+ function Moment(config) {
+ copyConfig(this, config);
+ this._d = new Date(config._d != null ? config._d.getTime() : NaN);
+ // Prevent infinite loop in case updateOffset creates new moment
+ // objects.
+ if (updateInProgress === false) {
+ updateInProgress = true;
+ utils_hooks__hooks.updateOffset(this);
+ updateInProgress = false;
+ }
+ }
+
+ function isMoment (obj) {
+ return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
+ }
+
+ function absFloor (number) {
+ if (number < 0) {
+ return Math.ceil(number);
+ } else {
+ return Math.floor(number);
+ }
+ }
+
+ function toInt(argumentForCoercion) {
+ var coercedNumber = +argumentForCoercion,
+ value = 0;
+
+ if (coercedNumber !== 0 && isFinite(coercedNumber)) {
+ value = absFloor(coercedNumber);
+ }
+
+ return value;
+ }
+
+ function compareArrays(array1, array2, dontConvert) {
+ var len = Math.min(array1.length, array2.length),
+ lengthDiff = Math.abs(array1.length - array2.length),
+ diffs = 0,
+ i;
+ for (i = 0; i < len; i++) {
+ if ((dontConvert && array1[i] !== array2[i]) ||
+ (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
+ diffs++;
+ }
+ }
+ return diffs + lengthDiff;
+ }
+
+ function Locale() {
+ }
+
+ var locales = {};
+ var globalLocale;
+
+ function normalizeLocale(key) {
+ return key ? key.toLowerCase().replace('_', '-') : key;
+ }
+
+ // pick the locale from the array
+ // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
+ // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
+ function chooseLocale(names) {
+ var i = 0, j, next, locale, split;
+
+ while (i < names.length) {
+ split = normalizeLocale(names[i]).split('-');
+ j = split.length;
+ next = normalizeLocale(names[i + 1]);
+ next = next ? next.split('-') : null;
+ while (j > 0) {
+ locale = loadLocale(split.slice(0, j).join('-'));
+ if (locale) {
+ return locale;
+ }
+ if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
+ //the next array item is better than a shallower substring of this one
+ break;
+ }
+ j--;
+ }
+ i++;
+ }
+ return null;
+ }
+
+ function loadLocale(name) {
+ var oldLocale = null;
+ // TODO: Find a better way to register and load all the locales in Node
+ if (!locales[name] && typeof module !== 'undefined' &&
+ module && module.exports) {
+ try {
+ oldLocale = globalLocale._abbr;
+ !(function webpackMissingModule() { var e = new Error("Cannot find module \"./locale\""); e.code = 'MODULE_NOT_FOUND'; throw e; }());
+ // because defineLocale currently also sets the global locale, we
+ // want to undo that for lazy loaded locales
+ locale_locales__getSetGlobalLocale(oldLocale);
+ } catch (e) { }
+ }
+ return locales[name];
+ }
+
+ // This function will load locale and then set the global locale. If
+ // no arguments are passed in, it will simply return the current global
+ // locale key.
+ function locale_locales__getSetGlobalLocale (key, values) {
+ var data;
+ if (key) {
+ if (typeof values === 'undefined') {
+ data = locale_locales__getLocale(key);
+ }
+ else {
+ data = defineLocale(key, values);
+ }
+
+ if (data) {
+ // moment.duration._locale = moment._locale = data;
+ globalLocale = data;
+ }
+ }
+
+ return globalLocale._abbr;
+ }
+
+ function defineLocale (name, values) {
+ if (values !== null) {
+ values.abbr = name;
+ locales[name] = locales[name] || new Locale();
+ locales[name].set(values);
+
+ // backwards compat for now: also set the locale
+ locale_locales__getSetGlobalLocale(name);
+
+ return locales[name];
+ } else {
+ // useful for testing
+ delete locales[name];
+ return null;
+ }
+ }
+
+ // returns locale data
+ function locale_locales__getLocale (key) {
+ var locale;
+
+ if (key && key._locale && key._locale._abbr) {
+ key = key._locale._abbr;
+ }
+
+ if (!key) {
+ return globalLocale;
+ }
+
+ if (!isArray(key)) {
+ //short-circuit everything else
+ locale = loadLocale(key);
+ if (locale) {
+ return locale;
+ }
+ key = [key];
+ }
+
+ return chooseLocale(key);
+ }
+
+ var aliases = {};
+
+ function addUnitAlias (unit, shorthand) {
+ var lowerCase = unit.toLowerCase();
+ aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
+ }
+
+ function normalizeUnits(units) {
+ return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
+ }
+
+ function normalizeObjectUnits(inputObject) {
+ var normalizedInput = {},
+ normalizedProp,
+ prop;
+
+ for (prop in inputObject) {
+ if (hasOwnProp(inputObject, prop)) {
+ normalizedProp = normalizeUnits(prop);
+ if (normalizedProp) {
+ normalizedInput[normalizedProp] = inputObject[prop];
+ }
+ }
+ }
+
+ return normalizedInput;
+ }
+
+ function makeGetSet (unit, keepTime) {
+ return function (value) {
+ if (value != null) {
+ get_set__set(this, unit, value);
+ utils_hooks__hooks.updateOffset(this, keepTime);
+ return this;
+ } else {
+ return get_set__get(this, unit);
+ }
+ };
+ }
+
+ function get_set__get (mom, unit) {
+ return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]();
+ }
+
+ function get_set__set (mom, unit, value) {
+ return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
+ }
+
+ // MOMENTS
+
+ function getSet (units, value) {
+ var unit;
+ if (typeof units === 'object') {
+ for (unit in units) {
+ this.set(unit, units[unit]);
+ }
+ } else {
+ units = normalizeUnits(units);
+ if (typeof this[units] === 'function') {
+ return this[units](value);
+ }
+ }
+ return this;
+ }
+
+ function zeroFill(number, targetLength, forceSign) {
+ var absNumber = '' + Math.abs(number),
+ zerosToFill = targetLength - absNumber.length,
+ sign = number >= 0;
+ return (sign ? (forceSign ? '+' : '') : '-') +
+ Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
+ }
+
+ var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
+
+ var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
+
+ var formatFunctions = {};
+
+ var formatTokenFunctions = {};
+
+ // token: 'M'
+ // padded: ['MM', 2]
+ // ordinal: 'Mo'
+ // callback: function () { this.month() + 1 }
+ function addFormatToken (token, padded, ordinal, callback) {
+ var func = callback;
+ if (typeof callback === 'string') {
+ func = function () {
+ return this[callback]();
+ };
+ }
+ if (token) {
+ formatTokenFunctions[token] = func;
+ }
+ if (padded) {
+ formatTokenFunctions[padded[0]] = function () {
+ return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
+ };
+ }
+ if (ordinal) {
+ formatTokenFunctions[ordinal] = function () {
+ return this.localeData().ordinal(func.apply(this, arguments), token);
+ };
+ }
+ }
+
+ function removeFormattingTokens(input) {
+ if (input.match(/\[[\s\S]/)) {
+ return input.replace(/^\[|\]$/g, '');
+ }
+ return input.replace(/\\/g, '');
+ }
+
+ function makeFormatFunction(format) {
+ var array = format.match(formattingTokens), i, length;
+
+ for (i = 0, length = array.length; i < length; i++) {
+ if (formatTokenFunctions[array[i]]) {
+ array[i] = formatTokenFunctions[array[i]];
+ } else {
+ array[i] = removeFormattingTokens(array[i]);
+ }
+ }
+
+ return function (mom) {
+ var output = '';
+ for (i = 0; i < length; i++) {
+ output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
+ }
+ return output;
+ };
+ }
+
+ // format date using native date object
+ function formatMoment(m, format) {
+ if (!m.isValid()) {
+ return m.localeData().invalidDate();
+ }
+
+ format = expandFormat(format, m.localeData());
+ formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
+
+ return formatFunctions[format](m);
+ }
+
+ function expandFormat(format, locale) {
+ var i = 5;
+
+ function replaceLongDateFormatTokens(input) {
+ return locale.longDateFormat(input) || input;
+ }
+
+ localFormattingTokens.lastIndex = 0;
+ while (i >= 0 && localFormattingTokens.test(format)) {
+ format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
+ localFormattingTokens.lastIndex = 0;
+ i -= 1;
+ }
+
+ return format;
+ }
+
+ var match1 = /\d/; // 0 - 9
+ var match2 = /\d\d/; // 00 - 99
+ var match3 = /\d{3}/; // 000 - 999
+ var match4 = /\d{4}/; // 0000 - 9999
+ var match6 = /[+-]?\d{6}/; // -999999 - 999999
+ var match1to2 = /\d\d?/; // 0 - 99
+ var match1to3 = /\d{1,3}/; // 0 - 999
+ var match1to4 = /\d{1,4}/; // 0 - 9999
+ var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
+
+ var matchUnsigned = /\d+/; // 0 - inf
+ var matchSigned = /[+-]?\d+/; // -inf - inf
+
+ var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
+
+ var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
+
+ // any word (or two) characters or numbers including two/three word month in arabic.
+ var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
+
+ var regexes = {};
+
+ function isFunction (sth) {
+ // https://github.com/moment/moment/issues/2325
+ return typeof sth === 'function' &&
+ Object.prototype.toString.call(sth) === '[object Function]';
+ }
+
+
+ function addRegexToken (token, regex, strictRegex) {
+ regexes[token] = isFunction(regex) ? regex : function (isStrict) {
+ return (isStrict && strictRegex) ? strictRegex : regex;
+ };
+ }
+
+ function getParseRegexForToken (token, config) {
+ if (!hasOwnProp(regexes, token)) {
+ return new RegExp(unescapeFormat(token));
+ }
+
+ return regexes[token](config._strict, config._locale);
+ }
+
+ // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
+ function unescapeFormat(s) {
+ return s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
+ return p1 || p2 || p3 || p4;
+ }).replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
+ }
+
+ var tokens = {};
+
+ function addParseToken (token, callback) {
+ var i, func = callback;
+ if (typeof token === 'string') {
+ token = [token];
+ }
+ if (typeof callback === 'number') {
+ func = function (input, array) {
+ array[callback] = toInt(input);
+ };
+ }
+ for (i = 0; i < token.length; i++) {
+ tokens[token[i]] = func;
+ }
+ }
+
+ function addWeekParseToken (token, callback) {
+ addParseToken(token, function (input, array, config, token) {
+ config._w = config._w || {};
+ callback(input, config._w, config, token);
+ });
+ }
+
+ function addTimeToArrayFromToken(token, input, config) {
+ if (input != null && hasOwnProp(tokens, token)) {
+ tokens[token](input, config._a, config, token);
+ }
+ }
+
+ var YEAR = 0;
+ var MONTH = 1;
+ var DATE = 2;
+ var HOUR = 3;
+ var MINUTE = 4;
+ var SECOND = 5;
+ var MILLISECOND = 6;
+
+ function daysInMonth(year, month) {
+ return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
+ }
+
+ // FORMATTING
+
+ addFormatToken('M', ['MM', 2], 'Mo', function () {
+ return this.month() + 1;
+ });
+
+ addFormatToken('MMM', 0, 0, function (format) {
+ return this.localeData().monthsShort(this, format);
+ });
+
+ addFormatToken('MMMM', 0, 0, function (format) {
+ return this.localeData().months(this, format);
+ });
+
+ // ALIASES
+
+ addUnitAlias('month', 'M');
+
+ // PARSING
+
+ addRegexToken('M', match1to2);
+ addRegexToken('MM', match1to2, match2);
+ addRegexToken('MMM', matchWord);
+ addRegexToken('MMMM', matchWord);
+
+ addParseToken(['M', 'MM'], function (input, array) {
+ array[MONTH] = toInt(input) - 1;
+ });
+
+ addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
+ var month = config._locale.monthsParse(input, token, config._strict);
+ // if we didn't find a month name, mark the date as invalid.
+ if (month != null) {
+ array[MONTH] = month;
+ } else {
+ getParsingFlags(config).invalidMonth = input;
+ }
+ });
+
+ // LOCALES
+
+ var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
+ function localeMonths (m) {
+ return this._months[m.month()];
+ }
+
+ var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
+ function localeMonthsShort (m) {
+ return this._monthsShort[m.month()];
+ }
+
+ function localeMonthsParse (monthName, format, strict) {
+ var i, mom, regex;
+
+ if (!this._monthsParse) {
+ this._monthsParse = [];
+ this._longMonthsParse = [];
+ this._shortMonthsParse = [];
+ }
+
+ for (i = 0; i < 12; i++) {
+ // make the regex if we don't have it already
+ mom = create_utc__createUTC([2000, i]);
+ if (strict && !this._longMonthsParse[i]) {
+ this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
+ this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
+ }
+ if (!strict && !this._monthsParse[i]) {
+ regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
+ this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
+ }
+ // test the regex
+ if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
+ return i;
+ } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
+ return i;
+ } else if (!strict && this._monthsParse[i].test(monthName)) {
+ return i;
+ }
+ }
+ }
+
+ // MOMENTS
+
+ function setMonth (mom, value) {
+ var dayOfMonth;
+
+ // TODO: Move this out of here!
+ if (typeof value === 'string') {
+ value = mom.localeData().monthsParse(value);
+ // TODO: Another silent failure?
+ if (typeof value !== 'number') {
+ return mom;
+ }
+ }
+
+ dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
+ mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
+ return mom;
+ }
+
+ function getSetMonth (value) {
+ if (value != null) {
+ setMonth(this, value);
+ utils_hooks__hooks.updateOffset(this, true);
+ return this;
+ } else {
+ return get_set__get(this, 'Month');
+ }
+ }
+
+ function getDaysInMonth () {
+ return daysInMonth(this.year(), this.month());
+ }
+
+ function checkOverflow (m) {
+ var overflow;
+ var a = m._a;
+
+ if (a && getParsingFlags(m).overflow === -2) {
+ overflow =
+ a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
+ a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
+ a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
+ a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
+ a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
+ a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
+ -1;
+
+ if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
+ overflow = DATE;
+ }
+
+ getParsingFlags(m).overflow = overflow;
+ }
+
+ return m;
+ }
+
+ function warn(msg) {
+ if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) {
+ console.warn('Deprecation warning: ' + msg);
+ }
+ }
+
+ function deprecate(msg, fn) {
+ var firstTime = true;
+
+ return extend(function () {
+ if (firstTime) {
+ warn(msg + '\n' + (new Error()).stack);
+ firstTime = false;
+ }
+ return fn.apply(this, arguments);
+ }, fn);
+ }
+
+ var deprecations = {};
+
+ function deprecateSimple(name, msg) {
+ if (!deprecations[name]) {
+ warn(msg);
+ deprecations[name] = true;
+ }
+ }
+
+ utils_hooks__hooks.suppressDeprecationWarnings = false;
+
+ var from_string__isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
+
+ var isoDates = [
+ ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/],
+ ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/],
+ ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/],
+ ['GGGG-[W]WW', /\d{4}-W\d{2}/],
+ ['YYYY-DDD', /\d{4}-\d{3}/]
+ ];
+
+ // iso time formats and regexes
+ var isoTimes = [
+ ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/],
+ ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/],
+ ['HH:mm', /(T| )\d\d:\d\d/],
+ ['HH', /(T| )\d\d/]
+ ];
+
+ var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
+
+ // date from iso format
+ function configFromISO(config) {
+ var i, l,
+ string = config._i,
+ match = from_string__isoRegex.exec(string);
+
+ if (match) {
+ getParsingFlags(config).iso = true;
+ for (i = 0, l = isoDates.length; i < l; i++) {
+ if (isoDates[i][1].exec(string)) {
+ config._f = isoDates[i][0];
+ break;
+ }
+ }
+ for (i = 0, l = isoTimes.length; i < l; i++) {
+ if (isoTimes[i][1].exec(string)) {
+ // match[6] should be 'T' or space
+ config._f += (match[6] || ' ') + isoTimes[i][0];
+ break;
+ }
+ }
+ if (string.match(matchOffset)) {
+ config._f += 'Z';
+ }
+ configFromStringAndFormat(config);
+ } else {
+ config._isValid = false;
+ }
+ }
+
+ // date from iso format or fallback
+ function configFromString(config) {
+ var matched = aspNetJsonRegex.exec(config._i);
+
+ if (matched !== null) {
+ config._d = new Date(+matched[1]);
+ return;
+ }
+
+ configFromISO(config);
+ if (config._isValid === false) {
+ delete config._isValid;
+ utils_hooks__hooks.createFromInputFallback(config);
+ }
+ }
+
+ utils_hooks__hooks.createFromInputFallback = deprecate(
+ 'moment construction falls back to js Date. This is ' +
+ 'discouraged and will be removed in upcoming major ' +
+ 'release. Please refer to ' +
+ 'https://github.com/moment/moment/issues/1407 for more info.',
+ function (config) {
+ config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
+ }
+ );
+
+ function createDate (y, m, d, h, M, s, ms) {
+ //can't just apply() to create a date:
+ //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
+ var date = new Date(y, m, d, h, M, s, ms);
+
+ //the date constructor doesn't accept years < 1970
+ if (y < 1970) {
+ date.setFullYear(y);
+ }
+ return date;
+ }
+
+ function createUTCDate (y) {
+ var date = new Date(Date.UTC.apply(null, arguments));
+ if (y < 1970) {
+ date.setUTCFullYear(y);
+ }
+ return date;
+ }
+
+ addFormatToken(0, ['YY', 2], 0, function () {
+ return this.year() % 100;
+ });
+
+ addFormatToken(0, ['YYYY', 4], 0, 'year');
+ addFormatToken(0, ['YYYYY', 5], 0, 'year');
+ addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
+
+ // ALIASES
+
+ addUnitAlias('year', 'y');
+
+ // PARSING
+
+ addRegexToken('Y', matchSigned);
+ addRegexToken('YY', match1to2, match2);
+ addRegexToken('YYYY', match1to4, match4);
+ addRegexToken('YYYYY', match1to6, match6);
+ addRegexToken('YYYYYY', match1to6, match6);
+
+ addParseToken(['YYYYY', 'YYYYYY'], YEAR);
+ addParseToken('YYYY', function (input, array) {
+ array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input);
+ });
+ addParseToken('YY', function (input, array) {
+ array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input);
+ });
+
+ // HELPERS
+
+ function daysInYear(year) {
+ return isLeapYear(year) ? 366 : 365;
+ }
+
+ function isLeapYear(year) {
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
+ }
+
+ // HOOKS
+
+ utils_hooks__hooks.parseTwoDigitYear = function (input) {
+ return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
+ };
+
+ // MOMENTS
+
+ var getSetYear = makeGetSet('FullYear', false);
+
+ function getIsLeapYear () {
+ return isLeapYear(this.year());
+ }
+
+ addFormatToken('w', ['ww', 2], 'wo', 'week');
+ addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
+
+ // ALIASES
+
+ addUnitAlias('week', 'w');
+ addUnitAlias('isoWeek', 'W');
+
+ // PARSING
+
+ addRegexToken('w', match1to2);
+ addRegexToken('ww', match1to2, match2);
+ addRegexToken('W', match1to2);
+ addRegexToken('WW', match1to2, match2);
+
+ addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
+ week[token.substr(0, 1)] = toInt(input);
+ });
+
+ // HELPERS
+
+ // firstDayOfWeek 0 = sun, 6 = sat
+ // the day of the week that starts the week
+ // (usually sunday or monday)
+ // firstDayOfWeekOfYear 0 = sun, 6 = sat
+ // the first week is the week that contains the first
+ // of this day of the week
+ // (eg. ISO weeks use thursday (4))
+ function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {
+ var end = firstDayOfWeekOfYear - firstDayOfWeek,
+ daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(),
+ adjustedMoment;
+
+
+ if (daysToDayOfWeek > end) {
+ daysToDayOfWeek -= 7;
+ }
+
+ if (daysToDayOfWeek < end - 7) {
+ daysToDayOfWeek += 7;
+ }
+
+ adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd');
+ return {
+ week: Math.ceil(adjustedMoment.dayOfYear() / 7),
+ year: adjustedMoment.year()
+ };
+ }
+
+ // LOCALES
+
+ function localeWeek (mom) {
+ return weekOfYear(mom, this._week.dow, this._week.doy).week;
+ }
+
+ var defaultLocaleWeek = {
+ dow : 0, // Sunday is the first day of the week.
+ doy : 6 // The week that contains Jan 1st is the first week of the year.
+ };
+
+ function localeFirstDayOfWeek () {
+ return this._week.dow;
+ }
+
+ function localeFirstDayOfYear () {
+ return this._week.doy;
+ }
+
+ // MOMENTS
+
+ function getSetWeek (input) {
+ var week = this.localeData().week(this);
+ return input == null ? week : this.add((input - week) * 7, 'd');
+ }
+
+ function getSetISOWeek (input) {
+ var week = weekOfYear(this, 1, 4).week;
+ return input == null ? week : this.add((input - week) * 7, 'd');
+ }
+
+ addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
+
+ // ALIASES
+
+ addUnitAlias('dayOfYear', 'DDD');
+
+ // PARSING
+
+ addRegexToken('DDD', match1to3);
+ addRegexToken('DDDD', match3);
+ addParseToken(['DDD', 'DDDD'], function (input, array, config) {
+ config._dayOfYear = toInt(input);
+ });
+
+ // HELPERS
+
+ //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
+ function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) {
+ var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear;
+ if (d < firstDayOfWeek) {
+ d += 7;
+ }
+
+ weekday = weekday != null ? 1 * weekday : firstDayOfWeek;
+
+ dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday;
+
+ return {
+ year: dayOfYear > 0 ? year : year - 1,
+ dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear
+ };
+ }
+
+ // MOMENTS
+
+ function getSetDayOfYear (input) {
+ var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
+ return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
+ }
+
+ // Pick the first defined of two or three arguments.
+ function defaults(a, b, c) {
+ if (a != null) {
+ return a;
+ }
+ if (b != null) {
+ return b;
+ }
+ return c;
+ }
+
+ function currentDateArray(config) {
+ var now = new Date();
+ if (config._useUTC) {
+ return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()];
+ }
+ return [now.getFullYear(), now.getMonth(), now.getDate()];
+ }
+
+ // convert an array to a date.
+ // the array should mirror the parameters below
+ // note: all values past the year are optional and will default to the lowest possible value.
+ // [year, month, day , hour, minute, second, millisecond]
+ function configFromArray (config) {
+ var i, date, input = [], currentDate, yearToUse;
+
+ if (config._d) {
+ return;
+ }
+
+ currentDate = currentDateArray(config);
+
+ //compute day of the year from weeks and weekdays
+ if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
+ dayOfYearFromWeekInfo(config);
+ }
+
+ //if the day of the year is set, figure out what it is
+ if (config._dayOfYear) {
+ yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
+
+ if (config._dayOfYear > daysInYear(yearToUse)) {
+ getParsingFlags(config)._overflowDayOfYear = true;
+ }
+
+ date = createUTCDate(yearToUse, 0, config._dayOfYear);
+ config._a[MONTH] = date.getUTCMonth();
+ config._a[DATE] = date.getUTCDate();
+ }
+
+ // Default to current date.
+ // * if no year, month, day of month are given, default to today
+ // * if day of month is given, default month and year
+ // * if month is given, default only year
+ // * if year is given, don't default anything
+ for (i = 0; i < 3 && config._a[i] == null; ++i) {
+ config._a[i] = input[i] = currentDate[i];
+ }
+
+ // Zero out whatever was not defaulted, including time
+ for (; i < 7; i++) {
+ config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
+ }
+
+ // Check for 24:00:00.000
+ if (config._a[HOUR] === 24 &&
+ config._a[MINUTE] === 0 &&
+ config._a[SECOND] === 0 &&
+ config._a[MILLISECOND] === 0) {
+ config._nextDay = true;
+ config._a[HOUR] = 0;
+ }
+
+ config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
+ // Apply timezone offset from input. The actual utcOffset can be changed
+ // with parseZone.
+ if (config._tzm != null) {
+ config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
+ }
+
+ if (config._nextDay) {
+ config._a[HOUR] = 24;
+ }
+ }
+
+ function dayOfYearFromWeekInfo(config) {
+ var w, weekYear, week, weekday, dow, doy, temp;
+
+ w = config._w;
+ if (w.GG != null || w.W != null || w.E != null) {
+ dow = 1;
+ doy = 4;
+
+ // TODO: We need to take the current isoWeekYear, but that depends on
+ // how we interpret now (local, utc, fixed offset). So create
+ // a now version of current config (take local/utc/offset flags, and
+ // create now).
+ weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year);
+ week = defaults(w.W, 1);
+ weekday = defaults(w.E, 1);
+ } else {
+ dow = config._locale._week.dow;
+ doy = config._locale._week.doy;
+
+ weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year);
+ week = defaults(w.w, 1);
+
+ if (w.d != null) {
+ // weekday -- low day numbers are considered next week
+ weekday = w.d;
+ if (weekday < dow) {
+ ++week;
+ }
+ } else if (w.e != null) {
+ // local weekday -- counting starts from begining of week
+ weekday = w.e + dow;
+ } else {
+ // default to begining of week
+ weekday = dow;
+ }
+ }
+ temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow);
+
+ config._a[YEAR] = temp.year;
+ config._dayOfYear = temp.dayOfYear;
+ }
+
+ utils_hooks__hooks.ISO_8601 = function () {};
+
+ // date from string and format string
+ function configFromStringAndFormat(config) {
+ // TODO: Move this to another part of the creation flow to prevent circular deps
+ if (config._f === utils_hooks__hooks.ISO_8601) {
+ configFromISO(config);
+ return;
+ }
+
+ config._a = [];
+ getParsingFlags(config).empty = true;
+
+ // This array is used to make a Date, either with `new Date` or `Date.UTC`
+ var string = '' + config._i,
+ i, parsedInput, tokens, token, skipped,
+ stringLength = string.length,
+ totalParsedInputLength = 0;
+
+ tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
+
+ for (i = 0; i < tokens.length; i++) {
+ token = tokens[i];
+ parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
+ if (parsedInput) {
+ skipped = string.substr(0, string.indexOf(parsedInput));
+ if (skipped.length > 0) {
+ getParsingFlags(config).unusedInput.push(skipped);
+ }
+ string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
+ totalParsedInputLength += parsedInput.length;
+ }
+ // don't parse if it's not a known token
+ if (formatTokenFunctions[token]) {
+ if (parsedInput) {
+ getParsingFlags(config).empty = false;
+ }
+ else {
+ getParsingFlags(config).unusedTokens.push(token);
+ }
+ addTimeToArrayFromToken(token, parsedInput, config);
+ }
+ else if (config._strict && !parsedInput) {
+ getParsingFlags(config).unusedTokens.push(token);
+ }
+ }
+
+ // add remaining unparsed input length to the string
+ getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
+ if (string.length > 0) {
+ getParsingFlags(config).unusedInput.push(string);
+ }
+
+ // clear _12h flag if hour is <= 12
+ if (getParsingFlags(config).bigHour === true &&
+ config._a[HOUR] <= 12 &&
+ config._a[HOUR] > 0) {
+ getParsingFlags(config).bigHour = undefined;
+ }
+ // handle meridiem
+ config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
+
+ configFromArray(config);
+ checkOverflow(config);
+ }
+
+
+ function meridiemFixWrap (locale, hour, meridiem) {
+ var isPm;
+
+ if (meridiem == null) {
+ // nothing to do
+ return hour;
+ }
+ if (locale.meridiemHour != null) {
+ return locale.meridiemHour(hour, meridiem);
+ } else if (locale.isPM != null) {
+ // Fallback
+ isPm = locale.isPM(meridiem);
+ if (isPm && hour < 12) {
+ hour += 12;
+ }
+ if (!isPm && hour === 12) {
+ hour = 0;
+ }
+ return hour;
+ } else {
+ // this is not supposed to happen
+ return hour;
+ }
+ }
+
+ function configFromStringAndArray(config) {
+ var tempConfig,
+ bestMoment,
+
+ scoreToBeat,
+ i,
+ currentScore;
+
+ if (config._f.length === 0) {
+ getParsingFlags(config).invalidFormat = true;
+ config._d = new Date(NaN);
+ return;
+ }
+
+ for (i = 0; i < config._f.length; i++) {
+ currentScore = 0;
+ tempConfig = copyConfig({}, config);
+ if (config._useUTC != null) {
+ tempConfig._useUTC = config._useUTC;
+ }
+ tempConfig._f = config._f[i];
+ configFromStringAndFormat(tempConfig);
+
+ if (!valid__isValid(tempConfig)) {
+ continue;
+ }
+
+ // if there is any input that was not parsed add a penalty for that format
+ currentScore += getParsingFlags(tempConfig).charsLeftOver;
+
+ //or tokens
+ currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
+
+ getParsingFlags(tempConfig).score = currentScore;
+
+ if (scoreToBeat == null || currentScore < scoreToBeat) {
+ scoreToBeat = currentScore;
+ bestMoment = tempConfig;
+ }
+ }
+
+ extend(config, bestMoment || tempConfig);
+ }
+
+ function configFromObject(config) {
+ if (config._d) {
+ return;
+ }
+
+ var i = normalizeObjectUnits(config._i);
+ config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond];
+
+ configFromArray(config);
+ }
+
+ function createFromConfig (config) {
+ var res = new Moment(checkOverflow(prepareConfig(config)));
+ if (res._nextDay) {
+ // Adding is smart enough around DST
+ res.add(1, 'd');
+ res._nextDay = undefined;
+ }
+
+ return res;
+ }
+
+ function prepareConfig (config) {
+ var input = config._i,
+ format = config._f;
+
+ config._locale = config._locale || locale_locales__getLocale(config._l);
+
+ if (input === null || (format === undefined && input === '')) {
+ return valid__createInvalid({nullInput: true});
+ }
+
+ if (typeof input === 'string') {
+ config._i = input = config._locale.preparse(input);
+ }
+
+ if (isMoment(input)) {
+ return new Moment(checkOverflow(input));
+ } else if (isArray(format)) {
+ configFromStringAndArray(config);
+ } else if (format) {
+ configFromStringAndFormat(config);
+ } else if (isDate(input)) {
+ config._d = input;
+ } else {
+ configFromInput(config);
+ }
+
+ return config;
+ }
+
+ function configFromInput(config) {
+ var input = config._i;
+ if (input === undefined) {
+ config._d = new Date();
+ } else if (isDate(input)) {
+ config._d = new Date(+input);
+ } else if (typeof input === 'string') {
+ configFromString(config);
+ } else if (isArray(input)) {
+ config._a = map(input.slice(0), function (obj) {
+ return parseInt(obj, 10);
+ });
+ configFromArray(config);
+ } else if (typeof(input) === 'object') {
+ configFromObject(config);
+ } else if (typeof(input) === 'number') {
+ // from milliseconds
+ config._d = new Date(input);
+ } else {
+ utils_hooks__hooks.createFromInputFallback(config);
+ }
+ }
+
+ function createLocalOrUTC (input, format, locale, strict, isUTC) {
+ var c = {};
+
+ if (typeof(locale) === 'boolean') {
+ strict = locale;
+ locale = undefined;
+ }
+ // object construction must be done this way.
+ // https://github.com/moment/moment/issues/1423
+ c._isAMomentObject = true;
+ c._useUTC = c._isUTC = isUTC;
+ c._l = locale;
+ c._i = input;
+ c._f = format;
+ c._strict = strict;
+
+ return createFromConfig(c);
+ }
+
+ function local__createLocal (input, format, locale, strict) {
+ return createLocalOrUTC(input, format, locale, strict, false);
+ }
+
+ var prototypeMin = deprecate(
+ 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548',
+ function () {
+ var other = local__createLocal.apply(null, arguments);
+ return other < this ? this : other;
+ }
+ );
+
+ var prototypeMax = deprecate(
+ 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548',
+ function () {
+ var other = local__createLocal.apply(null, arguments);
+ return other > this ? this : other;
+ }
+ );
+
+ // Pick a moment m from moments so that m[fn](other) is true for all
+ // other. This relies on the function fn to be transitive.
+ //
+ // moments should either be an array of moment objects or an array, whose
+ // first element is an array of moment objects.
+ function pickBy(fn, moments) {
+ var res, i;
+ if (moments.length === 1 && isArray(moments[0])) {
+ moments = moments[0];
+ }
+ if (!moments.length) {
+ return local__createLocal();
+ }
+ res = moments[0];
+ for (i = 1; i < moments.length; ++i) {
+ if (!moments[i].isValid() || moments[i][fn](res)) {
+ res = moments[i];
+ }
+ }
+ return res;
+ }
+
+ // TODO: Use [].sort instead?
+ function min () {
+ var args = [].slice.call(arguments, 0);
+
+ return pickBy('isBefore', args);
+ }
+
+ function max () {
+ var args = [].slice.call(arguments, 0);
+
+ return pickBy('isAfter', args);
+ }
+
+ function Duration (duration) {
+ var normalizedInput = normalizeObjectUnits(duration),
+ years = normalizedInput.year || 0,
+ quarters = normalizedInput.quarter || 0,
+ months = normalizedInput.month || 0,
+ weeks = normalizedInput.week || 0,
+ days = normalizedInput.day || 0,
+ hours = normalizedInput.hour || 0,
+ minutes = normalizedInput.minute || 0,
+ seconds = normalizedInput.second || 0,
+ milliseconds = normalizedInput.millisecond || 0;
+
+ // representation for dateAddRemove
+ this._milliseconds = +milliseconds +
+ seconds * 1e3 + // 1000
+ minutes * 6e4 + // 1000 * 60
+ hours * 36e5; // 1000 * 60 * 60
+ // Because of dateAddRemove treats 24 hours as different from a
+ // day when working around DST, we need to store them separately
+ this._days = +days +
+ weeks * 7;
+ // It is impossible translate months into days without knowing
+ // which months you are are talking about, so we have to store
+ // it separately.
+ this._months = +months +
+ quarters * 3 +
+ years * 12;
+
+ this._data = {};
+
+ this._locale = locale_locales__getLocale();
+
+ this._bubble();
+ }
+
+ function isDuration (obj) {
+ return obj instanceof Duration;
+ }
+
+ function offset (token, separator) {
+ addFormatToken(token, 0, 0, function () {
+ var offset = this.utcOffset();
+ var sign = '+';
+ if (offset < 0) {
+ offset = -offset;
+ sign = '-';
+ }
+ return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
+ });
+ }
+
+ offset('Z', ':');
+ offset('ZZ', '');
+
+ // PARSING
+
+ addRegexToken('Z', matchOffset);
+ addRegexToken('ZZ', matchOffset);
+ addParseToken(['Z', 'ZZ'], function (input, array, config) {
+ config._useUTC = true;
+ config._tzm = offsetFromString(input);
+ });
+
+ // HELPERS
+
+ // timezone chunker
+ // '+10:00' > ['10', '00']
+ // '-1530' > ['-15', '30']
+ var chunkOffset = /([\+\-]|\d\d)/gi;
+
+ function offsetFromString(string) {
+ var matches = ((string || '').match(matchOffset) || []);
+ var chunk = matches[matches.length - 1] || [];
+ var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
+ var minutes = +(parts[1] * 60) + toInt(parts[2]);
+
+ return parts[0] === '+' ? minutes : -minutes;
+ }
+
+ // Return a moment from input, that is local/utc/zone equivalent to model.
+ function cloneWithOffset(input, model) {
+ var res, diff;
+ if (model._isUTC) {
+ res = model.clone();
+ diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);
+ // Use low-level api, because this fn is low-level api.
+ res._d.setTime(+res._d + diff);
+ utils_hooks__hooks.updateOffset(res, false);
+ return res;
+ } else {
+ return local__createLocal(input).local();
+ }
+ }
+
+ function getDateOffset (m) {
+ // On Firefox.24 Date#getTimezoneOffset returns a floating point.
+ // https://github.com/moment/moment/pull/1871
+ return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
+ }
+
+ // HOOKS
+
+ // This function will be called whenever a moment is mutated.
+ // It is intended to keep the offset in sync with the timezone.
+ utils_hooks__hooks.updateOffset = function () {};
+
+ // MOMENTS
+
+ // keepLocalTime = true means only change the timezone, without
+ // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
+ // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
+ // +0200, so we adjust the time as needed, to be valid.
+ //
+ // Keeping the time actually adds/subtracts (one hour)
+ // from the actual represented time. That is why we call updateOffset
+ // a second time. In case it wants us to change the offset again
+ // _changeInProgress == true case, then we have to adjust, because
+ // there is no such time in the given timezone.
+ function getSetOffset (input, keepLocalTime) {
+ var offset = this._offset || 0,
+ localAdjust;
+ if (input != null) {
+ if (typeof input === 'string') {
+ input = offsetFromString(input);
+ }
+ if (Math.abs(input) < 16) {
+ input = input * 60;
+ }
+ if (!this._isUTC && keepLocalTime) {
+ localAdjust = getDateOffset(this);
+ }
+ this._offset = input;
+ this._isUTC = true;
+ if (localAdjust != null) {
+ this.add(localAdjust, 'm');
+ }
+ if (offset !== input) {
+ if (!keepLocalTime || this._changeInProgress) {
+ add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);
+ } else if (!this._changeInProgress) {
+ this._changeInProgress = true;
+ utils_hooks__hooks.updateOffset(this, true);
+ this._changeInProgress = null;
+ }
+ }
+ return this;
+ } else {
+ return this._isUTC ? offset : getDateOffset(this);
+ }
+ }
+
+ function getSetZone (input, keepLocalTime) {
+ if (input != null) {
+ if (typeof input !== 'string') {
+ input = -input;
+ }
+
+ this.utcOffset(input, keepLocalTime);
+
+ return this;
+ } else {
+ return -this.utcOffset();
+ }
+ }
+
+ function setOffsetToUTC (keepLocalTime) {
+ return this.utcOffset(0, keepLocalTime);
+ }
+
+ function setOffsetToLocal (keepLocalTime) {
+ if (this._isUTC) {
+ this.utcOffset(0, keepLocalTime);
+ this._isUTC = false;
+
+ if (keepLocalTime) {
+ this.subtract(getDateOffset(this), 'm');
+ }
+ }
+ return this;
+ }
+
+ function setOffsetToParsedOffset () {
+ if (this._tzm) {
+ this.utcOffset(this._tzm);
+ } else if (typeof this._i === 'string') {
+ this.utcOffset(offsetFromString(this._i));
+ }
+ return this;
+ }
+
+ function hasAlignedHourOffset (input) {
+ input = input ? local__createLocal(input).utcOffset() : 0;
+
+ return (this.utcOffset() - input) % 60 === 0;
+ }
+
+ function isDaylightSavingTime () {
+ return (
+ this.utcOffset() > this.clone().month(0).utcOffset() ||
+ this.utcOffset() > this.clone().month(5).utcOffset()
+ );
+ }
+
+ function isDaylightSavingTimeShifted () {
+ if (typeof this._isDSTShifted !== 'undefined') {
+ return this._isDSTShifted;
+ }
+
+ var c = {};
+
+ copyConfig(c, this);
+ c = prepareConfig(c);
+
+ if (c._a) {
+ var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a);
+ this._isDSTShifted = this.isValid() &&
+ compareArrays(c._a, other.toArray()) > 0;
+ } else {
+ this._isDSTShifted = false;
+ }
+
+ return this._isDSTShifted;
+ }
+
+ function isLocal () {
+ return !this._isUTC;
+ }
+
+ function isUtcOffset () {
+ return this._isUTC;
+ }
+
+ function isUtc () {
+ return this._isUTC && this._offset === 0;
+ }
+
+ var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/;
+
+ // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
+ // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
+ var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;
+
+ function create__createDuration (input, key) {
+ var duration = input,
+ // matching against regexp is expensive, do it on demand
+ match = null,
+ sign,
+ ret,
+ diffRes;
+
+ if (isDuration(input)) {
+ duration = {
+ ms : input._milliseconds,
+ d : input._days,
+ M : input._months
+ };
+ } else if (typeof input === 'number') {
+ duration = {};
+ if (key) {
+ duration[key] = input;
+ } else {
+ duration.milliseconds = input;
+ }
+ } else if (!!(match = aspNetRegex.exec(input))) {
+ sign = (match[1] === '-') ? -1 : 1;
+ duration = {
+ y : 0,
+ d : toInt(match[DATE]) * sign,
+ h : toInt(match[HOUR]) * sign,
+ m : toInt(match[MINUTE]) * sign,
+ s : toInt(match[SECOND]) * sign,
+ ms : toInt(match[MILLISECOND]) * sign
+ };
+ } else if (!!(match = create__isoRegex.exec(input))) {
+ sign = (match[1] === '-') ? -1 : 1;
+ duration = {
+ y : parseIso(match[2], sign),
+ M : parseIso(match[3], sign),
+ d : parseIso(match[4], sign),
+ h : parseIso(match[5], sign),
+ m : parseIso(match[6], sign),
+ s : parseIso(match[7], sign),
+ w : parseIso(match[8], sign)
+ };
+ } else if (duration == null) {// checks for null or undefined
+ duration = {};
+ } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
+ diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to));
+
+ duration = {};
+ duration.ms = diffRes.milliseconds;
+ duration.M = diffRes.months;
+ }
+
+ ret = new Duration(duration);
+
+ if (isDuration(input) && hasOwnProp(input, '_locale')) {
+ ret._locale = input._locale;
+ }
+
+ return ret;
+ }
+
+ create__createDuration.fn = Duration.prototype;
+
+ function parseIso (inp, sign) {
+ // We'd normally use ~~inp for this, but unfortunately it also
+ // converts floats to ints.
+ // inp may be undefined, so careful calling replace on it.
+ var res = inp && parseFloat(inp.replace(',', '.'));
+ // apply sign while we're at it
+ return (isNaN(res) ? 0 : res) * sign;
+ }
+
+ function positiveMomentsDifference(base, other) {
+ var res = {milliseconds: 0, months: 0};
+
+ res.months = other.month() - base.month() +
+ (other.year() - base.year()) * 12;
+ if (base.clone().add(res.months, 'M').isAfter(other)) {
+ --res.months;
+ }
+
+ res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
+
+ return res;
+ }
+
+ function momentsDifference(base, other) {
+ var res;
+ other = cloneWithOffset(other, base);
+ if (base.isBefore(other)) {
+ res = positiveMomentsDifference(base, other);
+ } else {
+ res = positiveMomentsDifference(other, base);
+ res.milliseconds = -res.milliseconds;
+ res.months = -res.months;
+ }
+
+ return res;
+ }
+
+ function createAdder(direction, name) {
+ return function (val, period) {
+ var dur, tmp;
+ //invert the arguments, but complain about it
+ if (period !== null && !isNaN(+period)) {
+ deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).');
+ tmp = val; val = period; period = tmp;
+ }
+
+ val = typeof val === 'string' ? +val : val;
+ dur = create__createDuration(val, period);
+ add_subtract__addSubtract(this, dur, direction);
+ return this;
+ };
+ }
+
+ function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) {
+ var milliseconds = duration._milliseconds,
+ days = duration._days,
+ months = duration._months;
+ updateOffset = updateOffset == null ? true : updateOffset;
+
+ if (milliseconds) {
+ mom._d.setTime(+mom._d + milliseconds * isAdding);
+ }
+ if (days) {
+ get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding);
+ }
+ if (months) {
+ setMonth(mom, get_set__get(mom, 'Month') + months * isAdding);
+ }
+ if (updateOffset) {
+ utils_hooks__hooks.updateOffset(mom, days || months);
+ }
+ }
+
+ var add_subtract__add = createAdder(1, 'add');
+ var add_subtract__subtract = createAdder(-1, 'subtract');
+
+ function moment_calendar__calendar (time, formats) {
+ // We want to compare the start of today, vs this.
+ // Getting start-of-today depends on whether we're local/utc/offset or not.
+ var now = time || local__createLocal(),
+ sod = cloneWithOffset(now, this).startOf('day'),
+ diff = this.diff(sod, 'days', true),
+ format = diff < -6 ? 'sameElse' :
+ diff < -1 ? 'lastWeek' :
+ diff < 0 ? 'lastDay' :
+ diff < 1 ? 'sameDay' :
+ diff < 2 ? 'nextDay' :
+ diff < 7 ? 'nextWeek' : 'sameElse';
+ return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now)));
+ }
+
+ function clone () {
+ return new Moment(this);
+ }
+
+ function isAfter (input, units) {
+ var inputMs;
+ units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');
+ if (units === 'millisecond') {
+ input = isMoment(input) ? input : local__createLocal(input);
+ return +this > +input;
+ } else {
+ inputMs = isMoment(input) ? +input : +local__createLocal(input);
+ return inputMs < +this.clone().startOf(units);
+ }
+ }
+
+ function isBefore (input, units) {
+ var inputMs;
+ units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');
+ if (units === 'millisecond') {
+ input = isMoment(input) ? input : local__createLocal(input);
+ return +this < +input;
+ } else {
+ inputMs = isMoment(input) ? +input : +local__createLocal(input);
+ return +this.clone().endOf(units) < inputMs;
+ }
+ }
+
+ function isBetween (from, to, units) {
+ return this.isAfter(from, units) && this.isBefore(to, units);
+ }
+
+ function isSame (input, units) {
+ var inputMs;
+ units = normalizeUnits(units || 'millisecond');
+ if (units === 'millisecond') {
+ input = isMoment(input) ? input : local__createLocal(input);
+ return +this === +input;
+ } else {
+ inputMs = +local__createLocal(input);
+ return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units));
+ }
+ }
+
+ function diff (input, units, asFloat) {
+ var that = cloneWithOffset(input, this),
+ zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4,
+ delta, output;
+
+ units = normalizeUnits(units);
+
+ if (units === 'year' || units === 'month' || units === 'quarter') {
+ output = monthDiff(this, that);
+ if (units === 'quarter') {
+ output = output / 3;
+ } else if (units === 'year') {
+ output = output / 12;
+ }
+ } else {
+ delta = this - that;
+ output = units === 'second' ? delta / 1e3 : // 1000
+ units === 'minute' ? delta / 6e4 : // 1000 * 60
+ units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
+ units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
+ units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
+ delta;
+ }
+ return asFloat ? output : absFloor(output);
+ }
+
+ function monthDiff (a, b) {
+ // difference in months
+ var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
+ // b is in (anchor - 1 month, anchor + 1 month)
+ anchor = a.clone().add(wholeMonthDiff, 'months'),
+ anchor2, adjust;
+
+ if (b - anchor < 0) {
+ anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
+ // linear across the month
+ adjust = (b - anchor) / (anchor - anchor2);
+ } else {
+ anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
+ // linear across the month
+ adjust = (b - anchor) / (anchor2 - anchor);
+ }
+
+ return -(wholeMonthDiff + adjust);
+ }
+
+ utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
+
+ function toString () {
+ return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
+ }
+
+ function moment_format__toISOString () {
+ var m = this.clone().utc();
+ if (0 < m.year() && m.year() <= 9999) {
+ if ('function' === typeof Date.prototype.toISOString) {
+ // native implementation is ~50x faster, use it when we can
+ return this.toDate().toISOString();
+ } else {
+ return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
+ }
+ } else {
+ return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
+ }
+ }
+
+ function format (inputString) {
+ var output = formatMoment(this, inputString || utils_hooks__hooks.defaultFormat);
+ return this.localeData().postformat(output);
+ }
+
+ function from (time, withoutSuffix) {
+ if (!this.isValid()) {
+ return this.localeData().invalidDate();
+ }
+ return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
+ }
+
+ function fromNow (withoutSuffix) {
+ return this.from(local__createLocal(), withoutSuffix);
+ }
+
+ function to (time, withoutSuffix) {
+ if (!this.isValid()) {
+ return this.localeData().invalidDate();
+ }
+ return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
+ }
+
+ function toNow (withoutSuffix) {
+ return this.to(local__createLocal(), withoutSuffix);
+ }
+
+ function locale (key) {
+ var newLocaleData;
+
+ if (key === undefined) {
+ return this._locale._abbr;
+ } else {
+ newLocaleData = locale_locales__getLocale(key);
+ if (newLocaleData != null) {
+ this._locale = newLocaleData;
+ }
+ return this;
+ }
+ }
+
+ var lang = deprecate(
+ 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
+ function (key) {
+ if (key === undefined) {
+ return this.localeData();
+ } else {
+ return this.locale(key);
+ }
+ }
+ );
+
+ function localeData () {
+ return this._locale;
+ }
+
+ function startOf (units) {
+ units = normalizeUnits(units);
+ // the following switch intentionally omits break keywords
+ // to utilize falling through the cases.
+ switch (units) {
+ case 'year':
+ this.month(0);
+ /* falls through */
+ case 'quarter':
+ case 'month':
+ this.date(1);
+ /* falls through */
+ case 'week':
+ case 'isoWeek':
+ case 'day':
+ this.hours(0);
+ /* falls through */
+ case 'hour':
+ this.minutes(0);
+ /* falls through */
+ case 'minute':
+ this.seconds(0);
+ /* falls through */
+ case 'second':
+ this.milliseconds(0);
+ }
+
+ // weeks are a special case
+ if (units === 'week') {
+ this.weekday(0);
+ }
+ if (units === 'isoWeek') {
+ this.isoWeekday(1);
+ }
+
+ // quarters are also special
+ if (units === 'quarter') {
+ this.month(Math.floor(this.month() / 3) * 3);
+ }
+
+ return this;
+ }
+
+ function endOf (units) {
+ units = normalizeUnits(units);
+ if (units === undefined || units === 'millisecond') {
+ return this;
+ }
+ return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
+ }
+
+ function to_type__valueOf () {
+ return +this._d - ((this._offset || 0) * 60000);
+ }
+
+ function unix () {
+ return Math.floor(+this / 1000);
+ }
+
+ function toDate () {
+ return this._offset ? new Date(+this) : this._d;
+ }
+
+ function toArray () {
+ var m = this;
+ return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
+ }
+
+ function toObject () {
+ var m = this;
+ return {
+ years: m.year(),
+ months: m.month(),
+ date: m.date(),
+ hours: m.hours(),
+ minutes: m.minutes(),
+ seconds: m.seconds(),
+ milliseconds: m.milliseconds()
+ };
+ }
+
+ function moment_valid__isValid () {
+ return valid__isValid(this);
+ }
+
+ function parsingFlags () {
+ return extend({}, getParsingFlags(this));
+ }
+
+ function invalidAt () {
+ return getParsingFlags(this).overflow;
+ }
+
+ addFormatToken(0, ['gg', 2], 0, function () {
+ return this.weekYear() % 100;
+ });
+
+ addFormatToken(0, ['GG', 2], 0, function () {
+ return this.isoWeekYear() % 100;
+ });
+
+ function addWeekYearFormatToken (token, getter) {
+ addFormatToken(0, [token, token.length], 0, getter);
+ }
+
+ addWeekYearFormatToken('gggg', 'weekYear');
+ addWeekYearFormatToken('ggggg', 'weekYear');
+ addWeekYearFormatToken('GGGG', 'isoWeekYear');
+ addWeekYearFormatToken('GGGGG', 'isoWeekYear');
+
+ // ALIASES
+
+ addUnitAlias('weekYear', 'gg');
+ addUnitAlias('isoWeekYear', 'GG');
+
+ // PARSING
+
+ addRegexToken('G', matchSigned);
+ addRegexToken('g', matchSigned);
+ addRegexToken('GG', match1to2, match2);
+ addRegexToken('gg', match1to2, match2);
+ addRegexToken('GGGG', match1to4, match4);
+ addRegexToken('gggg', match1to4, match4);
+ addRegexToken('GGGGG', match1to6, match6);
+ addRegexToken('ggggg', match1to6, match6);
+
+ addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
+ week[token.substr(0, 2)] = toInt(input);
+ });
+
+ addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
+ week[token] = utils_hooks__hooks.parseTwoDigitYear(input);
+ });
+
+ // HELPERS
+
+ function weeksInYear(year, dow, doy) {
+ return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week;
+ }
+
+ // MOMENTS
+
+ function getSetWeekYear (input) {
+ var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year;
+ return input == null ? year : this.add((input - year), 'y');
+ }
+
+ function getSetISOWeekYear (input) {
+ var year = weekOfYear(this, 1, 4).year;
+ return input == null ? year : this.add((input - year), 'y');
+ }
+
+ function getISOWeeksInYear () {
+ return weeksInYear(this.year(), 1, 4);
+ }
+
+ function getWeeksInYear () {
+ var weekInfo = this.localeData()._week;
+ return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
+ }
+
+ addFormatToken('Q', 0, 0, 'quarter');
+
+ // ALIASES
+
+ addUnitAlias('quarter', 'Q');
+
+ // PARSING
+
+ addRegexToken('Q', match1);
+ addParseToken('Q', function (input, array) {
+ array[MONTH] = (toInt(input) - 1) * 3;
+ });
+
+ // MOMENTS
+
+ function getSetQuarter (input) {
+ return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
+ }
+
+ addFormatToken('D', ['DD', 2], 'Do', 'date');
+
+ // ALIASES
+
+ addUnitAlias('date', 'D');
+
+ // PARSING
+
+ addRegexToken('D', match1to2);
+ addRegexToken('DD', match1to2, match2);
+ addRegexToken('Do', function (isStrict, locale) {
+ return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
+ });
+
+ addParseToken(['D', 'DD'], DATE);
+ addParseToken('Do', function (input, array) {
+ array[DATE] = toInt(input.match(match1to2)[0], 10);
+ });
+
+ // MOMENTS
+
+ var getSetDayOfMonth = makeGetSet('Date', true);
+
+ addFormatToken('d', 0, 'do', 'day');
+
+ addFormatToken('dd', 0, 0, function (format) {
+ return this.localeData().weekdaysMin(this, format);
+ });
+
+ addFormatToken('ddd', 0, 0, function (format) {
+ return this.localeData().weekdaysShort(this, format);
+ });
+
+ addFormatToken('dddd', 0, 0, function (format) {
+ return this.localeData().weekdays(this, format);
+ });
+
+ addFormatToken('e', 0, 0, 'weekday');
+ addFormatToken('E', 0, 0, 'isoWeekday');
+
+ // ALIASES
+
+ addUnitAlias('day', 'd');
+ addUnitAlias('weekday', 'e');
+ addUnitAlias('isoWeekday', 'E');
+
+ // PARSING
+
+ addRegexToken('d', match1to2);
+ addRegexToken('e', match1to2);
+ addRegexToken('E', match1to2);
+ addRegexToken('dd', matchWord);
+ addRegexToken('ddd', matchWord);
+ addRegexToken('dddd', matchWord);
+
+ addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) {
+ var weekday = config._locale.weekdaysParse(input);
+ // if we didn't get a weekday name, mark the date as invalid
+ if (weekday != null) {
+ week.d = weekday;
+ } else {
+ getParsingFlags(config).invalidWeekday = input;
+ }
+ });
+
+ addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
+ week[token] = toInt(input);
+ });
+
+ // HELPERS
+
+ function parseWeekday(input, locale) {
+ if (typeof input !== 'string') {
+ return input;
+ }
+
+ if (!isNaN(input)) {
+ return parseInt(input, 10);
+ }
+
+ input = locale.weekdaysParse(input);
+ if (typeof input === 'number') {
+ return input;
+ }
+
+ return null;
+ }
+
+ // LOCALES
+
+ var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
+ function localeWeekdays (m) {
+ return this._weekdays[m.day()];
+ }
+
+ var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
+ function localeWeekdaysShort (m) {
+ return this._weekdaysShort[m.day()];
+ }
+
+ var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
+ function localeWeekdaysMin (m) {
+ return this._weekdaysMin[m.day()];
+ }
+
+ function localeWeekdaysParse (weekdayName) {
+ var i, mom, regex;
+
+ this._weekdaysParse = this._weekdaysParse || [];
+
+ for (i = 0; i < 7; i++) {
+ // make the regex if we don't have it already
+ if (!this._weekdaysParse[i]) {
+ mom = local__createLocal([2000, 1]).day(i);
+ regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
+ this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
+ }
+ // test the regex
+ if (this._weekdaysParse[i].test(weekdayName)) {
+ return i;
+ }
+ }
+ }
+
+ // MOMENTS
+
+ function getSetDayOfWeek (input) {
+ var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
+ if (input != null) {
+ input = parseWeekday(input, this.localeData());
+ return this.add(input - day, 'd');
+ } else {
+ return day;
+ }
+ }
+
+ function getSetLocaleDayOfWeek (input) {
+ var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
+ return input == null ? weekday : this.add(input - weekday, 'd');
+ }
+
+ function getSetISODayOfWeek (input) {
+ // behaves the same as moment#day except
+ // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
+ // as a setter, sunday should belong to the previous week.
+ return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7);
+ }
+
+ addFormatToken('H', ['HH', 2], 0, 'hour');
+ addFormatToken('h', ['hh', 2], 0, function () {
+ return this.hours() % 12 || 12;
+ });
+
+ function meridiem (token, lowercase) {
+ addFormatToken(token, 0, 0, function () {
+ return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
+ });
+ }
+
+ meridiem('a', true);
+ meridiem('A', false);
+
+ // ALIASES
+
+ addUnitAlias('hour', 'h');
+
+ // PARSING
+
+ function matchMeridiem (isStrict, locale) {
+ return locale._meridiemParse;
+ }
+
+ addRegexToken('a', matchMeridiem);
+ addRegexToken('A', matchMeridiem);
+ addRegexToken('H', match1to2);
+ addRegexToken('h', match1to2);
+ addRegexToken('HH', match1to2, match2);
+ addRegexToken('hh', match1to2, match2);
+
+ addParseToken(['H', 'HH'], HOUR);
+ addParseToken(['a', 'A'], function (input, array, config) {
+ config._isPm = config._locale.isPM(input);
+ config._meridiem = input;
+ });
+ addParseToken(['h', 'hh'], function (input, array, config) {
+ array[HOUR] = toInt(input);
+ getParsingFlags(config).bigHour = true;
+ });
+
+ // LOCALES
+
+ function localeIsPM (input) {
+ // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
+ // Using charAt should be more compatible.
+ return ((input + '').toLowerCase().charAt(0) === 'p');
+ }
+
+ var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
+ function localeMeridiem (hours, minutes, isLower) {
+ if (hours > 11) {
+ return isLower ? 'pm' : 'PM';
+ } else {
+ return isLower ? 'am' : 'AM';
+ }
+ }
+
+
+ // MOMENTS
+
+ // Setting the hour should keep the time, because the user explicitly
+ // specified which hour he wants. So trying to maintain the same hour (in
+ // a new timezone) makes sense. Adding/subtracting hours does not follow
+ // this rule.
+ var getSetHour = makeGetSet('Hours', true);
+
+ addFormatToken('m', ['mm', 2], 0, 'minute');
+
+ // ALIASES
+
+ addUnitAlias('minute', 'm');
+
+ // PARSING
+
+ addRegexToken('m', match1to2);
+ addRegexToken('mm', match1to2, match2);
+ addParseToken(['m', 'mm'], MINUTE);
+
+ // MOMENTS
+
+ var getSetMinute = makeGetSet('Minutes', false);
+
+ addFormatToken('s', ['ss', 2], 0, 'second');
+
+ // ALIASES
+
+ addUnitAlias('second', 's');
+
+ // PARSING
+
+ addRegexToken('s', match1to2);
+ addRegexToken('ss', match1to2, match2);
+ addParseToken(['s', 'ss'], SECOND);
+
+ // MOMENTS
+
+ var getSetSecond = makeGetSet('Seconds', false);
+
+ addFormatToken('S', 0, 0, function () {
+ return ~~(this.millisecond() / 100);
+ });
+
+ addFormatToken(0, ['SS', 2], 0, function () {
+ return ~~(this.millisecond() / 10);
+ });
+
+ addFormatToken(0, ['SSS', 3], 0, 'millisecond');
+ addFormatToken(0, ['SSSS', 4], 0, function () {
+ return this.millisecond() * 10;
+ });
+ addFormatToken(0, ['SSSSS', 5], 0, function () {
+ return this.millisecond() * 100;
+ });
+ addFormatToken(0, ['SSSSSS', 6], 0, function () {
+ return this.millisecond() * 1000;
+ });
+ addFormatToken(0, ['SSSSSSS', 7], 0, function () {
+ return this.millisecond() * 10000;
+ });
+ addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
+ return this.millisecond() * 100000;
+ });
+ addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
+ return this.millisecond() * 1000000;
+ });
+
+
+ // ALIASES
+
+ addUnitAlias('millisecond', 'ms');
+
+ // PARSING
+
+ addRegexToken('S', match1to3, match1);
+ addRegexToken('SS', match1to3, match2);
+ addRegexToken('SSS', match1to3, match3);
+
+ var token;
+ for (token = 'SSSS'; token.length <= 9; token += 'S') {
+ addRegexToken(token, matchUnsigned);
+ }
+
+ function parseMs(input, array) {
+ array[MILLISECOND] = toInt(('0.' + input) * 1000);
+ }
+
+ for (token = 'S'; token.length <= 9; token += 'S') {
+ addParseToken(token, parseMs);
+ }
+ // MOMENTS
+
+ var getSetMillisecond = makeGetSet('Milliseconds', false);
+
+ addFormatToken('z', 0, 0, 'zoneAbbr');
+ addFormatToken('zz', 0, 0, 'zoneName');
+
+ // MOMENTS
+
+ function getZoneAbbr () {
+ return this._isUTC ? 'UTC' : '';
+ }
+
+ function getZoneName () {
+ return this._isUTC ? 'Coordinated Universal Time' : '';
+ }
+
+ var momentPrototype__proto = Moment.prototype;
+
+ momentPrototype__proto.add = add_subtract__add;
+ momentPrototype__proto.calendar = moment_calendar__calendar;
+ momentPrototype__proto.clone = clone;
+ momentPrototype__proto.diff = diff;
+ momentPrototype__proto.endOf = endOf;
+ momentPrototype__proto.format = format;
+ momentPrototype__proto.from = from;
+ momentPrototype__proto.fromNow = fromNow;
+ momentPrototype__proto.to = to;
+ momentPrototype__proto.toNow = toNow;
+ momentPrototype__proto.get = getSet;
+ momentPrototype__proto.invalidAt = invalidAt;
+ momentPrototype__proto.isAfter = isAfter;
+ momentPrototype__proto.isBefore = isBefore;
+ momentPrototype__proto.isBetween = isBetween;
+ momentPrototype__proto.isSame = isSame;
+ momentPrototype__proto.isValid = moment_valid__isValid;
+ momentPrototype__proto.lang = lang;
+ momentPrototype__proto.locale = locale;
+ momentPrototype__proto.localeData = localeData;
+ momentPrototype__proto.max = prototypeMax;
+ momentPrototype__proto.min = prototypeMin;
+ momentPrototype__proto.parsingFlags = parsingFlags;
+ momentPrototype__proto.set = getSet;
+ momentPrototype__proto.startOf = startOf;
+ momentPrototype__proto.subtract = add_subtract__subtract;
+ momentPrototype__proto.toArray = toArray;
+ momentPrototype__proto.toObject = toObject;
+ momentPrototype__proto.toDate = toDate;
+ momentPrototype__proto.toISOString = moment_format__toISOString;
+ momentPrototype__proto.toJSON = moment_format__toISOString;
+ momentPrototype__proto.toString = toString;
+ momentPrototype__proto.unix = unix;
+ momentPrototype__proto.valueOf = to_type__valueOf;
+
+ // Year
+ momentPrototype__proto.year = getSetYear;
+ momentPrototype__proto.isLeapYear = getIsLeapYear;
+
+ // Week Year
+ momentPrototype__proto.weekYear = getSetWeekYear;
+ momentPrototype__proto.isoWeekYear = getSetISOWeekYear;
+
+ // Quarter
+ momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter;
+
+ // Month
+ momentPrototype__proto.month = getSetMonth;
+ momentPrototype__proto.daysInMonth = getDaysInMonth;
+
+ // Week
+ momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek;
+ momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek;
+ momentPrototype__proto.weeksInYear = getWeeksInYear;
+ momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear;
+
+ // Day
+ momentPrototype__proto.date = getSetDayOfMonth;
+ momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek;
+ momentPrototype__proto.weekday = getSetLocaleDayOfWeek;
+ momentPrototype__proto.isoWeekday = getSetISODayOfWeek;
+ momentPrototype__proto.dayOfYear = getSetDayOfYear;
+
+ // Hour
+ momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour;
+
+ // Minute
+ momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute;
+
+ // Second
+ momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond;
+
+ // Millisecond
+ momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond;
+
+ // Offset
+ momentPrototype__proto.utcOffset = getSetOffset;
+ momentPrototype__proto.utc = setOffsetToUTC;
+ momentPrototype__proto.local = setOffsetToLocal;
+ momentPrototype__proto.parseZone = setOffsetToParsedOffset;
+ momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset;
+ momentPrototype__proto.isDST = isDaylightSavingTime;
+ momentPrototype__proto.isDSTShifted = isDaylightSavingTimeShifted;
+ momentPrototype__proto.isLocal = isLocal;
+ momentPrototype__proto.isUtcOffset = isUtcOffset;
+ momentPrototype__proto.isUtc = isUtc;
+ momentPrototype__proto.isUTC = isUtc;
+
+ // Timezone
+ momentPrototype__proto.zoneAbbr = getZoneAbbr;
+ momentPrototype__proto.zoneName = getZoneName;
+
+ // Deprecations
+ momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
+ momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
+ momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
+ momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone);
+
+ var momentPrototype = momentPrototype__proto;
+
+ function moment__createUnix (input) {
+ return local__createLocal(input * 1000);
+ }
+
+ function moment__createInZone () {
+ return local__createLocal.apply(null, arguments).parseZone();
+ }
+
+ var defaultCalendar = {
+ sameDay : '[Today at] LT',
+ nextDay : '[Tomorrow at] LT',
+ nextWeek : 'dddd [at] LT',
+ lastDay : '[Yesterday at] LT',
+ lastWeek : '[Last] dddd [at] LT',
+ sameElse : 'L'
+ };
+
+ function locale_calendar__calendar (key, mom, now) {
+ var output = this._calendar[key];
+ return typeof output === 'function' ? output.call(mom, now) : output;
+ }
+
+ var defaultLongDateFormat = {
+ LTS : 'h:mm:ss A',
+ LT : 'h:mm A',
+ L : 'MM/DD/YYYY',
+ LL : 'MMMM D, YYYY',
+ LLL : 'MMMM D, YYYY h:mm A',
+ LLLL : 'dddd, MMMM D, YYYY h:mm A'
+ };
+
+ function longDateFormat (key) {
+ var format = this._longDateFormat[key],
+ formatUpper = this._longDateFormat[key.toUpperCase()];
+
+ if (format || !formatUpper) {
+ return format;
+ }
+
+ this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
+ return val.slice(1);
+ });
+
+ return this._longDateFormat[key];
+ }
+
+ var defaultInvalidDate = 'Invalid date';
+
+ function invalidDate () {
+ return this._invalidDate;
+ }
+
+ var defaultOrdinal = '%d';
+ var defaultOrdinalParse = /\d{1,2}/;
+
+ function ordinal (number) {
+ return this._ordinal.replace('%d', number);
+ }
+
+ function preParsePostFormat (string) {
+ return string;
+ }
+
+ var defaultRelativeTime = {
+ future : 'in %s',
+ past : '%s ago',
+ s : 'a few seconds',
+ m : 'a minute',
+ mm : '%d minutes',
+ h : 'an hour',
+ hh : '%d hours',
+ d : 'a day',
+ dd : '%d days',
+ M : 'a month',
+ MM : '%d months',
+ y : 'a year',
+ yy : '%d years'
+ };
+
+ function relative__relativeTime (number, withoutSuffix, string, isFuture) {
+ var output = this._relativeTime[string];
+ return (typeof output === 'function') ?
+ output(number, withoutSuffix, string, isFuture) :
+ output.replace(/%d/i, number);
+ }
+
+ function pastFuture (diff, output) {
+ var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
+ return typeof format === 'function' ? format(output) : format.replace(/%s/i, output);
+ }
+
+ function locale_set__set (config) {
+ var prop, i;
+ for (i in config) {
+ prop = config[i];
+ if (typeof prop === 'function') {
+ this[i] = prop;
+ } else {
+ this['_' + i] = prop;
+ }
+ }
+ // Lenient ordinal parsing accepts just a number in addition to
+ // number + (possibly) stuff coming from _ordinalParseLenient.
+ this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
+ }
+
+ var prototype__proto = Locale.prototype;
+
+ prototype__proto._calendar = defaultCalendar;
+ prototype__proto.calendar = locale_calendar__calendar;
+ prototype__proto._longDateFormat = defaultLongDateFormat;
+ prototype__proto.longDateFormat = longDateFormat;
+ prototype__proto._invalidDate = defaultInvalidDate;
+ prototype__proto.invalidDate = invalidDate;
+ prototype__proto._ordinal = defaultOrdinal;
+ prototype__proto.ordinal = ordinal;
+ prototype__proto._ordinalParse = defaultOrdinalParse;
+ prototype__proto.preparse = preParsePostFormat;
+ prototype__proto.postformat = preParsePostFormat;
+ prototype__proto._relativeTime = defaultRelativeTime;
+ prototype__proto.relativeTime = relative__relativeTime;
+ prototype__proto.pastFuture = pastFuture;
+ prototype__proto.set = locale_set__set;
+
+ // Month
+ prototype__proto.months = localeMonths;
+ prototype__proto._months = defaultLocaleMonths;
+ prototype__proto.monthsShort = localeMonthsShort;
+ prototype__proto._monthsShort = defaultLocaleMonthsShort;
+ prototype__proto.monthsParse = localeMonthsParse;
+
+ // Week
+ prototype__proto.week = localeWeek;
+ prototype__proto._week = defaultLocaleWeek;
+ prototype__proto.firstDayOfYear = localeFirstDayOfYear;
+ prototype__proto.firstDayOfWeek = localeFirstDayOfWeek;
+
+ // Day of Week
+ prototype__proto.weekdays = localeWeekdays;
+ prototype__proto._weekdays = defaultLocaleWeekdays;
+ prototype__proto.weekdaysMin = localeWeekdaysMin;
+ prototype__proto._weekdaysMin = defaultLocaleWeekdaysMin;
+ prototype__proto.weekdaysShort = localeWeekdaysShort;
+ prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort;
+ prototype__proto.weekdaysParse = localeWeekdaysParse;
+
+ // Hours
+ prototype__proto.isPM = localeIsPM;
+ prototype__proto._meridiemParse = defaultLocaleMeridiemParse;
+ prototype__proto.meridiem = localeMeridiem;
+
+ function lists__get (format, index, field, setter) {
+ var locale = locale_locales__getLocale();
+ var utc = create_utc__createUTC().set(setter, index);
+ return locale[field](utc, format);
+ }
+
+ function list (format, index, field, count, setter) {
+ if (typeof format === 'number') {
+ index = format;
+ format = undefined;
+ }
+
+ format = format || '';
+
+ if (index != null) {
+ return lists__get(format, index, field, setter);
+ }
+
+ var i;
+ var out = [];
+ for (i = 0; i < count; i++) {
+ out[i] = lists__get(format, i, field, setter);
+ }
+ return out;
+ }
+
+ function lists__listMonths (format, index) {
+ return list(format, index, 'months', 12, 'month');
+ }
+
+ function lists__listMonthsShort (format, index) {
+ return list(format, index, 'monthsShort', 12, 'month');
+ }
+
+ function lists__listWeekdays (format, index) {
+ return list(format, index, 'weekdays', 7, 'day');
+ }
+
+ function lists__listWeekdaysShort (format, index) {
+ return list(format, index, 'weekdaysShort', 7, 'day');
+ }
+
+ function lists__listWeekdaysMin (format, index) {
+ return list(format, index, 'weekdaysMin', 7, 'day');
+ }
+
+ locale_locales__getSetGlobalLocale('en', {
+ ordinalParse: /\d{1,2}(th|st|nd|rd)/,
+ ordinal : function (number) {
+ var b = number % 10,
+ output = (toInt(number % 100 / 10) === 1) ? 'th' :
+ (b === 1) ? 'st' :
+ (b === 2) ? 'nd' :
+ (b === 3) ? 'rd' : 'th';
+ return number + output;
+ }
+ });
+
+ // Side effect imports
+ utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale);
+ utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale);
+
+ var mathAbs = Math.abs;
+
+ function duration_abs__abs () {
+ var data = this._data;
+
+ this._milliseconds = mathAbs(this._milliseconds);
+ this._days = mathAbs(this._days);
+ this._months = mathAbs(this._months);
+
+ data.milliseconds = mathAbs(data.milliseconds);
+ data.seconds = mathAbs(data.seconds);
+ data.minutes = mathAbs(data.minutes);
+ data.hours = mathAbs(data.hours);
+ data.months = mathAbs(data.months);
+ data.years = mathAbs(data.years);
+
+ return this;
+ }
+
+ function duration_add_subtract__addSubtract (duration, input, value, direction) {
+ var other = create__createDuration(input, value);
+
+ duration._milliseconds += direction * other._milliseconds;
+ duration._days += direction * other._days;
+ duration._months += direction * other._months;
+
+ return duration._bubble();
+ }
+
+ // supports only 2.0-style add(1, 's') or add(duration)
+ function duration_add_subtract__add (input, value) {
+ return duration_add_subtract__addSubtract(this, input, value, 1);
+ }
+
+ // supports only 2.0-style subtract(1, 's') or subtract(duration)
+ function duration_add_subtract__subtract (input, value) {
+ return duration_add_subtract__addSubtract(this, input, value, -1);
+ }
+
+ function absCeil (number) {
+ if (number < 0) {
+ return Math.floor(number);
+ } else {
+ return Math.ceil(number);
+ }
+ }
+
+ function bubble () {
+ var milliseconds = this._milliseconds;
+ var days = this._days;
+ var months = this._months;
+ var data = this._data;
+ var seconds, minutes, hours, years, monthsFromDays;
+
+ // if we have a mix of positive and negative values, bubble down first
+ // check: https://github.com/moment/moment/issues/2166
+ if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
+ (milliseconds <= 0 && days <= 0 && months <= 0))) {
+ milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
+ days = 0;
+ months = 0;
+ }
+
+ // The following code bubbles up values, see the tests for
+ // examples of what that means.
+ data.milliseconds = milliseconds % 1000;
+
+ seconds = absFloor(milliseconds / 1000);
+ data.seconds = seconds % 60;
+
+ minutes = absFloor(seconds / 60);
+ data.minutes = minutes % 60;
+
+ hours = absFloor(minutes / 60);
+ data.hours = hours % 24;
+
+ days += absFloor(hours / 24);
+
+ // convert days to months
+ monthsFromDays = absFloor(daysToMonths(days));
+ months += monthsFromDays;
+ days -= absCeil(monthsToDays(monthsFromDays));
+
+ // 12 months -> 1 year
+ years = absFloor(months / 12);
+ months %= 12;
+
+ data.days = days;
+ data.months = months;
+ data.years = years;
+
+ return this;
+ }
+
+ function daysToMonths (days) {
+ // 400 years have 146097 days (taking into account leap year rules)
+ // 400 years have 12 months === 4800
+ return days * 4800 / 146097;
+ }
+
+ function monthsToDays (months) {
+ // the reverse of daysToMonths
+ return months * 146097 / 4800;
+ }
+
+ function as (units) {
+ var days;
+ var months;
+ var milliseconds = this._milliseconds;
+
+ units = normalizeUnits(units);
+
+ if (units === 'month' || units === 'year') {
+ days = this._days + milliseconds / 864e5;
+ months = this._months + daysToMonths(days);
+ return units === 'month' ? months : months / 12;
+ } else {
+ // handle milliseconds separately because of floating point math errors (issue #1867)
+ days = this._days + Math.round(monthsToDays(this._months));
+ switch (units) {
+ case 'week' : return days / 7 + milliseconds / 6048e5;
+ case 'day' : return days + milliseconds / 864e5;
+ case 'hour' : return days * 24 + milliseconds / 36e5;
+ case 'minute' : return days * 1440 + milliseconds / 6e4;
+ case 'second' : return days * 86400 + milliseconds / 1000;
+ // Math.floor prevents floating point math errors here
+ case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
+ default: throw new Error('Unknown unit ' + units);
+ }
+ }
+ }
+
+ // TODO: Use this.as('ms')?
+ function duration_as__valueOf () {
+ return (
+ this._milliseconds +
+ this._days * 864e5 +
+ (this._months % 12) * 2592e6 +
+ toInt(this._months / 12) * 31536e6
+ );
+ }
+
+ function makeAs (alias) {
+ return function () {
+ return this.as(alias);
+ };
+ }
+
+ var asMilliseconds = makeAs('ms');
+ var asSeconds = makeAs('s');
+ var asMinutes = makeAs('m');
+ var asHours = makeAs('h');
+ var asDays = makeAs('d');
+ var asWeeks = makeAs('w');
+ var asMonths = makeAs('M');
+ var asYears = makeAs('y');
+
+ function duration_get__get (units) {
+ units = normalizeUnits(units);
+ return this[units + 's']();
+ }
+
+ function makeGetter(name) {
+ return function () {
+ return this._data[name];
+ };
+ }
+
+ var milliseconds = makeGetter('milliseconds');
+ var seconds = makeGetter('seconds');
+ var minutes = makeGetter('minutes');
+ var hours = makeGetter('hours');
+ var days = makeGetter('days');
+ var months = makeGetter('months');
+ var years = makeGetter('years');
+
+ function weeks () {
+ return absFloor(this.days() / 7);
+ }
+
+ var round = Math.round;
+ var thresholds = {
+ s: 45, // seconds to minute
+ m: 45, // minutes to hour
+ h: 22, // hours to day
+ d: 26, // days to month
+ M: 11 // months to year
+ };
+
+ // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
+ function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
+ return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
+ }
+
+ function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) {
+ var duration = create__createDuration(posNegDuration).abs();
+ var seconds = round(duration.as('s'));
+ var minutes = round(duration.as('m'));
+ var hours = round(duration.as('h'));
+ var days = round(duration.as('d'));
+ var months = round(duration.as('M'));
+ var years = round(duration.as('y'));
+
+ var a = seconds < thresholds.s && ['s', seconds] ||
+ minutes === 1 && ['m'] ||
+ minutes < thresholds.m && ['mm', minutes] ||
+ hours === 1 && ['h'] ||
+ hours < thresholds.h && ['hh', hours] ||
+ days === 1 && ['d'] ||
+ days < thresholds.d && ['dd', days] ||
+ months === 1 && ['M'] ||
+ months < thresholds.M && ['MM', months] ||
+ years === 1 && ['y'] || ['yy', years];
+
+ a[2] = withoutSuffix;
+ a[3] = +posNegDuration > 0;
+ a[4] = locale;
+ return substituteTimeAgo.apply(null, a);
+ }
+
+ // This function allows you to set a threshold for relative time strings
+ function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {
+ if (thresholds[threshold] === undefined) {
+ return false;
+ }
+ if (limit === undefined) {
+ return thresholds[threshold];
+ }
+ thresholds[threshold] = limit;
+ return true;
+ }
+
+ function humanize (withSuffix) {
+ var locale = this.localeData();
+ var output = duration_humanize__relativeTime(this, !withSuffix, locale);
+
+ if (withSuffix) {
+ output = locale.pastFuture(+this, output);
+ }
+
+ return locale.postformat(output);
+ }
+
+ var iso_string__abs = Math.abs;
+
+ function iso_string__toISOString() {
+ // for ISO strings we do not use the normal bubbling rules:
+ // * milliseconds bubble up until they become hours
+ // * days do not bubble at all
+ // * months bubble up until they become years
+ // This is because there is no context-free conversion between hours and days
+ // (think of clock changes)
+ // and also not between days and months (28-31 days per month)
+ var seconds = iso_string__abs(this._milliseconds) / 1000;
+ var days = iso_string__abs(this._days);
+ var months = iso_string__abs(this._months);
+ var minutes, hours, years;
+
+ // 3600 seconds -> 60 minutes -> 1 hour
+ minutes = absFloor(seconds / 60);
+ hours = absFloor(minutes / 60);
+ seconds %= 60;
+ minutes %= 60;
+
+ // 12 months -> 1 year
+ years = absFloor(months / 12);
+ months %= 12;
+
+
+ // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
+ var Y = years;
+ var M = months;
+ var D = days;
+ var h = hours;
+ var m = minutes;
+ var s = seconds;
+ var total = this.asSeconds();
+
+ if (!total) {
+ // this is the same as C#'s (Noda) and python (isodate)...
+ // but not other JS (goog.date)
+ return 'P0D';
+ }
+
+ return (total < 0 ? '-' : '') +
+ 'P' +
+ (Y ? Y + 'Y' : '') +
+ (M ? M + 'M' : '') +
+ (D ? D + 'D' : '') +
+ ((h || m || s) ? 'T' : '') +
+ (h ? h + 'H' : '') +
+ (m ? m + 'M' : '') +
+ (s ? s + 'S' : '');
+ }
+
+ var duration_prototype__proto = Duration.prototype;
+
+ duration_prototype__proto.abs = duration_abs__abs;
+ duration_prototype__proto.add = duration_add_subtract__add;
+ duration_prototype__proto.subtract = duration_add_subtract__subtract;
+ duration_prototype__proto.as = as;
+ duration_prototype__proto.asMilliseconds = asMilliseconds;
+ duration_prototype__proto.asSeconds = asSeconds;
+ duration_prototype__proto.asMinutes = asMinutes;
+ duration_prototype__proto.asHours = asHours;
+ duration_prototype__proto.asDays = asDays;
+ duration_prototype__proto.asWeeks = asWeeks;
+ duration_prototype__proto.asMonths = asMonths;
+ duration_prototype__proto.asYears = asYears;
+ duration_prototype__proto.valueOf = duration_as__valueOf;
+ duration_prototype__proto._bubble = bubble;
+ duration_prototype__proto.get = duration_get__get;
+ duration_prototype__proto.milliseconds = milliseconds;
+ duration_prototype__proto.seconds = seconds;
+ duration_prototype__proto.minutes = minutes;
+ duration_prototype__proto.hours = hours;
+ duration_prototype__proto.days = days;
+ duration_prototype__proto.weeks = weeks;
+ duration_prototype__proto.months = months;
+ duration_prototype__proto.years = years;
+ duration_prototype__proto.humanize = humanize;
+ duration_prototype__proto.toISOString = iso_string__toISOString;
+ duration_prototype__proto.toString = iso_string__toISOString;
+ duration_prototype__proto.toJSON = iso_string__toISOString;
+ duration_prototype__proto.locale = locale;
+ duration_prototype__proto.localeData = localeData;
+
+ // Deprecations
+ duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString);
+ duration_prototype__proto.lang = lang;
+
+ // Side effect imports
+
+ addFormatToken('X', 0, 0, 'unix');
+ addFormatToken('x', 0, 0, 'valueOf');
+
+ // PARSING
+
+ addRegexToken('x', matchSigned);
+ addRegexToken('X', matchTimestamp);
+ addParseToken('X', function (input, array, config) {
+ config._d = new Date(parseFloat(input, 10) * 1000);
+ });
+ addParseToken('x', function (input, array, config) {
+ config._d = new Date(toInt(input));
+ });
+
+ // Side effect imports
+
+
+ utils_hooks__hooks.version = '2.10.6';
+
+ setHookCallback(local__createLocal);
+
+ utils_hooks__hooks.fn = momentPrototype;
+ utils_hooks__hooks.min = min;
+ utils_hooks__hooks.max = max;
+ utils_hooks__hooks.utc = create_utc__createUTC;
+ utils_hooks__hooks.unix = moment__createUnix;
+ utils_hooks__hooks.months = lists__listMonths;
+ utils_hooks__hooks.isDate = isDate;
+ utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale;
+ utils_hooks__hooks.invalid = valid__createInvalid;
+ utils_hooks__hooks.duration = create__createDuration;
+ utils_hooks__hooks.isMoment = isMoment;
+ utils_hooks__hooks.weekdays = lists__listWeekdays;
+ utils_hooks__hooks.parseZone = moment__createInZone;
+ utils_hooks__hooks.localeData = locale_locales__getLocale;
+ utils_hooks__hooks.isDuration = isDuration;
+ utils_hooks__hooks.monthsShort = lists__listMonthsShort;
+ utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin;
+ utils_hooks__hooks.defineLocale = defineLocale;
+ utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort;
+ utils_hooks__hooks.normalizeUnits = normalizeUnits;
+ utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold;
+
+ var _moment = utils_hooks__hooks;
+
+ return _moment;
+
+ }));
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)(module)))
+
+/***/ },
+/* 4 */
+/***/ function(module, exports) {
+
+ module.exports = function(module) {
+ if(!module.webpackPolyfill) {
+ module.deprecate = function() {};
+ module.paths = [];
+ // module.parent = undefined by default
+ module.children = [];
+ module.webpackPolyfill = 1;
+ }
+ return module;
+ }
+
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ function webpackContext(req) {
+ throw new Error("Cannot find module '" + req + "'.");
+ }
+ webpackContext.keys = function() { return []; };
+ webpackContext.resolve = webpackContext;
+ module.exports = webpackContext;
+ webpackContext.id = 5;
+
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
+
+ var _rng;
+
+ var globalVar = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : null;
+
+ if (globalVar && globalVar.crypto && crypto.getRandomValues) {
+ // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto
+ // Moderately fast, high quality
+ var _rnds8 = new Uint8Array(16);
+ _rng = function whatwgRNG() {
+ crypto.getRandomValues(_rnds8);
+ return _rnds8;
+ };
+ }
+
+ if (!_rng) {
+ // Math.random()-based (RNG)
+ //
+ // If all else fails, use Math.random(). It's fast, but is of unspecified
+ // quality.
+ var _rnds = new Array(16);
+ _rng = function () {
+ for (var i = 0, r; i < 16; i++) {
+ if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
+ _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
+ }
+
+ return _rnds;
+ };
+ }
+
+ // uuid.js
+ //
+ // Copyright (c) 2010-2012 Robert Kieffer
+ // MIT License - http://opensource.org/licenses/mit-license.php
+
+ // Unique ID creation requires a high quality random # generator. We feature
+ // detect to determine the best RNG source, normalizing to a function that
+ // returns 128-bits of randomness, since that's what's usually required
+
+ //var _rng = require('./rng');
+
+ // Maps for number <-> hex string conversion
+ var _byteToHex = [];
+ var _hexToByte = {};
+ for (var i = 0; i < 256; i++) {
+ _byteToHex[i] = (i + 0x100).toString(16).substr(1);
+ _hexToByte[_byteToHex[i]] = i;
+ }
+
+ // **`parse()` - Parse a UUID into it's component bytes**
+ function parse(s, buf, offset) {
+ var i = buf && offset || 0,
+ ii = 0;
+
+ buf = buf || [];
+ s.toLowerCase().replace(/[0-9a-f]{2}/g, function (oct) {
+ if (ii < 16) {
+ // Don't overflow!
+ buf[i + ii++] = _hexToByte[oct];
+ }
+ });
+
+ // Zero out remaining bytes if string was short
+ while (ii < 16) {
+ buf[i + ii++] = 0;
+ }
+
+ return buf;
+ }
+
+ // **`unparse()` - Convert UUID byte array (ala parse()) into a string**
+ function unparse(buf, offset) {
+ var i = offset || 0,
+ bth = _byteToHex;
+ return bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]];
+ }
+
+ // **`v1()` - Generate time-based UUID**
+ //
+ // Inspired by https://github.com/LiosK/UUID.js
+ // and http://docs.python.org/library/uuid.html
+
+ // random #'s we need to init node and clockseq
+ var _seedBytes = _rng();
+
+ // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
+ var _nodeId = [_seedBytes[0] | 0x01, _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]];
+
+ // Per 4.2.2, randomize (14 bit) clockseq
+ var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;
+
+ // Previous uuid creation time
+ var _lastMSecs = 0,
+ _lastNSecs = 0;
+
+ // See https://github.com/broofa/node-uuid for API details
+ function v1(options, buf, offset) {
+ var i = buf && offset || 0;
+ var b = buf || [];
+
+ options = options || {};
+
+ var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
+
+ // UUID timestamps are 100 nano-second units since the Gregorian epoch,
+ // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
+ // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
+ // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
+ var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
+
+ // Per 4.2.1.2, use count of uuid's generated during the current clock
+ // cycle to simulate higher resolution clock
+ var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
+
+ // Time since last uuid creation (in msecs)
+ var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000;
+
+ // Per 4.2.1.2, Bump clockseq on clock regression
+ if (dt < 0 && options.clockseq === undefined) {
+ clockseq = clockseq + 1 & 0x3fff;
+ }
+
+ // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
+ // time interval
+ if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
+ nsecs = 0;
+ }
+
+ // Per 4.2.1.2 Throw error if too many uuids are requested
+ if (nsecs >= 10000) {
+ throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
+ }
+
+ _lastMSecs = msecs;
+ _lastNSecs = nsecs;
+ _clockseq = clockseq;
+
+ // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
+ msecs += 12219292800000;
+
+ // `time_low`
+ var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
+ b[i++] = tl >>> 24 & 0xff;
+ b[i++] = tl >>> 16 & 0xff;
+ b[i++] = tl >>> 8 & 0xff;
+ b[i++] = tl & 0xff;
+
+ // `time_mid`
+ var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
+ b[i++] = tmh >>> 8 & 0xff;
+ b[i++] = tmh & 0xff;
+
+ // `time_high_and_version`
+ b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
+ b[i++] = tmh >>> 16 & 0xff;
+
+ // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
+ b[i++] = clockseq >>> 8 | 0x80;
+
+ // `clock_seq_low`
+ b[i++] = clockseq & 0xff;
+
+ // `node`
+ var node = options.node || _nodeId;
+ for (var n = 0; n < 6; n++) {
+ b[i + n] = node[n];
+ }
+
+ return buf ? buf : unparse(b);
+ }
+
+ // **`v4()` - Generate random UUID**
+
+ // See https://github.com/broofa/node-uuid for API details
+ function v4(options, buf, offset) {
+ // Deprecated - 'format' argument, as supported in v1.2
+ var i = buf && offset || 0;
+
+ if (typeof options == 'string') {
+ buf = options == 'binary' ? new Array(16) : null;
+ options = null;
+ }
+ options = options || {};
+
+ var rnds = options.random || (options.rng || _rng)();
+
+ // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
+ rnds[6] = rnds[6] & 0x0f | 0x40;
+ rnds[8] = rnds[8] & 0x3f | 0x80;
+
+ // Copy bytes to buffer, if provided
+ if (buf) {
+ for (var ii = 0; ii < 16; ii++) {
+ buf[i + ii] = rnds[ii];
+ }
+ }
+
+ return buf || unparse(rnds);
+ }
+
+ // Export public API
+ var uuid = v4;
+ uuid.v1 = v1;
+ uuid.v4 = v4;
+ uuid.parse = parse;
+ uuid.unparse = unparse;
+
+ module.exports = uuid;
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ },
+/* 7 */
+/***/ function(module, exports) {
+
+ // DOM utility methods
+
+ /**
+ * this prepares the JSON container for allocating SVG elements
+ * @param JSONcontainer
+ * @private
+ */
+ 'use strict';
+
+ exports.prepareElements = function (JSONcontainer) {
+ // cleanup the redundant svgElements;
+ for (var elementType in JSONcontainer) {
+ if (JSONcontainer.hasOwnProperty(elementType)) {
+ JSONcontainer[elementType].redundant = JSONcontainer[elementType].used;
+ JSONcontainer[elementType].used = [];
+ }
+ }
+ };
+
+ /**
+ * this cleans up all the unused SVG elements. By asking for the parentNode, we only need to supply the JSON container from
+ * which to remove the redundant elements.
+ *
+ * @param JSONcontainer
+ * @private
+ */
+ exports.cleanupElements = function (JSONcontainer) {
+ // cleanup the redundant svgElements;
+ for (var elementType in JSONcontainer) {
+ if (JSONcontainer.hasOwnProperty(elementType)) {
+ if (JSONcontainer[elementType].redundant) {
+ for (var i = 0; i < JSONcontainer[elementType].redundant.length; i++) {
+ JSONcontainer[elementType].redundant[i].parentNode.removeChild(JSONcontainer[elementType].redundant[i]);
+ }
+ JSONcontainer[elementType].redundant = [];
+ }
+ }
+ }
+ };
+
+ /**
+ * Allocate or generate an SVG element if needed. Store a reference to it in the JSON container and draw it in the svgContainer
+ * the JSON container and the SVG container have to be supplied so other svg containers (like the legend) can use this.
+ *
+ * @param elementType
+ * @param JSONcontainer
+ * @param svgContainer
+ * @returns {*}
+ * @private
+ */
+ exports.getSVGElement = function (elementType, JSONcontainer, svgContainer) {
+ var element;
+ // allocate SVG element, if it doesnt yet exist, create one.
+ if (JSONcontainer.hasOwnProperty(elementType)) {
+ // this element has been created before
+ // check if there is an redundant element
+ if (JSONcontainer[elementType].redundant.length > 0) {
+ element = JSONcontainer[elementType].redundant[0];
+ JSONcontainer[elementType].redundant.shift();
+ } else {
+ // create a new element and add it to the SVG
+ element = document.createElementNS('http://www.w3.org/2000/svg', elementType);
+ svgContainer.appendChild(element);
+ }
+ } else {
+ // create a new element and add it to the SVG, also create a new object in the svgElements to keep track of it.
+ element = document.createElementNS('http://www.w3.org/2000/svg', elementType);
+ JSONcontainer[elementType] = { used: [], redundant: [] };
+ svgContainer.appendChild(element);
+ }
+ JSONcontainer[elementType].used.push(element);
+ return element;
+ };
+
+ /**
+ * Allocate or generate an SVG element if needed. Store a reference to it in the JSON container and draw it in the svgContainer
+ * the JSON container and the SVG container have to be supplied so other svg containers (like the legend) can use this.
+ *
+ * @param elementType
+ * @param JSONcontainer
+ * @param DOMContainer
+ * @returns {*}
+ * @private
+ */
+ exports.getDOMElement = function (elementType, JSONcontainer, DOMContainer, insertBefore) {
+ var element;
+ // allocate DOM element, if it doesnt yet exist, create one.
+ if (JSONcontainer.hasOwnProperty(elementType)) {
+ // this element has been created before
+ // check if there is an redundant element
+ if (JSONcontainer[elementType].redundant.length > 0) {
+ element = JSONcontainer[elementType].redundant[0];
+ JSONcontainer[elementType].redundant.shift();
+ } else {
+ // create a new element and add it to the SVG
+ element = document.createElement(elementType);
+ if (insertBefore !== undefined) {
+ DOMContainer.insertBefore(element, insertBefore);
+ } else {
+ DOMContainer.appendChild(element);
+ }
+ }
+ } else {
+ // create a new element and add it to the SVG, also create a new object in the svgElements to keep track of it.
+ element = document.createElement(elementType);
+ JSONcontainer[elementType] = { used: [], redundant: [] };
+ if (insertBefore !== undefined) {
+ DOMContainer.insertBefore(element, insertBefore);
+ } else {
+ DOMContainer.appendChild(element);
+ }
+ }
+ JSONcontainer[elementType].used.push(element);
+ return element;
+ };
+
+ /**
+ * Draw a point object. This is a separate function because it can also be called by the legend.
+ * The reason the JSONcontainer and the target SVG svgContainer have to be supplied is so the legend can use these functions
+ * as well.
+ *
+ * @param x
+ * @param y
+ * @param groupTemplate: A template containing the necessary information to draw the datapoint e.g., {style: 'circle', size: 5, className: 'className' }
+ * @param JSONcontainer
+ * @param svgContainer
+ * @param labelObj
+ * @returns {*}
+ */
+ exports.drawPoint = function (x, y, groupTemplate, JSONcontainer, svgContainer, labelObj) {
+ var point;
+ if (groupTemplate.style == 'circle') {
+ point = exports.getSVGElement('circle', JSONcontainer, svgContainer);
+ point.setAttributeNS(null, 'cx', x);
+ point.setAttributeNS(null, 'cy', y);
+ point.setAttributeNS(null, 'r', 0.5 * groupTemplate.size);
+ } else {
+ point = exports.getSVGElement('rect', JSONcontainer, svgContainer);
+ point.setAttributeNS(null, 'x', x - 0.5 * groupTemplate.size);
+ point.setAttributeNS(null, 'y', y - 0.5 * groupTemplate.size);
+ point.setAttributeNS(null, 'width', groupTemplate.size);
+ point.setAttributeNS(null, 'height', groupTemplate.size);
+ }
+
+ if (groupTemplate.styles !== undefined) {
+ point.setAttributeNS(null, 'style', groupTemplate.styles);
+ }
+ point.setAttributeNS(null, 'class', groupTemplate.className + ' vis-point');
+ //handle label
+
+ if (labelObj) {
+ var label = exports.getSVGElement('text', JSONcontainer, svgContainer);
+ if (labelObj.xOffset) {
+ x = x + labelObj.xOffset;
+ }
+
+ if (labelObj.yOffset) {
+ y = y + labelObj.yOffset;
+ }
+ if (labelObj.content) {
+ label.textContent = labelObj.content;
+ }
+
+ if (labelObj.className) {
+ label.setAttributeNS(null, 'class', labelObj.className + ' vis-label');
+ }
+ label.setAttributeNS(null, 'x', x);
+ label.setAttributeNS(null, 'y', y);
+ }
+
+ return point;
+ };
+
+ /**
+ * draw a bar SVG element centered on the X coordinate
+ *
+ * @param x
+ * @param y
+ * @param className
+ */
+ exports.drawBar = function (x, y, width, height, className, JSONcontainer, svgContainer, style) {
+ if (height != 0) {
+ if (height < 0) {
+ height *= -1;
+ y -= height;
+ }
+ var rect = exports.getSVGElement('rect', JSONcontainer, svgContainer);
+ rect.setAttributeNS(null, 'x', x - 0.5 * width);
+ rect.setAttributeNS(null, 'y', y);
+ rect.setAttributeNS(null, 'width', width);
+ rect.setAttributeNS(null, 'height', height);
+ rect.setAttributeNS(null, 'class', className);
+ if (style) {
+ rect.setAttributeNS(null, 'style', style);
+ }
+ }
+ };
+
+/***/ },
+/* 8 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var Queue = __webpack_require__(9);
+
+ /**
+ * DataSet
+ *
+ * Usage:
+ * var dataSet = new DataSet({
+ * fieldId: '_id',
+ * type: {
+ * // ...
+ * }
+ * });
+ *
+ * dataSet.add(item);
+ * dataSet.add(data);
+ * dataSet.update(item);
+ * dataSet.update(data);
+ * dataSet.remove(id);
+ * dataSet.remove(ids);
+ * var data = dataSet.get();
+ * var data = dataSet.get(id);
+ * var data = dataSet.get(ids);
+ * var data = dataSet.get(ids, options, data);
+ * dataSet.clear();
+ *
+ * A data set can:
+ * - add/remove/update data
+ * - gives triggers upon changes in the data
+ * - can import/export data in various data formats
+ *
+ * @param {Array} [data] Optional array with initial data
+ * @param {Object} [options] Available options:
+ * {String} fieldId Field name of the id in the
+ * items, 'id' by default.
+ * {Object.} [type]
+ * {String[]} [fields] field names to be returned
+ * {function} [filter] filter items
+ * {String | function} [order] Order the items by a field name or custom sort function.
+ * @throws Error
+ */
+ DataSet.prototype.get = function (args) {
+ var me = this;
+
+ // parse the arguments
+ var id, ids, options;
+ var firstType = util.getType(arguments[0]);
+ if (firstType == 'String' || firstType == 'Number') {
+ // get(id [, options])
+ id = arguments[0];
+ options = arguments[1];
+ } else if (firstType == 'Array') {
+ // get(ids [, options])
+ ids = arguments[0];
+ options = arguments[1];
+ } else {
+ // get([, options])
+ options = arguments[0];
+ }
+
+ // determine the return type
+ var returnType;
+ if (options && options.returnType) {
+ var allowedValues = ['Array', 'Object'];
+ returnType = allowedValues.indexOf(options.returnType) == -1 ? 'Array' : options.returnType;
+ } else {
+ returnType = 'Array';
+ }
+
+ // build options
+ var type = options && options.type || this._options.type;
+ var filter = options && options.filter;
+ var items = [],
+ item,
+ itemId,
+ i,
+ len;
+
+ // convert items
+ if (id != undefined) {
+ // return a single item
+ item = me._getItem(id, type);
+ if (filter && !filter(item)) {
+ item = null;
+ }
+ } else if (ids != undefined) {
+ // return a subset of items
+ for (i = 0, len = ids.length; i < len; i++) {
+ item = me._getItem(ids[i], type);
+ if (!filter || filter(item)) {
+ items.push(item);
+ }
+ }
+ } else {
+ // return all items
+ for (itemId in this._data) {
+ if (this._data.hasOwnProperty(itemId)) {
+ item = me._getItem(itemId, type);
+ if (!filter || filter(item)) {
+ items.push(item);
+ }
+ }
+ }
+ }
+
+ // order the results
+ if (options && options.order && id == undefined) {
+ this._sort(items, options.order);
+ }
+
+ // filter fields of the items
+ if (options && options.fields) {
+ var fields = options.fields;
+ if (id != undefined) {
+ item = this._filterFields(item, fields);
+ } else {
+ for (i = 0, len = items.length; i < len; i++) {
+ items[i] = this._filterFields(items[i], fields);
+ }
+ }
+ }
+
+ // return the results
+ if (returnType == 'Object') {
+ var result = {};
+ for (i = 0; i < items.length; i++) {
+ result[items[i].id] = items[i];
+ }
+ return result;
+ } else {
+ if (id != undefined) {
+ // a single item
+ return item;
+ } else {
+ // just return our array
+ return items;
+ }
+ }
+ };
+
+ /**
+ * Get ids of all items or from a filtered set of items.
+ * @param {Object} [options] An Object with options. Available options:
+ * {function} [filter] filter items
+ * {String | function} [order] Order the items by
+ * a field name or custom sort function.
+ * @return {Array} ids
+ */
+ DataSet.prototype.getIds = function (options) {
+ var data = this._data,
+ filter = options && options.filter,
+ order = options && options.order,
+ type = options && options.type || this._options.type,
+ i,
+ len,
+ id,
+ item,
+ items,
+ ids = [];
+
+ if (filter) {
+ // get filtered items
+ if (order) {
+ // create ordered list
+ items = [];
+ for (id in data) {
+ if (data.hasOwnProperty(id)) {
+ item = this._getItem(id, type);
+ if (filter(item)) {
+ items.push(item);
+ }
+ }
+ }
+
+ this._sort(items, order);
+
+ for (i = 0, len = items.length; i < len; i++) {
+ ids[i] = items[i][this._fieldId];
+ }
+ } else {
+ // create unordered list
+ for (id in data) {
+ if (data.hasOwnProperty(id)) {
+ item = this._getItem(id, type);
+ if (filter(item)) {
+ ids.push(item[this._fieldId]);
+ }
+ }
+ }
+ }
+ } else {
+ // get all items
+ if (order) {
+ // create an ordered list
+ items = [];
+ for (id in data) {
+ if (data.hasOwnProperty(id)) {
+ items.push(data[id]);
+ }
+ }
+
+ this._sort(items, order);
+
+ for (i = 0, len = items.length; i < len; i++) {
+ ids[i] = items[i][this._fieldId];
+ }
+ } else {
+ // create unordered list
+ for (id in data) {
+ if (data.hasOwnProperty(id)) {
+ item = data[id];
+ ids.push(item[this._fieldId]);
+ }
+ }
+ }
+ }
+
+ return ids;
+ };
+
+ /**
+ * Returns the DataSet itself. Is overwritten for example by the DataView,
+ * which returns the DataSet it is connected to instead.
+ */
+ DataSet.prototype.getDataSet = function () {
+ return this;
+ };
+
+ /**
+ * Execute a callback function for every item in the dataset.
+ * @param {function} callback
+ * @param {Object} [options] Available options:
+ * {Object.} [type]
+ * {String[]} [fields] filter fields
+ * {function} [filter] filter items
+ * {String | function} [order] Order the items by
+ * a field name or custom sort function.
+ */
+ DataSet.prototype.forEach = function (callback, options) {
+ var filter = options && options.filter,
+ type = options && options.type || this._options.type,
+ data = this._data,
+ item,
+ id;
+
+ if (options && options.order) {
+ // execute forEach on ordered list
+ var items = this.get(options);
+
+ for (var i = 0, len = items.length; i < len; i++) {
+ item = items[i];
+ id = item[this._fieldId];
+ callback(item, id);
+ }
+ } else {
+ // unordered
+ for (id in data) {
+ if (data.hasOwnProperty(id)) {
+ item = this._getItem(id, type);
+ if (!filter || filter(item)) {
+ callback(item, id);
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * Map every item in the dataset.
+ * @param {function} callback
+ * @param {Object} [options] Available options:
+ * {Object.} [type]
+ * {String[]} [fields] filter fields
+ * {function} [filter] filter items
+ * {String | function} [order] Order the items by
+ * a field name or custom sort function.
+ * @return {Object[]} mappedItems
+ */
+ DataSet.prototype.map = function (callback, options) {
+ var filter = options && options.filter,
+ type = options && options.type || this._options.type,
+ mappedItems = [],
+ data = this._data,
+ item;
+
+ // convert and filter items
+ for (var id in data) {
+ if (data.hasOwnProperty(id)) {
+ item = this._getItem(id, type);
+ if (!filter || filter(item)) {
+ mappedItems.push(callback(item, id));
+ }
+ }
+ }
+
+ // order items
+ if (options && options.order) {
+ this._sort(mappedItems, options.order);
+ }
+
+ return mappedItems;
+ };
+
+ /**
+ * Filter the fields of an item
+ * @param {Object | null} item
+ * @param {String[]} fields Field names
+ * @return {Object | null} filteredItem or null if no item is provided
+ * @private
+ */
+ DataSet.prototype._filterFields = function (item, fields) {
+ if (!item) {
+ // item is null
+ return item;
+ }
+
+ var filteredItem = {};
+
+ if (Array.isArray(fields)) {
+ for (var field in item) {
+ if (item.hasOwnProperty(field) && fields.indexOf(field) != -1) {
+ filteredItem[field] = item[field];
+ }
+ }
+ } else {
+ for (var field in item) {
+ if (item.hasOwnProperty(field) && fields.hasOwnProperty(field)) {
+ filteredItem[fields[field]] = item[field];
+ }
+ }
+ }
+
+ return filteredItem;
+ };
+
+ /**
+ * Sort the provided array with items
+ * @param {Object[]} items
+ * @param {String | function} order A field name or custom sort function.
+ * @private
+ */
+ DataSet.prototype._sort = function (items, order) {
+ if (util.isString(order)) {
+ // order by provided field name
+ var name = order; // field name
+ items.sort(function (a, b) {
+ var av = a[name];
+ var bv = b[name];
+ return av > bv ? 1 : av < bv ? -1 : 0;
+ });
+ } else if (typeof order === 'function') {
+ // order by sort function
+ items.sort(order);
+ }
+ // TODO: extend order by an Object {field:String, direction:String}
+ // where direction can be 'asc' or 'desc'
+ else {
+ throw new TypeError('Order must be a function or a string');
+ }
+ };
+
+ /**
+ * Remove an object by pointer or by id
+ * @param {String | Number | Object | Array} id Object or id, or an array with
+ * objects or ids to be removed
+ * @param {String} [senderId] Optional sender id
+ * @return {Array} removedIds
+ */
+ DataSet.prototype.remove = function (id, senderId) {
+ var removedIds = [],
+ i,
+ len,
+ removedId;
+
+ if (Array.isArray(id)) {
+ for (i = 0, len = id.length; i < len; i++) {
+ removedId = this._remove(id[i]);
+ if (removedId != null) {
+ removedIds.push(removedId);
+ }
+ }
+ } else {
+ removedId = this._remove(id);
+ if (removedId != null) {
+ removedIds.push(removedId);
+ }
+ }
+
+ if (removedIds.length) {
+ this._trigger('remove', { items: removedIds }, senderId);
+ }
+
+ return removedIds;
+ };
+
+ /**
+ * Remove an item by its id
+ * @param {Number | String | Object} id id or item
+ * @returns {Number | String | null} id
+ * @private
+ */
+ DataSet.prototype._remove = function (id) {
+ if (util.isNumber(id) || util.isString(id)) {
+ if (this._data[id]) {
+ delete this._data[id];
+ this.length--;
+ return id;
+ }
+ } else if (id instanceof Object) {
+ var itemId = id[this._fieldId];
+ if (itemId && this._data[itemId]) {
+ delete this._data[itemId];
+ this.length--;
+ return itemId;
+ }
+ }
+ return null;
+ };
+
+ /**
+ * Clear the data
+ * @param {String} [senderId] Optional sender id
+ * @return {Array} removedIds The ids of all removed items
+ */
+ DataSet.prototype.clear = function (senderId) {
+ var ids = Object.keys(this._data);
+
+ this._data = {};
+ this.length = 0;
+
+ this._trigger('remove', { items: ids }, senderId);
+
+ return ids;
+ };
+
+ /**
+ * Find the item with maximum value of a specified field
+ * @param {String} field
+ * @return {Object | null} item Item containing max value, or null if no items
+ */
+ DataSet.prototype.max = function (field) {
+ var data = this._data,
+ max = null,
+ maxField = null;
+
+ for (var id in data) {
+ if (data.hasOwnProperty(id)) {
+ var item = data[id];
+ var itemField = item[field];
+ if (itemField != null && (!max || itemField > maxField)) {
+ max = item;
+ maxField = itemField;
+ }
+ }
+ }
+
+ return max;
+ };
+
+ /**
+ * Find the item with minimum value of a specified field
+ * @param {String} field
+ * @return {Object | null} item Item containing max value, or null if no items
+ */
+ DataSet.prototype.min = function (field) {
+ var data = this._data,
+ min = null,
+ minField = null;
+
+ for (var id in data) {
+ if (data.hasOwnProperty(id)) {
+ var item = data[id];
+ var itemField = item[field];
+ if (itemField != null && (!min || itemField < minField)) {
+ min = item;
+ minField = itemField;
+ }
+ }
+ }
+
+ return min;
+ };
+
+ /**
+ * Find all distinct values of a specified field
+ * @param {String} field
+ * @return {Array} values Array containing all distinct values. If data items
+ * do not contain the specified field are ignored.
+ * The returned array is unordered.
+ */
+ DataSet.prototype.distinct = function (field) {
+ var data = this._data;
+ var values = [];
+ var fieldType = this._options.type && this._options.type[field] || null;
+ var count = 0;
+ var i;
+
+ for (var prop in data) {
+ if (data.hasOwnProperty(prop)) {
+ var item = data[prop];
+ var value = item[field];
+ var exists = false;
+ for (i = 0; i < count; i++) {
+ if (values[i] == value) {
+ exists = true;
+ break;
+ }
+ }
+ if (!exists && value !== undefined) {
+ values[count] = value;
+ count++;
+ }
+ }
+ }
+
+ if (fieldType) {
+ for (i = 0; i < values.length; i++) {
+ values[i] = util.convert(values[i], fieldType);
+ }
+ }
+
+ return values;
+ };
+
+ /**
+ * Add a single item. Will fail when an item with the same id already exists.
+ * @param {Object} item
+ * @return {String} id
+ * @private
+ */
+ DataSet.prototype._addItem = function (item) {
+ var id = item[this._fieldId];
+
+ if (id != undefined) {
+ // check whether this id is already taken
+ if (this._data[id]) {
+ // item already exists
+ throw new Error('Cannot add item: item with id ' + id + ' already exists');
+ }
+ } else {
+ // generate an id
+ id = util.randomUUID();
+ item[this._fieldId] = id;
+ }
+
+ var d = {};
+ for (var field in item) {
+ if (item.hasOwnProperty(field)) {
+ var fieldType = this._type[field]; // type may be undefined
+ d[field] = util.convert(item[field], fieldType);
+ }
+ }
+ this._data[id] = d;
+ this.length++;
+
+ return id;
+ };
+
+ /**
+ * Get an item. Fields can be converted to a specific type
+ * @param {String} id
+ * @param {Object.} [types] field types to convert
+ * @return {Object | null} item
+ * @private
+ */
+ DataSet.prototype._getItem = function (id, types) {
+ var field, value;
+
+ // get the item from the dataset
+ var raw = this._data[id];
+ if (!raw) {
+ return null;
+ }
+
+ // convert the items field types
+ var converted = {};
+ if (types) {
+ for (field in raw) {
+ if (raw.hasOwnProperty(field)) {
+ value = raw[field];
+ converted[field] = util.convert(value, types[field]);
+ }
+ }
+ } else {
+ // no field types specified, no converting needed
+ for (field in raw) {
+ if (raw.hasOwnProperty(field)) {
+ value = raw[field];
+ converted[field] = value;
+ }
+ }
+ }
+ return converted;
+ };
+
+ /**
+ * Update a single item: merge with existing item.
+ * Will fail when the item has no id, or when there does not exist an item
+ * with the same id.
+ * @param {Object} item
+ * @return {String} id
+ * @private
+ */
+ DataSet.prototype._updateItem = function (item) {
+ var id = item[this._fieldId];
+ if (id == undefined) {
+ throw new Error('Cannot update item: item has no id (item: ' + JSON.stringify(item) + ')');
+ }
+ var d = this._data[id];
+ if (!d) {
+ // item doesn't exist
+ throw new Error('Cannot update item: no item with id ' + id + ' found');
+ }
+
+ // merge with current item
+ for (var field in item) {
+ if (item.hasOwnProperty(field)) {
+ var fieldType = this._type[field]; // type may be undefined
+ d[field] = util.convert(item[field], fieldType);
+ }
+ }
+
+ return id;
+ };
+
+ module.exports = DataSet;
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ /**
+ * A queue
+ * @param {Object} options
+ * Available options:
+ * - delay: number When provided, the queue will be flushed
+ * automatically after an inactivity of this delay
+ * in milliseconds.
+ * Default value is null.
+ * - max: number When the queue exceeds the given maximum number
+ * of entries, the queue is flushed automatically.
+ * Default value of max is Infinity.
+ * @constructor
+ */
+ 'use strict';
+
+ function Queue(options) {
+ // options
+ this.delay = null;
+ this.max = Infinity;
+
+ // properties
+ this._queue = [];
+ this._timeout = null;
+ this._extended = null;
+
+ this.setOptions(options);
+ }
+
+ /**
+ * Update the configuration of the queue
+ * @param {Object} options
+ * Available options:
+ * - delay: number When provided, the queue will be flushed
+ * automatically after an inactivity of this delay
+ * in milliseconds.
+ * Default value is null.
+ * - max: number When the queue exceeds the given maximum number
+ * of entries, the queue is flushed automatically.
+ * Default value of max is Infinity.
+ * @param options
+ */
+ Queue.prototype.setOptions = function (options) {
+ if (options && typeof options.delay !== 'undefined') {
+ this.delay = options.delay;
+ }
+ if (options && typeof options.max !== 'undefined') {
+ this.max = options.max;
+ }
+
+ this._flushIfNeeded();
+ };
+
+ /**
+ * Extend an object with queuing functionality.
+ * The object will be extended with a function flush, and the methods provided
+ * in options.replace will be replaced with queued ones.
+ * @param {Object} object
+ * @param {Object} options
+ * Available options:
+ * - replace: Array.
+ * A list with method names of the methods
+ * on the object to be replaced with queued ones.
+ * - delay: number When provided, the queue will be flushed
+ * automatically after an inactivity of this delay
+ * in milliseconds.
+ * Default value is null.
+ * - max: number When the queue exceeds the given maximum number
+ * of entries, the queue is flushed automatically.
+ * Default value of max is Infinity.
+ * @return {Queue} Returns the created queue
+ */
+ Queue.extend = function (object, options) {
+ var queue = new Queue(options);
+
+ if (object.flush !== undefined) {
+ throw new Error('Target object already has a property flush');
+ }
+ object.flush = function () {
+ queue.flush();
+ };
+
+ var methods = [{
+ name: 'flush',
+ original: undefined
+ }];
+
+ if (options && options.replace) {
+ for (var i = 0; i < options.replace.length; i++) {
+ var name = options.replace[i];
+ methods.push({
+ name: name,
+ original: object[name]
+ });
+ queue.replace(object, name);
+ }
+ }
+
+ queue._extended = {
+ object: object,
+ methods: methods
+ };
+
+ return queue;
+ };
+
+ /**
+ * Destroy the queue. The queue will first flush all queued actions, and in
+ * case it has extended an object, will restore the original object.
+ */
+ Queue.prototype.destroy = function () {
+ this.flush();
+
+ if (this._extended) {
+ var object = this._extended.object;
+ var methods = this._extended.methods;
+ for (var i = 0; i < methods.length; i++) {
+ var method = methods[i];
+ if (method.original) {
+ object[method.name] = method.original;
+ } else {
+ delete object[method.name];
+ }
+ }
+ this._extended = null;
+ }
+ };
+
+ /**
+ * Replace a method on an object with a queued version
+ * @param {Object} object Object having the method
+ * @param {string} method The method name
+ */
+ Queue.prototype.replace = function (object, method) {
+ var me = this;
+ var original = object[method];
+ if (!original) {
+ throw new Error('Method ' + method + ' undefined');
+ }
+
+ object[method] = function () {
+ // create an Array with the arguments
+ var args = [];
+ for (var i = 0; i < arguments.length; i++) {
+ args[i] = arguments[i];
+ }
+
+ // add this call to the queue
+ me.queue({
+ args: args,
+ fn: original,
+ context: this
+ });
+ };
+ };
+
+ /**
+ * Queue a call
+ * @param {function | {fn: function, args: Array} | {fn: function, args: Array, context: Object}} entry
+ */
+ Queue.prototype.queue = function (entry) {
+ if (typeof entry === 'function') {
+ this._queue.push({ fn: entry });
+ } else {
+ this._queue.push(entry);
+ }
+
+ this._flushIfNeeded();
+ };
+
+ /**
+ * Check whether the queue needs to be flushed
+ * @private
+ */
+ Queue.prototype._flushIfNeeded = function () {
+ // flush when the maximum is exceeded.
+ if (this._queue.length > this.max) {
+ this.flush();
+ }
+
+ // flush after a period of inactivity when a delay is configured
+ clearTimeout(this._timeout);
+ if (this.queue.length > 0 && typeof this.delay === 'number') {
+ var me = this;
+ this._timeout = setTimeout(function () {
+ me.flush();
+ }, this.delay);
+ }
+ };
+
+ /**
+ * Flush all queued calls
+ */
+ Queue.prototype.flush = function () {
+ while (this._queue.length > 0) {
+ var entry = this._queue.shift();
+ entry.fn.apply(entry.context || entry.fn, entry.args || []);
+ }
+ };
+
+ module.exports = Queue;
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(8);
+
+ /**
+ * DataView
+ *
+ * a dataview offers a filtered view on a dataset or an other dataview.
+ *
+ * @param {DataSet | DataView} data
+ * @param {Object} [options] Available options: see method get
+ *
+ * @constructor DataView
+ */
+ function DataView(data, options) {
+ this._data = null;
+ this._ids = {}; // ids of the items currently in memory (just contains a boolean true)
+ this.length = 0; // number of items in the DataView
+ this._options = options || {};
+ this._fieldId = 'id'; // name of the field containing id
+ this._subscribers = {}; // event subscribers
+
+ var me = this;
+ this.listener = function () {
+ me._onEvent.apply(me, arguments);
+ };
+
+ this.setData(data);
+ }
+
+ // TODO: implement a function .config() to dynamically update things like configured filter
+ // and trigger changes accordingly
+
+ /**
+ * Set a data source for the view
+ * @param {DataSet | DataView} data
+ */
+ DataView.prototype.setData = function (data) {
+ var ids, i, len;
+
+ if (this._data) {
+ // unsubscribe from current dataset
+ if (this._data.off) {
+ this._data.off('*', this.listener);
+ }
+
+ // trigger a remove of all items in memory
+ ids = [];
+ for (var id in this._ids) {
+ if (this._ids.hasOwnProperty(id)) {
+ ids.push(id);
+ }
+ }
+ this._ids = {};
+ this.length = 0;
+ this._trigger('remove', { items: ids });
+ }
+
+ this._data = data;
+
+ if (this._data) {
+ // update fieldId
+ this._fieldId = this._options.fieldId || this._data && this._data.options && this._data.options.fieldId || 'id';
+
+ // trigger an add of all added items
+ ids = this._data.getIds({ filter: this._options && this._options.filter });
+ for (i = 0, len = ids.length; i < len; i++) {
+ id = ids[i];
+ this._ids[id] = true;
+ }
+ this.length = ids.length;
+ this._trigger('add', { items: ids });
+
+ // subscribe to new dataset
+ if (this._data.on) {
+ this._data.on('*', this.listener);
+ }
+ }
+ };
+
+ /**
+ * Refresh the DataView. Useful when the DataView has a filter function
+ * containing a variable parameter.
+ */
+ DataView.prototype.refresh = function () {
+ var id;
+ var ids = this._data.getIds({ filter: this._options && this._options.filter });
+ var newIds = {};
+ var added = [];
+ var removed = [];
+
+ // check for additions
+ for (var i = 0; i < ids.length; i++) {
+ id = ids[i];
+ newIds[id] = true;
+ if (!this._ids[id]) {
+ added.push(id);
+ this._ids[id] = true;
+ this.length++;
+ }
+ }
+
+ // check for removals
+ for (id in this._ids) {
+ if (this._ids.hasOwnProperty(id)) {
+ if (!newIds[id]) {
+ removed.push(id);
+ delete this._ids[id];
+ this.length--;
+ }
+ }
+ }
+
+ // trigger events
+ if (added.length) {
+ this._trigger('add', { items: added });
+ }
+ if (removed.length) {
+ this._trigger('remove', { items: removed });
+ }
+ };
+
+ /**
+ * Get data from the data view
+ *
+ * Usage:
+ *
+ * get()
+ * get(options: Object)
+ * get(options: Object, data: Array | DataTable)
+ *
+ * get(id: Number)
+ * get(id: Number, options: Object)
+ * get(id: Number, options: Object, data: Array | DataTable)
+ *
+ * get(ids: Number[])
+ * get(ids: Number[], options: Object)
+ * get(ids: Number[], options: Object, data: Array | DataTable)
+ *
+ * Where:
+ *
+ * {Number | String} id The id of an item
+ * {Number[] | String{}} ids An array with ids of items
+ * {Object} options An Object with options. Available options:
+ * {String} [type] Type of data to be returned. Can
+ * be 'DataTable' or 'Array' (default)
+ * {Object.} [convert]
+ * {String[]} [fields] field names to be returned
+ * {function} [filter] filter items
+ * {String | function} [order] Order the items by
+ * a field name or custom sort function.
+ * {Array | DataTable} [data] If provided, items will be appended to this
+ * array or table. Required in case of Google
+ * DataTable.
+ * @param args
+ */
+ DataView.prototype.get = function (args) {
+ var me = this;
+
+ // parse the arguments
+ var ids, options, data;
+ var firstType = util.getType(arguments[0]);
+ if (firstType == 'String' || firstType == 'Number' || firstType == 'Array') {
+ // get(id(s) [, options] [, data])
+ ids = arguments[0]; // can be a single id or an array with ids
+ options = arguments[1];
+ data = arguments[2];
+ } else {
+ // get([, options] [, data])
+ options = arguments[0];
+ data = arguments[1];
+ }
+
+ // extend the options with the default options and provided options
+ var viewOptions = util.extend({}, this._options, options);
+
+ // create a combined filter method when needed
+ if (this._options.filter && options && options.filter) {
+ viewOptions.filter = function (item) {
+ return me._options.filter(item) && options.filter(item);
+ };
+ }
+
+ // build up the call to the linked data set
+ var getArguments = [];
+ if (ids != undefined) {
+ getArguments.push(ids);
+ }
+ getArguments.push(viewOptions);
+ getArguments.push(data);
+
+ return this._data && this._data.get.apply(this._data, getArguments);
+ };
+
+ /**
+ * Get ids of all items or from a filtered set of items.
+ * @param {Object} [options] An Object with options. Available options:
+ * {function} [filter] filter items
+ * {String | function} [order] Order the items by
+ * a field name or custom sort function.
+ * @return {Array} ids
+ */
+ DataView.prototype.getIds = function (options) {
+ var ids;
+
+ if (this._data) {
+ var defaultFilter = this._options.filter;
+ var filter;
+
+ if (options && options.filter) {
+ if (defaultFilter) {
+ filter = function (item) {
+ return defaultFilter(item) && options.filter(item);
+ };
+ } else {
+ filter = options.filter;
+ }
+ } else {
+ filter = defaultFilter;
+ }
+
+ ids = this._data.getIds({
+ filter: filter,
+ order: options && options.order
+ });
+ } else {
+ ids = [];
+ }
+
+ return ids;
+ };
+
+ /**
+ * Get the DataSet to which this DataView is connected. In case there is a chain
+ * of multiple DataViews, the root DataSet of this chain is returned.
+ * @return {DataSet} dataSet
+ */
+ DataView.prototype.getDataSet = function () {
+ var dataSet = this;
+ while (dataSet instanceof DataView) {
+ dataSet = dataSet._data;
+ }
+ return dataSet || null;
+ };
+
+ /**
+ * Event listener. Will propagate all events from the connected data set to
+ * the subscribers of the DataView, but will filter the items and only trigger
+ * when there are changes in the filtered data set.
+ * @param {String} event
+ * @param {Object | null} params
+ * @param {String} senderId
+ * @private
+ */
+ DataView.prototype._onEvent = function (event, params, senderId) {
+ var i, len, id, item;
+ var ids = params && params.items;
+ var data = this._data;
+ var updatedData = [];
+ var added = [];
+ var updated = [];
+ var removed = [];
+
+ if (ids && data) {
+ switch (event) {
+ case 'add':
+ // filter the ids of the added items
+ for (i = 0, len = ids.length; i < len; i++) {
+ id = ids[i];
+ item = this.get(id);
+ if (item) {
+ this._ids[id] = true;
+ added.push(id);
+ }
+ }
+
+ break;
+
+ case 'update':
+ // determine the event from the views viewpoint: an updated
+ // item can be added, updated, or removed from this view.
+ for (i = 0, len = ids.length; i < len; i++) {
+ id = ids[i];
+ item = this.get(id);
+
+ if (item) {
+ if (this._ids[id]) {
+ updated.push(id);
+ updatedData.push(params.data[i]);
+ } else {
+ this._ids[id] = true;
+ added.push(id);
+ }
+ } else {
+ if (this._ids[id]) {
+ delete this._ids[id];
+ removed.push(id);
+ } else {}
+ }
+ }
+
+ break;
+
+ case 'remove':
+ // filter the ids of the removed items
+ for (i = 0, len = ids.length; i < len; i++) {
+ id = ids[i];
+ if (this._ids[id]) {
+ delete this._ids[id];
+ removed.push(id);
+ }
+ }
+
+ break;
+ }
+
+ this.length += added.length - removed.length;
+
+ if (added.length) {
+ this._trigger('add', { items: added }, senderId);
+ }
+ if (updated.length) {
+ this._trigger('update', { items: updated, data: updatedData }, senderId);
+ }
+ if (removed.length) {
+ this._trigger('remove', { items: removed }, senderId);
+ }
+ }
+ };
+
+ // copy subscription functionality from DataSet
+ DataView.prototype.on = DataSet.prototype.on;
+ DataView.prototype.off = DataSet.prototype.off;
+ DataView.prototype._trigger = DataSet.prototype._trigger;
+
+ // TODO: make these functions deprecated (replaced with `on` and `off` since version 0.5)
+ DataView.prototype.subscribe = DataView.prototype.on;
+ DataView.prototype.unsubscribe = DataView.prototype.off;
+
+ module.exports = DataView;
+
+ // nothing interesting for me :-(
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Emitter = __webpack_require__(12);
+ var DataSet = __webpack_require__(8);
+ var DataView = __webpack_require__(10);
+ var util = __webpack_require__(1);
+ var Point3d = __webpack_require__(13);
+ var Point2d = __webpack_require__(14);
+ var Camera = __webpack_require__(15);
+ var Filter = __webpack_require__(16);
+ var Slider = __webpack_require__(17);
+ var StepNumber = __webpack_require__(18);
+
+ /**
+ * @constructor Graph3d
+ * Graph3d displays data in 3d.
+ *
+ * Graph3d is developed in javascript as a Google Visualization Chart.
+ *
+ * @param {Element} container The DOM element in which the Graph3d will
+ * be created. Normally a div element.
+ * @param {DataSet | DataView | Array} [data]
+ * @param {Object} [options]
+ */
+ function Graph3d(container, data, options) {
+ if (!(this instanceof Graph3d)) {
+ throw new SyntaxError('Constructor must be called with the new operator');
+ }
+
+ // create variables and set default values
+ this.containerElement = container;
+ this.width = '400px';
+ this.height = '400px';
+ this.margin = 10; // px
+ this.defaultXCenter = '55%';
+ this.defaultYCenter = '50%';
+
+ this.xLabel = 'x';
+ this.yLabel = 'y';
+ this.zLabel = 'z';
+
+ var passValueFn = function passValueFn(v) {
+ return v;
+ };
+ this.xValueLabel = passValueFn;
+ this.yValueLabel = passValueFn;
+ this.zValueLabel = passValueFn;
+
+ this.filterLabel = 'time';
+ this.legendLabel = 'value';
+
+ this.style = Graph3d.STYLE.DOT;
+ this.showPerspective = true;
+ this.showGrid = true;
+ this.keepAspectRatio = true;
+ this.showShadow = false;
+ this.showGrayBottom = false; // TODO: this does not work correctly
+ this.showTooltip = false;
+ this.verticalRatio = 0.5; // 0.1 to 1.0, where 1.0 results in a 'cube'
+
+ this.animationInterval = 1000; // milliseconds
+ this.animationPreload = false;
+
+ this.camera = new Camera();
+ this.camera.setArmRotation(1.0, 0.5);
+ this.camera.setArmLength(1.7);
+ this.eye = new Point3d(0, 0, -1); // TODO: set eye.z about 3/4 of the width of the window?
+
+ this.dataTable = null; // The original data table
+ this.dataPoints = null; // The table with point objects
+
+ // the column indexes
+ this.colX = undefined;
+ this.colY = undefined;
+ this.colZ = undefined;
+ this.colValue = undefined;
+ this.colFilter = undefined;
+
+ this.xMin = 0;
+ this.xStep = undefined; // auto by default
+ this.xMax = 1;
+ this.yMin = 0;
+ this.yStep = undefined; // auto by default
+ this.yMax = 1;
+ this.zMin = 0;
+ this.zStep = undefined; // auto by default
+ this.zMax = 1;
+ this.valueMin = 0;
+ this.valueMax = 1;
+ this.xBarWidth = 1;
+ this.yBarWidth = 1;
+ // TODO: customize axis range
+
+ // colors
+ this.axisColor = '#4D4D4D';
+ this.gridColor = '#D3D3D3';
+ this.dataColor = {
+ fill: '#7DC1FF',
+ stroke: '#3267D2',
+ strokeWidth: 1 // px
+ };
+
+ // create a frame and canvas
+ this.create();
+
+ // apply options (also when undefined)
+ this.setOptions(options);
+
+ // apply data
+ if (data) {
+ this.setData(data);
+ }
+ }
+
+ // Extend Graph3d with an Emitter mixin
+ Emitter(Graph3d.prototype);
+
+ /**
+ * Calculate the scaling values, dependent on the range in x, y, and z direction
+ */
+ Graph3d.prototype._setScale = function () {
+ this.scale = new Point3d(1 / (this.xMax - this.xMin), 1 / (this.yMax - this.yMin), 1 / (this.zMax - this.zMin));
+
+ // keep aspect ration between x and y scale if desired
+ if (this.keepAspectRatio) {
+ if (this.scale.x < this.scale.y) {
+ //noinspection JSSuspiciousNameCombination
+ this.scale.y = this.scale.x;
+ } else {
+ //noinspection JSSuspiciousNameCombination
+ this.scale.x = this.scale.y;
+ }
+ }
+
+ // scale the vertical axis
+ this.scale.z *= this.verticalRatio;
+ // TODO: can this be automated? verticalRatio?
+
+ // determine scale for (optional) value
+ this.scale.value = 1 / (this.valueMax - this.valueMin);
+
+ // position the camera arm
+ var xCenter = (this.xMax + this.xMin) / 2 * this.scale.x;
+ var yCenter = (this.yMax + this.yMin) / 2 * this.scale.y;
+ var zCenter = (this.zMax + this.zMin) / 2 * this.scale.z;
+ this.camera.setArmLocation(xCenter, yCenter, zCenter);
+ };
+
+ /**
+ * Convert a 3D location to a 2D location on screen
+ * http://en.wikipedia.org/wiki/3D_projection
+ * @param {Point3d} point3d A 3D point with parameters x, y, z
+ * @return {Point2d} point2d A 2D point with parameters x, y
+ */
+ Graph3d.prototype._convert3Dto2D = function (point3d) {
+ var translation = this._convertPointToTranslation(point3d);
+ return this._convertTranslationToScreen(translation);
+ };
+
+ /**
+ * Convert a 3D location its translation seen from the camera
+ * http://en.wikipedia.org/wiki/3D_projection
+ * @param {Point3d} point3d A 3D point with parameters x, y, z
+ * @return {Point3d} translation A 3D point with parameters x, y, z This is
+ * the translation of the point, seen from the
+ * camera
+ */
+ Graph3d.prototype._convertPointToTranslation = function (point3d) {
+ var ax = point3d.x * this.scale.x,
+ ay = point3d.y * this.scale.y,
+ az = point3d.z * this.scale.z,
+ cx = this.camera.getCameraLocation().x,
+ cy = this.camera.getCameraLocation().y,
+ cz = this.camera.getCameraLocation().z,
+
+ // calculate angles
+ sinTx = Math.sin(this.camera.getCameraRotation().x),
+ cosTx = Math.cos(this.camera.getCameraRotation().x),
+ sinTy = Math.sin(this.camera.getCameraRotation().y),
+ cosTy = Math.cos(this.camera.getCameraRotation().y),
+ sinTz = Math.sin(this.camera.getCameraRotation().z),
+ cosTz = Math.cos(this.camera.getCameraRotation().z),
+
+ // calculate translation
+ dx = cosTy * (sinTz * (ay - cy) + cosTz * (ax - cx)) - sinTy * (az - cz),
+ dy = sinTx * (cosTy * (az - cz) + sinTy * (sinTz * (ay - cy) + cosTz * (ax - cx))) + cosTx * (cosTz * (ay - cy) - sinTz * (ax - cx)),
+ dz = cosTx * (cosTy * (az - cz) + sinTy * (sinTz * (ay - cy) + cosTz * (ax - cx))) - sinTx * (cosTz * (ay - cy) - sinTz * (ax - cx));
+
+ return new Point3d(dx, dy, dz);
+ };
+
+ /**
+ * Convert a translation point to a point on the screen
+ * @param {Point3d} translation A 3D point with parameters x, y, z This is
+ * the translation of the point, seen from the
+ * camera
+ * @return {Point2d} point2d A 2D point with parameters x, y
+ */
+ Graph3d.prototype._convertTranslationToScreen = function (translation) {
+ var ex = this.eye.x,
+ ey = this.eye.y,
+ ez = this.eye.z,
+ dx = translation.x,
+ dy = translation.y,
+ dz = translation.z;
+
+ // calculate position on screen from translation
+ var bx;
+ var by;
+ if (this.showPerspective) {
+ bx = (dx - ex) * (ez / dz);
+ by = (dy - ey) * (ez / dz);
+ } else {
+ bx = dx * -(ez / this.camera.getArmLength());
+ by = dy * -(ez / this.camera.getArmLength());
+ }
+
+ // shift and scale the point to the center of the screen
+ // use the width of the graph to scale both horizontally and vertically.
+ return new Point2d(this.xcenter + bx * this.frame.canvas.clientWidth, this.ycenter - by * this.frame.canvas.clientWidth);
+ };
+
+ /**
+ * Set the background styling for the graph
+ * @param {string | {fill: string, stroke: string, strokeWidth: string}} backgroundColor
+ */
+ Graph3d.prototype._setBackgroundColor = function (backgroundColor) {
+ var fill = 'white';
+ var stroke = 'gray';
+ var strokeWidth = 1;
+
+ if (typeof backgroundColor === 'string') {
+ fill = backgroundColor;
+ stroke = 'none';
+ strokeWidth = 0;
+ } else if (typeof backgroundColor === 'object') {
+ if (backgroundColor.fill !== undefined) fill = backgroundColor.fill;
+ if (backgroundColor.stroke !== undefined) stroke = backgroundColor.stroke;
+ if (backgroundColor.strokeWidth !== undefined) strokeWidth = backgroundColor.strokeWidth;
+ } else if (backgroundColor === undefined) {} else {
+ throw 'Unsupported type of backgroundColor';
+ }
+
+ this.frame.style.backgroundColor = fill;
+ this.frame.style.borderColor = stroke;
+ this.frame.style.borderWidth = strokeWidth + 'px';
+ this.frame.style.borderStyle = 'solid';
+ };
+
+ /// enumerate the available styles
+ Graph3d.STYLE = {
+ BAR: 0,
+ BARCOLOR: 1,
+ BARSIZE: 2,
+ DOT: 3,
+ DOTLINE: 4,
+ DOTCOLOR: 5,
+ DOTSIZE: 6,
+ GRID: 7,
+ LINE: 8,
+ SURFACE: 9
+ };
+
+ /**
+ * Retrieve the style index from given styleName
+ * @param {string} styleName Style name such as 'dot', 'grid', 'dot-line'
+ * @return {Number} styleNumber Enumeration value representing the style, or -1
+ * when not found
+ */
+ Graph3d.prototype._getStyleNumber = function (styleName) {
+ switch (styleName) {
+ case 'dot':
+ return Graph3d.STYLE.DOT;
+ case 'dot-line':
+ return Graph3d.STYLE.DOTLINE;
+ case 'dot-color':
+ return Graph3d.STYLE.DOTCOLOR;
+ case 'dot-size':
+ return Graph3d.STYLE.DOTSIZE;
+ case 'line':
+ return Graph3d.STYLE.LINE;
+ case 'grid':
+ return Graph3d.STYLE.GRID;
+ case 'surface':
+ return Graph3d.STYLE.SURFACE;
+ case 'bar':
+ return Graph3d.STYLE.BAR;
+ case 'bar-color':
+ return Graph3d.STYLE.BARCOLOR;
+ case 'bar-size':
+ return Graph3d.STYLE.BARSIZE;
+ }
+
+ return -1;
+ };
+
+ /**
+ * Determine the indexes of the data columns, based on the given style and data
+ * @param {DataSet} data
+ * @param {Number} style
+ */
+ Graph3d.prototype._determineColumnIndexes = function (data, style) {
+ if (this.style === Graph3d.STYLE.DOT || this.style === Graph3d.STYLE.DOTLINE || this.style === Graph3d.STYLE.LINE || this.style === Graph3d.STYLE.GRID || this.style === Graph3d.STYLE.SURFACE || this.style === Graph3d.STYLE.BAR) {
+ // 3 columns expected, and optionally a 4th with filter values
+ this.colX = 0;
+ this.colY = 1;
+ this.colZ = 2;
+ this.colValue = undefined;
+
+ if (data.getNumberOfColumns() > 3) {
+ this.colFilter = 3;
+ }
+ } else if (this.style === Graph3d.STYLE.DOTCOLOR || this.style === Graph3d.STYLE.DOTSIZE || this.style === Graph3d.STYLE.BARCOLOR || this.style === Graph3d.STYLE.BARSIZE) {
+ // 4 columns expected, and optionally a 5th with filter values
+ this.colX = 0;
+ this.colY = 1;
+ this.colZ = 2;
+ this.colValue = 3;
+
+ if (data.getNumberOfColumns() > 4) {
+ this.colFilter = 4;
+ }
+ } else {
+ throw 'Unknown style "' + this.style + '"';
+ }
+ };
+
+ Graph3d.prototype.getNumberOfRows = function (data) {
+ return data.length;
+ };
+
+ Graph3d.prototype.getNumberOfColumns = function (data) {
+ var counter = 0;
+ for (var column in data[0]) {
+ if (data[0].hasOwnProperty(column)) {
+ counter++;
+ }
+ }
+ return counter;
+ };
+
+ Graph3d.prototype.getDistinctValues = function (data, column) {
+ var distinctValues = [];
+ for (var i = 0; i < data.length; i++) {
+ if (distinctValues.indexOf(data[i][column]) == -1) {
+ distinctValues.push(data[i][column]);
+ }
+ }
+ return distinctValues;
+ };
+
+ Graph3d.prototype.getColumnRange = function (data, column) {
+ var minMax = { min: data[0][column], max: data[0][column] };
+ for (var i = 0; i < data.length; i++) {
+ if (minMax.min > data[i][column]) {
+ minMax.min = data[i][column];
+ }
+ if (minMax.max < data[i][column]) {
+ minMax.max = data[i][column];
+ }
+ }
+ return minMax;
+ };
+
+ /**
+ * Initialize the data from the data table. Calculate minimum and maximum values
+ * and column index values
+ * @param {Array | DataSet | DataView} rawData The data containing the items for the Graph.
+ * @param {Number} style Style Number
+ */
+ Graph3d.prototype._dataInitialize = function (rawData, style) {
+ var me = this;
+
+ // unsubscribe from the dataTable
+ if (this.dataSet) {
+ this.dataSet.off('*', this._onChange);
+ }
+
+ if (rawData === undefined) return;
+
+ if (Array.isArray(rawData)) {
+ rawData = new DataSet(rawData);
+ }
+
+ var data;
+ if (rawData instanceof DataSet || rawData instanceof DataView) {
+ data = rawData.get();
+ } else {
+ throw new Error('Array, DataSet, or DataView expected');
+ }
+
+ if (data.length == 0) return;
+
+ this.dataSet = rawData;
+ this.dataTable = data;
+
+ // subscribe to changes in the dataset
+ this._onChange = function () {
+ me.setData(me.dataSet);
+ };
+ this.dataSet.on('*', this._onChange);
+
+ // _determineColumnIndexes
+ // getNumberOfRows (points)
+ // getNumberOfColumns (x,y,z,v,t,t1,t2...)
+ // getDistinctValues (unique values?)
+ // getColumnRange
+
+ // determine the location of x,y,z,value,filter columns
+ this.colX = 'x';
+ this.colY = 'y';
+ this.colZ = 'z';
+ this.colValue = 'style';
+ this.colFilter = 'filter';
+
+ // check if a filter column is provided
+ if (data[0].hasOwnProperty('filter')) {
+ if (this.dataFilter === undefined) {
+ this.dataFilter = new Filter(rawData, this.colFilter, this);
+ this.dataFilter.setOnLoadCallback(function () {
+ me.redraw();
+ });
+ }
+ }
+
+ var withBars = this.style == Graph3d.STYLE.BAR || this.style == Graph3d.STYLE.BARCOLOR || this.style == Graph3d.STYLE.BARSIZE;
+
+ // determine barWidth from data
+ if (withBars) {
+ if (this.defaultXBarWidth !== undefined) {
+ this.xBarWidth = this.defaultXBarWidth;
+ } else {
+ var dataX = this.getDistinctValues(data, this.colX);
+ this.xBarWidth = dataX[1] - dataX[0] || 1;
+ }
+
+ if (this.defaultYBarWidth !== undefined) {
+ this.yBarWidth = this.defaultYBarWidth;
+ } else {
+ var dataY = this.getDistinctValues(data, this.colY);
+ this.yBarWidth = dataY[1] - dataY[0] || 1;
+ }
+ }
+
+ // calculate minimums and maximums
+ var xRange = this.getColumnRange(data, this.colX);
+ if (withBars) {
+ xRange.min -= this.xBarWidth / 2;
+ xRange.max += this.xBarWidth / 2;
+ }
+ this.xMin = this.defaultXMin !== undefined ? this.defaultXMin : xRange.min;
+ this.xMax = this.defaultXMax !== undefined ? this.defaultXMax : xRange.max;
+ if (this.xMax <= this.xMin) this.xMax = this.xMin + 1;
+ this.xStep = this.defaultXStep !== undefined ? this.defaultXStep : (this.xMax - this.xMin) / 5;
+
+ var yRange = this.getColumnRange(data, this.colY);
+ if (withBars) {
+ yRange.min -= this.yBarWidth / 2;
+ yRange.max += this.yBarWidth / 2;
+ }
+ this.yMin = this.defaultYMin !== undefined ? this.defaultYMin : yRange.min;
+ this.yMax = this.defaultYMax !== undefined ? this.defaultYMax : yRange.max;
+ if (this.yMax <= this.yMin) this.yMax = this.yMin + 1;
+ this.yStep = this.defaultYStep !== undefined ? this.defaultYStep : (this.yMax - this.yMin) / 5;
+
+ var zRange = this.getColumnRange(data, this.colZ);
+ this.zMin = this.defaultZMin !== undefined ? this.defaultZMin : zRange.min;
+ this.zMax = this.defaultZMax !== undefined ? this.defaultZMax : zRange.max;
+ if (this.zMax <= this.zMin) this.zMax = this.zMin + 1;
+ this.zStep = this.defaultZStep !== undefined ? this.defaultZStep : (this.zMax - this.zMin) / 5;
+
+ if (this.colValue !== undefined) {
+ var valueRange = this.getColumnRange(data, this.colValue);
+ this.valueMin = this.defaultValueMin !== undefined ? this.defaultValueMin : valueRange.min;
+ this.valueMax = this.defaultValueMax !== undefined ? this.defaultValueMax : valueRange.max;
+ if (this.valueMax <= this.valueMin) this.valueMax = this.valueMin + 1;
+ }
+
+ // set the scale dependent on the ranges.
+ this._setScale();
+ };
+
+ /**
+ * Filter the data based on the current filter
+ * @param {Array} data
+ * @return {Array} dataPoints Array with point objects which can be drawn on screen
+ */
+ Graph3d.prototype._getDataPoints = function (data) {
+ // TODO: store the created matrix dataPoints in the filters instead of reloading each time
+ var x, y, i, z, obj, point;
+
+ var dataPoints = [];
+
+ if (this.style === Graph3d.STYLE.GRID || this.style === Graph3d.STYLE.SURFACE) {
+ // copy all values from the google data table to a matrix
+ // the provided values are supposed to form a grid of (x,y) positions
+
+ // create two lists with all present x and y values
+ var dataX = [];
+ var dataY = [];
+ for (i = 0; i < this.getNumberOfRows(data); i++) {
+ x = data[i][this.colX] || 0;
+ y = data[i][this.colY] || 0;
+
+ if (dataX.indexOf(x) === -1) {
+ dataX.push(x);
+ }
+ if (dataY.indexOf(y) === -1) {
+ dataY.push(y);
+ }
+ }
+
+ var sortNumber = function sortNumber(a, b) {
+ return a - b;
+ };
+ dataX.sort(sortNumber);
+ dataY.sort(sortNumber);
+
+ // create a grid, a 2d matrix, with all values.
+ var dataMatrix = []; // temporary data matrix
+ for (i = 0; i < data.length; i++) {
+ x = data[i][this.colX] || 0;
+ y = data[i][this.colY] || 0;
+ z = data[i][this.colZ] || 0;
+
+ var xIndex = dataX.indexOf(x); // TODO: implement Array().indexOf() for Internet Explorer
+ var yIndex = dataY.indexOf(y);
+
+ if (dataMatrix[xIndex] === undefined) {
+ dataMatrix[xIndex] = [];
+ }
+
+ var point3d = new Point3d();
+ point3d.x = x;
+ point3d.y = y;
+ point3d.z = z;
+
+ obj = {};
+ obj.point = point3d;
+ obj.trans = undefined;
+ obj.screen = undefined;
+ obj.bottom = new Point3d(x, y, this.zMin);
+
+ dataMatrix[xIndex][yIndex] = obj;
+
+ dataPoints.push(obj);
+ }
+
+ // fill in the pointers to the neighbors.
+ for (x = 0; x < dataMatrix.length; x++) {
+ for (y = 0; y < dataMatrix[x].length; y++) {
+ if (dataMatrix[x][y]) {
+ dataMatrix[x][y].pointRight = x < dataMatrix.length - 1 ? dataMatrix[x + 1][y] : undefined;
+ dataMatrix[x][y].pointTop = y < dataMatrix[x].length - 1 ? dataMatrix[x][y + 1] : undefined;
+ dataMatrix[x][y].pointCross = x < dataMatrix.length - 1 && y < dataMatrix[x].length - 1 ? dataMatrix[x + 1][y + 1] : undefined;
+ }
+ }
+ }
+ } else {
+ // 'dot', 'dot-line', etc.
+ // copy all values from the google data table to a list with Point3d objects
+ for (i = 0; i < data.length; i++) {
+ point = new Point3d();
+ point.x = data[i][this.colX] || 0;
+ point.y = data[i][this.colY] || 0;
+ point.z = data[i][this.colZ] || 0;
+
+ if (this.colValue !== undefined) {
+ point.value = data[i][this.colValue] || 0;
+ }
+
+ obj = {};
+ obj.point = point;
+ obj.bottom = new Point3d(point.x, point.y, this.zMin);
+ obj.trans = undefined;
+ obj.screen = undefined;
+
+ dataPoints.push(obj);
+ }
+ }
+
+ return dataPoints;
+ };
+
+ /**
+ * Create the main frame for the Graph3d.
+ * This function is executed once when a Graph3d object is created. The frame
+ * contains a canvas, and this canvas contains all objects like the axis and
+ * nodes.
+ */
+ Graph3d.prototype.create = function () {
+ // remove all elements from the container element.
+ while (this.containerElement.hasChildNodes()) {
+ this.containerElement.removeChild(this.containerElement.firstChild);
+ }
+
+ this.frame = document.createElement('div');
+ this.frame.style.position = 'relative';
+ this.frame.style.overflow = 'hidden';
+
+ // create the graph canvas (HTML canvas element)
+ this.frame.canvas = document.createElement('canvas');
+ this.frame.canvas.style.position = 'relative';
+ this.frame.appendChild(this.frame.canvas);
+ //if (!this.frame.canvas.getContext) {
+ {
+ var noCanvas = document.createElement('DIV');
+ noCanvas.style.color = 'red';
+ noCanvas.style.fontWeight = 'bold';
+ noCanvas.style.padding = '10px';
+ noCanvas.innerHTML = 'Error: your browser does not support HTML canvas';
+ this.frame.canvas.appendChild(noCanvas);
+ }
+
+ this.frame.filter = document.createElement('div');
+ this.frame.filter.style.position = 'absolute';
+ this.frame.filter.style.bottom = '0px';
+ this.frame.filter.style.left = '0px';
+ this.frame.filter.style.width = '100%';
+ this.frame.appendChild(this.frame.filter);
+
+ // add event listeners to handle moving and zooming the contents
+ var me = this;
+ var onmousedown = function onmousedown(event) {
+ me._onMouseDown(event);
+ };
+ var ontouchstart = function ontouchstart(event) {
+ me._onTouchStart(event);
+ };
+ var onmousewheel = function onmousewheel(event) {
+ me._onWheel(event);
+ };
+ var ontooltip = function ontooltip(event) {
+ me._onTooltip(event);
+ };
+ // TODO: these events are never cleaned up... can give a 'memory leakage'
+
+ util.addEventListener(this.frame.canvas, 'keydown', onkeydown);
+ util.addEventListener(this.frame.canvas, 'mousedown', onmousedown);
+ util.addEventListener(this.frame.canvas, 'touchstart', ontouchstart);
+ util.addEventListener(this.frame.canvas, 'mousewheel', onmousewheel);
+ util.addEventListener(this.frame.canvas, 'mousemove', ontooltip);
+
+ // add the new graph to the container element
+ this.containerElement.appendChild(this.frame);
+ };
+
+ /**
+ * Set a new size for the graph
+ * @param {string} width Width in pixels or percentage (for example '800px'
+ * or '50%')
+ * @param {string} height Height in pixels or percentage (for example '400px'
+ * or '30%')
+ */
+ Graph3d.prototype.setSize = function (width, height) {
+ this.frame.style.width = width;
+ this.frame.style.height = height;
+
+ this._resizeCanvas();
+ };
+
+ /**
+ * Resize the canvas to the current size of the frame
+ */
+ Graph3d.prototype._resizeCanvas = function () {
+ this.frame.canvas.style.width = '100%';
+ this.frame.canvas.style.height = '100%';
+
+ this.frame.canvas.width = this.frame.canvas.clientWidth;
+ this.frame.canvas.height = this.frame.canvas.clientHeight;
+
+ // adjust with for margin
+ this.frame.filter.style.width = this.frame.canvas.clientWidth - 2 * 10 + 'px';
+ };
+
+ /**
+ * Start animation
+ */
+ Graph3d.prototype.animationStart = function () {
+ if (!this.frame.filter || !this.frame.filter.slider) throw 'No animation available';
+
+ this.frame.filter.slider.play();
+ };
+
+ /**
+ * Stop animation
+ */
+ Graph3d.prototype.animationStop = function () {
+ if (!this.frame.filter || !this.frame.filter.slider) return;
+
+ this.frame.filter.slider.stop();
+ };
+
+ /**
+ * Resize the center position based on the current values in this.defaultXCenter
+ * and this.defaultYCenter (which are strings with a percentage or a value
+ * in pixels). The center positions are the variables this.xCenter
+ * and this.yCenter
+ */
+ Graph3d.prototype._resizeCenter = function () {
+ // calculate the horizontal center position
+ if (this.defaultXCenter.charAt(this.defaultXCenter.length - 1) === '%') {
+ this.xcenter = parseFloat(this.defaultXCenter) / 100 * this.frame.canvas.clientWidth;
+ } else {
+ this.xcenter = parseFloat(this.defaultXCenter); // supposed to be in px
+ }
+
+ // calculate the vertical center position
+ if (this.defaultYCenter.charAt(this.defaultYCenter.length - 1) === '%') {
+ this.ycenter = parseFloat(this.defaultYCenter) / 100 * (this.frame.canvas.clientHeight - this.frame.filter.clientHeight);
+ } else {
+ this.ycenter = parseFloat(this.defaultYCenter); // supposed to be in px
+ }
+ };
+
+ /**
+ * Set the rotation and distance of the camera
+ * @param {Object} pos An object with the camera position. The object
+ * contains three parameters:
+ * - horizontal {Number}
+ * The horizontal rotation, between 0 and 2*PI.
+ * Optional, can be left undefined.
+ * - vertical {Number}
+ * The vertical rotation, between 0 and 0.5*PI
+ * if vertical=0.5*PI, the graph is shown from the
+ * top. Optional, can be left undefined.
+ * - distance {Number}
+ * The (normalized) distance of the camera to the
+ * center of the graph, a value between 0.71 and 5.0.
+ * Optional, can be left undefined.
+ */
+ Graph3d.prototype.setCameraPosition = function (pos) {
+ if (pos === undefined) {
+ return;
+ }
+
+ if (pos.horizontal !== undefined && pos.vertical !== undefined) {
+ this.camera.setArmRotation(pos.horizontal, pos.vertical);
+ }
+
+ if (pos.distance !== undefined) {
+ this.camera.setArmLength(pos.distance);
+ }
+
+ this.redraw();
+ };
+
+ /**
+ * Retrieve the current camera rotation
+ * @return {object} An object with parameters horizontal, vertical, and
+ * distance
+ */
+ Graph3d.prototype.getCameraPosition = function () {
+ var pos = this.camera.getArmRotation();
+ pos.distance = this.camera.getArmLength();
+ return pos;
+ };
+
+ /**
+ * Load data into the 3D Graph
+ */
+ Graph3d.prototype._readData = function (data) {
+ // read the data
+ this._dataInitialize(data, this.style);
+
+ if (this.dataFilter) {
+ // apply filtering
+ this.dataPoints = this.dataFilter._getDataPoints();
+ } else {
+ // no filtering. load all data
+ this.dataPoints = this._getDataPoints(this.dataTable);
+ }
+
+ // draw the filter
+ this._redrawFilter();
+ };
+
+ /**
+ * Replace the dataset of the Graph3d
+ * @param {Array | DataSet | DataView} data
+ */
+ Graph3d.prototype.setData = function (data) {
+ this._readData(data);
+ this.redraw();
+
+ // start animation when option is true
+ if (this.animationAutoStart && this.dataFilter) {
+ this.animationStart();
+ }
+ };
+
+ /**
+ * Update the options. Options will be merged with current options
+ * @param {Object} options
+ */
+ Graph3d.prototype.setOptions = function (options) {
+ var cameraPosition = undefined;
+
+ this.animationStop();
+
+ if (options !== undefined) {
+ // retrieve parameter values
+ if (options.width !== undefined) this.width = options.width;
+ if (options.height !== undefined) this.height = options.height;
+
+ if (options.xCenter !== undefined) this.defaultXCenter = options.xCenter;
+ if (options.yCenter !== undefined) this.defaultYCenter = options.yCenter;
+
+ if (options.filterLabel !== undefined) this.filterLabel = options.filterLabel;
+ if (options.legendLabel !== undefined) this.legendLabel = options.legendLabel;
+ if (options.xLabel !== undefined) this.xLabel = options.xLabel;
+ if (options.yLabel !== undefined) this.yLabel = options.yLabel;
+ if (options.zLabel !== undefined) this.zLabel = options.zLabel;
+
+ if (options.xValueLabel !== undefined) this.xValueLabel = options.xValueLabel;
+ if (options.yValueLabel !== undefined) this.yValueLabel = options.yValueLabel;
+ if (options.zValueLabel !== undefined) this.zValueLabel = options.zValueLabel;
+
+ if (options.style !== undefined) {
+ var styleNumber = this._getStyleNumber(options.style);
+ if (styleNumber !== -1) {
+ this.style = styleNumber;
+ }
+ }
+ if (options.showGrid !== undefined) this.showGrid = options.showGrid;
+ if (options.showPerspective !== undefined) this.showPerspective = options.showPerspective;
+ if (options.showShadow !== undefined) this.showShadow = options.showShadow;
+ if (options.tooltip !== undefined) this.showTooltip = options.tooltip;
+ if (options.showAnimationControls !== undefined) this.showAnimationControls = options.showAnimationControls;
+ if (options.keepAspectRatio !== undefined) this.keepAspectRatio = options.keepAspectRatio;
+ if (options.verticalRatio !== undefined) this.verticalRatio = options.verticalRatio;
+
+ if (options.animationInterval !== undefined) this.animationInterval = options.animationInterval;
+ if (options.animationPreload !== undefined) this.animationPreload = options.animationPreload;
+ if (options.animationAutoStart !== undefined) this.animationAutoStart = options.animationAutoStart;
+
+ if (options.xBarWidth !== undefined) this.defaultXBarWidth = options.xBarWidth;
+ if (options.yBarWidth !== undefined) this.defaultYBarWidth = options.yBarWidth;
+
+ if (options.xMin !== undefined) this.defaultXMin = options.xMin;
+ if (options.xStep !== undefined) this.defaultXStep = options.xStep;
+ if (options.xMax !== undefined) this.defaultXMax = options.xMax;
+ if (options.yMin !== undefined) this.defaultYMin = options.yMin;
+ if (options.yStep !== undefined) this.defaultYStep = options.yStep;
+ if (options.yMax !== undefined) this.defaultYMax = options.yMax;
+ if (options.zMin !== undefined) this.defaultZMin = options.zMin;
+ if (options.zStep !== undefined) this.defaultZStep = options.zStep;
+ if (options.zMax !== undefined) this.defaultZMax = options.zMax;
+ if (options.valueMin !== undefined) this.defaultValueMin = options.valueMin;
+ if (options.valueMax !== undefined) this.defaultValueMax = options.valueMax;
+ if (options.backgroundColor !== undefined) this._setBackgroundColor(options.backgroundColor);
+
+ if (options.cameraPosition !== undefined) cameraPosition = options.cameraPosition;
+
+ if (cameraPosition !== undefined) {
+ this.camera.setArmRotation(cameraPosition.horizontal, cameraPosition.vertical);
+ this.camera.setArmLength(cameraPosition.distance);
+ }
+
+ // colors
+ if (options.axisColor !== undefined) this.axisColor = options.axisColor;
+ if (options.gridColor !== undefined) this.gridColor = options.gridColor;
+ if (options.dataColor) {
+ if (typeof options.dataColor === 'string') {
+ this.dataColor.fill = options.dataColor;
+ this.dataColor.stroke = options.dataColor;
+ } else {
+ if (options.dataColor.fill) {
+ this.dataColor.fill = options.dataColor.fill;
+ }
+ if (options.dataColor.stroke) {
+ this.dataColor.stroke = options.dataColor.stroke;
+ }
+ if (options.dataColor.strokeWidth !== undefined) {
+ this.dataColor.strokeWidth = options.dataColor.strokeWidth;
+ }
+ }
+ }
+ }
+
+ this.setSize(this.width, this.height);
+
+ // re-load the data
+ if (this.dataTable) {
+ this.setData(this.dataTable);
+ }
+
+ // start animation when option is true
+ if (this.animationAutoStart && this.dataFilter) {
+ this.animationStart();
+ }
+ };
+
+ /**
+ * Redraw the Graph.
+ */
+ Graph3d.prototype.redraw = function () {
+ if (this.dataPoints === undefined) {
+ throw 'Error: graph data not initialized';
+ }
+
+ this._resizeCanvas();
+ this._resizeCenter();
+ this._redrawSlider();
+ this._redrawClear();
+ this._redrawAxis();
+
+ if (this.style === Graph3d.STYLE.GRID || this.style === Graph3d.STYLE.SURFACE) {
+ this._redrawDataGrid();
+ } else if (this.style === Graph3d.STYLE.LINE) {
+ this._redrawDataLine();
+ } else if (this.style === Graph3d.STYLE.BAR || this.style === Graph3d.STYLE.BARCOLOR || this.style === Graph3d.STYLE.BARSIZE) {
+ this._redrawDataBar();
+ } else {
+ // style is DOT, DOTLINE, DOTCOLOR, DOTSIZE
+ this._redrawDataDot();
+ }
+
+ this._redrawInfo();
+ this._redrawLegend();
+ };
+
+ /**
+ * Clear the canvas before redrawing
+ */
+ Graph3d.prototype._redrawClear = function () {
+ var canvas = this.frame.canvas;
+ var ctx = canvas.getContext('2d');
+
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
+ };
+
+ /**
+ * Redraw the legend showing the colors
+ */
+ Graph3d.prototype._redrawLegend = function () {
+ var y;
+
+ if (this.style === Graph3d.STYLE.DOTCOLOR || this.style === Graph3d.STYLE.DOTSIZE) {
+
+ var dotSize = this.frame.clientWidth * 0.02;
+
+ var widthMin, widthMax;
+ if (this.style === Graph3d.STYLE.DOTSIZE) {
+ widthMin = dotSize / 2; // px
+ widthMax = dotSize / 2 + dotSize * 2; // Todo: put this in one function
+ } else {
+ widthMin = 20; // px
+ widthMax = 20; // px
+ }
+
+ var height = Math.max(this.frame.clientHeight * 0.25, 100);
+ var top = this.margin;
+ var right = this.frame.clientWidth - this.margin;
+ var left = right - widthMax;
+ var bottom = top + height;
+ }
+
+ var canvas = this.frame.canvas;
+ var ctx = canvas.getContext('2d');
+ ctx.lineWidth = 1;
+ ctx.font = '14px arial'; // TODO: put in options
+
+ if (this.style === Graph3d.STYLE.DOTCOLOR) {
+ // draw the color bar
+ var ymin = 0;
+ var ymax = height; // Todo: make height customizable
+ for (y = ymin; y < ymax; y++) {
+ var f = (y - ymin) / (ymax - ymin);
+
+ //var width = (dotSize / 2 + (1-f) * dotSize * 2); // Todo: put this in one function
+ var hue = f * 240;
+ var color = this._hsv2rgb(hue, 1, 1);
+
+ ctx.strokeStyle = color;
+ ctx.beginPath();
+ ctx.moveTo(left, top + y);
+ ctx.lineTo(right, top + y);
+ ctx.stroke();
+ }
+
+ ctx.strokeStyle = this.axisColor;
+ ctx.strokeRect(left, top, widthMax, height);
+ }
+
+ if (this.style === Graph3d.STYLE.DOTSIZE) {
+ // draw border around color bar
+ ctx.strokeStyle = this.axisColor;
+ ctx.fillStyle = this.dataColor.fill;
+ ctx.beginPath();
+ ctx.moveTo(left, top);
+ ctx.lineTo(right, top);
+ ctx.lineTo(right - widthMax + widthMin, bottom);
+ ctx.lineTo(left, bottom);
+ ctx.closePath();
+ ctx.fill();
+ ctx.stroke();
+ }
+
+ if (this.style === Graph3d.STYLE.DOTCOLOR || this.style === Graph3d.STYLE.DOTSIZE) {
+ // print values along the color bar
+ var gridLineLen = 5; // px
+ var step = new StepNumber(this.valueMin, this.valueMax, (this.valueMax - this.valueMin) / 5, true);
+ step.start();
+ if (step.getCurrent() < this.valueMin) {
+ step.next();
+ }
+ while (!step.end()) {
+ y = bottom - (step.getCurrent() - this.valueMin) / (this.valueMax - this.valueMin) * height;
+
+ ctx.beginPath();
+ ctx.moveTo(left - gridLineLen, y);
+ ctx.lineTo(left, y);
+ ctx.stroke();
+
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ ctx.fillStyle = this.axisColor;
+ ctx.fillText(step.getCurrent(), left - 2 * gridLineLen, y);
+
+ step.next();
+ }
+
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'top';
+ var label = this.legendLabel;
+ ctx.fillText(label, right, bottom + this.margin);
+ }
+ };
+
+ /**
+ * Redraw the filter
+ */
+ Graph3d.prototype._redrawFilter = function () {
+ this.frame.filter.innerHTML = '';
+
+ if (this.dataFilter) {
+ var options = {
+ 'visible': this.showAnimationControls
+ };
+ var slider = new Slider(this.frame.filter, options);
+ this.frame.filter.slider = slider;
+
+ // TODO: css here is not nice here...
+ this.frame.filter.style.padding = '10px';
+ //this.frame.filter.style.backgroundColor = '#EFEFEF';
+
+ slider.setValues(this.dataFilter.values);
+ slider.setPlayInterval(this.animationInterval);
+
+ // create an event handler
+ var me = this;
+ var onchange = function onchange() {
+ var index = slider.getIndex();
+
+ me.dataFilter.selectValue(index);
+ me.dataPoints = me.dataFilter._getDataPoints();
+
+ me.redraw();
+ };
+ slider.setOnChangeCallback(onchange);
+ } else {
+ this.frame.filter.slider = undefined;
+ }
+ };
+
+ /**
+ * Redraw the slider
+ */
+ Graph3d.prototype._redrawSlider = function () {
+ if (this.frame.filter.slider !== undefined) {
+ this.frame.filter.slider.redraw();
+ }
+ };
+
+ /**
+ * Redraw common information
+ */
+ Graph3d.prototype._redrawInfo = function () {
+ if (this.dataFilter) {
+ var canvas = this.frame.canvas;
+ var ctx = canvas.getContext('2d');
+
+ ctx.font = '14px arial'; // TODO: put in options
+ ctx.lineStyle = 'gray';
+ ctx.fillStyle = 'gray';
+ ctx.textAlign = 'left';
+ ctx.textBaseline = 'top';
+
+ var x = this.margin;
+ var y = this.margin;
+ ctx.fillText(this.dataFilter.getLabel() + ': ' + this.dataFilter.getSelectedValue(), x, y);
+ }
+ };
+
+ /**
+ * Redraw the axis
+ */
+ Graph3d.prototype._redrawAxis = function () {
+ var canvas = this.frame.canvas,
+ ctx = canvas.getContext('2d'),
+ from,
+ to,
+ step,
+ prettyStep,
+ text,
+ xText,
+ yText,
+ zText,
+ offset,
+ xOffset,
+ yOffset,
+ xMin2d,
+ xMax2d;
+
+ // TODO: get the actual rendered style of the containerElement
+ //ctx.font = this.containerElement.style.font;
+ ctx.font = 24 / this.camera.getArmLength() + 'px arial';
+
+ // calculate the length for the short grid lines
+ var gridLenX = 0.025 / this.scale.x;
+ var gridLenY = 0.025 / this.scale.y;
+ var textMargin = 5 / this.camera.getArmLength(); // px
+ var armAngle = this.camera.getArmRotation().horizontal;
+
+ // draw x-grid lines
+ ctx.lineWidth = 1;
+ prettyStep = this.defaultXStep === undefined;
+ step = new StepNumber(this.xMin, this.xMax, this.xStep, prettyStep);
+ step.start();
+ if (step.getCurrent() < this.xMin) {
+ step.next();
+ }
+ while (!step.end()) {
+ var x = step.getCurrent();
+
+ if (this.showGrid) {
+ from = this._convert3Dto2D(new Point3d(x, this.yMin, this.zMin));
+ to = this._convert3Dto2D(new Point3d(x, this.yMax, this.zMin));
+ ctx.strokeStyle = this.gridColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+ } else {
+ from = this._convert3Dto2D(new Point3d(x, this.yMin, this.zMin));
+ to = this._convert3Dto2D(new Point3d(x, this.yMin + gridLenX, this.zMin));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+
+ from = this._convert3Dto2D(new Point3d(x, this.yMax, this.zMin));
+ to = this._convert3Dto2D(new Point3d(x, this.yMax - gridLenX, this.zMin));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+ }
+
+ yText = Math.cos(armAngle) > 0 ? this.yMin : this.yMax;
+ text = this._convert3Dto2D(new Point3d(x, yText, this.zMin));
+ if (Math.cos(armAngle * 2) > 0) {
+ ctx.textAlign = 'center';
+ ctx.textBaseline = 'top';
+ text.y += textMargin;
+ } else if (Math.sin(armAngle * 2) < 0) {
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ } else {
+ ctx.textAlign = 'left';
+ ctx.textBaseline = 'middle';
+ }
+ ctx.fillStyle = this.axisColor;
+ ctx.fillText(' ' + this.xValueLabel(step.getCurrent()) + ' ', text.x, text.y);
+
+ step.next();
+ }
+
+ // draw y-grid lines
+ ctx.lineWidth = 1;
+ prettyStep = this.defaultYStep === undefined;
+ step = new StepNumber(this.yMin, this.yMax, this.yStep, prettyStep);
+ step.start();
+ if (step.getCurrent() < this.yMin) {
+ step.next();
+ }
+ while (!step.end()) {
+ if (this.showGrid) {
+ from = this._convert3Dto2D(new Point3d(this.xMin, step.getCurrent(), this.zMin));
+ to = this._convert3Dto2D(new Point3d(this.xMax, step.getCurrent(), this.zMin));
+ ctx.strokeStyle = this.gridColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+ } else {
+ from = this._convert3Dto2D(new Point3d(this.xMin, step.getCurrent(), this.zMin));
+ to = this._convert3Dto2D(new Point3d(this.xMin + gridLenY, step.getCurrent(), this.zMin));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+
+ from = this._convert3Dto2D(new Point3d(this.xMax, step.getCurrent(), this.zMin));
+ to = this._convert3Dto2D(new Point3d(this.xMax - gridLenY, step.getCurrent(), this.zMin));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+ }
+
+ xText = Math.sin(armAngle) > 0 ? this.xMin : this.xMax;
+ text = this._convert3Dto2D(new Point3d(xText, step.getCurrent(), this.zMin));
+ if (Math.cos(armAngle * 2) < 0) {
+ ctx.textAlign = 'center';
+ ctx.textBaseline = 'top';
+ text.y += textMargin;
+ } else if (Math.sin(armAngle * 2) > 0) {
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ } else {
+ ctx.textAlign = 'left';
+ ctx.textBaseline = 'middle';
+ }
+ ctx.fillStyle = this.axisColor;
+ ctx.fillText(' ' + this.yValueLabel(step.getCurrent()) + ' ', text.x, text.y);
+
+ step.next();
+ }
+
+ // draw z-grid lines and axis
+ ctx.lineWidth = 1;
+ prettyStep = this.defaultZStep === undefined;
+ step = new StepNumber(this.zMin, this.zMax, this.zStep, prettyStep);
+ step.start();
+ if (step.getCurrent() < this.zMin) {
+ step.next();
+ }
+ xText = Math.cos(armAngle) > 0 ? this.xMin : this.xMax;
+ yText = Math.sin(armAngle) < 0 ? this.yMin : this.yMax;
+ while (!step.end()) {
+ // TODO: make z-grid lines really 3d?
+ from = this._convert3Dto2D(new Point3d(xText, yText, step.getCurrent()));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(from.x - textMargin, from.y);
+ ctx.stroke();
+
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ ctx.fillStyle = this.axisColor;
+ ctx.fillText(this.zValueLabel(step.getCurrent()) + ' ', from.x - 5, from.y);
+
+ step.next();
+ }
+ ctx.lineWidth = 1;
+ from = this._convert3Dto2D(new Point3d(xText, yText, this.zMin));
+ to = this._convert3Dto2D(new Point3d(xText, yText, this.zMax));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+
+ // draw x-axis
+ ctx.lineWidth = 1;
+ // line at yMin
+ xMin2d = this._convert3Dto2D(new Point3d(this.xMin, this.yMin, this.zMin));
+ xMax2d = this._convert3Dto2D(new Point3d(this.xMax, this.yMin, this.zMin));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(xMin2d.x, xMin2d.y);
+ ctx.lineTo(xMax2d.x, xMax2d.y);
+ ctx.stroke();
+ // line at ymax
+ xMin2d = this._convert3Dto2D(new Point3d(this.xMin, this.yMax, this.zMin));
+ xMax2d = this._convert3Dto2D(new Point3d(this.xMax, this.yMax, this.zMin));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(xMin2d.x, xMin2d.y);
+ ctx.lineTo(xMax2d.x, xMax2d.y);
+ ctx.stroke();
+
+ // draw y-axis
+ ctx.lineWidth = 1;
+ // line at xMin
+ from = this._convert3Dto2D(new Point3d(this.xMin, this.yMin, this.zMin));
+ to = this._convert3Dto2D(new Point3d(this.xMin, this.yMax, this.zMin));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+ // line at xMax
+ from = this._convert3Dto2D(new Point3d(this.xMax, this.yMin, this.zMin));
+ to = this._convert3Dto2D(new Point3d(this.xMax, this.yMax, this.zMin));
+ ctx.strokeStyle = this.axisColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+
+ // draw x-label
+ var xLabel = this.xLabel;
+ if (xLabel.length > 0) {
+ yOffset = 0.1 / this.scale.y;
+ xText = (this.xMin + this.xMax) / 2;
+ yText = Math.cos(armAngle) > 0 ? this.yMin - yOffset : this.yMax + yOffset;
+ text = this._convert3Dto2D(new Point3d(xText, yText, this.zMin));
+ if (Math.cos(armAngle * 2) > 0) {
+ ctx.textAlign = 'center';
+ ctx.textBaseline = 'top';
+ } else if (Math.sin(armAngle * 2) < 0) {
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ } else {
+ ctx.textAlign = 'left';
+ ctx.textBaseline = 'middle';
+ }
+ ctx.fillStyle = this.axisColor;
+ ctx.fillText(xLabel, text.x, text.y);
+ }
+
+ // draw y-label
+ var yLabel = this.yLabel;
+ if (yLabel.length > 0) {
+ xOffset = 0.1 / this.scale.x;
+ xText = Math.sin(armAngle) > 0 ? this.xMin - xOffset : this.xMax + xOffset;
+ yText = (this.yMin + this.yMax) / 2;
+ text = this._convert3Dto2D(new Point3d(xText, yText, this.zMin));
+ if (Math.cos(armAngle * 2) < 0) {
+ ctx.textAlign = 'center';
+ ctx.textBaseline = 'top';
+ } else if (Math.sin(armAngle * 2) > 0) {
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ } else {
+ ctx.textAlign = 'left';
+ ctx.textBaseline = 'middle';
+ }
+ ctx.fillStyle = this.axisColor;
+ ctx.fillText(yLabel, text.x, text.y);
+ }
+
+ // draw z-label
+ var zLabel = this.zLabel;
+ if (zLabel.length > 0) {
+ offset = 30; // pixels. // TODO: relate to the max width of the values on the z axis?
+ xText = Math.cos(armAngle) > 0 ? this.xMin : this.xMax;
+ yText = Math.sin(armAngle) < 0 ? this.yMin : this.yMax;
+ zText = (this.zMin + this.zMax) / 2;
+ text = this._convert3Dto2D(new Point3d(xText, yText, zText));
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ ctx.fillStyle = this.axisColor;
+ ctx.fillText(zLabel, text.x - offset, text.y);
+ }
+ };
+
+ /**
+ * Calculate the color based on the given value.
+ * @param {Number} H Hue, a value be between 0 and 360
+ * @param {Number} S Saturation, a value between 0 and 1
+ * @param {Number} V Value, a value between 0 and 1
+ */
+ Graph3d.prototype._hsv2rgb = function (H, S, V) {
+ var R, G, B, C, Hi, X;
+
+ C = V * S;
+ Hi = Math.floor(H / 60); // hi = 0,1,2,3,4,5
+ X = C * (1 - Math.abs(H / 60 % 2 - 1));
+
+ switch (Hi) {
+ case 0:
+ R = C;G = X;B = 0;break;
+ case 1:
+ R = X;G = C;B = 0;break;
+ case 2:
+ R = 0;G = C;B = X;break;
+ case 3:
+ R = 0;G = X;B = C;break;
+ case 4:
+ R = X;G = 0;B = C;break;
+ case 5:
+ R = C;G = 0;B = X;break;
+
+ default:
+ R = 0;G = 0;B = 0;break;
+ }
+
+ return 'RGB(' + parseInt(R * 255) + ',' + parseInt(G * 255) + ',' + parseInt(B * 255) + ')';
+ };
+
+ /**
+ * Draw all datapoints as a grid
+ * This function can be used when the style is 'grid'
+ */
+ Graph3d.prototype._redrawDataGrid = function () {
+ var canvas = this.frame.canvas,
+ ctx = canvas.getContext('2d'),
+ point,
+ right,
+ top,
+ cross,
+ i,
+ topSideVisible,
+ fillStyle,
+ strokeStyle,
+ lineWidth,
+ h,
+ s,
+ v,
+ zAvg;
+
+ ctx.lineJoin = 'round';
+ ctx.lineCap = 'round';
+
+ if (this.dataPoints === undefined || this.dataPoints.length <= 0) return; // TODO: throw exception?
+
+ // calculate the translations and screen position of all points
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var trans = this._convertPointToTranslation(this.dataPoints[i].point);
+ var screen = this._convertTranslationToScreen(trans);
+
+ this.dataPoints[i].trans = trans;
+ this.dataPoints[i].screen = screen;
+
+ // calculate the translation of the point at the bottom (needed for sorting)
+ var transBottom = this._convertPointToTranslation(this.dataPoints[i].bottom);
+ this.dataPoints[i].dist = this.showPerspective ? transBottom.length() : -transBottom.z;
+ }
+
+ // sort the points on depth of their (x,y) position (not on z)
+ var sortDepth = function sortDepth(a, b) {
+ return b.dist - a.dist;
+ };
+ this.dataPoints.sort(sortDepth);
+
+ if (this.style === Graph3d.STYLE.SURFACE) {
+ for (i = 0; i < this.dataPoints.length; i++) {
+ point = this.dataPoints[i];
+ right = this.dataPoints[i].pointRight;
+ top = this.dataPoints[i].pointTop;
+ cross = this.dataPoints[i].pointCross;
+
+ if (point !== undefined && right !== undefined && top !== undefined && cross !== undefined) {
+
+ if (this.showGrayBottom || this.showShadow) {
+ // calculate the cross product of the two vectors from center
+ // to left and right, in order to know whether we are looking at the
+ // bottom or at the top side. We can also use the cross product
+ // for calculating light intensity
+ var aDiff = Point3d.subtract(cross.trans, point.trans);
+ var bDiff = Point3d.subtract(top.trans, right.trans);
+ var crossproduct = Point3d.crossProduct(aDiff, bDiff);
+ var len = crossproduct.length();
+ // FIXME: there is a bug with determining the surface side (shadow or colored)
+
+ topSideVisible = crossproduct.z > 0;
+ } else {
+ topSideVisible = true;
+ }
+
+ if (topSideVisible) {
+ // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
+ zAvg = (point.point.z + right.point.z + top.point.z + cross.point.z) / 4;
+ h = (1 - (zAvg - this.zMin) * this.scale.z / this.verticalRatio) * 240;
+ s = 1; // saturation
+
+ if (this.showShadow) {
+ v = Math.min(1 + crossproduct.x / len / 2, 1); // value. TODO: scale
+ fillStyle = this._hsv2rgb(h, s, v);
+ strokeStyle = fillStyle;
+ } else {
+ v = 1;
+ fillStyle = this._hsv2rgb(h, s, v);
+ strokeStyle = this.axisColor; // TODO: should be customizable
+ }
+ } else {
+ fillStyle = 'gray';
+ strokeStyle = this.axisColor;
+ }
+
+ ctx.lineWidth = this._getStrokeWidth(point);
+ ctx.fillStyle = fillStyle;
+ ctx.strokeStyle = strokeStyle;
+ ctx.beginPath();
+ ctx.moveTo(point.screen.x, point.screen.y);
+ ctx.lineTo(right.screen.x, right.screen.y);
+ ctx.lineTo(cross.screen.x, cross.screen.y);
+ ctx.lineTo(top.screen.x, top.screen.y);
+ ctx.closePath();
+ ctx.fill();
+ ctx.stroke(); // TODO: only draw stroke when strokeWidth > 0
+ }
+ }
+ } else {
+ // grid style
+ for (i = 0; i < this.dataPoints.length; i++) {
+ point = this.dataPoints[i];
+ right = this.dataPoints[i].pointRight;
+ top = this.dataPoints[i].pointTop;
+
+ if (point !== undefined && right !== undefined) {
+ // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
+ zAvg = (point.point.z + right.point.z) / 2;
+ h = (1 - (zAvg - this.zMin) * this.scale.z / this.verticalRatio) * 240;
+
+ ctx.lineWidth = this._getStrokeWidth(point) * 2;
+ ctx.strokeStyle = this._hsv2rgb(h, 1, 1);
+ ctx.beginPath();
+ ctx.moveTo(point.screen.x, point.screen.y);
+ ctx.lineTo(right.screen.x, right.screen.y);
+ ctx.stroke();
+ }
+
+ if (point !== undefined && top !== undefined) {
+ // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
+ zAvg = (point.point.z + top.point.z) / 2;
+ h = (1 - (zAvg - this.zMin) * this.scale.z / this.verticalRatio) * 240;
+
+ ctx.lineWidth = this._getStrokeWidth(point) * 2;
+ ctx.strokeStyle = this._hsv2rgb(h, 1, 1);
+ ctx.beginPath();
+ ctx.moveTo(point.screen.x, point.screen.y);
+ ctx.lineTo(top.screen.x, top.screen.y);
+ ctx.stroke();
+ }
+ }
+ }
+ };
+
+ Graph3d.prototype._getStrokeWidth = function (point) {
+ if (point !== undefined) {
+ if (this.showPerspective) {
+ return 1 / -point.trans.z * this.dataColor.strokeWidth;
+ } else {
+ return -(this.eye.z / this.camera.getArmLength()) * this.dataColor.strokeWidth;
+ }
+ }
+
+ return this.dataColor.strokeWidth;
+ };
+
+ /**
+ * Draw all datapoints as dots.
+ * This function can be used when the style is 'dot' or 'dot-line'
+ */
+ Graph3d.prototype._redrawDataDot = function () {
+ var canvas = this.frame.canvas;
+ var ctx = canvas.getContext('2d');
+ var i;
+
+ if (this.dataPoints === undefined || this.dataPoints.length <= 0) return; // TODO: throw exception?
+
+ // calculate the translations of all points
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var trans = this._convertPointToTranslation(this.dataPoints[i].point);
+ var screen = this._convertTranslationToScreen(trans);
+ this.dataPoints[i].trans = trans;
+ this.dataPoints[i].screen = screen;
+
+ // calculate the distance from the point at the bottom to the camera
+ var transBottom = this._convertPointToTranslation(this.dataPoints[i].bottom);
+ this.dataPoints[i].dist = this.showPerspective ? transBottom.length() : -transBottom.z;
+ }
+
+ // order the translated points by depth
+ var sortDepth = function sortDepth(a, b) {
+ return b.dist - a.dist;
+ };
+ this.dataPoints.sort(sortDepth);
+
+ // draw the datapoints as colored circles
+ var dotSize = this.frame.clientWidth * 0.02; // px
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var point = this.dataPoints[i];
+
+ if (this.style === Graph3d.STYLE.DOTLINE) {
+ // draw a vertical line from the bottom to the graph value
+ //var from = this._convert3Dto2D(new Point3d(point.point.x, point.point.y, this.zMin));
+ var from = this._convert3Dto2D(point.bottom);
+ ctx.lineWidth = 1;
+ ctx.strokeStyle = this.gridColor;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(point.screen.x, point.screen.y);
+ ctx.stroke();
+ }
+
+ // calculate radius for the circle
+ var size;
+ if (this.style === Graph3d.STYLE.DOTSIZE) {
+ size = dotSize / 2 + 2 * dotSize * (point.point.value - this.valueMin) / (this.valueMax - this.valueMin);
+ } else {
+ size = dotSize;
+ }
+
+ var radius;
+ if (this.showPerspective) {
+ radius = size / -point.trans.z;
+ } else {
+ radius = size * -(this.eye.z / this.camera.getArmLength());
+ }
+ if (radius < 0) {
+ radius = 0;
+ }
+
+ var hue, color, borderColor;
+ if (this.style === Graph3d.STYLE.DOTCOLOR) {
+ // calculate the color based on the value
+ hue = (1 - (point.point.value - this.valueMin) * this.scale.value) * 240;
+ color = this._hsv2rgb(hue, 1, 1);
+ borderColor = this._hsv2rgb(hue, 1, 0.8);
+ } else if (this.style === Graph3d.STYLE.DOTSIZE) {
+ color = this.dataColor.fill;
+ borderColor = this.dataColor.stroke;
+ } else {
+ // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
+ hue = (1 - (point.point.z - this.zMin) * this.scale.z / this.verticalRatio) * 240;
+ color = this._hsv2rgb(hue, 1, 1);
+ borderColor = this._hsv2rgb(hue, 1, 0.8);
+ }
+
+ // draw the circle
+ ctx.lineWidth = this._getStrokeWidth(point);
+ ctx.strokeStyle = borderColor;
+ ctx.fillStyle = color;
+ ctx.beginPath();
+ ctx.arc(point.screen.x, point.screen.y, radius, 0, Math.PI * 2, true);
+ ctx.fill();
+ ctx.stroke();
+ }
+ };
+
+ /**
+ * Draw all datapoints as bars.
+ * This function can be used when the style is 'bar', 'bar-color', or 'bar-size'
+ */
+ Graph3d.prototype._redrawDataBar = function () {
+ var canvas = this.frame.canvas;
+ var ctx = canvas.getContext('2d');
+ var i, j, surface, corners;
+
+ if (this.dataPoints === undefined || this.dataPoints.length <= 0) return; // TODO: throw exception?
+
+ // calculate the translations of all points
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var trans = this._convertPointToTranslation(this.dataPoints[i].point);
+ var screen = this._convertTranslationToScreen(trans);
+ this.dataPoints[i].trans = trans;
+ this.dataPoints[i].screen = screen;
+
+ // calculate the distance from the point at the bottom to the camera
+ var transBottom = this._convertPointToTranslation(this.dataPoints[i].bottom);
+ this.dataPoints[i].dist = this.showPerspective ? transBottom.length() : -transBottom.z;
+ }
+
+ // order the translated points by depth
+ var sortDepth = function sortDepth(a, b) {
+ return b.dist - a.dist;
+ };
+ this.dataPoints.sort(sortDepth);
+
+ ctx.lineJoin = 'round';
+ ctx.lineCap = 'round';
+
+ // draw the datapoints as bars
+ var xWidth = this.xBarWidth / 2;
+ var yWidth = this.yBarWidth / 2;
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var point = this.dataPoints[i];
+
+ // determine color
+ var hue, color, borderColor;
+ if (this.style === Graph3d.STYLE.BARCOLOR) {
+ // calculate the color based on the value
+ hue = (1 - (point.point.value - this.valueMin) * this.scale.value) * 240;
+ color = this._hsv2rgb(hue, 1, 1);
+ borderColor = this._hsv2rgb(hue, 1, 0.8);
+ } else if (this.style === Graph3d.STYLE.BARSIZE) {
+ color = this.dataColor.fill;
+ borderColor = this.dataColor.stroke;
+ } else {
+ // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
+ hue = (1 - (point.point.z - this.zMin) * this.scale.z / this.verticalRatio) * 240;
+ color = this._hsv2rgb(hue, 1, 1);
+ borderColor = this._hsv2rgb(hue, 1, 0.8);
+ }
+
+ // calculate size for the bar
+ if (this.style === Graph3d.STYLE.BARSIZE) {
+ xWidth = this.xBarWidth / 2 * ((point.point.value - this.valueMin) / (this.valueMax - this.valueMin) * 0.8 + 0.2);
+ yWidth = this.yBarWidth / 2 * ((point.point.value - this.valueMin) / (this.valueMax - this.valueMin) * 0.8 + 0.2);
+ }
+
+ // calculate all corner points
+ var me = this;
+ var point3d = point.point;
+ var top = [{ point: new Point3d(point3d.x - xWidth, point3d.y - yWidth, point3d.z) }, { point: new Point3d(point3d.x + xWidth, point3d.y - yWidth, point3d.z) }, { point: new Point3d(point3d.x + xWidth, point3d.y + yWidth, point3d.z) }, { point: new Point3d(point3d.x - xWidth, point3d.y + yWidth, point3d.z) }];
+ var bottom = [{ point: new Point3d(point3d.x - xWidth, point3d.y - yWidth, this.zMin) }, { point: new Point3d(point3d.x + xWidth, point3d.y - yWidth, this.zMin) }, { point: new Point3d(point3d.x + xWidth, point3d.y + yWidth, this.zMin) }, { point: new Point3d(point3d.x - xWidth, point3d.y + yWidth, this.zMin) }];
+
+ // calculate screen location of the points
+ top.forEach(function (obj) {
+ obj.screen = me._convert3Dto2D(obj.point);
+ });
+ bottom.forEach(function (obj) {
+ obj.screen = me._convert3Dto2D(obj.point);
+ });
+
+ // create five sides, calculate both corner points and center points
+ var surfaces = [{ corners: top, center: Point3d.avg(bottom[0].point, bottom[2].point) }, { corners: [top[0], top[1], bottom[1], bottom[0]], center: Point3d.avg(bottom[1].point, bottom[0].point) }, { corners: [top[1], top[2], bottom[2], bottom[1]], center: Point3d.avg(bottom[2].point, bottom[1].point) }, { corners: [top[2], top[3], bottom[3], bottom[2]], center: Point3d.avg(bottom[3].point, bottom[2].point) }, { corners: [top[3], top[0], bottom[0], bottom[3]], center: Point3d.avg(bottom[0].point, bottom[3].point) }];
+ point.surfaces = surfaces;
+
+ // calculate the distance of each of the surface centers to the camera
+ for (j = 0; j < surfaces.length; j++) {
+ surface = surfaces[j];
+ var transCenter = this._convertPointToTranslation(surface.center);
+ surface.dist = this.showPerspective ? transCenter.length() : -transCenter.z;
+ // TODO: this dept calculation doesn't work 100% of the cases due to perspective,
+ // but the current solution is fast/simple and works in 99.9% of all cases
+ // the issue is visible in example 14, with graph.setCameraPosition({horizontal: 2.97, vertical: 0.5, distance: 0.9})
+ }
+
+ // order the surfaces by their (translated) depth
+ surfaces.sort(function (a, b) {
+ var diff = b.dist - a.dist;
+ if (diff) return diff;
+
+ // if equal depth, sort the top surface last
+ if (a.corners === top) return 1;
+ if (b.corners === top) return -1;
+
+ // both are equal
+ return 0;
+ });
+
+ // draw the ordered surfaces
+ ctx.lineWidth = this._getStrokeWidth(point);
+ ctx.strokeStyle = borderColor;
+ ctx.fillStyle = color;
+ // NOTE: we start at j=2 instead of j=0 as we don't need to draw the two surfaces at the backside
+ for (j = 2; j < surfaces.length; j++) {
+ surface = surfaces[j];
+ corners = surface.corners;
+ ctx.beginPath();
+ ctx.moveTo(corners[3].screen.x, corners[3].screen.y);
+ ctx.lineTo(corners[0].screen.x, corners[0].screen.y);
+ ctx.lineTo(corners[1].screen.x, corners[1].screen.y);
+ ctx.lineTo(corners[2].screen.x, corners[2].screen.y);
+ ctx.lineTo(corners[3].screen.x, corners[3].screen.y);
+ ctx.fill();
+ ctx.stroke();
+ }
+ }
+ };
+
+ /**
+ * Draw a line through all datapoints.
+ * This function can be used when the style is 'line'
+ */
+ Graph3d.prototype._redrawDataLine = function () {
+ var canvas = this.frame.canvas,
+ ctx = canvas.getContext('2d'),
+ point,
+ i;
+
+ if (this.dataPoints === undefined || this.dataPoints.length <= 0) return; // TODO: throw exception?
+
+ // calculate the translations of all points
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var trans = this._convertPointToTranslation(this.dataPoints[i].point);
+ var screen = this._convertTranslationToScreen(trans);
+
+ this.dataPoints[i].trans = trans;
+ this.dataPoints[i].screen = screen;
+ }
+
+ // start the line
+ if (this.dataPoints.length > 0) {
+ point = this.dataPoints[0];
+
+ ctx.lineWidth = this._getStrokeWidth(point);
+ ctx.lineJoin = 'round';
+ ctx.lineCap = 'round';
+ ctx.strokeStyle = this.dataColor.stroke;
+ ctx.beginPath();
+ ctx.moveTo(point.screen.x, point.screen.y);
+
+ // draw the datapoints as colored circles
+ for (i = 1; i < this.dataPoints.length; i++) {
+ point = this.dataPoints[i];
+ ctx.lineTo(point.screen.x, point.screen.y);
+ }
+
+ // finish the line
+ ctx.stroke();
+ }
+ };
+
+ /**
+ * Start a moving operation inside the provided parent element
+ * @param {Event} event The event that occurred (required for
+ * retrieving the mouse position)
+ */
+ Graph3d.prototype._onMouseDown = function (event) {
+ event = event || window.event;
+
+ // check if mouse is still down (may be up when focus is lost for example
+ // in an iframe)
+ if (this.leftButtonDown) {
+ this._onMouseUp(event);
+ }
+
+ // only react on left mouse button down
+ this.leftButtonDown = event.which ? event.which === 1 : event.button === 1;
+ if (!this.leftButtonDown && !this.touchDown) return;
+
+ // get mouse position (different code for IE and all other browsers)
+ this.startMouseX = getMouseX(event);
+ this.startMouseY = getMouseY(event);
+
+ this.startStart = new Date(this.start);
+ this.startEnd = new Date(this.end);
+ this.startArmRotation = this.camera.getArmRotation();
+
+ this.frame.style.cursor = 'move';
+
+ // add event listeners to handle moving the contents
+ // we store the function onmousemove and onmouseup in the graph, so we can
+ // remove the eventlisteners lateron in the function mouseUp()
+ var me = this;
+ this.onmousemove = function (event) {
+ me._onMouseMove(event);
+ };
+ this.onmouseup = function (event) {
+ me._onMouseUp(event);
+ };
+ util.addEventListener(document, 'mousemove', me.onmousemove);
+ util.addEventListener(document, 'mouseup', me.onmouseup);
+ util.preventDefault(event);
+ };
+
+ /**
+ * Perform moving operating.
+ * This function activated from within the funcion Graph.mouseDown().
+ * @param {Event} event Well, eehh, the event
+ */
+ Graph3d.prototype._onMouseMove = function (event) {
+ event = event || window.event;
+
+ // calculate change in mouse position
+ var diffX = parseFloat(getMouseX(event)) - this.startMouseX;
+ var diffY = parseFloat(getMouseY(event)) - this.startMouseY;
+
+ var horizontalNew = this.startArmRotation.horizontal + diffX / 200;
+ var verticalNew = this.startArmRotation.vertical + diffY / 200;
+
+ var snapAngle = 4; // degrees
+ var snapValue = Math.sin(snapAngle / 360 * 2 * Math.PI);
+
+ // snap horizontally to nice angles at 0pi, 0.5pi, 1pi, 1.5pi, etc...
+ // the -0.001 is to take care that the vertical axis is always drawn at the left front corner
+ if (Math.abs(Math.sin(horizontalNew)) < snapValue) {
+ horizontalNew = Math.round(horizontalNew / Math.PI) * Math.PI - 0.001;
+ }
+ if (Math.abs(Math.cos(horizontalNew)) < snapValue) {
+ horizontalNew = (Math.round(horizontalNew / Math.PI - 0.5) + 0.5) * Math.PI - 0.001;
+ }
+
+ // snap vertically to nice angles
+ if (Math.abs(Math.sin(verticalNew)) < snapValue) {
+ verticalNew = Math.round(verticalNew / Math.PI) * Math.PI;
+ }
+ if (Math.abs(Math.cos(verticalNew)) < snapValue) {
+ verticalNew = (Math.round(verticalNew / Math.PI - 0.5) + 0.5) * Math.PI;
+ }
+
+ this.camera.setArmRotation(horizontalNew, verticalNew);
+ this.redraw();
+
+ // fire a cameraPositionChange event
+ var parameters = this.getCameraPosition();
+ this.emit('cameraPositionChange', parameters);
+
+ util.preventDefault(event);
+ };
+
+ /**
+ * Stop moving operating.
+ * This function activated from within the funcion Graph.mouseDown().
+ * @param {event} event The event
+ */
+ Graph3d.prototype._onMouseUp = function (event) {
+ this.frame.style.cursor = 'auto';
+ this.leftButtonDown = false;
+
+ // remove event listeners here
+ util.removeEventListener(document, 'mousemove', this.onmousemove);
+ util.removeEventListener(document, 'mouseup', this.onmouseup);
+ util.preventDefault(event);
+ };
+
+ /**
+ * After having moved the mouse, a tooltip should pop up when the mouse is resting on a data point
+ * @param {Event} event A mouse move event
+ */
+ Graph3d.prototype._onTooltip = function (event) {
+ var delay = 300; // ms
+ var boundingRect = this.frame.getBoundingClientRect();
+ var mouseX = getMouseX(event) - boundingRect.left;
+ var mouseY = getMouseY(event) - boundingRect.top;
+
+ if (!this.showTooltip) {
+ return;
+ }
+
+ if (this.tooltipTimeout) {
+ clearTimeout(this.tooltipTimeout);
+ }
+
+ // (delayed) display of a tooltip only if no mouse button is down
+ if (this.leftButtonDown) {
+ this._hideTooltip();
+ return;
+ }
+
+ if (this.tooltip && this.tooltip.dataPoint) {
+ // tooltip is currently visible
+ var dataPoint = this._dataPointFromXY(mouseX, mouseY);
+ if (dataPoint !== this.tooltip.dataPoint) {
+ // datapoint changed
+ if (dataPoint) {
+ this._showTooltip(dataPoint);
+ } else {
+ this._hideTooltip();
+ }
+ }
+ } else {
+ // tooltip is currently not visible
+ var me = this;
+ this.tooltipTimeout = setTimeout(function () {
+ me.tooltipTimeout = null;
+
+ // show a tooltip if we have a data point
+ var dataPoint = me._dataPointFromXY(mouseX, mouseY);
+ if (dataPoint) {
+ me._showTooltip(dataPoint);
+ }
+ }, delay);
+ }
+ };
+
+ /**
+ * Event handler for touchstart event on mobile devices
+ */
+ Graph3d.prototype._onTouchStart = function (event) {
+ this.touchDown = true;
+
+ var me = this;
+ this.ontouchmove = function (event) {
+ me._onTouchMove(event);
+ };
+ this.ontouchend = function (event) {
+ me._onTouchEnd(event);
+ };
+ util.addEventListener(document, 'touchmove', me.ontouchmove);
+ util.addEventListener(document, 'touchend', me.ontouchend);
+
+ this._onMouseDown(event);
+ };
+
+ /**
+ * Event handler for touchmove event on mobile devices
+ */
+ Graph3d.prototype._onTouchMove = function (event) {
+ this._onMouseMove(event);
+ };
+
+ /**
+ * Event handler for touchend event on mobile devices
+ */
+ Graph3d.prototype._onTouchEnd = function (event) {
+ this.touchDown = false;
+
+ util.removeEventListener(document, 'touchmove', this.ontouchmove);
+ util.removeEventListener(document, 'touchend', this.ontouchend);
+
+ this._onMouseUp(event);
+ };
+
+ /**
+ * Event handler for mouse wheel event, used to zoom the graph
+ * Code from http://adomas.org/javascript-mouse-wheel/
+ * @param {event} event The event
+ */
+ Graph3d.prototype._onWheel = function (event) {
+ if (!event) /* For IE. */
+ event = window.event;
+
+ // retrieve delta
+ var delta = 0;
+ if (event.wheelDelta) {
+ /* IE/Opera. */
+ delta = event.wheelDelta / 120;
+ } else if (event.detail) {
+ /* Mozilla case. */
+ // In Mozilla, sign of delta is different than in IE.
+ // Also, delta is multiple of 3.
+ delta = -event.detail / 3;
+ }
+
+ // If delta is nonzero, handle it.
+ // Basically, delta is now positive if wheel was scrolled up,
+ // and negative, if wheel was scrolled down.
+ if (delta) {
+ var oldLength = this.camera.getArmLength();
+ var newLength = oldLength * (1 - delta / 10);
+
+ this.camera.setArmLength(newLength);
+ this.redraw();
+
+ this._hideTooltip();
+ }
+
+ // fire a cameraPositionChange event
+ var parameters = this.getCameraPosition();
+ this.emit('cameraPositionChange', parameters);
+
+ // Prevent default actions caused by mouse wheel.
+ // That might be ugly, but we handle scrolls somehow
+ // anyway, so don't bother here..
+ util.preventDefault(event);
+ };
+
+ /**
+ * Test whether a point lies inside given 2D triangle
+ * @param {Point2d} point
+ * @param {Point2d[]} triangle
+ * @return {boolean} Returns true if given point lies inside or on the edge of the triangle
+ * @private
+ */
+ Graph3d.prototype._insideTriangle = function (point, triangle) {
+ var a = triangle[0],
+ b = triangle[1],
+ c = triangle[2];
+
+ function sign(x) {
+ return x > 0 ? 1 : x < 0 ? -1 : 0;
+ }
+
+ var as = sign((b.x - a.x) * (point.y - a.y) - (b.y - a.y) * (point.x - a.x));
+ var bs = sign((c.x - b.x) * (point.y - b.y) - (c.y - b.y) * (point.x - b.x));
+ var cs = sign((a.x - c.x) * (point.y - c.y) - (a.y - c.y) * (point.x - c.x));
+
+ // each of the three signs must be either equal to each other or zero
+ return (as == 0 || bs == 0 || as == bs) && (bs == 0 || cs == 0 || bs == cs) && (as == 0 || cs == 0 || as == cs);
+ };
+
+ /**
+ * Find a data point close to given screen position (x, y)
+ * @param {Number} x
+ * @param {Number} y
+ * @return {Object | null} The closest data point or null if not close to any data point
+ * @private
+ */
+ Graph3d.prototype._dataPointFromXY = function (x, y) {
+ var i,
+ distMax = 100,
+ // px
+ dataPoint = null,
+ closestDataPoint = null,
+ closestDist = null,
+ center = new Point2d(x, y);
+
+ if (this.style === Graph3d.STYLE.BAR || this.style === Graph3d.STYLE.BARCOLOR || this.style === Graph3d.STYLE.BARSIZE) {
+ // the data points are ordered from far away to closest
+ for (i = this.dataPoints.length - 1; i >= 0; i--) {
+ dataPoint = this.dataPoints[i];
+ var surfaces = dataPoint.surfaces;
+ if (surfaces) {
+ for (var s = surfaces.length - 1; s >= 0; s--) {
+ // split each surface in two triangles, and see if the center point is inside one of these
+ var surface = surfaces[s];
+ var corners = surface.corners;
+ var triangle1 = [corners[0].screen, corners[1].screen, corners[2].screen];
+ var triangle2 = [corners[2].screen, corners[3].screen, corners[0].screen];
+ if (this._insideTriangle(center, triangle1) || this._insideTriangle(center, triangle2)) {
+ // return immediately at the first hit
+ return dataPoint;
+ }
+ }
+ }
+ }
+ } else {
+ // find the closest data point, using distance to the center of the point on 2d screen
+ for (i = 0; i < this.dataPoints.length; i++) {
+ dataPoint = this.dataPoints[i];
+ var point = dataPoint.screen;
+ if (point) {
+ var distX = Math.abs(x - point.x);
+ var distY = Math.abs(y - point.y);
+ var dist = Math.sqrt(distX * distX + distY * distY);
+
+ if ((closestDist === null || dist < closestDist) && dist < distMax) {
+ closestDist = dist;
+ closestDataPoint = dataPoint;
+ }
+ }
+ }
+ }
+
+ return closestDataPoint;
+ };
+
+ /**
+ * Display a tooltip for given data point
+ * @param {Object} dataPoint
+ * @private
+ */
+ Graph3d.prototype._showTooltip = function (dataPoint) {
+ var content, line, dot;
+
+ if (!this.tooltip) {
+ content = document.createElement('div');
+ content.style.position = 'absolute';
+ content.style.padding = '10px';
+ content.style.border = '1px solid #4d4d4d';
+ content.style.color = '#1a1a1a';
+ content.style.background = 'rgba(255,255,255,0.7)';
+ content.style.borderRadius = '2px';
+ content.style.boxShadow = '5px 5px 10px rgba(128,128,128,0.5)';
+
+ line = document.createElement('div');
+ line.style.position = 'absolute';
+ line.style.height = '40px';
+ line.style.width = '0';
+ line.style.borderLeft = '1px solid #4d4d4d';
+
+ dot = document.createElement('div');
+ dot.style.position = 'absolute';
+ dot.style.height = '0';
+ dot.style.width = '0';
+ dot.style.border = '5px solid #4d4d4d';
+ dot.style.borderRadius = '5px';
+
+ this.tooltip = {
+ dataPoint: null,
+ dom: {
+ content: content,
+ line: line,
+ dot: dot
+ }
+ };
+ } else {
+ content = this.tooltip.dom.content;
+ line = this.tooltip.dom.line;
+ dot = this.tooltip.dom.dot;
+ }
+
+ this._hideTooltip();
+
+ this.tooltip.dataPoint = dataPoint;
+ if (typeof this.showTooltip === 'function') {
+ content.innerHTML = this.showTooltip(dataPoint.point);
+ } else {
+ content.innerHTML = '' + 'x: ' + dataPoint.point.x + ' ' + 'y: ' + dataPoint.point.y + ' ' + 'z: ' + dataPoint.point.z + ' ' + '
';
+ }
+
+ content.style.left = '0';
+ content.style.top = '0';
+ this.frame.appendChild(content);
+ this.frame.appendChild(line);
+ this.frame.appendChild(dot);
+
+ // calculate sizes
+ var contentWidth = content.offsetWidth;
+ var contentHeight = content.offsetHeight;
+ var lineHeight = line.offsetHeight;
+ var dotWidth = dot.offsetWidth;
+ var dotHeight = dot.offsetHeight;
+
+ var left = dataPoint.screen.x - contentWidth / 2;
+ left = Math.min(Math.max(left, 10), this.frame.clientWidth - 10 - contentWidth);
+
+ line.style.left = dataPoint.screen.x + 'px';
+ line.style.top = dataPoint.screen.y - lineHeight + 'px';
+ content.style.left = left + 'px';
+ content.style.top = dataPoint.screen.y - lineHeight - contentHeight + 'px';
+ dot.style.left = dataPoint.screen.x - dotWidth / 2 + 'px';
+ dot.style.top = dataPoint.screen.y - dotHeight / 2 + 'px';
+ };
+
+ /**
+ * Hide the tooltip when displayed
+ * @private
+ */
+ Graph3d.prototype._hideTooltip = function () {
+ if (this.tooltip) {
+ this.tooltip.dataPoint = null;
+
+ for (var prop in this.tooltip.dom) {
+ if (this.tooltip.dom.hasOwnProperty(prop)) {
+ var elem = this.tooltip.dom[prop];
+ if (elem && elem.parentNode) {
+ elem.parentNode.removeChild(elem);
+ }
+ }
+ }
+ }
+ };
+
+ /**--------------------------------------------------------------------------**/
+
+ /**
+ * Get the horizontal mouse position from a mouse event
+ * @param {Event} event
+ * @return {Number} mouse x
+ */
+ function getMouseX(event) {
+ if ('clientX' in event) return event.clientX;
+ return event.targetTouches[0] && event.targetTouches[0].clientX || 0;
+ }
+
+ /**
+ * Get the vertical mouse position from a mouse event
+ * @param {Event} event
+ * @return {Number} mouse y
+ */
+ function getMouseY(event) {
+ if ('clientY' in event) return event.clientY;
+ return event.targetTouches[0] && event.targetTouches[0].clientY || 0;
+ }
+
+ module.exports = Graph3d;
+
+ // use use defaults
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+
+ /**
+ * Expose `Emitter`.
+ */
+
+ module.exports = Emitter;
+
+ /**
+ * Initialize a new `Emitter`.
+ *
+ * @api public
+ */
+
+ function Emitter(obj) {
+ if (obj) return mixin(obj);
+ };
+
+ /**
+ * Mixin the emitter properties.
+ *
+ * @param {Object} obj
+ * @return {Object}
+ * @api private
+ */
+
+ function mixin(obj) {
+ for (var key in Emitter.prototype) {
+ obj[key] = Emitter.prototype[key];
+ }
+ return obj;
+ }
+
+ /**
+ * Listen on the given `event` with `fn`.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+ Emitter.prototype.on =
+ Emitter.prototype.addEventListener = function(event, fn){
+ this._callbacks = this._callbacks || {};
+ (this._callbacks[event] = this._callbacks[event] || [])
+ .push(fn);
+ return this;
+ };
+
+ /**
+ * Adds an `event` listener that will be invoked a single
+ * time then automatically removed.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+ Emitter.prototype.once = function(event, fn){
+ var self = this;
+ this._callbacks = this._callbacks || {};
+
+ function on() {
+ self.off(event, on);
+ fn.apply(this, arguments);
+ }
+
+ on.fn = fn;
+ this.on(event, on);
+ return this;
+ };
+
+ /**
+ * Remove the given callback for `event` or all
+ * registered callbacks.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+ Emitter.prototype.off =
+ Emitter.prototype.removeListener =
+ Emitter.prototype.removeAllListeners =
+ Emitter.prototype.removeEventListener = function(event, fn){
+ this._callbacks = this._callbacks || {};
+
+ // all
+ if (0 == arguments.length) {
+ this._callbacks = {};
+ return this;
+ }
+
+ // specific event
+ var callbacks = this._callbacks[event];
+ if (!callbacks) return this;
+
+ // remove all handlers
+ if (1 == arguments.length) {
+ delete this._callbacks[event];
+ return this;
+ }
+
+ // remove specific handler
+ var cb;
+ for (var i = 0; i < callbacks.length; i++) {
+ cb = callbacks[i];
+ if (cb === fn || cb.fn === fn) {
+ callbacks.splice(i, 1);
+ break;
+ }
+ }
+ return this;
+ };
+
+ /**
+ * Emit `event` with the given args.
+ *
+ * @param {String} event
+ * @param {Mixed} ...
+ * @return {Emitter}
+ */
+
+ Emitter.prototype.emit = function(event){
+ this._callbacks = this._callbacks || {};
+ var args = [].slice.call(arguments, 1)
+ , callbacks = this._callbacks[event];
+
+ if (callbacks) {
+ callbacks = callbacks.slice(0);
+ for (var i = 0, len = callbacks.length; i < len; ++i) {
+ callbacks[i].apply(this, args);
+ }
+ }
+
+ return this;
+ };
+
+ /**
+ * Return array of callbacks for `event`.
+ *
+ * @param {String} event
+ * @return {Array}
+ * @api public
+ */
+
+ Emitter.prototype.listeners = function(event){
+ this._callbacks = this._callbacks || {};
+ return this._callbacks[event] || [];
+ };
+
+ /**
+ * Check if this emitter has `event` handlers.
+ *
+ * @param {String} event
+ * @return {Boolean}
+ * @api public
+ */
+
+ Emitter.prototype.hasListeners = function(event){
+ return !! this.listeners(event).length;
+ };
+
+
+/***/ },
+/* 13 */
+/***/ function(module, exports) {
+
+ /**
+ * @prototype Point3d
+ * @param {Number} [x]
+ * @param {Number} [y]
+ * @param {Number} [z]
+ */
+ "use strict";
+
+ function Point3d(x, y, z) {
+ this.x = x !== undefined ? x : 0;
+ this.y = y !== undefined ? y : 0;
+ this.z = z !== undefined ? z : 0;
+ };
+
+ /**
+ * Subtract the two provided points, returns a-b
+ * @param {Point3d} a
+ * @param {Point3d} b
+ * @return {Point3d} a-b
+ */
+ Point3d.subtract = function (a, b) {
+ var sub = new Point3d();
+ sub.x = a.x - b.x;
+ sub.y = a.y - b.y;
+ sub.z = a.z - b.z;
+ return sub;
+ };
+
+ /**
+ * Add the two provided points, returns a+b
+ * @param {Point3d} a
+ * @param {Point3d} b
+ * @return {Point3d} a+b
+ */
+ Point3d.add = function (a, b) {
+ var sum = new Point3d();
+ sum.x = a.x + b.x;
+ sum.y = a.y + b.y;
+ sum.z = a.z + b.z;
+ return sum;
+ };
+
+ /**
+ * Calculate the average of two 3d points
+ * @param {Point3d} a
+ * @param {Point3d} b
+ * @return {Point3d} The average, (a+b)/2
+ */
+ Point3d.avg = function (a, b) {
+ return new Point3d((a.x + b.x) / 2, (a.y + b.y) / 2, (a.z + b.z) / 2);
+ };
+
+ /**
+ * Calculate the cross product of the two provided points, returns axb
+ * Documentation: http://en.wikipedia.org/wiki/Cross_product
+ * @param {Point3d} a
+ * @param {Point3d} b
+ * @return {Point3d} cross product axb
+ */
+ Point3d.crossProduct = function (a, b) {
+ var crossproduct = new Point3d();
+
+ crossproduct.x = a.y * b.z - a.z * b.y;
+ crossproduct.y = a.z * b.x - a.x * b.z;
+ crossproduct.z = a.x * b.y - a.y * b.x;
+
+ return crossproduct;
+ };
+
+ /**
+ * Rtrieve the length of the vector (or the distance from this point to the origin
+ * @return {Number} length
+ */
+ Point3d.prototype.length = function () {
+ return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
+ };
+
+ module.exports = Point3d;
+
+/***/ },
+/* 14 */
+/***/ function(module, exports) {
+
+ /**
+ * @prototype Point2d
+ * @param {Number} [x]
+ * @param {Number} [y]
+ */
+ "use strict";
+
+ function Point2d(x, y) {
+ this.x = x !== undefined ? x : 0;
+ this.y = y !== undefined ? y : 0;
+ }
+
+ module.exports = Point2d;
+
+/***/ },
+/* 15 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Point3d = __webpack_require__(13);
+
+ /**
+ * @class Camera
+ * The camera is mounted on a (virtual) camera arm. The camera arm can rotate
+ * The camera is always looking in the direction of the origin of the arm.
+ * This way, the camera always rotates around one fixed point, the location
+ * of the camera arm.
+ *
+ * Documentation:
+ * http://en.wikipedia.org/wiki/3D_projection
+ */
+ function Camera() {
+ this.armLocation = new Point3d();
+ this.armRotation = {};
+ this.armRotation.horizontal = 0;
+ this.armRotation.vertical = 0;
+ this.armLength = 1.7;
+
+ this.cameraLocation = new Point3d();
+ this.cameraRotation = new Point3d(0.5 * Math.PI, 0, 0);
+
+ this.calculateCameraOrientation();
+ }
+
+ /**
+ * Set the location (origin) of the arm
+ * @param {Number} x Normalized value of x
+ * @param {Number} y Normalized value of y
+ * @param {Number} z Normalized value of z
+ */
+ Camera.prototype.setArmLocation = function (x, y, z) {
+ this.armLocation.x = x;
+ this.armLocation.y = y;
+ this.armLocation.z = z;
+
+ this.calculateCameraOrientation();
+ };
+
+ /**
+ * Set the rotation of the camera arm
+ * @param {Number} horizontal The horizontal rotation, between 0 and 2*PI.
+ * Optional, can be left undefined.
+ * @param {Number} vertical The vertical rotation, between 0 and 0.5*PI
+ * if vertical=0.5*PI, the graph is shown from the
+ * top. Optional, can be left undefined.
+ */
+ Camera.prototype.setArmRotation = function (horizontal, vertical) {
+ if (horizontal !== undefined) {
+ this.armRotation.horizontal = horizontal;
+ }
+
+ if (vertical !== undefined) {
+ this.armRotation.vertical = vertical;
+ if (this.armRotation.vertical < 0) this.armRotation.vertical = 0;
+ if (this.armRotation.vertical > 0.5 * Math.PI) this.armRotation.vertical = 0.5 * Math.PI;
+ }
+
+ if (horizontal !== undefined || vertical !== undefined) {
+ this.calculateCameraOrientation();
+ }
+ };
+
+ /**
+ * Retrieve the current arm rotation
+ * @return {object} An object with parameters horizontal and vertical
+ */
+ Camera.prototype.getArmRotation = function () {
+ var rot = {};
+ rot.horizontal = this.armRotation.horizontal;
+ rot.vertical = this.armRotation.vertical;
+
+ return rot;
+ };
+
+ /**
+ * Set the (normalized) length of the camera arm.
+ * @param {Number} length A length between 0.71 and 5.0
+ */
+ Camera.prototype.setArmLength = function (length) {
+ if (length === undefined) return;
+
+ this.armLength = length;
+
+ // Radius must be larger than the corner of the graph,
+ // which has a distance of sqrt(0.5^2+0.5^2) = 0.71 from the center of the
+ // graph
+ if (this.armLength < 0.71) this.armLength = 0.71;
+ if (this.armLength > 5.0) this.armLength = 5.0;
+
+ this.calculateCameraOrientation();
+ };
+
+ /**
+ * Retrieve the arm length
+ * @return {Number} length
+ */
+ Camera.prototype.getArmLength = function () {
+ return this.armLength;
+ };
+
+ /**
+ * Retrieve the camera location
+ * @return {Point3d} cameraLocation
+ */
+ Camera.prototype.getCameraLocation = function () {
+ return this.cameraLocation;
+ };
+
+ /**
+ * Retrieve the camera rotation
+ * @return {Point3d} cameraRotation
+ */
+ Camera.prototype.getCameraRotation = function () {
+ return this.cameraRotation;
+ };
+
+ /**
+ * Calculate the location and rotation of the camera based on the
+ * position and orientation of the camera arm
+ */
+ Camera.prototype.calculateCameraOrientation = function () {
+ // calculate location of the camera
+ this.cameraLocation.x = this.armLocation.x - this.armLength * Math.sin(this.armRotation.horizontal) * Math.cos(this.armRotation.vertical);
+ this.cameraLocation.y = this.armLocation.y - this.armLength * Math.cos(this.armRotation.horizontal) * Math.cos(this.armRotation.vertical);
+ this.cameraLocation.z = this.armLocation.z + this.armLength * Math.sin(this.armRotation.vertical);
+
+ // calculate rotation of the camera
+ this.cameraRotation.x = Math.PI / 2 - this.armRotation.vertical;
+ this.cameraRotation.y = 0;
+ this.cameraRotation.z = -this.armRotation.horizontal;
+ };
+
+ module.exports = Camera;
+
+/***/ },
+/* 16 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var DataView = __webpack_require__(10);
+
+ /**
+ * @class Filter
+ *
+ * @param {DataSet} data The google data table
+ * @param {Number} column The index of the column to be filtered
+ * @param {Graph} graph The graph
+ */
+ function Filter(data, column, graph) {
+ this.data = data;
+ this.column = column;
+ this.graph = graph; // the parent graph
+
+ this.index = undefined;
+ this.value = undefined;
+
+ // read all distinct values and select the first one
+ this.values = graph.getDistinctValues(data.get(), this.column);
+
+ // sort both numeric and string values correctly
+ this.values.sort(function (a, b) {
+ return a > b ? 1 : a < b ? -1 : 0;
+ });
+
+ if (this.values.length > 0) {
+ this.selectValue(0);
+ }
+
+ // create an array with the filtered datapoints. this will be loaded afterwards
+ this.dataPoints = [];
+
+ this.loaded = false;
+ this.onLoadCallback = undefined;
+
+ if (graph.animationPreload) {
+ this.loaded = false;
+ this.loadInBackground();
+ } else {
+ this.loaded = true;
+ }
+ };
+
+ /**
+ * Return the label
+ * @return {string} label
+ */
+ Filter.prototype.isLoaded = function () {
+ return this.loaded;
+ };
+
+ /**
+ * Return the loaded progress
+ * @return {Number} percentage between 0 and 100
+ */
+ Filter.prototype.getLoadedProgress = function () {
+ var len = this.values.length;
+
+ var i = 0;
+ while (this.dataPoints[i]) {
+ i++;
+ }
+
+ return Math.round(i / len * 100);
+ };
+
+ /**
+ * Return the label
+ * @return {string} label
+ */
+ Filter.prototype.getLabel = function () {
+ return this.graph.filterLabel;
+ };
+
+ /**
+ * Return the columnIndex of the filter
+ * @return {Number} columnIndex
+ */
+ Filter.prototype.getColumn = function () {
+ return this.column;
+ };
+
+ /**
+ * Return the currently selected value. Returns undefined if there is no selection
+ * @return {*} value
+ */
+ Filter.prototype.getSelectedValue = function () {
+ if (this.index === undefined) return undefined;
+
+ return this.values[this.index];
+ };
+
+ /**
+ * Retrieve all values of the filter
+ * @return {Array} values
+ */
+ Filter.prototype.getValues = function () {
+ return this.values;
+ };
+
+ /**
+ * Retrieve one value of the filter
+ * @param {Number} index
+ * @return {*} value
+ */
+ Filter.prototype.getValue = function (index) {
+ if (index >= this.values.length) throw 'Error: index out of range';
+
+ return this.values[index];
+ };
+
+ /**
+ * Retrieve the (filtered) dataPoints for the currently selected filter index
+ * @param {Number} [index] (optional)
+ * @return {Array} dataPoints
+ */
+ Filter.prototype._getDataPoints = function (index) {
+ if (index === undefined) index = this.index;
+
+ if (index === undefined) return [];
+
+ var dataPoints;
+ if (this.dataPoints[index]) {
+ dataPoints = this.dataPoints[index];
+ } else {
+ var f = {};
+ f.column = this.column;
+ f.value = this.values[index];
+
+ var dataView = new DataView(this.data, { filter: function filter(item) {
+ return item[f.column] == f.value;
+ } }).get();
+ dataPoints = this.graph._getDataPoints(dataView);
+
+ this.dataPoints[index] = dataPoints;
+ }
+
+ return dataPoints;
+ };
+
+ /**
+ * Set a callback function when the filter is fully loaded.
+ */
+ Filter.prototype.setOnLoadCallback = function (callback) {
+ this.onLoadCallback = callback;
+ };
+
+ /**
+ * Add a value to the list with available values for this filter
+ * No double entries will be created.
+ * @param {Number} index
+ */
+ Filter.prototype.selectValue = function (index) {
+ if (index >= this.values.length) throw 'Error: index out of range';
+
+ this.index = index;
+ this.value = this.values[index];
+ };
+
+ /**
+ * Load all filtered rows in the background one by one
+ * Start this method without providing an index!
+ */
+ Filter.prototype.loadInBackground = function (index) {
+ if (index === undefined) index = 0;
+
+ var frame = this.graph.frame;
+
+ if (index < this.values.length) {
+ var dataPointsTemp = this._getDataPoints(index);
+ //this.graph.redrawInfo(); // TODO: not neat
+
+ // create a progress box
+ if (frame.progress === undefined) {
+ frame.progress = document.createElement('DIV');
+ frame.progress.style.position = 'absolute';
+ frame.progress.style.color = 'gray';
+ frame.appendChild(frame.progress);
+ }
+ var progress = this.getLoadedProgress();
+ frame.progress.innerHTML = 'Loading animation... ' + progress + '%';
+ // TODO: this is no nice solution...
+ frame.progress.style.bottom = 60 + 'px'; // TODO: use height of slider
+ frame.progress.style.left = 10 + 'px';
+
+ var me = this;
+ setTimeout(function () {
+ me.loadInBackground(index + 1);
+ }, 10);
+ this.loaded = false;
+ } else {
+ this.loaded = true;
+
+ // remove the progress box
+ if (frame.progress !== undefined) {
+ frame.removeChild(frame.progress);
+ frame.progress = undefined;
+ }
+
+ if (this.onLoadCallback) this.onLoadCallback();
+ }
+ };
+
+ module.exports = Filter;
+
+/***/ },
+/* 17 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+
+ /**
+ * @constructor Slider
+ *
+ * An html slider control with start/stop/prev/next buttons
+ * @param {Element} container The element where the slider will be created
+ * @param {Object} options Available options:
+ * {boolean} visible If true (default) the
+ * slider is visible.
+ */
+ function Slider(container, options) {
+ if (container === undefined) {
+ throw 'Error: No container element defined';
+ }
+ this.container = container;
+ this.visible = options && options.visible != undefined ? options.visible : true;
+
+ if (this.visible) {
+ this.frame = document.createElement('DIV');
+ //this.frame.style.backgroundColor = '#E5E5E5';
+ this.frame.style.width = '100%';
+ this.frame.style.position = 'relative';
+ this.container.appendChild(this.frame);
+
+ this.frame.prev = document.createElement('INPUT');
+ this.frame.prev.type = 'BUTTON';
+ this.frame.prev.value = 'Prev';
+ this.frame.appendChild(this.frame.prev);
+
+ this.frame.play = document.createElement('INPUT');
+ this.frame.play.type = 'BUTTON';
+ this.frame.play.value = 'Play';
+ this.frame.appendChild(this.frame.play);
+
+ this.frame.next = document.createElement('INPUT');
+ this.frame.next.type = 'BUTTON';
+ this.frame.next.value = 'Next';
+ this.frame.appendChild(this.frame.next);
+
+ this.frame.bar = document.createElement('INPUT');
+ this.frame.bar.type = 'BUTTON';
+ this.frame.bar.style.position = 'absolute';
+ this.frame.bar.style.border = '1px solid red';
+ this.frame.bar.style.width = '100px';
+ this.frame.bar.style.height = '6px';
+ this.frame.bar.style.borderRadius = '2px';
+ this.frame.bar.style.MozBorderRadius = '2px';
+ this.frame.bar.style.border = '1px solid #7F7F7F';
+ this.frame.bar.style.backgroundColor = '#E5E5E5';
+ this.frame.appendChild(this.frame.bar);
+
+ this.frame.slide = document.createElement('INPUT');
+ this.frame.slide.type = 'BUTTON';
+ this.frame.slide.style.margin = '0px';
+ this.frame.slide.value = ' ';
+ this.frame.slide.style.position = 'relative';
+ this.frame.slide.style.left = '-100px';
+ this.frame.appendChild(this.frame.slide);
+
+ // create events
+ var me = this;
+ this.frame.slide.onmousedown = function (event) {
+ me._onMouseDown(event);
+ };
+ this.frame.prev.onclick = function (event) {
+ me.prev(event);
+ };
+ this.frame.play.onclick = function (event) {
+ me.togglePlay(event);
+ };
+ this.frame.next.onclick = function (event) {
+ me.next(event);
+ };
+ }
+
+ this.onChangeCallback = undefined;
+
+ this.values = [];
+ this.index = undefined;
+
+ this.playTimeout = undefined;
+ this.playInterval = 1000; // milliseconds
+ this.playLoop = true;
+ }
+
+ /**
+ * Select the previous index
+ */
+ Slider.prototype.prev = function () {
+ var index = this.getIndex();
+ if (index > 0) {
+ index--;
+ this.setIndex(index);
+ }
+ };
+
+ /**
+ * Select the next index
+ */
+ Slider.prototype.next = function () {
+ var index = this.getIndex();
+ if (index < this.values.length - 1) {
+ index++;
+ this.setIndex(index);
+ }
+ };
+
+ /**
+ * Select the next index
+ */
+ Slider.prototype.playNext = function () {
+ var start = new Date();
+
+ var index = this.getIndex();
+ if (index < this.values.length - 1) {
+ index++;
+ this.setIndex(index);
+ } else if (this.playLoop) {
+ // jump to the start
+ index = 0;
+ this.setIndex(index);
+ }
+
+ var end = new Date();
+ var diff = end - start;
+
+ // calculate how much time it to to set the index and to execute the callback
+ // function.
+ var interval = Math.max(this.playInterval - diff, 0);
+ // document.title = diff // TODO: cleanup
+
+ var me = this;
+ this.playTimeout = setTimeout(function () {
+ me.playNext();
+ }, interval);
+ };
+
+ /**
+ * Toggle start or stop playing
+ */
+ Slider.prototype.togglePlay = function () {
+ if (this.playTimeout === undefined) {
+ this.play();
+ } else {
+ this.stop();
+ }
+ };
+
+ /**
+ * Start playing
+ */
+ Slider.prototype.play = function () {
+ // Test whether already playing
+ if (this.playTimeout) return;
+
+ this.playNext();
+
+ if (this.frame) {
+ this.frame.play.value = 'Stop';
+ }
+ };
+
+ /**
+ * Stop playing
+ */
+ Slider.prototype.stop = function () {
+ clearInterval(this.playTimeout);
+ this.playTimeout = undefined;
+
+ if (this.frame) {
+ this.frame.play.value = 'Play';
+ }
+ };
+
+ /**
+ * Set a callback function which will be triggered when the value of the
+ * slider bar has changed.
+ */
+ Slider.prototype.setOnChangeCallback = function (callback) {
+ this.onChangeCallback = callback;
+ };
+
+ /**
+ * Set the interval for playing the list
+ * @param {Number} interval The interval in milliseconds
+ */
+ Slider.prototype.setPlayInterval = function (interval) {
+ this.playInterval = interval;
+ };
+
+ /**
+ * Retrieve the current play interval
+ * @return {Number} interval The interval in milliseconds
+ */
+ Slider.prototype.getPlayInterval = function (interval) {
+ return this.playInterval;
+ };
+
+ /**
+ * Set looping on or off
+ * @pararm {boolean} doLoop If true, the slider will jump to the start when
+ * the end is passed, and will jump to the end
+ * when the start is passed.
+ */
+ Slider.prototype.setPlayLoop = function (doLoop) {
+ this.playLoop = doLoop;
+ };
+
+ /**
+ * Execute the onchange callback function
+ */
+ Slider.prototype.onChange = function () {
+ if (this.onChangeCallback !== undefined) {
+ this.onChangeCallback();
+ }
+ };
+
+ /**
+ * redraw the slider on the correct place
+ */
+ Slider.prototype.redraw = function () {
+ if (this.frame) {
+ // resize the bar
+ this.frame.bar.style.top = this.frame.clientHeight / 2 - this.frame.bar.offsetHeight / 2 + 'px';
+ this.frame.bar.style.width = this.frame.clientWidth - this.frame.prev.clientWidth - this.frame.play.clientWidth - this.frame.next.clientWidth - 30 + 'px';
+
+ // position the slider button
+ var left = this.indexToLeft(this.index);
+ this.frame.slide.style.left = left + 'px';
+ }
+ };
+
+ /**
+ * Set the list with values for the slider
+ * @param {Array} values A javascript array with values (any type)
+ */
+ Slider.prototype.setValues = function (values) {
+ this.values = values;
+
+ if (this.values.length > 0) this.setIndex(0);else this.index = undefined;
+ };
+
+ /**
+ * Select a value by its index
+ * @param {Number} index
+ */
+ Slider.prototype.setIndex = function (index) {
+ if (index < this.values.length) {
+ this.index = index;
+
+ this.redraw();
+ this.onChange();
+ } else {
+ throw 'Error: index out of range';
+ }
+ };
+
+ /**
+ * retrieve the index of the currently selected vaue
+ * @return {Number} index
+ */
+ Slider.prototype.getIndex = function () {
+ return this.index;
+ };
+
+ /**
+ * retrieve the currently selected value
+ * @return {*} value
+ */
+ Slider.prototype.get = function () {
+ return this.values[this.index];
+ };
+
+ Slider.prototype._onMouseDown = function (event) {
+ // only react on left mouse button down
+ var leftButtonDown = event.which ? event.which === 1 : event.button === 1;
+ if (!leftButtonDown) return;
+
+ this.startClientX = event.clientX;
+ this.startSlideX = parseFloat(this.frame.slide.style.left);
+
+ this.frame.style.cursor = 'move';
+
+ // add event listeners to handle moving the contents
+ // we store the function onmousemove and onmouseup in the graph, so we can
+ // remove the eventlisteners lateron in the function mouseUp()
+ var me = this;
+ this.onmousemove = function (event) {
+ me._onMouseMove(event);
+ };
+ this.onmouseup = function (event) {
+ me._onMouseUp(event);
+ };
+ util.addEventListener(document, 'mousemove', this.onmousemove);
+ util.addEventListener(document, 'mouseup', this.onmouseup);
+ util.preventDefault(event);
+ };
+
+ Slider.prototype.leftToIndex = function (left) {
+ var width = parseFloat(this.frame.bar.style.width) - this.frame.slide.clientWidth - 10;
+ var x = left - 3;
+
+ var index = Math.round(x / width * (this.values.length - 1));
+ if (index < 0) index = 0;
+ if (index > this.values.length - 1) index = this.values.length - 1;
+
+ return index;
+ };
+
+ Slider.prototype.indexToLeft = function (index) {
+ var width = parseFloat(this.frame.bar.style.width) - this.frame.slide.clientWidth - 10;
+
+ var x = index / (this.values.length - 1) * width;
+ var left = x + 3;
+
+ return left;
+ };
+
+ Slider.prototype._onMouseMove = function (event) {
+ var diff = event.clientX - this.startClientX;
+ var x = this.startSlideX + diff;
+
+ var index = this.leftToIndex(x);
+
+ this.setIndex(index);
+
+ util.preventDefault();
+ };
+
+ Slider.prototype._onMouseUp = function (event) {
+ this.frame.style.cursor = 'auto';
+
+ // remove event listeners
+ util.removeEventListener(document, 'mousemove', this.onmousemove);
+ util.removeEventListener(document, 'mouseup', this.onmouseup);
+
+ util.preventDefault();
+ };
+
+ module.exports = Slider;
+
+/***/ },
+/* 18 */
+/***/ function(module, exports) {
+
+ /**
+ * @prototype StepNumber
+ * The class StepNumber is an iterator for Numbers. You provide a start and end
+ * value, and a best step size. StepNumber itself rounds to fixed values and
+ * a finds the step that best fits the provided step.
+ *
+ * If prettyStep is true, the step size is chosen as close as possible to the
+ * provided step, but being a round value like 1, 2, 5, 10, 20, 50, ....
+ *
+ * Example usage:
+ * var step = new StepNumber(0, 10, 2.5, true);
+ * step.start();
+ * while (!step.end()) {
+ * alert(step.getCurrent());
+ * step.next();
+ * }
+ *
+ * Version: 1.0
+ *
+ * @param {Number} start The start value
+ * @param {Number} end The end value
+ * @param {Number} step Optional. Step size. Must be a positive value.
+ * @param {boolean} prettyStep Optional. If true, the step size is rounded
+ * To a pretty step size (like 1, 2, 5, 10, 20, 50, ...)
+ */
+ "use strict";
+
+ function StepNumber(start, end, step, prettyStep) {
+ // set default values
+ this._start = 0;
+ this._end = 0;
+ this._step = 1;
+ this.prettyStep = true;
+ this.precision = 5;
+
+ this._current = 0;
+ this.setRange(start, end, step, prettyStep);
+ };
+
+ /**
+ * Set a new range: start, end and step.
+ *
+ * @param {Number} start The start value
+ * @param {Number} end The end value
+ * @param {Number} step Optional. Step size. Must be a positive value.
+ * @param {boolean} prettyStep Optional. If true, the step size is rounded
+ * To a pretty step size (like 1, 2, 5, 10, 20, 50, ...)
+ */
+ StepNumber.prototype.setRange = function (start, end, step, prettyStep) {
+ this._start = start ? start : 0;
+ this._end = end ? end : 0;
+
+ this.setStep(step, prettyStep);
+ };
+
+ /**
+ * Set a new step size
+ * @param {Number} step New step size. Must be a positive value
+ * @param {boolean} prettyStep Optional. If true, the provided step is rounded
+ * to a pretty step size (like 1, 2, 5, 10, 20, 50, ...)
+ */
+ StepNumber.prototype.setStep = function (step, prettyStep) {
+ if (step === undefined || step <= 0) return;
+
+ if (prettyStep !== undefined) this.prettyStep = prettyStep;
+
+ if (this.prettyStep === true) this._step = StepNumber.calculatePrettyStep(step);else this._step = step;
+ };
+
+ /**
+ * Calculate a nice step size, closest to the desired step size.
+ * Returns a value in one of the ranges 1*10^n, 2*10^n, or 5*10^n, where n is an
+ * integer Number. For example 1, 2, 5, 10, 20, 50, etc...
+ * @param {Number} step Desired step size
+ * @return {Number} Nice step size
+ */
+ StepNumber.calculatePrettyStep = function (step) {
+ var log10 = function log10(x) {
+ return Math.log(x) / Math.LN10;
+ };
+
+ // try three steps (multiple of 1, 2, or 5
+ var step1 = Math.pow(10, Math.round(log10(step))),
+ step2 = 2 * Math.pow(10, Math.round(log10(step / 2))),
+ step5 = 5 * Math.pow(10, Math.round(log10(step / 5)));
+
+ // choose the best step (closest to minimum step)
+ var prettyStep = step1;
+ if (Math.abs(step2 - step) <= Math.abs(prettyStep - step)) prettyStep = step2;
+ if (Math.abs(step5 - step) <= Math.abs(prettyStep - step)) prettyStep = step5;
+
+ // for safety
+ if (prettyStep <= 0) {
+ prettyStep = 1;
+ }
+
+ return prettyStep;
+ };
+
+ /**
+ * returns the current value of the step
+ * @return {Number} current value
+ */
+ StepNumber.prototype.getCurrent = function () {
+ return parseFloat(this._current.toPrecision(this.precision));
+ };
+
+ /**
+ * returns the current step size
+ * @return {Number} current step size
+ */
+ StepNumber.prototype.getStep = function () {
+ return this._step;
+ };
+
+ /**
+ * Set the current value to the largest value smaller than start, which
+ * is a multiple of the step size
+ */
+ StepNumber.prototype.start = function () {
+ this._current = this._start - this._start % this._step;
+ };
+
+ /**
+ * Do a step, add the step size to the current value
+ */
+ StepNumber.prototype.next = function () {
+ this._current += this._step;
+ };
+
+ /**
+ * Returns true whether the end is reached
+ * @return {boolean} True if the current value has passed the end value.
+ */
+ StepNumber.prototype.end = function () {
+ return this._current > this._end;
+ };
+
+ module.exports = StepNumber;
+
+/***/ },
+/* 19 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Emitter = __webpack_require__(12);
+ var Hammer = __webpack_require__(20);
+ var moment = __webpack_require__(2);
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(8);
+ var DataView = __webpack_require__(10);
+ var Range = __webpack_require__(24);
+ var Core = __webpack_require__(28);
+ var TimeAxis = __webpack_require__(39);
+ var CurrentTime = __webpack_require__(44);
+ var CustomTime = __webpack_require__(42);
+ var ItemSet = __webpack_require__(29);
+
+ var Configurator = __webpack_require__(45);
+ var Validator = __webpack_require__(47)['default'];
+ var printStyle = __webpack_require__(47).printStyle;
+ var allOptions = __webpack_require__(48).allOptions;
+ var configureOptions = __webpack_require__(48).configureOptions;
+
+ /**
+ * Create a timeline visualization
+ * @param {HTMLElement} container
+ * @param {vis.DataSet | vis.DataView | Array} [items]
+ * @param {vis.DataSet | vis.DataView | Array} [groups]
+ * @param {Object} [options] See Timeline.setOptions for the available options.
+ * @constructor
+ * @extends Core
+ */
+ function Timeline(container, items, groups, options) {
+ if (!(this instanceof Timeline)) {
+ throw new SyntaxError('Constructor must be called with the new operator');
+ }
+
+ // if the third element is options, the forth is groups (optionally);
+ if (!(Array.isArray(groups) || groups instanceof DataSet || groups instanceof DataView) && groups instanceof Object) {
+ var forthArgument = options;
+ options = groups;
+ groups = forthArgument;
+ }
+
+ var me = this;
+ this.defaultOptions = {
+ start: null,
+ end: null,
+
+ autoResize: true,
+ throttleRedraw: 0, // ms
+
+ orientation: {
+ axis: 'bottom', // axis orientation: 'bottom', 'top', or 'both'
+ item: 'bottom' // not relevant
+ },
+
+ moment: moment,
+
+ width: null,
+ height: null,
+ maxHeight: null,
+ minHeight: null
+ };
+ this.options = util.deepExtend({}, this.defaultOptions);
+
+ // Create the DOM, props, and emitter
+ this._create(container);
+
+ // all components listed here will be repainted automatically
+ this.components = [];
+
+ this.body = {
+ dom: this.dom,
+ domProps: this.props,
+ emitter: {
+ on: this.on.bind(this),
+ off: this.off.bind(this),
+ emit: this.emit.bind(this)
+ },
+ hiddenDates: [],
+ util: {
+ getScale: function getScale() {
+ return me.timeAxis.step.scale;
+ },
+ getStep: function getStep() {
+ return me.timeAxis.step.step;
+ },
+
+ toScreen: me._toScreen.bind(me),
+ toGlobalScreen: me._toGlobalScreen.bind(me), // this refers to the root.width
+ toTime: me._toTime.bind(me),
+ toGlobalTime: me._toGlobalTime.bind(me)
+ }
+ };
+
+ // range
+ this.range = new Range(this.body);
+ this.components.push(this.range);
+ this.body.range = this.range;
+
+ // time axis
+ this.timeAxis = new TimeAxis(this.body);
+ this.timeAxis2 = null; // used in case of orientation option 'both'
+ this.components.push(this.timeAxis);
+
+ // current time bar
+ this.currentTime = new CurrentTime(this.body);
+ this.components.push(this.currentTime);
+
+ // item set
+ this.itemSet = new ItemSet(this.body);
+ this.components.push(this.itemSet);
+
+ this.itemsData = null; // DataSet
+ this.groupsData = null; // DataSet
+
+ this.on('tap', function (event) {
+ me.emit('click', me.getEventProperties(event));
+ });
+ this.on('doubletap', function (event) {
+ me.emit('doubleClick', me.getEventProperties(event));
+ });
+ this.dom.root.oncontextmenu = function (event) {
+ me.emit('contextmenu', me.getEventProperties(event));
+ };
+
+ // apply options
+ if (options) {
+ this.setOptions(options);
+ }
+
+ // IMPORTANT: THIS HAPPENS BEFORE SET ITEMS!
+ if (groups) {
+ this.setGroups(groups);
+ }
+
+ // create itemset
+ if (items) {
+ this.setItems(items);
+ } else {
+ this._redraw();
+ }
+ }
+
+ // Extend the functionality from Core
+ Timeline.prototype = new Core();
+
+ /**
+ * Load a configurator
+ * @return {Object}
+ * @private
+ */
+ Timeline.prototype._createConfigurator = function () {
+ return new Configurator(this, this.dom.container, configureOptions);
+ };
+
+ /**
+ * Force a redraw. The size of all items will be recalculated.
+ * Can be useful to manually redraw when option autoResize=false and the window
+ * has been resized, or when the items CSS has been changed.
+ *
+ * Note: this function will be overridden on construction with a trottled version
+ */
+ Timeline.prototype.redraw = function () {
+ this.itemSet && this.itemSet.markDirty({ refreshItems: true });
+ this._redraw();
+ };
+
+ Timeline.prototype.setOptions = function (options) {
+ // validate options
+ var errorFound = Validator.validate(options, allOptions);
+ if (errorFound === true) {
+ console.log('%cErrors have been found in the supplied options object.', printStyle);
+ }
+
+ Core.prototype.setOptions.call(this, options);
+
+ if ('type' in options) {
+ if (options.type !== this.options.type) {
+ this.options.type = options.type;
+
+ // force recreation of all items
+ var itemsData = this.itemsData;
+ if (itemsData) {
+ var selection = this.getSelection();
+ this.setItems(null); // remove all
+ this.setItems(itemsData); // add all
+ this.setSelection(selection); // restore selection
+ }
+ }
+ }
+ };
+
+ /**
+ * Set items
+ * @param {vis.DataSet | Array | null} items
+ */
+ Timeline.prototype.setItems = function (items) {
+ var initialLoad = this.itemsData == null;
+
+ // convert to type DataSet when needed
+ var newDataSet;
+ if (!items) {
+ newDataSet = null;
+ } else if (items instanceof DataSet || items instanceof DataView) {
+ newDataSet = items;
+ } else {
+ // turn an array into a dataset
+ newDataSet = new DataSet(items, {
+ type: {
+ start: 'Date',
+ end: 'Date'
+ }
+ });
+ }
+
+ // set items
+ this.itemsData = newDataSet;
+ this.itemSet && this.itemSet.setItems(newDataSet);
+
+ if (initialLoad) {
+ if (this.options.start != undefined || this.options.end != undefined) {
+ if (this.options.start == undefined || this.options.end == undefined) {
+ var range = this.getItemRange();
+ }
+
+ var start = this.options.start != undefined ? this.options.start : range.min;
+ var end = this.options.end != undefined ? this.options.end : range.max;
+
+ this.setWindow(start, end, { animation: false });
+ } else {
+ this.fit({ animation: false });
+ }
+ }
+ };
+
+ /**
+ * Set groups
+ * @param {vis.DataSet | Array} groups
+ */
+ Timeline.prototype.setGroups = function (groups) {
+ // convert to type DataSet when needed
+ var newDataSet;
+ if (!groups) {
+ newDataSet = null;
+ } else if (groups instanceof DataSet || groups instanceof DataView) {
+ newDataSet = groups;
+ } else {
+ // turn an array into a dataset
+ newDataSet = new DataSet(groups);
+ }
+
+ this.groupsData = newDataSet;
+ this.itemSet.setGroups(newDataSet);
+ };
+
+ /**
+ * Set both items and groups in one go
+ * @param {{items: Array | vis.DataSet, groups: Array | vis.DataSet}} data
+ */
+ Timeline.prototype.setData = function (data) {
+ if (data && data.groups) {
+ this.setGroups(data.groups);
+ }
+
+ if (data && data.items) {
+ this.setItems(data.items);
+ }
+ };
+
+ /**
+ * Set selected items by their id. Replaces the current selection
+ * Unknown id's are silently ignored.
+ * @param {string[] | string} [ids] An array with zero or more id's of the items to be
+ * selected. If ids is an empty array, all items will be
+ * unselected.
+ * @param {Object} [options] Available options:
+ * `focus: boolean`
+ * If true, focus will be set to the selected item(s)
+ * `animation: boolean | {duration: number, easingFunction: string}`
+ * If true (default), the range is animated
+ * smoothly to the new window. An object can be
+ * provided to specify duration and easing function.
+ * Default duration is 500 ms, and default easing
+ * function is 'easeInOutQuad'.
+ * Only applicable when option focus is true.
+ */
+ Timeline.prototype.setSelection = function (ids, options) {
+ this.itemSet && this.itemSet.setSelection(ids);
+
+ if (options && options.focus) {
+ this.focus(ids, options);
+ }
+ };
+
+ /**
+ * Get the selected items by their id
+ * @return {Array} ids The ids of the selected items
+ */
+ Timeline.prototype.getSelection = function () {
+ return this.itemSet && this.itemSet.getSelection() || [];
+ };
+
+ /**
+ * Adjust the visible window such that the selected item (or multiple items)
+ * are centered on screen.
+ * @param {String | String[]} id An item id or array with item ids
+ * @param {Object} [options] Available options:
+ * `animation: boolean | {duration: number, easingFunction: string}`
+ * If true (default), the range is animated
+ * smoothly to the new window. An object can be
+ * provided to specify duration and easing function.
+ * Default duration is 500 ms, and default easing
+ * function is 'easeInOutQuad'.
+ */
+ Timeline.prototype.focus = function (id, options) {
+ if (!this.itemsData || id == undefined) return;
+
+ var ids = Array.isArray(id) ? id : [id];
+
+ // get the specified item(s)
+ var itemsData = this.itemsData.getDataSet().get(ids, {
+ type: {
+ start: 'Date',
+ end: 'Date'
+ }
+ });
+
+ // calculate minimum start and maximum end of specified items
+ var start = null;
+ var end = null;
+ itemsData.forEach(function (itemData) {
+ var s = itemData.start.valueOf();
+ var e = 'end' in itemData ? itemData.end.valueOf() : itemData.start.valueOf();
+
+ if (start === null || s < start) {
+ start = s;
+ }
+
+ if (end === null || e > end) {
+ end = e;
+ }
+ });
+
+ if (start !== null && end !== null) {
+ // calculate the new middle and interval for the window
+ var middle = (start + end) / 2;
+ var interval = Math.max(this.range.end - this.range.start, (end - start) * 1.1);
+
+ var animation = options && options.animation !== undefined ? options.animation : true;
+ this.range.setRange(middle - interval / 2, middle + interval / 2, animation);
+ }
+ };
+
+ /**
+ * Set Timeline window such that it fits all items
+ * @param {Object} [options] Available options:
+ * `animation: boolean | {duration: number, easingFunction: string}`
+ * If true (default), the range is animated
+ * smoothly to the new window. An object can be
+ * provided to specify duration and easing function.
+ * Default duration is 500 ms, and default easing
+ * function is 'easeInOutQuad'.
+ */
+ Timeline.prototype.fit = function (options) {
+ var animation = options && options.animation !== undefined ? options.animation : true;
+ var range = this.getItemRange();
+ this.range.setRange(range.min, range.max, animation);
+ };
+
+ /**
+ * Determine the range of the items, taking into account their actual width
+ * and a margin of 10 pixels on both sides.
+ * @return {{min: Date | null, max: Date | null}}
+ */
+ Timeline.prototype.getItemRange = function () {
+ var _this = this;
+
+ // get a rough approximation for the range based on the items start and end dates
+ var range = this.getDataRange();
+ var min = range.min;
+ var max = range.max;
+ var minItem = null;
+ var maxItem = null;
+
+ if (min != null && max != null) {
+ var interval;
+ var factor;
+ var lhs;
+ var rhs;
+ var delta;
+
+ (function () {
+ var getStart = function getStart(item) {
+ return util.convert(item.data.start, 'Date').valueOf();
+ };
+
+ var getEnd = function getEnd(item) {
+ var end = item.data.end != undefined ? item.data.end : item.data.start;
+ return util.convert(end, 'Date').valueOf();
+ };
+
+ interval = max - min;
+ // ms
+ if (interval <= 0) {
+ interval = 10;
+ }
+ factor = interval / _this.props.center.width;
+
+ // calculate the date of the left side and right side of the items given
+ util.forEach(_this.itemSet.items, (function (item) {
+ item.show();
+
+ var start = getStart(item);
+ var end = getEnd(item);
+
+ var left = new Date(start - (item.getWidthLeft() + 10) * factor);
+ var right = new Date(end + (item.getWidthRight() + 10) * factor);
+
+ if (left < min) {
+ min = left;
+ minItem = item;
+ }
+ if (right > max) {
+ max = right;
+ maxItem = item;
+ }
+ }).bind(_this));
+
+ if (minItem && maxItem) {
+ lhs = minItem.getWidthLeft() + 10;
+ rhs = maxItem.getWidthRight() + 10;
+ delta = _this.props.center.width - lhs - rhs;
+ // px
+
+ if (delta > 0) {
+ min = getStart(minItem) - lhs * interval / delta; // ms
+ max = getEnd(maxItem) + rhs * interval / delta; // ms
+ }
+ }
+ })();
+ }
+
+ return {
+ min: min != null ? new Date(min) : null,
+ max: max != null ? new Date(max) : null
+ };
+ };
+
+ /**
+ * Calculate the data range of the items start and end dates
+ * @returns {{min: Date | null, max: Date | null}}
+ */
+ Timeline.prototype.getDataRange = function () {
+ var min = null;
+ var max = null;
+
+ var dataset = this.itemsData && this.itemsData.getDataSet();
+ if (dataset) {
+ dataset.forEach(function (item) {
+ var start = util.convert(item.start, 'Date').valueOf();
+ var end = util.convert(item.end != undefined ? item.end : item.start, 'Date').valueOf();
+ if (min === null || start < min) {
+ min = start;
+ }
+ if (max === null || end > max) {
+ max = start;
+ }
+ });
+ }
+
+ return {
+ min: min != null ? new Date(min) : null,
+ max: max != null ? new Date(max) : null
+ };
+ };
+
+ /**
+ * Generate Timeline related information from an event
+ * @param {Event} event
+ * @return {Object} An object with related information, like on which area
+ * The event happened, whether clicked on an item, etc.
+ */
+ Timeline.prototype.getEventProperties = function (event) {
+ var clientX = event.center ? event.center.x : event.clientX;
+ var clientY = event.center ? event.center.y : event.clientY;
+ var x = clientX - util.getAbsoluteLeft(this.dom.centerContainer);
+ var y = clientY - util.getAbsoluteTop(this.dom.centerContainer);
+
+ var item = this.itemSet.itemFromTarget(event);
+ var group = this.itemSet.groupFromTarget(event);
+ var customTime = CustomTime.customTimeFromTarget(event);
+
+ var snap = this.itemSet.options.snap || null;
+ var scale = this.body.util.getScale();
+ var step = this.body.util.getStep();
+ var time = this._toTime(x);
+ var snappedTime = snap ? snap(time, scale, step) : time;
+
+ var element = util.getTarget(event);
+ var what = null;
+ if (item != null) {
+ what = 'item';
+ } else if (customTime != null) {
+ what = 'custom-time';
+ } else if (util.hasParent(element, this.timeAxis.dom.foreground)) {
+ what = 'axis';
+ } else if (this.timeAxis2 && util.hasParent(element, this.timeAxis2.dom.foreground)) {
+ what = 'axis';
+ } else if (util.hasParent(element, this.itemSet.dom.labelSet)) {
+ what = 'group-label';
+ } else if (util.hasParent(element, this.currentTime.bar)) {
+ what = 'current-time';
+ } else if (util.hasParent(element, this.dom.center)) {
+ what = 'background';
+ }
+
+ return {
+ event: event,
+ item: item ? item.id : null,
+ group: group ? group.groupId : null,
+ what: what,
+ pageX: event.srcEvent ? event.srcEvent.pageX : event.pageX,
+ pageY: event.srcEvent ? event.srcEvent.pageY : event.pageY,
+ x: x,
+ y: y,
+ time: time,
+ snappedTime: snappedTime
+ };
+ };
+
+ module.exports = Timeline;
+
+/***/ },
+/* 20 */
+/***/ function(module, exports, __webpack_require__) {
+
+ // Only load hammer.js when in a browser environment
+ // (loading hammer.js in a node.js environment gives errors)
+ 'use strict';
+
+ if (typeof window !== 'undefined') {
+ var propagating = __webpack_require__(21);
+ var Hammer = window['Hammer'] || __webpack_require__(22);
+ module.exports = propagating(Hammer, {
+ preventDefault: 'mouse'
+ });
+ } else {
+ module.exports = function () {
+ throw Error('hammer.js is only available in a browser, not in node.js.');
+ };
+ }
+
+/***/ },
+/* 21 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;'use strict';
+
+ (function (factory) {
+ if (true) {
+ // AMD. Register as an anonymous module.
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
+ } else if (typeof exports === 'object') {
+ // Node. Does not work with strict CommonJS, but
+ // only CommonJS-like environments that support module.exports,
+ // like Node.
+ module.exports = factory();
+ } else {
+ // Browser globals (root is window)
+ window.propagating = factory();
+ }
+ }(function () {
+ var _firstTarget = null; // singleton, will contain the target element where the touch event started
+ var _processing = false; // singleton, true when a touch event is being handled
+
+ /**
+ * Extend an Hammer.js instance with event propagation.
+ *
+ * Features:
+ * - Events emitted by hammer will propagate in order from child to parent
+ * elements.
+ * - Events are extended with a function `event.stopPropagation()` to stop
+ * propagation to parent elements.
+ * - An option `preventDefault` to stop all default browser behavior.
+ *
+ * Usage:
+ * var hammer = propagatingHammer(new Hammer(element));
+ * var hammer = propagatingHammer(new Hammer(element), {preventDefault: true});
+ *
+ * @param {Hammer.Manager} hammer An hammer instance.
+ * @param {Object} [options] Available options:
+ * - `preventDefault: true | 'mouse' | 'touch' | 'pen'`.
+ * Enforce preventing the default browser behavior.
+ * Cannot be set to `false`.
+ * @return {Hammer.Manager} Returns the same hammer instance with extended
+ * functionality
+ */
+ return function propagating(hammer, options) {
+ var _options = options || {
+ preventDefault: false
+ };
+
+ if (hammer.Manager) {
+ // This looks like the Hammer constructor.
+ // Overload the constructors with our own.
+ var Hammer = hammer;
+
+ var PropagatingHammer = function(element, options) {
+ var o = Object.create(_options);
+ if (options) Hammer.extend(o, options);
+ return propagating(new Hammer(element, o), o);
+ };
+ Hammer.extend(PropagatingHammer, Hammer);
+
+ PropagatingHammer.Manager = function (element, options) {
+ var o = Object.create(_options);
+ if (options) Hammer.extend(o, options);
+ return propagating(new Hammer.Manager(element, o), o);
+ };
+
+ return PropagatingHammer;
+ }
+
+ // create a wrapper object which will override the functions
+ // `on`, `off`, `destroy`, and `emit` of the hammer instance
+ var wrapper = Object.create(hammer);
+
+ // attach to DOM element
+ var element = hammer.element;
+ element.hammer = wrapper;
+
+ // register an event to catch the start of a gesture and store the
+ // target in a singleton
+ hammer.on('hammer.input', function (event) {
+ if (_options.preventDefault === true || (_options.preventDefault === event.pointerType)) {
+ event.preventDefault();
+ }
+ if (event.isFirst) {
+ _firstTarget = event.target;
+ }
+ });
+
+ /** @type {Object.>} */
+ wrapper._handlers = {};
+
+ /**
+ * Register a handler for one or multiple events
+ * @param {String} events A space separated string with events
+ * @param {function} handler A callback function, called as handler(event)
+ * @returns {Hammer.Manager} Returns the hammer instance
+ */
+ wrapper.on = function (events, handler) {
+ // register the handler
+ split(events).forEach(function (event) {
+ var _handlers = wrapper._handlers[event];
+ if (!_handlers) {
+ wrapper._handlers[event] = _handlers = [];
+
+ // register the static, propagated handler
+ hammer.on(event, propagatedHandler);
+ }
+ _handlers.push(handler);
+ });
+
+ return wrapper;
+ };
+
+ /**
+ * Unregister a handler for one or multiple events
+ * @param {String} events A space separated string with events
+ * @param {function} [handler] Optional. The registered handler. If not
+ * provided, all handlers for given events
+ * are removed.
+ * @returns {Hammer.Manager} Returns the hammer instance
+ */
+ wrapper.off = function (events, handler) {
+ // unregister the handler
+ split(events).forEach(function (event) {
+ var _handlers = wrapper._handlers[event];
+ if (_handlers) {
+ _handlers = handler ? _handlers.filter(function (h) {
+ return h !== handler;
+ }) : [];
+
+ if (_handlers.length > 0) {
+ wrapper._handlers[event] = _handlers;
+ }
+ else {
+ // remove static, propagated handler
+ hammer.off(event, propagatedHandler);
+ delete wrapper._handlers[event];
+ }
+ }
+ });
+
+ return wrapper;
+ };
+
+ /**
+ * Emit to the event listeners
+ * @param {string} eventType
+ * @param {Event} event
+ */
+ wrapper.emit = function(eventType, event) {
+ _firstTarget = event.target;
+ hammer.emit(eventType, event);
+ };
+
+ wrapper.destroy = function () {
+ // Detach from DOM element
+ delete hammer.element.hammer;
+
+ // clear all handlers
+ wrapper._handlers = {};
+
+ // call original hammer destroy
+ hammer.destroy();
+ };
+
+ // split a string with space separated words
+ function split(events) {
+ return events.match(/[^ ]+/g);
+ }
+
+ /**
+ * A static event handler, applying event propagation.
+ * @param {Object} event
+ */
+ function propagatedHandler(event) {
+ // let only a single hammer instance handle this event
+ if (event.type !== 'hammer.input') {
+ // it is possible that the same srcEvent is used with multiple hammer events,
+ // we keep track on which events are handled in an object _handled
+ if (!event.srcEvent._handled) {
+ event.srcEvent._handled = {};
+ }
+
+ if (event.srcEvent._handled[event.type]) {
+ return;
+ }
+ else {
+ event.srcEvent._handled[event.type] = true;
+ }
+ }
+
+ // attach a stopPropagation function to the event
+ var stopped = false;
+ event.stopPropagation = function () {
+ stopped = true;
+ };
+
+ // attach firstTarget property to the event
+ event.firstTarget = _firstTarget;
+
+ // propagate over all elements (until stopped)
+ var elem = _firstTarget;
+ while (elem && !stopped) {
+ var _handlers = elem.hammer && elem.hammer._handlers[event.type];
+ if (_handlers) {
+ for (var i = 0; i < _handlers.length && !stopped; i++) {
+ _handlers[i](event);
+ }
+ }
+
+ elem = elem.parentNode;
+ }
+ }
+
+ return wrapper;
+ };
+ }));
+
+
+/***/ },
+/* 22 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var __WEBPACK_AMD_DEFINE_RESULT__;/*! Hammer.JS - v2.0.4 - 2014-09-28
+ * http://hammerjs.github.io/
+ *
+ * Copyright (c) 2014 Jorik Tangelder;
+ * Licensed under the MIT license */
+ (function(window, document, exportName, undefined) {
+ 'use strict';
+
+ var VENDOR_PREFIXES = ['', 'webkit', 'moz', 'MS', 'ms', 'o'];
+ var TEST_ELEMENT = document.createElement('div');
+
+ var TYPE_FUNCTION = 'function';
+
+ var round = Math.round;
+ var abs = Math.abs;
+ var now = Date.now;
+
+ /**
+ * set a timeout with a given scope
+ * @param {Function} fn
+ * @param {Number} timeout
+ * @param {Object} context
+ * @returns {number}
+ */
+ function setTimeoutContext(fn, timeout, context) {
+ return setTimeout(bindFn(fn, context), timeout);
+ }
+
+ /**
+ * if the argument is an array, we want to execute the fn on each entry
+ * if it aint an array we don't want to do a thing.
+ * this is used by all the methods that accept a single and array argument.
+ * @param {*|Array} arg
+ * @param {String} fn
+ * @param {Object} [context]
+ * @returns {Boolean}
+ */
+ function invokeArrayArg(arg, fn, context) {
+ if (Array.isArray(arg)) {
+ each(arg, context[fn], context);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * walk objects and arrays
+ * @param {Object} obj
+ * @param {Function} iterator
+ * @param {Object} context
+ */
+ function each(obj, iterator, context) {
+ var i;
+
+ if (!obj) {
+ return;
+ }
+
+ if (obj.forEach) {
+ obj.forEach(iterator, context);
+ } else if (obj.length !== undefined) {
+ i = 0;
+ while (i < obj.length) {
+ iterator.call(context, obj[i], i, obj);
+ i++;
+ }
+ } else {
+ for (i in obj) {
+ obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
+ }
+ }
+ }
+
+ /**
+ * extend object.
+ * means that properties in dest will be overwritten by the ones in src.
+ * @param {Object} dest
+ * @param {Object} src
+ * @param {Boolean} [merge]
+ * @returns {Object} dest
+ */
+ function extend(dest, src, merge) {
+ var keys = Object.keys(src);
+ var i = 0;
+ while (i < keys.length) {
+ if (!merge || (merge && dest[keys[i]] === undefined)) {
+ dest[keys[i]] = src[keys[i]];
+ }
+ i++;
+ }
+ return dest;
+ }
+
+ /**
+ * merge the values from src in the dest.
+ * means that properties that exist in dest will not be overwritten by src
+ * @param {Object} dest
+ * @param {Object} src
+ * @returns {Object} dest
+ */
+ function merge(dest, src) {
+ return extend(dest, src, true);
+ }
+
+ /**
+ * simple class inheritance
+ * @param {Function} child
+ * @param {Function} base
+ * @param {Object} [properties]
+ */
+ function inherit(child, base, properties) {
+ var baseP = base.prototype,
+ childP;
+
+ childP = child.prototype = Object.create(baseP);
+ childP.constructor = child;
+ childP._super = baseP;
+
+ if (properties) {
+ extend(childP, properties);
+ }
+ }
+
+ /**
+ * simple function bind
+ * @param {Function} fn
+ * @param {Object} context
+ * @returns {Function}
+ */
+ function bindFn(fn, context) {
+ return function boundFn() {
+ return fn.apply(context, arguments);
+ };
+ }
+
+ /**
+ * let a boolean value also be a function that must return a boolean
+ * this first item in args will be used as the context
+ * @param {Boolean|Function} val
+ * @param {Array} [args]
+ * @returns {Boolean}
+ */
+ function boolOrFn(val, args) {
+ if (typeof val == TYPE_FUNCTION) {
+ return val.apply(args ? args[0] || undefined : undefined, args);
+ }
+ return val;
+ }
+
+ /**
+ * use the val2 when val1 is undefined
+ * @param {*} val1
+ * @param {*} val2
+ * @returns {*}
+ */
+ function ifUndefined(val1, val2) {
+ return (val1 === undefined) ? val2 : val1;
+ }
+
+ /**
+ * addEventListener with multiple events at once
+ * @param {EventTarget} target
+ * @param {String} types
+ * @param {Function} handler
+ */
+ function addEventListeners(target, types, handler) {
+ each(splitStr(types), function(type) {
+ target.addEventListener(type, handler, false);
+ });
+ }
+
+ /**
+ * removeEventListener with multiple events at once
+ * @param {EventTarget} target
+ * @param {String} types
+ * @param {Function} handler
+ */
+ function removeEventListeners(target, types, handler) {
+ each(splitStr(types), function(type) {
+ target.removeEventListener(type, handler, false);
+ });
+ }
+
+ /**
+ * find if a node is in the given parent
+ * @method hasParent
+ * @param {HTMLElement} node
+ * @param {HTMLElement} parent
+ * @return {Boolean} found
+ */
+ function hasParent(node, parent) {
+ while (node) {
+ if (node == parent) {
+ return true;
+ }
+ node = node.parentNode;
+ }
+ return false;
+ }
+
+ /**
+ * small indexOf wrapper
+ * @param {String} str
+ * @param {String} find
+ * @returns {Boolean} found
+ */
+ function inStr(str, find) {
+ return str.indexOf(find) > -1;
+ }
+
+ /**
+ * split string on whitespace
+ * @param {String} str
+ * @returns {Array} words
+ */
+ function splitStr(str) {
+ return str.trim().split(/\s+/g);
+ }
+
+ /**
+ * find if a array contains the object using indexOf or a simple polyFill
+ * @param {Array} src
+ * @param {String} find
+ * @param {String} [findByKey]
+ * @return {Boolean|Number} false when not found, or the index
+ */
+ function inArray(src, find, findByKey) {
+ if (src.indexOf && !findByKey) {
+ return src.indexOf(find);
+ } else {
+ var i = 0;
+ while (i < src.length) {
+ if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {
+ return i;
+ }
+ i++;
+ }
+ return -1;
+ }
+ }
+
+ /**
+ * convert array-like objects to real arrays
+ * @param {Object} obj
+ * @returns {Array}
+ */
+ function toArray(obj) {
+ return Array.prototype.slice.call(obj, 0);
+ }
+
+ /**
+ * unique array with objects based on a key (like 'id') or just by the array's value
+ * @param {Array} src [{id:1},{id:2},{id:1}]
+ * @param {String} [key]
+ * @param {Boolean} [sort=False]
+ * @returns {Array} [{id:1},{id:2}]
+ */
+ function uniqueArray(src, key, sort) {
+ var results = [];
+ var values = [];
+ var i = 0;
+
+ while (i < src.length) {
+ var val = key ? src[i][key] : src[i];
+ if (inArray(values, val) < 0) {
+ results.push(src[i]);
+ }
+ values[i] = val;
+ i++;
+ }
+
+ if (sort) {
+ if (!key) {
+ results = results.sort();
+ } else {
+ results = results.sort(function sortUniqueArray(a, b) {
+ return a[key] > b[key];
+ });
+ }
+ }
+
+ return results;
+ }
+
+ /**
+ * get the prefixed property
+ * @param {Object} obj
+ * @param {String} property
+ * @returns {String|Undefined} prefixed
+ */
+ function prefixed(obj, property) {
+ var prefix, prop;
+ var camelProp = property[0].toUpperCase() + property.slice(1);
+
+ var i = 0;
+ while (i < VENDOR_PREFIXES.length) {
+ prefix = VENDOR_PREFIXES[i];
+ prop = (prefix) ? prefix + camelProp : property;
+
+ if (prop in obj) {
+ return prop;
+ }
+ i++;
+ }
+ return undefined;
+ }
+
+ /**
+ * get a unique id
+ * @returns {number} uniqueId
+ */
+ var _uniqueId = 1;
+ function uniqueId() {
+ return _uniqueId++;
+ }
+
+ /**
+ * get the window object of an element
+ * @param {HTMLElement} element
+ * @returns {DocumentView|Window}
+ */
+ function getWindowForElement(element) {
+ var doc = element.ownerDocument;
+ return (doc.defaultView || doc.parentWindow);
+ }
+
+ var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
+
+ var SUPPORT_TOUCH = ('ontouchstart' in window);
+ var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;
+ var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
+
+ var INPUT_TYPE_TOUCH = 'touch';
+ var INPUT_TYPE_PEN = 'pen';
+ var INPUT_TYPE_MOUSE = 'mouse';
+ var INPUT_TYPE_KINECT = 'kinect';
+
+ var COMPUTE_INTERVAL = 25;
+
+ var INPUT_START = 1;
+ var INPUT_MOVE = 2;
+ var INPUT_END = 4;
+ var INPUT_CANCEL = 8;
+
+ var DIRECTION_NONE = 1;
+ var DIRECTION_LEFT = 2;
+ var DIRECTION_RIGHT = 4;
+ var DIRECTION_UP = 8;
+ var DIRECTION_DOWN = 16;
+
+ var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
+ var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
+ var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
+
+ var PROPS_XY = ['x', 'y'];
+ var PROPS_CLIENT_XY = ['clientX', 'clientY'];
+
+ /**
+ * create new input type manager
+ * @param {Manager} manager
+ * @param {Function} callback
+ * @returns {Input}
+ * @constructor
+ */
+ function Input(manager, callback) {
+ var self = this;
+ this.manager = manager;
+ this.callback = callback;
+ this.element = manager.element;
+ this.target = manager.options.inputTarget;
+
+ // smaller wrapper around the handler, for the scope and the enabled state of the manager,
+ // so when disabled the input events are completely bypassed.
+ this.domHandler = function(ev) {
+ if (boolOrFn(manager.options.enable, [manager])) {
+ self.handler(ev);
+ }
+ };
+
+ this.init();
+
+ }
+
+ Input.prototype = {
+ /**
+ * should handle the inputEvent data and trigger the callback
+ * @virtual
+ */
+ handler: function() { },
+
+ /**
+ * bind the events
+ */
+ init: function() {
+ this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
+ this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
+ this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
+ },
+
+ /**
+ * unbind the events
+ */
+ destroy: function() {
+ this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
+ this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
+ this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
+ }
+ };
+
+ /**
+ * create new input type manager
+ * called by the Manager constructor
+ * @param {Hammer} manager
+ * @returns {Input}
+ */
+ function createInputInstance(manager) {
+ var Type;
+ var inputClass = manager.options.inputClass;
+
+ if (inputClass) {
+ Type = inputClass;
+ } else if (SUPPORT_POINTER_EVENTS) {
+ Type = PointerEventInput;
+ } else if (SUPPORT_ONLY_TOUCH) {
+ Type = TouchInput;
+ } else if (!SUPPORT_TOUCH) {
+ Type = MouseInput;
+ } else {
+ Type = TouchMouseInput;
+ }
+ return new (Type)(manager, inputHandler);
+ }
+
+ /**
+ * handle input events
+ * @param {Manager} manager
+ * @param {String} eventType
+ * @param {Object} input
+ */
+ function inputHandler(manager, eventType, input) {
+ var pointersLen = input.pointers.length;
+ var changedPointersLen = input.changedPointers.length;
+ var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
+ var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));
+
+ input.isFirst = !!isFirst;
+ input.isFinal = !!isFinal;
+
+ if (isFirst) {
+ manager.session = {};
+ }
+
+ // source event is the normalized value of the domEvents
+ // like 'touchstart, mouseup, pointerdown'
+ input.eventType = eventType;
+
+ // compute scale, rotation etc
+ computeInputData(manager, input);
+
+ // emit secret event
+ manager.emit('hammer.input', input);
+
+ manager.recognize(input);
+ manager.session.prevInput = input;
+ }
+
+ /**
+ * extend the data with some usable properties like scale, rotate, velocity etc
+ * @param {Object} manager
+ * @param {Object} input
+ */
+ function computeInputData(manager, input) {
+ var session = manager.session;
+ var pointers = input.pointers;
+ var pointersLength = pointers.length;
+
+ // store the first input to calculate the distance and direction
+ if (!session.firstInput) {
+ session.firstInput = simpleCloneInputData(input);
+ }
+
+ // to compute scale and rotation we need to store the multiple touches
+ if (pointersLength > 1 && !session.firstMultiple) {
+ session.firstMultiple = simpleCloneInputData(input);
+ } else if (pointersLength === 1) {
+ session.firstMultiple = false;
+ }
+
+ var firstInput = session.firstInput;
+ var firstMultiple = session.firstMultiple;
+ var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
+
+ var center = input.center = getCenter(pointers);
+ input.timeStamp = now();
+ input.deltaTime = input.timeStamp - firstInput.timeStamp;
+
+ input.angle = getAngle(offsetCenter, center);
+ input.distance = getDistance(offsetCenter, center);
+
+ computeDeltaXY(session, input);
+ input.offsetDirection = getDirection(input.deltaX, input.deltaY);
+
+ input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
+ input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
+
+ computeIntervalInputData(session, input);
+
+ // find the correct target
+ var target = manager.element;
+ if (hasParent(input.srcEvent.target, target)) {
+ target = input.srcEvent.target;
+ }
+ input.target = target;
+ }
+
+ function computeDeltaXY(session, input) {
+ var center = input.center;
+ var offset = session.offsetDelta || {};
+ var prevDelta = session.prevDelta || {};
+ var prevInput = session.prevInput || {};
+
+ if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
+ prevDelta = session.prevDelta = {
+ x: prevInput.deltaX || 0,
+ y: prevInput.deltaY || 0
+ };
+
+ offset = session.offsetDelta = {
+ x: center.x,
+ y: center.y
+ };
+ }
+
+ input.deltaX = prevDelta.x + (center.x - offset.x);
+ input.deltaY = prevDelta.y + (center.y - offset.y);
+ }
+
+ /**
+ * velocity is calculated every x ms
+ * @param {Object} session
+ * @param {Object} input
+ */
+ function computeIntervalInputData(session, input) {
+ var last = session.lastInterval || input,
+ deltaTime = input.timeStamp - last.timeStamp,
+ velocity, velocityX, velocityY, direction;
+
+ if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
+ var deltaX = last.deltaX - input.deltaX;
+ var deltaY = last.deltaY - input.deltaY;
+
+ var v = getVelocity(deltaTime, deltaX, deltaY);
+ velocityX = v.x;
+ velocityY = v.y;
+ velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
+ direction = getDirection(deltaX, deltaY);
+
+ session.lastInterval = input;
+ } else {
+ // use latest velocity info if it doesn't overtake a minimum period
+ velocity = last.velocity;
+ velocityX = last.velocityX;
+ velocityY = last.velocityY;
+ direction = last.direction;
+ }
+
+ input.velocity = velocity;
+ input.velocityX = velocityX;
+ input.velocityY = velocityY;
+ input.direction = direction;
+ }
+
+ /**
+ * create a simple clone from the input used for storage of firstInput and firstMultiple
+ * @param {Object} input
+ * @returns {Object} clonedInputData
+ */
+ function simpleCloneInputData(input) {
+ // make a simple copy of the pointers because we will get a reference if we don't
+ // we only need clientXY for the calculations
+ var pointers = [];
+ var i = 0;
+ while (i < input.pointers.length) {
+ pointers[i] = {
+ clientX: round(input.pointers[i].clientX),
+ clientY: round(input.pointers[i].clientY)
+ };
+ i++;
+ }
+
+ return {
+ timeStamp: now(),
+ pointers: pointers,
+ center: getCenter(pointers),
+ deltaX: input.deltaX,
+ deltaY: input.deltaY
+ };
+ }
+
+ /**
+ * get the center of all the pointers
+ * @param {Array} pointers
+ * @return {Object} center contains `x` and `y` properties
+ */
+ function getCenter(pointers) {
+ var pointersLength = pointers.length;
+
+ // no need to loop when only one touch
+ if (pointersLength === 1) {
+ return {
+ x: round(pointers[0].clientX),
+ y: round(pointers[0].clientY)
+ };
+ }
+
+ var x = 0, y = 0, i = 0;
+ while (i < pointersLength) {
+ x += pointers[i].clientX;
+ y += pointers[i].clientY;
+ i++;
+ }
+
+ return {
+ x: round(x / pointersLength),
+ y: round(y / pointersLength)
+ };
+ }
+
+ /**
+ * calculate the velocity between two points. unit is in px per ms.
+ * @param {Number} deltaTime
+ * @param {Number} x
+ * @param {Number} y
+ * @return {Object} velocity `x` and `y`
+ */
+ function getVelocity(deltaTime, x, y) {
+ return {
+ x: x / deltaTime || 0,
+ y: y / deltaTime || 0
+ };
+ }
+
+ /**
+ * get the direction between two points
+ * @param {Number} x
+ * @param {Number} y
+ * @return {Number} direction
+ */
+ function getDirection(x, y) {
+ if (x === y) {
+ return DIRECTION_NONE;
+ }
+
+ if (abs(x) >= abs(y)) {
+ return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
+ }
+ return y > 0 ? DIRECTION_UP : DIRECTION_DOWN;
+ }
+
+ /**
+ * calculate the absolute distance between two points
+ * @param {Object} p1 {x, y}
+ * @param {Object} p2 {x, y}
+ * @param {Array} [props] containing x and y keys
+ * @return {Number} distance
+ */
+ function getDistance(p1, p2, props) {
+ if (!props) {
+ props = PROPS_XY;
+ }
+ var x = p2[props[0]] - p1[props[0]],
+ y = p2[props[1]] - p1[props[1]];
+
+ return Math.sqrt((x * x) + (y * y));
+ }
+
+ /**
+ * calculate the angle between two coordinates
+ * @param {Object} p1
+ * @param {Object} p2
+ * @param {Array} [props] containing x and y keys
+ * @return {Number} angle
+ */
+ function getAngle(p1, p2, props) {
+ if (!props) {
+ props = PROPS_XY;
+ }
+ var x = p2[props[0]] - p1[props[0]],
+ y = p2[props[1]] - p1[props[1]];
+ return Math.atan2(y, x) * 180 / Math.PI;
+ }
+
+ /**
+ * calculate the rotation degrees between two pointersets
+ * @param {Array} start array of pointers
+ * @param {Array} end array of pointers
+ * @return {Number} rotation
+ */
+ function getRotation(start, end) {
+ return getAngle(end[1], end[0], PROPS_CLIENT_XY) - getAngle(start[1], start[0], PROPS_CLIENT_XY);
+ }
+
+ /**
+ * calculate the scale factor between two pointersets
+ * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
+ * @param {Array} start array of pointers
+ * @param {Array} end array of pointers
+ * @return {Number} scale
+ */
+ function getScale(start, end) {
+ return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
+ }
+
+ var MOUSE_INPUT_MAP = {
+ mousedown: INPUT_START,
+ mousemove: INPUT_MOVE,
+ mouseup: INPUT_END
+ };
+
+ var MOUSE_ELEMENT_EVENTS = 'mousedown';
+ var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
+
+ /**
+ * Mouse events input
+ * @constructor
+ * @extends Input
+ */
+ function MouseInput() {
+ this.evEl = MOUSE_ELEMENT_EVENTS;
+ this.evWin = MOUSE_WINDOW_EVENTS;
+
+ this.allow = true; // used by Input.TouchMouse to disable mouse events
+ this.pressed = false; // mousedown state
+
+ Input.apply(this, arguments);
+ }
+
+ inherit(MouseInput, Input, {
+ /**
+ * handle mouse events
+ * @param {Object} ev
+ */
+ handler: function MEhandler(ev) {
+ var eventType = MOUSE_INPUT_MAP[ev.type];
+
+ // on start we want to have the left mouse button down
+ if (eventType & INPUT_START && ev.button === 0) {
+ this.pressed = true;
+ }
+
+ if (eventType & INPUT_MOVE && ev.which !== 1) {
+ eventType = INPUT_END;
+ }
+
+ // mouse must be down, and mouse events are allowed (see the TouchMouse input)
+ if (!this.pressed || !this.allow) {
+ return;
+ }
+
+ if (eventType & INPUT_END) {
+ this.pressed = false;
+ }
+
+ this.callback(this.manager, eventType, {
+ pointers: [ev],
+ changedPointers: [ev],
+ pointerType: INPUT_TYPE_MOUSE,
+ srcEvent: ev
+ });
+ }
+ });
+
+ var POINTER_INPUT_MAP = {
+ pointerdown: INPUT_START,
+ pointermove: INPUT_MOVE,
+ pointerup: INPUT_END,
+ pointercancel: INPUT_CANCEL,
+ pointerout: INPUT_CANCEL
+ };
+
+ // in IE10 the pointer types is defined as an enum
+ var IE10_POINTER_TYPE_ENUM = {
+ 2: INPUT_TYPE_TOUCH,
+ 3: INPUT_TYPE_PEN,
+ 4: INPUT_TYPE_MOUSE,
+ 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816
+ };
+
+ var POINTER_ELEMENT_EVENTS = 'pointerdown';
+ var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
+
+ // IE10 has prefixed support, and case-sensitive
+ if (window.MSPointerEvent) {
+ POINTER_ELEMENT_EVENTS = 'MSPointerDown';
+ POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
+ }
+
+ /**
+ * Pointer events input
+ * @constructor
+ * @extends Input
+ */
+ function PointerEventInput() {
+ this.evEl = POINTER_ELEMENT_EVENTS;
+ this.evWin = POINTER_WINDOW_EVENTS;
+
+ Input.apply(this, arguments);
+
+ this.store = (this.manager.session.pointerEvents = []);
+ }
+
+ inherit(PointerEventInput, Input, {
+ /**
+ * handle mouse events
+ * @param {Object} ev
+ */
+ handler: function PEhandler(ev) {
+ var store = this.store;
+ var removePointer = false;
+
+ var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
+ var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
+ var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
+
+ var isTouch = (pointerType == INPUT_TYPE_TOUCH);
+
+ // get index of the event in the store
+ var storeIndex = inArray(store, ev.pointerId, 'pointerId');
+
+ // start and mouse must be down
+ if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
+ if (storeIndex < 0) {
+ store.push(ev);
+ storeIndex = store.length - 1;
+ }
+ } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
+ removePointer = true;
+ }
+
+ // it not found, so the pointer hasn't been down (so it's probably a hover)
+ if (storeIndex < 0) {
+ return;
+ }
+
+ // update the event in the store
+ store[storeIndex] = ev;
+
+ this.callback(this.manager, eventType, {
+ pointers: store,
+ changedPointers: [ev],
+ pointerType: pointerType,
+ srcEvent: ev
+ });
+
+ if (removePointer) {
+ // remove from the store
+ store.splice(storeIndex, 1);
+ }
+ }
+ });
+
+ var SINGLE_TOUCH_INPUT_MAP = {
+ touchstart: INPUT_START,
+ touchmove: INPUT_MOVE,
+ touchend: INPUT_END,
+ touchcancel: INPUT_CANCEL
+ };
+
+ var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
+ var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
+
+ /**
+ * Touch events input
+ * @constructor
+ * @extends Input
+ */
+ function SingleTouchInput() {
+ this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
+ this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
+ this.started = false;
+
+ Input.apply(this, arguments);
+ }
+
+ inherit(SingleTouchInput, Input, {
+ handler: function TEhandler(ev) {
+ var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
+
+ // should we handle the touch events?
+ if (type === INPUT_START) {
+ this.started = true;
+ }
+
+ if (!this.started) {
+ return;
+ }
+
+ var touches = normalizeSingleTouches.call(this, ev, type);
+
+ // when done, reset the started state
+ if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
+ this.started = false;
+ }
+
+ this.callback(this.manager, type, {
+ pointers: touches[0],
+ changedPointers: touches[1],
+ pointerType: INPUT_TYPE_TOUCH,
+ srcEvent: ev
+ });
+ }
+ });
+
+ /**
+ * @this {TouchInput}
+ * @param {Object} ev
+ * @param {Number} type flag
+ * @returns {undefined|Array} [all, changed]
+ */
+ function normalizeSingleTouches(ev, type) {
+ var all = toArray(ev.touches);
+ var changed = toArray(ev.changedTouches);
+
+ if (type & (INPUT_END | INPUT_CANCEL)) {
+ all = uniqueArray(all.concat(changed), 'identifier', true);
+ }
+
+ return [all, changed];
+ }
+
+ var TOUCH_INPUT_MAP = {
+ touchstart: INPUT_START,
+ touchmove: INPUT_MOVE,
+ touchend: INPUT_END,
+ touchcancel: INPUT_CANCEL
+ };
+
+ var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
+
+ /**
+ * Multi-user touch events input
+ * @constructor
+ * @extends Input
+ */
+ function TouchInput() {
+ this.evTarget = TOUCH_TARGET_EVENTS;
+ this.targetIds = {};
+
+ Input.apply(this, arguments);
+ }
+
+ inherit(TouchInput, Input, {
+ handler: function MTEhandler(ev) {
+ var type = TOUCH_INPUT_MAP[ev.type];
+ var touches = getTouches.call(this, ev, type);
+ if (!touches) {
+ return;
+ }
+
+ this.callback(this.manager, type, {
+ pointers: touches[0],
+ changedPointers: touches[1],
+ pointerType: INPUT_TYPE_TOUCH,
+ srcEvent: ev
+ });
+ }
+ });
+
+ /**
+ * @this {TouchInput}
+ * @param {Object} ev
+ * @param {Number} type flag
+ * @returns {undefined|Array} [all, changed]
+ */
+ function getTouches(ev, type) {
+ var allTouches = toArray(ev.touches);
+ var targetIds = this.targetIds;
+
+ // when there is only one touch, the process can be simplified
+ if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
+ targetIds[allTouches[0].identifier] = true;
+ return [allTouches, allTouches];
+ }
+
+ var i,
+ targetTouches,
+ changedTouches = toArray(ev.changedTouches),
+ changedTargetTouches = [],
+ target = this.target;
+
+ // get target touches from touches
+ targetTouches = allTouches.filter(function(touch) {
+ return hasParent(touch.target, target);
+ });
+
+ // collect touches
+ if (type === INPUT_START) {
+ i = 0;
+ while (i < targetTouches.length) {
+ targetIds[targetTouches[i].identifier] = true;
+ i++;
+ }
+ }
+
+ // filter changed touches to only contain touches that exist in the collected target ids
+ i = 0;
+ while (i < changedTouches.length) {
+ if (targetIds[changedTouches[i].identifier]) {
+ changedTargetTouches.push(changedTouches[i]);
+ }
+
+ // cleanup removed touches
+ if (type & (INPUT_END | INPUT_CANCEL)) {
+ delete targetIds[changedTouches[i].identifier];
+ }
+ i++;
+ }
+
+ if (!changedTargetTouches.length) {
+ return;
+ }
+
+ return [
+ // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
+ uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),
+ changedTargetTouches
+ ];
+ }
+
+ /**
+ * Combined touch and mouse input
+ *
+ * Touch has a higher priority then mouse, and while touching no mouse events are allowed.
+ * This because touch devices also emit mouse events while doing a touch.
+ *
+ * @constructor
+ * @extends Input
+ */
+ function TouchMouseInput() {
+ Input.apply(this, arguments);
+
+ var handler = bindFn(this.handler, this);
+ this.touch = new TouchInput(this.manager, handler);
+ this.mouse = new MouseInput(this.manager, handler);
+ }
+
+ inherit(TouchMouseInput, Input, {
+ /**
+ * handle mouse and touch events
+ * @param {Hammer} manager
+ * @param {String} inputEvent
+ * @param {Object} inputData
+ */
+ handler: function TMEhandler(manager, inputEvent, inputData) {
+ var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),
+ isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);
+
+ // when we're in a touch event, so block all upcoming mouse events
+ // most mobile browser also emit mouseevents, right after touchstart
+ if (isTouch) {
+ this.mouse.allow = false;
+ } else if (isMouse && !this.mouse.allow) {
+ return;
+ }
+
+ // reset the allowMouse when we're done
+ if (inputEvent & (INPUT_END | INPUT_CANCEL)) {
+ this.mouse.allow = true;
+ }
+
+ this.callback(manager, inputEvent, inputData);
+ },
+
+ /**
+ * remove the event listeners
+ */
+ destroy: function destroy() {
+ this.touch.destroy();
+ this.mouse.destroy();
+ }
+ });
+
+ var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
+ var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
+
+ // magical touchAction value
+ var TOUCH_ACTION_COMPUTE = 'compute';
+ var TOUCH_ACTION_AUTO = 'auto';
+ var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
+ var TOUCH_ACTION_NONE = 'none';
+ var TOUCH_ACTION_PAN_X = 'pan-x';
+ var TOUCH_ACTION_PAN_Y = 'pan-y';
+
+ /**
+ * Touch Action
+ * sets the touchAction property or uses the js alternative
+ * @param {Manager} manager
+ * @param {String} value
+ * @constructor
+ */
+ function TouchAction(manager, value) {
+ this.manager = manager;
+ this.set(value);
+ }
+
+ TouchAction.prototype = {
+ /**
+ * set the touchAction value on the element or enable the polyfill
+ * @param {String} value
+ */
+ set: function(value) {
+ // find out the touch-action by the event handlers
+ if (value == TOUCH_ACTION_COMPUTE) {
+ value = this.compute();
+ }
+
+ if (NATIVE_TOUCH_ACTION) {
+ this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
+ }
+ this.actions = value.toLowerCase().trim();
+ },
+
+ /**
+ * just re-set the touchAction value
+ */
+ update: function() {
+ this.set(this.manager.options.touchAction);
+ },
+
+ /**
+ * compute the value for the touchAction property based on the recognizer's settings
+ * @returns {String} value
+ */
+ compute: function() {
+ var actions = [];
+ each(this.manager.recognizers, function(recognizer) {
+ if (boolOrFn(recognizer.options.enable, [recognizer])) {
+ actions = actions.concat(recognizer.getTouchAction());
+ }
+ });
+ return cleanTouchActions(actions.join(' '));
+ },
+
+ /**
+ * this method is called on each input cycle and provides the preventing of the browser behavior
+ * @param {Object} input
+ */
+ preventDefaults: function(input) {
+ // not needed with native support for the touchAction property
+ if (NATIVE_TOUCH_ACTION) {
+ return;
+ }
+
+ var srcEvent = input.srcEvent;
+ var direction = input.offsetDirection;
+
+ // if the touch action did prevented once this session
+ if (this.manager.session.prevented) {
+ srcEvent.preventDefault();
+ return;
+ }
+
+ var actions = this.actions;
+ var hasNone = inStr(actions, TOUCH_ACTION_NONE);
+ var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
+ var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
+
+ if (hasNone ||
+ (hasPanY && direction & DIRECTION_HORIZONTAL) ||
+ (hasPanX && direction & DIRECTION_VERTICAL)) {
+ return this.preventSrc(srcEvent);
+ }
+ },
+
+ /**
+ * call preventDefault to prevent the browser's default behavior (scrolling in most cases)
+ * @param {Object} srcEvent
+ */
+ preventSrc: function(srcEvent) {
+ this.manager.session.prevented = true;
+ srcEvent.preventDefault();
+ }
+ };
+
+ /**
+ * when the touchActions are collected they are not a valid value, so we need to clean things up. *
+ * @param {String} actions
+ * @returns {*}
+ */
+ function cleanTouchActions(actions) {
+ // none
+ if (inStr(actions, TOUCH_ACTION_NONE)) {
+ return TOUCH_ACTION_NONE;
+ }
+
+ var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
+ var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
+
+ // pan-x and pan-y can be combined
+ if (hasPanX && hasPanY) {
+ return TOUCH_ACTION_PAN_X + ' ' + TOUCH_ACTION_PAN_Y;
+ }
+
+ // pan-x OR pan-y
+ if (hasPanX || hasPanY) {
+ return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
+ }
+
+ // manipulation
+ if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
+ return TOUCH_ACTION_MANIPULATION;
+ }
+
+ return TOUCH_ACTION_AUTO;
+ }
+
+ /**
+ * Recognizer flow explained; *
+ * All recognizers have the initial state of POSSIBLE when a input session starts.
+ * The definition of a input session is from the first input until the last input, with all it's movement in it. *
+ * Example session for mouse-input: mousedown -> mousemove -> mouseup
+ *
+ * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
+ * which determines with state it should be.
+ *
+ * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
+ * POSSIBLE to give it another change on the next cycle.
+ *
+ * Possible
+ * |
+ * +-----+---------------+
+ * | |
+ * +-----+-----+ |
+ * | | |
+ * Failed Cancelled |
+ * +-------+------+
+ * | |
+ * Recognized Began
+ * |
+ * Changed
+ * |
+ * Ended/Recognized
+ */
+ var STATE_POSSIBLE = 1;
+ var STATE_BEGAN = 2;
+ var STATE_CHANGED = 4;
+ var STATE_ENDED = 8;
+ var STATE_RECOGNIZED = STATE_ENDED;
+ var STATE_CANCELLED = 16;
+ var STATE_FAILED = 32;
+
+ /**
+ * Recognizer
+ * Every recognizer needs to extend from this class.
+ * @constructor
+ * @param {Object} options
+ */
+ function Recognizer(options) {
+ this.id = uniqueId();
+
+ this.manager = null;
+ this.options = merge(options || {}, this.defaults);
+
+ // default is enable true
+ this.options.enable = ifUndefined(this.options.enable, true);
+
+ this.state = STATE_POSSIBLE;
+
+ this.simultaneous = {};
+ this.requireFail = [];
+ }
+
+ Recognizer.prototype = {
+ /**
+ * @virtual
+ * @type {Object}
+ */
+ defaults: {},
+
+ /**
+ * set options
+ * @param {Object} options
+ * @return {Recognizer}
+ */
+ set: function(options) {
+ extend(this.options, options);
+
+ // also update the touchAction, in case something changed about the directions/enabled state
+ this.manager && this.manager.touchAction.update();
+ return this;
+ },
+
+ /**
+ * recognize simultaneous with an other recognizer.
+ * @param {Recognizer} otherRecognizer
+ * @returns {Recognizer} this
+ */
+ recognizeWith: function(otherRecognizer) {
+ if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
+ return this;
+ }
+
+ var simultaneous = this.simultaneous;
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
+ if (!simultaneous[otherRecognizer.id]) {
+ simultaneous[otherRecognizer.id] = otherRecognizer;
+ otherRecognizer.recognizeWith(this);
+ }
+ return this;
+ },
+
+ /**
+ * drop the simultaneous link. it doesnt remove the link on the other recognizer.
+ * @param {Recognizer} otherRecognizer
+ * @returns {Recognizer} this
+ */
+ dropRecognizeWith: function(otherRecognizer) {
+ if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
+ return this;
+ }
+
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
+ delete this.simultaneous[otherRecognizer.id];
+ return this;
+ },
+
+ /**
+ * recognizer can only run when an other is failing
+ * @param {Recognizer} otherRecognizer
+ * @returns {Recognizer} this
+ */
+ requireFailure: function(otherRecognizer) {
+ if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
+ return this;
+ }
+
+ var requireFail = this.requireFail;
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
+ if (inArray(requireFail, otherRecognizer) === -1) {
+ requireFail.push(otherRecognizer);
+ otherRecognizer.requireFailure(this);
+ }
+ return this;
+ },
+
+ /**
+ * drop the requireFailure link. it does not remove the link on the other recognizer.
+ * @param {Recognizer} otherRecognizer
+ * @returns {Recognizer} this
+ */
+ dropRequireFailure: function(otherRecognizer) {
+ if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
+ return this;
+ }
+
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
+ var index = inArray(this.requireFail, otherRecognizer);
+ if (index > -1) {
+ this.requireFail.splice(index, 1);
+ }
+ return this;
+ },
+
+ /**
+ * has require failures boolean
+ * @returns {boolean}
+ */
+ hasRequireFailures: function() {
+ return this.requireFail.length > 0;
+ },
+
+ /**
+ * if the recognizer can recognize simultaneous with an other recognizer
+ * @param {Recognizer} otherRecognizer
+ * @returns {Boolean}
+ */
+ canRecognizeWith: function(otherRecognizer) {
+ return !!this.simultaneous[otherRecognizer.id];
+ },
+
+ /**
+ * You should use `tryEmit` instead of `emit` directly to check
+ * that all the needed recognizers has failed before emitting.
+ * @param {Object} input
+ */
+ emit: function(input) {
+ var self = this;
+ var state = this.state;
+
+ function emit(withState) {
+ self.manager.emit(self.options.event + (withState ? stateStr(state) : ''), input);
+ }
+
+ // 'panstart' and 'panmove'
+ if (state < STATE_ENDED) {
+ emit(true);
+ }
+
+ emit(); // simple 'eventName' events
+
+ // panend and pancancel
+ if (state >= STATE_ENDED) {
+ emit(true);
+ }
+ },
+
+ /**
+ * Check that all the require failure recognizers has failed,
+ * if true, it emits a gesture event,
+ * otherwise, setup the state to FAILED.
+ * @param {Object} input
+ */
+ tryEmit: function(input) {
+ if (this.canEmit()) {
+ return this.emit(input);
+ }
+ // it's failing anyway
+ this.state = STATE_FAILED;
+ },
+
+ /**
+ * can we emit?
+ * @returns {boolean}
+ */
+ canEmit: function() {
+ var i = 0;
+ while (i < this.requireFail.length) {
+ if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
+ return false;
+ }
+ i++;
+ }
+ return true;
+ },
+
+ /**
+ * update the recognizer
+ * @param {Object} inputData
+ */
+ recognize: function(inputData) {
+ // make a new copy of the inputData
+ // so we can change the inputData without messing up the other recognizers
+ var inputDataClone = extend({}, inputData);
+
+ // is is enabled and allow recognizing?
+ if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
+ this.reset();
+ this.state = STATE_FAILED;
+ return;
+ }
+
+ // reset when we've reached the end
+ if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
+ this.state = STATE_POSSIBLE;
+ }
+
+ this.state = this.process(inputDataClone);
+
+ // the recognizer has recognized a gesture
+ // so trigger an event
+ if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
+ this.tryEmit(inputDataClone);
+ }
+ },
+
+ /**
+ * return the state of the recognizer
+ * the actual recognizing happens in this method
+ * @virtual
+ * @param {Object} inputData
+ * @returns {Const} STATE
+ */
+ process: function(inputData) { }, // jshint ignore:line
+
+ /**
+ * return the preferred touch-action
+ * @virtual
+ * @returns {Array}
+ */
+ getTouchAction: function() { },
+
+ /**
+ * called when the gesture isn't allowed to recognize
+ * like when another is being recognized or it is disabled
+ * @virtual
+ */
+ reset: function() { }
+ };
+
+ /**
+ * get a usable string, used as event postfix
+ * @param {Const} state
+ * @returns {String} state
+ */
+ function stateStr(state) {
+ if (state & STATE_CANCELLED) {
+ return 'cancel';
+ } else if (state & STATE_ENDED) {
+ return 'end';
+ } else if (state & STATE_CHANGED) {
+ return 'move';
+ } else if (state & STATE_BEGAN) {
+ return 'start';
+ }
+ return '';
+ }
+
+ /**
+ * direction cons to string
+ * @param {Const} direction
+ * @returns {String}
+ */
+ function directionStr(direction) {
+ if (direction == DIRECTION_DOWN) {
+ return 'down';
+ } else if (direction == DIRECTION_UP) {
+ return 'up';
+ } else if (direction == DIRECTION_LEFT) {
+ return 'left';
+ } else if (direction == DIRECTION_RIGHT) {
+ return 'right';
+ }
+ return '';
+ }
+
+ /**
+ * get a recognizer by name if it is bound to a manager
+ * @param {Recognizer|String} otherRecognizer
+ * @param {Recognizer} recognizer
+ * @returns {Recognizer}
+ */
+ function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
+ var manager = recognizer.manager;
+ if (manager) {
+ return manager.get(otherRecognizer);
+ }
+ return otherRecognizer;
+ }
+
+ /**
+ * This recognizer is just used as a base for the simple attribute recognizers.
+ * @constructor
+ * @extends Recognizer
+ */
+ function AttrRecognizer() {
+ Recognizer.apply(this, arguments);
+ }
+
+ inherit(AttrRecognizer, Recognizer, {
+ /**
+ * @namespace
+ * @memberof AttrRecognizer
+ */
+ defaults: {
+ /**
+ * @type {Number}
+ * @default 1
+ */
+ pointers: 1
+ },
+
+ /**
+ * Used to check if it the recognizer receives valid input, like input.distance > 10.
+ * @memberof AttrRecognizer
+ * @param {Object} input
+ * @returns {Boolean} recognized
+ */
+ attrTest: function(input) {
+ var optionPointers = this.options.pointers;
+ return optionPointers === 0 || input.pointers.length === optionPointers;
+ },
+
+ /**
+ * Process the input and return the state for the recognizer
+ * @memberof AttrRecognizer
+ * @param {Object} input
+ * @returns {*} State
+ */
+ process: function(input) {
+ var state = this.state;
+ var eventType = input.eventType;
+
+ var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
+ var isValid = this.attrTest(input);
+
+ // on cancel input and we've recognized before, return STATE_CANCELLED
+ if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
+ return state | STATE_CANCELLED;
+ } else if (isRecognized || isValid) {
+ if (eventType & INPUT_END) {
+ return state | STATE_ENDED;
+ } else if (!(state & STATE_BEGAN)) {
+ return STATE_BEGAN;
+ }
+ return state | STATE_CHANGED;
+ }
+ return STATE_FAILED;
+ }
+ });
+
+ /**
+ * Pan
+ * Recognized when the pointer is down and moved in the allowed direction.
+ * @constructor
+ * @extends AttrRecognizer
+ */
+ function PanRecognizer() {
+ AttrRecognizer.apply(this, arguments);
+
+ this.pX = null;
+ this.pY = null;
+ }
+
+ inherit(PanRecognizer, AttrRecognizer, {
+ /**
+ * @namespace
+ * @memberof PanRecognizer
+ */
+ defaults: {
+ event: 'pan',
+ threshold: 10,
+ pointers: 1,
+ direction: DIRECTION_ALL
+ },
+
+ getTouchAction: function() {
+ var direction = this.options.direction;
+ var actions = [];
+ if (direction & DIRECTION_HORIZONTAL) {
+ actions.push(TOUCH_ACTION_PAN_Y);
+ }
+ if (direction & DIRECTION_VERTICAL) {
+ actions.push(TOUCH_ACTION_PAN_X);
+ }
+ return actions;
+ },
+
+ directionTest: function(input) {
+ var options = this.options;
+ var hasMoved = true;
+ var distance = input.distance;
+ var direction = input.direction;
+ var x = input.deltaX;
+ var y = input.deltaY;
+
+ // lock to axis?
+ if (!(direction & options.direction)) {
+ if (options.direction & DIRECTION_HORIZONTAL) {
+ direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
+ hasMoved = x != this.pX;
+ distance = Math.abs(input.deltaX);
+ } else {
+ direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
+ hasMoved = y != this.pY;
+ distance = Math.abs(input.deltaY);
+ }
+ }
+ input.direction = direction;
+ return hasMoved && distance > options.threshold && direction & options.direction;
+ },
+
+ attrTest: function(input) {
+ return AttrRecognizer.prototype.attrTest.call(this, input) &&
+ (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));
+ },
+
+ emit: function(input) {
+ this.pX = input.deltaX;
+ this.pY = input.deltaY;
+
+ var direction = directionStr(input.direction);
+ if (direction) {
+ this.manager.emit(this.options.event + direction, input);
+ }
+
+ this._super.emit.call(this, input);
+ }
+ });
+
+ /**
+ * Pinch
+ * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
+ * @constructor
+ * @extends AttrRecognizer
+ */
+ function PinchRecognizer() {
+ AttrRecognizer.apply(this, arguments);
+ }
+
+ inherit(PinchRecognizer, AttrRecognizer, {
+ /**
+ * @namespace
+ * @memberof PinchRecognizer
+ */
+ defaults: {
+ event: 'pinch',
+ threshold: 0,
+ pointers: 2
+ },
+
+ getTouchAction: function() {
+ return [TOUCH_ACTION_NONE];
+ },
+
+ attrTest: function(input) {
+ return this._super.attrTest.call(this, input) &&
+ (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
+ },
+
+ emit: function(input) {
+ this._super.emit.call(this, input);
+ if (input.scale !== 1) {
+ var inOut = input.scale < 1 ? 'in' : 'out';
+ this.manager.emit(this.options.event + inOut, input);
+ }
+ }
+ });
+
+ /**
+ * Press
+ * Recognized when the pointer is down for x ms without any movement.
+ * @constructor
+ * @extends Recognizer
+ */
+ function PressRecognizer() {
+ Recognizer.apply(this, arguments);
+
+ this._timer = null;
+ this._input = null;
+ }
+
+ inherit(PressRecognizer, Recognizer, {
+ /**
+ * @namespace
+ * @memberof PressRecognizer
+ */
+ defaults: {
+ event: 'press',
+ pointers: 1,
+ time: 500, // minimal time of the pointer to be pressed
+ threshold: 5 // a minimal movement is ok, but keep it low
+ },
+
+ getTouchAction: function() {
+ return [TOUCH_ACTION_AUTO];
+ },
+
+ process: function(input) {
+ var options = this.options;
+ var validPointers = input.pointers.length === options.pointers;
+ var validMovement = input.distance < options.threshold;
+ var validTime = input.deltaTime > options.time;
+
+ this._input = input;
+
+ // we only allow little movement
+ // and we've reached an end event, so a tap is possible
+ if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {
+ this.reset();
+ } else if (input.eventType & INPUT_START) {
+ this.reset();
+ this._timer = setTimeoutContext(function() {
+ this.state = STATE_RECOGNIZED;
+ this.tryEmit();
+ }, options.time, this);
+ } else if (input.eventType & INPUT_END) {
+ return STATE_RECOGNIZED;
+ }
+ return STATE_FAILED;
+ },
+
+ reset: function() {
+ clearTimeout(this._timer);
+ },
+
+ emit: function(input) {
+ if (this.state !== STATE_RECOGNIZED) {
+ return;
+ }
+
+ if (input && (input.eventType & INPUT_END)) {
+ this.manager.emit(this.options.event + 'up', input);
+ } else {
+ this._input.timeStamp = now();
+ this.manager.emit(this.options.event, this._input);
+ }
+ }
+ });
+
+ /**
+ * Rotate
+ * Recognized when two or more pointer are moving in a circular motion.
+ * @constructor
+ * @extends AttrRecognizer
+ */
+ function RotateRecognizer() {
+ AttrRecognizer.apply(this, arguments);
+ }
+
+ inherit(RotateRecognizer, AttrRecognizer, {
+ /**
+ * @namespace
+ * @memberof RotateRecognizer
+ */
+ defaults: {
+ event: 'rotate',
+ threshold: 0,
+ pointers: 2
+ },
+
+ getTouchAction: function() {
+ return [TOUCH_ACTION_NONE];
+ },
+
+ attrTest: function(input) {
+ return this._super.attrTest.call(this, input) &&
+ (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
+ }
+ });
+
+ /**
+ * Swipe
+ * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
+ * @constructor
+ * @extends AttrRecognizer
+ */
+ function SwipeRecognizer() {
+ AttrRecognizer.apply(this, arguments);
+ }
+
+ inherit(SwipeRecognizer, AttrRecognizer, {
+ /**
+ * @namespace
+ * @memberof SwipeRecognizer
+ */
+ defaults: {
+ event: 'swipe',
+ threshold: 10,
+ velocity: 0.65,
+ direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
+ pointers: 1
+ },
+
+ getTouchAction: function() {
+ return PanRecognizer.prototype.getTouchAction.call(this);
+ },
+
+ attrTest: function(input) {
+ var direction = this.options.direction;
+ var velocity;
+
+ if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
+ velocity = input.velocity;
+ } else if (direction & DIRECTION_HORIZONTAL) {
+ velocity = input.velocityX;
+ } else if (direction & DIRECTION_VERTICAL) {
+ velocity = input.velocityY;
+ }
+
+ return this._super.attrTest.call(this, input) &&
+ direction & input.direction &&
+ input.distance > this.options.threshold &&
+ abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
+ },
+
+ emit: function(input) {
+ var direction = directionStr(input.direction);
+ if (direction) {
+ this.manager.emit(this.options.event + direction, input);
+ }
+
+ this.manager.emit(this.options.event, input);
+ }
+ });
+
+ /**
+ * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
+ * between the given interval and position. The delay option can be used to recognize multi-taps without firing
+ * a single tap.
+ *
+ * The eventData from the emitted event contains the property `tapCount`, which contains the amount of
+ * multi-taps being recognized.
+ * @constructor
+ * @extends Recognizer
+ */
+ function TapRecognizer() {
+ Recognizer.apply(this, arguments);
+
+ // previous time and center,
+ // used for tap counting
+ this.pTime = false;
+ this.pCenter = false;
+
+ this._timer = null;
+ this._input = null;
+ this.count = 0;
+ }
+
+ inherit(TapRecognizer, Recognizer, {
+ /**
+ * @namespace
+ * @memberof PinchRecognizer
+ */
+ defaults: {
+ event: 'tap',
+ pointers: 1,
+ taps: 1,
+ interval: 300, // max time between the multi-tap taps
+ time: 250, // max time of the pointer to be down (like finger on the screen)
+ threshold: 2, // a minimal movement is ok, but keep it low
+ posThreshold: 10 // a multi-tap can be a bit off the initial position
+ },
+
+ getTouchAction: function() {
+ return [TOUCH_ACTION_MANIPULATION];
+ },
+
+ process: function(input) {
+ var options = this.options;
+
+ var validPointers = input.pointers.length === options.pointers;
+ var validMovement = input.distance < options.threshold;
+ var validTouchTime = input.deltaTime < options.time;
+
+ this.reset();
+
+ if ((input.eventType & INPUT_START) && (this.count === 0)) {
+ return this.failTimeout();
+ }
+
+ // we only allow little movement
+ // and we've reached an end event, so a tap is possible
+ if (validMovement && validTouchTime && validPointers) {
+ if (input.eventType != INPUT_END) {
+ return this.failTimeout();
+ }
+
+ var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
+ var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
+
+ this.pTime = input.timeStamp;
+ this.pCenter = input.center;
+
+ if (!validMultiTap || !validInterval) {
+ this.count = 1;
+ } else {
+ this.count += 1;
+ }
+
+ this._input = input;
+
+ // if tap count matches we have recognized it,
+ // else it has began recognizing...
+ var tapCount = this.count % options.taps;
+ if (tapCount === 0) {
+ // no failing requirements, immediately trigger the tap event
+ // or wait as long as the multitap interval to trigger
+ if (!this.hasRequireFailures()) {
+ return STATE_RECOGNIZED;
+ } else {
+ this._timer = setTimeoutContext(function() {
+ this.state = STATE_RECOGNIZED;
+ this.tryEmit();
+ }, options.interval, this);
+ return STATE_BEGAN;
+ }
+ }
+ }
+ return STATE_FAILED;
+ },
+
+ failTimeout: function() {
+ this._timer = setTimeoutContext(function() {
+ this.state = STATE_FAILED;
+ }, this.options.interval, this);
+ return STATE_FAILED;
+ },
+
+ reset: function() {
+ clearTimeout(this._timer);
+ },
+
+ emit: function() {
+ if (this.state == STATE_RECOGNIZED ) {
+ this._input.tapCount = this.count;
+ this.manager.emit(this.options.event, this._input);
+ }
+ }
+ });
+
+ /**
+ * Simple way to create an manager with a default set of recognizers.
+ * @param {HTMLElement} element
+ * @param {Object} [options]
+ * @constructor
+ */
+ function Hammer(element, options) {
+ options = options || {};
+ options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
+ return new Manager(element, options);
+ }
+
+ /**
+ * @const {string}
+ */
+ Hammer.VERSION = '2.0.4';
+
+ /**
+ * default settings
+ * @namespace
+ */
+ Hammer.defaults = {
+ /**
+ * set if DOM events are being triggered.
+ * But this is slower and unused by simple implementations, so disabled by default.
+ * @type {Boolean}
+ * @default false
+ */
+ domEvents: false,
+
+ /**
+ * The value for the touchAction property/fallback.
+ * When set to `compute` it will magically set the correct value based on the added recognizers.
+ * @type {String}
+ * @default compute
+ */
+ touchAction: TOUCH_ACTION_COMPUTE,
+
+ /**
+ * @type {Boolean}
+ * @default true
+ */
+ enable: true,
+
+ /**
+ * EXPERIMENTAL FEATURE -- can be removed/changed
+ * Change the parent input target element.
+ * If Null, then it is being set the to main element.
+ * @type {Null|EventTarget}
+ * @default null
+ */
+ inputTarget: null,
+
+ /**
+ * force an input class
+ * @type {Null|Function}
+ * @default null
+ */
+ inputClass: null,
+
+ /**
+ * Default recognizer setup when calling `Hammer()`
+ * When creating a new Manager these will be skipped.
+ * @type {Array}
+ */
+ preset: [
+ // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
+ [RotateRecognizer, { enable: false }],
+ [PinchRecognizer, { enable: false }, ['rotate']],
+ [SwipeRecognizer,{ direction: DIRECTION_HORIZONTAL }],
+ [PanRecognizer, { direction: DIRECTION_HORIZONTAL }, ['swipe']],
+ [TapRecognizer],
+ [TapRecognizer, { event: 'doubletap', taps: 2 }, ['tap']],
+ [PressRecognizer]
+ ],
+
+ /**
+ * Some CSS properties can be used to improve the working of Hammer.
+ * Add them to this method and they will be set when creating a new Manager.
+ * @namespace
+ */
+ cssProps: {
+ /**
+ * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
+ * @type {String}
+ * @default 'none'
+ */
+ userSelect: 'none',
+
+ /**
+ * Disable the Windows Phone grippers when pressing an element.
+ * @type {String}
+ * @default 'none'
+ */
+ touchSelect: 'none',
+
+ /**
+ * Disables the default callout shown when you touch and hold a touch target.
+ * On iOS, when you touch and hold a touch target such as a link, Safari displays
+ * a callout containing information about the link. This property allows you to disable that callout.
+ * @type {String}
+ * @default 'none'
+ */
+ touchCallout: 'none',
+
+ /**
+ * Specifies whether zooming is enabled. Used by IE10>
+ * @type {String}
+ * @default 'none'
+ */
+ contentZooming: 'none',
+
+ /**
+ * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
+ * @type {String}
+ * @default 'none'
+ */
+ userDrag: 'none',
+
+ /**
+ * Overrides the highlight color shown when the user taps a link or a JavaScript
+ * clickable element in iOS. This property obeys the alpha value, if specified.
+ * @type {String}
+ * @default 'rgba(0,0,0,0)'
+ */
+ tapHighlightColor: 'rgba(0,0,0,0)'
+ }
+ };
+
+ var STOP = 1;
+ var FORCED_STOP = 2;
+
+ /**
+ * Manager
+ * @param {HTMLElement} element
+ * @param {Object} [options]
+ * @constructor
+ */
+ function Manager(element, options) {
+ options = options || {};
+
+ this.options = merge(options, Hammer.defaults);
+ this.options.inputTarget = this.options.inputTarget || element;
+
+ this.handlers = {};
+ this.session = {};
+ this.recognizers = [];
+
+ this.element = element;
+ this.input = createInputInstance(this);
+ this.touchAction = new TouchAction(this, this.options.touchAction);
+
+ toggleCssProps(this, true);
+
+ each(options.recognizers, function(item) {
+ var recognizer = this.add(new (item[0])(item[1]));
+ item[2] && recognizer.recognizeWith(item[2]);
+ item[3] && recognizer.requireFailure(item[3]);
+ }, this);
+ }
+
+ Manager.prototype = {
+ /**
+ * set options
+ * @param {Object} options
+ * @returns {Manager}
+ */
+ set: function(options) {
+ extend(this.options, options);
+
+ // Options that need a little more setup
+ if (options.touchAction) {
+ this.touchAction.update();
+ }
+ if (options.inputTarget) {
+ // Clean up existing event listeners and reinitialize
+ this.input.destroy();
+ this.input.target = options.inputTarget;
+ this.input.init();
+ }
+ return this;
+ },
+
+ /**
+ * stop recognizing for this session.
+ * This session will be discarded, when a new [input]start event is fired.
+ * When forced, the recognizer cycle is stopped immediately.
+ * @param {Boolean} [force]
+ */
+ stop: function(force) {
+ this.session.stopped = force ? FORCED_STOP : STOP;
+ },
+
+ /**
+ * run the recognizers!
+ * called by the inputHandler function on every movement of the pointers (touches)
+ * it walks through all the recognizers and tries to detect the gesture that is being made
+ * @param {Object} inputData
+ */
+ recognize: function(inputData) {
+ var session = this.session;
+ if (session.stopped) {
+ return;
+ }
+
+ // run the touch-action polyfill
+ this.touchAction.preventDefaults(inputData);
+
+ var recognizer;
+ var recognizers = this.recognizers;
+
+ // this holds the recognizer that is being recognized.
+ // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED
+ // if no recognizer is detecting a thing, it is set to `null`
+ var curRecognizer = session.curRecognizer;
+
+ // reset when the last recognizer is recognized
+ // or when we're in a new session
+ if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {
+ curRecognizer = session.curRecognizer = null;
+ }
+
+ var i = 0;
+ while (i < recognizers.length) {
+ recognizer = recognizers[i];
+
+ // find out if we are allowed try to recognize the input for this one.
+ // 1. allow if the session is NOT forced stopped (see the .stop() method)
+ // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one
+ // that is being recognized.
+ // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.
+ // this can be setup with the `recognizeWith()` method on the recognizer.
+ if (session.stopped !== FORCED_STOP && ( // 1
+ !curRecognizer || recognizer == curRecognizer || // 2
+ recognizer.canRecognizeWith(curRecognizer))) { // 3
+ recognizer.recognize(inputData);
+ } else {
+ recognizer.reset();
+ }
+
+ // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the
+ // current active recognizer. but only if we don't already have an active recognizer
+ if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
+ curRecognizer = session.curRecognizer = recognizer;
+ }
+ i++;
+ }
+ },
+
+ /**
+ * get a recognizer by its event name.
+ * @param {Recognizer|String} recognizer
+ * @returns {Recognizer|Null}
+ */
+ get: function(recognizer) {
+ if (recognizer instanceof Recognizer) {
+ return recognizer;
+ }
+
+ var recognizers = this.recognizers;
+ for (var i = 0; i < recognizers.length; i++) {
+ if (recognizers[i].options.event == recognizer) {
+ return recognizers[i];
+ }
+ }
+ return null;
+ },
+
+ /**
+ * add a recognizer to the manager
+ * existing recognizers with the same event name will be removed
+ * @param {Recognizer} recognizer
+ * @returns {Recognizer|Manager}
+ */
+ add: function(recognizer) {
+ if (invokeArrayArg(recognizer, 'add', this)) {
+ return this;
+ }
+
+ // remove existing
+ var existing = this.get(recognizer.options.event);
+ if (existing) {
+ this.remove(existing);
+ }
+
+ this.recognizers.push(recognizer);
+ recognizer.manager = this;
+
+ this.touchAction.update();
+ return recognizer;
+ },
+
+ /**
+ * remove a recognizer by name or instance
+ * @param {Recognizer|String} recognizer
+ * @returns {Manager}
+ */
+ remove: function(recognizer) {
+ if (invokeArrayArg(recognizer, 'remove', this)) {
+ return this;
+ }
+
+ var recognizers = this.recognizers;
+ recognizer = this.get(recognizer);
+ recognizers.splice(inArray(recognizers, recognizer), 1);
+
+ this.touchAction.update();
+ return this;
+ },
+
+ /**
+ * bind event
+ * @param {String} events
+ * @param {Function} handler
+ * @returns {EventEmitter} this
+ */
+ on: function(events, handler) {
+ var handlers = this.handlers;
+ each(splitStr(events), function(event) {
+ handlers[event] = handlers[event] || [];
+ handlers[event].push(handler);
+ });
+ return this;
+ },
+
+ /**
+ * unbind event, leave emit blank to remove all handlers
+ * @param {String} events
+ * @param {Function} [handler]
+ * @returns {EventEmitter} this
+ */
+ off: function(events, handler) {
+ var handlers = this.handlers;
+ each(splitStr(events), function(event) {
+ if (!handler) {
+ delete handlers[event];
+ } else {
+ handlers[event].splice(inArray(handlers[event], handler), 1);
+ }
+ });
+ return this;
+ },
+
+ /**
+ * emit event to the listeners
+ * @param {String} event
+ * @param {Object} data
+ */
+ emit: function(event, data) {
+ // we also want to trigger dom events
+ if (this.options.domEvents) {
+ triggerDomEvent(event, data);
+ }
+
+ // no handlers, so skip it all
+ var handlers = this.handlers[event] && this.handlers[event].slice();
+ if (!handlers || !handlers.length) {
+ return;
+ }
+
+ data.type = event;
+ data.preventDefault = function() {
+ data.srcEvent.preventDefault();
+ };
+
+ var i = 0;
+ while (i < handlers.length) {
+ handlers[i](data);
+ i++;
+ }
+ },
+
+ /**
+ * destroy the manager and unbinds all events
+ * it doesn't unbind dom events, that is the user own responsibility
+ */
+ destroy: function() {
+ this.element && toggleCssProps(this, false);
+
+ this.handlers = {};
+ this.session = {};
+ this.input.destroy();
+ this.element = null;
+ }
+ };
+
+ /**
+ * add/remove the css properties as defined in manager.options.cssProps
+ * @param {Manager} manager
+ * @param {Boolean} add
+ */
+ function toggleCssProps(manager, add) {
+ var element = manager.element;
+ each(manager.options.cssProps, function(value, name) {
+ element.style[prefixed(element.style, name)] = add ? value : '';
+ });
+ }
+
+ /**
+ * trigger dom event
+ * @param {String} event
+ * @param {Object} data
+ */
+ function triggerDomEvent(event, data) {
+ var gestureEvent = document.createEvent('Event');
+ gestureEvent.initEvent(event, true, true);
+ gestureEvent.gesture = data;
+ data.target.dispatchEvent(gestureEvent);
+ }
+
+ extend(Hammer, {
+ INPUT_START: INPUT_START,
+ INPUT_MOVE: INPUT_MOVE,
+ INPUT_END: INPUT_END,
+ INPUT_CANCEL: INPUT_CANCEL,
+
+ STATE_POSSIBLE: STATE_POSSIBLE,
+ STATE_BEGAN: STATE_BEGAN,
+ STATE_CHANGED: STATE_CHANGED,
+ STATE_ENDED: STATE_ENDED,
+ STATE_RECOGNIZED: STATE_RECOGNIZED,
+ STATE_CANCELLED: STATE_CANCELLED,
+ STATE_FAILED: STATE_FAILED,
+
+ DIRECTION_NONE: DIRECTION_NONE,
+ DIRECTION_LEFT: DIRECTION_LEFT,
+ DIRECTION_RIGHT: DIRECTION_RIGHT,
+ DIRECTION_UP: DIRECTION_UP,
+ DIRECTION_DOWN: DIRECTION_DOWN,
+ DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
+ DIRECTION_VERTICAL: DIRECTION_VERTICAL,
+ DIRECTION_ALL: DIRECTION_ALL,
+
+ Manager: Manager,
+ Input: Input,
+ TouchAction: TouchAction,
+
+ TouchInput: TouchInput,
+ MouseInput: MouseInput,
+ PointerEventInput: PointerEventInput,
+ TouchMouseInput: TouchMouseInput,
+ SingleTouchInput: SingleTouchInput,
+
+ Recognizer: Recognizer,
+ AttrRecognizer: AttrRecognizer,
+ Tap: TapRecognizer,
+ Pan: PanRecognizer,
+ Swipe: SwipeRecognizer,
+ Pinch: PinchRecognizer,
+ Rotate: RotateRecognizer,
+ Press: PressRecognizer,
+
+ on: addEventListeners,
+ off: removeEventListeners,
+ each: each,
+ merge: merge,
+ extend: extend,
+ inherit: inherit,
+ bindFn: bindFn,
+ prefixed: prefixed
+ });
+
+ if ("function" == TYPE_FUNCTION && __webpack_require__(23)) {
+ !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
+ return Hammer;
+ }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
+ } else if (typeof module != 'undefined' && module.exports) {
+ module.exports = Hammer;
+ } else {
+ window[exportName] = Hammer;
+ }
+
+ })(window, document, 'Hammer');
+
+
+/***/ },
+/* 23 */
+/***/ function(module, exports) {
+
+ /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {module.exports = __webpack_amd_options__;
+
+ /* WEBPACK VAR INJECTION */}.call(exports, {}))
+
+/***/ },
+/* 24 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var hammerUtil = __webpack_require__(25);
+ var moment = __webpack_require__(2);
+ var Component = __webpack_require__(26);
+ var DateUtil = __webpack_require__(27);
+
+ /**
+ * @constructor Range
+ * A Range controls a numeric range with a start and end value.
+ * The Range adjusts the range based on mouse events or programmatic changes,
+ * and triggers events when the range is changing or has been changed.
+ * @param {{dom: Object, domProps: Object, emitter: Emitter}} body
+ * @param {Object} [options] See description at Range.setOptions
+ */
+ function Range(body, options) {
+ var now = moment().hours(0).minutes(0).seconds(0).milliseconds(0);
+ this.start = now.clone().add(-3, 'days').valueOf(); // Number
+ this.end = now.clone().add(4, 'days').valueOf(); // Number
+
+ this.body = body;
+ this.deltaDifference = 0;
+ this.scaleOffset = 0;
+ this.startToFront = false;
+ this.endToFront = true;
+
+ // default options
+ this.defaultOptions = {
+ start: null,
+ end: null,
+ moment: moment,
+ direction: 'horizontal', // 'horizontal' or 'vertical'
+ moveable: true,
+ zoomable: true,
+ min: null,
+ max: null,
+ zoomMin: 10, // milliseconds
+ zoomMax: 1000 * 60 * 60 * 24 * 365 * 10000 // milliseconds
+ };
+ this.options = util.extend({}, this.defaultOptions);
+
+ this.props = {
+ touch: {}
+ };
+ this.animationTimer = null;
+
+ // drag listeners for dragging
+ this.body.emitter.on('panstart', this._onDragStart.bind(this));
+ this.body.emitter.on('panmove', this._onDrag.bind(this));
+ this.body.emitter.on('panend', this._onDragEnd.bind(this));
+
+ // mouse wheel for zooming
+ this.body.emitter.on('mousewheel', this._onMouseWheel.bind(this));
+
+ // pinch to zoom
+ this.body.emitter.on('touch', this._onTouch.bind(this));
+ this.body.emitter.on('pinch', this._onPinch.bind(this));
+
+ this.setOptions(options);
+ }
+
+ Range.prototype = new Component();
+
+ /**
+ * Set options for the range controller
+ * @param {Object} options Available options:
+ * {Number | Date | String} start Start date for the range
+ * {Number | Date | String} end End date for the range
+ * {Number} min Minimum value for start
+ * {Number} max Maximum value for end
+ * {Number} zoomMin Set a minimum value for
+ * (end - start).
+ * {Number} zoomMax Set a maximum value for
+ * (end - start).
+ * {Boolean} moveable Enable moving of the range
+ * by dragging. True by default
+ * {Boolean} zoomable Enable zooming of the range
+ * by pinching/scrolling. True by default
+ */
+ Range.prototype.setOptions = function (options) {
+ if (options) {
+ // copy the options that we know
+ var fields = ['direction', 'min', 'max', 'zoomMin', 'zoomMax', 'moveable', 'zoomable', 'moment', 'activate', 'hiddenDates', 'zoomKey'];
+ util.selectiveExtend(fields, this.options, options);
+
+ if ('start' in options || 'end' in options) {
+ // apply a new range. both start and end are optional
+ this.setRange(options.start, options.end);
+ }
+ }
+ };
+
+ /**
+ * Test whether direction has a valid value
+ * @param {String} direction 'horizontal' or 'vertical'
+ */
+ function validateDirection(direction) {
+ if (direction != 'horizontal' && direction != 'vertical') {
+ throw new TypeError('Unknown direction "' + direction + '". ' + 'Choose "horizontal" or "vertical".');
+ }
+ }
+
+ /**
+ * Set a new start and end range
+ * @param {Date | Number | String} [start]
+ * @param {Date | Number | String} [end]
+ * @param {boolean | {duration: number, easingFunction: string}} [animation=false]
+ * If true (default), the range is animated
+ * smoothly to the new window. An object can be
+ * provided to specify duration and easing function.
+ * Default duration is 500 ms, and default easing
+ * function is 'easeInOutQuad'.
+ * @param {Boolean} [byUser=false]
+ *
+ */
+ Range.prototype.setRange = function (start, end, animation, byUser) {
+ if (byUser !== true) {
+ byUser = false;
+ }
+ var finalStart = start != undefined ? util.convert(start, 'Date').valueOf() : null;
+ var finalEnd = end != undefined ? util.convert(end, 'Date').valueOf() : null;
+ this._cancelAnimation();
+
+ if (animation) {
+ // true or an Object
+ var me = this;
+ var initStart = this.start;
+ var initEnd = this.end;
+ var duration = typeof animation === 'object' && 'duration' in animation ? animation.duration : 500;
+ var easingName = typeof animation === 'object' && 'easingFunction' in animation ? animation.easingFunction : 'easeInOutQuad';
+ var easingFunction = util.easingFunctions[easingName];
+ if (!easingFunction) {
+ throw new Error('Unknown easing function ' + JSON.stringify(easingName) + '. ' + 'Choose from: ' + Object.keys(util.easingFunctions).join(', '));
+ }
+
+ var initTime = new Date().valueOf();
+ var anyChanged = false;
+
+ var next = function next() {
+ if (!me.props.touch.dragging) {
+ var now = new Date().valueOf();
+ var time = now - initTime;
+ var ease = easingFunction(time / duration);
+ var done = time > duration;
+ var s = done || finalStart === null ? finalStart : initStart + (finalStart - initStart) * ease;
+ var e = done || finalEnd === null ? finalEnd : initEnd + (finalEnd - initEnd) * ease;
+
+ changed = me._applyRange(s, e);
+ DateUtil.updateHiddenDates(me.options.moment, me.body, me.options.hiddenDates);
+ anyChanged = anyChanged || changed;
+ if (changed) {
+ me.body.emitter.emit('rangechange', { start: new Date(me.start), end: new Date(me.end), byUser: byUser });
+ }
+
+ if (done) {
+ if (anyChanged) {
+ me.body.emitter.emit('rangechanged', { start: new Date(me.start), end: new Date(me.end), byUser: byUser });
+ }
+ } else {
+ // animate with as high as possible frame rate, leave 20 ms in between
+ // each to prevent the browser from blocking
+ me.animationTimer = setTimeout(next, 20);
+ }
+ }
+ };
+
+ return next();
+ } else {
+ var changed = this._applyRange(finalStart, finalEnd);
+ DateUtil.updateHiddenDates(this.options.moment, this.body, this.options.hiddenDates);
+ if (changed) {
+ var params = { start: new Date(this.start), end: new Date(this.end), byUser: byUser };
+ this.body.emitter.emit('rangechange', params);
+ this.body.emitter.emit('rangechanged', params);
+ }
+ }
+ };
+
+ /**
+ * Stop an animation
+ * @private
+ */
+ Range.prototype._cancelAnimation = function () {
+ if (this.animationTimer) {
+ clearTimeout(this.animationTimer);
+ this.animationTimer = null;
+ }
+ };
+
+ /**
+ * Set a new start and end range. This method is the same as setRange, but
+ * does not trigger a range change and range changed event, and it returns
+ * true when the range is changed
+ * @param {Number} [start]
+ * @param {Number} [end]
+ * @return {Boolean} changed
+ * @private
+ */
+ Range.prototype._applyRange = function (start, end) {
+ var newStart = start != null ? util.convert(start, 'Date').valueOf() : this.start,
+ newEnd = end != null ? util.convert(end, 'Date').valueOf() : this.end,
+ max = this.options.max != null ? util.convert(this.options.max, 'Date').valueOf() : null,
+ min = this.options.min != null ? util.convert(this.options.min, 'Date').valueOf() : null,
+ diff;
+
+ // check for valid number
+ if (isNaN(newStart) || newStart === null) {
+ throw new Error('Invalid start "' + start + '"');
+ }
+ if (isNaN(newEnd) || newEnd === null) {
+ throw new Error('Invalid end "' + end + '"');
+ }
+
+ // prevent start < end
+ if (newEnd < newStart) {
+ newEnd = newStart;
+ }
+
+ // prevent start < min
+ if (min !== null) {
+ if (newStart < min) {
+ diff = min - newStart;
+ newStart += diff;
+ newEnd += diff;
+
+ // prevent end > max
+ if (max != null) {
+ if (newEnd > max) {
+ newEnd = max;
+ }
+ }
+ }
+ }
+
+ // prevent end > max
+ if (max !== null) {
+ if (newEnd > max) {
+ diff = newEnd - max;
+ newStart -= diff;
+ newEnd -= diff;
+
+ // prevent start < min
+ if (min != null) {
+ if (newStart < min) {
+ newStart = min;
+ }
+ }
+ }
+ }
+
+ // prevent (end-start) < zoomMin
+ if (this.options.zoomMin !== null) {
+ var zoomMin = parseFloat(this.options.zoomMin);
+ if (zoomMin < 0) {
+ zoomMin = 0;
+ }
+ if (newEnd - newStart < zoomMin) {
+ if (this.end - this.start === zoomMin && newStart > this.start && newEnd < this.end) {
+ // ignore this action, we are already zoomed to the minimum
+ newStart = this.start;
+ newEnd = this.end;
+ } else {
+ // zoom to the minimum
+ diff = zoomMin - (newEnd - newStart);
+ newStart -= diff / 2;
+ newEnd += diff / 2;
+ }
+ }
+ }
+
+ // prevent (end-start) > zoomMax
+ if (this.options.zoomMax !== null) {
+ var zoomMax = parseFloat(this.options.zoomMax);
+ if (zoomMax < 0) {
+ zoomMax = 0;
+ }
+
+ if (newEnd - newStart > zoomMax) {
+ if (this.end - this.start === zoomMax && newStart < this.start && newEnd > this.end) {
+ // ignore this action, we are already zoomed to the maximum
+ newStart = this.start;
+ newEnd = this.end;
+ } else {
+ // zoom to the maximum
+ diff = newEnd - newStart - zoomMax;
+ newStart += diff / 2;
+ newEnd -= diff / 2;
+ }
+ }
+ }
+
+ var changed = this.start != newStart || this.end != newEnd;
+
+ // if the new range does NOT overlap with the old range, emit checkRangedItems to avoid not showing ranged items (ranged meaning has end time, not necessarily of type Range)
+ if (!(newStart >= this.start && newStart <= this.end || newEnd >= this.start && newEnd <= this.end) && !(this.start >= newStart && this.start <= newEnd || this.end >= newStart && this.end <= newEnd)) {
+ this.body.emitter.emit('checkRangedItems');
+ }
+
+ this.start = newStart;
+ this.end = newEnd;
+ return changed;
+ };
+
+ /**
+ * Retrieve the current range.
+ * @return {Object} An object with start and end properties
+ */
+ Range.prototype.getRange = function () {
+ return {
+ start: this.start,
+ end: this.end
+ };
+ };
+
+ /**
+ * Calculate the conversion offset and scale for current range, based on
+ * the provided width
+ * @param {Number} width
+ * @returns {{offset: number, scale: number}} conversion
+ */
+ Range.prototype.conversion = function (width, totalHidden) {
+ return Range.conversion(this.start, this.end, width, totalHidden);
+ };
+
+ /**
+ * Static method to calculate the conversion offset and scale for a range,
+ * based on the provided start, end, and width
+ * @param {Number} start
+ * @param {Number} end
+ * @param {Number} width
+ * @returns {{offset: number, scale: number}} conversion
+ */
+ Range.conversion = function (start, end, width, totalHidden) {
+ if (totalHidden === undefined) {
+ totalHidden = 0;
+ }
+ if (width != 0 && end - start != 0) {
+ return {
+ offset: start,
+ scale: width / (end - start - totalHidden)
+ };
+ } else {
+ return {
+ offset: 0,
+ scale: 1
+ };
+ }
+ };
+
+ /**
+ * Start dragging horizontally or vertically
+ * @param {Event} event
+ * @private
+ */
+ Range.prototype._onDragStart = function (event) {
+ this.deltaDifference = 0;
+ this.previousDelta = 0;
+
+ // only allow dragging when configured as movable
+ if (!this.options.moveable) return;
+
+ // only start dragging when the mouse is inside the current range
+ if (!this._isInsideRange(event)) return;
+
+ // refuse to drag when we where pinching to prevent the timeline make a jump
+ // when releasing the fingers in opposite order from the touch screen
+ if (!this.props.touch.allowDragging) return;
+
+ this.props.touch.start = this.start;
+ this.props.touch.end = this.end;
+ this.props.touch.dragging = true;
+
+ if (this.body.dom.root) {
+ this.body.dom.root.style.cursor = 'move';
+ }
+ };
+
+ /**
+ * Perform dragging operation
+ * @param {Event} event
+ * @private
+ */
+ Range.prototype._onDrag = function (event) {
+ if (!this.props.touch.dragging) return;
+
+ // only allow dragging when configured as movable
+ if (!this.options.moveable) return;
+
+ // TODO: this may be redundant in hammerjs2
+ // refuse to drag when we where pinching to prevent the timeline make a jump
+ // when releasing the fingers in opposite order from the touch screen
+ if (!this.props.touch.allowDragging) return;
+
+ var direction = this.options.direction;
+ validateDirection(direction);
+ var delta = direction == 'horizontal' ? event.deltaX : event.deltaY;
+ delta -= this.deltaDifference;
+ var interval = this.props.touch.end - this.props.touch.start;
+
+ // normalize dragging speed if cutout is in between.
+ var duration = DateUtil.getHiddenDurationBetween(this.body.hiddenDates, this.start, this.end);
+ interval -= duration;
+
+ var width = direction == 'horizontal' ? this.body.domProps.center.width : this.body.domProps.center.height;
+ var diffRange = -delta / width * interval;
+ var newStart = this.props.touch.start + diffRange;
+ var newEnd = this.props.touch.end + diffRange;
+
+ // snapping times away from hidden zones
+ var safeStart = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newStart, this.previousDelta - delta, true);
+ var safeEnd = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newEnd, this.previousDelta - delta, true);
+ if (safeStart != newStart || safeEnd != newEnd) {
+ this.deltaDifference += delta;
+ this.props.touch.start = safeStart;
+ this.props.touch.end = safeEnd;
+ this._onDrag(event);
+ return;
+ }
+
+ this.previousDelta = delta;
+ this._applyRange(newStart, newEnd);
+
+ // fire a rangechange event
+ this.body.emitter.emit('rangechange', {
+ start: new Date(this.start),
+ end: new Date(this.end),
+ byUser: true
+ });
+ };
+
+ /**
+ * Stop dragging operation
+ * @param {event} event
+ * @private
+ */
+ Range.prototype._onDragEnd = function (event) {
+ if (!this.props.touch.dragging) return;
+
+ // only allow dragging when configured as movable
+ if (!this.options.moveable) return;
+
+ // TODO: this may be redundant in hammerjs2
+ // refuse to drag when we where pinching to prevent the timeline make a jump
+ // when releasing the fingers in opposite order from the touch screen
+ if (!this.props.touch.allowDragging) return;
+
+ this.props.touch.dragging = false;
+ if (this.body.dom.root) {
+ this.body.dom.root.style.cursor = 'auto';
+ }
+
+ // fire a rangechanged event
+ this.body.emitter.emit('rangechanged', {
+ start: new Date(this.start),
+ end: new Date(this.end),
+ byUser: true
+ });
+ };
+
+ /**
+ * Event handler for mouse wheel event, used to zoom
+ * Code from http://adomas.org/javascript-mouse-wheel/
+ * @param {Event} event
+ * @private
+ */
+ Range.prototype._onMouseWheel = function (event) {
+ // only allow zooming when configured as zoomable and moveable
+ if (!(this.options.zoomable && this.options.moveable)) return;
+
+ // only zoom when the mouse is inside the current range
+ if (!this._isInsideRange(event)) return;
+
+ // only zoom when the according key is pressed and the zoomKey option is set
+ if (this.options.zoomKey && !event[this.options.zoomKey]) return;
+
+ // retrieve delta
+ var delta = 0;
+ if (event.wheelDelta) {
+ /* IE/Opera. */
+ delta = event.wheelDelta / 120;
+ } else if (event.detail) {
+ /* Mozilla case. */
+ // In Mozilla, sign of delta is different than in IE.
+ // Also, delta is multiple of 3.
+ delta = -event.detail / 3;
+ }
+
+ // If delta is nonzero, handle it.
+ // Basically, delta is now positive if wheel was scrolled up,
+ // and negative, if wheel was scrolled down.
+ if (delta) {
+ // perform the zoom action. Delta is normally 1 or -1
+
+ // adjust a negative delta such that zooming in with delta 0.1
+ // equals zooming out with a delta -0.1
+ var scale;
+ if (delta < 0) {
+ scale = 1 - delta / 5;
+ } else {
+ scale = 1 / (1 + delta / 5);
+ }
+
+ // calculate center, the date to zoom around
+ var pointer = getPointer({ x: event.clientX, y: event.clientY }, this.body.dom.center);
+ var pointerDate = this._pointerToDate(pointer);
+
+ this.zoom(scale, pointerDate, delta);
+ }
+
+ // Prevent default actions caused by mouse wheel
+ // (else the page and timeline both zoom and scroll)
+ event.preventDefault();
+ };
+
+ /**
+ * Start of a touch gesture
+ * @private
+ */
+ Range.prototype._onTouch = function (event) {
+ this.props.touch.start = this.start;
+ this.props.touch.end = this.end;
+ this.props.touch.allowDragging = true;
+ this.props.touch.center = null;
+ this.scaleOffset = 0;
+ this.deltaDifference = 0;
+ };
+
+ /**
+ * Handle pinch event
+ * @param {Event} event
+ * @private
+ */
+ Range.prototype._onPinch = function (event) {
+ // only allow zooming when configured as zoomable and moveable
+ if (!(this.options.zoomable && this.options.moveable)) return;
+
+ this.props.touch.allowDragging = false;
+
+ if (!this.props.touch.center) {
+ this.props.touch.center = getPointer(event.center, this.body.dom.center);
+ }
+
+ var scale = 1 / (event.scale + this.scaleOffset);
+ var centerDate = this._pointerToDate(this.props.touch.center);
+
+ var hiddenDuration = DateUtil.getHiddenDurationBetween(this.body.hiddenDates, this.start, this.end);
+ var hiddenDurationBefore = DateUtil.getHiddenDurationBefore(this.options.moment, this.body.hiddenDates, this, centerDate);
+ var hiddenDurationAfter = hiddenDuration - hiddenDurationBefore;
+
+ // calculate new start and end
+ var newStart = centerDate - hiddenDurationBefore + (this.props.touch.start - (centerDate - hiddenDurationBefore)) * scale;
+ var newEnd = centerDate + hiddenDurationAfter + (this.props.touch.end - (centerDate + hiddenDurationAfter)) * scale;
+
+ // snapping times away from hidden zones
+ this.startToFront = 1 - scale <= 0; // used to do the right auto correction with periodic hidden times
+ this.endToFront = scale - 1 <= 0; // used to do the right auto correction with periodic hidden times
+
+ var safeStart = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newStart, 1 - scale, true);
+ var safeEnd = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newEnd, scale - 1, true);
+ if (safeStart != newStart || safeEnd != newEnd) {
+ this.props.touch.start = safeStart;
+ this.props.touch.end = safeEnd;
+ this.scaleOffset = 1 - event.scale;
+ newStart = safeStart;
+ newEnd = safeEnd;
+ }
+
+ this.setRange(newStart, newEnd, false, true);
+
+ this.startToFront = false; // revert to default
+ this.endToFront = true; // revert to default
+ };
+
+ /**
+ * Test whether the mouse from a mouse event is inside the visible window,
+ * between the current start and end date
+ * @param {Object} event
+ * @return {boolean} Returns true when inside the visible window
+ * @private
+ */
+ Range.prototype._isInsideRange = function (event) {
+ // calculate the time where the mouse is, check whether inside
+ // and no scroll action should happen.
+ var clientX = event.center ? event.center.x : event.clientX;
+ var x = clientX - util.getAbsoluteLeft(this.body.dom.centerContainer);
+ var time = this.body.util.toTime(x);
+
+ return time >= this.start && time <= this.end;
+ };
+
+ /**
+ * Helper function to calculate the center date for zooming
+ * @param {{x: Number, y: Number}} pointer
+ * @return {number} date
+ * @private
+ */
+ Range.prototype._pointerToDate = function (pointer) {
+ var conversion;
+ var direction = this.options.direction;
+
+ validateDirection(direction);
+
+ if (direction == 'horizontal') {
+ return this.body.util.toTime(pointer.x).valueOf();
+ } else {
+ var height = this.body.domProps.center.height;
+ conversion = this.conversion(height);
+ return pointer.y / conversion.scale + conversion.offset;
+ }
+ };
+
+ /**
+ * Get the pointer location relative to the location of the dom element
+ * @param {{x: Number, y: Number}} touch
+ * @param {Element} element HTML DOM element
+ * @return {{x: Number, y: Number}} pointer
+ * @private
+ */
+ function getPointer(touch, element) {
+ return {
+ x: touch.x - util.getAbsoluteLeft(element),
+ y: touch.y - util.getAbsoluteTop(element)
+ };
+ }
+
+ /**
+ * Zoom the range the given scale in or out. Start and end date will
+ * be adjusted, and the timeline will be redrawn. You can optionally give a
+ * date around which to zoom.
+ * For example, try scale = 0.9 or 1.1
+ * @param {Number} scale Scaling factor. Values above 1 will zoom out,
+ * values below 1 will zoom in.
+ * @param {Number} [center] Value representing a date around which will
+ * be zoomed.
+ */
+ Range.prototype.zoom = function (scale, center, delta) {
+ // if centerDate is not provided, take it half between start Date and end Date
+ if (center == null) {
+ center = (this.start + this.end) / 2;
+ }
+
+ var hiddenDuration = DateUtil.getHiddenDurationBetween(this.body.hiddenDates, this.start, this.end);
+ var hiddenDurationBefore = DateUtil.getHiddenDurationBefore(this.options.moment, this.body.hiddenDates, this, center);
+ var hiddenDurationAfter = hiddenDuration - hiddenDurationBefore;
+
+ // calculate new start and end
+ var newStart = center - hiddenDurationBefore + (this.start - (center - hiddenDurationBefore)) * scale;
+ var newEnd = center + hiddenDurationAfter + (this.end - (center + hiddenDurationAfter)) * scale;
+
+ // snapping times away from hidden zones
+ this.startToFront = delta > 0 ? false : true; // used to do the right autocorrection with periodic hidden times
+ this.endToFront = -delta > 0 ? false : true; // used to do the right autocorrection with periodic hidden times
+ var safeStart = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newStart, delta, true);
+ var safeEnd = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newEnd, -delta, true);
+ if (safeStart != newStart || safeEnd != newEnd) {
+ newStart = safeStart;
+ newEnd = safeEnd;
+ }
+
+ this.setRange(newStart, newEnd, false, true);
+
+ this.startToFront = false; // revert to default
+ this.endToFront = true; // revert to default
+ };
+
+ /**
+ * Move the range with a given delta to the left or right. Start and end
+ * value will be adjusted. For example, try delta = 0.1 or -0.1
+ * @param {Number} delta Moving amount. Positive value will move right,
+ * negative value will move left
+ */
+ Range.prototype.move = function (delta) {
+ // zoom start Date and end Date relative to the centerDate
+ var diff = this.end - this.start;
+
+ // apply new values
+ var newStart = this.start + diff * delta;
+ var newEnd = this.end + diff * delta;
+
+ // TODO: reckon with min and max range
+
+ this.start = newStart;
+ this.end = newEnd;
+ };
+
+ /**
+ * Move the range to a new center point
+ * @param {Number} moveTo New center point of the range
+ */
+ Range.prototype.moveTo = function (moveTo) {
+ var center = (this.start + this.end) / 2;
+
+ var diff = center - moveTo;
+
+ // calculate new start and end
+ var newStart = this.start - diff;
+ var newEnd = this.end - diff;
+
+ this.setRange(newStart, newEnd);
+ };
+
+ module.exports = Range;
+
+/***/ },
+/* 25 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Hammer = __webpack_require__(20);
+
+ /**
+ * Register a touch event, taking place before a gesture
+ * @param {Hammer} hammer A hammer instance
+ * @param {function} callback Callback, called as callback(event)
+ */
+ exports.onTouch = function (hammer, callback) {
+ callback.inputHandler = function (event) {
+ if (event.isFirst && !isTouching) {
+ callback(event);
+
+ isTouching = true;
+ setTimeout(function () {
+ isTouching = false;
+ }, 0);
+ }
+ };
+
+ hammer.on('hammer.input', callback.inputHandler);
+ };
+
+ // isTouching is true while a touch action is being emitted
+ // this is a hack to prevent `touch` from being fired twice
+ var isTouching = false;
+
+ /**
+ * Register a release event, taking place after a gesture
+ * @param {Hammer} hammer A hammer instance
+ * @param {function} callback Callback, called as callback(event)
+ */
+ exports.onRelease = function (hammer, callback) {
+ callback.inputHandler = function (event) {
+ if (event.isFinal && !isReleasing) {
+ callback(event);
+
+ isReleasing = true;
+ setTimeout(function () {
+ isReleasing = false;
+ }, 0);
+ }
+ };
+
+ return hammer.on('hammer.input', callback.inputHandler);
+ };
+
+ // isReleasing is true while a release action is being emitted
+ // this is a hack to prevent `release` from being fired twice
+ var isReleasing = false;
+
+ /**
+ * Unregister a touch event, taking place before a gesture
+ * @param {Hammer} hammer A hammer instance
+ * @param {function} callback Callback, called as callback(event)
+ */
+ exports.offTouch = function (hammer, callback) {
+ hammer.off('hammer.input', callback.inputHandler);
+ };
+
+ /**
+ * Unregister a release event, taking place before a gesture
+ * @param {Hammer} hammer A hammer instance
+ * @param {function} callback Callback, called as callback(event)
+ */
+ exports.offRelease = exports.offTouch;
+
+/***/ },
+/* 26 */
+/***/ function(module, exports) {
+
+ /**
+ * Prototype for visual components
+ * @param {{dom: Object, domProps: Object, emitter: Emitter, range: Range}} [body]
+ * @param {Object} [options]
+ */
+ "use strict";
+
+ function Component(body, options) {
+ this.options = null;
+ this.props = null;
+ }
+
+ /**
+ * Set options for the component. The new options will be merged into the
+ * current options.
+ * @param {Object} options
+ */
+ Component.prototype.setOptions = function (options) {
+ if (options) {
+ util.extend(this.options, options);
+ }
+ };
+
+ /**
+ * Repaint the component
+ * @return {boolean} Returns true if the component is resized
+ */
+ Component.prototype.redraw = function () {
+ // should be implemented by the component
+ return false;
+ };
+
+ /**
+ * Destroy the component. Cleanup DOM and event listeners
+ */
+ Component.prototype.destroy = function () {};
+
+ /**
+ * Test whether the component is resized since the last time _isResized() was
+ * called.
+ * @return {Boolean} Returns true if the component is resized
+ * @protected
+ */
+ Component.prototype._isResized = function () {
+ var resized = this.props._previousWidth !== this.props.width || this.props._previousHeight !== this.props.height;
+
+ this.props._previousWidth = this.props.width;
+ this.props._previousHeight = this.props.height;
+
+ return resized;
+ };
+
+ module.exports = Component;
+
+ // should be implemented by the component
+
+/***/ },
+/* 27 */
+/***/ function(module, exports) {
+
+
+ /**
+ * used in Core to convert the options into a volatile variable
+ *
+ * @param {function} moment
+ * @param {Object} body
+ * @param {Array | Object} hiddenDates
+ */
+ "use strict";
+
+ exports.convertHiddenOptions = function (moment, body, hiddenDates) {
+ if (hiddenDates && !Array.isArray(hiddenDates)) {
+ return exports.convertHiddenOptions(moment, body, [hiddenDates]);
+ }
+
+ body.hiddenDates = [];
+ if (hiddenDates) {
+ if (Array.isArray(hiddenDates) == true) {
+ for (var i = 0; i < hiddenDates.length; i++) {
+ if (hiddenDates[i].repeat === undefined) {
+ var dateItem = {};
+ dateItem.start = moment(hiddenDates[i].start).toDate().valueOf();
+ dateItem.end = moment(hiddenDates[i].end).toDate().valueOf();
+ body.hiddenDates.push(dateItem);
+ }
+ }
+ body.hiddenDates.sort(function (a, b) {
+ return a.start - b.start;
+ }); // sort by start time
+ }
+ }
+ };
+
+ /**
+ * create new entrees for the repeating hidden dates
+ * @param {function} moment
+ * @param {Object} body
+ * @param {Array | Object} hiddenDates
+ */
+ exports.updateHiddenDates = function (moment, body, hiddenDates) {
+ if (hiddenDates && !Array.isArray(hiddenDates)) {
+ return exports.updateHiddenDates(moment, body, [hiddenDates]);
+ }
+
+ if (hiddenDates && body.domProps.centerContainer.width !== undefined) {
+ exports.convertHiddenOptions(moment, body, hiddenDates);
+
+ var start = moment(body.range.start);
+ var end = moment(body.range.end);
+
+ var totalRange = body.range.end - body.range.start;
+ var pixelTime = totalRange / body.domProps.centerContainer.width;
+
+ for (var i = 0; i < hiddenDates.length; i++) {
+ if (hiddenDates[i].repeat !== undefined) {
+ var startDate = moment(hiddenDates[i].start);
+ var endDate = moment(hiddenDates[i].end);
+
+ if (startDate._d == "Invalid Date") {
+ throw new Error("Supplied start date is not valid: " + hiddenDates[i].start);
+ }
+ if (endDate._d == "Invalid Date") {
+ throw new Error("Supplied end date is not valid: " + hiddenDates[i].end);
+ }
+
+ var duration = endDate - startDate;
+ if (duration >= 4 * pixelTime) {
+
+ var offset = 0;
+ var runUntil = end.clone();
+ switch (hiddenDates[i].repeat) {
+ case "daily":
+ // case of time
+ if (startDate.day() != endDate.day()) {
+ offset = 1;
+ }
+ startDate.dayOfYear(start.dayOfYear());
+ startDate.year(start.year());
+ startDate.subtract(7, "days");
+
+ endDate.dayOfYear(start.dayOfYear());
+ endDate.year(start.year());
+ endDate.subtract(7 - offset, "days");
+
+ runUntil.add(1, "weeks");
+ break;
+ case "weekly":
+ var dayOffset = endDate.diff(startDate, "days");
+ var day = startDate.day();
+
+ // set the start date to the range.start
+ startDate.date(start.date());
+ startDate.month(start.month());
+ startDate.year(start.year());
+ endDate = startDate.clone();
+
+ // force
+ startDate.day(day);
+ endDate.day(day);
+ endDate.add(dayOffset, "days");
+
+ startDate.subtract(1, "weeks");
+ endDate.subtract(1, "weeks");
+
+ runUntil.add(1, "weeks");
+ break;
+ case "monthly":
+ if (startDate.month() != endDate.month()) {
+ offset = 1;
+ }
+ startDate.month(start.month());
+ startDate.year(start.year());
+ startDate.subtract(1, "months");
+
+ endDate.month(start.month());
+ endDate.year(start.year());
+ endDate.subtract(1, "months");
+ endDate.add(offset, "months");
+
+ runUntil.add(1, "months");
+ break;
+ case "yearly":
+ if (startDate.year() != endDate.year()) {
+ offset = 1;
+ }
+ startDate.year(start.year());
+ startDate.subtract(1, "years");
+ endDate.year(start.year());
+ endDate.subtract(1, "years");
+ endDate.add(offset, "years");
+
+ runUntil.add(1, "years");
+ break;
+ default:
+ console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:", hiddenDates[i].repeat);
+ return;
+ }
+ while (startDate < runUntil) {
+ body.hiddenDates.push({ start: startDate.valueOf(), end: endDate.valueOf() });
+ switch (hiddenDates[i].repeat) {
+ case "daily":
+ startDate.add(1, "days");
+ endDate.add(1, "days");
+ break;
+ case "weekly":
+ startDate.add(1, "weeks");
+ endDate.add(1, "weeks");
+ break;
+ case "monthly":
+ startDate.add(1, "months");
+ endDate.add(1, "months");
+ break;
+ case "yearly":
+ startDate.add(1, "y");
+ endDate.add(1, "y");
+ break;
+ default:
+ console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:", hiddenDates[i].repeat);
+ return;
+ }
+ }
+ body.hiddenDates.push({ start: startDate.valueOf(), end: endDate.valueOf() });
+ }
+ }
+ }
+ // remove duplicates, merge where possible
+ exports.removeDuplicates(body);
+ // ensure the new positions are not on hidden dates
+ var startHidden = exports.isHidden(body.range.start, body.hiddenDates);
+ var endHidden = exports.isHidden(body.range.end, body.hiddenDates);
+ var rangeStart = body.range.start;
+ var rangeEnd = body.range.end;
+ if (startHidden.hidden == true) {
+ rangeStart = body.range.startToFront == true ? startHidden.startDate - 1 : startHidden.endDate + 1;
+ }
+ if (endHidden.hidden == true) {
+ rangeEnd = body.range.endToFront == true ? endHidden.startDate - 1 : endHidden.endDate + 1;
+ }
+ if (startHidden.hidden == true || endHidden.hidden == true) {
+ body.range._applyRange(rangeStart, rangeEnd);
+ }
+ }
+ };
+
+ /**
+ * remove duplicates from the hidden dates list. Duplicates are evil. They mess everything up.
+ * Scales with N^2
+ * @param body
+ */
+ exports.removeDuplicates = function (body) {
+ var hiddenDates = body.hiddenDates;
+ var safeDates = [];
+ for (var i = 0; i < hiddenDates.length; i++) {
+ for (var j = 0; j < hiddenDates.length; j++) {
+ if (i != j && hiddenDates[j].remove != true && hiddenDates[i].remove != true) {
+ // j inside i
+ if (hiddenDates[j].start >= hiddenDates[i].start && hiddenDates[j].end <= hiddenDates[i].end) {
+ hiddenDates[j].remove = true;
+ }
+ // j start inside i
+ else if (hiddenDates[j].start >= hiddenDates[i].start && hiddenDates[j].start <= hiddenDates[i].end) {
+ hiddenDates[i].end = hiddenDates[j].end;
+ hiddenDates[j].remove = true;
+ }
+ // j end inside i
+ else if (hiddenDates[j].end >= hiddenDates[i].start && hiddenDates[j].end <= hiddenDates[i].end) {
+ hiddenDates[i].start = hiddenDates[j].start;
+ hiddenDates[j].remove = true;
+ }
+ }
+ }
+ }
+
+ for (var i = 0; i < hiddenDates.length; i++) {
+ if (hiddenDates[i].remove !== true) {
+ safeDates.push(hiddenDates[i]);
+ }
+ }
+
+ body.hiddenDates = safeDates;
+ body.hiddenDates.sort(function (a, b) {
+ return a.start - b.start;
+ }); // sort by start time
+ };
+
+ exports.printDates = function (dates) {
+ for (var i = 0; i < dates.length; i++) {
+ console.log(i, new Date(dates[i].start), new Date(dates[i].end), dates[i].start, dates[i].end, dates[i].remove);
+ }
+ };
+
+ /**
+ * Used in TimeStep to avoid the hidden times.
+ * @param {function} moment
+ * @param {TimeStep} timeStep
+ * @param previousTime
+ */
+ exports.stepOverHiddenDates = function (moment, timeStep, previousTime) {
+ var stepInHidden = false;
+ var currentValue = timeStep.current.valueOf();
+ for (var i = 0; i < timeStep.hiddenDates.length; i++) {
+ var startDate = timeStep.hiddenDates[i].start;
+ var endDate = timeStep.hiddenDates[i].end;
+ if (currentValue >= startDate && currentValue < endDate) {
+ stepInHidden = true;
+ break;
+ }
+ }
+
+ if (stepInHidden == true && currentValue < timeStep._end.valueOf() && currentValue != previousTime) {
+ var prevValue = moment(previousTime);
+ var newValue = moment(endDate);
+ //check if the next step should be major
+ if (prevValue.year() != newValue.year()) {
+ timeStep.switchedYear = true;
+ } else if (prevValue.month() != newValue.month()) {
+ timeStep.switchedMonth = true;
+ } else if (prevValue.dayOfYear() != newValue.dayOfYear()) {
+ timeStep.switchedDay = true;
+ }
+
+ timeStep.current = newValue;
+ }
+ };
+
+ ///**
+ // * Used in TimeStep to avoid the hidden times.
+ // * @param timeStep
+ // * @param previousTime
+ // */
+ //exports.checkFirstStep = function(timeStep) {
+ // var stepInHidden = false;
+ // var currentValue = timeStep.current.valueOf();
+ // for (var i = 0; i < timeStep.hiddenDates.length; i++) {
+ // var startDate = timeStep.hiddenDates[i].start;
+ // var endDate = timeStep.hiddenDates[i].end;
+ // if (currentValue >= startDate && currentValue < endDate) {
+ // stepInHidden = true;
+ // break;
+ // }
+ // }
+ //
+ // if (stepInHidden == true && currentValue <= timeStep._end.valueOf()) {
+ // var newValue = moment(endDate);
+ // timeStep.current = newValue.toDate();
+ // }
+ //};
+
+ /**
+ * replaces the Core toScreen methods
+ * @param Core
+ * @param time
+ * @param width
+ * @returns {number}
+ */
+ exports.toScreen = function (Core, time, width) {
+ if (Core.body.hiddenDates.length == 0) {
+ var conversion = Core.range.conversion(width);
+ return (time.valueOf() - conversion.offset) * conversion.scale;
+ } else {
+ var hidden = exports.isHidden(time, Core.body.hiddenDates);
+ if (hidden.hidden == true) {
+ time = hidden.startDate;
+ }
+
+ var duration = exports.getHiddenDurationBetween(Core.body.hiddenDates, Core.range.start, Core.range.end);
+ time = exports.correctTimeForHidden(Core.options.moment, Core.body.hiddenDates, Core.range, time);
+
+ var conversion = Core.range.conversion(width, duration);
+ return (time.valueOf() - conversion.offset) * conversion.scale;
+ }
+ };
+
+ /**
+ * Replaces the core toTime methods
+ * @param body
+ * @param range
+ * @param x
+ * @param width
+ * @returns {Date}
+ */
+ exports.toTime = function (Core, x, width) {
+ if (Core.body.hiddenDates.length == 0) {
+ var conversion = Core.range.conversion(width);
+ return new Date(x / conversion.scale + conversion.offset);
+ } else {
+ var hiddenDuration = exports.getHiddenDurationBetween(Core.body.hiddenDates, Core.range.start, Core.range.end);
+ var totalDuration = Core.range.end - Core.range.start - hiddenDuration;
+ var partialDuration = totalDuration * x / width;
+ var accumulatedHiddenDuration = exports.getAccumulatedHiddenDuration(Core.body.hiddenDates, Core.range, partialDuration);
+
+ var newTime = new Date(accumulatedHiddenDuration + partialDuration + Core.range.start);
+ return newTime;
+ }
+ };
+
+ /**
+ * Support function
+ *
+ * @param hiddenDates
+ * @param range
+ * @returns {number}
+ */
+ exports.getHiddenDurationBetween = function (hiddenDates, start, end) {
+ var duration = 0;
+ for (var i = 0; i < hiddenDates.length; i++) {
+ var startDate = hiddenDates[i].start;
+ var endDate = hiddenDates[i].end;
+ // if time after the cutout, and the
+ if (startDate >= start && endDate < end) {
+ duration += endDate - startDate;
+ }
+ }
+ return duration;
+ };
+
+ /**
+ * Support function
+ * @param moment
+ * @param hiddenDates
+ * @param range
+ * @param time
+ * @returns {{duration: number, time: *, offset: number}}
+ */
+ exports.correctTimeForHidden = function (moment, hiddenDates, range, time) {
+ time = moment(time).toDate().valueOf();
+ time -= exports.getHiddenDurationBefore(moment, hiddenDates, range, time);
+ return time;
+ };
+
+ exports.getHiddenDurationBefore = function (moment, hiddenDates, range, time) {
+ var timeOffset = 0;
+ time = moment(time).toDate().valueOf();
+
+ for (var i = 0; i < hiddenDates.length; i++) {
+ var startDate = hiddenDates[i].start;
+ var endDate = hiddenDates[i].end;
+ // if time after the cutout, and the
+ if (startDate >= range.start && endDate < range.end) {
+ if (time >= endDate) {
+ timeOffset += endDate - startDate;
+ }
+ }
+ }
+ return timeOffset;
+ };
+
+ /**
+ * sum the duration from start to finish, including the hidden duration,
+ * until the required amount has been reached, return the accumulated hidden duration
+ * @param hiddenDates
+ * @param range
+ * @param time
+ * @returns {{duration: number, time: *, offset: number}}
+ */
+ exports.getAccumulatedHiddenDuration = function (hiddenDates, range, requiredDuration) {
+ var hiddenDuration = 0;
+ var duration = 0;
+ var previousPoint = range.start;
+ //exports.printDates(hiddenDates)
+ for (var i = 0; i < hiddenDates.length; i++) {
+ var startDate = hiddenDates[i].start;
+ var endDate = hiddenDates[i].end;
+ // if time after the cutout, and the
+ if (startDate >= range.start && endDate < range.end) {
+ duration += startDate - previousPoint;
+ previousPoint = endDate;
+ if (duration >= requiredDuration) {
+ break;
+ } else {
+ hiddenDuration += endDate - startDate;
+ }
+ }
+ }
+
+ return hiddenDuration;
+ };
+
+ /**
+ * used to step over to either side of a hidden block. Correction is disabled on tablets, might be set to true
+ * @param hiddenDates
+ * @param time
+ * @param direction
+ * @param correctionEnabled
+ * @returns {*}
+ */
+ exports.snapAwayFromHidden = function (hiddenDates, time, direction, correctionEnabled) {
+ var isHidden = exports.isHidden(time, hiddenDates);
+ if (isHidden.hidden == true) {
+ if (direction < 0) {
+ if (correctionEnabled == true) {
+ return isHidden.startDate - (isHidden.endDate - time) - 1;
+ } else {
+ return isHidden.startDate - 1;
+ }
+ } else {
+ if (correctionEnabled == true) {
+ return isHidden.endDate + (time - isHidden.startDate) + 1;
+ } else {
+ return isHidden.endDate + 1;
+ }
+ }
+ } else {
+ return time;
+ }
+ };
+
+ /**
+ * Check if a time is hidden
+ *
+ * @param time
+ * @param hiddenDates
+ * @returns {{hidden: boolean, startDate: Window.start, endDate: *}}
+ */
+ exports.isHidden = function (time, hiddenDates) {
+ for (var i = 0; i < hiddenDates.length; i++) {
+ var startDate = hiddenDates[i].start;
+ var endDate = hiddenDates[i].end;
+
+ if (time >= startDate && time < endDate) {
+ // if the start is entering a hidden zone
+ return { hidden: true, startDate: startDate, endDate: endDate };
+ break;
+ }
+ }
+ return { hidden: false, startDate: startDate, endDate: endDate };
+ };
+
+/***/ },
+/* 28 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Emitter = __webpack_require__(12);
+ var Hammer = __webpack_require__(20);
+ var hammerUtil = __webpack_require__(25);
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(8);
+ var DataView = __webpack_require__(10);
+ var Range = __webpack_require__(24);
+ var ItemSet = __webpack_require__(29);
+ var TimeAxis = __webpack_require__(39);
+ var Activator = __webpack_require__(40);
+ var DateUtil = __webpack_require__(27);
+ var CustomTime = __webpack_require__(42);
+
+ /**
+ * Create a timeline visualization
+ * @constructor
+ */
+ function Core() {}
+
+ // turn Core into an event emitter
+ Emitter(Core.prototype);
+
+ /**
+ * Create the main DOM for the Core: a root panel containing left, right,
+ * top, bottom, content, and background panel.
+ * @param {Element} container The container element where the Core will
+ * be attached.
+ * @protected
+ */
+ Core.prototype._create = function (container) {
+ this.dom = {};
+
+ this.dom.container = container;
+
+ this.dom.root = document.createElement('div');
+ this.dom.background = document.createElement('div');
+ this.dom.backgroundVertical = document.createElement('div');
+ this.dom.backgroundHorizontal = document.createElement('div');
+ this.dom.centerContainer = document.createElement('div');
+ this.dom.leftContainer = document.createElement('div');
+ this.dom.rightContainer = document.createElement('div');
+ this.dom.center = document.createElement('div');
+ this.dom.left = document.createElement('div');
+ this.dom.right = document.createElement('div');
+ this.dom.top = document.createElement('div');
+ this.dom.bottom = document.createElement('div');
+ this.dom.shadowTop = document.createElement('div');
+ this.dom.shadowBottom = document.createElement('div');
+ this.dom.shadowTopLeft = document.createElement('div');
+ this.dom.shadowBottomLeft = document.createElement('div');
+ this.dom.shadowTopRight = document.createElement('div');
+ this.dom.shadowBottomRight = document.createElement('div');
+
+ this.dom.root.className = 'vis-timeline';
+ this.dom.background.className = 'vis-panel vis-background';
+ this.dom.backgroundVertical.className = 'vis-panel vis-background vis-vertical';
+ this.dom.backgroundHorizontal.className = 'vis-panel vis-background vis-horizontal';
+ this.dom.centerContainer.className = 'vis-panel vis-center';
+ this.dom.leftContainer.className = 'vis-panel vis-left';
+ this.dom.rightContainer.className = 'vis-panel vis-right';
+ this.dom.top.className = 'vis-panel vis-top';
+ this.dom.bottom.className = 'vis-panel vis-bottom';
+ this.dom.left.className = 'vis-content';
+ this.dom.center.className = 'vis-content';
+ this.dom.right.className = 'vis-content';
+ this.dom.shadowTop.className = 'vis-shadow vis-top';
+ this.dom.shadowBottom.className = 'vis-shadow vis-bottom';
+ this.dom.shadowTopLeft.className = 'vis-shadow vis-top';
+ this.dom.shadowBottomLeft.className = 'vis-shadow vis-bottom';
+ this.dom.shadowTopRight.className = 'vis-shadow vis-top';
+ this.dom.shadowBottomRight.className = 'vis-shadow vis-bottom';
+
+ this.dom.root.appendChild(this.dom.background);
+ this.dom.root.appendChild(this.dom.backgroundVertical);
+ this.dom.root.appendChild(this.dom.backgroundHorizontal);
+ this.dom.root.appendChild(this.dom.centerContainer);
+ this.dom.root.appendChild(this.dom.leftContainer);
+ this.dom.root.appendChild(this.dom.rightContainer);
+ this.dom.root.appendChild(this.dom.top);
+ this.dom.root.appendChild(this.dom.bottom);
+
+ this.dom.centerContainer.appendChild(this.dom.center);
+ this.dom.leftContainer.appendChild(this.dom.left);
+ this.dom.rightContainer.appendChild(this.dom.right);
+
+ this.dom.centerContainer.appendChild(this.dom.shadowTop);
+ this.dom.centerContainer.appendChild(this.dom.shadowBottom);
+ this.dom.leftContainer.appendChild(this.dom.shadowTopLeft);
+ this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft);
+ this.dom.rightContainer.appendChild(this.dom.shadowTopRight);
+ this.dom.rightContainer.appendChild(this.dom.shadowBottomRight);
+
+ this.on('rangechange', (function () {
+ this._redraw(); // this allows overriding the _redraw method
+ }).bind(this));
+ this.on('touch', this._onTouch.bind(this));
+ this.on('pan', this._onDrag.bind(this));
+
+ var me = this;
+ this.on('change', function (properties) {
+ if (properties && properties.queue == true) {
+ // redraw once on next tick
+ if (!me._redrawTimer) {
+ me._redrawTimer = setTimeout(function () {
+ me._redrawTimer = null;
+ me._redraw();
+ }, 0);
+ }
+ } else {
+ // redraw immediately
+ me._redraw();
+ }
+ });
+
+ // create event listeners for all interesting events, these events will be
+ // emitted via emitter
+ this.hammer = new Hammer(this.dom.root);
+ this.hammer.get('pinch').set({ enable: true });
+ this.hammer.get('pan').set({ threshold: 5, direction: 30 }); // 30 is ALL_DIRECTIONS in hammer.
+ this.listeners = {};
+
+ var events = ['tap', 'doubletap', 'press', 'pinch', 'pan', 'panstart', 'panmove', 'panend'
+ // TODO: cleanup
+ //'touch', 'pinch',
+ //'tap', 'doubletap', 'hold',
+ //'dragstart', 'drag', 'dragend',
+ //'mousewheel', 'DOMMouseScroll' // DOMMouseScroll is needed for Firefox
+ ];
+ events.forEach(function (type) {
+ var listener = function listener(event) {
+ if (me.isActive()) {
+ me.emit(type, event);
+ }
+ };
+ me.hammer.on(type, listener);
+ me.listeners[type] = listener;
+ });
+
+ // emulate a touch event (emitted before the start of a pan, pinch, tap, or press)
+ hammerUtil.onTouch(this.hammer, (function (event) {
+ me.emit('touch', event);
+ }).bind(this));
+
+ // emulate a release event (emitted after a pan, pinch, tap, or press)
+ hammerUtil.onRelease(this.hammer, (function (event) {
+ me.emit('release', event);
+ }).bind(this));
+
+ function onMouseWheel(event) {
+ if (me.isActive()) {
+ me.emit('mousewheel', event);
+ }
+ }
+ this.dom.root.addEventListener('mousewheel', onMouseWheel);
+ this.dom.root.addEventListener('DOMMouseScroll', onMouseWheel);
+
+ // size properties of each of the panels
+ this.props = {
+ root: {},
+ background: {},
+ centerContainer: {},
+ leftContainer: {},
+ rightContainer: {},
+ center: {},
+ left: {},
+ right: {},
+ top: {},
+ bottom: {},
+ border: {},
+ scrollTop: 0,
+ scrollTopMin: 0
+ };
+
+ this.customTimes = [];
+
+ // store state information needed for touch events
+ this.touch = {};
+
+ this.redrawCount = 0;
+
+ // attach the root panel to the provided container
+ if (!container) throw new Error('No container provided');
+ container.appendChild(this.dom.root);
+ };
+
+ /**
+ * Set options. Options will be passed to all components loaded in the Timeline.
+ * @param {Object} [options]
+ * {String} orientation
+ * Vertical orientation for the Timeline,
+ * can be 'bottom' (default) or 'top'.
+ * {String | Number} width
+ * Width for the timeline, a number in pixels or
+ * a css string like '1000px' or '75%'. '100%' by default.
+ * {String | Number} height
+ * Fixed height for the Timeline, a number in pixels or
+ * a css string like '400px' or '75%'. If undefined,
+ * The Timeline will automatically size such that
+ * its contents fit.
+ * {String | Number} minHeight
+ * Minimum height for the Timeline, a number in pixels or
+ * a css string like '400px' or '75%'.
+ * {String | Number} maxHeight
+ * Maximum height for the Timeline, a number in pixels or
+ * a css string like '400px' or '75%'.
+ * {Number | Date | String} start
+ * Start date for the visible window
+ * {Number | Date | String} end
+ * End date for the visible window
+ */
+ Core.prototype.setOptions = function (options) {
+ if (options) {
+ // copy the known options
+ var fields = ['width', 'height', 'minHeight', 'maxHeight', 'autoResize', 'start', 'end', 'clickToUse', 'dataAttributes', 'hiddenDates', 'locale', 'locales', 'moment', 'throttleRedraw'];
+ util.selectiveExtend(fields, this.options, options);
+
+ if ('orientation' in options) {
+ if (typeof options.orientation === 'string') {
+ this.options.orientation = {
+ item: options.orientation,
+ axis: options.orientation
+ };
+ } else if (typeof options.orientation === 'object') {
+ if ('item' in options.orientation) {
+ this.options.orientation.item = options.orientation.item;
+ }
+ if ('axis' in options.orientation) {
+ this.options.orientation.axis = options.orientation.axis;
+ }
+ }
+ }
+
+ if (this.options.orientation.axis === 'both') {
+ if (!this.timeAxis2) {
+ var timeAxis2 = this.timeAxis2 = new TimeAxis(this.body);
+ timeAxis2.setOptions = function (options) {
+ var _options = options ? util.extend({}, options) : {};
+ _options.orientation = 'top'; // override the orientation option, always top
+ TimeAxis.prototype.setOptions.call(timeAxis2, _options);
+ };
+ this.components.push(timeAxis2);
+ }
+ } else {
+ if (this.timeAxis2) {
+ var index = this.components.indexOf(this.timeAxis2);
+ if (index !== -1) {
+ this.components.splice(index, 1);
+ }
+ this.timeAxis2.destroy();
+ this.timeAxis2 = null;
+ }
+ }
+
+ // if the graph2d's drawPoints is a function delegate the callback to the onRender property
+ if (typeof options.drawPoints == 'function') {
+ options.drawPoints = {
+ onRender: options.drawPoints
+ };
+ }
+
+ if ('hiddenDates' in this.options) {
+ DateUtil.convertHiddenOptions(this.options.moment, this.body, this.options.hiddenDates);
+ }
+
+ if ('clickToUse' in options) {
+ if (options.clickToUse) {
+ if (!this.activator) {
+ this.activator = new Activator(this.dom.root);
+ }
+ } else {
+ if (this.activator) {
+ this.activator.destroy();
+ delete this.activator;
+ }
+ }
+ }
+
+ if ('showCustomTime' in options) {
+ throw new Error('Option `showCustomTime` is deprecated. Create a custom time bar via timeline.addCustomTime(time [, id])');
+ }
+
+ // enable/disable autoResize
+ this._initAutoResize();
+ }
+
+ // propagate options to all components
+ this.components.forEach(function (component) {
+ return component.setOptions(options);
+ });
+
+ // enable/disable configure
+ if ('configure' in options) {
+ if (!this.configurator) {
+ this.configurator = this._createConfigurator();
+ }
+
+ this.configurator.setOptions(options.configure);
+
+ // collect the settings of all components, and pass them to the configuration system
+ var appliedOptions = util.deepExtend({}, this.options);
+ this.components.forEach(function (component) {
+ util.deepExtend(appliedOptions, component.options);
+ });
+ this.configurator.setModuleOptions({ global: appliedOptions });
+ }
+
+ // override redraw with a throttled version
+ if (!this._origRedraw) {
+ this._origRedraw = this._redraw.bind(this);
+ }
+ this._redraw = util.throttle(this._origRedraw, this.options.throttleRedraw);
+
+ // redraw everything
+ this._redraw();
+ };
+
+ /**
+ * Returns true when the Timeline is active.
+ * @returns {boolean}
+ */
+ Core.prototype.isActive = function () {
+ return !this.activator || this.activator.active;
+ };
+
+ /**
+ * Destroy the Core, clean up all DOM elements and event listeners.
+ */
+ Core.prototype.destroy = function () {
+ // unbind datasets
+ this.setItems(null);
+ this.setGroups(null);
+
+ // remove all event listeners
+ this.off();
+
+ // stop checking for changed size
+ this._stopAutoResize();
+
+ // remove from DOM
+ if (this.dom.root.parentNode) {
+ this.dom.root.parentNode.removeChild(this.dom.root);
+ }
+ this.dom = null;
+
+ // remove Activator
+ if (this.activator) {
+ this.activator.destroy();
+ delete this.activator;
+ }
+
+ // cleanup hammer touch events
+ for (var event in this.listeners) {
+ if (this.listeners.hasOwnProperty(event)) {
+ delete this.listeners[event];
+ }
+ }
+ this.listeners = null;
+ this.hammer = null;
+
+ // give all components the opportunity to cleanup
+ this.components.forEach(function (component) {
+ return component.destroy();
+ });
+
+ this.body = null;
+ };
+
+ /**
+ * Set a custom time bar
+ * @param {Date} time
+ * @param {number} [id=undefined] Optional id of the custom time bar to be adjusted.
+ */
+ Core.prototype.setCustomTime = function (time, id) {
+ var customTimes = this.customTimes.filter(function (component) {
+ return id === component.options.id;
+ });
+
+ if (customTimes.length === 0) {
+ throw new Error('No custom time bar found with id ' + JSON.stringify(id));
+ }
+
+ if (customTimes.length > 0) {
+ customTimes[0].setCustomTime(time);
+ }
+ };
+
+ /**
+ * Retrieve the current custom time.
+ * @param {number} [id=undefined] Id of the custom time bar.
+ * @return {Date | undefined} customTime
+ */
+ Core.prototype.getCustomTime = function (id) {
+ var customTimes = this.customTimes.filter(function (component) {
+ return component.options.id === id;
+ });
+
+ if (customTimes.length === 0) {
+ throw new Error('No custom time bar found with id ' + JSON.stringify(id));
+ }
+ return customTimes[0].getCustomTime();
+ };
+
+ /**
+ * Set a custom title for the custom time bar.
+ * @param {String} [title] Custom title
+ * @param {number} [id=undefined] Id of the custom time bar.
+ */
+ Core.prototype.setCustomTimeTitle = function (title, id) {
+ var customTimes = this.customTimes.filter(function (component) {
+ return component.options.id === id;
+ });
+
+ if (customTimes.length === 0) {
+ throw new Error('No custom time bar found with id ' + JSON.stringify(id));
+ }
+ if (customTimes.length > 0) {
+ return customTimes[0].setCustomTitle(title);
+ }
+ };
+
+ /**
+ * Retrieve meta information from an event.
+ * Should be overridden by classes extending Core
+ * @param {Event} event
+ * @return {Object} An object with related information.
+ */
+ Core.prototype.getEventProperties = function (event) {
+ return { event: event };
+ };
+
+ /**
+ * Add custom vertical bar
+ * @param {Date | String | Number} [time] A Date, unix timestamp, or
+ * ISO date string. Time point where
+ * the new bar should be placed.
+ * If not provided, `new Date()` will
+ * be used.
+ * @param {Number | String} [id=undefined] Id of the new bar. Optional
+ * @return {Number | String} Returns the id of the new bar
+ */
+ Core.prototype.addCustomTime = function (time, id) {
+ var timestamp = time !== undefined ? util.convert(time, 'Date').valueOf() : new Date();
+
+ var exists = this.customTimes.some(function (customTime) {
+ return customTime.options.id === id;
+ });
+ if (exists) {
+ throw new Error('A custom time with id ' + JSON.stringify(id) + ' already exists');
+ }
+
+ var customTime = new CustomTime(this.body, util.extend({}, this.options, {
+ time: timestamp,
+ id: id
+ }));
+
+ this.customTimes.push(customTime);
+ this.components.push(customTime);
+ this._redraw();
+
+ return id;
+ };
+
+ /**
+ * Remove previously added custom bar
+ * @param {int} id ID of the custom bar to be removed
+ * @return {boolean} True if the bar exists and is removed, false otherwise
+ */
+ Core.prototype.removeCustomTime = function (id) {
+ var customTimes = this.customTimes.filter(function (bar) {
+ return bar.options.id === id;
+ });
+
+ if (customTimes.length === 0) {
+ throw new Error('No custom time bar found with id ' + JSON.stringify(id));
+ }
+
+ customTimes.forEach((function (customTime) {
+ this.customTimes.splice(this.customTimes.indexOf(customTime), 1);
+ this.components.splice(this.components.indexOf(customTime), 1);
+ customTime.destroy();
+ }).bind(this));
+ };
+
+ /**
+ * Get the id's of the currently visible items.
+ * @returns {Array} The ids of the visible items
+ */
+ Core.prototype.getVisibleItems = function () {
+ return this.itemSet && this.itemSet.getVisibleItems() || [];
+ };
+
+ /**
+ * Set Core window such that it fits all items
+ * @param {Object} [options] Available options:
+ * `animation: boolean | {duration: number, easingFunction: string}`
+ * If true (default), the range is animated
+ * smoothly to the new window. An object can be
+ * provided to specify duration and easing function.
+ * Default duration is 500 ms, and default easing
+ * function is 'easeInOutQuad'.
+ */
+ Core.prototype.fit = function (options) {
+ var range = this.getDataRange();
+
+ // skip range set if there is no min and max date
+ if (range.min === null && range.max === null) {
+ return;
+ }
+
+ // apply a margin of 1% left and right of the data
+ var interval = range.max - range.min;
+ var min = new Date(range.min.valueOf() - interval * 0.01);
+ var max = new Date(range.max.valueOf() + interval * 0.01);
+
+ var animation = options && options.animation !== undefined ? options.animation : true;
+ this.range.setRange(min, max, animation);
+ };
+
+ /**
+ * Calculate the data range of the items start and end dates
+ * @returns {{min: Date | null, max: Date | null}}
+ * @protected
+ */
+ Core.prototype.getDataRange = function () {
+ // must be implemented by Timeline and Graph2d
+ throw new Error('Cannot invoke abstract method getDataRange');
+ };
+
+ /**
+ * Set the visible window. Both parameters are optional, you can change only
+ * start or only end. Syntax:
+ *
+ * TimeLine.setWindow(start, end)
+ * TimeLine.setWindow(start, end, options)
+ * TimeLine.setWindow(range)
+ *
+ * Where start and end can be a Date, number, or string, and range is an
+ * object with properties start and end.
+ *
+ * @param {Date | Number | String | Object} [start] Start date of visible window
+ * @param {Date | Number | String} [end] End date of visible window
+ * @param {Object} [options] Available options:
+ * `animation: boolean | {duration: number, easingFunction: string}`
+ * If true (default), the range is animated
+ * smoothly to the new window. An object can be
+ * provided to specify duration and easing function.
+ * Default duration is 500 ms, and default easing
+ * function is 'easeInOutQuad'.
+ */
+ Core.prototype.setWindow = function (start, end, options) {
+ var animation;
+ if (arguments.length == 1) {
+ var range = arguments[0];
+ animation = range.animation !== undefined ? range.animation : true;
+ this.range.setRange(range.start, range.end, animation);
+ } else {
+ animation = options && options.animation !== undefined ? options.animation : true;
+ this.range.setRange(start, end, animation);
+ }
+ };
+
+ /**
+ * Move the window such that given time is centered on screen.
+ * @param {Date | Number | String} time
+ * @param {Object} [options] Available options:
+ * `animation: boolean | {duration: number, easingFunction: string}`
+ * If true (default), the range is animated
+ * smoothly to the new window. An object can be
+ * provided to specify duration and easing function.
+ * Default duration is 500 ms, and default easing
+ * function is 'easeInOutQuad'.
+ */
+ Core.prototype.moveTo = function (time, options) {
+ var interval = this.range.end - this.range.start;
+ var t = util.convert(time, 'Date').valueOf();
+
+ var start = t - interval / 2;
+ var end = t + interval / 2;
+ var animation = options && options.animation !== undefined ? options.animation : true;
+
+ this.range.setRange(start, end, animation);
+ };
+
+ /**
+ * Get the visible window
+ * @return {{start: Date, end: Date}} Visible range
+ */
+ Core.prototype.getWindow = function () {
+ var range = this.range.getRange();
+ return {
+ start: new Date(range.start),
+ end: new Date(range.end)
+ };
+ };
+
+ /**
+ * Force a redraw. Can be overridden by implementations of Core
+ *
+ * Note: this function will be overridden on construction with a trottled version
+ */
+ Core.prototype.redraw = function () {
+ this._redraw();
+ };
+
+ /**
+ * Redraw for internal use. Redraws all components. See also the public
+ * method redraw.
+ * @protected
+ */
+ Core.prototype._redraw = function () {
+ var resized = false;
+ var options = this.options;
+ var props = this.props;
+ var dom = this.dom;
+
+ if (!dom) return; // when destroyed
+
+ DateUtil.updateHiddenDates(this.options.moment, this.body, this.options.hiddenDates);
+
+ // update class names
+ if (options.orientation == 'top') {
+ util.addClassName(dom.root, 'vis-top');
+ util.removeClassName(dom.root, 'vis-bottom');
+ } else {
+ util.removeClassName(dom.root, 'vis-top');
+ util.addClassName(dom.root, 'vis-bottom');
+ }
+
+ // update root width and height options
+ dom.root.style.maxHeight = util.option.asSize(options.maxHeight, '');
+ dom.root.style.minHeight = util.option.asSize(options.minHeight, '');
+ dom.root.style.width = util.option.asSize(options.width, '');
+
+ // calculate border widths
+ props.border.left = (dom.centerContainer.offsetWidth - dom.centerContainer.clientWidth) / 2;
+ props.border.right = props.border.left;
+ props.border.top = (dom.centerContainer.offsetHeight - dom.centerContainer.clientHeight) / 2;
+ props.border.bottom = props.border.top;
+ var borderRootHeight = dom.root.offsetHeight - dom.root.clientHeight;
+ var borderRootWidth = dom.root.offsetWidth - dom.root.clientWidth;
+
+ // workaround for a bug in IE: the clientWidth of an element with
+ // a height:0px and overflow:hidden is not calculated and always has value 0
+ if (dom.centerContainer.clientHeight === 0) {
+ props.border.left = props.border.top;
+ props.border.right = props.border.left;
+ }
+ if (dom.root.clientHeight === 0) {
+ borderRootWidth = borderRootHeight;
+ }
+
+ // calculate the heights. If any of the side panels is empty, we set the height to
+ // minus the border width, such that the border will be invisible
+ props.center.height = dom.center.offsetHeight;
+ props.left.height = dom.left.offsetHeight;
+ props.right.height = dom.right.offsetHeight;
+ props.top.height = dom.top.clientHeight || -props.border.top;
+ props.bottom.height = dom.bottom.clientHeight || -props.border.bottom;
+
+ // TODO: compensate borders when any of the panels is empty.
+
+ // apply auto height
+ // TODO: only calculate autoHeight when needed (else we cause an extra reflow/repaint of the DOM)
+ var contentHeight = Math.max(props.left.height, props.center.height, props.right.height);
+ var autoHeight = props.top.height + contentHeight + props.bottom.height + borderRootHeight + props.border.top + props.border.bottom;
+ dom.root.style.height = util.option.asSize(options.height, autoHeight + 'px');
+
+ // calculate heights of the content panels
+ props.root.height = dom.root.offsetHeight;
+ props.background.height = props.root.height - borderRootHeight;
+ var containerHeight = props.root.height - props.top.height - props.bottom.height - borderRootHeight;
+ props.centerContainer.height = containerHeight;
+ props.leftContainer.height = containerHeight;
+ props.rightContainer.height = props.leftContainer.height;
+
+ // calculate the widths of the panels
+ props.root.width = dom.root.offsetWidth;
+ props.background.width = props.root.width - borderRootWidth;
+ props.left.width = dom.leftContainer.clientWidth || -props.border.left;
+ props.leftContainer.width = props.left.width;
+ props.right.width = dom.rightContainer.clientWidth || -props.border.right;
+ props.rightContainer.width = props.right.width;
+ var centerWidth = props.root.width - props.left.width - props.right.width - borderRootWidth;
+ props.center.width = centerWidth;
+ props.centerContainer.width = centerWidth;
+ props.top.width = centerWidth;
+ props.bottom.width = centerWidth;
+
+ // resize the panels
+ dom.background.style.height = props.background.height + 'px';
+ dom.backgroundVertical.style.height = props.background.height + 'px';
+ dom.backgroundHorizontal.style.height = props.centerContainer.height + 'px';
+ dom.centerContainer.style.height = props.centerContainer.height + 'px';
+ dom.leftContainer.style.height = props.leftContainer.height + 'px';
+ dom.rightContainer.style.height = props.rightContainer.height + 'px';
+
+ dom.background.style.width = props.background.width + 'px';
+ dom.backgroundVertical.style.width = props.centerContainer.width + 'px';
+ dom.backgroundHorizontal.style.width = props.background.width + 'px';
+ dom.centerContainer.style.width = props.center.width + 'px';
+ dom.top.style.width = props.top.width + 'px';
+ dom.bottom.style.width = props.bottom.width + 'px';
+
+ // reposition the panels
+ dom.background.style.left = '0';
+ dom.background.style.top = '0';
+ dom.backgroundVertical.style.left = props.left.width + props.border.left + 'px';
+ dom.backgroundVertical.style.top = '0';
+ dom.backgroundHorizontal.style.left = '0';
+ dom.backgroundHorizontal.style.top = props.top.height + 'px';
+ dom.centerContainer.style.left = props.left.width + 'px';
+ dom.centerContainer.style.top = props.top.height + 'px';
+ dom.leftContainer.style.left = '0';
+ dom.leftContainer.style.top = props.top.height + 'px';
+ dom.rightContainer.style.left = props.left.width + props.center.width + 'px';
+ dom.rightContainer.style.top = props.top.height + 'px';
+ dom.top.style.left = props.left.width + 'px';
+ dom.top.style.top = '0';
+ dom.bottom.style.left = props.left.width + 'px';
+ dom.bottom.style.top = props.top.height + props.centerContainer.height + 'px';
+
+ // update the scrollTop, feasible range for the offset can be changed
+ // when the height of the Core or of the contents of the center changed
+ this._updateScrollTop();
+
+ // reposition the scrollable contents
+ var offset = this.props.scrollTop;
+ if (options.orientation.item != 'top') {
+ offset += Math.max(this.props.centerContainer.height - this.props.center.height - this.props.border.top - this.props.border.bottom, 0);
+ }
+ dom.center.style.left = '0';
+ dom.center.style.top = offset + 'px';
+ dom.left.style.left = '0';
+ dom.left.style.top = offset + 'px';
+ dom.right.style.left = '0';
+ dom.right.style.top = offset + 'px';
+
+ // show shadows when vertical scrolling is available
+ var visibilityTop = this.props.scrollTop == 0 ? 'hidden' : '';
+ var visibilityBottom = this.props.scrollTop == this.props.scrollTopMin ? 'hidden' : '';
+ dom.shadowTop.style.visibility = visibilityTop;
+ dom.shadowBottom.style.visibility = visibilityBottom;
+ dom.shadowTopLeft.style.visibility = visibilityTop;
+ dom.shadowBottomLeft.style.visibility = visibilityBottom;
+ dom.shadowTopRight.style.visibility = visibilityTop;
+ dom.shadowBottomRight.style.visibility = visibilityBottom;
+
+ // redraw all components
+ this.components.forEach(function (component) {
+ resized = component.redraw() || resized;
+ });
+ if (resized) {
+ // keep repainting until all sizes are settled
+ var MAX_REDRAWS = 3; // maximum number of consecutive redraws
+ if (this.redrawCount < MAX_REDRAWS) {
+ this.redrawCount++;
+ this._redraw();
+ } else {
+ console.log('WARNING: infinite loop in redraw?');
+ }
+ this.redrawCount = 0;
+ }
+ };
+
+ // TODO: deprecated since version 1.1.0, remove some day
+ Core.prototype.repaint = function () {
+ throw new Error('Function repaint is deprecated. Use redraw instead.');
+ };
+
+ /**
+ * Set a current time. This can be used for example to ensure that a client's
+ * time is synchronized with a shared server time.
+ * Only applicable when option `showCurrentTime` is true.
+ * @param {Date | String | Number} time A Date, unix timestamp, or
+ * ISO date string.
+ */
+ Core.prototype.setCurrentTime = function (time) {
+ if (!this.currentTime) {
+ throw new Error('Option showCurrentTime must be true');
+ }
+
+ this.currentTime.setCurrentTime(time);
+ };
+
+ /**
+ * Get the current time.
+ * Only applicable when option `showCurrentTime` is true.
+ * @return {Date} Returns the current time.
+ */
+ Core.prototype.getCurrentTime = function () {
+ if (!this.currentTime) {
+ throw new Error('Option showCurrentTime must be true');
+ }
+
+ return this.currentTime.getCurrentTime();
+ };
+
+ /**
+ * Convert a position on screen (pixels) to a datetime
+ * @param {int} x Position on the screen in pixels
+ * @return {Date} time The datetime the corresponds with given position x
+ * @protected
+ */
+ // TODO: move this function to Range
+ Core.prototype._toTime = function (x) {
+ return DateUtil.toTime(this, x, this.props.center.width);
+ };
+
+ /**
+ * Convert a position on the global screen (pixels) to a datetime
+ * @param {int} x Position on the screen in pixels
+ * @return {Date} time The datetime the corresponds with given position x
+ * @protected
+ */
+ // TODO: move this function to Range
+ Core.prototype._toGlobalTime = function (x) {
+ return DateUtil.toTime(this, x, this.props.root.width);
+ //var conversion = this.range.conversion(this.props.root.width);
+ //return new Date(x / conversion.scale + conversion.offset);
+ };
+
+ /**
+ * Convert a datetime (Date object) into a position on the screen
+ * @param {Date} time A date
+ * @return {int} x The position on the screen in pixels which corresponds
+ * with the given date.
+ * @protected
+ */
+ // TODO: move this function to Range
+ Core.prototype._toScreen = function (time) {
+ return DateUtil.toScreen(this, time, this.props.center.width);
+ };
+
+ /**
+ * Convert a datetime (Date object) into a position on the root
+ * This is used to get the pixel density estimate for the screen, not the center panel
+ * @param {Date} time A date
+ * @return {int} x The position on root in pixels which corresponds
+ * with the given date.
+ * @protected
+ */
+ // TODO: move this function to Range
+ Core.prototype._toGlobalScreen = function (time) {
+ return DateUtil.toScreen(this, time, this.props.root.width);
+ //var conversion = this.range.conversion(this.props.root.width);
+ //return (time.valueOf() - conversion.offset) * conversion.scale;
+ };
+
+ /**
+ * Initialize watching when option autoResize is true
+ * @private
+ */
+ Core.prototype._initAutoResize = function () {
+ if (this.options.autoResize == true) {
+ this._startAutoResize();
+ } else {
+ this._stopAutoResize();
+ }
+ };
+
+ /**
+ * Watch for changes in the size of the container. On resize, the Panel will
+ * automatically redraw itself.
+ * @private
+ */
+ Core.prototype._startAutoResize = function () {
+ var me = this;
+
+ this._stopAutoResize();
+
+ this._onResize = function () {
+ if (me.options.autoResize != true) {
+ // stop watching when the option autoResize is changed to false
+ me._stopAutoResize();
+ return;
+ }
+
+ if (me.dom.root) {
+ // check whether the frame is resized
+ // Note: we compare offsetWidth here, not clientWidth. For some reason,
+ // IE does not restore the clientWidth from 0 to the actual width after
+ // changing the timeline's container display style from none to visible
+ if (me.dom.root.offsetWidth != me.props.lastWidth || me.dom.root.offsetHeight != me.props.lastHeight) {
+ me.props.lastWidth = me.dom.root.offsetWidth;
+ me.props.lastHeight = me.dom.root.offsetHeight;
+
+ me.emit('change');
+ }
+ }
+ };
+
+ // add event listener to window resize
+ util.addEventListener(window, 'resize', this._onResize);
+
+ this.watchTimer = setInterval(this._onResize, 1000);
+ };
+
+ /**
+ * Stop watching for a resize of the frame.
+ * @private
+ */
+ Core.prototype._stopAutoResize = function () {
+ if (this.watchTimer) {
+ clearInterval(this.watchTimer);
+ this.watchTimer = undefined;
+ }
+
+ // remove event listener on window.resize
+ if (this._onResize) {
+ util.removeEventListener(window, 'resize', this._onResize);
+ this._onResize = null;
+ }
+ };
+
+ /**
+ * Start moving the timeline vertically
+ * @param {Event} event
+ * @private
+ */
+ Core.prototype._onTouch = function (event) {
+ this.touch.allowDragging = true;
+ this.touch.initialScrollTop = this.props.scrollTop;
+ };
+
+ /**
+ * Start moving the timeline vertically
+ * @param {Event} event
+ * @private
+ */
+ Core.prototype._onPinch = function (event) {
+ this.touch.allowDragging = false;
+ };
+
+ /**
+ * Move the timeline vertically
+ * @param {Event} event
+ * @private
+ */
+ Core.prototype._onDrag = function (event) {
+ // refuse to drag when we where pinching to prevent the timeline make a jump
+ // when releasing the fingers in opposite order from the touch screen
+ if (!this.touch.allowDragging) return;
+
+ var delta = event.deltaY;
+
+ var oldScrollTop = this._getScrollTop();
+ var newScrollTop = this._setScrollTop(this.touch.initialScrollTop + delta);
+
+ if (newScrollTop != oldScrollTop) {
+ this._redraw(); // TODO: this causes two redraws when dragging, the other is triggered by rangechange already
+ this.emit('verticalDrag');
+ }
+ };
+
+ /**
+ * Apply a scrollTop
+ * @param {Number} scrollTop
+ * @returns {Number} scrollTop Returns the applied scrollTop
+ * @private
+ */
+ Core.prototype._setScrollTop = function (scrollTop) {
+ this.props.scrollTop = scrollTop;
+ this._updateScrollTop();
+ return this.props.scrollTop;
+ };
+
+ /**
+ * Update the current scrollTop when the height of the containers has been changed
+ * @returns {Number} scrollTop Returns the applied scrollTop
+ * @private
+ */
+ Core.prototype._updateScrollTop = function () {
+ // recalculate the scrollTopMin
+ var scrollTopMin = Math.min(this.props.centerContainer.height - this.props.center.height, 0); // is negative or zero
+ if (scrollTopMin != this.props.scrollTopMin) {
+ // in case of bottom orientation, change the scrollTop such that the contents
+ // do not move relative to the time axis at the bottom
+ if (this.options.orientation.item != 'top') {
+ this.props.scrollTop += scrollTopMin - this.props.scrollTopMin;
+ }
+ this.props.scrollTopMin = scrollTopMin;
+ }
+
+ // limit the scrollTop to the feasible scroll range
+ if (this.props.scrollTop > 0) this.props.scrollTop = 0;
+ if (this.props.scrollTop < scrollTopMin) this.props.scrollTop = scrollTopMin;
+
+ return this.props.scrollTop;
+ };
+
+ /**
+ * Get the current scrollTop
+ * @returns {number} scrollTop
+ * @private
+ */
+ Core.prototype._getScrollTop = function () {
+ return this.props.scrollTop;
+ };
+
+ /**
+ * Load a configurator
+ * @return {Object}
+ * @private
+ */
+ Core.prototype._createConfigurator = function () {
+ throw new Error('Cannot invoke abstract method _createConfigurator');
+ };
+
+ module.exports = Core;
+
+/***/ },
+/* 29 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Hammer = __webpack_require__(20);
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(8);
+ var DataView = __webpack_require__(10);
+ var TimeStep = __webpack_require__(30);
+ var Component = __webpack_require__(26);
+ var Group = __webpack_require__(31);
+ var BackgroundGroup = __webpack_require__(35);
+ var BoxItem = __webpack_require__(36);
+ var PointItem = __webpack_require__(37);
+ var RangeItem = __webpack_require__(33);
+ var BackgroundItem = __webpack_require__(38);
+
+ var UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items
+ var BACKGROUND = '__background__'; // reserved group id for background items without group
+
+ /**
+ * An ItemSet holds a set of items and ranges which can be displayed in a
+ * range. The width is determined by the parent of the ItemSet, and the height
+ * is determined by the size of the items.
+ * @param {{dom: Object, domProps: Object, emitter: Emitter, range: Range}} body
+ * @param {Object} [options] See ItemSet.setOptions for the available options.
+ * @constructor ItemSet
+ * @extends Component
+ */
+ function ItemSet(body, options) {
+ this.body = body;
+
+ this.defaultOptions = {
+ type: null, // 'box', 'point', 'range', 'background'
+ orientation: {
+ item: 'bottom' // item orientation: 'top' or 'bottom'
+ },
+ align: 'auto', // alignment of box items
+ stack: true,
+ groupOrderSwap: function groupOrderSwap(fromGroup, toGroup, groups) {
+ var targetOrder = toGroup.order;
+ toGroup.order = fromGroup.order;
+ fromGroup.order = targetOrder;
+ },
+ groupOrder: 'order',
+
+ selectable: true,
+ multiselect: false,
+
+ editable: {
+ updateTime: false,
+ updateGroup: false,
+ add: false,
+ remove: false
+ },
+
+ groupEditable: {
+ order: false,
+ add: false,
+ remove: false
+ },
+
+ snap: TimeStep.snap,
+
+ onAdd: function onAdd(item, callback) {
+ callback(item);
+ },
+ onUpdate: function onUpdate(item, callback) {
+ callback(item);
+ },
+ onMove: function onMove(item, callback) {
+ callback(item);
+ },
+ onRemove: function onRemove(item, callback) {
+ callback(item);
+ },
+ onMoving: function onMoving(item, callback) {
+ callback(item);
+ },
+ onAddGroup: function onAddGroup(item, callback) {
+ callback(item);
+ },
+ onMoveGroup: function onMoveGroup(item, callback) {
+ callback(item);
+ },
+ onRemoveGroup: function onRemoveGroup(item, callback) {
+ callback(item);
+ },
+
+ margin: {
+ item: {
+ horizontal: 10,
+ vertical: 10
+ },
+ axis: 20
+ }
+ };
+
+ // options is shared by this ItemSet and all its items
+ this.options = util.extend({}, this.defaultOptions);
+
+ // options for getting items from the DataSet with the correct type
+ this.itemOptions = {
+ type: { start: 'Date', end: 'Date' }
+ };
+
+ this.conversion = {
+ toScreen: body.util.toScreen,
+ toTime: body.util.toTime
+ };
+ this.dom = {};
+ this.props = {};
+ this.hammer = null;
+
+ var me = this;
+ this.itemsData = null; // DataSet
+ this.groupsData = null; // DataSet
+
+ // listeners for the DataSet of the items
+ this.itemListeners = {
+ 'add': function add(event, params, senderId) {
+ me._onAdd(params.items);
+ },
+ 'update': function update(event, params, senderId) {
+ me._onUpdate(params.items);
+ },
+ 'remove': function remove(event, params, senderId) {
+ me._onRemove(params.items);
+ }
+ };
+
+ // listeners for the DataSet of the groups
+ this.groupListeners = {
+ 'add': function add(event, params, senderId) {
+ me._onAddGroups(params.items);
+ },
+ 'update': function update(event, params, senderId) {
+ me._onUpdateGroups(params.items);
+ },
+ 'remove': function remove(event, params, senderId) {
+ me._onRemoveGroups(params.items);
+ }
+ };
+
+ this.items = {}; // object with an Item for every data item
+ this.groups = {}; // Group object for every group
+ this.groupIds = [];
+
+ this.selection = []; // list with the ids of all selected nodes
+ this.stackDirty = true; // if true, all items will be restacked on next redraw
+
+ this.touchParams = {}; // stores properties while dragging
+ this.groupTouchParams = {};
+ // create the HTML DOM
+
+ this._create();
+
+ this.setOptions(options);
+ }
+
+ ItemSet.prototype = new Component();
+
+ // available item types will be registered here
+ ItemSet.types = {
+ background: BackgroundItem,
+ box: BoxItem,
+ range: RangeItem,
+ point: PointItem
+ };
+
+ /**
+ * Create the HTML DOM for the ItemSet
+ */
+ ItemSet.prototype._create = function () {
+ var frame = document.createElement('div');
+ frame.className = 'vis-itemset';
+ frame['timeline-itemset'] = this;
+ this.dom.frame = frame;
+
+ // create background panel
+ var background = document.createElement('div');
+ background.className = 'vis-background';
+ frame.appendChild(background);
+ this.dom.background = background;
+
+ // create foreground panel
+ var foreground = document.createElement('div');
+ foreground.className = 'vis-foreground';
+ frame.appendChild(foreground);
+ this.dom.foreground = foreground;
+
+ // create axis panel
+ var axis = document.createElement('div');
+ axis.className = 'vis-axis';
+ this.dom.axis = axis;
+
+ // create labelset
+ var labelSet = document.createElement('div');
+ labelSet.className = 'vis-labelset';
+ this.dom.labelSet = labelSet;
+
+ // create ungrouped Group
+ this._updateUngrouped();
+
+ // create background Group
+ var backgroundGroup = new BackgroundGroup(BACKGROUND, null, this);
+ backgroundGroup.show();
+ this.groups[BACKGROUND] = backgroundGroup;
+
+ // attach event listeners
+ // Note: we bind to the centerContainer for the case where the height
+ // of the center container is larger than of the ItemSet, so we
+ // can click in the empty area to create a new item or deselect an item.
+ this.hammer = new Hammer(this.body.dom.centerContainer);
+
+ // drag items when selected
+ this.hammer.on('hammer.input', (function (event) {
+ if (event.isFirst) {
+ this._onTouch(event);
+ }
+ }).bind(this));
+ this.hammer.on('panstart', this._onDragStart.bind(this));
+ this.hammer.on('panmove', this._onDrag.bind(this));
+ this.hammer.on('panend', this._onDragEnd.bind(this));
+ this.hammer.get('pan').set({ threshold: 5, direction: 30 }); // 30 is ALL_DIRECTIONS in hammer.
+
+ // single select (or unselect) when tapping an item
+ this.hammer.on('tap', this._onSelectItem.bind(this));
+
+ // multi select when holding mouse/touch, or on ctrl+click
+ this.hammer.on('press', this._onMultiSelectItem.bind(this));
+
+ // add item on doubletap
+ this.hammer.on('doubletap', this._onAddItem.bind(this));
+
+ this.groupHammer = new Hammer(this.body.dom.leftContainer);
+ this.groupHammer.on('panstart', this._onGroupDragStart.bind(this));
+ this.groupHammer.on('panmove', this._onGroupDrag.bind(this));
+ this.groupHammer.on('panend', this._onGroupDragEnd.bind(this));
+ this.groupHammer.get('pan').set({ threshold: 5, direction: 30 });
+
+ // attach to the DOM
+ this.show();
+ };
+
+ /**
+ * Set options for the ItemSet. Existing options will be extended/overwritten.
+ * @param {Object} [options] The following options are available:
+ * {String} type
+ * Default type for the items. Choose from 'box'
+ * (default), 'point', 'range', or 'background'.
+ * The default style can be overwritten by
+ * individual items.
+ * {String} align
+ * Alignment for the items, only applicable for
+ * BoxItem. Choose 'center' (default), 'left', or
+ * 'right'.
+ * {String} orientation.item
+ * Orientation of the item set. Choose 'top' or
+ * 'bottom' (default).
+ * {Function} groupOrder
+ * A sorting function for ordering groups
+ * {Boolean} stack
+ * If true (default), items will be stacked on
+ * top of each other.
+ * {Number} margin.axis
+ * Margin between the axis and the items in pixels.
+ * Default is 20.
+ * {Number} margin.item.horizontal
+ * Horizontal margin between items in pixels.
+ * Default is 10.
+ * {Number} margin.item.vertical
+ * Vertical Margin between items in pixels.
+ * Default is 10.
+ * {Number} margin.item
+ * Margin between items in pixels in both horizontal
+ * and vertical direction. Default is 10.
+ * {Number} margin
+ * Set margin for both axis and items in pixels.
+ * {Boolean} selectable
+ * If true (default), items can be selected.
+ * {Boolean} multiselect
+ * If true, multiple items can be selected.
+ * False by default.
+ * {Boolean} editable
+ * Set all editable options to true or false
+ * {Boolean} editable.updateTime
+ * Allow dragging an item to an other moment in time
+ * {Boolean} editable.updateGroup
+ * Allow dragging an item to an other group
+ * {Boolean} editable.add
+ * Allow creating new items on double tap
+ * {Boolean} editable.remove
+ * Allow removing items by clicking the delete button
+ * top right of a selected item.
+ * {Function(item: Item, callback: Function)} onAdd
+ * Callback function triggered when an item is about to be added:
+ * when the user double taps an empty space in the Timeline.
+ * {Function(item: Item, callback: Function)} onUpdate
+ * Callback function fired when an item is about to be updated.
+ * This function typically has to show a dialog where the user
+ * change the item. If not implemented, nothing happens.
+ * {Function(item: Item, callback: Function)} onMove
+ * Fired when an item has been moved. If not implemented,
+ * the move action will be accepted.
+ * {Function(item: Item, callback: Function)} onRemove
+ * Fired when an item is about to be deleted.
+ * If not implemented, the item will be always removed.
+ */
+ ItemSet.prototype.setOptions = function (options) {
+ if (options) {
+ // copy all options that we know
+ var fields = ['type', 'align', 'order', 'stack', 'selectable', 'multiselect', 'groupOrder', 'dataAttributes', 'template', 'groupTemplate', 'hide', 'snap', 'groupOrderSwap'];
+ util.selectiveExtend(fields, this.options, options);
+
+ if ('orientation' in options) {
+ if (typeof options.orientation === 'string') {
+ this.options.orientation.item = options.orientation === 'top' ? 'top' : 'bottom';
+ } else if (typeof options.orientation === 'object' && 'item' in options.orientation) {
+ this.options.orientation.item = options.orientation.item;
+ }
+ }
+
+ if ('margin' in options) {
+ if (typeof options.margin === 'number') {
+ this.options.margin.axis = options.margin;
+ this.options.margin.item.horizontal = options.margin;
+ this.options.margin.item.vertical = options.margin;
+ } else if (typeof options.margin === 'object') {
+ util.selectiveExtend(['axis'], this.options.margin, options.margin);
+ if ('item' in options.margin) {
+ if (typeof options.margin.item === 'number') {
+ this.options.margin.item.horizontal = options.margin.item;
+ this.options.margin.item.vertical = options.margin.item;
+ } else if (typeof options.margin.item === 'object') {
+ util.selectiveExtend(['horizontal', 'vertical'], this.options.margin.item, options.margin.item);
+ }
+ }
+ }
+ }
+
+ if ('editable' in options) {
+ if (typeof options.editable === 'boolean') {
+ this.options.editable.updateTime = options.editable;
+ this.options.editable.updateGroup = options.editable;
+ this.options.editable.add = options.editable;
+ this.options.editable.remove = options.editable;
+ } else if (typeof options.editable === 'object') {
+ util.selectiveExtend(['updateTime', 'updateGroup', 'add', 'remove'], this.options.editable, options.editable);
+ }
+ }
+
+ if ('groupEditable' in options) {
+ if (typeof options.groupEditable === 'boolean') {
+ this.options.groupEditable.order = options.groupEditable;
+ this.options.groupEditable.add = options.groupEditable;
+ this.options.groupEditable.remove = options.groupEditable;
+ } else if (typeof options.groupEditable === 'object') {
+ util.selectiveExtend(['order', 'add', 'remove'], this.options.groupEditable, options.groupEditable);
+ }
+ }
+
+ // callback functions
+ var addCallback = (function (name) {
+ var fn = options[name];
+ if (fn) {
+ if (!(fn instanceof Function)) {
+ throw new Error('option ' + name + ' must be a function ' + name + '(item, callback)');
+ }
+ this.options[name] = fn;
+ }
+ }).bind(this);
+ ['onAdd', 'onUpdate', 'onRemove', 'onMove', 'onMoving', 'onAddGroup', 'onMoveGroup', 'onRemoveGroup'].forEach(addCallback);
+
+ // force the itemSet to refresh: options like orientation and margins may be changed
+ this.markDirty();
+ }
+ };
+
+ /**
+ * Mark the ItemSet dirty so it will refresh everything with next redraw.
+ * Optionally, all items can be marked as dirty and be refreshed.
+ * @param {{refreshItems: boolean}} [options]
+ */
+ ItemSet.prototype.markDirty = function (options) {
+ this.groupIds = [];
+ this.stackDirty = true;
+
+ if (options && options.refreshItems) {
+ util.forEach(this.items, function (item) {
+ item.dirty = true;
+ if (item.displayed) item.redraw();
+ });
+ }
+ };
+
+ /**
+ * Destroy the ItemSet
+ */
+ ItemSet.prototype.destroy = function () {
+ this.hide();
+ this.setItems(null);
+ this.setGroups(null);
+
+ this.hammer = null;
+
+ this.body = null;
+ this.conversion = null;
+ };
+
+ /**
+ * Hide the component from the DOM
+ */
+ ItemSet.prototype.hide = function () {
+ // remove the frame containing the items
+ if (this.dom.frame.parentNode) {
+ this.dom.frame.parentNode.removeChild(this.dom.frame);
+ }
+
+ // remove the axis with dots
+ if (this.dom.axis.parentNode) {
+ this.dom.axis.parentNode.removeChild(this.dom.axis);
+ }
+
+ // remove the labelset containing all group labels
+ if (this.dom.labelSet.parentNode) {
+ this.dom.labelSet.parentNode.removeChild(this.dom.labelSet);
+ }
+ };
+
+ /**
+ * Show the component in the DOM (when not already visible).
+ * @return {Boolean} changed
+ */
+ ItemSet.prototype.show = function () {
+ // show frame containing the items
+ if (!this.dom.frame.parentNode) {
+ this.body.dom.center.appendChild(this.dom.frame);
+ }
+
+ // show axis with dots
+ if (!this.dom.axis.parentNode) {
+ this.body.dom.backgroundVertical.appendChild(this.dom.axis);
+ }
+
+ // show labelset containing labels
+ if (!this.dom.labelSet.parentNode) {
+ this.body.dom.left.appendChild(this.dom.labelSet);
+ }
+ };
+
+ /**
+ * Set selected items by their id. Replaces the current selection
+ * Unknown id's are silently ignored.
+ * @param {string[] | string} [ids] An array with zero or more id's of the items to be
+ * selected, or a single item id. If ids is undefined
+ * or an empty array, all items will be unselected.
+ */
+ ItemSet.prototype.setSelection = function (ids) {
+ var i, ii, id, item;
+
+ if (ids == undefined) ids = [];
+ if (!Array.isArray(ids)) ids = [ids];
+
+ // unselect currently selected items
+ for (i = 0, ii = this.selection.length; i < ii; i++) {
+ id = this.selection[i];
+ item = this.items[id];
+ if (item) item.unselect();
+ }
+
+ // select items
+ this.selection = [];
+ for (i = 0, ii = ids.length; i < ii; i++) {
+ id = ids[i];
+ item = this.items[id];
+ if (item) {
+ this.selection.push(id);
+ item.select();
+ }
+ }
+ };
+
+ /**
+ * Get the selected items by their id
+ * @return {Array} ids The ids of the selected items
+ */
+ ItemSet.prototype.getSelection = function () {
+ return this.selection.concat([]);
+ };
+
+ /**
+ * Get the id's of the currently visible items.
+ * @returns {Array} The ids of the visible items
+ */
+ ItemSet.prototype.getVisibleItems = function () {
+ var range = this.body.range.getRange();
+ var left = this.body.util.toScreen(range.start);
+ var right = this.body.util.toScreen(range.end);
+
+ var ids = [];
+ for (var groupId in this.groups) {
+ if (this.groups.hasOwnProperty(groupId)) {
+ var group = this.groups[groupId];
+ var rawVisibleItems = group.visibleItems;
+
+ // filter the "raw" set with visibleItems into a set which is really
+ // visible by pixels
+ for (var i = 0; i < rawVisibleItems.length; i++) {
+ var item = rawVisibleItems[i];
+ // TODO: also check whether visible vertically
+ if (item.left < right && item.left + item.width > left) {
+ ids.push(item.id);
+ }
+ }
+ }
+ }
+
+ return ids;
+ };
+
+ /**
+ * Deselect a selected item
+ * @param {String | Number} id
+ * @private
+ */
+ ItemSet.prototype._deselect = function (id) {
+ var selection = this.selection;
+ for (var i = 0, ii = selection.length; i < ii; i++) {
+ if (selection[i] == id) {
+ // non-strict comparison!
+ selection.splice(i, 1);
+ break;
+ }
+ }
+ };
+
+ /**
+ * Repaint the component
+ * @return {boolean} Returns true if the component is resized
+ */
+ ItemSet.prototype.redraw = function () {
+ var margin = this.options.margin,
+ range = this.body.range,
+ asSize = util.option.asSize,
+ options = this.options,
+ orientation = options.orientation.item,
+ resized = false,
+ frame = this.dom.frame;
+
+ // recalculate absolute position (before redrawing groups)
+ this.props.top = this.body.domProps.top.height + this.body.domProps.border.top;
+ this.props.left = this.body.domProps.left.width + this.body.domProps.border.left;
+
+ // update class name
+ frame.className = 'vis-itemset';
+
+ // reorder the groups (if needed)
+ resized = this._orderGroups() || resized;
+
+ // check whether zoomed (in that case we need to re-stack everything)
+ // TODO: would be nicer to get this as a trigger from Range
+ var visibleInterval = range.end - range.start;
+ var zoomed = visibleInterval != this.lastVisibleInterval || this.props.width != this.props.lastWidth;
+ if (zoomed) this.stackDirty = true;
+ this.lastVisibleInterval = visibleInterval;
+ this.props.lastWidth = this.props.width;
+
+ var restack = this.stackDirty;
+ var firstGroup = this._firstGroup();
+ var firstMargin = {
+ item: margin.item,
+ axis: margin.axis
+ };
+ var nonFirstMargin = {
+ item: margin.item,
+ axis: margin.item.vertical / 2
+ };
+ var height = 0;
+ var minHeight = margin.axis + margin.item.vertical;
+
+ // redraw the background group
+ this.groups[BACKGROUND].redraw(range, nonFirstMargin, restack);
+
+ // redraw all regular groups
+ util.forEach(this.groups, function (group) {
+ var groupMargin = group == firstGroup ? firstMargin : nonFirstMargin;
+ var groupResized = group.redraw(range, groupMargin, restack);
+ resized = groupResized || resized;
+ height += group.height;
+ });
+ height = Math.max(height, minHeight);
+ this.stackDirty = false;
+
+ // update frame height
+ frame.style.height = asSize(height);
+
+ // calculate actual size
+ this.props.width = frame.offsetWidth;
+ this.props.height = height;
+
+ // reposition axis
+ this.dom.axis.style.top = asSize(orientation == 'top' ? this.body.domProps.top.height + this.body.domProps.border.top : this.body.domProps.top.height + this.body.domProps.centerContainer.height);
+ this.dom.axis.style.left = '0';
+
+ // check if this component is resized
+ resized = this._isResized() || resized;
+
+ return resized;
+ };
+
+ /**
+ * Get the first group, aligned with the axis
+ * @return {Group | null} firstGroup
+ * @private
+ */
+ ItemSet.prototype._firstGroup = function () {
+ var firstGroupIndex = this.options.orientation.item == 'top' ? 0 : this.groupIds.length - 1;
+ var firstGroupId = this.groupIds[firstGroupIndex];
+ var firstGroup = this.groups[firstGroupId] || this.groups[UNGROUPED];
+
+ return firstGroup || null;
+ };
+
+ /**
+ * Create or delete the group holding all ungrouped items. This group is used when
+ * there are no groups specified.
+ * @protected
+ */
+ ItemSet.prototype._updateUngrouped = function () {
+ var ungrouped = this.groups[UNGROUPED];
+ var background = this.groups[BACKGROUND];
+ var item, itemId;
+
+ if (this.groupsData) {
+ // remove the group holding all ungrouped items
+ if (ungrouped) {
+ ungrouped.hide();
+ delete this.groups[UNGROUPED];
+
+ for (itemId in this.items) {
+ if (this.items.hasOwnProperty(itemId)) {
+ item = this.items[itemId];
+ item.parent && item.parent.remove(item);
+ var groupId = this._getGroupId(item.data);
+ var group = this.groups[groupId];
+ group && group.add(item) || item.hide();
+ }
+ }
+ }
+ } else {
+ // create a group holding all (unfiltered) items
+ if (!ungrouped) {
+ var id = null;
+ var data = null;
+ ungrouped = new Group(id, data, this);
+ this.groups[UNGROUPED] = ungrouped;
+
+ for (itemId in this.items) {
+ if (this.items.hasOwnProperty(itemId)) {
+ item = this.items[itemId];
+ ungrouped.add(item);
+ }
+ }
+
+ ungrouped.show();
+ }
+ }
+ };
+
+ /**
+ * Get the element for the labelset
+ * @return {HTMLElement} labelSet
+ */
+ ItemSet.prototype.getLabelSet = function () {
+ return this.dom.labelSet;
+ };
+
+ /**
+ * Set items
+ * @param {vis.DataSet | null} items
+ */
+ ItemSet.prototype.setItems = function (items) {
+ var me = this,
+ ids,
+ oldItemsData = this.itemsData;
+
+ // replace the dataset
+ if (!items) {
+ this.itemsData = null;
+ } else if (items instanceof DataSet || items instanceof DataView) {
+ this.itemsData = items;
+ } else {
+ throw new TypeError('Data must be an instance of DataSet or DataView');
+ }
+
+ if (oldItemsData) {
+ // unsubscribe from old dataset
+ util.forEach(this.itemListeners, function (callback, event) {
+ oldItemsData.off(event, callback);
+ });
+
+ // remove all drawn items
+ ids = oldItemsData.getIds();
+ this._onRemove(ids);
+ }
+
+ if (this.itemsData) {
+ // subscribe to new dataset
+ var id = this.id;
+ util.forEach(this.itemListeners, function (callback, event) {
+ me.itemsData.on(event, callback, id);
+ });
+
+ // add all new items
+ ids = this.itemsData.getIds();
+ this._onAdd(ids);
+
+ // update the group holding all ungrouped items
+ this._updateUngrouped();
+ }
+ };
+
+ /**
+ * Get the current items
+ * @returns {vis.DataSet | null}
+ */
+ ItemSet.prototype.getItems = function () {
+ return this.itemsData;
+ };
+
+ /**
+ * Set groups
+ * @param {vis.DataSet} groups
+ */
+ ItemSet.prototype.setGroups = function (groups) {
+ var me = this,
+ ids;
+
+ // unsubscribe from current dataset
+ if (this.groupsData) {
+ util.forEach(this.groupListeners, function (callback, event) {
+ me.groupsData.off(event, callback);
+ });
+
+ // remove all drawn groups
+ ids = this.groupsData.getIds();
+ this.groupsData = null;
+ this._onRemoveGroups(ids); // note: this will cause a redraw
+ }
+
+ // replace the dataset
+ if (!groups) {
+ this.groupsData = null;
+ } else if (groups instanceof DataSet || groups instanceof DataView) {
+ this.groupsData = groups;
+ } else {
+ throw new TypeError('Data must be an instance of DataSet or DataView');
+ }
+
+ if (this.groupsData) {
+ // subscribe to new dataset
+ var id = this.id;
+ util.forEach(this.groupListeners, function (callback, event) {
+ me.groupsData.on(event, callback, id);
+ });
+
+ // draw all ms
+ ids = this.groupsData.getIds();
+ this._onAddGroups(ids);
+ }
+
+ // update the group holding all ungrouped items
+ this._updateUngrouped();
+
+ // update the order of all items in each group
+ this._order();
+
+ this.body.emitter.emit('change', { queue: true });
+ };
+
+ /**
+ * Get the current groups
+ * @returns {vis.DataSet | null} groups
+ */
+ ItemSet.prototype.getGroups = function () {
+ return this.groupsData;
+ };
+
+ /**
+ * Remove an item by its id
+ * @param {String | Number} id
+ */
+ ItemSet.prototype.removeItem = function (id) {
+ var item = this.itemsData.get(id),
+ dataset = this.itemsData.getDataSet();
+
+ if (item) {
+ // confirm deletion
+ this.options.onRemove(item, function (item) {
+ if (item) {
+ // remove by id here, it is possible that an item has no id defined
+ // itself, so better not delete by the item itself
+ dataset.remove(id);
+ }
+ });
+ }
+ };
+
+ /**
+ * Get the time of an item based on it's data and options.type
+ * @param {Object} itemData
+ * @returns {string} Returns the type
+ * @private
+ */
+ ItemSet.prototype._getType = function (itemData) {
+ return itemData.type || this.options.type || (itemData.end ? 'range' : 'box');
+ };
+
+ /**
+ * Get the group id for an item
+ * @param {Object} itemData
+ * @returns {string} Returns the groupId
+ * @private
+ */
+ ItemSet.prototype._getGroupId = function (itemData) {
+ var type = this._getType(itemData);
+ if (type == 'background' && itemData.group == undefined) {
+ return BACKGROUND;
+ } else {
+ return this.groupsData ? itemData.group : UNGROUPED;
+ }
+ };
+
+ /**
+ * Handle updated items
+ * @param {Number[]} ids
+ * @protected
+ */
+ ItemSet.prototype._onUpdate = function (ids) {
+ var me = this;
+
+ ids.forEach((function (id) {
+ var itemData = me.itemsData.get(id, me.itemOptions);
+ var item = me.items[id];
+ var type = me._getType(itemData);
+
+ var constructor = ItemSet.types[type];
+ var selected;
+
+ if (item) {
+ // update item
+ if (!constructor || !(item instanceof constructor)) {
+ // item type has changed, delete the item and recreate it
+ selected = item.selected; // preserve selection of this item
+ me._removeItem(item);
+ item = null;
+ } else {
+ me._updateItem(item, itemData);
+ }
+ }
+
+ if (!item) {
+ // create item
+ if (constructor) {
+ item = new constructor(itemData, me.conversion, me.options);
+ item.id = id; // TODO: not so nice setting id afterwards
+ me._addItem(item);
+ if (selected) {
+ this.selection.push(id);
+ item.select();
+ }
+ } else if (type == 'rangeoverflow') {
+ // TODO: deprecated since version 2.1.0 (or 3.0.0?). cleanup some day
+ throw new TypeError('Item type "rangeoverflow" is deprecated. Use css styling instead: ' + '.vis-item.vis-range .vis-item-content {overflow: visible;}');
+ } else {
+ throw new TypeError('Unknown item type "' + type + '"');
+ }
+ }
+ }).bind(this));
+
+ this._order();
+ this.stackDirty = true; // force re-stacking of all items next redraw
+ this.body.emitter.emit('change', { queue: true });
+ };
+
+ /**
+ * Handle added items
+ * @param {Number[]} ids
+ * @protected
+ */
+ ItemSet.prototype._onAdd = ItemSet.prototype._onUpdate;
+
+ /**
+ * Handle removed items
+ * @param {Number[]} ids
+ * @protected
+ */
+ ItemSet.prototype._onRemove = function (ids) {
+ var count = 0;
+ var me = this;
+ ids.forEach(function (id) {
+ var item = me.items[id];
+ if (item) {
+ count++;
+ me._removeItem(item);
+ }
+ });
+
+ if (count) {
+ // update order
+ this._order();
+ this.stackDirty = true; // force re-stacking of all items next redraw
+ this.body.emitter.emit('change', { queue: true });
+ }
+ };
+
+ /**
+ * Update the order of item in all groups
+ * @private
+ */
+ ItemSet.prototype._order = function () {
+ // reorder the items in all groups
+ // TODO: optimization: only reorder groups affected by the changed items
+ util.forEach(this.groups, function (group) {
+ group.order();
+ });
+ };
+
+ /**
+ * Handle updated groups
+ * @param {Number[]} ids
+ * @private
+ */
+ ItemSet.prototype._onUpdateGroups = function (ids) {
+ this._onAddGroups(ids);
+ };
+
+ /**
+ * Handle changed groups (added or updated)
+ * @param {Number[]} ids
+ * @private
+ */
+ ItemSet.prototype._onAddGroups = function (ids) {
+ var me = this;
+
+ ids.forEach(function (id) {
+ var groupData = me.groupsData.get(id);
+ var group = me.groups[id];
+
+ if (!group) {
+ // check for reserved ids
+ if (id == UNGROUPED || id == BACKGROUND) {
+ throw new Error('Illegal group id. ' + id + ' is a reserved id.');
+ }
+
+ var groupOptions = Object.create(me.options);
+ util.extend(groupOptions, {
+ height: null
+ });
+
+ group = new Group(id, groupData, me);
+ me.groups[id] = group;
+
+ // add items with this groupId to the new group
+ for (var itemId in me.items) {
+ if (me.items.hasOwnProperty(itemId)) {
+ var item = me.items[itemId];
+ if (item.data.group == id) {
+ group.add(item);
+ }
+ }
+ }
+
+ group.order();
+ group.show();
+ } else {
+ // update group
+ group.setData(groupData);
+ }
+ });
+
+ this.body.emitter.emit('change', { queue: true });
+ };
+
+ /**
+ * Handle removed groups
+ * @param {Number[]} ids
+ * @private
+ */
+ ItemSet.prototype._onRemoveGroups = function (ids) {
+ var groups = this.groups;
+ ids.forEach(function (id) {
+ var group = groups[id];
+
+ if (group) {
+ group.hide();
+ delete groups[id];
+ }
+ });
+
+ this.markDirty();
+
+ this.body.emitter.emit('change', { queue: true });
+ };
+
+ /**
+ * Reorder the groups if needed
+ * @return {boolean} changed
+ * @private
+ */
+ ItemSet.prototype._orderGroups = function () {
+ if (this.groupsData) {
+ // reorder the groups
+ var groupIds = this.groupsData.getIds({
+ order: this.options.groupOrder
+ });
+
+ var changed = !util.equalArray(groupIds, this.groupIds);
+ if (changed) {
+ // hide all groups, removes them from the DOM
+ var groups = this.groups;
+ groupIds.forEach(function (groupId) {
+ groups[groupId].hide();
+ });
+
+ // show the groups again, attach them to the DOM in correct order
+ groupIds.forEach(function (groupId) {
+ groups[groupId].show();
+ });
+
+ this.groupIds = groupIds;
+ }
+
+ return changed;
+ } else {
+ return false;
+ }
+ };
+
+ /**
+ * Add a new item
+ * @param {Item} item
+ * @private
+ */
+ ItemSet.prototype._addItem = function (item) {
+ this.items[item.id] = item;
+
+ // add to group
+ var groupId = this._getGroupId(item.data);
+ var group = this.groups[groupId];
+ if (group) group.add(item);
+ };
+
+ /**
+ * Update an existing item
+ * @param {Item} item
+ * @param {Object} itemData
+ * @private
+ */
+ ItemSet.prototype._updateItem = function (item, itemData) {
+ var oldGroupId = item.data.group;
+ var oldSubGroupId = item.data.subgroup;
+
+ // update the items data (will redraw the item when displayed)
+ item.setData(itemData);
+
+ // update group
+ if (oldGroupId != item.data.group || oldSubGroupId != item.data.subgroup) {
+ var oldGroup = this.groups[oldGroupId];
+ if (oldGroup) oldGroup.remove(item);
+
+ var groupId = this._getGroupId(item.data);
+ var group = this.groups[groupId];
+ if (group) group.add(item);
+ }
+ };
+
+ /**
+ * Delete an item from the ItemSet: remove it from the DOM, from the map
+ * with items, and from the map with visible items, and from the selection
+ * @param {Item} item
+ * @private
+ */
+ ItemSet.prototype._removeItem = function (item) {
+ // remove from DOM
+ item.hide();
+
+ // remove from items
+ delete this.items[item.id];
+
+ // remove from selection
+ var index = this.selection.indexOf(item.id);
+ if (index != -1) this.selection.splice(index, 1);
+
+ // remove from group
+ item.parent && item.parent.remove(item);
+ };
+
+ /**
+ * Create an array containing all items being a range (having an end date)
+ * @param array
+ * @returns {Array}
+ * @private
+ */
+ ItemSet.prototype._constructByEndArray = function (array) {
+ var endArray = [];
+
+ for (var i = 0; i < array.length; i++) {
+ if (array[i] instanceof RangeItem) {
+ endArray.push(array[i]);
+ }
+ }
+ return endArray;
+ };
+
+ /**
+ * Register the clicked item on touch, before dragStart is initiated.
+ *
+ * dragStart is initiated from a mousemove event, AFTER the mouse/touch is
+ * already moving. Therefore, the mouse/touch can sometimes be above an other
+ * DOM element than the item itself.
+ *
+ * @param {Event} event
+ * @private
+ */
+ ItemSet.prototype._onTouch = function (event) {
+ // store the touched item, used in _onDragStart
+ this.touchParams.item = this.itemFromTarget(event);
+ this.touchParams.dragLeftItem = event.target.dragLeftItem || false;
+ this.touchParams.dragRightItem = event.target.dragRightItem || false;
+ this.touchParams.itemProps = null;
+ };
+
+ /**
+ * Given an group id, returns the index it has.
+ *
+ * @param {Number} groupID
+ * @private
+ */
+ ItemSet.prototype._getGroupIndex = function (groupId) {
+ for (var i = 0; i < this.groupIds.length; i++) {
+ if (groupId == this.groupIds[i]) return i;
+ }
+ };
+
+ /**
+ * Start dragging the selected events
+ * @param {Event} event
+ * @private
+ */
+ ItemSet.prototype._onDragStart = function (event) {
+ var item = this.touchParams.item || null;
+ var me = this;
+ var props;
+
+ if (item && item.selected) {
+
+ if (!this.options.editable.updateTime && !this.options.editable.updateGroup && !item.editable) {
+ return;
+ }
+
+ // override options.editable
+ if (item.editable === false) {
+ return;
+ }
+
+ var dragLeftItem = this.touchParams.dragLeftItem;
+ var dragRightItem = this.touchParams.dragRightItem;
+
+ if (dragLeftItem) {
+ props = {
+ item: dragLeftItem,
+ initialX: event.center.x,
+ dragLeft: true,
+ data: this._cloneItemData(item.data)
+ };
+
+ this.touchParams.itemProps = [props];
+ } else if (dragRightItem) {
+ props = {
+ item: dragRightItem,
+ initialX: event.center.x,
+ dragRight: true,
+ data: this._cloneItemData(item.data)
+ };
+
+ this.touchParams.itemProps = [props];
+ } else {
+ this.touchParams.selectedItem = item;
+
+ var baseGroupIndex = this._getGroupIndex(item.data.group);
+
+ this.touchParams.itemProps = this.getSelection().map((function (id) {
+ var item = me.items[id];
+ var groupIndex = me._getGroupIndex(item.data.group);
+ return {
+ item: item,
+ initialX: event.center.x,
+ groupOffset: baseGroupIndex - groupIndex,
+ data: this._cloneItemData(item.data)
+ };
+ }).bind(this));
+ }
+
+ event.stopPropagation();
+ } else if (this.options.editable.add && (event.srcEvent.ctrlKey || event.srcEvent.metaKey)) {
+ // create a new range item when dragging with ctrl key down
+ this._onDragStartAddItem(event);
+ }
+ };
+
+ /**
+ * Start creating a new range item by dragging.
+ * @param {Event} event
+ * @private
+ */
+ ItemSet.prototype._onDragStartAddItem = function (event) {
+ var snap = this.options.snap || null;
+ var xAbs = util.getAbsoluteLeft(this.dom.frame);
+ var x = event.center.x - xAbs - 10; // minus 10 to compensate for the drag starting as soon as you've moved 10px
+ var time = this.body.util.toTime(x);
+ var scale = this.body.util.getScale();
+ var step = this.body.util.getStep();
+ var start = snap ? snap(time, scale, step) : start;
+ var end = start;
+
+ var itemData = {
+ type: 'range',
+ start: start,
+ end: end,
+ content: 'new item'
+ };
+
+ var id = util.randomUUID();
+ itemData[this.itemsData._fieldId] = id;
+
+ var group = this.groupFromTarget(event);
+ if (group) {
+ itemData.group = group.groupId;
+ }
+
+ var newItem = new RangeItem(itemData, this.conversion, this.options);
+ newItem.id = id; // TODO: not so nice setting id afterwards
+ newItem.data = this._cloneItemData(itemData);
+ this._addItem(newItem);
+
+ var props = {
+ item: newItem,
+ dragRight: true,
+ initialX: event.center.x,
+ data: newItem.data
+ };
+ this.touchParams.itemProps = [props];
+
+ event.stopPropagation();
+ };
+
+ /**
+ * Drag selected items
+ * @param {Event} event
+ * @private
+ */
+ ItemSet.prototype._onDrag = function (event) {
+ if (this.touchParams.itemProps) {
+ event.stopPropagation();
+
+ var me = this;
+ var snap = this.options.snap || null;
+ var xOffset = this.body.dom.root.offsetLeft + this.body.domProps.left.width;
+ var scale = this.body.util.getScale();
+ var step = this.body.util.getStep();
+
+ //only calculate the new group for the item that's actually dragged
+ var selectedItem = this.touchParams.selectedItem;
+ var updateGroupAllowed = me.options.editable.updateGroup;
+ var newGroupBase = null;
+ if (updateGroupAllowed && selectedItem) {
+ if (selectedItem.data.group != undefined) {
+ // drag from one group to another
+ var group = me.groupFromTarget(event);
+ if (group) {
+ //we know the offset for all items, so the new group for all items
+ //will be relative to this one.
+ newGroupBase = this._getGroupIndex(group.groupId);
+ }
+ }
+ }
+
+ // move
+ this.touchParams.itemProps.forEach((function (props) {
+ var current = me.body.util.toTime(event.center.x - xOffset);
+ var initial = me.body.util.toTime(props.initialX - xOffset);
+ var offset = current - initial; // ms
+
+ var itemData = this._cloneItemData(props.item.data); // clone the data
+ if (props.item.editable === false) {
+ return;
+ }
+
+ var updateTimeAllowed = me.options.editable.updateTime || props.item.editable === true;
+
+ if (updateTimeAllowed) {
+ if (props.dragLeft) {
+ // drag left side of a range item
+ if (itemData.start != undefined) {
+ var initialStart = util.convert(props.data.start, 'Date');
+ var start = new Date(initialStart.valueOf() + offset);
+ // TODO: pass a Moment instead of a Date to snap(). (Breaking change)
+ itemData.start = snap ? snap(start, scale, step) : start;
+ }
+ } else if (props.dragRight) {
+ // drag right side of a range item
+ if (itemData.end != undefined) {
+ var initialEnd = util.convert(props.data.end, 'Date');
+ var end = new Date(initialEnd.valueOf() + offset);
+ // TODO: pass a Moment instead of a Date to snap(). (Breaking change)
+ itemData.end = snap ? snap(end, scale, step) : end;
+ }
+ } else {
+ // drag both start and end
+ if (itemData.start != undefined) {
+ var initialStart = util.convert(props.data.start, 'Date').valueOf();
+ var start = new Date(initialStart + offset);
+
+ if (itemData.end != undefined) {
+ var initialEnd = util.convert(props.data.end, 'Date');
+ var duration = initialEnd.valueOf() - initialStart.valueOf();
+
+ // TODO: pass a Moment instead of a Date to snap(). (Breaking change)
+ itemData.start = snap ? snap(start, scale, step) : start;
+ itemData.end = new Date(itemData.start.valueOf() + duration);
+ } else {
+ // TODO: pass a Moment instead of a Date to snap(). (Breaking change)
+ itemData.start = snap ? snap(start, scale, step) : start;
+ }
+ }
+ }
+ }
+
+ var updateGroupAllowed = me.options.editable.updateGroup || props.item.editable === true;
+
+ if (updateGroupAllowed && (!props.dragLeft && !props.dragRight) && newGroupBase != null) {
+ if (itemData.group != undefined) {
+ var newOffset = newGroupBase - props.groupOffset;
+
+ //make sure we stay in bounds
+ newOffset = Math.max(0, newOffset);
+ newOffset = Math.min(me.groupIds.length - 1, newOffset);
+
+ itemData.group = me.groupIds[newOffset];
+ }
+ }
+
+ // confirm moving the item
+ itemData = this._cloneItemData(itemData); // convert start and end to the correct type
+ me.options.onMoving(itemData, (function (itemData) {
+ if (itemData) {
+ props.item.setData(this._cloneItemData(itemData, 'Date'));
+ }
+ }).bind(this));
+ }).bind(this));
+
+ this.stackDirty = true; // force re-stacking of all items next redraw
+ this.body.emitter.emit('change');
+ }
+ };
+
+ /**
+ * Move an item to another group
+ * @param {Item} item
+ * @param {String | Number} groupId
+ * @private
+ */
+ ItemSet.prototype._moveToGroup = function (item, groupId) {
+ var group = this.groups[groupId];
+ if (group && group.groupId != item.data.group) {
+ var oldGroup = item.parent;
+ oldGroup.remove(item);
+ oldGroup.order();
+ group.add(item);
+ group.order();
+
+ item.data.group = group.groupId;
+ }
+ };
+
+ /**
+ * End of dragging selected items
+ * @param {Event} event
+ * @private
+ */
+ ItemSet.prototype._onDragEnd = function (event) {
+ if (this.touchParams.itemProps) {
+ event.stopPropagation();
+
+ var me = this;
+ var dataset = this.itemsData.getDataSet();
+ var itemProps = this.touchParams.itemProps;
+ this.touchParams.itemProps = null;
+
+ itemProps.forEach((function (props) {
+ var id = props.item.id;
+ var exists = me.itemsData.get(id, me.itemOptions) != null;
+
+ if (!exists) {
+ // add a new item
+ me.options.onAdd(props.item.data, function (itemData) {
+ me._removeItem(props.item); // remove temporary item
+ if (itemData) {
+ me.itemsData.getDataSet().add(itemData);
+ }
+
+ // force re-stacking of all items next redraw
+ me.stackDirty = true;
+ me.body.emitter.emit('change');
+ });
+ } else {
+ // update existing item
+ var itemData = this._cloneItemData(props.item.data); // convert start and end to the correct type
+ me.options.onMove(itemData, function (itemData) {
+ if (itemData) {
+ // apply changes
+ itemData[dataset._fieldId] = id; // ensure the item contains its id (can be undefined)
+ dataset.update(itemData);
+ } else {
+ // restore original values
+ props.item.setData(props.data);
+
+ me.stackDirty = true; // force re-stacking of all items next redraw
+ me.body.emitter.emit('change');
+ }
+ });
+ }
+ }).bind(this));
+ }
+ };
+
+ ItemSet.prototype._onGroupDragStart = function (event) {
+ if (this.options.groupEditable.order) {
+ this.groupTouchParams.group = this.groupFromTarget(event);
+
+ if (this.groupTouchParams.group) {
+ event.stopPropagation();
+
+ this.groupTouchParams.originalOrder = this.groupsData.getIds({
+ order: this.options.groupOrder
+ });
+ }
+ }
+ };
+
+ ItemSet.prototype._onGroupDrag = function (event) {
+ if (this.options.groupEditable.order && this.groupTouchParams.group) {
+ event.stopPropagation();
+
+ // drag from one group to another
+ var group = this.groupFromTarget(event);
+
+ // try to avoid toggling when groups differ in height
+ if (group && group.height != this.groupTouchParams.group.height) {
+ var movingUp = group.top < this.groupTouchParams.group.top;
+ var clientY = event.center ? event.center.y : event.clientY;
+ var targetGroupTop = util.getAbsoluteTop(group.dom.foreground);
+ var draggedGroupHeight = this.groupTouchParams.group.height;
+ if (movingUp) {
+ // skip swapping the groups when the dragged group is not below clientY afterwards
+ if (targetGroupTop + draggedGroupHeight < clientY) {
+ return;
+ }
+ } else {
+ var targetGroupHeight = group.height;
+ // skip swapping the groups when the dragged group is not below clientY afterwards
+ if (targetGroupTop + targetGroupHeight - draggedGroupHeight > clientY) {
+ return;
+ }
+ }
+ }
+
+ if (group && group != this.groupTouchParams.group) {
+ var groupsData = this.groupsData;
+ var targetGroup = groupsData.get(group.groupId);
+ var draggedGroup = groupsData.get(this.groupTouchParams.group.groupId);
+
+ // switch groups
+ if (draggedGroup && targetGroup) {
+ this.options.groupOrderSwap(draggedGroup, targetGroup, this.groupsData);
+ this.groupsData.update(draggedGroup);
+ this.groupsData.update(targetGroup);
+ }
+
+ // fetch current order of groups
+ var newOrder = this.groupsData.getIds({
+ order: this.options.groupOrder
+ });
+
+ // in case of changes since _onGroupDragStart
+ if (!util.equalArray(newOrder, this.groupTouchParams.originalOrder)) {
+ var groupsData = this.groupsData;
+ var origOrder = this.groupTouchParams.originalOrder;
+ var draggedId = this.groupTouchParams.group.groupId;
+ var numGroups = Math.min(origOrder.length, newOrder.length);
+ var curPos = 0;
+ var newOffset = 0;
+ var orgOffset = 0;
+ while (curPos < numGroups) {
+ // as long as the groups are where they should be step down along the groups order
+ while (curPos + newOffset < numGroups && curPos + orgOffset < numGroups && newOrder[curPos + newOffset] == origOrder[curPos + orgOffset]) {
+ curPos++;
+ }
+
+ // all ok
+ if (curPos + newOffset >= numGroups) {
+ break;
+ }
+
+ // not all ok
+ // if dragged group was move upwards everything below should have an offset
+ if (newOrder[curPos + newOffset] == draggedId) {
+ newOffset = 1;
+ continue;
+ }
+ // if dragged group was move downwards everything above should have an offset
+ else if (origOrder[curPos + orgOffset] == draggedId) {
+ orgOffset = 1;
+ continue;
+ }
+ // found a group (apart from dragged group) that has the wrong position -> switch with the
+ // group at the position where other one should be, fix index arrays and continue
+ else {
+ var slippedPosition = newOrder.indexOf(origOrder[curPos + orgOffset]);
+ var switchGroup = groupsData.get(newOrder[curPos + newOffset]);
+ var shouldBeGroup = groupsData.get(origOrder[curPos + orgOffset]);
+ this.options.groupOrderSwap(switchGroup, shouldBeGroup, groupsData);
+ groupsData.update(switchGroup);
+ groupsData.update(shouldBeGroup);
+
+ var switchGroupId = newOrder[curPos + newOffset];
+ newOrder[curPos + newOffset] = origOrder[curPos + orgOffset];
+ newOrder[slippedPosition] = switchGroupId;
+
+ curPos++;
+ }
+ }
+ }
+ }
+ }
+ };
+
+ ItemSet.prototype._onGroupDragEnd = function (event) {
+ if (this.options.groupEditable.order && this.groupTouchParams.group) {
+ event.stopPropagation();
+
+ // update existing group
+ var me = this;
+ var id = me.groupTouchParams.group.groupId;
+ var dataset = me.groupsData.getDataSet();
+ var groupData = util.extend({}, dataset.get(id)); // clone the data
+ me.options.onMoveGroup(groupData, function (groupData) {
+ if (groupData) {
+ // apply changes
+ groupData[dataset._fieldId] = id; // ensure the group contains its id (can be undefined)
+ dataset.update(groupData);
+ } else {
+
+ // fetch current order of groups
+ var newOrder = dataset.getIds({
+ order: me.options.groupOrder
+ });
+
+ // restore original order
+ if (!util.equalArray(newOrder, me.groupTouchParams.originalOrder)) {
+ var origOrder = me.groupTouchParams.originalOrder;
+ var numGroups = Math.min(origOrder.length, newOrder.length);
+ var curPos = 0;
+ while (curPos < numGroups) {
+ // as long as the groups are where they should be step down along the groups order
+ while (curPos < numGroups && newOrder[curPos] == origOrder[curPos]) {
+ curPos++;
+ }
+
+ // all ok
+ if (curPos >= numGroups) {
+ break;
+ }
+
+ // found a group that has the wrong position -> switch with the
+ // group at the position where other one should be, fix index arrays and continue
+ var slippedPosition = newOrder.indexOf(origOrder[curPos]);
+ var switchGroup = dataset.get(newOrder[curPos]);
+ var shouldBeGroup = dataset.get(origOrder[curPos]);
+ me.options.groupOrderSwap(switchGroup, shouldBeGroup, dataset);
+ groupsData.update(switchGroup);
+ groupsData.update(shouldBeGroup);
+
+ var switchGroupId = newOrder[curPos];
+ newOrder[curPos] = origOrder[curPos];
+ newOrder[slippedPosition] = switchGroupId;
+
+ curPos++;
+ }
+ }
+ }
+ });
+
+ me.body.emitter.emit('groupDragged', { groupId: id });
+ }
+ };
+
+ /**
+ * Handle selecting/deselecting an item when tapping it
+ * @param {Event} event
+ * @private
+ */
+ ItemSet.prototype._onSelectItem = function (event) {
+ if (!this.options.selectable) return;
+
+ var ctrlKey = event.srcEvent && (event.srcEvent.ctrlKey || event.srcEvent.metaKey);
+ var shiftKey = event.srcEvent && event.srcEvent.shiftKey;
+ if (ctrlKey || shiftKey) {
+ this._onMultiSelectItem(event);
+ return;
+ }
+
+ var oldSelection = this.getSelection();
+
+ var item = this.itemFromTarget(event);
+ var selection = item ? [item.id] : [];
+ this.setSelection(selection);
+
+ var newSelection = this.getSelection();
+
+ // emit a select event,
+ // except when old selection is empty and new selection is still empty
+ if (newSelection.length > 0 || oldSelection.length > 0) {
+ this.body.emitter.emit('select', {
+ items: newSelection,
+ event: event
+ });
+ }
+ };
+
+ /**
+ * Handle creation and updates of an item on double tap
+ * @param event
+ * @private
+ */
+ ItemSet.prototype._onAddItem = function (event) {
+ if (!this.options.selectable) return;
+ if (!this.options.editable.add) return;
+
+ var me = this;
+ var snap = this.options.snap || null;
+ var item = this.itemFromTarget(event);
+
+ event.stopPropagation();
+
+ if (item) {
+ // update item
+
+ // execute async handler to update the item (or cancel it)
+ var itemData = me.itemsData.get(item.id); // get a clone of the data from the dataset
+ this.options.onUpdate(itemData, function (itemData) {
+ if (itemData) {
+ me.itemsData.getDataSet().update(itemData);
+ }
+ });
+ } else {
+ // add item
+ var xAbs = util.getAbsoluteLeft(this.dom.frame);
+ var x = event.center.x - xAbs;
+ var start = this.body.util.toTime(x);
+ var scale = this.body.util.getScale();
+ var step = this.body.util.getStep();
+
+ var newItemData = {
+ start: snap ? snap(start, scale, step) : start,
+ content: 'new item'
+ };
+
+ // when default type is a range, add a default end date to the new item
+ if (this.options.type === 'range') {
+ var end = this.body.util.toTime(x + this.props.width / 5);
+ newItemData.end = snap ? snap(end, scale, step) : end;
+ }
+
+ newItemData[this.itemsData._fieldId] = util.randomUUID();
+
+ var group = this.groupFromTarget(event);
+ if (group) {
+ newItemData.group = group.groupId;
+ }
+
+ // execute async handler to customize (or cancel) adding an item
+ newItemData = this._cloneItemData(newItemData); // convert start and end to the correct type
+ this.options.onAdd(newItemData, function (item) {
+ if (item) {
+ me.itemsData.getDataSet().add(item);
+ // TODO: need to trigger a redraw?
+ }
+ });
+ }
+ };
+
+ /**
+ * Handle selecting/deselecting multiple items when holding an item
+ * @param {Event} event
+ * @private
+ */
+ ItemSet.prototype._onMultiSelectItem = function (event) {
+ if (!this.options.selectable) return;
+
+ var item = this.itemFromTarget(event);
+
+ if (item) {
+ // multi select items (if allowed)
+
+ var selection = this.options.multiselect ? this.getSelection() // take current selection
+ : []; // deselect current selection
+
+ var shiftKey = event.srcEvent && event.srcEvent.shiftKey || false;
+
+ if (shiftKey && this.options.multiselect) {
+ // select all items between the old selection and the tapped item
+
+ // determine the selection range
+ selection.push(item.id);
+ var range = ItemSet._getItemRange(this.itemsData.get(selection, this.itemOptions));
+
+ // select all items within the selection range
+ selection = [];
+ for (var id in this.items) {
+ if (this.items.hasOwnProperty(id)) {
+ var _item = this.items[id];
+ var start = _item.data.start;
+ var end = _item.data.end !== undefined ? _item.data.end : start;
+
+ if (start >= range.min && end <= range.max && !(_item instanceof BackgroundItem)) {
+ selection.push(_item.id); // do not use id but item.id, id itself is stringified
+ }
+ }
+ }
+ } else {
+ // add/remove this item from the current selection
+ var index = selection.indexOf(item.id);
+ if (index == -1) {
+ // item is not yet selected -> select it
+ selection.push(item.id);
+ } else {
+ // item is already selected -> deselect it
+ selection.splice(index, 1);
+ }
+ }
+
+ this.setSelection(selection);
+
+ this.body.emitter.emit('select', {
+ items: this.getSelection(),
+ event: event
+ });
+ }
+ };
+
+ /**
+ * Calculate the time range of a list of items
+ * @param {Array.} itemsData
+ * @return {{min: Date, max: Date}} Returns the range of the provided items
+ * @private
+ */
+ ItemSet._getItemRange = function (itemsData) {
+ var max = null;
+ var min = null;
+
+ itemsData.forEach(function (data) {
+ if (min == null || data.start < min) {
+ min = data.start;
+ }
+
+ if (data.end != undefined) {
+ if (max == null || data.end > max) {
+ max = data.end;
+ }
+ } else {
+ if (max == null || data.start > max) {
+ max = data.start;
+ }
+ }
+ });
+
+ return {
+ min: min,
+ max: max
+ };
+ };
+
+ /**
+ * Find an item from an event target:
+ * searches for the attribute 'timeline-item' in the event target's element tree
+ * @param {Event} event
+ * @return {Item | null} item
+ */
+ ItemSet.prototype.itemFromTarget = function (event) {
+ var target = event.target;
+ while (target) {
+ if (target.hasOwnProperty('timeline-item')) {
+ return target['timeline-item'];
+ }
+ target = target.parentNode;
+ }
+
+ return null;
+ };
+
+ /**
+ * Find the Group from an event target:
+ * searches for the attribute 'timeline-group' in the event target's element tree
+ * @param {Event} event
+ * @return {Group | null} group
+ */
+ ItemSet.prototype.groupFromTarget = function (event) {
+ var clientY = event.center ? event.center.y : event.clientY;
+ for (var i = 0; i < this.groupIds.length; i++) {
+ var groupId = this.groupIds[i];
+ var group = this.groups[groupId];
+ var foreground = group.dom.foreground;
+ var top = util.getAbsoluteTop(foreground);
+ if (clientY > top && clientY < top + foreground.offsetHeight) {
+ return group;
+ }
+
+ if (this.options.orientation.item === 'top') {
+ if (i === this.groupIds.length - 1 && clientY > top) {
+ return group;
+ }
+ } else {
+ if (i === 0 && clientY < top + foreground.offset) {
+ return group;
+ }
+ }
+ }
+
+ return null;
+ };
+
+ /**
+ * Find the ItemSet from an event target:
+ * searches for the attribute 'timeline-itemset' in the event target's element tree
+ * @param {Event} event
+ * @return {ItemSet | null} item
+ */
+ ItemSet.itemSetFromTarget = function (event) {
+ var target = event.target;
+ while (target) {
+ if (target.hasOwnProperty('timeline-itemset')) {
+ return target['timeline-itemset'];
+ }
+ target = target.parentNode;
+ }
+
+ return null;
+ };
+
+ /**
+ * Clone the data of an item, and "normalize" it: convert the start and end date
+ * to the type (Date, Moment, ...) configured in the DataSet. If not configured,
+ * start and end are converted to Date.
+ * @param {Object} itemData, typically `item.data`
+ * @param {string} [type] Optional Date type. If not provided, the type from the DataSet is taken
+ * @return {Object} The cloned object
+ * @private
+ */
+ ItemSet.prototype._cloneItemData = function (itemData, type) {
+ var clone = util.extend({}, itemData);
+
+ if (!type) {
+ // convert start and end date to the type (Date, Moment, ...) configured in the DataSet
+ type = this.itemsData.getDataSet()._options.type;
+ }
+
+ if (clone.start != undefined) {
+ clone.start = util.convert(clone.start, type && type.start || 'Date');
+ }
+ if (clone.end != undefined) {
+ clone.end = util.convert(clone.end, type && type.end || 'Date');
+ }
+
+ return clone;
+ };
+
+ module.exports = ItemSet;
+
+/***/ },
+/* 30 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var moment = __webpack_require__(2);
+ var DateUtil = __webpack_require__(27);
+ var util = __webpack_require__(1);
+
+ /**
+ * @constructor TimeStep
+ * The class TimeStep is an iterator for dates. You provide a start date and an
+ * end date. The class itself determines the best scale (step size) based on the
+ * provided start Date, end Date, and minimumStep.
+ *
+ * If minimumStep is provided, the step size is chosen as close as possible
+ * to the minimumStep but larger than minimumStep. If minimumStep is not
+ * provided, the scale is set to 1 DAY.
+ * The minimumStep should correspond with the onscreen size of about 6 characters
+ *
+ * Alternatively, you can set a scale by hand.
+ * After creation, you can initialize the class by executing first(). Then you
+ * can iterate from the start date to the end date via next(). You can check if
+ * the end date is reached with the function hasNext(). After each step, you can
+ * retrieve the current date via getCurrent().
+ * The TimeStep has scales ranging from milliseconds, seconds, minutes, hours,
+ * days, to years.
+ *
+ * Version: 1.2
+ *
+ * @param {Date} [start] The start date, for example new Date(2010, 9, 21)
+ * or new Date(2010, 9, 21, 23, 45, 00)
+ * @param {Date} [end] The end date
+ * @param {Number} [minimumStep] Optional. Minimum step size in milliseconds
+ */
+ function TimeStep(start, end, minimumStep, hiddenDates) {
+ this.moment = moment;
+
+ // variables
+ this.current = this.moment();
+ this._start = this.moment();
+ this._end = this.moment();
+
+ this.autoScale = true;
+ this.scale = 'day';
+ this.step = 1;
+
+ // initialize the range
+ this.setRange(start, end, minimumStep);
+
+ // hidden Dates options
+ this.switchedDay = false;
+ this.switchedMonth = false;
+ this.switchedYear = false;
+ if (Array.isArray(hiddenDates)) {
+ this.hiddenDates = hiddenDates;
+ } else if (hiddenDates != undefined) {
+ this.hiddenDates = [hiddenDates];
+ } else {
+ this.hiddenDates = [];
+ }
+
+ this.format = TimeStep.FORMAT; // default formatting
+ }
+
+ // Time formatting
+ TimeStep.FORMAT = {
+ minorLabels: {
+ millisecond: 'SSS',
+ second: 's',
+ minute: 'HH:mm',
+ hour: 'HH:mm',
+ weekday: 'ddd D',
+ day: 'D',
+ month: 'MMM',
+ year: 'YYYY'
+ },
+ majorLabels: {
+ millisecond: 'HH:mm:ss',
+ second: 'D MMMM HH:mm',
+ minute: 'ddd D MMMM',
+ hour: 'ddd D MMMM',
+ weekday: 'MMMM YYYY',
+ day: 'MMMM YYYY',
+ month: 'YYYY',
+ year: ''
+ }
+ };
+
+ /**
+ * Set custom constructor function for moment. Can be used to set dates
+ * to UTC or to set a utcOffset.
+ * @param {function} moment
+ */
+ TimeStep.prototype.setMoment = function (moment) {
+ this.moment = moment;
+
+ // update the date properties, can have a new utcOffset
+ this.current = this.moment(this.current);
+ this._start = this.moment(this._start);
+ this._end = this.moment(this._end);
+ };
+
+ /**
+ * Set custom formatting for the minor an major labels of the TimeStep.
+ * Both `minorLabels` and `majorLabels` are an Object with properties:
+ * 'millisecond', 'second', 'minute', 'hour', 'weekday', 'day', 'month', 'year'.
+ * @param {{minorLabels: Object, majorLabels: Object}} format
+ */
+ TimeStep.prototype.setFormat = function (format) {
+ var defaultFormat = util.deepExtend({}, TimeStep.FORMAT);
+ this.format = util.deepExtend(defaultFormat, format);
+ };
+
+ /**
+ * Set a new range
+ * If minimumStep is provided, the step size is chosen as close as possible
+ * to the minimumStep but larger than minimumStep. If minimumStep is not
+ * provided, the scale is set to 1 DAY.
+ * The minimumStep should correspond with the onscreen size of about 6 characters
+ * @param {Date} [start] The start date and time.
+ * @param {Date} [end] The end date and time.
+ * @param {int} [minimumStep] Optional. Minimum step size in milliseconds
+ */
+ TimeStep.prototype.setRange = function (start, end, minimumStep) {
+ if (!(start instanceof Date) || !(end instanceof Date)) {
+ throw 'No legal start or end date in method setRange';
+ }
+
+ this._start = start != undefined ? this.moment(start.valueOf()) : new Date();
+ this._end = end != undefined ? this.moment(end.valueOf()) : new Date();
+
+ if (this.autoScale) {
+ this.setMinimumStep(minimumStep);
+ }
+ };
+
+ /**
+ * Set the range iterator to the start date.
+ */
+ TimeStep.prototype.start = function () {
+ this.current = this._start.clone();
+ this.roundToMinor();
+ };
+
+ /**
+ * Round the current date to the first minor date value
+ * This must be executed once when the current date is set to start Date
+ */
+ TimeStep.prototype.roundToMinor = function () {
+ // round to floor
+ // IMPORTANT: we have no breaks in this switch! (this is no bug)
+ // noinspection FallThroughInSwitchStatementJS
+ switch (this.scale) {
+ case 'year':
+ this.current.year(this.step * Math.floor(this.current.year() / this.step));
+ this.current.month(0);
+ case 'month':
+ this.current.date(1);
+ case 'day': // intentional fall through
+ case 'weekday':
+ this.current.hours(0);
+ case 'hour':
+ this.current.minutes(0);
+ case 'minute':
+ this.current.seconds(0);
+ case 'second':
+ this.current.milliseconds(0);
+ //case 'millisecond': // nothing to do for milliseconds
+ }
+
+ if (this.step != 1) {
+ // round down to the first minor value that is a multiple of the current step size
+ switch (this.scale) {
+ case 'millisecond':
+ this.current.subtract(this.current.milliseconds() % this.step, 'milliseconds');break;
+ case 'second':
+ this.current.subtract(this.current.seconds() % this.step, 'seconds');break;
+ case 'minute':
+ this.current.subtract(this.current.minutes() % this.step, 'minutes');break;
+ case 'hour':
+ this.current.subtract(this.current.hours() % this.step, 'hours');break;
+ case 'weekday': // intentional fall through
+ case 'day':
+ this.current.subtract((this.current.date() - 1) % this.step, 'day');break;
+ case 'month':
+ this.current.subtract(this.current.month() % this.step, 'month');break;
+ case 'year':
+ this.current.subtract(this.current.year() % this.step, 'year');break;
+ default:
+ break;
+ }
+ }
+ };
+
+ /**
+ * Check if the there is a next step
+ * @return {boolean} true if the current date has not passed the end date
+ */
+ TimeStep.prototype.hasNext = function () {
+ return this.current.valueOf() <= this._end.valueOf();
+ };
+
+ /**
+ * Do the next step
+ */
+ TimeStep.prototype.next = function () {
+ var prev = this.current.valueOf();
+
+ // Two cases, needed to prevent issues with switching daylight savings
+ // (end of March and end of October)
+ if (this.current.month() < 6) {
+ switch (this.scale) {
+ case 'millisecond':
+ this.current.add(this.step, 'millisecond');break;
+ case 'second':
+ this.current.add(this.step, 'second');break;
+ case 'minute':
+ this.current.add(this.step, 'minute');break;
+ case 'hour':
+ this.current.add(this.step, 'hour');
+ // in case of skipping an hour for daylight savings, adjust the hour again (else you get: 0h 5h 9h ... instead of 0h 4h 8h ...)
+ // TODO: is this still needed now we use the function of moment.js?
+ this.current.subtract(this.current.hours() % this.step, 'hour');
+ break;
+ case 'weekday': // intentional fall through
+ case 'day':
+ this.current.add(this.step, 'day');break;
+ case 'month':
+ this.current.add(this.step, 'month');break;
+ case 'year':
+ this.current.add(this.step, 'year');break;
+ default:
+ break;
+ }
+ } else {
+ switch (this.scale) {
+ case 'millisecond':
+ this.current.add(this.step, 'millisecond');break;
+ case 'second':
+ this.current.add(this.step, 'second');break;
+ case 'minute':
+ this.current.add(this.step, 'minute');break;
+ case 'hour':
+ this.current.add(this.step, 'hour');break;
+ case 'weekday': // intentional fall through
+ case 'day':
+ this.current.add(this.step, 'day');break;
+ case 'month':
+ this.current.add(this.step, 'month');break;
+ case 'year':
+ this.current.add(this.step, 'year');break;
+ default:
+ break;
+ }
+ }
+
+ if (this.step != 1) {
+ // round down to the correct major value
+ switch (this.scale) {
+ case 'millisecond':
+ if (this.current.milliseconds() < this.step) this.current.milliseconds(0);break;
+ case 'second':
+ if (this.current.seconds() < this.step) this.current.seconds(0);break;
+ case 'minute':
+ if (this.current.minutes() < this.step) this.current.minutes(0);break;
+ case 'hour':
+ if (this.current.hours() < this.step) this.current.hours(0);break;
+ case 'weekday': // intentional fall through
+ case 'day':
+ if (this.current.date() < this.step + 1) this.current.date(1);break;
+ case 'month':
+ if (this.current.month() < this.step) this.current.month(0);break;
+ case 'year':
+ break; // nothing to do for year
+ default:
+ break;
+ }
+ }
+
+ // safety mechanism: if current time is still unchanged, move to the end
+ if (this.current.valueOf() == prev) {
+ this.current = this._end.clone();
+ }
+
+ DateUtil.stepOverHiddenDates(this.moment, this, prev);
+ };
+
+ /**
+ * Get the current datetime
+ * @return {Moment} current The current date
+ */
+ TimeStep.prototype.getCurrent = function () {
+ return this.current;
+ };
+
+ /**
+ * Set a custom scale. Autoscaling will be disabled.
+ * For example setScale('minute', 5) will result
+ * in minor steps of 5 minutes, and major steps of an hour.
+ *
+ * @param {{scale: string, step: number}} params
+ * An object containing two properties:
+ * - A string 'scale'. Choose from 'millisecond', 'second',
+ * 'minute', 'hour', 'weekday', 'day', 'month', 'year'.
+ * - A number 'step'. A step size, by default 1.
+ * Choose for example 1, 2, 5, or 10.
+ */
+ TimeStep.prototype.setScale = function (params) {
+ if (params && typeof params.scale == 'string') {
+ this.scale = params.scale;
+ this.step = params.step > 0 ? params.step : 1;
+ this.autoScale = false;
+ }
+ };
+
+ /**
+ * Enable or disable autoscaling
+ * @param {boolean} enable If true, autoascaling is set true
+ */
+ TimeStep.prototype.setAutoScale = function (enable) {
+ this.autoScale = enable;
+ };
+
+ /**
+ * Automatically determine the scale that bests fits the provided minimum step
+ * @param {Number} [minimumStep] The minimum step size in milliseconds
+ */
+ TimeStep.prototype.setMinimumStep = function (minimumStep) {
+ if (minimumStep == undefined) {
+ return;
+ }
+
+ //var b = asc + ds;
+
+ var stepYear = 1000 * 60 * 60 * 24 * 30 * 12;
+ var stepMonth = 1000 * 60 * 60 * 24 * 30;
+ var stepDay = 1000 * 60 * 60 * 24;
+ var stepHour = 1000 * 60 * 60;
+ var stepMinute = 1000 * 60;
+ var stepSecond = 1000;
+ var stepMillisecond = 1;
+
+ // find the smallest step that is larger than the provided minimumStep
+ if (stepYear * 1000 > minimumStep) {
+ this.scale = 'year';this.step = 1000;
+ }
+ if (stepYear * 500 > minimumStep) {
+ this.scale = 'year';this.step = 500;
+ }
+ if (stepYear * 100 > minimumStep) {
+ this.scale = 'year';this.step = 100;
+ }
+ if (stepYear * 50 > minimumStep) {
+ this.scale = 'year';this.step = 50;
+ }
+ if (stepYear * 10 > minimumStep) {
+ this.scale = 'year';this.step = 10;
+ }
+ if (stepYear * 5 > minimumStep) {
+ this.scale = 'year';this.step = 5;
+ }
+ if (stepYear > minimumStep) {
+ this.scale = 'year';this.step = 1;
+ }
+ if (stepMonth * 3 > minimumStep) {
+ this.scale = 'month';this.step = 3;
+ }
+ if (stepMonth > minimumStep) {
+ this.scale = 'month';this.step = 1;
+ }
+ if (stepDay * 5 > minimumStep) {
+ this.scale = 'day';this.step = 5;
+ }
+ if (stepDay * 2 > minimumStep) {
+ this.scale = 'day';this.step = 2;
+ }
+ if (stepDay > minimumStep) {
+ this.scale = 'day';this.step = 1;
+ }
+ if (stepDay / 2 > minimumStep) {
+ this.scale = 'weekday';this.step = 1;
+ }
+ if (stepHour * 4 > minimumStep) {
+ this.scale = 'hour';this.step = 4;
+ }
+ if (stepHour > minimumStep) {
+ this.scale = 'hour';this.step = 1;
+ }
+ if (stepMinute * 15 > minimumStep) {
+ this.scale = 'minute';this.step = 15;
+ }
+ if (stepMinute * 10 > minimumStep) {
+ this.scale = 'minute';this.step = 10;
+ }
+ if (stepMinute * 5 > minimumStep) {
+ this.scale = 'minute';this.step = 5;
+ }
+ if (stepMinute > minimumStep) {
+ this.scale = 'minute';this.step = 1;
+ }
+ if (stepSecond * 15 > minimumStep) {
+ this.scale = 'second';this.step = 15;
+ }
+ if (stepSecond * 10 > minimumStep) {
+ this.scale = 'second';this.step = 10;
+ }
+ if (stepSecond * 5 > minimumStep) {
+ this.scale = 'second';this.step = 5;
+ }
+ if (stepSecond > minimumStep) {
+ this.scale = 'second';this.step = 1;
+ }
+ if (stepMillisecond * 200 > minimumStep) {
+ this.scale = 'millisecond';this.step = 200;
+ }
+ if (stepMillisecond * 100 > minimumStep) {
+ this.scale = 'millisecond';this.step = 100;
+ }
+ if (stepMillisecond * 50 > minimumStep) {
+ this.scale = 'millisecond';this.step = 50;
+ }
+ if (stepMillisecond * 10 > minimumStep) {
+ this.scale = 'millisecond';this.step = 10;
+ }
+ if (stepMillisecond * 5 > minimumStep) {
+ this.scale = 'millisecond';this.step = 5;
+ }
+ if (stepMillisecond > minimumStep) {
+ this.scale = 'millisecond';this.step = 1;
+ }
+ };
+
+ /**
+ * Snap a date to a rounded value.
+ * The snap intervals are dependent on the current scale and step.
+ * Static function
+ * @param {Date} date the date to be snapped.
+ * @param {string} scale Current scale, can be 'millisecond', 'second',
+ * 'minute', 'hour', 'weekday, 'day', 'month', 'year'.
+ * @param {number} step Current step (1, 2, 4, 5, ...
+ * @return {Date} snappedDate
+ */
+ TimeStep.snap = function (date, scale, step) {
+ var clone = moment(date);
+
+ if (scale == 'year') {
+ var year = clone.year() + Math.round(clone.month() / 12);
+ clone.year(Math.round(year / step) * step);
+ clone.month(0);
+ clone.date(0);
+ clone.hours(0);
+ clone.minutes(0);
+ clone.seconds(0);
+ clone.milliseconds(0);
+ } else if (scale == 'month') {
+ if (clone.date() > 15) {
+ clone.date(1);
+ clone.add(1, 'month');
+ // important: first set Date to 1, after that change the month.
+ } else {
+ clone.date(1);
+ }
+
+ clone.hours(0);
+ clone.minutes(0);
+ clone.seconds(0);
+ clone.milliseconds(0);
+ } else if (scale == 'day') {
+ //noinspection FallthroughInSwitchStatementJS
+ switch (step) {
+ case 5:
+ case 2:
+ clone.hours(Math.round(clone.hours() / 24) * 24);break;
+ default:
+ clone.hours(Math.round(clone.hours() / 12) * 12);break;
+ }
+ clone.minutes(0);
+ clone.seconds(0);
+ clone.milliseconds(0);
+ } else if (scale == 'weekday') {
+ //noinspection FallthroughInSwitchStatementJS
+ switch (step) {
+ case 5:
+ case 2:
+ clone.hours(Math.round(clone.hours() / 12) * 12);break;
+ default:
+ clone.hours(Math.round(clone.hours() / 6) * 6);break;
+ }
+ clone.minutes(0);
+ clone.seconds(0);
+ clone.milliseconds(0);
+ } else if (scale == 'hour') {
+ switch (step) {
+ case 4:
+ clone.minutes(Math.round(clone.minutes() / 60) * 60);break;
+ default:
+ clone.minutes(Math.round(clone.minutes() / 30) * 30);break;
+ }
+ clone.seconds(0);
+ clone.milliseconds(0);
+ } else if (scale == 'minute') {
+ //noinspection FallthroughInSwitchStatementJS
+ switch (step) {
+ case 15:
+ case 10:
+ clone.minutes(Math.round(clone.minutes() / 5) * 5);
+ clone.seconds(0);
+ break;
+ case 5:
+ clone.seconds(Math.round(clone.seconds() / 60) * 60);break;
+ default:
+ clone.seconds(Math.round(clone.seconds() / 30) * 30);break;
+ }
+ clone.milliseconds(0);
+ } else if (scale == 'second') {
+ //noinspection FallthroughInSwitchStatementJS
+ switch (step) {
+ case 15:
+ case 10:
+ clone.seconds(Math.round(clone.seconds() / 5) * 5);
+ clone.milliseconds(0);
+ break;
+ case 5:
+ clone.milliseconds(Math.round(clone.milliseconds() / 1000) * 1000);break;
+ default:
+ clone.milliseconds(Math.round(clone.milliseconds() / 500) * 500);break;
+ }
+ } else if (scale == 'millisecond') {
+ var _step = step > 5 ? step / 2 : 1;
+ clone.milliseconds(Math.round(clone.milliseconds() / _step) * _step);
+ }
+
+ return clone;
+ };
+
+ /**
+ * Check if the current value is a major value (for example when the step
+ * is DAY, a major value is each first day of the MONTH)
+ * @return {boolean} true if current date is major, else false.
+ */
+ TimeStep.prototype.isMajor = function () {
+ if (this.switchedYear == true) {
+ this.switchedYear = false;
+ switch (this.scale) {
+ case 'year':
+ case 'month':
+ case 'weekday':
+ case 'day':
+ case 'hour':
+ case 'minute':
+ case 'second':
+ case 'millisecond':
+ return true;
+ default:
+ return false;
+ }
+ } else if (this.switchedMonth == true) {
+ this.switchedMonth = false;
+ switch (this.scale) {
+ case 'weekday':
+ case 'day':
+ case 'hour':
+ case 'minute':
+ case 'second':
+ case 'millisecond':
+ return true;
+ default:
+ return false;
+ }
+ } else if (this.switchedDay == true) {
+ this.switchedDay = false;
+ switch (this.scale) {
+ case 'millisecond':
+ case 'second':
+ case 'minute':
+ case 'hour':
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ var date = this.moment(this.current);
+ switch (this.scale) {
+ case 'millisecond':
+ return date.milliseconds() == 0;
+ case 'second':
+ return date.seconds() == 0;
+ case 'minute':
+ return date.hours() == 0 && date.minutes() == 0;
+ case 'hour':
+ return date.hours() == 0;
+ case 'weekday': // intentional fall through
+ case 'day':
+ return date.date() == 1;
+ case 'month':
+ return date.month() == 0;
+ case 'year':
+ return false;
+ default:
+ return false;
+ }
+ };
+
+ /**
+ * Returns formatted text for the minor axislabel, depending on the current
+ * date and the scale. For example when scale is MINUTE, the current time is
+ * formatted as "hh:mm".
+ * @param {Date} [date] custom date. if not provided, current date is taken
+ */
+ TimeStep.prototype.getLabelMinor = function (date) {
+ if (date == undefined) {
+ date = this.current;
+ }
+
+ var format = this.format.minorLabels[this.scale];
+ return format && format.length > 0 ? this.moment(date).format(format) : '';
+ };
+
+ /**
+ * Returns formatted text for the major axis label, depending on the current
+ * date and the scale. For example when scale is MINUTE, the major scale is
+ * hours, and the hour will be formatted as "hh".
+ * @param {Date} [date] custom date. if not provided, current date is taken
+ */
+ TimeStep.prototype.getLabelMajor = function (date) {
+ if (date == undefined) {
+ date = this.current;
+ }
+
+ var format = this.format.majorLabels[this.scale];
+ return format && format.length > 0 ? this.moment(date).format(format) : '';
+ };
+
+ TimeStep.prototype.getClassName = function () {
+ var _moment = this.moment;
+ var m = this.moment(this.current);
+ var current = m.locale ? m.locale('en') : m.lang('en'); // old versions of moment have .lang() function
+ var step = this.step;
+
+ function even(value) {
+ return value / step % 2 == 0 ? ' vis-even' : ' vis-odd';
+ }
+
+ function today(date) {
+ if (date.isSame(new Date(), 'day')) {
+ return ' vis-today';
+ }
+ if (date.isSame(_moment().add(1, 'day'), 'day')) {
+ return ' vis-tomorrow';
+ }
+ if (date.isSame(_moment().add(-1, 'day'), 'day')) {
+ return ' vis-yesterday';
+ }
+ return '';
+ }
+
+ function currentWeek(date) {
+ return date.isSame(new Date(), 'week') ? ' vis-current-week' : '';
+ }
+
+ function currentMonth(date) {
+ return date.isSame(new Date(), 'month') ? ' vis-current-month' : '';
+ }
+
+ function currentYear(date) {
+ return date.isSame(new Date(), 'year') ? ' vis-current-year' : '';
+ }
+
+ switch (this.scale) {
+ case 'millisecond':
+ return even(current.milliseconds()).trim();
+
+ case 'second':
+ return even(current.seconds()).trim();
+
+ case 'minute':
+ return even(current.minutes()).trim();
+
+ case 'hour':
+ var hours = current.hours();
+ if (this.step == 4) {
+ hours = hours + '-h' + (hours + 4);
+ }
+ return 'vis-h' + hours + today(current) + even(current.hours());
+
+ case 'weekday':
+ return 'vis-' + current.format('dddd').toLowerCase() + today(current) + currentWeek(current) + even(current.date());
+
+ case 'day':
+ var day = current.date();
+ var month = current.format('MMMM').toLowerCase();
+ return 'vis-day' + day + ' vis-' + month + currentMonth(current) + even(day - 1);
+
+ case 'month':
+ return 'vis-' + current.format('MMMM').toLowerCase() + currentMonth(current) + even(current.month());
+
+ case 'year':
+ var year = current.year();
+ return 'vis-year' + year + currentYear(current) + even(year);
+
+ default:
+ return '';
+ }
+ };
+
+ module.exports = TimeStep;
+
+/***/ },
+/* 31 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var stack = __webpack_require__(32);
+ var RangeItem = __webpack_require__(33);
+
+ /**
+ * @constructor Group
+ * @param {Number | String} groupId
+ * @param {Object} data
+ * @param {ItemSet} itemSet
+ */
+ function Group(groupId, data, itemSet) {
+ this.groupId = groupId;
+ this.subgroups = {};
+ this.subgroupIndex = 0;
+ this.subgroupOrderer = data && data.subgroupOrder;
+ this.itemSet = itemSet;
+
+ this.dom = {};
+ this.props = {
+ label: {
+ width: 0,
+ height: 0
+ }
+ };
+ this.className = null;
+
+ this.items = {}; // items filtered by groupId of this group
+ this.visibleItems = []; // items currently visible in window
+ this.orderedItems = {
+ byStart: [],
+ byEnd: []
+ };
+ this.checkRangedItems = false; // needed to refresh the ranged items if the window is programatically changed with NO overlap.
+ var me = this;
+ this.itemSet.body.emitter.on('checkRangedItems', function () {
+ me.checkRangedItems = true;
+ });
+
+ this._create();
+
+ this.setData(data);
+ }
+
+ /**
+ * Create DOM elements for the group
+ * @private
+ */
+ Group.prototype._create = function () {
+ var label = document.createElement('div');
+ if (this.itemSet.options.groupEditable.order) {
+ label.className = 'vis-label draggable';
+ } else {
+ label.className = 'vis-label';
+ }
+ this.dom.label = label;
+
+ var inner = document.createElement('div');
+ inner.className = 'vis-inner';
+ label.appendChild(inner);
+ this.dom.inner = inner;
+
+ var foreground = document.createElement('div');
+ foreground.className = 'vis-group';
+ foreground['timeline-group'] = this;
+ this.dom.foreground = foreground;
+
+ this.dom.background = document.createElement('div');
+ this.dom.background.className = 'vis-group';
+
+ this.dom.axis = document.createElement('div');
+ this.dom.axis.className = 'vis-group';
+
+ // create a hidden marker to detect when the Timelines container is attached
+ // to the DOM, or the style of a parent of the Timeline is changed from
+ // display:none is changed to visible.
+ this.dom.marker = document.createElement('div');
+ this.dom.marker.style.visibility = 'hidden';
+ this.dom.marker.innerHTML = '?';
+ this.dom.background.appendChild(this.dom.marker);
+ };
+
+ /**
+ * Set the group data for this group
+ * @param {Object} data Group data, can contain properties content and className
+ */
+ Group.prototype.setData = function (data) {
+ // update contents
+ var content;
+ if (this.itemSet.options && this.itemSet.options.groupTemplate) {
+ content = this.itemSet.options.groupTemplate(data);
+ } else {
+ content = data && data.content;
+ }
+
+ if (content instanceof Element) {
+ this.dom.inner.appendChild(content);
+ while (this.dom.inner.firstChild) {
+ this.dom.inner.removeChild(this.dom.inner.firstChild);
+ }
+ this.dom.inner.appendChild(content);
+ } else if (content !== undefined && content !== null) {
+ this.dom.inner.innerHTML = content;
+ } else {
+ this.dom.inner.innerHTML = this.groupId || ''; // groupId can be null
+ }
+
+ // update title
+ this.dom.label.title = data && data.title || '';
+
+ if (!this.dom.inner.firstChild) {
+ util.addClassName(this.dom.inner, 'vis-hidden');
+ } else {
+ util.removeClassName(this.dom.inner, 'vis-hidden');
+ }
+
+ // update className
+ var className = data && data.className || null;
+ if (className != this.className) {
+ if (this.className) {
+ util.removeClassName(this.dom.label, this.className);
+ util.removeClassName(this.dom.foreground, this.className);
+ util.removeClassName(this.dom.background, this.className);
+ util.removeClassName(this.dom.axis, this.className);
+ }
+ util.addClassName(this.dom.label, className);
+ util.addClassName(this.dom.foreground, className);
+ util.addClassName(this.dom.background, className);
+ util.addClassName(this.dom.axis, className);
+ this.className = className;
+ }
+
+ // update style
+ if (this.style) {
+ util.removeCssText(this.dom.label, this.style);
+ this.style = null;
+ }
+ if (data && data.style) {
+ util.addCssText(this.dom.label, data.style);
+ this.style = data.style;
+ }
+ };
+
+ /**
+ * Get the width of the group label
+ * @return {number} width
+ */
+ Group.prototype.getLabelWidth = function () {
+ return this.props.label.width;
+ };
+
+ /**
+ * Repaint this group
+ * @param {{start: number, end: number}} range
+ * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin
+ * @param {boolean} [restack=false] Force restacking of all items
+ * @return {boolean} Returns true if the group is resized
+ */
+ Group.prototype.redraw = function (range, margin, restack) {
+ var resized = false;
+
+ // force recalculation of the height of the items when the marker height changed
+ // (due to the Timeline being attached to the DOM or changed from display:none to visible)
+ var markerHeight = this.dom.marker.clientHeight;
+ if (markerHeight != this.lastMarkerHeight) {
+ this.lastMarkerHeight = markerHeight;
+
+ util.forEach(this.items, function (item) {
+ item.dirty = true;
+ if (item.displayed) item.redraw();
+ });
+
+ restack = true;
+ }
+
+ // reposition visible items vertically
+ if (typeof this.itemSet.options.order === 'function') {
+ // a custom order function
+
+ if (restack) {
+ // brute force restack of all items
+
+ // show all items
+ var me = this;
+ var limitSize = false;
+ util.forEach(this.items, function (item) {
+ if (!item.displayed) {
+ item.redraw();
+ me.visibleItems.push(item);
+ }
+ item.repositionX(limitSize);
+ });
+
+ // order all items and force a restacking
+ var customOrderedItems = this.orderedItems.byStart.slice().sort(function (a, b) {
+ return me.itemSet.options.order(a.data, b.data);
+ });
+ stack.stack(customOrderedItems, margin, true /* restack=true */);
+ }
+
+ this.visibleItems = this._updateVisibleItems(this.orderedItems, this.visibleItems, range);
+ } else {
+ // no custom order function, lazy stacking
+ this.visibleItems = this._updateVisibleItems(this.orderedItems, this.visibleItems, range);
+
+ if (this.itemSet.options.stack) {
+ // TODO: ugly way to access options...
+ stack.stack(this.visibleItems, margin, restack);
+ } else {
+ // no stacking
+ stack.nostack(this.visibleItems, margin, this.subgroups);
+ }
+ }
+
+ // recalculate the height of the group
+ var height = this._calculateHeight(margin);
+
+ // calculate actual size and position
+ var foreground = this.dom.foreground;
+ this.top = foreground.offsetTop;
+ this.left = foreground.offsetLeft;
+ this.width = foreground.offsetWidth;
+ resized = util.updateProperty(this, 'height', height) || resized;
+
+ // recalculate size of label
+ resized = util.updateProperty(this.props.label, 'width', this.dom.inner.clientWidth) || resized;
+ resized = util.updateProperty(this.props.label, 'height', this.dom.inner.clientHeight) || resized;
+
+ // apply new height
+ this.dom.background.style.height = height + 'px';
+ this.dom.foreground.style.height = height + 'px';
+ this.dom.label.style.height = height + 'px';
+
+ // update vertical position of items after they are re-stacked and the height of the group is calculated
+ for (var i = 0, ii = this.visibleItems.length; i < ii; i++) {
+ var item = this.visibleItems[i];
+ item.repositionY(margin);
+ }
+
+ return resized;
+ };
+
+ /**
+ * recalculate the height of the group
+ * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin
+ * @returns {number} Returns the height
+ * @private
+ */
+ Group.prototype._calculateHeight = function (margin) {
+ // recalculate the height of the group
+ var height;
+ var visibleItems = this.visibleItems;
+ //var visibleSubgroups = [];
+ //this.visibleSubgroups = 0;
+ this.resetSubgroups();
+ var me = this;
+ if (visibleItems.length > 0) {
+ var min = visibleItems[0].top;
+ var max = visibleItems[0].top + visibleItems[0].height;
+ util.forEach(visibleItems, function (item) {
+ min = Math.min(min, item.top);
+ max = Math.max(max, item.top + item.height);
+ if (item.data.subgroup !== undefined) {
+ me.subgroups[item.data.subgroup].height = Math.max(me.subgroups[item.data.subgroup].height, item.height);
+ me.subgroups[item.data.subgroup].visible = true;
+ }
+ });
+ if (min > margin.axis) {
+ // there is an empty gap between the lowest item and the axis
+ var offset = min - margin.axis;
+ max -= offset;
+ util.forEach(visibleItems, function (item) {
+ item.top -= offset;
+ });
+ }
+ height = max + margin.item.vertical / 2;
+ } else {
+ height = 0;
+ }
+ height = Math.max(height, this.props.label.height);
+
+ return height;
+ };
+
+ /**
+ * Show this group: attach to the DOM
+ */
+ Group.prototype.show = function () {
+ if (!this.dom.label.parentNode) {
+ this.itemSet.dom.labelSet.appendChild(this.dom.label);
+ }
+
+ if (!this.dom.foreground.parentNode) {
+ this.itemSet.dom.foreground.appendChild(this.dom.foreground);
+ }
+
+ if (!this.dom.background.parentNode) {
+ this.itemSet.dom.background.appendChild(this.dom.background);
+ }
+
+ if (!this.dom.axis.parentNode) {
+ this.itemSet.dom.axis.appendChild(this.dom.axis);
+ }
+ };
+
+ /**
+ * Hide this group: remove from the DOM
+ */
+ Group.prototype.hide = function () {
+ var label = this.dom.label;
+ if (label.parentNode) {
+ label.parentNode.removeChild(label);
+ }
+
+ var foreground = this.dom.foreground;
+ if (foreground.parentNode) {
+ foreground.parentNode.removeChild(foreground);
+ }
+
+ var background = this.dom.background;
+ if (background.parentNode) {
+ background.parentNode.removeChild(background);
+ }
+
+ var axis = this.dom.axis;
+ if (axis.parentNode) {
+ axis.parentNode.removeChild(axis);
+ }
+ };
+
+ /**
+ * Add an item to the group
+ * @param {Item} item
+ */
+ Group.prototype.add = function (item) {
+ this.items[item.id] = item;
+ item.setParent(this);
+
+ // add to
+ if (item.data.subgroup !== undefined) {
+ if (this.subgroups[item.data.subgroup] === undefined) {
+ this.subgroups[item.data.subgroup] = { height: 0, visible: false, index: this.subgroupIndex, items: [] };
+ this.subgroupIndex++;
+ }
+ this.subgroups[item.data.subgroup].items.push(item);
+ }
+ this.orderSubgroups();
+
+ if (this.visibleItems.indexOf(item) == -1) {
+ var range = this.itemSet.body.range; // TODO: not nice accessing the range like this
+ this._checkIfVisible(item, this.visibleItems, range);
+ }
+ };
+
+ Group.prototype.orderSubgroups = function () {
+ if (this.subgroupOrderer !== undefined) {
+ var sortArray = [];
+ if (typeof this.subgroupOrderer == 'string') {
+ for (var subgroup in this.subgroups) {
+ sortArray.push({ subgroup: subgroup, sortField: this.subgroups[subgroup].items[0].data[this.subgroupOrderer] });
+ }
+ sortArray.sort(function (a, b) {
+ return a.sortField - b.sortField;
+ });
+ } else if (typeof this.subgroupOrderer == 'function') {
+ for (var subgroup in this.subgroups) {
+ sortArray.push(this.subgroups[subgroup].items[0].data);
+ }
+ sortArray.sort(this.subgroupOrderer);
+ }
+
+ if (sortArray.length > 0) {
+ for (var i = 0; i < sortArray.length; i++) {
+ this.subgroups[sortArray[i].subgroup].index = i;
+ }
+ }
+ }
+ };
+
+ Group.prototype.resetSubgroups = function () {
+ for (var subgroup in this.subgroups) {
+ if (this.subgroups.hasOwnProperty(subgroup)) {
+ this.subgroups[subgroup].visible = false;
+ }
+ }
+ };
+
+ /**
+ * Remove an item from the group
+ * @param {Item} item
+ */
+ Group.prototype.remove = function (item) {
+ delete this.items[item.id];
+ item.setParent(null);
+
+ // remove from visible items
+ var index = this.visibleItems.indexOf(item);
+ if (index != -1) this.visibleItems.splice(index, 1);
+
+ if (item.data.subgroup !== undefined) {
+ var subgroup = this.subgroups[item.data.subgroup];
+ if (subgroup) {
+ var itemIndex = subgroup.items.indexOf(item);
+ subgroup.items.splice(itemIndex, 1);
+ if (!subgroup.items.length) {
+ delete this.subgroups[item.data.subgroup];
+ this.subgroupIndex--;
+ }
+ this.orderSubgroups();
+ }
+ }
+ };
+
+ /**
+ * Remove an item from the corresponding DataSet
+ * @param {Item} item
+ */
+ Group.prototype.removeFromDataSet = function (item) {
+ this.itemSet.removeItem(item.id);
+ };
+
+ /**
+ * Reorder the items
+ */
+ Group.prototype.order = function () {
+ var array = util.toArray(this.items);
+ var startArray = [];
+ var endArray = [];
+
+ for (var i = 0; i < array.length; i++) {
+ if (array[i].data.end !== undefined) {
+ endArray.push(array[i]);
+ }
+ startArray.push(array[i]);
+ }
+ this.orderedItems = {
+ byStart: startArray,
+ byEnd: endArray
+ };
+
+ stack.orderByStart(this.orderedItems.byStart);
+ stack.orderByEnd(this.orderedItems.byEnd);
+ };
+
+ /**
+ * Update the visible items
+ * @param {{byStart: Item[], byEnd: Item[]}} orderedItems All items ordered by start date and by end date
+ * @param {Item[]} visibleItems The previously visible items.
+ * @param {{start: number, end: number}} range Visible range
+ * @return {Item[]} visibleItems The new visible items.
+ * @private
+ */
+ Group.prototype._updateVisibleItems = function (orderedItems, oldVisibleItems, range) {
+ var visibleItems = [];
+ var visibleItemsLookup = {}; // we keep this to quickly look up if an item already exists in the list without using indexOf on visibleItems
+ var interval = (range.end - range.start) / 4;
+ var lowerBound = range.start - interval;
+ var upperBound = range.end + interval;
+ var item, i;
+
+ // this function is used to do the binary search.
+ var searchFunction = function searchFunction(value) {
+ if (value < lowerBound) {
+ return -1;
+ } else if (value <= upperBound) {
+ return 0;
+ } else {
+ return 1;
+ }
+ };
+
+ // first check if the items that were in view previously are still in view.
+ // IMPORTANT: this handles the case for the items with startdate before the window and enddate after the window!
+ // also cleans up invisible items.
+ if (oldVisibleItems.length > 0) {
+ for (i = 0; i < oldVisibleItems.length; i++) {
+ this._checkIfVisibleWithReference(oldVisibleItems[i], visibleItems, visibleItemsLookup, range);
+ }
+ }
+
+ // we do a binary search for the items that have only start values.
+ var initialPosByStart = util.binarySearchCustom(orderedItems.byStart, searchFunction, 'data', 'start');
+
+ // trace the visible items from the inital start pos both ways until an invisible item is found, we only look at the start values.
+ this._traceVisible(initialPosByStart, orderedItems.byStart, visibleItems, visibleItemsLookup, function (item) {
+ return item.data.start < lowerBound || item.data.start > upperBound;
+ });
+
+ // if the window has changed programmatically without overlapping the old window, the ranged items with start < lowerBound and end > upperbound are not shown.
+ // We therefore have to brute force check all items in the byEnd list
+ if (this.checkRangedItems == true) {
+ this.checkRangedItems = false;
+ for (i = 0; i < orderedItems.byEnd.length; i++) {
+ this._checkIfVisibleWithReference(orderedItems.byEnd[i], visibleItems, visibleItemsLookup, range);
+ }
+ } else {
+ // we do a binary search for the items that have defined end times.
+ var initialPosByEnd = util.binarySearchCustom(orderedItems.byEnd, searchFunction, 'data', 'end');
+
+ // trace the visible items from the inital start pos both ways until an invisible item is found, we only look at the end values.
+ this._traceVisible(initialPosByEnd, orderedItems.byEnd, visibleItems, visibleItemsLookup, function (item) {
+ return item.data.end < lowerBound || item.data.end > upperBound;
+ });
+ }
+
+ // finally, we reposition all the visible items.
+ for (i = 0; i < visibleItems.length; i++) {
+ item = visibleItems[i];
+ if (!item.displayed) item.show();
+ // reposition item horizontally
+ item.repositionX();
+ }
+
+ // debug
+ //console.log("new line")
+ //if (this.groupId == null) {
+ // for (i = 0; i < orderedItems.byStart.length; i++) {
+ // item = orderedItems.byStart[i].data;
+ // console.log('start',i,initialPosByStart, item.start.valueOf(), item.content, item.start >= lowerBound && item.start <= upperBound,i == initialPosByStart ? "<------------------- HEREEEE" : "")
+ // }
+ // for (i = 0; i < orderedItems.byEnd.length; i++) {
+ // item = orderedItems.byEnd[i].data;
+ // console.log('rangeEnd',i,initialPosByEnd, item.end.valueOf(), item.content, item.end >= range.start && item.end <= range.end,i == initialPosByEnd ? "<------------------- HEREEEE" : "")
+ // }
+ //}
+
+ return visibleItems;
+ };
+
+ Group.prototype._traceVisible = function (initialPos, items, visibleItems, visibleItemsLookup, breakCondition) {
+ var item;
+ var i;
+
+ if (initialPos != -1) {
+ for (i = initialPos; i >= 0; i--) {
+ item = items[i];
+ if (breakCondition(item)) {
+ break;
+ } else {
+ if (visibleItemsLookup[item.id] === undefined) {
+ visibleItemsLookup[item.id] = true;
+ visibleItems.push(item);
+ }
+ }
+ }
+
+ for (i = initialPos + 1; i < items.length; i++) {
+ item = items[i];
+ if (breakCondition(item)) {
+ break;
+ } else {
+ if (visibleItemsLookup[item.id] === undefined) {
+ visibleItemsLookup[item.id] = true;
+ visibleItems.push(item);
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * this function is very similar to the _checkIfInvisible() but it does not
+ * return booleans, hides the item if it should not be seen and always adds to
+ * the visibleItems.
+ * this one is for brute forcing and hiding.
+ *
+ * @param {Item} item
+ * @param {Array} visibleItems
+ * @param {{start:number, end:number}} range
+ * @private
+ */
+ Group.prototype._checkIfVisible = function (item, visibleItems, range) {
+ if (item.isVisible(range)) {
+ if (!item.displayed) item.show();
+ // reposition item horizontally
+ item.repositionX();
+ visibleItems.push(item);
+ } else {
+ if (item.displayed) item.hide();
+ }
+ };
+
+ /**
+ * this function is very similar to the _checkIfInvisible() but it does not
+ * return booleans, hides the item if it should not be seen and always adds to
+ * the visibleItems.
+ * this one is for brute forcing and hiding.
+ *
+ * @param {Item} item
+ * @param {Array} visibleItems
+ * @param {{start:number, end:number}} range
+ * @private
+ */
+ Group.prototype._checkIfVisibleWithReference = function (item, visibleItems, visibleItemsLookup, range) {
+ if (item.isVisible(range)) {
+ if (visibleItemsLookup[item.id] === undefined) {
+ visibleItemsLookup[item.id] = true;
+ visibleItems.push(item);
+ }
+ } else {
+ if (item.displayed) item.hide();
+ }
+ };
+
+ module.exports = Group;
+
+/***/ },
+/* 32 */
+/***/ function(module, exports) {
+
+ // Utility functions for ordering and stacking of items
+ 'use strict';
+
+ var EPSILON = 0.001; // used when checking collisions, to prevent round-off errors
+
+ /**
+ * Order items by their start data
+ * @param {Item[]} items
+ */
+ exports.orderByStart = function (items) {
+ items.sort(function (a, b) {
+ return a.data.start - b.data.start;
+ });
+ };
+
+ /**
+ * Order items by their end date. If they have no end date, their start date
+ * is used.
+ * @param {Item[]} items
+ */
+ exports.orderByEnd = function (items) {
+ items.sort(function (a, b) {
+ var aTime = 'end' in a.data ? a.data.end : a.data.start,
+ bTime = 'end' in b.data ? b.data.end : b.data.start;
+
+ return aTime - bTime;
+ });
+ };
+
+ /**
+ * Adjust vertical positions of the items such that they don't overlap each
+ * other.
+ * @param {Item[]} items
+ * All visible items
+ * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin
+ * Margins between items and between items and the axis.
+ * @param {boolean} [force=false]
+ * If true, all items will be repositioned. If false (default), only
+ * items having a top===null will be re-stacked
+ */
+ exports.stack = function (items, margin, force) {
+ var i, iMax;
+
+ if (force) {
+ // reset top position of all items
+ for (i = 0, iMax = items.length; i < iMax; i++) {
+ items[i].top = null;
+ }
+ }
+
+ // calculate new, non-overlapping positions
+ for (i = 0, iMax = items.length; i < iMax; i++) {
+ var item = items[i];
+ if (item.stack && item.top === null) {
+ // initialize top position
+ item.top = margin.axis;
+
+ do {
+ // TODO: optimize checking for overlap. when there is a gap without items,
+ // you only need to check for items from the next item on, not from zero
+ var collidingItem = null;
+ for (var j = 0, jj = items.length; j < jj; j++) {
+ var other = items[j];
+ if (other.top !== null && other !== item && other.stack && exports.collision(item, other, margin.item)) {
+ collidingItem = other;
+ break;
+ }
+ }
+
+ if (collidingItem != null) {
+ // There is a collision. Reposition the items above the colliding element
+ item.top = collidingItem.top + collidingItem.height + margin.item.vertical;
+ }
+ } while (collidingItem);
+ }
+ }
+ };
+
+ /**
+ * Adjust vertical positions of the items without stacking them
+ * @param {Item[]} items
+ * All visible items
+ * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin
+ * Margins between items and between items and the axis.
+ */
+ exports.nostack = function (items, margin, subgroups) {
+ var i, iMax, newTop;
+
+ // reset top position of all items
+ for (i = 0, iMax = items.length; i < iMax; i++) {
+ if (items[i].data.subgroup !== undefined) {
+ newTop = margin.axis;
+ for (var subgroup in subgroups) {
+ if (subgroups.hasOwnProperty(subgroup)) {
+ if (subgroups[subgroup].visible == true && subgroups[subgroup].index < subgroups[items[i].data.subgroup].index) {
+ newTop += subgroups[subgroup].height + margin.item.vertical;
+ }
+ }
+ }
+ items[i].top = newTop;
+ } else {
+ items[i].top = margin.axis;
+ }
+ }
+ };
+
+ /**
+ * Test if the two provided items collide
+ * The items must have parameters left, width, top, and height.
+ * @param {Item} a The first item
+ * @param {Item} b The second item
+ * @param {{horizontal: number, vertical: number}} margin
+ * An object containing a horizontal and vertical
+ * minimum required margin.
+ * @return {boolean} true if a and b collide, else false
+ */
+ exports.collision = function (a, b, margin) {
+ return a.left - margin.horizontal + EPSILON < b.left + b.width && a.left + a.width + margin.horizontal - EPSILON > b.left && a.top - margin.vertical + EPSILON < b.top + b.height && a.top + a.height + margin.vertical - EPSILON > b.top;
+ };
+
+/***/ },
+/* 33 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Hammer = __webpack_require__(20);
+ var Item = __webpack_require__(34);
+
+ /**
+ * @constructor RangeItem
+ * @extends Item
+ * @param {Object} data Object containing parameters start, end
+ * content, className.
+ * @param {{toScreen: function, toTime: function}} conversion
+ * Conversion functions from time to screen and vice versa
+ * @param {Object} [options] Configuration options
+ * // TODO: describe options
+ */
+ function RangeItem(data, conversion, options) {
+ this.props = {
+ content: {
+ width: 0
+ }
+ };
+ this.overflow = false; // if contents can overflow (css styling), this flag is set to true
+
+ // validate data
+ if (data) {
+ if (data.start == undefined) {
+ throw new Error('Property "start" missing in item ' + data.id);
+ }
+ if (data.end == undefined) {
+ throw new Error('Property "end" missing in item ' + data.id);
+ }
+ }
+
+ Item.call(this, data, conversion, options);
+ }
+
+ RangeItem.prototype = new Item(null, null, null);
+
+ RangeItem.prototype.baseClassName = 'vis-item vis-range';
+
+ /**
+ * Check whether this item is visible inside given range
+ * @returns {{start: Number, end: Number}} range with a timestamp for start and end
+ * @returns {boolean} True if visible
+ */
+ RangeItem.prototype.isVisible = function (range) {
+ // determine visibility
+ return this.data.start < range.end && this.data.end > range.start;
+ };
+
+ /**
+ * Repaint the item
+ */
+ RangeItem.prototype.redraw = function () {
+ var dom = this.dom;
+ if (!dom) {
+ // create DOM
+ this.dom = {};
+ dom = this.dom;
+
+ // background box
+ dom.box = document.createElement('div');
+ // className is updated in redraw()
+
+ // frame box (to prevent the item contents from overflowing
+ dom.frame = document.createElement('div');
+ dom.frame.className = 'vis-item-overflow';
+ dom.box.appendChild(dom.frame);
+
+ // contents box
+ dom.content = document.createElement('div');
+ dom.content.className = 'vis-item-content';
+ dom.frame.appendChild(dom.content);
+
+ // attach this item as attribute
+ dom.box['timeline-item'] = this;
+
+ this.dirty = true;
+ }
+
+ // append DOM to parent DOM
+ if (!this.parent) {
+ throw new Error('Cannot redraw item: no parent attached');
+ }
+ if (!dom.box.parentNode) {
+ var foreground = this.parent.dom.foreground;
+ if (!foreground) {
+ throw new Error('Cannot redraw item: parent has no foreground container element');
+ }
+ foreground.appendChild(dom.box);
+ }
+ this.displayed = true;
+
+ // Update DOM when item is marked dirty. An item is marked dirty when:
+ // - the item is not yet rendered
+ // - the item's data is changed
+ // - the item is selected/deselected
+ if (this.dirty) {
+ this._updateContents(this.dom.content);
+ this._updateTitle(this.dom.box);
+ this._updateDataAttributes(this.dom.box);
+ this._updateStyle(this.dom.box);
+
+ var editable = (this.options.editable.updateTime || this.options.editable.updateGroup || this.editable === true) && this.editable !== false;
+
+ // update class
+ var className = (this.data.className ? ' ' + this.data.className : '') + (this.selected ? ' vis-selected' : '') + (editable ? ' vis-editable' : ' vis-readonly');
+ dom.box.className = this.baseClassName + className;
+
+ // determine from css whether this box has overflow
+ this.overflow = window.getComputedStyle(dom.frame).overflow !== 'hidden';
+
+ // recalculate size
+ // turn off max-width to be able to calculate the real width
+ // this causes an extra browser repaint/reflow, but so be it
+ this.dom.content.style.maxWidth = 'none';
+ this.props.content.width = this.dom.content.offsetWidth;
+ this.height = this.dom.box.offsetHeight;
+ this.dom.content.style.maxWidth = '';
+
+ this.dirty = false;
+ }
+
+ this._repaintDeleteButton(dom.box);
+ this._repaintDragLeft();
+ this._repaintDragRight();
+ };
+
+ /**
+ * Show the item in the DOM (when not already visible). The items DOM will
+ * be created when needed.
+ */
+ RangeItem.prototype.show = function () {
+ if (!this.displayed) {
+ this.redraw();
+ }
+ };
+
+ /**
+ * Hide the item from the DOM (when visible)
+ * @return {Boolean} changed
+ */
+ RangeItem.prototype.hide = function () {
+ if (this.displayed) {
+ var box = this.dom.box;
+
+ if (box.parentNode) {
+ box.parentNode.removeChild(box);
+ }
+
+ this.displayed = false;
+ }
+ };
+
+ /**
+ * Reposition the item horizontally
+ * @param {boolean} [limitSize=true] If true (default), the width of the range
+ * item will be limited, as the browser cannot
+ * display very wide divs. This means though
+ * that the applied left and width may
+ * not correspond to the ranges start and end
+ * @Override
+ */
+ RangeItem.prototype.repositionX = function (limitSize) {
+ var parentWidth = this.parent.width;
+ var start = this.conversion.toScreen(this.data.start);
+ var end = this.conversion.toScreen(this.data.end);
+ var contentLeft;
+ var contentWidth;
+
+ // limit the width of the range, as browsers cannot draw very wide divs
+ if (limitSize === undefined || limitSize === true) {
+ if (start < -parentWidth) {
+ start = -parentWidth;
+ }
+ if (end > 2 * parentWidth) {
+ end = 2 * parentWidth;
+ }
+ }
+ var boxWidth = Math.max(end - start, 1);
+
+ if (this.overflow) {
+ this.left = start;
+ this.width = boxWidth + this.props.content.width;
+ contentWidth = this.props.content.width;
+
+ // Note: The calculation of width is an optimistic calculation, giving
+ // a width which will not change when moving the Timeline
+ // So no re-stacking needed, which is nicer for the eye;
+ } else {
+ this.left = start;
+ this.width = boxWidth;
+ contentWidth = Math.min(end - start, this.props.content.width);
+ }
+
+ this.dom.box.style.left = this.left + 'px';
+ this.dom.box.style.width = boxWidth + 'px';
+
+ switch (this.options.align) {
+ case 'left':
+ this.dom.content.style.left = '0';
+ break;
+
+ case 'right':
+ this.dom.content.style.left = Math.max(boxWidth - contentWidth, 0) + 'px';
+ break;
+
+ case 'center':
+ this.dom.content.style.left = Math.max((boxWidth - contentWidth) / 2, 0) + 'px';
+ break;
+
+ default:
+ // 'auto'
+ // when range exceeds left of the window, position the contents at the left of the visible area
+ if (this.overflow) {
+ if (end > 0) {
+ contentLeft = Math.max(-start, 0);
+ } else {
+ contentLeft = -contentWidth; // ensure it's not visible anymore
+ }
+ } else {
+ if (start < 0) {
+ contentLeft = -start;
+ } else {
+ contentLeft = 0;
+ }
+ }
+ this.dom.content.style.left = contentLeft + 'px';
+ }
+ };
+
+ /**
+ * Reposition the item vertically
+ * @Override
+ */
+ RangeItem.prototype.repositionY = function () {
+ var orientation = this.options.orientation.item;
+ var box = this.dom.box;
+
+ if (orientation == 'top') {
+ box.style.top = this.top + 'px';
+ } else {
+ box.style.top = this.parent.height - this.top - this.height + 'px';
+ }
+ };
+
+ /**
+ * Repaint a drag area on the left side of the range when the range is selected
+ * @protected
+ */
+ RangeItem.prototype._repaintDragLeft = function () {
+ if (this.selected && this.options.editable.updateTime && !this.dom.dragLeft) {
+ // create and show drag area
+ var dragLeft = document.createElement('div');
+ dragLeft.className = 'vis-drag-left';
+ dragLeft.dragLeftItem = this;
+
+ this.dom.box.appendChild(dragLeft);
+ this.dom.dragLeft = dragLeft;
+ } else if (!this.selected && this.dom.dragLeft) {
+ // delete drag area
+ if (this.dom.dragLeft.parentNode) {
+ this.dom.dragLeft.parentNode.removeChild(this.dom.dragLeft);
+ }
+ this.dom.dragLeft = null;
+ }
+ };
+
+ /**
+ * Repaint a drag area on the right side of the range when the range is selected
+ * @protected
+ */
+ RangeItem.prototype._repaintDragRight = function () {
+ if (this.selected && this.options.editable.updateTime && !this.dom.dragRight) {
+ // create and show drag area
+ var dragRight = document.createElement('div');
+ dragRight.className = 'vis-drag-right';
+ dragRight.dragRightItem = this;
+
+ this.dom.box.appendChild(dragRight);
+ this.dom.dragRight = dragRight;
+ } else if (!this.selected && this.dom.dragRight) {
+ // delete drag area
+ if (this.dom.dragRight.parentNode) {
+ this.dom.dragRight.parentNode.removeChild(this.dom.dragRight);
+ }
+ this.dom.dragRight = null;
+ }
+ };
+
+ module.exports = RangeItem;
+
+/***/ },
+/* 34 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Hammer = __webpack_require__(20);
+ var util = __webpack_require__(1);
+
+ /**
+ * @constructor Item
+ * @param {Object} data Object containing (optional) parameters type,
+ * start, end, content, group, className.
+ * @param {{toScreen: function, toTime: function}} conversion
+ * Conversion functions from time to screen and vice versa
+ * @param {Object} options Configuration options
+ * // TODO: describe available options
+ */
+ function Item(data, conversion, options) {
+ this.id = null;
+ this.parent = null;
+ this.data = data;
+ this.dom = null;
+ this.conversion = conversion || {};
+ this.options = options || {};
+
+ this.selected = false;
+ this.displayed = false;
+ this.dirty = true;
+
+ this.top = null;
+ this.left = null;
+ this.width = null;
+ this.height = null;
+
+ this.editable = null;
+ if (this.data && this.data.hasOwnProperty('editable') && typeof this.data.editable === 'boolean') {
+ this.editable = data.editable;
+ }
+ }
+
+ Item.prototype.stack = true;
+
+ /**
+ * Select current item
+ */
+ Item.prototype.select = function () {
+ this.selected = true;
+ this.dirty = true;
+ if (this.displayed) this.redraw();
+ };
+
+ /**
+ * Unselect current item
+ */
+ Item.prototype.unselect = function () {
+ this.selected = false;
+ this.dirty = true;
+ if (this.displayed) this.redraw();
+ };
+
+ /**
+ * Set data for the item. Existing data will be updated. The id should not
+ * be changed. When the item is displayed, it will be redrawn immediately.
+ * @param {Object} data
+ */
+ Item.prototype.setData = function (data) {
+ var groupChanged = data.group != undefined && this.data.group != data.group;
+ if (groupChanged) {
+ this.parent.itemSet._moveToGroup(this, data.group);
+ }
+
+ if (data.hasOwnProperty('editable') && typeof data.editable === 'boolean') {
+ this.editable = data.editable;
+ }
+
+ this.data = data;
+ this.dirty = true;
+ if (this.displayed) this.redraw();
+ };
+
+ /**
+ * Set a parent for the item
+ * @param {ItemSet | Group} parent
+ */
+ Item.prototype.setParent = function (parent) {
+ if (this.displayed) {
+ this.hide();
+ this.parent = parent;
+ if (this.parent) {
+ this.show();
+ }
+ } else {
+ this.parent = parent;
+ }
+ };
+
+ /**
+ * Check whether this item is visible inside given range
+ * @returns {{start: Number, end: Number}} range with a timestamp for start and end
+ * @returns {boolean} True if visible
+ */
+ Item.prototype.isVisible = function (range) {
+ // Should be implemented by Item implementations
+ return false;
+ };
+
+ /**
+ * Show the Item in the DOM (when not already visible)
+ * @return {Boolean} changed
+ */
+ Item.prototype.show = function () {
+ return false;
+ };
+
+ /**
+ * Hide the Item from the DOM (when visible)
+ * @return {Boolean} changed
+ */
+ Item.prototype.hide = function () {
+ return false;
+ };
+
+ /**
+ * Repaint the item
+ */
+ Item.prototype.redraw = function () {};
+
+ /**
+ * Reposition the Item horizontally
+ */
+ Item.prototype.repositionX = function () {};
+
+ /**
+ * Reposition the Item vertically
+ */
+ Item.prototype.repositionY = function () {};
+
+ /**
+ * Repaint a delete button on the top right of the item when the item is selected
+ * @param {HTMLElement} anchor
+ * @protected
+ */
+ Item.prototype._repaintDeleteButton = function (anchor) {
+ var editable = (this.options.editable.remove || this.data.editable === true) && this.data.editable !== false;
+
+ if (this.selected && editable && !this.dom.deleteButton) {
+ // create and show button
+ var me = this;
+
+ var deleteButton = document.createElement('div');
+ deleteButton.className = 'vis-delete';
+ deleteButton.title = 'Delete this item';
+
+ // TODO: be able to destroy the delete button
+ new Hammer(deleteButton).on('tap', function (event) {
+ event.stopPropagation();
+ me.parent.removeFromDataSet(me);
+ });
+
+ anchor.appendChild(deleteButton);
+ this.dom.deleteButton = deleteButton;
+ } else if (!this.selected && this.dom.deleteButton) {
+ // remove button
+ if (this.dom.deleteButton.parentNode) {
+ this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton);
+ }
+ this.dom.deleteButton = null;
+ }
+ };
+
+ /**
+ * Set HTML contents for the item
+ * @param {Element} element HTML element to fill with the contents
+ * @private
+ */
+ Item.prototype._updateContents = function (element) {
+ var content;
+ if (this.options.template) {
+ var itemData = this.parent.itemSet.itemsData.get(this.id); // get a clone of the data from the dataset
+ content = this.options.template(itemData);
+ } else {
+ content = this.data.content;
+ }
+
+ var changed = this._contentToString(this.content) !== this._contentToString(content);
+ if (changed) {
+ // only replace the content when changed
+ if (content instanceof Element) {
+ element.innerHTML = '';
+ element.appendChild(content);
+ } else if (content != undefined) {
+ element.innerHTML = content;
+ } else {
+ if (!(this.data.type == 'background' && this.data.content === undefined)) {
+ throw new Error('Property "content" missing in item ' + this.id);
+ }
+ }
+
+ this.content = content;
+ }
+ };
+
+ /**
+ * Set HTML contents for the item
+ * @param {Element} element HTML element to fill with the contents
+ * @private
+ */
+ Item.prototype._updateTitle = function (element) {
+ if (this.data.title != null) {
+ element.title = this.data.title || '';
+ } else {
+ element.removeAttribute('vis-title');
+ }
+ };
+
+ /**
+ * Process dataAttributes timeline option and set as data- attributes on dom.content
+ * @param {Element} element HTML element to which the attributes will be attached
+ * @private
+ */
+ Item.prototype._updateDataAttributes = function (element) {
+ if (this.options.dataAttributes && this.options.dataAttributes.length > 0) {
+ var attributes = [];
+
+ if (Array.isArray(this.options.dataAttributes)) {
+ attributes = this.options.dataAttributes;
+ } else if (this.options.dataAttributes == 'all') {
+ attributes = Object.keys(this.data);
+ } else {
+ return;
+ }
+
+ for (var i = 0; i < attributes.length; i++) {
+ var name = attributes[i];
+ var value = this.data[name];
+
+ if (value != null) {
+ element.setAttribute('data-' + name, value);
+ } else {
+ element.removeAttribute('data-' + name);
+ }
+ }
+ }
+ };
+
+ /**
+ * Update custom styles of the element
+ * @param element
+ * @private
+ */
+ Item.prototype._updateStyle = function (element) {
+ // remove old styles
+ if (this.style) {
+ util.removeCssText(element, this.style);
+ this.style = null;
+ }
+
+ // append new styles
+ if (this.data.style) {
+ util.addCssText(element, this.data.style);
+ this.style = this.data.style;
+ }
+ };
+
+ /**
+ * Stringify the items contents
+ * @param {string | Element | undefined} content
+ * @returns {string | undefined}
+ * @private
+ */
+ Item.prototype._contentToString = function (content) {
+ if (typeof content === 'string') return content;
+ if (content && 'outerHTML' in content) return content.outerHTML;
+ return content;
+ };
+
+ /**
+ * Return the width of the item left from its start date
+ * @return {number}
+ */
+ Item.prototype.getWidthLeft = function () {
+ return 0;
+ };
+
+ /**
+ * Return the width of the item right from the max of its start and end date
+ * @return {number}
+ */
+ Item.prototype.getWidthRight = function () {
+ return 0;
+ };
+
+ module.exports = Item;
+
+ // should be implemented by the item
+
+ // should be implemented by the item
+
+ // should be implemented by the item
+
+/***/ },
+/* 35 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var Group = __webpack_require__(31);
+
+ /**
+ * @constructor BackgroundGroup
+ * @param {Number | String} groupId
+ * @param {Object} data
+ * @param {ItemSet} itemSet
+ */
+ function BackgroundGroup(groupId, data, itemSet) {
+ Group.call(this, groupId, data, itemSet);
+
+ this.width = 0;
+ this.height = 0;
+ this.top = 0;
+ this.left = 0;
+ }
+
+ BackgroundGroup.prototype = Object.create(Group.prototype);
+
+ /**
+ * Repaint this group
+ * @param {{start: number, end: number}} range
+ * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin
+ * @param {boolean} [restack=false] Force restacking of all items
+ * @return {boolean} Returns true if the group is resized
+ */
+ BackgroundGroup.prototype.redraw = function (range, margin, restack) {
+ var resized = false;
+
+ this.visibleItems = this._updateVisibleItems(this.orderedItems, this.visibleItems, range);
+
+ // calculate actual size
+ this.width = this.dom.background.offsetWidth;
+
+ // apply new height (just always zero for BackgroundGroup
+ this.dom.background.style.height = '0';
+
+ // update vertical position of items after they are re-stacked and the height of the group is calculated
+ for (var i = 0, ii = this.visibleItems.length; i < ii; i++) {
+ var item = this.visibleItems[i];
+ item.repositionY(margin);
+ }
+
+ return resized;
+ };
+
+ /**
+ * Show this group: attach to the DOM
+ */
+ BackgroundGroup.prototype.show = function () {
+ if (!this.dom.background.parentNode) {
+ this.itemSet.dom.background.appendChild(this.dom.background);
+ }
+ };
+
+ module.exports = BackgroundGroup;
+
+/***/ },
+/* 36 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Item = __webpack_require__(34);
+ var util = __webpack_require__(1);
+
+ /**
+ * @constructor BoxItem
+ * @extends Item
+ * @param {Object} data Object containing parameters start
+ * content, className.
+ * @param {{toScreen: function, toTime: function}} conversion
+ * Conversion functions from time to screen and vice versa
+ * @param {Object} [options] Configuration options
+ * // TODO: describe available options
+ */
+ function BoxItem(data, conversion, options) {
+ this.props = {
+ dot: {
+ width: 0,
+ height: 0
+ },
+ line: {
+ width: 0,
+ height: 0
+ }
+ };
+
+ // validate data
+ if (data) {
+ if (data.start == undefined) {
+ throw new Error('Property "start" missing in item ' + data);
+ }
+ }
+
+ Item.call(this, data, conversion, options);
+ }
+
+ BoxItem.prototype = new Item(null, null, null);
+
+ /**
+ * Check whether this item is visible inside given range
+ * @returns {{start: Number, end: Number}} range with a timestamp for start and end
+ * @returns {boolean} True if visible
+ */
+ BoxItem.prototype.isVisible = function (range) {
+ // determine visibility
+ // TODO: account for the real width of the item. Right now we just add 1/4 to the window
+ var interval = (range.end - range.start) / 4;
+ return this.data.start > range.start - interval && this.data.start < range.end + interval;
+ };
+
+ /**
+ * Repaint the item
+ */
+ BoxItem.prototype.redraw = function () {
+ var dom = this.dom;
+ if (!dom) {
+ // create DOM
+ this.dom = {};
+ dom = this.dom;
+
+ // create main box
+ dom.box = document.createElement('DIV');
+
+ // contents box (inside the background box). used for making margins
+ dom.content = document.createElement('DIV');
+ dom.content.className = 'vis-item-content';
+ dom.box.appendChild(dom.content);
+
+ // line to axis
+ dom.line = document.createElement('DIV');
+ dom.line.className = 'vis-line';
+
+ // dot on axis
+ dom.dot = document.createElement('DIV');
+ dom.dot.className = 'vis-dot';
+
+ // attach this item as attribute
+ dom.box['timeline-item'] = this;
+
+ this.dirty = true;
+ }
+
+ // append DOM to parent DOM
+ if (!this.parent) {
+ throw new Error('Cannot redraw item: no parent attached');
+ }
+ if (!dom.box.parentNode) {
+ var foreground = this.parent.dom.foreground;
+ if (!foreground) throw new Error('Cannot redraw item: parent has no foreground container element');
+ foreground.appendChild(dom.box);
+ }
+ if (!dom.line.parentNode) {
+ var background = this.parent.dom.background;
+ if (!background) throw new Error('Cannot redraw item: parent has no background container element');
+ background.appendChild(dom.line);
+ }
+ if (!dom.dot.parentNode) {
+ var axis = this.parent.dom.axis;
+ if (!background) throw new Error('Cannot redraw item: parent has no axis container element');
+ axis.appendChild(dom.dot);
+ }
+ this.displayed = true;
+
+ // Update DOM when item is marked dirty. An item is marked dirty when:
+ // - the item is not yet rendered
+ // - the item's data is changed
+ // - the item is selected/deselected
+ if (this.dirty) {
+ this._updateContents(this.dom.content);
+ this._updateTitle(this.dom.box);
+ this._updateDataAttributes(this.dom.box);
+ this._updateStyle(this.dom.box);
+
+ var editable = (this.options.editable.updateTime || this.options.editable.updateGroup || this.editable === true) && this.editable !== false;
+
+ // update class
+ var className = (this.data.className ? ' ' + this.data.className : '') + (this.selected ? ' vis-selected' : '') + (editable ? ' vis-editable' : ' vis-readonly');
+ dom.box.className = 'vis-item vis-box' + className;
+ dom.line.className = 'vis-item vis-line' + className;
+ dom.dot.className = 'vis-item vis-dot' + className;
+
+ // recalculate size
+ this.props.dot.height = dom.dot.offsetHeight;
+ this.props.dot.width = dom.dot.offsetWidth;
+ this.props.line.width = dom.line.offsetWidth;
+ this.width = dom.box.offsetWidth;
+ this.height = dom.box.offsetHeight;
+
+ this.dirty = false;
+ }
+
+ this._repaintDeleteButton(dom.box);
+ };
+
+ /**
+ * Show the item in the DOM (when not already displayed). The items DOM will
+ * be created when needed.
+ */
+ BoxItem.prototype.show = function () {
+ if (!this.displayed) {
+ this.redraw();
+ }
+ };
+
+ /**
+ * Hide the item from the DOM (when visible)
+ */
+ BoxItem.prototype.hide = function () {
+ if (this.displayed) {
+ var dom = this.dom;
+
+ if (dom.box.parentNode) dom.box.parentNode.removeChild(dom.box);
+ if (dom.line.parentNode) dom.line.parentNode.removeChild(dom.line);
+ if (dom.dot.parentNode) dom.dot.parentNode.removeChild(dom.dot);
+
+ this.displayed = false;
+ }
+ };
+
+ /**
+ * Reposition the item horizontally
+ * @Override
+ */
+ BoxItem.prototype.repositionX = function () {
+ var start = this.conversion.toScreen(this.data.start);
+ var align = this.options.align;
+ var left;
+
+ // calculate left position of the box
+ if (align == 'right') {
+ this.left = start - this.width;
+ } else if (align == 'left') {
+ this.left = start;
+ } else {
+ // default or 'center'
+ this.left = start - this.width / 2;
+ }
+
+ // reposition box
+ this.dom.box.style.left = this.left + 'px';
+
+ // reposition line
+ this.dom.line.style.left = start - this.props.line.width / 2 + 'px';
+
+ // reposition dot
+ this.dom.dot.style.left = start - this.props.dot.width / 2 + 'px';
+ };
+
+ /**
+ * Reposition the item vertically
+ * @Override
+ */
+ BoxItem.prototype.repositionY = function () {
+ var orientation = this.options.orientation.item;
+ var box = this.dom.box;
+ var line = this.dom.line;
+ var dot = this.dom.dot;
+
+ if (orientation == 'top') {
+ box.style.top = (this.top || 0) + 'px';
+
+ line.style.top = '0';
+ line.style.height = this.parent.top + this.top + 1 + 'px';
+ line.style.bottom = '';
+ } else {
+ // orientation 'bottom'
+ var itemSetHeight = this.parent.itemSet.props.height; // TODO: this is nasty
+ var lineHeight = itemSetHeight - this.parent.top - this.parent.height + this.top;
+
+ box.style.top = (this.parent.height - this.top - this.height || 0) + 'px';
+ line.style.top = itemSetHeight - lineHeight + 'px';
+ line.style.bottom = '0';
+ }
+
+ dot.style.top = -this.props.dot.height / 2 + 'px';
+ };
+
+ /**
+ * Return the width of the item left from its start date
+ * @return {number}
+ */
+ BoxItem.prototype.getWidthLeft = function () {
+ return this.width / 2;
+ };
+
+ /**
+ * Return the width of the item right from its start date
+ * @return {number}
+ */
+ BoxItem.prototype.getWidthRight = function () {
+ return this.width / 2;
+ };
+
+ module.exports = BoxItem;
+
+/***/ },
+/* 37 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Item = __webpack_require__(34);
+
+ /**
+ * @constructor PointItem
+ * @extends Item
+ * @param {Object} data Object containing parameters start
+ * content, className.
+ * @param {{toScreen: function, toTime: function}} conversion
+ * Conversion functions from time to screen and vice versa
+ * @param {Object} [options] Configuration options
+ * // TODO: describe available options
+ */
+ function PointItem(data, conversion, options) {
+ this.props = {
+ dot: {
+ top: 0,
+ width: 0,
+ height: 0
+ },
+ content: {
+ height: 0,
+ marginLeft: 0
+ }
+ };
+
+ // validate data
+ if (data) {
+ if (data.start == undefined) {
+ throw new Error('Property "start" missing in item ' + data);
+ }
+ }
+
+ Item.call(this, data, conversion, options);
+ }
+
+ PointItem.prototype = new Item(null, null, null);
+
+ /**
+ * Check whether this item is visible inside given range
+ * @returns {{start: Number, end: Number}} range with a timestamp for start and end
+ * @returns {boolean} True if visible
+ */
+ PointItem.prototype.isVisible = function (range) {
+ // determine visibility
+ // TODO: account for the real width of the item. Right now we just add 1/4 to the window
+ var interval = (range.end - range.start) / 4;
+ return this.data.start > range.start - interval && this.data.start < range.end + interval;
+ };
+
+ /**
+ * Repaint the item
+ */
+ PointItem.prototype.redraw = function () {
+ var dom = this.dom;
+ if (!dom) {
+ // create DOM
+ this.dom = {};
+ dom = this.dom;
+
+ // background box
+ dom.point = document.createElement('div');
+ // className is updated in redraw()
+
+ // contents box, right from the dot
+ dom.content = document.createElement('div');
+ dom.content.className = 'vis-item-content';
+ dom.point.appendChild(dom.content);
+
+ // dot at start
+ dom.dot = document.createElement('div');
+ dom.point.appendChild(dom.dot);
+
+ // attach this item as attribute
+ dom.point['timeline-item'] = this;
+
+ this.dirty = true;
+ }
+
+ // append DOM to parent DOM
+ if (!this.parent) {
+ throw new Error('Cannot redraw item: no parent attached');
+ }
+ if (!dom.point.parentNode) {
+ var foreground = this.parent.dom.foreground;
+ if (!foreground) {
+ throw new Error('Cannot redraw item: parent has no foreground container element');
+ }
+ foreground.appendChild(dom.point);
+ }
+ this.displayed = true;
+
+ // Update DOM when item is marked dirty. An item is marked dirty when:
+ // - the item is not yet rendered
+ // - the item's data is changed
+ // - the item is selected/deselected
+ if (this.dirty) {
+ this._updateContents(this.dom.content);
+ this._updateTitle(this.dom.point);
+ this._updateDataAttributes(this.dom.point);
+ this._updateStyle(this.dom.point);
+
+ var editable = (this.options.editable.updateTime || this.options.editable.updateGroup || this.editable === true) && this.editable !== false;
+
+ // update class
+ var className = (this.data.className ? ' ' + this.data.className : '') + (this.selected ? ' vis-selected' : '') + (editable ? ' vis-editable' : ' vis-readonly');
+ dom.point.className = 'vis-item vis-point' + className;
+ dom.dot.className = 'vis-item vis-dot' + className;
+
+ // recalculate size of dot and contents
+ this.props.dot.width = dom.dot.offsetWidth;
+ this.props.dot.height = dom.dot.offsetHeight;
+ this.props.content.height = dom.content.offsetHeight;
+
+ // resize contents
+ dom.content.style.marginLeft = 2 * this.props.dot.width + 'px';
+ //dom.content.style.marginRight = ... + 'px'; // TODO: margin right
+
+ // recalculate size
+ this.width = dom.point.offsetWidth;
+ this.height = dom.point.offsetHeight;
+
+ // reposition the dot
+ dom.dot.style.top = (this.height - this.props.dot.height) / 2 + 'px';
+ dom.dot.style.left = this.props.dot.width / 2 + 'px';
+
+ this.dirty = false;
+ }
+
+ this._repaintDeleteButton(dom.point);
+ };
+
+ /**
+ * Show the item in the DOM (when not already visible). The items DOM will
+ * be created when needed.
+ */
+ PointItem.prototype.show = function () {
+ if (!this.displayed) {
+ this.redraw();
+ }
+ };
+
+ /**
+ * Hide the item from the DOM (when visible)
+ */
+ PointItem.prototype.hide = function () {
+ if (this.displayed) {
+ if (this.dom.point.parentNode) {
+ this.dom.point.parentNode.removeChild(this.dom.point);
+ }
+
+ this.displayed = false;
+ }
+ };
+
+ /**
+ * Reposition the item horizontally
+ * @Override
+ */
+ PointItem.prototype.repositionX = function () {
+ var start = this.conversion.toScreen(this.data.start);
+
+ this.left = start - this.props.dot.width;
+
+ // reposition point
+ this.dom.point.style.left = this.left + 'px';
+ };
+
+ /**
+ * Reposition the item vertically
+ * @Override
+ */
+ PointItem.prototype.repositionY = function () {
+ var orientation = this.options.orientation.item;
+ var point = this.dom.point;
+
+ if (orientation == 'top') {
+ point.style.top = this.top + 'px';
+ } else {
+ point.style.top = this.parent.height - this.top - this.height + 'px';
+ }
+ };
+
+ /**
+ * Return the width of the item left from its start date
+ * @return {number}
+ */
+ PointItem.prototype.getWidthLeft = function () {
+ return this.props.dot.width;
+ };
+
+ /**
+ * Return the width of the item right from its start date
+ * @return {number}
+ */
+ PointItem.prototype.getWidthRight = function () {
+ return this.width - this.props.dot.width;
+ };
+
+ module.exports = PointItem;
+
+/***/ },
+/* 38 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Hammer = __webpack_require__(20);
+ var Item = __webpack_require__(34);
+ var BackgroundGroup = __webpack_require__(35);
+ var RangeItem = __webpack_require__(33);
+
+ /**
+ * @constructor BackgroundItem
+ * @extends Item
+ * @param {Object} data Object containing parameters start, end
+ * content, className.
+ * @param {{toScreen: function, toTime: function}} conversion
+ * Conversion functions from time to screen and vice versa
+ * @param {Object} [options] Configuration options
+ * // TODO: describe options
+ */
+ // TODO: implement support for the BackgroundItem just having a start, then being displayed as a sort of an annotation
+ function BackgroundItem(data, conversion, options) {
+ this.props = {
+ content: {
+ width: 0
+ }
+ };
+ this.overflow = false; // if contents can overflow (css styling), this flag is set to true
+
+ // validate data
+ if (data) {
+ if (data.start == undefined) {
+ throw new Error('Property "start" missing in item ' + data.id);
+ }
+ if (data.end == undefined) {
+ throw new Error('Property "end" missing in item ' + data.id);
+ }
+ }
+
+ Item.call(this, data, conversion, options);
+ }
+
+ BackgroundItem.prototype = new Item(null, null, null);
+
+ BackgroundItem.prototype.baseClassName = 'vis-item vis-background';
+ BackgroundItem.prototype.stack = false;
+
+ /**
+ * Check whether this item is visible inside given range
+ * @returns {{start: Number, end: Number}} range with a timestamp for start and end
+ * @returns {boolean} True if visible
+ */
+ BackgroundItem.prototype.isVisible = function (range) {
+ // determine visibility
+ return this.data.start < range.end && this.data.end > range.start;
+ };
+
+ /**
+ * Repaint the item
+ */
+ BackgroundItem.prototype.redraw = function () {
+ var dom = this.dom;
+ if (!dom) {
+ // create DOM
+ this.dom = {};
+ dom = this.dom;
+
+ // background box
+ dom.box = document.createElement('div');
+ // className is updated in redraw()
+
+ // frame box (to prevent the item contents from overflowing
+ dom.frame = document.createElement('div');
+ dom.frame.className = 'vis-item-overflow';
+ dom.box.appendChild(dom.frame);
+
+ // contents box
+ dom.content = document.createElement('div');
+ dom.content.className = 'vis-item-content';
+ dom.frame.appendChild(dom.content);
+
+ // Note: we do NOT attach this item as attribute to the DOM,
+ // such that background items cannot be selected
+ //dom.box['timeline-item'] = this;
+
+ this.dirty = true;
+ }
+
+ // append DOM to parent DOM
+ if (!this.parent) {
+ throw new Error('Cannot redraw item: no parent attached');
+ }
+ if (!dom.box.parentNode) {
+ var background = this.parent.dom.background;
+ if (!background) {
+ throw new Error('Cannot redraw item: parent has no background container element');
+ }
+ background.appendChild(dom.box);
+ }
+ this.displayed = true;
+
+ // Update DOM when item is marked dirty. An item is marked dirty when:
+ // - the item is not yet rendered
+ // - the item's data is changed
+ // - the item is selected/deselected
+ if (this.dirty) {
+ this._updateContents(this.dom.content);
+ this._updateTitle(this.dom.content);
+ this._updateDataAttributes(this.dom.content);
+ this._updateStyle(this.dom.box);
+
+ // update class
+ var className = (this.data.className ? ' ' + this.data.className : '') + (this.selected ? ' vis-selected' : '');
+ dom.box.className = this.baseClassName + className;
+
+ // determine from css whether this box has overflow
+ this.overflow = window.getComputedStyle(dom.content).overflow !== 'hidden';
+
+ // recalculate size
+ this.props.content.width = this.dom.content.offsetWidth;
+ this.height = 0; // set height zero, so this item will be ignored when stacking items
+
+ this.dirty = false;
+ }
+ };
+
+ /**
+ * Show the item in the DOM (when not already visible). The items DOM will
+ * be created when needed.
+ */
+ BackgroundItem.prototype.show = RangeItem.prototype.show;
+
+ /**
+ * Hide the item from the DOM (when visible)
+ * @return {Boolean} changed
+ */
+ BackgroundItem.prototype.hide = RangeItem.prototype.hide;
+
+ /**
+ * Reposition the item horizontally
+ * @Override
+ */
+ BackgroundItem.prototype.repositionX = RangeItem.prototype.repositionX;
+
+ /**
+ * Reposition the item vertically
+ * @Override
+ */
+ BackgroundItem.prototype.repositionY = function (margin) {
+ var onTop = this.options.orientation.item === 'top';
+ this.dom.content.style.top = onTop ? '' : '0';
+ this.dom.content.style.bottom = onTop ? '0' : '';
+ var height;
+
+ // special positioning for subgroups
+ if (this.data.subgroup !== undefined) {
+ // TODO: instead of calculating the top position of the subgroups here for every BackgroundItem, calculate the top of the subgroup once in Itemset
+
+ var itemSubgroup = this.data.subgroup;
+ var subgroups = this.parent.subgroups;
+ var subgroupIndex = subgroups[itemSubgroup].index;
+ // if the orientation is top, we need to take the difference in height into account.
+ if (onTop == true) {
+ // the first subgroup will have to account for the distance from the top to the first item.
+ height = this.parent.subgroups[itemSubgroup].height + margin.item.vertical;
+ height += subgroupIndex == 0 ? margin.axis - 0.5 * margin.item.vertical : 0;
+ var newTop = this.parent.top;
+ for (var subgroup in subgroups) {
+ if (subgroups.hasOwnProperty(subgroup)) {
+ if (subgroups[subgroup].visible == true && subgroups[subgroup].index < subgroupIndex) {
+ newTop += subgroups[subgroup].height + margin.item.vertical;
+ }
+ }
+ }
+
+ // the others will have to be offset downwards with this same distance.
+ newTop += subgroupIndex != 0 ? margin.axis - 0.5 * margin.item.vertical : 0;
+ this.dom.box.style.top = newTop + 'px';
+ this.dom.box.style.bottom = '';
+ }
+ // and when the orientation is bottom:
+ else {
+ var newTop = this.parent.top;
+ var totalHeight = 0;
+ for (var subgroup in subgroups) {
+ if (subgroups.hasOwnProperty(subgroup)) {
+ if (subgroups[subgroup].visible == true) {
+ var newHeight = subgroups[subgroup].height + margin.item.vertical;
+ totalHeight += newHeight;
+ if (subgroups[subgroup].index > subgroupIndex) {
+ newTop += newHeight;
+ }
+ }
+ }
+ }
+ height = this.parent.subgroups[itemSubgroup].height + margin.item.vertical;
+ this.dom.box.style.top = this.parent.height - totalHeight + newTop + 'px';
+ this.dom.box.style.bottom = '';
+ }
+ }
+ // and in the case of no subgroups:
+ else {
+ // we want backgrounds with groups to only show in groups.
+ if (this.parent instanceof BackgroundGroup) {
+ // if the item is not in a group:
+ height = Math.max(this.parent.height, this.parent.itemSet.body.domProps.center.height, this.parent.itemSet.body.domProps.centerContainer.height);
+ this.dom.box.style.top = onTop ? '0' : '';
+ this.dom.box.style.bottom = onTop ? '' : '0';
+ } else {
+ height = this.parent.height;
+ // same alignment for items when orientation is top or bottom
+ this.dom.box.style.top = this.parent.top + 'px';
+ this.dom.box.style.bottom = '';
+ }
+ }
+ this.dom.box.style.height = height + 'px';
+ };
+
+ module.exports = BackgroundItem;
+
+/***/ },
+/* 39 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var Component = __webpack_require__(26);
+ var TimeStep = __webpack_require__(30);
+ var DateUtil = __webpack_require__(27);
+ var moment = __webpack_require__(2);
+
+ /**
+ * A horizontal time axis
+ * @param {{dom: Object, domProps: Object, emitter: Emitter, range: Range}} body
+ * @param {Object} [options] See TimeAxis.setOptions for the available
+ * options.
+ * @constructor TimeAxis
+ * @extends Component
+ */
+ function TimeAxis(body, options) {
+ this.dom = {
+ foreground: null,
+ lines: [],
+ majorTexts: [],
+ minorTexts: [],
+ redundant: {
+ lines: [],
+ majorTexts: [],
+ minorTexts: []
+ }
+ };
+ this.props = {
+ range: {
+ start: 0,
+ end: 0,
+ minimumStep: 0
+ },
+ lineTop: 0
+ };
+
+ this.defaultOptions = {
+ orientation: {
+ axis: 'bottom'
+ }, // axis orientation: 'top' or 'bottom'
+ showMinorLabels: true,
+ showMajorLabels: true,
+ format: TimeStep.FORMAT,
+ moment: moment,
+ timeAxis: null
+ };
+ this.options = util.extend({}, this.defaultOptions);
+
+ this.body = body;
+
+ // create the HTML DOM
+ this._create();
+
+ this.setOptions(options);
+ }
+
+ TimeAxis.prototype = new Component();
+
+ /**
+ * Set options for the TimeAxis.
+ * Parameters will be merged in current options.
+ * @param {Object} options Available options:
+ * {string} [orientation.axis]
+ * {boolean} [showMinorLabels]
+ * {boolean} [showMajorLabels]
+ */
+ TimeAxis.prototype.setOptions = function (options) {
+ if (options) {
+ // copy all options that we know
+ util.selectiveExtend(['showMinorLabels', 'showMajorLabels', 'hiddenDates', 'timeAxis', 'moment'], this.options, options);
+
+ // deep copy the format options
+ util.selectiveDeepExtend(['format'], this.options, options);
+
+ if ('orientation' in options) {
+ if (typeof options.orientation === 'string') {
+ this.options.orientation.axis = options.orientation;
+ } else if (typeof options.orientation === 'object' && 'axis' in options.orientation) {
+ this.options.orientation.axis = options.orientation.axis;
+ }
+ }
+
+ // apply locale to moment.js
+ // TODO: not so nice, this is applied globally to moment.js
+ if ('locale' in options) {
+ if (typeof moment.locale === 'function') {
+ // moment.js 2.8.1+
+ moment.locale(options.locale);
+ } else {
+ moment.lang(options.locale);
+ }
+ }
+ }
+ };
+
+ /**
+ * Create the HTML DOM for the TimeAxis
+ */
+ TimeAxis.prototype._create = function () {
+ this.dom.foreground = document.createElement('div');
+ this.dom.background = document.createElement('div');
+
+ this.dom.foreground.className = 'vis-time-axis vis-foreground';
+ this.dom.background.className = 'vis-time-axis vis-background';
+ };
+
+ /**
+ * Destroy the TimeAxis
+ */
+ TimeAxis.prototype.destroy = function () {
+ // remove from DOM
+ if (this.dom.foreground.parentNode) {
+ this.dom.foreground.parentNode.removeChild(this.dom.foreground);
+ }
+ if (this.dom.background.parentNode) {
+ this.dom.background.parentNode.removeChild(this.dom.background);
+ }
+
+ this.body = null;
+ };
+
+ /**
+ * Repaint the component
+ * @return {boolean} Returns true if the component is resized
+ */
+ TimeAxis.prototype.redraw = function () {
+ var props = this.props;
+ var foreground = this.dom.foreground;
+ var background = this.dom.background;
+
+ // determine the correct parent DOM element (depending on option orientation)
+ var parent = this.options.orientation.axis == 'top' ? this.body.dom.top : this.body.dom.bottom;
+ var parentChanged = foreground.parentNode !== parent;
+
+ // calculate character width and height
+ this._calculateCharSize();
+
+ // TODO: recalculate sizes only needed when parent is resized or options is changed
+ var showMinorLabels = this.options.showMinorLabels && this.options.orientation.axis !== 'none';
+ var showMajorLabels = this.options.showMajorLabels && this.options.orientation.axis !== 'none';
+
+ // determine the width and height of the elemens for the axis
+ props.minorLabelHeight = showMinorLabels ? props.minorCharHeight : 0;
+ props.majorLabelHeight = showMajorLabels ? props.majorCharHeight : 0;
+ props.height = props.minorLabelHeight + props.majorLabelHeight;
+ props.width = foreground.offsetWidth;
+
+ props.minorLineHeight = this.body.domProps.root.height - props.majorLabelHeight - (this.options.orientation.axis == 'top' ? this.body.domProps.bottom.height : this.body.domProps.top.height);
+ props.minorLineWidth = 1; // TODO: really calculate width
+ props.majorLineHeight = props.minorLineHeight + props.majorLabelHeight;
+ props.majorLineWidth = 1; // TODO: really calculate width
+
+ // take foreground and background offline while updating (is almost twice as fast)
+ var foregroundNextSibling = foreground.nextSibling;
+ var backgroundNextSibling = background.nextSibling;
+ foreground.parentNode && foreground.parentNode.removeChild(foreground);
+ background.parentNode && background.parentNode.removeChild(background);
+
+ foreground.style.height = this.props.height + 'px';
+
+ this._repaintLabels();
+
+ // put DOM online again (at the same place)
+ if (foregroundNextSibling) {
+ parent.insertBefore(foreground, foregroundNextSibling);
+ } else {
+ parent.appendChild(foreground);
+ }
+ if (backgroundNextSibling) {
+ this.body.dom.backgroundVertical.insertBefore(background, backgroundNextSibling);
+ } else {
+ this.body.dom.backgroundVertical.appendChild(background);
+ }
+
+ return this._isResized() || parentChanged;
+ };
+
+ /**
+ * Repaint major and minor text labels and vertical grid lines
+ * @private
+ */
+ TimeAxis.prototype._repaintLabels = function () {
+ var orientation = this.options.orientation.axis;
+
+ // calculate range and step (step such that we have space for 7 characters per label)
+ var start = util.convert(this.body.range.start, 'Number');
+ var end = util.convert(this.body.range.end, 'Number');
+ var timeLabelsize = this.body.util.toTime((this.props.minorCharWidth || 10) * 7).valueOf();
+ var minimumStep = timeLabelsize - DateUtil.getHiddenDurationBefore(this.options.moment, this.body.hiddenDates, this.body.range, timeLabelsize);
+ minimumStep -= this.body.util.toTime(0).valueOf();
+
+ var step = new TimeStep(new Date(start), new Date(end), minimumStep, this.body.hiddenDates);
+ step.setMoment(this.options.moment);
+ if (this.options.format) {
+ step.setFormat(this.options.format);
+ }
+ if (this.options.timeAxis) {
+ step.setScale(this.options.timeAxis);
+ }
+ this.step = step;
+
+ // Move all DOM elements to a "redundant" list, where they
+ // can be picked for re-use, and clear the lists with lines and texts.
+ // At the end of the function _repaintLabels, left over elements will be cleaned up
+ var dom = this.dom;
+ dom.redundant.lines = dom.lines;
+ dom.redundant.majorTexts = dom.majorTexts;
+ dom.redundant.minorTexts = dom.minorTexts;
+ dom.lines = [];
+ dom.majorTexts = [];
+ dom.minorTexts = [];
+
+ var current;
+ var next;
+ var x;
+ var xNext;
+ var isMajor;
+ var width;
+ var line;
+ var labelMinor;
+ var xFirstMajorLabel = undefined;
+ var max = 0;
+ var className;
+
+ step.start();
+ next = step.getCurrent();
+ xNext = this.body.util.toScreen(next);
+ while (step.hasNext() && max < 1000) {
+ max++;
+
+ isMajor = step.isMajor();
+ className = step.getClassName();
+ labelMinor = step.getLabelMinor();
+
+ current = next;
+ x = xNext;
+
+ step.next();
+ next = step.getCurrent();
+ xNext = this.body.util.toScreen(next);
+
+ width = xNext - x;
+ var labelFits = (labelMinor.length + 1) * this.props.minorCharWidth < width;
+
+ if (this.options.showMinorLabels && labelFits) {
+ this._repaintMinorText(x, labelMinor, orientation, className);
+ }
+
+ if (isMajor && this.options.showMajorLabels) {
+ if (x > 0) {
+ if (xFirstMajorLabel == undefined) {
+ xFirstMajorLabel = x;
+ }
+ this._repaintMajorText(x, step.getLabelMajor(), orientation, className);
+ }
+ line = this._repaintMajorLine(x, width, orientation, className);
+ } else {
+ if (labelFits) {
+ line = this._repaintMinorLine(x, width, orientation, className);
+ } else {
+ if (line) {
+ line.style.width = parseInt(line.style.width) + width + 'px';
+ }
+ }
+ }
+ }
+
+ // create a major label on the left when needed
+ if (this.options.showMajorLabels) {
+ var leftTime = this.body.util.toTime(0),
+ leftText = step.getLabelMajor(leftTime),
+ widthText = leftText.length * (this.props.majorCharWidth || 10) + 10; // upper bound estimation
+
+ if (xFirstMajorLabel == undefined || widthText < xFirstMajorLabel) {
+ this._repaintMajorText(0, leftText, orientation, className);
+ }
+ }
+
+ // Cleanup leftover DOM elements from the redundant list
+ util.forEach(this.dom.redundant, function (arr) {
+ while (arr.length) {
+ var elem = arr.pop();
+ if (elem && elem.parentNode) {
+ elem.parentNode.removeChild(elem);
+ }
+ }
+ });
+ };
+
+ /**
+ * Create a minor label for the axis at position x
+ * @param {Number} x
+ * @param {String} text
+ * @param {String} orientation "top" or "bottom" (default)
+ * @param {String} className
+ * @return {Element} Returns the HTML element of the created label
+ * @private
+ */
+ TimeAxis.prototype._repaintMinorText = function (x, text, orientation, className) {
+ // reuse redundant label
+ var label = this.dom.redundant.minorTexts.shift();
+
+ if (!label) {
+ // create new label
+ var content = document.createTextNode('');
+ label = document.createElement('div');
+ label.appendChild(content);
+ this.dom.foreground.appendChild(label);
+ }
+ this.dom.minorTexts.push(label);
+
+ label.childNodes[0].nodeValue = text;
+
+ label.style.top = orientation == 'top' ? this.props.majorLabelHeight + 'px' : '0';
+ label.style.left = x + 'px';
+ label.className = 'vis-text vis-minor ' + className;
+ //label.title = title; // TODO: this is a heavy operation
+
+ return label;
+ };
+
+ /**
+ * Create a Major label for the axis at position x
+ * @param {Number} x
+ * @param {String} text
+ * @param {String} orientation "top" or "bottom" (default)
+ * @param {String} className
+ * @return {Element} Returns the HTML element of the created label
+ * @private
+ */
+ TimeAxis.prototype._repaintMajorText = function (x, text, orientation, className) {
+ // reuse redundant label
+ var label = this.dom.redundant.majorTexts.shift();
+
+ if (!label) {
+ // create label
+ var content = document.createTextNode(text);
+ label = document.createElement('div');
+ label.appendChild(content);
+ this.dom.foreground.appendChild(label);
+ }
+ this.dom.majorTexts.push(label);
+
+ label.childNodes[0].nodeValue = text;
+ label.className = 'vis-text vis-major ' + className;
+ //label.title = title; // TODO: this is a heavy operation
+
+ label.style.top = orientation == 'top' ? '0' : this.props.minorLabelHeight + 'px';
+ label.style.left = x + 'px';
+
+ return label;
+ };
+
+ /**
+ * Create a minor line for the axis at position x
+ * @param {Number} x
+ * @param {Number} width
+ * @param {String} orientation "top" or "bottom" (default)
+ * @param {String} className
+ * @return {Element} Returns the created line
+ * @private
+ */
+ TimeAxis.prototype._repaintMinorLine = function (x, width, orientation, className) {
+ // reuse redundant line
+ var line = this.dom.redundant.lines.shift();
+ if (!line) {
+ // create vertical line
+ line = document.createElement('div');
+ this.dom.background.appendChild(line);
+ }
+ this.dom.lines.push(line);
+
+ var props = this.props;
+ if (orientation == 'top') {
+ line.style.top = props.majorLabelHeight + 'px';
+ } else {
+ line.style.top = this.body.domProps.top.height + 'px';
+ }
+ line.style.height = props.minorLineHeight + 'px';
+ line.style.left = x - props.minorLineWidth / 2 + 'px';
+ line.style.width = width + 'px';
+
+ line.className = 'vis-grid vis-vertical vis-minor ' + className;
+
+ return line;
+ };
+
+ /**
+ * Create a Major line for the axis at position x
+ * @param {Number} x
+ * @param {Number} width
+ * @param {String} orientation "top" or "bottom" (default)
+ * @param {String} className
+ * @return {Element} Returns the created line
+ * @private
+ */
+ TimeAxis.prototype._repaintMajorLine = function (x, width, orientation, className) {
+ // reuse redundant line
+ var line = this.dom.redundant.lines.shift();
+ if (!line) {
+ // create vertical line
+ line = document.createElement('div');
+ this.dom.background.appendChild(line);
+ }
+ this.dom.lines.push(line);
+
+ var props = this.props;
+ if (orientation == 'top') {
+ line.style.top = '0';
+ } else {
+ line.style.top = this.body.domProps.top.height + 'px';
+ }
+ line.style.left = x - props.majorLineWidth / 2 + 'px';
+ line.style.height = props.majorLineHeight + 'px';
+ line.style.width = width + 'px';
+
+ line.className = 'vis-grid vis-vertical vis-major ' + className;
+
+ return line;
+ };
+
+ /**
+ * Determine the size of text on the axis (both major and minor axis).
+ * The size is calculated only once and then cached in this.props.
+ * @private
+ */
+ TimeAxis.prototype._calculateCharSize = function () {
+ // Note: We calculate char size with every redraw. Size may change, for
+ // example when any of the timelines parents had display:none for example.
+
+ // determine the char width and height on the minor axis
+ if (!this.dom.measureCharMinor) {
+ this.dom.measureCharMinor = document.createElement('DIV');
+ this.dom.measureCharMinor.className = 'vis-text vis-minor vis-measure';
+ this.dom.measureCharMinor.style.position = 'absolute';
+
+ this.dom.measureCharMinor.appendChild(document.createTextNode('0'));
+ this.dom.foreground.appendChild(this.dom.measureCharMinor);
+ }
+ this.props.minorCharHeight = this.dom.measureCharMinor.clientHeight;
+ this.props.minorCharWidth = this.dom.measureCharMinor.clientWidth;
+
+ // determine the char width and height on the major axis
+ if (!this.dom.measureCharMajor) {
+ this.dom.measureCharMajor = document.createElement('DIV');
+ this.dom.measureCharMajor.className = 'vis-text vis-major vis-measure';
+ this.dom.measureCharMajor.style.position = 'absolute';
+
+ this.dom.measureCharMajor.appendChild(document.createTextNode('0'));
+ this.dom.foreground.appendChild(this.dom.measureCharMajor);
+ }
+ this.props.majorCharHeight = this.dom.measureCharMajor.clientHeight;
+ this.props.majorCharWidth = this.dom.measureCharMajor.clientWidth;
+ };
+
+ module.exports = TimeAxis;
+
+/***/ },
+/* 40 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var keycharm = __webpack_require__(41);
+ var Emitter = __webpack_require__(12);
+ var Hammer = __webpack_require__(20);
+ var util = __webpack_require__(1);
+
+ /**
+ * Turn an element into an clickToUse element.
+ * When not active, the element has a transparent overlay. When the overlay is
+ * clicked, the mode is changed to active.
+ * When active, the element is displayed with a blue border around it, and
+ * the interactive contents of the element can be used. When clicked outside
+ * the element, the elements mode is changed to inactive.
+ * @param {Element} container
+ * @constructor
+ */
+ function Activator(container) {
+ this.active = false;
+
+ this.dom = {
+ container: container
+ };
+
+ this.dom.overlay = document.createElement('div');
+ this.dom.overlay.className = 'vis-overlay';
+
+ this.dom.container.appendChild(this.dom.overlay);
+
+ this.hammer = Hammer(this.dom.overlay);
+ this.hammer.on('tap', this._onTapOverlay.bind(this));
+
+ // block all touch events (except tap)
+ var me = this;
+ var events = ['tap', 'doubletap', 'press', 'pinch', 'pan', 'panstart', 'panmove', 'panend'];
+ events.forEach(function (event) {
+ me.hammer.on(event, function (event) {
+ event.stopPropagation();
+ });
+ });
+
+ // attach a click event to the window, in order to deactivate when clicking outside the timeline
+ if (document && document.body) {
+ this.onClick = function (event) {
+ if (!_hasParent(event.target, container)) {
+ me.deactivate();
+ }
+ };
+ document.body.addEventListener('click', this.onClick);
+ }
+
+ if (this.keycharm !== undefined) {
+ this.keycharm.destroy();
+ }
+ this.keycharm = keycharm();
+
+ // keycharm listener only bounded when active)
+ this.escListener = this.deactivate.bind(this);
+ }
+
+ // turn into an event emitter
+ Emitter(Activator.prototype);
+
+ // The currently active activator
+ Activator.current = null;
+
+ /**
+ * Destroy the activator. Cleans up all created DOM and event listeners
+ */
+ Activator.prototype.destroy = function () {
+ this.deactivate();
+
+ // remove dom
+ this.dom.overlay.parentNode.removeChild(this.dom.overlay);
+
+ // remove global event listener
+ if (this.onClick) {
+ document.body.removeEventListener('click', this.onClick);
+ }
+
+ // cleanup hammer instances
+ this.hammer.destroy();
+ this.hammer = null;
+ // FIXME: cleaning up hammer instances doesn't work (Timeline not removed from memory)
+ };
+
+ /**
+ * Activate the element
+ * Overlay is hidden, element is decorated with a blue shadow border
+ */
+ Activator.prototype.activate = function () {
+ // we allow only one active activator at a time
+ if (Activator.current) {
+ Activator.current.deactivate();
+ }
+ Activator.current = this;
+
+ this.active = true;
+ this.dom.overlay.style.display = 'none';
+ util.addClassName(this.dom.container, 'vis-active');
+
+ this.emit('change');
+ this.emit('activate');
+
+ // ugly hack: bind ESC after emitting the events, as the Network rebinds all
+ // keyboard events on a 'change' event
+ this.keycharm.bind('esc', this.escListener);
+ };
+
+ /**
+ * Deactivate the element
+ * Overlay is displayed on top of the element
+ */
+ Activator.prototype.deactivate = function () {
+ this.active = false;
+ this.dom.overlay.style.display = '';
+ util.removeClassName(this.dom.container, 'vis-active');
+ this.keycharm.unbind('esc', this.escListener);
+
+ this.emit('change');
+ this.emit('deactivate');
+ };
+
+ /**
+ * Handle a tap event: activate the container
+ * @param event
+ * @private
+ */
+ Activator.prototype._onTapOverlay = function (event) {
+ // activate the container
+ this.activate();
+ event.stopPropagation();
+ };
+
+ /**
+ * Test whether the element has the requested parent element somewhere in
+ * its chain of parent nodes.
+ * @param {HTMLElement} element
+ * @param {HTMLElement} parent
+ * @returns {boolean} Returns true when the parent is found somewhere in the
+ * chain of parent nodes.
+ * @private
+ */
+ function _hasParent(element, parent) {
+ while (element) {
+ if (element === parent) {
+ return true;
+ }
+ element = element.parentNode;
+ }
+ return false;
+ }
+
+ module.exports = Activator;
+
+/***/ },
+/* 41 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;"use strict";
+ /**
+ * Created by Alex on 11/6/2014.
+ */
+
+ // https://github.com/umdjs/umd/blob/master/returnExports.js#L40-L60
+ // if the module has no dependencies, the above pattern can be simplified to
+ (function (root, factory) {
+ if (true) {
+ // AMD. Register as an anonymous module.
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
+ } else if (typeof exports === 'object') {
+ // Node. Does not work with strict CommonJS, but
+ // only CommonJS-like environments that support module.exports,
+ // like Node.
+ module.exports = factory();
+ } else {
+ // Browser globals (root is window)
+ root.keycharm = factory();
+ }
+ }(this, function () {
+
+ function keycharm(options) {
+ var preventDefault = options && options.preventDefault || false;
+
+ var container = options && options.container || window;
+
+ var _exportFunctions = {};
+ var _bound = {keydown:{}, keyup:{}};
+ var _keys = {};
+ var i;
+
+ // a - z
+ for (i = 97; i <= 122; i++) {_keys[String.fromCharCode(i)] = {code:65 + (i - 97), shift: false};}
+ // A - Z
+ for (i = 65; i <= 90; i++) {_keys[String.fromCharCode(i)] = {code:i, shift: true};}
+ // 0 - 9
+ for (i = 0; i <= 9; i++) {_keys['' + i] = {code:48 + i, shift: false};}
+ // F1 - F12
+ for (i = 1; i <= 12; i++) {_keys['F' + i] = {code:111 + i, shift: false};}
+ // num0 - num9
+ for (i = 0; i <= 9; i++) {_keys['num' + i] = {code:96 + i, shift: false};}
+
+ // numpad misc
+ _keys['num*'] = {code:106, shift: false};
+ _keys['num+'] = {code:107, shift: false};
+ _keys['num-'] = {code:109, shift: false};
+ _keys['num/'] = {code:111, shift: false};
+ _keys['num.'] = {code:110, shift: false};
+ // arrows
+ _keys['left'] = {code:37, shift: false};
+ _keys['up'] = {code:38, shift: false};
+ _keys['right'] = {code:39, shift: false};
+ _keys['down'] = {code:40, shift: false};
+ // extra keys
+ _keys['space'] = {code:32, shift: false};
+ _keys['enter'] = {code:13, shift: false};
+ _keys['shift'] = {code:16, shift: undefined};
+ _keys['esc'] = {code:27, shift: false};
+ _keys['backspace'] = {code:8, shift: false};
+ _keys['tab'] = {code:9, shift: false};
+ _keys['ctrl'] = {code:17, shift: false};
+ _keys['alt'] = {code:18, shift: false};
+ _keys['delete'] = {code:46, shift: false};
+ _keys['pageup'] = {code:33, shift: false};
+ _keys['pagedown'] = {code:34, shift: false};
+ // symbols
+ _keys['='] = {code:187, shift: false};
+ _keys['-'] = {code:189, shift: false};
+ _keys[']'] = {code:221, shift: false};
+ _keys['['] = {code:219, shift: false};
+
+
+
+ var down = function(event) {handleEvent(event,'keydown');};
+ var up = function(event) {handleEvent(event,'keyup');};
+
+ // handle the actualy bound key with the event
+ var handleEvent = function(event,type) {
+ if (_bound[type][event.keyCode] !== undefined) {
+ var bound = _bound[type][event.keyCode];
+ for (var i = 0; i < bound.length; i++) {
+ if (bound[i].shift === undefined) {
+ bound[i].fn(event);
+ }
+ else if (bound[i].shift == true && event.shiftKey == true) {
+ bound[i].fn(event);
+ }
+ else if (bound[i].shift == false && event.shiftKey == false) {
+ bound[i].fn(event);
+ }
+ }
+
+ if (preventDefault == true) {
+ event.preventDefault();
+ }
+ }
+ };
+
+ // bind a key to a callback
+ _exportFunctions.bind = function(key, callback, type) {
+ if (type === undefined) {
+ type = 'keydown';
+ }
+ if (_keys[key] === undefined) {
+ throw new Error("unsupported key: " + key);
+ }
+ if (_bound[type][_keys[key].code] === undefined) {
+ _bound[type][_keys[key].code] = [];
+ }
+ _bound[type][_keys[key].code].push({fn:callback, shift:_keys[key].shift});
+ };
+
+
+ // bind all keys to a call back (demo purposes)
+ _exportFunctions.bindAll = function(callback, type) {
+ if (type === undefined) {
+ type = 'keydown';
+ }
+ for (var key in _keys) {
+ if (_keys.hasOwnProperty(key)) {
+ _exportFunctions.bind(key,callback,type);
+ }
+ }
+ };
+
+ // get the key label from an event
+ _exportFunctions.getKey = function(event) {
+ for (var key in _keys) {
+ if (_keys.hasOwnProperty(key)) {
+ if (event.shiftKey == true && _keys[key].shift == true && event.keyCode == _keys[key].code) {
+ return key;
+ }
+ else if (event.shiftKey == false && _keys[key].shift == false && event.keyCode == _keys[key].code) {
+ return key;
+ }
+ else if (event.keyCode == _keys[key].code && key == 'shift') {
+ return key;
+ }
+ }
+ }
+ return "unknown key, currently not supported";
+ };
+
+ // unbind either a specific callback from a key or all of them (by leaving callback undefined)
+ _exportFunctions.unbind = function(key, callback, type) {
+ if (type === undefined) {
+ type = 'keydown';
+ }
+ if (_keys[key] === undefined) {
+ throw new Error("unsupported key: " + key);
+ }
+ if (callback !== undefined) {
+ var newBindings = [];
+ var bound = _bound[type][_keys[key].code];
+ if (bound !== undefined) {
+ for (var i = 0; i < bound.length; i++) {
+ if (!(bound[i].fn == callback && bound[i].shift == _keys[key].shift)) {
+ newBindings.push(_bound[type][_keys[key].code][i]);
+ }
+ }
+ }
+ _bound[type][_keys[key].code] = newBindings;
+ }
+ else {
+ _bound[type][_keys[key].code] = [];
+ }
+ };
+
+ // reset all bound variables.
+ _exportFunctions.reset = function() {
+ _bound = {keydown:{}, keyup:{}};
+ };
+
+ // unbind all listeners and reset all variables.
+ _exportFunctions.destroy = function() {
+ _bound = {keydown:{}, keyup:{}};
+ container.removeEventListener('keydown', down, true);
+ container.removeEventListener('keyup', up, true);
+ };
+
+ // create listeners.
+ container.addEventListener('keydown',down,true);
+ container.addEventListener('keyup',up,true);
+
+ // return the public functions.
+ return _exportFunctions;
+ }
+
+ return keycharm;
+ }));
+
+
+
+
+/***/ },
+/* 42 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Hammer = __webpack_require__(20);
+ var util = __webpack_require__(1);
+ var Component = __webpack_require__(26);
+ var moment = __webpack_require__(2);
+ var locales = __webpack_require__(43);
+
+ /**
+ * A custom time bar
+ * @param {{range: Range, dom: Object}} body
+ * @param {Object} [options] Available parameters:
+ * {number | string} id
+ * {string} locales
+ * {string} locale
+ * @constructor CustomTime
+ * @extends Component
+ */
+
+ function CustomTime(body, options) {
+ this.body = body;
+
+ // default options
+ this.defaultOptions = {
+ moment: moment,
+ locales: locales,
+ locale: 'en',
+ id: undefined,
+ title: undefined
+ };
+ this.options = util.extend({}, this.defaultOptions);
+
+ if (options && options.time) {
+ this.customTime = options.time;
+ } else {
+ this.customTime = new Date();
+ }
+
+ this.eventParams = {}; // stores state parameters while dragging the bar
+
+ this.setOptions(options);
+
+ // create the DOM
+ this._create();
+ }
+
+ CustomTime.prototype = new Component();
+
+ /**
+ * Set options for the component. Options will be merged in current options.
+ * @param {Object} options Available parameters:
+ * {number | string} id
+ * {string} locales
+ * {string} locale
+ */
+ CustomTime.prototype.setOptions = function (options) {
+ if (options) {
+ // copy all options that we know
+ util.selectiveExtend(['moment', 'locale', 'locales', 'id'], this.options, options);
+ }
+ };
+
+ /**
+ * Create the DOM for the custom time
+ * @private
+ */
+ CustomTime.prototype._create = function () {
+ var bar = document.createElement('div');
+ bar['custom-time'] = this;
+ bar.className = 'vis-custom-time ' + (this.options.id || '');
+ bar.style.position = 'absolute';
+ bar.style.top = '0px';
+ bar.style.height = '100%';
+ this.bar = bar;
+
+ var drag = document.createElement('div');
+ drag.style.position = 'relative';
+ drag.style.top = '0px';
+ drag.style.left = '-10px';
+ drag.style.height = '100%';
+ drag.style.width = '20px';
+ bar.appendChild(drag);
+
+ // attach event listeners
+ this.hammer = new Hammer(drag);
+ this.hammer.on('panstart', this._onDragStart.bind(this));
+ this.hammer.on('panmove', this._onDrag.bind(this));
+ this.hammer.on('panend', this._onDragEnd.bind(this));
+ this.hammer.get('pan').set({ threshold: 5, direction: 30 }); // 30 is ALL_DIRECTIONS in hammer.
+ };
+
+ /**
+ * Destroy the CustomTime bar
+ */
+ CustomTime.prototype.destroy = function () {
+ this.hide();
+
+ this.hammer.destroy();
+ this.hammer = null;
+
+ this.body = null;
+ };
+
+ /**
+ * Repaint the component
+ * @return {boolean} Returns true if the component is resized
+ */
+ CustomTime.prototype.redraw = function () {
+ var parent = this.body.dom.backgroundVertical;
+ if (this.bar.parentNode != parent) {
+ // attach to the dom
+ if (this.bar.parentNode) {
+ this.bar.parentNode.removeChild(this.bar);
+ }
+ parent.appendChild(this.bar);
+ }
+
+ var x = this.body.util.toScreen(this.customTime);
+
+ var locale = this.options.locales[this.options.locale];
+ if (!locale) {
+ if (!this.warned) {
+ console.log('WARNING: options.locales[\'' + this.options.locale + '\'] not found. See http://visjs.org/docs/timeline.html#Localization');
+ this.warned = true;
+ }
+ locale = this.options.locales['en']; // fall back on english when not available
+ }
+
+ var title = this.options.title;
+ // To hide the title completely use empty string ''.
+ if (title === undefined) {
+ title = locale.time + ': ' + this.options.moment(this.customTime).format('dddd, MMMM Do YYYY, H:mm:ss');
+ title = title.charAt(0).toUpperCase() + title.substring(1);
+ }
+
+ this.bar.style.left = x + 'px';
+ this.bar.title = title;
+
+ return false;
+ };
+
+ /**
+ * Remove the CustomTime from the DOM
+ */
+ CustomTime.prototype.hide = function () {
+ // remove the line from the DOM
+ if (this.bar.parentNode) {
+ this.bar.parentNode.removeChild(this.bar);
+ }
+ };
+
+ /**
+ * Set custom time.
+ * @param {Date | number | string} time
+ */
+ CustomTime.prototype.setCustomTime = function (time) {
+ this.customTime = util.convert(time, 'Date');
+ this.redraw();
+ };
+
+ /**
+ * Retrieve the current custom time.
+ * @return {Date} customTime
+ */
+ CustomTime.prototype.getCustomTime = function () {
+ return new Date(this.customTime.valueOf());
+ };
+
+ /**
+ * Set custom title.
+ * @param {Date | number | string} title
+ */
+ CustomTime.prototype.setCustomTitle = function (title) {
+ this.options.title = title;
+ };
+
+ /**
+ * Start moving horizontally
+ * @param {Event} event
+ * @private
+ */
+ CustomTime.prototype._onDragStart = function (event) {
+ this.eventParams.dragging = true;
+ this.eventParams.customTime = this.customTime;
+
+ event.stopPropagation();
+ };
+
+ /**
+ * Perform moving operating.
+ * @param {Event} event
+ * @private
+ */
+ CustomTime.prototype._onDrag = function (event) {
+ if (!this.eventParams.dragging) return;
+
+ var x = this.body.util.toScreen(this.eventParams.customTime) + event.deltaX;
+ var time = this.body.util.toTime(x);
+
+ this.setCustomTime(time);
+
+ // fire a timechange event
+ this.body.emitter.emit('timechange', {
+ id: this.options.id,
+ time: new Date(this.customTime.valueOf())
+ });
+
+ event.stopPropagation();
+ };
+
+ /**
+ * Stop moving operating.
+ * @param {Event} event
+ * @private
+ */
+ CustomTime.prototype._onDragEnd = function (event) {
+ if (!this.eventParams.dragging) return;
+
+ // fire a timechanged event
+ this.body.emitter.emit('timechanged', {
+ id: this.options.id,
+ time: new Date(this.customTime.valueOf())
+ });
+
+ event.stopPropagation();
+ };
+
+ /**
+ * Find a custom time from an event target:
+ * searches for the attribute 'custom-time' in the event target's element tree
+ * @param {Event} event
+ * @return {CustomTime | null} customTime
+ */
+ CustomTime.customTimeFromTarget = function (event) {
+ var target = event.target;
+ while (target) {
+ if (target.hasOwnProperty('custom-time')) {
+ return target['custom-time'];
+ }
+ target = target.parentNode;
+ }
+
+ return null;
+ };
+
+ module.exports = CustomTime;
+
+/***/ },
+/* 43 */
+/***/ function(module, exports) {
+
+ // English
+ 'use strict';
+
+ exports['en'] = {
+ current: 'current',
+ time: 'time'
+ };
+ exports['en_EN'] = exports['en'];
+ exports['en_US'] = exports['en'];
+
+ // Dutch
+ exports['nl'] = {
+ current: 'huidige',
+ time: 'tijd'
+ };
+ exports['nl_NL'] = exports['nl'];
+ exports['nl_BE'] = exports['nl'];
+
+/***/ },
+/* 44 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var Component = __webpack_require__(26);
+ var moment = __webpack_require__(2);
+ var locales = __webpack_require__(43);
+
+ /**
+ * A current time bar
+ * @param {{range: Range, dom: Object, domProps: Object}} body
+ * @param {Object} [options] Available parameters:
+ * {Boolean} [showCurrentTime]
+ * @constructor CurrentTime
+ * @extends Component
+ */
+ function CurrentTime(body, options) {
+ this.body = body;
+
+ // default options
+ this.defaultOptions = {
+ showCurrentTime: true,
+
+ moment: moment,
+ locales: locales,
+ locale: 'en'
+ };
+ this.options = util.extend({}, this.defaultOptions);
+ this.offset = 0;
+
+ this._create();
+
+ this.setOptions(options);
+ }
+
+ CurrentTime.prototype = new Component();
+
+ /**
+ * Create the HTML DOM for the current time bar
+ * @private
+ */
+ CurrentTime.prototype._create = function () {
+ var bar = document.createElement('div');
+ bar.className = 'vis-current-time';
+ bar.style.position = 'absolute';
+ bar.style.top = '0px';
+ bar.style.height = '100%';
+
+ this.bar = bar;
+ };
+
+ /**
+ * Destroy the CurrentTime bar
+ */
+ CurrentTime.prototype.destroy = function () {
+ this.options.showCurrentTime = false;
+ this.redraw(); // will remove the bar from the DOM and stop refreshing
+
+ this.body = null;
+ };
+
+ /**
+ * Set options for the component. Options will be merged in current options.
+ * @param {Object} options Available parameters:
+ * {boolean} [showCurrentTime]
+ */
+ CurrentTime.prototype.setOptions = function (options) {
+ if (options) {
+ // copy all options that we know
+ util.selectiveExtend(['showCurrentTime', 'moment', 'locale', 'locales'], this.options, options);
+ }
+ };
+
+ /**
+ * Repaint the component
+ * @return {boolean} Returns true if the component is resized
+ */
+ CurrentTime.prototype.redraw = function () {
+ if (this.options.showCurrentTime) {
+ var parent = this.body.dom.backgroundVertical;
+ if (this.bar.parentNode != parent) {
+ // attach to the dom
+ if (this.bar.parentNode) {
+ this.bar.parentNode.removeChild(this.bar);
+ }
+ parent.appendChild(this.bar);
+
+ this.start();
+ }
+
+ var now = this.options.moment(new Date().valueOf() + this.offset);
+ var x = this.body.util.toScreen(now);
+
+ var locale = this.options.locales[this.options.locale];
+ if (!locale) {
+ if (!this.warned) {
+ console.log('WARNING: options.locales[\'' + this.options.locale + '\'] not found. See http://visjs.org/docs/timeline.html#Localization');
+ this.warned = true;
+ }
+ locale = this.options.locales['en']; // fall back on english when not available
+ }
+ var title = locale.current + ' ' + locale.time + ': ' + now.format('dddd, MMMM Do YYYY, H:mm:ss');
+ title = title.charAt(0).toUpperCase() + title.substring(1);
+
+ this.bar.style.left = x + 'px';
+ this.bar.title = title;
+ } else {
+ // remove the line from the DOM
+ if (this.bar.parentNode) {
+ this.bar.parentNode.removeChild(this.bar);
+ }
+ this.stop();
+ }
+
+ return false;
+ };
+
+ /**
+ * Start auto refreshing the current time bar
+ */
+ CurrentTime.prototype.start = function () {
+ var me = this;
+
+ function update() {
+ me.stop();
+
+ // determine interval to refresh
+ var scale = me.body.range.conversion(me.body.domProps.center.width).scale;
+ var interval = 1 / scale / 10;
+ if (interval < 30) interval = 30;
+ if (interval > 1000) interval = 1000;
+
+ me.redraw();
+
+ // start a renderTimer to adjust for the new time
+ me.currentTimeTimer = setTimeout(update, interval);
+ }
+
+ update();
+ };
+
+ /**
+ * Stop auto refreshing the current time bar
+ */
+ CurrentTime.prototype.stop = function () {
+ if (this.currentTimeTimer !== undefined) {
+ clearTimeout(this.currentTimeTimer);
+ delete this.currentTimeTimer;
+ }
+ };
+
+ /**
+ * Set a current time. This can be used for example to ensure that a client's
+ * time is synchronized with a shared server time.
+ * @param {Date | String | Number} time A Date, unix timestamp, or
+ * ISO date string.
+ */
+ CurrentTime.prototype.setCurrentTime = function (time) {
+ var t = util.convert(time, 'Date').valueOf();
+ var now = new Date().valueOf();
+ this.offset = t - now;
+ this.redraw();
+ };
+
+ /**
+ * Get the current time.
+ * @return {Date} Returns the current time.
+ */
+ CurrentTime.prototype.getCurrentTime = function () {
+ return new Date(new Date().valueOf() + this.offset);
+ };
+
+ module.exports = CurrentTime;
+
+/***/ },
+/* 45 */
+/***/ 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 _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 _ColorPicker = __webpack_require__(46);
+
+ var _ColorPicker2 = _interopRequireDefault(_ColorPicker);
+
+ var util = __webpack_require__(1);
+
+ /**
+ * The way this works is for all properties of this.possible options, you can supply the property name in any form to list the options.
+ * Boolean options are recognised as Boolean
+ * Number options should be written as array: [default value, min value, max value, stepsize]
+ * Colors should be written as array: ['color', '#ffffff']
+ * Strings with should be written as array: [option1, option2, option3, ..]
+ *
+ * The options are matched with their counterparts in each of the modules and the values used in the configuration are
+ *
+ * @param parentModule | the location where parentModule.setOptions() can be called
+ * @param defaultContainer | the default container of the module
+ * @param configureOptions | the fully configured and predefined options set found in allOptions.js
+ * @param pixelRatio | canvas pixel ratio
+ */
+
+ var Configurator = (function () {
+ function Configurator(parentModule, defaultContainer, configureOptions) {
+ var pixelRatio = arguments.length <= 3 || arguments[3] === undefined ? 1 : arguments[3];
+
+ _classCallCheck(this, Configurator);
+
+ this.parent = parentModule;
+ this.changedOptions = [];
+ this.container = defaultContainer;
+ this.allowCreation = false;
+
+ this.options = {};
+ this.initialized = false;
+ this.popupCounter = 0;
+ this.defaultOptions = {
+ enabled: false,
+ filter: true,
+ container: undefined,
+ showButton: true
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ this.configureOptions = configureOptions;
+ this.moduleOptions = {};
+ this.domElements = [];
+ this.popupDiv = {};
+ this.popupLimit = 5;
+ this.popupHistory = {};
+ this.colorPicker = new _ColorPicker2['default'](pixelRatio);
+ this.wrapper = undefined;
+ }
+
+ _createClass(Configurator, [{
+ key: 'setOptions',
+
+ /**
+ * refresh all options.
+ * Because all modules parse their options by themselves, we just use their options. We copy them here.
+ *
+ * @param options
+ */
+ value: function setOptions(options) {
+ if (options !== undefined) {
+ // reset the popup history because the indices may have been changed.
+ this.popupHistory = {};
+ this._removePopup();
+
+ var enabled = true;
+ if (typeof options === 'string') {
+ this.options.filter = options;
+ } else if (options instanceof Array) {
+ this.options.filter = options.join();
+ } else if (typeof options === 'object') {
+ if (options.container !== undefined) {
+ this.options.container = options.container;
+ }
+ if (options.filter !== undefined) {
+ this.options.filter = options.filter;
+ }
+ if (options.showButton !== undefined) {
+ this.options.showButton = options.showButton;
+ }
+ if (options.enabled !== undefined) {
+ enabled = options.enabled;
+ }
+ } else if (typeof options === 'boolean') {
+ this.options.filter = true;
+ enabled = options;
+ } else if (typeof options === 'function') {
+ this.options.filter = options;
+ enabled = true;
+ }
+ if (this.options.filter === false) {
+ enabled = false;
+ }
+
+ this.options.enabled = enabled;
+ }
+ this._clean();
+ }
+ }, {
+ key: 'setModuleOptions',
+ value: function setModuleOptions(moduleOptions) {
+ this.moduleOptions = moduleOptions;
+ if (this.options.enabled === true) {
+ this._clean();
+ if (this.options.container !== undefined) {
+ this.container = this.options.container;
+ }
+ this._create();
+ }
+ }
+ }, {
+ key: '_create',
+
+ /**
+ * Create all DOM elements
+ * @private
+ */
+ value: function _create() {
+ var _this = this;
+
+ this._clean();
+ this.changedOptions = [];
+
+ var filter = this.options.filter;
+ var counter = 0;
+ var show = false;
+ for (var option in this.configureOptions) {
+ if (this.configureOptions.hasOwnProperty(option)) {
+ this.allowCreation = false;
+ show = false;
+ if (typeof filter === 'function') {
+ show = filter(option, []);
+ show = show || this._handleObject(this.configureOptions[option], [option], true);
+ } else if (filter === true || filter.indexOf(option) !== -1) {
+ show = true;
+ }
+
+ if (show !== false) {
+ this.allowCreation = true;
+
+ // linebreak between categories
+ if (counter > 0) {
+ this._makeItem([]);
+ }
+ // a header for the category
+ this._makeHeader(option);
+
+ // get the suboptions
+ this._handleObject(this.configureOptions[option], [option]);
+ }
+ counter++;
+ }
+ }
+
+ if (this.options.showButton === true) {
+ (function () {
+ var generateButton = document.createElement('div');
+ generateButton.className = 'vis-configuration vis-config-button';
+ generateButton.innerHTML = 'generate options';
+ generateButton.onclick = function () {
+ _this._printOptions();
+ };
+ generateButton.onmouseover = function () {
+ generateButton.className = 'vis-configuration vis-config-button hover';
+ };
+ generateButton.onmouseout = function () {
+ generateButton.className = 'vis-configuration vis-config-button';
+ };
+
+ _this.optionsContainer = document.createElement('div');
+ _this.optionsContainer.className = 'vis-configuration vis-config-option-container';
+
+ _this.domElements.push(_this.optionsContainer);
+ _this.domElements.push(generateButton);
+ })();
+ }
+
+ this._push();
+ this.colorPicker.insertTo(this.container);
+ }
+ }, {
+ key: '_push',
+
+ /**
+ * draw all DOM elements on the screen
+ * @private
+ */
+ value: function _push() {
+ this.wrapper = document.createElement('div');
+ this.wrapper.className = 'vis-configuration-wrapper';
+ this.container.appendChild(this.wrapper);
+ for (var i = 0; i < this.domElements.length; i++) {
+ this.wrapper.appendChild(this.domElements[i]);
+ }
+
+ this._showPopupIfNeeded();
+ }
+ }, {
+ key: '_clean',
+
+ /**
+ * delete all DOM elements
+ * @private
+ */
+ value: function _clean() {
+ for (var i = 0; i < this.domElements.length; i++) {
+ this.wrapper.removeChild(this.domElements[i]);
+ }
+
+ if (this.wrapper !== undefined) {
+ this.container.removeChild(this.wrapper);
+ this.wrapper = undefined;
+ }
+ this.domElements = [];
+
+ this._removePopup();
+ }
+ }, {
+ key: '_getValue',
+
+ /**
+ * get the value from the actualOptions if it exists
+ * @param {array} path | where to look for the actual option
+ * @returns {*}
+ * @private
+ */
+ value: function _getValue(path) {
+ var base = this.moduleOptions;
+ for (var i = 0; i < path.length; i++) {
+ if (base[path[i]] !== undefined) {
+ base = base[path[i]];
+ } else {
+ base = undefined;
+ break;
+ }
+ }
+ return base;
+ }
+ }, {
+ key: '_makeItem',
+
+ /**
+ * all option elements are wrapped in an item
+ * @param path
+ * @param domElements
+ * @private
+ */
+ value: function _makeItem(path) {
+ var _arguments = arguments,
+ _this2 = this;
+
+ if (this.allowCreation === true) {
+ var _len, domElements, _key;
+
+ var _ret2 = (function () {
+ var item = document.createElement('div');
+ item.className = 'vis-configuration vis-config-item vis-config-s' + path.length;
+
+ for (_len = _arguments.length, domElements = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ domElements[_key - 1] = _arguments[_key];
+ }
+
+ domElements.forEach(function (element) {
+ item.appendChild(element);
+ });
+ _this2.domElements.push(item);
+ return {
+ v: _this2.domElements.length
+ };
+ })();
+
+ if (typeof _ret2 === 'object') return _ret2.v;
+ }
+ return 0;
+ }
+ }, {
+ key: '_makeHeader',
+
+ /**
+ * header for major subjects
+ * @param name
+ * @private
+ */
+ value: function _makeHeader(name) {
+ var div = document.createElement('div');
+ div.className = 'vis-configuration vis-config-header';
+ div.innerHTML = name;
+ this._makeItem([], div);
+ }
+ }, {
+ key: '_makeLabel',
+
+ /**
+ * make a label, if it is an object label, it gets different styling.
+ * @param name
+ * @param path
+ * @param objectLabel
+ * @returns {HTMLElement}
+ * @private
+ */
+ value: function _makeLabel(name, path) {
+ var objectLabel = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+
+ var div = document.createElement('div');
+ div.className = 'vis-configuration vis-config-label vis-config-s' + path.length;
+ if (objectLabel === true) {
+ div.innerHTML = '' + name + ': ';
+ } else {
+ div.innerHTML = name + ':';
+ }
+ return div;
+ }
+ }, {
+ key: '_makeDropdown',
+
+ /**
+ * make a dropdown list for multiple possible string optoins
+ * @param arr
+ * @param value
+ * @param path
+ * @private
+ */
+ value: function _makeDropdown(arr, value, path) {
+ var select = document.createElement('select');
+ select.className = 'vis-configuration vis-config-select';
+ var selectedValue = 0;
+ if (value !== undefined) {
+ if (arr.indexOf(value) !== -1) {
+ selectedValue = arr.indexOf(value);
+ }
+ }
+
+ for (var i = 0; i < arr.length; i++) {
+ var option = document.createElement('option');
+ option.value = arr[i];
+ if (i === selectedValue) {
+ option.selected = 'selected';
+ }
+ option.innerHTML = arr[i];
+ select.appendChild(option);
+ }
+
+ var me = this;
+ select.onchange = function () {
+ me._update(this.value, path);
+ };
+
+ var label = this._makeLabel(path[path.length - 1], path);
+ this._makeItem(path, label, select);
+ }
+ }, {
+ key: '_makeRange',
+
+ /**
+ * make a range object for numeric options
+ * @param arr
+ * @param value
+ * @param path
+ * @private
+ */
+ value: function _makeRange(arr, value, path) {
+ var defaultValue = arr[0];
+ var min = arr[1];
+ var max = arr[2];
+ var step = arr[3];
+ var range = document.createElement('input');
+ range.className = 'vis-configuration vis-config-range';
+ try {
+ range.type = 'range'; // not supported on IE9
+ range.min = min;
+ range.max = max;
+ } catch (err) {}
+ range.step = step;
+
+ // set up the popup settings in case they are needed.
+ var popupString = '';
+ var popupValue = 0;
+
+ if (value !== undefined) {
+ var factor = 1.20;
+ if (value < 0 && value * factor < min) {
+ range.min = Math.ceil(value * factor);
+ popupValue = range.min;
+ popupString = 'range increased';
+ } else if (value / factor < min) {
+ range.min = Math.ceil(value / factor);
+ popupValue = range.min;
+ popupString = 'range increased';
+ }
+ if (value * factor > max && max !== 1) {
+ range.max = Math.ceil(value * factor);
+ popupValue = range.max;
+ popupString = 'range increased';
+ }
+ range.value = value;
+ } else {
+ range.value = defaultValue;
+ }
+
+ var input = document.createElement('input');
+ input.className = 'vis-configuration vis-config-rangeinput';
+ input.value = range.value;
+
+ var me = this;
+ range.onchange = function () {
+ input.value = this.value;me._update(Number(this.value), path);
+ };
+ range.oninput = function () {
+ input.value = this.value;
+ };
+
+ var label = this._makeLabel(path[path.length - 1], path);
+ var itemIndex = this._makeItem(path, label, range, input);
+
+ // if a popup is needed AND it has not been shown for this value, show it.
+ if (popupString !== '' && this.popupHistory[itemIndex] !== popupValue) {
+ this.popupHistory[itemIndex] = popupValue;
+ this._setupPopup(popupString, itemIndex);
+ }
+ }
+ }, {
+ key: '_setupPopup',
+
+ /**
+ * prepare the popup
+ * @param string
+ * @param index
+ * @private
+ */
+ value: function _setupPopup(string, index) {
+ var _this3 = this;
+
+ if (this.initialized === true && this.allowCreation === true && this.popupCounter < this.popupLimit) {
+ var div = document.createElement('div');
+ div.id = 'vis-configuration-popup';
+ div.className = 'vis-configuration-popup';
+ div.innerHTML = string;
+ div.onclick = function () {
+ _this3._removePopup();
+ };
+ this.popupCounter += 1;
+ this.popupDiv = { html: div, index: index };
+ }
+ }
+ }, {
+ key: '_removePopup',
+
+ /**
+ * remove the popup from the dom
+ * @private
+ */
+ value: function _removePopup() {
+ if (this.popupDiv.html !== undefined) {
+ this.popupDiv.html.parentNode.removeChild(this.popupDiv.html);
+ clearTimeout(this.popupDiv.hideTimeout);
+ clearTimeout(this.popupDiv.deleteTimeout);
+ this.popupDiv = {};
+ }
+ }
+ }, {
+ key: '_showPopupIfNeeded',
+
+ /**
+ * Show the popup if it is needed.
+ * @private
+ */
+ value: function _showPopupIfNeeded() {
+ var _this4 = this;
+
+ if (this.popupDiv.html !== undefined) {
+ var correspondingElement = this.domElements[this.popupDiv.index];
+ var rect = correspondingElement.getBoundingClientRect();
+ this.popupDiv.html.style.left = rect.left + 'px';
+ this.popupDiv.html.style.top = rect.top - 30 + 'px'; // 30 is the height;
+ document.body.appendChild(this.popupDiv.html);
+ this.popupDiv.hideTimeout = setTimeout(function () {
+ _this4.popupDiv.html.style.opacity = 0;
+ }, 1500);
+ this.popupDiv.deleteTimeout = setTimeout(function () {
+ _this4._removePopup();
+ }, 1800);
+ }
+ }
+ }, {
+ key: '_makeCheckbox',
+
+ /**
+ * make a checkbox for boolean options.
+ * @param defaultValue
+ * @param value
+ * @param path
+ * @private
+ */
+ value: function _makeCheckbox(defaultValue, value, path) {
+ var checkbox = document.createElement('input');
+ checkbox.type = 'checkbox';
+ checkbox.className = 'vis-configuration vis-config-checkbox';
+ checkbox.checked = defaultValue;
+ if (value !== undefined) {
+ checkbox.checked = value;
+ if (value !== defaultValue) {
+ if (typeof defaultValue === 'object') {
+ if (value !== defaultValue.enabled) {
+ this.changedOptions.push({ path: path, value: value });
+ }
+ } else {
+ this.changedOptions.push({ path: path, value: value });
+ }
+ }
+ }
+
+ var me = this;
+ checkbox.onchange = function () {
+ me._update(this.checked, path);
+ };
+
+ var label = this._makeLabel(path[path.length - 1], path);
+ this._makeItem(path, label, checkbox);
+ }
+ }, {
+ key: '_makeTextInput',
+
+ /**
+ * make a text input field for string options.
+ * @param defaultValue
+ * @param value
+ * @param path
+ * @private
+ */
+ value: function _makeTextInput(defaultValue, value, path) {
+ var checkbox = document.createElement('input');
+ checkbox.type = 'text';
+ checkbox.className = 'vis-configuration vis-config-text';
+ checkbox.value = value;
+ if (value !== defaultValue) {
+ this.changedOptions.push({ path: path, value: value });
+ }
+
+ var me = this;
+ checkbox.onchange = function () {
+ me._update(this.value, path);
+ };
+
+ var label = this._makeLabel(path[path.length - 1], path);
+ this._makeItem(path, label, checkbox);
+ }
+ }, {
+ key: '_makeColorField',
+
+ /**
+ * make a color field with a color picker for color fields
+ * @param arr
+ * @param value
+ * @param path
+ * @private
+ */
+ value: function _makeColorField(arr, value, path) {
+ var _this5 = this;
+
+ var defaultColor = arr[1];
+ var div = document.createElement('div');
+ value = value === undefined ? defaultColor : value;
+
+ if (value !== 'none') {
+ div.className = 'vis-configuration vis-config-colorBlock';
+ div.style.backgroundColor = value;
+ } else {
+ div.className = 'vis-configuration vis-config-colorBlock none';
+ }
+
+ value = value === undefined ? defaultColor : value;
+ div.onclick = function () {
+ _this5._showColorPicker(value, div, path);
+ };
+
+ var label = this._makeLabel(path[path.length - 1], path);
+ this._makeItem(path, label, div);
+ }
+ }, {
+ key: '_showColorPicker',
+
+ /**
+ * used by the color buttons to call the color picker.
+ * @param event
+ * @param value
+ * @param div
+ * @param path
+ * @private
+ */
+ value: function _showColorPicker(value, div, path) {
+ var _this6 = this;
+
+ var rect = div.getBoundingClientRect();
+ var bodyRect = document.body.getBoundingClientRect();
+ var pickerX = rect.left + rect.width + 5;
+ var pickerY = rect.top - bodyRect.top + rect.height + 2;
+ this.colorPicker.show(pickerX, pickerY);
+ this.colorPicker.setColor(value);
+ this.colorPicker.setCallback(function (color) {
+ var colorString = 'rgba(' + color.r + ',' + color.g + ',' + color.b + ',' + color.a + ')';
+ div.style.backgroundColor = colorString;
+ _this6._update(colorString, path);
+ });
+ }
+ }, {
+ key: '_handleObject',
+
+ /**
+ * parse an object and draw the correct items
+ * @param obj
+ * @param path
+ * @private
+ */
+ value: function _handleObject(obj) {
+ var path = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];
+ var checkOnly = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+
+ var show = false;
+ var filter = this.options.filter;
+ var visibleInSet = false;
+ for (var subObj in obj) {
+ if (obj.hasOwnProperty(subObj)) {
+ show = true;
+ var item = obj[subObj];
+ var newPath = util.copyAndExtendArray(path, subObj);
+ if (typeof filter === 'function') {
+ show = filter(subObj, path);
+
+ // if needed we must go deeper into the object.
+ if (show === false) {
+ if (!(item instanceof Array) && typeof item !== 'string' && typeof item !== 'boolean' && item instanceof Object) {
+ this.allowCreation = false;
+ show = this._handleObject(item, newPath, true);
+ this.allowCreation = checkOnly === false;
+ }
+ }
+ }
+
+ if (show !== false) {
+ visibleInSet = true;
+ var value = this._getValue(newPath);
+
+ if (item instanceof Array) {
+ this._handleArray(item, value, newPath);
+ } else if (typeof item === 'string') {
+ this._makeTextInput(item, value, newPath);
+ } else if (typeof item === 'boolean') {
+ this._makeCheckbox(item, value, newPath);
+ } else if (item instanceof Object) {
+ // collapse the physics options that are not enabled
+ var draw = true;
+ if (path.indexOf('physics') !== -1) {
+ if (this.moduleOptions.physics.solver !== subObj) {
+ draw = false;
+ }
+ }
+
+ if (draw === true) {
+ // initially collapse options with an disabled enabled option.
+ if (item.enabled !== undefined) {
+ var enabledPath = util.copyAndExtendArray(newPath, 'enabled');
+ var enabledValue = this._getValue(enabledPath);
+ if (enabledValue === true) {
+ var label = this._makeLabel(subObj, newPath, true);
+ this._makeItem(newPath, label);
+ visibleInSet = this._handleObject(item, newPath) || visibleInSet;
+ } else {
+ this._makeCheckbox(item, enabledValue, newPath);
+ }
+ } else {
+ var label = this._makeLabel(subObj, newPath, true);
+ this._makeItem(newPath, label);
+ visibleInSet = this._handleObject(item, newPath) || visibleInSet;
+ }
+ }
+ } else {
+ console.error('dont know how to handle', item, subObj, newPath);
+ }
+ }
+ }
+ }
+ return visibleInSet;
+ }
+ }, {
+ key: '_handleArray',
+
+ /**
+ * handle the array type of option
+ * @param optionName
+ * @param arr
+ * @param value
+ * @param path
+ * @private
+ */
+ value: function _handleArray(arr, value, path) {
+ if (typeof arr[0] === 'string' && arr[0] === 'color') {
+ this._makeColorField(arr, value, path);
+ if (arr[1] !== value) {
+ this.changedOptions.push({ path: path, value: value });
+ }
+ } else if (typeof arr[0] === 'string') {
+ this._makeDropdown(arr, value, path);
+ if (arr[0] !== value) {
+ this.changedOptions.push({ path: path, value: value });
+ }
+ } else if (typeof arr[0] === 'number') {
+ this._makeRange(arr, value, path);
+ if (arr[0] !== value) {
+ this.changedOptions.push({ path: path, value: Number(value) });
+ }
+ }
+ }
+ }, {
+ key: '_update',
+
+ /**
+ * called to update the network with the new settings.
+ * @param value
+ * @param path
+ * @private
+ */
+ value: function _update(value, path) {
+ var options = this._constructOptions(value, path);
+
+ if (this.parent.body && this.parent.body.emitter && this.parent.body.emitter.emit) {
+ this.parent.body.emitter.emit('configChange', options);
+ }
+ this.initialized = true;
+ this.parent.setOptions(options);
+ }
+ }, {
+ key: '_constructOptions',
+ value: function _constructOptions(value, path) {
+ var optionsObj = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
+
+ var pointer = optionsObj;
+
+ // when dropdown boxes can be string or boolean, we typecast it into correct types
+ value = value === 'true' ? true : value;
+ value = value === 'false' ? false : value;
+
+ for (var i = 0; i < path.length; i++) {
+ if (path[i] !== 'global') {
+ if (pointer[path[i]] === undefined) {
+ pointer[path[i]] = {};
+ }
+ if (i !== path.length - 1) {
+ pointer = pointer[path[i]];
+ } else {
+ pointer[path[i]] = value;
+ }
+ }
+ }
+ return optionsObj;
+ }
+ }, {
+ key: '_printOptions',
+ value: function _printOptions() {
+ var options = this.getOptions();
+ this.optionsContainer.innerHTML = 'var options = ' + JSON.stringify(options, null, 2) + ' ';
+ }
+ }, {
+ key: 'getOptions',
+ value: function getOptions() {
+ var options = {};
+ for (var i = 0; i < this.changedOptions.length; i++) {
+ this._constructOptions(this.changedOptions[i].value, this.changedOptions[i].path, options);
+ }
+ return options;
+ }
+ }]);
+
+ return Configurator;
+ })();
+
+ exports['default'] = Configurator;
+ module.exports = exports['default'];
+
+/***/ },
+/* 46 */
+/***/ 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 Hammer = __webpack_require__(20);
+ var hammerUtil = __webpack_require__(25);
+ var util = __webpack_require__(1);
+
+ var ColorPicker = (function () {
+ function ColorPicker() {
+ var pixelRatio = arguments.length <= 0 || arguments[0] === undefined ? 1 : arguments[0];
+
+ _classCallCheck(this, ColorPicker);
+
+ this.pixelRatio = pixelRatio;
+ this.generated = false;
+ this.centerCoordinates = { x: 289 / 2, y: 289 / 2 };
+ this.r = 289 * 0.49;
+ this.color = { r: 255, g: 255, b: 255, a: 1.0 };
+ this.hueCircle = undefined;
+ this.initialColor = { r: 255, g: 255, b: 255, a: 1.0 };
+ this.previousColor = undefined;
+ this.applied = false;
+
+ // bound by
+ this.updateCallback = function () {};
+
+ // create all DOM elements
+ this._create();
+ }
+
+ _createClass(ColorPicker, [{
+ key: 'insertTo',
+
+ /**
+ * this inserts the colorPicker into a div from the DOM
+ * @param container
+ */
+ value: function insertTo(container) {
+ if (this.hammer !== undefined) {
+ this.hammer.destroy();
+ this.hammer = undefined;
+ }
+ this.container = container;
+ this.container.appendChild(this.frame);
+ this._bindHammer();
+
+ this._setSize();
+ }
+ }, {
+ key: 'setCallback',
+
+ /**
+ * the callback is executed on apply and save. Bind it to the application
+ * @param callback
+ */
+ value: function setCallback(callback) {
+ if (typeof callback === 'function') {
+ this.updateCallback = callback;
+ } else {
+ throw new Error('Function attempted to set as colorPicker callback is not a function.');
+ }
+ }
+ }, {
+ key: '_isColorString',
+ value: function _isColorString(color) {
+ var htmlColors = { black: '#000000', navy: '#000080', darkblue: '#00008B', mediumblue: '#0000CD', blue: '#0000FF', darkgreen: '#006400', green: '#008000', teal: '#008080', darkcyan: '#008B8B', deepskyblue: '#00BFFF', darkturquoise: '#00CED1', mediumspringgreen: '#00FA9A', lime: '#00FF00', springgreen: '#00FF7F', aqua: '#00FFFF', cyan: '#00FFFF', midnightblue: '#191970', dodgerblue: '#1E90FF', lightseagreen: '#20B2AA', forestgreen: '#228B22', seagreen: '#2E8B57', darkslategray: '#2F4F4F', limegreen: '#32CD32', mediumseagreen: '#3CB371', turquoise: '#40E0D0', royalblue: '#4169E1', steelblue: '#4682B4', darkslateblue: '#483D8B', mediumturquoise: '#48D1CC', indigo: '#4B0082', darkolivegreen: '#556B2F', cadetblue: '#5F9EA0', cornflowerblue: '#6495ED', mediumaquamarine: '#66CDAA', dimgray: '#696969', slateblue: '#6A5ACD', olivedrab: '#6B8E23', slategray: '#708090', lightslategray: '#778899', mediumslateblue: '#7B68EE', lawngreen: '#7CFC00', chartreuse: '#7FFF00', aquamarine: '#7FFFD4', maroon: '#800000', purple: '#800080', olive: '#808000', gray: '#808080', skyblue: '#87CEEB', lightskyblue: '#87CEFA', blueviolet: '#8A2BE2', darkred: '#8B0000', darkmagenta: '#8B008B', saddlebrown: '#8B4513', darkseagreen: '#8FBC8F', lightgreen: '#90EE90', mediumpurple: '#9370D8', darkviolet: '#9400D3', palegreen: '#98FB98', darkorchid: '#9932CC', yellowgreen: '#9ACD32', sienna: '#A0522D', brown: '#A52A2A', darkgray: '#A9A9A9', lightblue: '#ADD8E6', greenyellow: '#ADFF2F', paleturquoise: '#AFEEEE', lightsteelblue: '#B0C4DE', powderblue: '#B0E0E6', firebrick: '#B22222', darkgoldenrod: '#B8860B', mediumorchid: '#BA55D3', rosybrown: '#BC8F8F', darkkhaki: '#BDB76B', silver: '#C0C0C0', mediumvioletred: '#C71585', indianred: '#CD5C5C', peru: '#CD853F', chocolate: '#D2691E', tan: '#D2B48C', lightgrey: '#D3D3D3', palevioletred: '#D87093', thistle: '#D8BFD8', orchid: '#DA70D6', goldenrod: '#DAA520', crimson: '#DC143C', gainsboro: '#DCDCDC', plum: '#DDA0DD', burlywood: '#DEB887', lightcyan: '#E0FFFF', lavender: '#E6E6FA', darksalmon: '#E9967A', violet: '#EE82EE', palegoldenrod: '#EEE8AA', lightcoral: '#F08080', khaki: '#F0E68C', aliceblue: '#F0F8FF', honeydew: '#F0FFF0', azure: '#F0FFFF', sandybrown: '#F4A460', wheat: '#F5DEB3', beige: '#F5F5DC', whitesmoke: '#F5F5F5', mintcream: '#F5FFFA', ghostwhite: '#F8F8FF', salmon: '#FA8072', antiquewhite: '#FAEBD7', linen: '#FAF0E6', lightgoldenrodyellow: '#FAFAD2', oldlace: '#FDF5E6', red: '#FF0000', fuchsia: '#FF00FF', magenta: '#FF00FF', deeppink: '#FF1493', orangered: '#FF4500', tomato: '#FF6347', hotpink: '#FF69B4', coral: '#FF7F50', darkorange: '#FF8C00', lightsalmon: '#FFA07A', orange: '#FFA500', lightpink: '#FFB6C1', pink: '#FFC0CB', gold: '#FFD700', peachpuff: '#FFDAB9', navajowhite: '#FFDEAD', moccasin: '#FFE4B5', bisque: '#FFE4C4', mistyrose: '#FFE4E1', blanchedalmond: '#FFEBCD', papayawhip: '#FFEFD5', lavenderblush: '#FFF0F5', seashell: '#FFF5EE', cornsilk: '#FFF8DC', lemonchiffon: '#FFFACD', floralwhite: '#FFFAF0', snow: '#FFFAFA', yellow: '#FFFF00', lightyellow: '#FFFFE0', ivory: '#FFFFF0', white: '#FFFFFF' };
+ if (typeof color === 'string') {
+ return htmlColors[color];
+ }
+ }
+ }, {
+ key: 'setColor',
+
+ /**
+ * Set the color of the colorPicker
+ * Supported formats:
+ * 'red' --> HTML color string
+ * '#ffffff' --> hex string
+ * 'rbg(255,255,255)' --> rgb string
+ * 'rgba(255,255,255,1.0)' --> rgba string
+ * {r:255,g:255,b:255} --> rgb object
+ * {r:255,g:255,b:255,a:1.0} --> rgba object
+ * @param color
+ * @param setInitial
+ */
+ value: function setColor(color) {
+ var setInitial = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ if (color === 'none') {
+ return;
+ }
+
+ var rgba = undefined;
+
+ // if a html color shorthand is used, convert to hex
+ var htmlColor = this._isColorString(color);
+ if (htmlColor !== undefined) {
+ color = htmlColor;
+ }
+
+ // check format
+ if (util.isString(color) === true) {
+ if (util.isValidRGB(color) === true) {
+ var rgbaArray = color.substr(4).substr(0, color.length - 5).split(',');
+ rgba = { r: rgbaArray[0], g: rgbaArray[1], b: rgbaArray[2], a: 1.0 };
+ } else if (util.isValidRGBA(color) === true) {
+ var rgbaArray = color.substr(5).substr(0, color.length - 6).split(',');
+ rgba = { r: rgbaArray[0], g: rgbaArray[1], b: rgbaArray[2], a: rgbaArray[3] };
+ } else if (util.isValidHex(color) === true) {
+ var rgbObj = util.hexToRGB(color);
+ rgba = { r: rgbObj.r, g: rgbObj.g, b: rgbObj.b, a: 1.0 };
+ }
+ } else {
+ if (color instanceof Object) {
+ if (color.r !== undefined && color.g !== undefined && color.b !== undefined) {
+ var alpha = color.a !== undefined ? color.a : '1.0';
+ rgba = { r: color.r, g: color.g, b: color.b, a: alpha };
+ }
+ }
+ }
+
+ // set color
+ if (rgba === undefined) {
+ throw new Error('Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: ' + JSON.stringify(color));
+ } else {
+ this._setColor(rgba, setInitial);
+ }
+ }
+ }, {
+ key: 'show',
+
+ /**
+ * this shows the color picker at a location. The hue circle is constructed once and stored.
+ * @param x
+ * @param y
+ */
+ value: function show(x, y) {
+ this.applied = false;
+ this.frame.style.display = 'block';
+ this.frame.style.top = y + 'px';
+ this.frame.style.left = x + 'px';
+ this._generateHueCircle();
+ }
+ }, {
+ key: '_hide',
+
+ // ------------------------------------------ PRIVATE ----------------------------- //
+
+ /**
+ * Hide the picker. Is called by the cancel button.
+ * Optional boolean to store the previous color for easy access later on.
+ * @param storePrevious
+ * @private
+ */
+ value: function _hide() {
+ var storePrevious = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];
+
+ // store the previous color for next time;
+ if (storePrevious === true) {
+ this.previousColor = util.extend({}, this.color);
+ }
+
+ if (this.applied === true) {
+ this.updateCallback(this.initialColor);
+ }
+
+ this.frame.style.display = 'none';
+ }
+ }, {
+ key: '_save',
+
+ /**
+ * bound to the save button. Saves and hides.
+ * @private
+ */
+ value: function _save() {
+ this.updateCallback(this.color);
+ this.applied = false;
+ this._hide();
+ }
+ }, {
+ key: '_apply',
+
+ /**
+ * Bound to apply button. Saves but does not close. Is undone by the cancel button.
+ * @private
+ */
+ value: function _apply() {
+ this.applied = true;
+ this.updateCallback(this.color);
+ this._updatePicker(this.color);
+ }
+ }, {
+ key: '_loadLast',
+
+ /**
+ * load the color from the previous session.
+ * @private
+ */
+ value: function _loadLast() {
+ if (this.previousColor !== undefined) {
+ this.setColor(this.previousColor, false);
+ } else {
+ alert('There is no last color to load...');
+ }
+ }
+ }, {
+ key: '_setColor',
+
+ /**
+ * set the color, place the picker
+ * @param rgba
+ * @param setInitial
+ * @private
+ */
+ value: function _setColor(rgba) {
+ var setInitial = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ // store the initial color
+ if (setInitial === true) {
+ this.initialColor = util.extend({}, rgba);
+ }
+
+ this.color = rgba;
+ var hsv = util.RGBToHSV(rgba.r, rgba.g, rgba.b);
+
+ var angleConvert = 2 * Math.PI;
+ var radius = this.r * hsv.s;
+ var x = this.centerCoordinates.x + radius * Math.sin(angleConvert * hsv.h);
+ var y = this.centerCoordinates.y + radius * Math.cos(angleConvert * hsv.h);
+
+ this.colorPickerSelector.style.left = x - 0.5 * this.colorPickerSelector.clientWidth + 'px';
+ this.colorPickerSelector.style.top = y - 0.5 * this.colorPickerSelector.clientHeight + 'px';
+
+ this._updatePicker(rgba);
+ }
+ }, {
+ key: '_setOpacity',
+
+ /**
+ * bound to opacity control
+ * @param value
+ * @private
+ */
+ value: function _setOpacity(value) {
+ this.color.a = value / 100;
+ this._updatePicker(this.color);
+ }
+ }, {
+ key: '_setBrightness',
+
+ /**
+ * bound to brightness control
+ * @param value
+ * @private
+ */
+ value: function _setBrightness(value) {
+ var hsv = util.RGBToHSV(this.color.r, this.color.g, this.color.b);
+ hsv.v = value / 100;
+ var rgba = util.HSVToRGB(hsv.h, hsv.s, hsv.v);
+ rgba['a'] = this.color.a;
+ this.color = rgba;
+ this._updatePicker();
+ }
+ }, {
+ key: '_updatePicker',
+
+ /**
+ * update the colorpicker. A black circle overlays the hue circle to mimic the brightness decreasing.
+ * @param rgba
+ * @private
+ */
+ value: function _updatePicker() {
+ var rgba = arguments.length <= 0 || arguments[0] === undefined ? this.color : arguments[0];
+
+ var hsv = util.RGBToHSV(rgba.r, rgba.g, rgba.b);
+ var ctx = this.colorPickerCanvas.getContext('2d');
+ if (this.pixelRation === undefined) {
+ this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
+ }
+ ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
+
+ // clear the canvas
+ var w = this.colorPickerCanvas.clientWidth;
+ var h = this.colorPickerCanvas.clientHeight;
+ ctx.clearRect(0, 0, w, h);
+
+ ctx.putImageData(this.hueCircle, 0, 0);
+ ctx.fillStyle = 'rgba(0,0,0,' + (1 - hsv.v) + ')';
+ ctx.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r);
+ ctx.fill();
+
+ this.brightnessRange.value = 100 * hsv.v;
+ this.opacityRange.value = 100 * rgba.a;
+
+ this.initialColorDiv.style.backgroundColor = 'rgba(' + this.initialColor.r + ',' + this.initialColor.g + ',' + this.initialColor.b + ',' + this.initialColor.a + ')';
+ this.newColorDiv.style.backgroundColor = 'rgba(' + this.color.r + ',' + this.color.g + ',' + this.color.b + ',' + this.color.a + ')';
+ }
+ }, {
+ key: '_setSize',
+
+ /**
+ * used by create to set the size of the canvas.
+ * @private
+ */
+ value: function _setSize() {
+ this.colorPickerCanvas.style.width = '100%';
+ this.colorPickerCanvas.style.height = '100%';
+
+ this.colorPickerCanvas.width = 289 * this.pixelRatio;
+ this.colorPickerCanvas.height = 289 * this.pixelRatio;
+ }
+ }, {
+ key: '_create',
+
+ /**
+ * create all dom elements
+ * TODO: cleanup, lots of similar dom elements
+ * @private
+ */
+ value: function _create() {
+ this.frame = document.createElement('div');
+ this.frame.className = 'vis-color-picker';
+
+ this.colorPickerDiv = document.createElement('div');
+ this.colorPickerSelector = document.createElement('div');
+ this.colorPickerSelector.className = 'vis-selector';
+ this.colorPickerDiv.appendChild(this.colorPickerSelector);
+
+ this.colorPickerCanvas = document.createElement('canvas');
+ this.colorPickerDiv.appendChild(this.colorPickerCanvas);
+
+ if (!this.colorPickerCanvas.getContext) {
+ var noCanvas = document.createElement('DIV');
+ noCanvas.style.color = 'red';
+ noCanvas.style.fontWeight = 'bold';
+ noCanvas.style.padding = '10px';
+ noCanvas.innerHTML = 'Error: your browser does not support HTML canvas';
+ this.colorPickerCanvas.appendChild(noCanvas);
+ } else {
+ var ctx = this.colorPickerCanvas.getContext('2d');
+ this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
+
+ this.colorPickerCanvas.getContext('2d').setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
+ }
+
+ this.colorPickerDiv.className = 'vis-color';
+
+ this.opacityDiv = document.createElement('div');
+ this.opacityDiv.className = 'vis-opacity';
+
+ this.brightnessDiv = document.createElement('div');
+ this.brightnessDiv.className = 'vis-brightness';
+
+ this.arrowDiv = document.createElement('div');
+ this.arrowDiv.className = 'vis-arrow';
+
+ this.opacityRange = document.createElement('input');
+ try {
+ this.opacityRange.type = 'range'; // Not supported on IE9
+ this.opacityRange.min = '0';
+ this.opacityRange.max = '100';
+ } catch (err) {}
+ this.opacityRange.value = '100';
+ this.opacityRange.className = 'vis-range';
+
+ this.brightnessRange = document.createElement('input');
+ try {
+ this.brightnessRange.type = 'range'; // Not supported on IE9
+ this.brightnessRange.min = '0';
+ this.brightnessRange.max = '100';
+ } catch (err) {}
+ this.brightnessRange.value = '100';
+ this.brightnessRange.className = 'vis-range';
+
+ this.opacityDiv.appendChild(this.opacityRange);
+ this.brightnessDiv.appendChild(this.brightnessRange);
+
+ var me = this;
+ this.opacityRange.onchange = function () {
+ me._setOpacity(this.value);
+ };
+ this.opacityRange.oninput = function () {
+ me._setOpacity(this.value);
+ };
+ this.brightnessRange.onchange = function () {
+ me._setBrightness(this.value);
+ };
+ this.brightnessRange.oninput = function () {
+ me._setBrightness(this.value);
+ };
+
+ this.brightnessLabel = document.createElement('div');
+ this.brightnessLabel.className = 'vis-label vis-brightness';
+ this.brightnessLabel.innerHTML = 'brightness:';
+
+ this.opacityLabel = document.createElement('div');
+ this.opacityLabel.className = 'vis-label vis-opacity';
+ this.opacityLabel.innerHTML = 'opacity:';
+
+ this.newColorDiv = document.createElement('div');
+ this.newColorDiv.className = 'vis-new-color';
+ this.newColorDiv.innerHTML = 'new';
+
+ this.initialColorDiv = document.createElement('div');
+ this.initialColorDiv.className = 'vis-initial-color';
+ this.initialColorDiv.innerHTML = 'initial';
+
+ this.cancelButton = document.createElement('div');
+ this.cancelButton.className = 'vis-button vis-cancel';
+ this.cancelButton.innerHTML = 'cancel';
+ this.cancelButton.onclick = this._hide.bind(this, false);
+
+ this.applyButton = document.createElement('div');
+ this.applyButton.className = 'vis-button vis-apply';
+ this.applyButton.innerHTML = 'apply';
+ this.applyButton.onclick = this._apply.bind(this);
+
+ this.saveButton = document.createElement('div');
+ this.saveButton.className = 'vis-button vis-save';
+ this.saveButton.innerHTML = 'save';
+ this.saveButton.onclick = this._save.bind(this);
+
+ this.loadButton = document.createElement('div');
+ this.loadButton.className = 'vis-button vis-load';
+ this.loadButton.innerHTML = 'load last';
+ this.loadButton.onclick = this._loadLast.bind(this);
+
+ this.frame.appendChild(this.colorPickerDiv);
+ this.frame.appendChild(this.arrowDiv);
+ this.frame.appendChild(this.brightnessLabel);
+ this.frame.appendChild(this.brightnessDiv);
+ this.frame.appendChild(this.opacityLabel);
+ this.frame.appendChild(this.opacityDiv);
+ this.frame.appendChild(this.newColorDiv);
+ this.frame.appendChild(this.initialColorDiv);
+
+ this.frame.appendChild(this.cancelButton);
+ this.frame.appendChild(this.applyButton);
+ this.frame.appendChild(this.saveButton);
+ this.frame.appendChild(this.loadButton);
+ }
+ }, {
+ key: '_bindHammer',
+
+ /**
+ * bind hammer to the color picker
+ * @private
+ */
+ value: function _bindHammer() {
+ var _this = this;
+
+ this.drag = {};
+ this.pinch = {};
+ this.hammer = new Hammer(this.colorPickerCanvas);
+ this.hammer.get('pinch').set({ enable: true });
+
+ hammerUtil.onTouch(this.hammer, function (event) {
+ _this._moveSelector(event);
+ });
+ this.hammer.on('tap', function (event) {
+ _this._moveSelector(event);
+ });
+ this.hammer.on('panstart', function (event) {
+ _this._moveSelector(event);
+ });
+ this.hammer.on('panmove', function (event) {
+ _this._moveSelector(event);
+ });
+ this.hammer.on('panend', function (event) {
+ _this._moveSelector(event);
+ });
+ }
+ }, {
+ key: '_generateHueCircle',
+
+ /**
+ * generate the hue circle. This is relatively heavy (200ms) and is done only once on the first time it is shown.
+ * @private
+ */
+ value: function _generateHueCircle() {
+ if (this.generated === false) {
+ var ctx = this.colorPickerCanvas.getContext('2d');
+ if (this.pixelRation === undefined) {
+ this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
+ }
+ ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
+
+ // clear the canvas
+ var w = this.colorPickerCanvas.clientWidth;
+ var h = this.colorPickerCanvas.clientHeight;
+ ctx.clearRect(0, 0, w, h);
+
+ // draw hue circle
+ var x = undefined,
+ y = undefined,
+ hue = undefined,
+ sat = undefined;
+ this.centerCoordinates = { x: w * 0.5, y: h * 0.5 };
+ this.r = 0.49 * w;
+ var angleConvert = 2 * Math.PI / 360;
+ var hfac = 1 / 360;
+ var sfac = 1 / this.r;
+ var rgb = undefined;
+ for (hue = 0; hue < 360; hue++) {
+ for (sat = 0; sat < this.r; sat++) {
+ x = this.centerCoordinates.x + sat * Math.sin(angleConvert * hue);
+ y = this.centerCoordinates.y + sat * Math.cos(angleConvert * hue);
+ rgb = util.HSVToRGB(hue * hfac, sat * sfac, 1);
+ ctx.fillStyle = 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')';
+ ctx.fillRect(x - 0.5, y - 0.5, 2, 2);
+ }
+ }
+ ctx.strokeStyle = 'rgba(0,0,0,1)';
+ ctx.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r);
+ ctx.stroke();
+
+ this.hueCircle = ctx.getImageData(0, 0, w, h);
+ }
+ this.generated = true;
+ }
+ }, {
+ key: '_moveSelector',
+
+ /**
+ * move the selector. This is called by hammer functions.
+ *
+ * @param event
+ * @private
+ */
+ value: function _moveSelector(event) {
+ var rect = this.colorPickerDiv.getBoundingClientRect();
+ var left = event.center.x - rect.left;
+ var top = event.center.y - rect.top;
+
+ var centerY = 0.5 * this.colorPickerDiv.clientHeight;
+ var centerX = 0.5 * this.colorPickerDiv.clientWidth;
+
+ var x = left - centerX;
+ var y = top - centerY;
+
+ var angle = Math.atan2(x, y);
+ var radius = 0.98 * Math.min(Math.sqrt(x * x + y * y), centerX);
+
+ var newTop = Math.cos(angle) * radius + centerY;
+ var newLeft = Math.sin(angle) * radius + centerX;
+
+ this.colorPickerSelector.style.top = newTop - 0.5 * this.colorPickerSelector.clientHeight + 'px';
+ this.colorPickerSelector.style.left = newLeft - 0.5 * this.colorPickerSelector.clientWidth + 'px';
+
+ // set color
+ var h = angle / (2 * Math.PI);
+ h = h < 0 ? h + 1 : h;
+ var s = radius / this.r;
+ var hsv = util.RGBToHSV(this.color.r, this.color.g, this.color.b);
+ hsv.h = h;
+ hsv.s = s;
+ var rgba = util.HSVToRGB(hsv.h, hsv.s, hsv.v);
+ rgba['a'] = this.color.a;
+ this.color = rgba;
+
+ // update previews
+ this.initialColorDiv.style.backgroundColor = 'rgba(' + this.initialColor.r + ',' + this.initialColor.g + ',' + this.initialColor.b + ',' + this.initialColor.a + ')';
+ this.newColorDiv.style.backgroundColor = 'rgba(' + this.color.r + ',' + this.color.g + ',' + this.color.b + ',' + this.color.a + ')';
+ }
+ }]);
+
+ return ColorPicker;
+ })();
+
+ exports['default'] = ColorPicker;
+ module.exports = exports['default'];
+
+/***/ },
+/* 47 */
+/***/ 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 util = __webpack_require__(1);
+
+ var errorFound = false;
+ var allOptions = undefined;
+ var printStyle = 'background: #FFeeee; color: #dd0000';
+ /**
+ * Used to validate options.
+ */
+
+ var Validator = (function () {
+ function Validator() {
+ _classCallCheck(this, Validator);
+ }
+
+ _createClass(Validator, null, [{
+ key: 'validate',
+
+ /**
+ * Main function to be called
+ * @param options
+ * @param subObject
+ * @returns {boolean}
+ */
+ value: function validate(options, referenceOptions, subObject) {
+ errorFound = false;
+ allOptions = referenceOptions;
+ var usedOptions = referenceOptions;
+ if (subObject !== undefined) {
+ usedOptions = referenceOptions[subObject];
+ }
+ Validator.parse(options, usedOptions, []);
+ return errorFound;
+ }
+ }, {
+ key: 'parse',
+
+ /**
+ * Will traverse an object recursively and check every value
+ * @param options
+ * @param referenceOptions
+ * @param path
+ */
+ value: function parse(options, referenceOptions, path) {
+ for (var option in options) {
+ if (options.hasOwnProperty(option)) {
+ Validator.check(option, options, referenceOptions, path);
+ }
+ }
+ }
+ }, {
+ key: 'check',
+
+ /**
+ * Check every value. If the value is an object, call the parse function on that object.
+ * @param option
+ * @param options
+ * @param referenceOptions
+ * @param path
+ */
+ value: function check(option, options, referenceOptions, path) {
+ if (referenceOptions[option] === undefined && referenceOptions.__any__ === undefined) {
+ Validator.getSuggestion(option, referenceOptions, path);
+ } else if (referenceOptions[option] === undefined && referenceOptions.__any__ !== undefined) {
+ // __any__ is a wildcard. Any value is accepted and will be further analysed by reference.
+ if (Validator.getType(options[option]) === 'object' && referenceOptions['__any__'].__type__ !== undefined) {
+ // if the any subgroup is not a predefined object int he configurator we do not look deeper into the object.
+ Validator.checkFields(option, options, referenceOptions, '__any__', referenceOptions['__any__'].__type__, path);
+ } else {
+ Validator.checkFields(option, options, referenceOptions, '__any__', referenceOptions['__any__'], path);
+ }
+ } else {
+ // Since all options in the reference are objects, we can check whether they are supposed to be object to look for the __type__ field.
+ if (referenceOptions[option].__type__ !== undefined) {
+ // if this should be an object, we check if the correct type has been supplied to account for shorthand options.
+ Validator.checkFields(option, options, referenceOptions, option, referenceOptions[option].__type__, path);
+ } else {
+ Validator.checkFields(option, options, referenceOptions, option, referenceOptions[option], path);
+ }
+ }
+ }
+ }, {
+ key: 'checkFields',
+
+ /**
+ *
+ * @param {String} option | the option property
+ * @param {Object} options | The supplied options object
+ * @param {Object} referenceOptions | The reference options containing all options and their allowed formats
+ * @param {String} referenceOption | Usually this is the same as option, except when handling an __any__ tag.
+ * @param {String} refOptionType | This is the type object from the reference options
+ * @param {Array} path | where in the object is the option
+ */
+ value: function checkFields(option, options, referenceOptions, referenceOption, refOptionObj, path) {
+ var optionType = Validator.getType(options[option]);
+ var refOptionType = refOptionObj[optionType];
+ if (refOptionType !== undefined) {
+ // if the type is correct, we check if it is supposed to be one of a few select values
+ if (Validator.getType(refOptionType) === 'array') {
+ if (refOptionType.indexOf(options[option]) === -1) {
+ console.log('%cInvalid option detected in "' + option + '".' + ' Allowed values are:' + Validator.print(refOptionType) + ' not "' + options[option] + '". ' + Validator.printLocation(path, option), printStyle);
+ errorFound = true;
+ } else if (optionType === 'object' && referenceOption !== '__any__') {
+ path = util.copyAndExtendArray(path, option);
+ Validator.parse(options[option], referenceOptions[referenceOption], path);
+ }
+ } else if (optionType === 'object' && referenceOption !== '__any__') {
+ path = util.copyAndExtendArray(path, option);
+ Validator.parse(options[option], referenceOptions[referenceOption], path);
+ }
+ } else if (refOptionObj['any'] === undefined) {
+ // type of the field is incorrect and the field cannot be any
+ console.log('%cInvalid type received for "' + option + '". Expected: ' + Validator.print(Object.keys(refOptionObj)) + '. Received [' + optionType + '] "' + options[option] + '"' + Validator.printLocation(path, option), printStyle);
+ errorFound = true;
+ }
+ }
+ }, {
+ key: 'getType',
+ value: function getType(object) {
+ var type = typeof object;
+
+ if (type === 'object') {
+ if (object === null) {
+ return 'null';
+ }
+ if (object instanceof Boolean) {
+ return 'boolean';
+ }
+ if (object instanceof Number) {
+ return 'number';
+ }
+ if (object instanceof String) {
+ return 'string';
+ }
+ if (Array.isArray(object)) {
+ return 'array';
+ }
+ if (object instanceof Date) {
+ return 'date';
+ }
+ if (object.nodeType !== undefined) {
+ return 'dom';
+ }
+ if (object._isAMomentObject === true) {
+ return 'moment';
+ }
+ return 'object';
+ } else if (type === 'number') {
+ return 'number';
+ } else if (type === 'boolean') {
+ return 'boolean';
+ } else if (type === 'string') {
+ return 'string';
+ } else if (type === undefined) {
+ return 'undefined';
+ }
+ return type;
+ }
+ }, {
+ key: 'getSuggestion',
+ value: function getSuggestion(option, options, path) {
+ var localSearch = Validator.findInOptions(option, options, path, false);
+ var globalSearch = Validator.findInOptions(option, allOptions, [], true);
+
+ var localSearchThreshold = 8;
+ var globalSearchThreshold = 4;
+
+ if (localSearch.indexMatch !== undefined) {
+ console.log('%cUnknown option detected: "' + option + '" in ' + Validator.printLocation(localSearch.path, option, '') + 'Perhaps it was incomplete? Did you mean: "' + localSearch.indexMatch + '"?\n\n', printStyle);
+ } else if (globalSearch.distance <= globalSearchThreshold && localSearch.distance > globalSearch.distance) {
+ console.log('%cUnknown option detected: "' + option + '" in ' + Validator.printLocation(localSearch.path, option, '') + 'Perhaps it was misplaced? Matching option found at: ' + Validator.printLocation(globalSearch.path, globalSearch.closestMatch, ''), printStyle);
+ } else if (localSearch.distance <= localSearchThreshold) {
+ console.log('%cUnknown option detected: "' + option + '". Did you mean "' + localSearch.closestMatch + '"?' + Validator.printLocation(localSearch.path, option), printStyle);
+ } else {
+ console.log('%cUnknown option detected: "' + option + '". Did you mean one of these: ' + Validator.print(Object.keys(options)) + Validator.printLocation(path, option), printStyle);
+ }
+
+ errorFound = true;
+ }
+ }, {
+ key: 'findInOptions',
+
+ /**
+ * traverse the options in search for a match.
+ * @param option
+ * @param options
+ * @param path
+ * @param recursive
+ * @returns {{closestMatch: string, path: Array, distance: number}}
+ */
+ value: function findInOptions(option, options, path) {
+ var recursive = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
+
+ var min = 1e9;
+ var closestMatch = '';
+ var closestMatchPath = [];
+ var lowerCaseOption = option.toLowerCase();
+ var indexMatch = undefined;
+ for (var op in options) {
+ var distance = undefined;
+ if (options[op].__type__ !== undefined && recursive === true) {
+ var result = Validator.findInOptions(option, options[op], util.copyAndExtendArray(path, op));
+ if (min > result.distance) {
+ closestMatch = result.closestMatch;
+ closestMatchPath = result.path;
+ min = result.distance;
+ indexMatch = result.indexMatch;
+ }
+ } else {
+ if (op.toLowerCase().indexOf(lowerCaseOption) !== -1) {
+ indexMatch = op;
+ }
+ distance = Validator.levenshteinDistance(option, op);
+ if (min > distance) {
+ closestMatch = op;
+ closestMatchPath = util.copyArray(path);
+ min = distance;
+ }
+ }
+ }
+ return { closestMatch: closestMatch, path: closestMatchPath, distance: min, indexMatch: indexMatch };
+ }
+ }, {
+ key: 'printLocation',
+ value: function printLocation(path, option) {
+ var prefix = arguments.length <= 2 || arguments[2] === undefined ? 'Problem value found at: \n' : arguments[2];
+
+ var str = '\n\n' + prefix + 'options = {\n';
+ for (var i = 0; i < path.length; i++) {
+ for (var j = 0; j < i + 1; j++) {
+ str += ' ';
+ }
+ str += path[i] + ': {\n';
+ }
+ for (var j = 0; j < path.length + 1; j++) {
+ str += ' ';
+ }
+ str += option + '\n';
+ for (var i = 0; i < path.length + 1; i++) {
+ for (var j = 0; j < path.length - i; j++) {
+ str += ' ';
+ }
+ str += '}\n';
+ }
+ return str + '\n\n';
+ }
+ }, {
+ key: 'print',
+ value: function print(options) {
+ return JSON.stringify(options).replace(/(\")|(\[)|(\])|(,"__type__")/g, '').replace(/(\,)/g, ', ');
+ }
+ }, {
+ key: 'levenshteinDistance',
+
+ // Compute the edit distance between the two given strings
+ // http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#JavaScript
+ /*
+ Copyright (c) 2011 Andrei Mackenzie
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+ value: function levenshteinDistance(a, b) {
+ if (a.length === 0) return b.length;
+ if (b.length === 0) return a.length;
+
+ var matrix = [];
+
+ // increment along the first column of each row
+ var i;
+ for (i = 0; i <= b.length; i++) {
+ matrix[i] = [i];
+ }
+
+ // increment each column in the first row
+ var j;
+ for (j = 0; j <= a.length; j++) {
+ matrix[0][j] = j;
+ }
+
+ // Fill in the rest of the matrix
+ for (i = 1; i <= b.length; i++) {
+ for (j = 1; j <= a.length; j++) {
+ if (b.charAt(i - 1) == a.charAt(j - 1)) {
+ matrix[i][j] = matrix[i - 1][j - 1];
+ } else {
+ matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
+ Math.min(matrix[i][j - 1] + 1, // insertion
+ matrix[i - 1][j] + 1)); // deletion
+ }
+ }
+ }
+
+ return matrix[b.length][a.length];
+ }
+ }]);
+
+ return Validator;
+ })();
+
+ exports['default'] = Validator;
+ exports.printStyle = printStyle;
+
+/***/ },
+/* 48 */
+/***/ function(module, exports) {
+
+ /**
+ * This object contains all possible options. It will check if the types are correct, if required if the option is one
+ * of the allowed values.
+ *
+ * __any__ means that the name of the property does not matter.
+ * __type__ is a required field for all objects and contains the allowed types of all objects
+ */
+ 'use strict';
+
+ Object.defineProperty(exports, '__esModule', {
+ value: true
+ });
+ var string = 'string';
+ var boolean = 'boolean';
+ var number = 'number';
+ var array = 'array';
+ var date = 'date';
+ var object = 'object'; // should only be in a __type__ property
+ var dom = 'dom';
+ var moment = 'moment';
+ var any = 'any';
+
+ var allOptions = {
+ configure: {
+ enabled: { boolean: boolean },
+ filter: { boolean: boolean, 'function': 'function' },
+ container: { dom: dom },
+ __type__: { object: object, boolean: boolean, 'function': 'function' }
+ },
+
+ //globals :
+ align: { string: string },
+ autoResize: { boolean: boolean },
+ throttleRedraw: { number: number },
+ clickToUse: { boolean: boolean },
+ dataAttributes: { string: string, array: array },
+ editable: {
+ add: { boolean: boolean, 'undefined': 'undefined' },
+ remove: { boolean: boolean, 'undefined': 'undefined' },
+ updateGroup: { boolean: boolean, 'undefined': 'undefined' },
+ updateTime: { boolean: boolean, 'undefined': 'undefined' },
+ __type__: { boolean: boolean, object: object }
+ },
+ end: { number: number, date: date, string: string, moment: moment },
+ format: {
+ minorLabels: {
+ millisecond: { string: string, 'undefined': 'undefined' },
+ second: { string: string, 'undefined': 'undefined' },
+ minute: { string: string, 'undefined': 'undefined' },
+ hour: { string: string, 'undefined': 'undefined' },
+ weekday: { string: string, 'undefined': 'undefined' },
+ day: { string: string, 'undefined': 'undefined' },
+ month: { string: string, 'undefined': 'undefined' },
+ year: { string: string, 'undefined': 'undefined' },
+ __type__: { object: object }
+ },
+ majorLabels: {
+ millisecond: { string: string, 'undefined': 'undefined' },
+ second: { string: string, 'undefined': 'undefined' },
+ minute: { string: string, 'undefined': 'undefined' },
+ hour: { string: string, 'undefined': 'undefined' },
+ weekday: { string: string, 'undefined': 'undefined' },
+ day: { string: string, 'undefined': 'undefined' },
+ month: { string: string, 'undefined': 'undefined' },
+ year: { string: string, 'undefined': 'undefined' },
+ __type__: { object: object }
+ },
+ __type__: { object: object }
+ },
+ moment: { 'function': 'function' },
+ groupOrder: { string: string, 'function': 'function' },
+ groupEditable: {
+ add: { boolean: boolean, 'undefined': 'undefined' },
+ remove: { boolean: boolean, 'undefined': 'undefined' },
+ order: { boolean: boolean, 'undefined': 'undefined' },
+ __type__: { boolean: boolean, object: object }
+ },
+ groupOrderSwap: { 'function': 'function' },
+ height: { string: string, number: number },
+ hiddenDates: {
+ start: { date: date, number: number, string: string, moment: moment },
+ end: { date: date, number: number, string: string, moment: moment },
+ repeat: { string: string },
+ __type__: { object: object, array: array }
+ },
+ locale: { string: string },
+ locales: {
+ __type__: { object: object }
+ },
+ margin: {
+ axis: { number: number },
+ item: {
+ horizontal: { number: number, 'undefined': 'undefined' },
+ vertical: { number: number, 'undefined': 'undefined' },
+ __type__: { object: object, number: number }
+ },
+ __type__: { object: object, number: number }
+ },
+ max: { date: date, number: number, string: string, moment: moment },
+ maxHeight: { number: number, string: string },
+ min: { date: date, number: number, string: string, moment: moment },
+ minHeight: { number: number, string: string },
+ moveable: { boolean: boolean },
+ multiselect: { boolean: boolean },
+ onAdd: { 'function': 'function' },
+ onUpdate: { 'function': 'function' },
+ onMove: { 'function': 'function' },
+ onMoving: { 'function': 'function' },
+ onRemove: { 'function': 'function' },
+ onAddGroup: { 'function': 'function' },
+ onMoveGroup: { 'function': 'function' },
+ onRemoveGroup: { 'function': 'function' },
+ order: { 'function': 'function' },
+ orientation: {
+ axis: { string: string, 'undefined': 'undefined' },
+ item: { string: string, 'undefined': 'undefined' },
+ __type__: { string: string, object: object }
+ },
+ selectable: { boolean: boolean },
+ showCurrentTime: { boolean: boolean },
+ showMajorLabels: { boolean: boolean },
+ showMinorLabels: { boolean: boolean },
+ stack: { boolean: boolean },
+ snap: { 'function': 'function', 'null': 'null' },
+ start: { date: date, number: number, string: string, moment: moment },
+ template: { 'function': 'function' },
+ groupTemplate: { 'function': 'function' },
+ timeAxis: {
+ scale: { string: string, 'undefined': 'undefined' },
+ step: { number: number, 'undefined': 'undefined' },
+ __type__: { object: object }
+ },
+ type: { string: string },
+ width: { string: string, number: number },
+ zoomable: { boolean: boolean },
+ zoomKey: { string: ['ctrlKey', 'altKey', 'metaKey', ''] },
+ zoomMax: { number: number },
+ zoomMin: { number: number },
+
+ __type__: { object: object }
+ };
+
+ var configureOptions = {
+ global: {
+ align: ['center', 'left', 'right'],
+ autoResize: true,
+ throttleRedraw: [10, 0, 1000, 10],
+ clickToUse: false,
+ // dataAttributes: ['all'], // FIXME: can be 'all' or string[]
+ editable: {
+ add: false,
+ remove: false,
+ updateGroup: false,
+ updateTime: false
+ },
+ end: '',
+ format: {
+ minorLabels: {
+ millisecond: 'SSS',
+ second: 's',
+ minute: 'HH:mm',
+ hour: 'HH:mm',
+ weekday: 'ddd D',
+ day: 'D',
+ month: 'MMM',
+ year: 'YYYY'
+ },
+ majorLabels: {
+ millisecond: 'HH:mm:ss',
+ second: 'D MMMM HH:mm',
+ minute: 'ddd D MMMM',
+ hour: 'ddd D MMMM',
+ weekday: 'MMMM YYYY',
+ day: 'MMMM YYYY',
+ month: 'YYYY',
+ year: ''
+ }
+ },
+
+ //groupOrder: {string, 'function': 'function'},
+ groupsDraggable: false,
+ height: '',
+ //hiddenDates: {object, array},
+ locale: '',
+ margin: {
+ axis: [20, 0, 100, 1],
+ item: {
+ horizontal: [10, 0, 100, 1],
+ vertical: [10, 0, 100, 1]
+ }
+ },
+ max: '',
+ maxHeight: '',
+ min: '',
+ minHeight: '',
+ moveable: false,
+ multiselect: false,
+ //onAdd: {'function': 'function'},
+ //onUpdate: {'function': 'function'},
+ //onMove: {'function': 'function'},
+ //onMoving: {'function': 'function'},
+ //onRename: {'function': 'function'},
+ //order: {'function': 'function'},
+ orientation: {
+ axis: ['both', 'bottom', 'top'],
+ item: ['bottom', 'top']
+ },
+ selectable: true,
+ showCurrentTime: false,
+ showMajorLabels: true,
+ showMinorLabels: true,
+ stack: true,
+ //snap: {'function': 'function', nada},
+ start: '',
+ //template: {'function': 'function'},
+ //timeAxis: {
+ // scale: ['millisecond', 'second', 'minute', 'hour', 'weekday', 'day', 'month', 'year'],
+ // step: [1, 1, 10, 1]
+ //},
+ type: ['box', 'point', 'range', 'background'],
+ width: '100%',
+ zoomable: true,
+ zoomKey: ['ctrlKey', 'altKey', 'metaKey', ''],
+ zoomMax: [315360000000000, 10, 315360000000000, 1],
+ zoomMin: [10, 10, 315360000000000, 1]
+ }
+ };
+
+ exports.allOptions = allOptions;
+ exports.configureOptions = configureOptions;
+
+/***/ },
+/* 49 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var Emitter = __webpack_require__(12);
+ var Hammer = __webpack_require__(20);
+ var moment = __webpack_require__(2);
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(8);
+ var DataView = __webpack_require__(10);
+ var Range = __webpack_require__(24);
+ var Core = __webpack_require__(28);
+ var TimeAxis = __webpack_require__(39);
+ var CurrentTime = __webpack_require__(44);
+ var CustomTime = __webpack_require__(42);
+ var LineGraph = __webpack_require__(50);
+
+ var Configurator = __webpack_require__(45);
+ var Validator = __webpack_require__(47)['default'];
+ var printStyle = __webpack_require__(47).printStyle;
+ var allOptions = __webpack_require__(58).allOptions;
+ var configureOptions = __webpack_require__(58).configureOptions;
+
+ /**
+ * Create a timeline visualization
+ * @param {HTMLElement} container
+ * @param {vis.DataSet | Array} [items]
+ * @param {Object} [options] See Graph2d.setOptions for the available options.
+ * @constructor
+ * @extends Core
+ */
+ function Graph2d(container, items, groups, options) {
+ // if the third element is options, the forth is groups (optionally);
+ if (!(Array.isArray(groups) || groups instanceof DataSet) && groups instanceof Object) {
+ var forthArgument = options;
+ options = groups;
+ groups = forthArgument;
+ }
+
+ var me = this;
+ this.defaultOptions = {
+ start: null,
+ end: null,
+
+ autoResize: true,
+
+ orientation: {
+ axis: 'bottom', // axis orientation: 'bottom', 'top', or 'both'
+ item: 'bottom' // not relevant for Graph2d
+ },
+
+ moment: moment,
+
+ width: null,
+ height: null,
+ maxHeight: null,
+ minHeight: null
+ };
+ this.options = util.deepExtend({}, this.defaultOptions);
+
+ // Create the DOM, props, and emitter
+ this._create(container);
+
+ // all components listed here will be repainted automatically
+ this.components = [];
+
+ this.body = {
+ dom: this.dom,
+ domProps: this.props,
+ emitter: {
+ on: this.on.bind(this),
+ off: this.off.bind(this),
+ emit: this.emit.bind(this)
+ },
+ hiddenDates: [],
+ util: {
+ toScreen: me._toScreen.bind(me),
+ toGlobalScreen: me._toGlobalScreen.bind(me), // this refers to the root.width
+ toTime: me._toTime.bind(me),
+ toGlobalTime: me._toGlobalTime.bind(me)
+ }
+ };
+
+ // range
+ this.range = new Range(this.body);
+ this.components.push(this.range);
+ this.body.range = this.range;
+
+ // time axis
+ this.timeAxis = new TimeAxis(this.body);
+ this.components.push(this.timeAxis);
+ //this.body.util.snap = this.timeAxis.snap.bind(this.timeAxis);
+
+ // current time bar
+ this.currentTime = new CurrentTime(this.body);
+ this.components.push(this.currentTime);
+
+ // item set
+ this.linegraph = new LineGraph(this.body);
+ this.components.push(this.linegraph);
+
+ this.itemsData = null; // DataSet
+ this.groupsData = null; // DataSet
+
+ this.on('tap', function (event) {
+ me.emit('click', me.getEventProperties(event));
+ });
+ this.on('doubletap', function (event) {
+ me.emit('doubleClick', me.getEventProperties(event));
+ });
+ this.dom.root.oncontextmenu = function (event) {
+ me.emit('contextmenu', me.getEventProperties(event));
+ };
+
+ // apply options
+ if (options) {
+ this.setOptions(options);
+ }
+
+ // IMPORTANT: THIS HAPPENS BEFORE SET ITEMS!
+ if (groups) {
+ this.setGroups(groups);
+ }
+
+ // create itemset
+ if (items) {
+ this.setItems(items);
+ } else {
+ this._redraw();
+ }
+ }
+
+ // Extend the functionality from Core
+ Graph2d.prototype = new Core();
+
+ Graph2d.prototype.setOptions = function (options) {
+ // validate options
+ var errorFound = Validator.validate(options, allOptions);
+ if (errorFound === true) {
+ console.log('%cErrors have been found in the supplied options object.', printStyle);
+ }
+
+ Core.prototype.setOptions.call(this, options);
+ };
+
+ /**
+ * Set items
+ * @param {vis.DataSet | Array | null} items
+ */
+ Graph2d.prototype.setItems = function (items) {
+ var initialLoad = this.itemsData == null;
+
+ // convert to type DataSet when needed
+ var newDataSet;
+ if (!items) {
+ newDataSet = null;
+ } else if (items instanceof DataSet || items instanceof DataView) {
+ newDataSet = items;
+ } else {
+ // turn an array into a dataset
+ newDataSet = new DataSet(items, {
+ type: {
+ start: 'Date',
+ end: 'Date'
+ }
+ });
+ }
+
+ // set items
+ this.itemsData = newDataSet;
+ this.linegraph && this.linegraph.setItems(newDataSet);
+
+ if (initialLoad) {
+ if (this.options.start != undefined || this.options.end != undefined) {
+ var start = this.options.start != undefined ? this.options.start : null;
+ var end = this.options.end != undefined ? this.options.end : null;
+
+ this.setWindow(start, end, { animation: false });
+ } else {
+ this.fit({ animation: false });
+ }
+ }
+ };
+
+ /**
+ * Set groups
+ * @param {vis.DataSet | Array} groups
+ */
+ Graph2d.prototype.setGroups = function (groups) {
+ // convert to type DataSet when needed
+ var newDataSet;
+ if (!groups) {
+ newDataSet = null;
+ } else if (groups instanceof DataSet || groups instanceof DataView) {
+ newDataSet = groups;
+ } else {
+ // turn an array into a dataset
+ newDataSet = new DataSet(groups);
+ }
+
+ this.groupsData = newDataSet;
+ this.linegraph.setGroups(newDataSet);
+ };
+
+ /**
+ * Returns an object containing an SVG element with the icon of the group (size determined by iconWidth and iconHeight), the label of the group (content) and the yAxisOrientation of the group (left or right).
+ * @param groupId
+ * @param width
+ * @param height
+ */
+ Graph2d.prototype.getLegend = function (groupId, width, height) {
+ if (width === undefined) {
+ width = 15;
+ }
+ if (height === undefined) {
+ height = 15;
+ }
+ if (this.linegraph.groups[groupId] !== undefined) {
+ return this.linegraph.groups[groupId].getLegend(width, height);
+ } else {
+ return 'cannot find group:' + groupId;
+ }
+ };
+
+ /**
+ * This checks if the visible option of the supplied group (by ID) is true or false.
+ * @param groupId
+ * @returns {*}
+ */
+ Graph2d.prototype.isGroupVisible = function (groupId) {
+ if (this.linegraph.groups[groupId] !== undefined) {
+ return this.linegraph.groups[groupId].visible && (this.linegraph.options.groups.visibility[groupId] === undefined || this.linegraph.options.groups.visibility[groupId] == true);
+ } else {
+ return false;
+ }
+ };
+
+ /**
+ * Get the data range of the item set.
+ * @returns {{min: Date, max: Date}} range A range with a start and end Date.
+ * When no minimum is found, min==null
+ * When no maximum is found, max==null
+ */
+ Graph2d.prototype.getDataRange = function () {
+ var min = null;
+ var max = null;
+
+ // calculate min from start filed
+ for (var groupId in this.linegraph.groups) {
+ if (this.linegraph.groups.hasOwnProperty(groupId)) {
+ if (this.linegraph.groups[groupId].visible == true) {
+ for (var i = 0; i < this.linegraph.groups[groupId].itemsData.length; i++) {
+ var item = this.linegraph.groups[groupId].itemsData[i];
+ var value = util.convert(item.x, 'Date').valueOf();
+ min = min == null ? value : min > value ? value : min;
+ max = max == null ? value : max < value ? value : max;
+ }
+ }
+ }
+ }
+
+ return {
+ min: min != null ? new Date(min) : null,
+ max: max != null ? new Date(max) : null
+ };
+ };
+
+ /**
+ * Generate Timeline related information from an event
+ * @param {Event} event
+ * @return {Object} An object with related information, like on which area
+ * The event happened, whether clicked on an item, etc.
+ */
+ Graph2d.prototype.getEventProperties = function (event) {
+ var clientX = event.center ? event.center.x : event.clientX;
+ var clientY = event.center ? event.center.y : event.clientY;
+ var x = clientX - util.getAbsoluteLeft(this.dom.centerContainer);
+ var y = clientY - util.getAbsoluteTop(this.dom.centerContainer);
+ var time = this._toTime(x);
+
+ var customTime = CustomTime.customTimeFromTarget(event);
+
+ var element = util.getTarget(event);
+ var what = null;
+ if (util.hasParent(element, this.timeAxis.dom.foreground)) {
+ what = 'axis';
+ } else if (this.timeAxis2 && util.hasParent(element, this.timeAxis2.dom.foreground)) {
+ what = 'axis';
+ } else if (util.hasParent(element, this.linegraph.yAxisLeft.dom.frame)) {
+ what = 'data-axis';
+ } else if (util.hasParent(element, this.linegraph.yAxisRight.dom.frame)) {
+ what = 'data-axis';
+ } else if (util.hasParent(element, this.linegraph.legendLeft.dom.frame)) {
+ what = 'legend';
+ } else if (util.hasParent(element, this.linegraph.legendRight.dom.frame)) {
+ what = 'legend';
+ } else if (customTime != null) {
+ what = 'custom-time';
+ } else if (util.hasParent(element, this.currentTime.bar)) {
+ what = 'current-time';
+ } else if (util.hasParent(element, this.dom.center)) {
+ what = 'background';
+ }
+
+ var value = [];
+ var yAxisLeft = this.linegraph.yAxisLeft;
+ var yAxisRight = this.linegraph.yAxisRight;
+ if (!yAxisLeft.hidden) {
+ value.push(yAxisLeft.screenToValue(y));
+ }
+ if (!yAxisRight.hidden) {
+ value.push(yAxisRight.screenToValue(y));
+ }
+
+ return {
+ event: event,
+ what: what,
+ pageX: event.srcEvent ? event.srcEvent.pageX : event.pageX,
+ pageY: event.srcEvent ? event.srcEvent.pageY : event.pageY,
+ x: x,
+ y: y,
+ time: time,
+ value: value
+ };
+ };
+
+ /**
+ * Load a configurator
+ * @return {Object}
+ * @private
+ */
+ Graph2d.prototype._createConfigurator = function () {
+ return new Configurator(this, this.dom.container, configureOptions);
+ };
+
+ module.exports = Graph2d;
+
+/***/ },
+/* 50 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var DOMutil = __webpack_require__(7);
+ var DataSet = __webpack_require__(8);
+ var DataView = __webpack_require__(10);
+ var Component = __webpack_require__(26);
+ var DataAxis = __webpack_require__(51);
+ var GraphGroup = __webpack_require__(53);
+ var Legend = __webpack_require__(57);
+ var BarFunctions = __webpack_require__(56);
+ var LineFunctions = __webpack_require__(54);
+
+ var UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items
+
+ /**
+ * This is the constructor of the LineGraph. It requires a Timeline body and options.
+ *
+ * @param body
+ * @param options
+ * @constructor
+ */
+ function LineGraph(body, options) {
+ this.id = util.randomUUID();
+ this.body = body;
+
+ this.defaultOptions = {
+ yAxisOrientation: 'left',
+ defaultGroup: 'default',
+ sort: true,
+ sampling: true,
+ stack: false,
+ graphHeight: '400px',
+ shaded: {
+ enabled: false,
+ orientation: 'bottom' // top, bottom
+ },
+ style: 'line', // line, bar
+ barChart: {
+ width: 50,
+ sideBySide: false,
+ align: 'center' // left, center, right
+ },
+ interpolation: {
+ enabled: true,
+ parametrization: 'centripetal', // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5)
+ alpha: 0.5
+ },
+ drawPoints: {
+ enabled: true,
+ size: 6,
+ style: 'square' // square, circle
+ },
+ dataAxis: {
+ showMinorLabels: true,
+ showMajorLabels: true,
+ icons: false,
+ width: '40px',
+ visible: true,
+ alignZeros: true,
+ left: {
+ range: { min: undefined, max: undefined },
+ format: function format(value) {
+ return value;
+ },
+ title: { text: undefined, style: undefined }
+ },
+ right: {
+ range: { min: undefined, max: undefined },
+ format: function format(value) {
+ return value;
+ },
+ title: { text: undefined, style: undefined }
+ }
+ },
+ legend: {
+ enabled: false,
+ icons: true,
+ left: {
+ visible: true,
+ position: 'top-left' // top/bottom - left,right
+ },
+ right: {
+ visible: true,
+ position: 'top-right' // top/bottom - left,right
+ }
+ },
+ groups: {
+ visibility: {}
+ }
+ };
+
+ // options is shared by this ItemSet and all its items
+ this.options = util.extend({}, this.defaultOptions);
+ this.dom = {};
+ this.props = {};
+ this.hammer = null;
+ this.groups = {};
+ this.abortedGraphUpdate = false;
+ this.updateSVGheight = false;
+ this.updateSVGheightOnResize = false;
+
+ var me = this;
+ this.itemsData = null; // DataSet
+ this.groupsData = null; // DataSet
+
+ // listeners for the DataSet of the items
+ this.itemListeners = {
+ 'add': function add(event, params, senderId) {
+ me._onAdd(params.items);
+ },
+ 'update': function update(event, params, senderId) {
+ me._onUpdate(params.items);
+ },
+ 'remove': function remove(event, params, senderId) {
+ me._onRemove(params.items);
+ }
+ };
+
+ // listeners for the DataSet of the groups
+ this.groupListeners = {
+ 'add': function add(event, params, senderId) {
+ me._onAddGroups(params.items);
+ },
+ 'update': function update(event, params, senderId) {
+ me._onUpdateGroups(params.items);
+ },
+ 'remove': function remove(event, params, senderId) {
+ me._onRemoveGroups(params.items);
+ }
+ };
+
+ this.items = {}; // object with an Item for every data item
+ this.selection = []; // list with the ids of all selected nodes
+ this.lastStart = this.body.range.start;
+ this.touchParams = {}; // stores properties while dragging
+
+ this.svgElements = {};
+ this.setOptions(options);
+ this.groupsUsingDefaultStyles = [0];
+ this.COUNTER = 0;
+ this.body.emitter.on('rangechanged', function () {
+ me.lastStart = me.body.range.start;
+ me.svg.style.left = util.option.asSize(-me.props.width);
+ me.redraw.call(me, true);
+ });
+
+ // create the HTML DOM
+ this._create();
+ this.framework = { svg: this.svg, svgElements: this.svgElements, options: this.options, groups: this.groups };
+ this.body.emitter.emit('change');
+ }
+
+ LineGraph.prototype = new Component();
+
+ /**
+ * Create the HTML DOM for the ItemSet
+ */
+ LineGraph.prototype._create = function () {
+ var frame = document.createElement('div');
+ frame.className = 'vis-line-graph';
+ this.dom.frame = frame;
+
+ // create svg element for graph drawing.
+ this.svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
+ this.svg.style.position = 'relative';
+ this.svg.style.height = ('' + this.options.graphHeight).replace('px', '') + 'px';
+ this.svg.style.display = 'block';
+ frame.appendChild(this.svg);
+
+ // data axis
+ this.options.dataAxis.orientation = 'left';
+ this.yAxisLeft = new DataAxis(this.body, this.options.dataAxis, this.svg, this.options.groups);
+
+ this.options.dataAxis.orientation = 'right';
+ this.yAxisRight = new DataAxis(this.body, this.options.dataAxis, this.svg, this.options.groups);
+ delete this.options.dataAxis.orientation;
+
+ // legends
+ this.legendLeft = new Legend(this.body, this.options.legend, 'left', this.options.groups);
+ this.legendRight = new Legend(this.body, this.options.legend, 'right', this.options.groups);
+
+ this.show();
+ };
+
+ /**
+ * set the options of the LineGraph. the mergeOptions is used for subObjects that have an enabled element.
+ * @param {object} options
+ */
+ LineGraph.prototype.setOptions = function (options) {
+ if (options) {
+ var fields = ['sampling', 'defaultGroup', 'stack', 'height', 'graphHeight', 'yAxisOrientation', 'style', 'barChart', 'dataAxis', 'sort', 'groups'];
+ if (options.graphHeight === undefined && options.height !== undefined && this.body.domProps.centerContainer.height !== undefined) {
+ this.updateSVGheight = true;
+ this.updateSVGheightOnResize = true;
+ } else if (this.body.domProps.centerContainer.height !== undefined && options.graphHeight !== undefined) {
+ if (parseInt((options.graphHeight + '').replace('px', '')) < this.body.domProps.centerContainer.height) {
+ this.updateSVGheight = true;
+ }
+ }
+ util.selectiveDeepExtend(fields, this.options, options);
+ util.mergeOptions(this.options, options, 'interpolation');
+ util.mergeOptions(this.options, options, 'drawPoints');
+ util.mergeOptions(this.options, options, 'shaded');
+ util.mergeOptions(this.options, options, 'legend');
+
+ if (options.interpolation) {
+ if (typeof options.interpolation == 'object') {
+ if (options.interpolation.parametrization) {
+ if (options.interpolation.parametrization == 'uniform') {
+ this.options.interpolation.alpha = 0;
+ } else if (options.interpolation.parametrization == 'chordal') {
+ this.options.interpolation.alpha = 1.0;
+ } else {
+ this.options.interpolation.parametrization = 'centripetal';
+ this.options.interpolation.alpha = 0.5;
+ }
+ }
+ }
+ }
+
+ if (this.yAxisLeft) {
+ if (options.dataAxis !== undefined) {
+ this.yAxisLeft.setOptions(this.options.dataAxis);
+ this.yAxisRight.setOptions(this.options.dataAxis);
+ }
+ }
+
+ if (this.legendLeft) {
+ if (options.legend !== undefined) {
+ this.legendLeft.setOptions(this.options.legend);
+ this.legendRight.setOptions(this.options.legend);
+ }
+ }
+
+ if (this.groups.hasOwnProperty(UNGROUPED)) {
+ this.groups[UNGROUPED].setOptions(options);
+ }
+ }
+
+ // this is used to redraw the graph if the visibility of the groups is changed.
+ if (this.dom.frame) {
+ this.redraw(true);
+ }
+ };
+
+ /**
+ * Hide the component from the DOM
+ */
+ LineGraph.prototype.hide = function () {
+ // remove the frame containing the items
+ if (this.dom.frame.parentNode) {
+ this.dom.frame.parentNode.removeChild(this.dom.frame);
+ }
+ };
+
+ /**
+ * Show the component in the DOM (when not already visible).
+ * @return {Boolean} changed
+ */
+ LineGraph.prototype.show = function () {
+ // show frame containing the items
+ if (!this.dom.frame.parentNode) {
+ this.body.dom.center.appendChild(this.dom.frame);
+ }
+ };
+
+ /**
+ * Set items
+ * @param {vis.DataSet | null} items
+ */
+ LineGraph.prototype.setItems = function (items) {
+ var me = this,
+ ids,
+ oldItemsData = this.itemsData;
+
+ // replace the dataset
+ if (!items) {
+ this.itemsData = null;
+ } else if (items instanceof DataSet || items instanceof DataView) {
+ this.itemsData = items;
+ } else {
+ throw new TypeError('Data must be an instance of DataSet or DataView');
+ }
+
+ if (oldItemsData) {
+ // unsubscribe from old dataset
+ util.forEach(this.itemListeners, function (callback, event) {
+ oldItemsData.off(event, callback);
+ });
+
+ // remove all drawn items
+ ids = oldItemsData.getIds();
+ this._onRemove(ids);
+ }
+
+ if (this.itemsData) {
+ // subscribe to new dataset
+ var id = this.id;
+ util.forEach(this.itemListeners, function (callback, event) {
+ me.itemsData.on(event, callback, id);
+ });
+
+ // add all new items
+ ids = this.itemsData.getIds();
+ this._onAdd(ids);
+ }
+ this._updateUngrouped();
+ //this._updateGraph();
+ this.redraw(true);
+ };
+
+ /**
+ * Set groups
+ * @param {vis.DataSet} groups
+ */
+ LineGraph.prototype.setGroups = function (groups) {
+ var me = this;
+ var ids;
+
+ // unsubscribe from current dataset
+ if (this.groupsData) {
+ util.forEach(this.groupListeners, function (callback, event) {
+ me.groupsData.off(event, callback);
+ });
+
+ // remove all drawn groups
+ ids = this.groupsData.getIds();
+ this.groupsData = null;
+ this._onRemoveGroups(ids); // note: this will cause a redraw
+ }
+
+ // replace the dataset
+ if (!groups) {
+ this.groupsData = null;
+ } else if (groups instanceof DataSet || groups instanceof DataView) {
+ this.groupsData = groups;
+ } else {
+ throw new TypeError('Data must be an instance of DataSet or DataView');
+ }
+
+ if (this.groupsData) {
+ // subscribe to new dataset
+ var id = this.id;
+ util.forEach(this.groupListeners, function (callback, event) {
+ me.groupsData.on(event, callback, id);
+ });
+
+ // draw all ms
+ ids = this.groupsData.getIds();
+ this._onAddGroups(ids);
+ }
+ this._onUpdate();
+ };
+
+ /**
+ * Update the data
+ * @param [ids]
+ * @private
+ */
+ LineGraph.prototype._onUpdate = function (ids) {
+ this._updateUngrouped();
+ this._updateAllGroupData();
+ //this._updateGraph();
+ this.redraw(true);
+ };
+ LineGraph.prototype._onAdd = function (ids) {
+ this._onUpdate(ids);
+ };
+ LineGraph.prototype._onRemove = function (ids) {
+ this._onUpdate(ids);
+ };
+ LineGraph.prototype._onUpdateGroups = function (groupIds) {
+ for (var i = 0; i < groupIds.length; i++) {
+ var group = this.groupsData.get(groupIds[i]);
+ this._updateGroup(group, groupIds[i]);
+ }
+
+ //this._updateGraph();
+ this.redraw(true);
+ };
+ LineGraph.prototype._onAddGroups = function (groupIds) {
+ this._onUpdateGroups(groupIds);
+ };
+
+ /**
+ * this cleans the group out off the legends and the dataaxis, updates the ungrouped and updates the graph
+ * @param {Array} groupIds
+ * @private
+ */
+ LineGraph.prototype._onRemoveGroups = function (groupIds) {
+ for (var i = 0; i < groupIds.length; i++) {
+ if (this.groups.hasOwnProperty(groupIds[i])) {
+ if (this.groups[groupIds[i]].options.yAxisOrientation == 'right') {
+ this.yAxisRight.removeGroup(groupIds[i]);
+ this.legendRight.removeGroup(groupIds[i]);
+ this.legendRight.redraw();
+ } else {
+ this.yAxisLeft.removeGroup(groupIds[i]);
+ this.legendLeft.removeGroup(groupIds[i]);
+ this.legendLeft.redraw();
+ }
+ delete this.groups[groupIds[i]];
+ }
+ }
+ this._updateUngrouped();
+ //this._updateGraph();
+ this.redraw(true);
+ };
+
+ /**
+ * update a group object with the group dataset entree
+ *
+ * @param group
+ * @param groupId
+ * @private
+ */
+ LineGraph.prototype._updateGroup = function (group, groupId) {
+ if (!this.groups.hasOwnProperty(groupId)) {
+ this.groups[groupId] = new GraphGroup(group, groupId, this.options, this.groupsUsingDefaultStyles);
+ if (this.groups[groupId].options.yAxisOrientation == 'right') {
+ this.yAxisRight.addGroup(groupId, this.groups[groupId]);
+ this.legendRight.addGroup(groupId, this.groups[groupId]);
+ } else {
+ this.yAxisLeft.addGroup(groupId, this.groups[groupId]);
+ this.legendLeft.addGroup(groupId, this.groups[groupId]);
+ }
+ } else {
+ this.groups[groupId].update(group);
+ if (this.groups[groupId].options.yAxisOrientation == 'right') {
+ this.yAxisRight.updateGroup(groupId, this.groups[groupId]);
+ this.legendRight.updateGroup(groupId, this.groups[groupId]);
+ } else {
+ this.yAxisLeft.updateGroup(groupId, this.groups[groupId]);
+ this.legendLeft.updateGroup(groupId, this.groups[groupId]);
+ }
+ }
+ this.legendLeft.redraw();
+ this.legendRight.redraw();
+ };
+
+ /**
+ * this updates all groups, it is used when there is an update the the itemset.
+ *
+ * @private
+ */
+ LineGraph.prototype._updateAllGroupData = function () {
+ if (this.itemsData != null) {
+ var groupsContent = {};
+ var groupId;
+ for (groupId in this.groups) {
+ if (this.groups.hasOwnProperty(groupId)) {
+ groupsContent[groupId] = [];
+ }
+ }
+ for (var itemId in this.itemsData._data) {
+ if (this.itemsData._data.hasOwnProperty(itemId)) {
+ var item = this.itemsData._data[itemId];
+ if (groupsContent[item.group] === undefined) {
+ throw new Error('Cannot find referenced group ' + item.group + '. Possible reason: items added before groups? Groups need to be added before items, as items refer to groups.');
+ }
+ item.x = util.convert(item.x, 'Date');
+ groupsContent[item.group].push(item);
+ }
+ }
+ for (groupId in this.groups) {
+ if (this.groups.hasOwnProperty(groupId)) {
+ this.groups[groupId].setItems(groupsContent[groupId]);
+ }
+ }
+ }
+ };
+
+ /**
+ * Create or delete the group holding all ungrouped items. This group is used when
+ * there are no groups specified. This anonymous group is called 'graph'.
+ * @protected
+ */
+ LineGraph.prototype._updateUngrouped = function () {
+ if (this.itemsData && this.itemsData != null) {
+ var ungroupedCounter = 0;
+ for (var itemId in this.itemsData._data) {
+ if (this.itemsData._data.hasOwnProperty(itemId)) {
+ var item = this.itemsData._data[itemId];
+ if (item != undefined) {
+ if (item.hasOwnProperty('group')) {
+ if (item.group === undefined) {
+ item.group = UNGROUPED;
+ }
+ } else {
+ item.group = UNGROUPED;
+ }
+ ungroupedCounter = item.group == UNGROUPED ? ungroupedCounter + 1 : ungroupedCounter;
+ }
+ }
+ }
+
+ if (ungroupedCounter == 0) {
+ delete this.groups[UNGROUPED];
+ this.legendLeft.removeGroup(UNGROUPED);
+ this.legendRight.removeGroup(UNGROUPED);
+ this.yAxisLeft.removeGroup(UNGROUPED);
+ this.yAxisRight.removeGroup(UNGROUPED);
+ } else {
+ var group = { id: UNGROUPED, content: this.options.defaultGroup };
+ this._updateGroup(group, UNGROUPED);
+ }
+ } else {
+ delete this.groups[UNGROUPED];
+ this.legendLeft.removeGroup(UNGROUPED);
+ this.legendRight.removeGroup(UNGROUPED);
+ this.yAxisLeft.removeGroup(UNGROUPED);
+ this.yAxisRight.removeGroup(UNGROUPED);
+ }
+
+ this.legendLeft.redraw();
+ this.legendRight.redraw();
+ };
+
+ /**
+ * Redraw the component, mandatory function
+ * @return {boolean} Returns true if the component is resized
+ */
+ LineGraph.prototype.redraw = function (forceGraphUpdate) {
+ var resized = false;
+
+ // calculate actual size and position
+ this.props.width = this.dom.frame.offsetWidth;
+ this.props.height = this.body.domProps.centerContainer.height - this.body.domProps.border.top - this.body.domProps.border.bottom;
+
+ // update the graph if there is no lastWidth or with, used for the initial draw
+ if (this.lastWidth === undefined && this.props.width) {
+ forceGraphUpdate = true;
+ }
+
+ // check if this component is resized
+ resized = this._isResized() || resized;
+
+ // check whether zoomed (in that case we need to re-stack everything)
+ var visibleInterval = this.body.range.end - this.body.range.start;
+ var zoomed = visibleInterval != this.lastVisibleInterval;
+ this.lastVisibleInterval = visibleInterval;
+
+ // the svg element is three times as big as the width, this allows for fully dragging left and right
+ // without reloading the graph. the controls for this are bound to events in the constructor
+ if (resized == true) {
+ this.svg.style.width = util.option.asSize(3 * this.props.width);
+ this.svg.style.left = util.option.asSize(-this.props.width);
+
+ // if the height of the graph is set as proportional, change the height of the svg
+ if ((this.options.height + '').indexOf('%') != -1 || this.updateSVGheightOnResize == true) {
+ this.updateSVGheight = true;
+ }
+ }
+
+ // update the height of the graph on each redraw of the graph.
+ if (this.updateSVGheight == true) {
+ if (this.options.graphHeight != this.props.height + 'px') {
+ this.options.graphHeight = this.props.height + 'px';
+ this.svg.style.height = this.props.height + 'px';
+ }
+ this.updateSVGheight = false;
+ } else {
+ this.svg.style.height = ('' + this.options.graphHeight).replace('px', '') + 'px';
+ }
+
+ // zoomed is here to ensure that animations are shown correctly.
+ if (resized == true || zoomed == true || this.abortedGraphUpdate == true || forceGraphUpdate == true) {
+ resized = this._updateGraph() || resized;
+ } else {
+ // move the whole svg while dragging
+ if (this.lastStart != 0) {
+ var offset = this.body.range.start - this.lastStart;
+ var range = this.body.range.end - this.body.range.start;
+ if (this.props.width != 0) {
+ var rangePerPixelInv = this.props.width / range;
+ var xOffset = offset * rangePerPixelInv;
+ this.svg.style.left = -this.props.width - xOffset + 'px';
+ }
+ }
+ }
+
+ this.legendLeft.redraw();
+ this.legendRight.redraw();
+ return resized;
+ };
+
+ /**
+ * Update and redraw the graph.
+ *
+ */
+ LineGraph.prototype._updateGraph = function () {
+ // reset the svg elements
+ DOMutil.prepareElements(this.svgElements);
+ if (this.props.width != 0 && this.itemsData != null) {
+ var group, i;
+ var preprocessedGroupData = {};
+ var processedGroupData = {};
+ var groupRanges = {};
+ var changeCalled = false;
+
+ // getting group Ids
+ var groupIds = [];
+ for (var groupId in this.groups) {
+ if (this.groups.hasOwnProperty(groupId)) {
+ group = this.groups[groupId];
+ if (group.visible == true && (this.options.groups.visibility[groupId] === undefined || this.options.groups.visibility[groupId] == true)) {
+ groupIds.push(groupId);
+ }
+ }
+ }
+ if (groupIds.length > 0) {
+ // this is the range of the SVG canvas
+ var minDate = this.body.util.toGlobalTime(-this.body.domProps.root.width);
+ var maxDate = this.body.util.toGlobalTime(2 * this.body.domProps.root.width);
+ var groupsData = {};
+ // fill groups data, this only loads the data we require based on the timewindow
+ this._getRelevantData(groupIds, groupsData, minDate, maxDate);
+
+ // apply sampling, if disabled, it will pass through this function.
+ this._applySampling(groupIds, groupsData);
+
+ // we transform the X coordinates to detect collisions
+ for (i = 0; i < groupIds.length; i++) {
+ preprocessedGroupData[groupIds[i]] = this._convertXcoordinates(groupsData[groupIds[i]]);
+ }
+
+ // now all needed data has been collected we start the processing.
+ this._getYRanges(groupIds, preprocessedGroupData, groupRanges);
+
+ // update the Y axis first, we use this data to draw at the correct Y points
+ // changeCalled is required to clean the SVG on a change emit.
+ changeCalled = this._updateYAxis(groupIds, groupRanges);
+ var MAX_CYCLES = 5;
+ if (changeCalled == true && this.COUNTER < MAX_CYCLES) {
+ DOMutil.cleanupElements(this.svgElements);
+ this.abortedGraphUpdate = true;
+ this.COUNTER++;
+ this.body.emitter.emit('change');
+ return true;
+ } else {
+ if (this.COUNTER > MAX_CYCLES) {
+ console.log('WARNING: there may be an infinite loop in the _updateGraph emitter cycle.');
+ }
+ this.COUNTER = 0;
+ this.abortedGraphUpdate = false;
+
+ // With the yAxis scaled correctly, use this to get the Y values of the points.
+ for (i = 0; i < groupIds.length; i++) {
+ group = this.groups[groupIds[i]];
+ processedGroupData[groupIds[i]] = this._convertYcoordinates(groupsData[groupIds[i]], group);
+ }
+
+ // draw the groups
+ for (i = 0; i < groupIds.length; i++) {
+ group = this.groups[groupIds[i]];
+ if (group.options.style != 'bar') {
+ // bar needs to be drawn enmasse
+ group.draw(processedGroupData[groupIds[i]], group, this.framework);
+ }
+ }
+ BarFunctions.draw(groupIds, processedGroupData, this.framework);
+ }
+ }
+ }
+
+ // cleanup unused svg elements
+ DOMutil.cleanupElements(this.svgElements);
+ return false;
+ };
+
+ /**
+ * first select and preprocess the data from the datasets.
+ * the groups have their preselection of data, we now loop over this data to see
+ * what data we need to draw. Sorted data is much faster.
+ * more optimization is possible by doing the sampling before and using the binary search
+ * to find the end date to determine the increment.
+ *
+ * @param {array} groupIds
+ * @param {object} groupsData
+ * @param {date} minDate
+ * @param {date} maxDate
+ * @private
+ */
+ LineGraph.prototype._getRelevantData = function (groupIds, groupsData, minDate, maxDate) {
+ var group, i, j, item;
+ if (groupIds.length > 0) {
+ for (i = 0; i < groupIds.length; i++) {
+ group = this.groups[groupIds[i]];
+ groupsData[groupIds[i]] = [];
+ var dataContainer = groupsData[groupIds[i]];
+ // optimization for sorted data
+ if (group.options.sort == true) {
+ var guess = Math.max(0, util.binarySearchValue(group.itemsData, minDate, 'x', 'before'));
+ for (j = guess; j < group.itemsData.length; j++) {
+ item = group.itemsData[j];
+ if (item !== undefined) {
+ if (item.x > maxDate) {
+ dataContainer.push(item);
+ break;
+ } else {
+ dataContainer.push(item);
+ }
+ }
+ }
+ } else {
+ for (j = 0; j < group.itemsData.length; j++) {
+ item = group.itemsData[j];
+ if (item !== undefined) {
+ if (item.x > minDate && item.x < maxDate) {
+ dataContainer.push(item);
+ }
+ }
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ *
+ * @param groupIds
+ * @param groupsData
+ * @private
+ */
+ LineGraph.prototype._applySampling = function (groupIds, groupsData) {
+ var group;
+ if (groupIds.length > 0) {
+ for (var i = 0; i < groupIds.length; i++) {
+ group = this.groups[groupIds[i]];
+ if (group.options.sampling == true) {
+ var dataContainer = groupsData[groupIds[i]];
+ if (dataContainer.length > 0) {
+ var increment = 1;
+ var amountOfPoints = dataContainer.length;
+
+ // the global screen is used because changing the width of the yAxis may affect the increment, resulting in an endless loop
+ // of width changing of the yAxis.
+ var xDistance = this.body.util.toGlobalScreen(dataContainer[dataContainer.length - 1].x) - this.body.util.toGlobalScreen(dataContainer[0].x);
+ var pointsPerPixel = amountOfPoints / xDistance;
+ increment = Math.min(Math.ceil(0.2 * amountOfPoints), Math.max(1, Math.round(pointsPerPixel)));
+
+ var sampledData = [];
+ for (var j = 0; j < amountOfPoints; j += increment) {
+ sampledData.push(dataContainer[j]);
+ }
+ groupsData[groupIds[i]] = sampledData;
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ *
+ *
+ * @param {array} groupIds
+ * @param {object} groupsData
+ * @param {object} groupRanges | this is being filled here
+ * @private
+ */
+ LineGraph.prototype._getYRanges = function (groupIds, groupsData, groupRanges) {
+ var groupData, group, i;
+ var combinedDataLeft = [];
+ var combinedDataRight = [];
+ var options;
+ if (groupIds.length > 0) {
+ for (i = 0; i < groupIds.length; i++) {
+ groupData = groupsData[groupIds[i]];
+ options = this.groups[groupIds[i]].options;
+ if (groupData.length > 0) {
+ group = this.groups[groupIds[i]];
+ // if bar graphs are stacked, their range need to be handled differently and accumulated over all groups.
+ if (options.stack === true && options.style === 'bar') {
+ if (options.yAxisOrientation === 'left') {
+ combinedDataLeft = combinedDataLeft.concat(group.getData(groupData));
+ } else {
+ combinedDataRight = combinedDataRight.concat(group.getData(groupData));
+ }
+ } else {
+ groupRanges[groupIds[i]] = group.getYRange(groupData, groupIds[i]);
+ }
+ }
+ }
+
+ // if bar graphs are stacked, their range need to be handled differently and accumulated over all groups.
+ BarFunctions.getStackedYRange(combinedDataLeft, groupRanges, groupIds, '__barStackLeft', 'left');
+ BarFunctions.getStackedYRange(combinedDataRight, groupRanges, groupIds, '__barStackRight', 'right');
+ // if line graphs are stacked, their range need to be handled differently and accumulated over all groups.
+ //LineFunctions.getStackedYRange(combinedDataLeft , groupRanges, groupIds, '__lineStackLeft' , 'left' );
+ //LineFunctions.getStackedYRange(combinedDataRight, groupRanges, groupIds, '__lineStackRight', 'right');
+ }
+ };
+
+ /**
+ * this sets the Y ranges for the Y axis. It also determines which of the axis should be shown or hidden.
+ * @param {Array} groupIds
+ * @param {Object} groupRanges
+ * @private
+ */
+ LineGraph.prototype._updateYAxis = function (groupIds, groupRanges) {
+ var resized = false;
+ var yAxisLeftUsed = false;
+ var yAxisRightUsed = false;
+ var minLeft = 1e9,
+ minRight = 1e9,
+ maxLeft = -1e9,
+ maxRight = -1e9,
+ minVal,
+ maxVal;
+ // if groups are present
+ if (groupIds.length > 0) {
+ // this is here to make sure that if there are no items in the axis but there are groups, that there is no infinite draw/redraw loop.
+ for (var i = 0; i < groupIds.length; i++) {
+ var group = this.groups[groupIds[i]];
+ if (group && group.options.yAxisOrientation != 'right') {
+ yAxisLeftUsed = true;
+ minLeft = 1e9;
+ maxLeft = -1e9;
+ } else if (group && group.options.yAxisOrientation) {
+ yAxisRightUsed = true;
+ minRight = 1e9;
+ maxRight = -1e9;
+ }
+ }
+
+ // if there are items:
+ for (var i = 0; i < groupIds.length; i++) {
+ if (groupRanges.hasOwnProperty(groupIds[i])) {
+ if (groupRanges[groupIds[i]].ignore !== true) {
+ minVal = groupRanges[groupIds[i]].min;
+ maxVal = groupRanges[groupIds[i]].max;
+
+ if (groupRanges[groupIds[i]].yAxisOrientation != 'right') {
+ yAxisLeftUsed = true;
+ minLeft = minLeft > minVal ? minVal : minLeft;
+ maxLeft = maxLeft < maxVal ? maxVal : maxLeft;
+ } else {
+ yAxisRightUsed = true;
+ minRight = minRight > minVal ? minVal : minRight;
+ maxRight = maxRight < maxVal ? maxVal : maxRight;
+ }
+ }
+ }
+ }
+
+ if (yAxisLeftUsed == true) {
+ this.yAxisLeft.setRange(minLeft, maxLeft);
+ }
+ if (yAxisRightUsed == true) {
+ this.yAxisRight.setRange(minRight, maxRight);
+ }
+ }
+ resized = this._toggleAxisVisiblity(yAxisLeftUsed, this.yAxisLeft) || resized;
+ resized = this._toggleAxisVisiblity(yAxisRightUsed, this.yAxisRight) || resized;
+
+ if (yAxisRightUsed == true && yAxisLeftUsed == true) {
+ this.yAxisLeft.drawIcons = true;
+ this.yAxisRight.drawIcons = true;
+ } else {
+ this.yAxisLeft.drawIcons = false;
+ this.yAxisRight.drawIcons = false;
+ }
+ this.yAxisRight.master = !yAxisLeftUsed;
+ if (this.yAxisRight.master == false) {
+ if (yAxisRightUsed == true) {
+ this.yAxisLeft.lineOffset = this.yAxisRight.width;
+ } else {
+ this.yAxisLeft.lineOffset = 0;
+ }
+
+ resized = this.yAxisLeft.redraw() || resized;
+ this.yAxisRight.stepPixels = this.yAxisLeft.stepPixels;
+ this.yAxisRight.zeroCrossing = this.yAxisLeft.zeroCrossing;
+ this.yAxisRight.amountOfSteps = this.yAxisLeft.amountOfSteps;
+ resized = this.yAxisRight.redraw() || resized;
+ } else {
+ resized = this.yAxisRight.redraw() || resized;
+ }
+
+ // clean the accumulated lists
+ var tempGroups = ['__barStackLeft', '__barStackRight', '__lineStackLeft', '__lineStackRight'];
+ for (var i = 0; i < tempGroups.length; i++) {
+ if (groupIds.indexOf(tempGroups[i]) != -1) {
+ groupIds.splice(groupIds.indexOf(tempGroups[i]), 1);
+ }
+ }
+
+ return resized;
+ };
+
+ /**
+ * This shows or hides the Y axis if needed. If there is a change, the changed event is emitted by the updateYAxis function
+ *
+ * @param {boolean} axisUsed
+ * @returns {boolean}
+ * @private
+ * @param axis
+ */
+ LineGraph.prototype._toggleAxisVisiblity = function (axisUsed, axis) {
+ var changed = false;
+ if (axisUsed == false) {
+ if (axis.dom.frame.parentNode && axis.hidden == false) {
+ axis.hide();
+ changed = true;
+ }
+ } else {
+ if (!axis.dom.frame.parentNode && axis.hidden == true) {
+ axis.show();
+ changed = true;
+ }
+ }
+ return changed;
+ };
+
+ /**
+ * This uses the DataAxis object to generate the correct X coordinate on the SVG window. It uses the
+ * util function toScreen to get the x coordinate from the timestamp. It also pre-filters the data and get the minMax ranges for
+ * the yAxis.
+ *
+ * @param datapoints
+ * @returns {Array}
+ * @private
+ */
+ LineGraph.prototype._convertXcoordinates = function (datapoints) {
+ var extractedData = [];
+ var xValue, yValue;
+ var toScreen = this.body.util.toScreen;
+
+ for (var i = 0; i < datapoints.length; i++) {
+ xValue = toScreen(datapoints[i].x) + this.props.width;
+ yValue = datapoints[i].y;
+ extractedData.push({ x: xValue, y: yValue });
+ }
+
+ return extractedData;
+ };
+
+ /**
+ * This uses the DataAxis object to generate the correct X coordinate on the SVG window. It uses the
+ * util function toScreen to get the x coordinate from the timestamp. It also pre-filters the data and get the minMax ranges for
+ * the yAxis.
+ *
+ * @param datapoints
+ * @param group
+ * @returns {Array}
+ * @private
+ */
+ LineGraph.prototype._convertYcoordinates = function (datapoints, group) {
+ var extractedData = [];
+ var xValue, yValue;
+ var toScreen = this.body.util.toScreen;
+ var axis = this.yAxisLeft;
+ var svgHeight = Number(this.svg.style.height.replace('px', ''));
+ if (group.options.yAxisOrientation == 'right') {
+ axis = this.yAxisRight;
+ }
+
+ for (var i = 0; i < datapoints.length; i++) {
+ var labelValue = datapoints[i].label ? datapoints[i].label : null;
+ xValue = toScreen(datapoints[i].x) + this.props.width;
+ yValue = Math.round(axis.convertValue(datapoints[i].y));
+ extractedData.push({ x: xValue, y: yValue, label: labelValue });
+ }
+
+ group.setZeroPosition(Math.min(svgHeight, axis.convertValue(0)));
+
+ return extractedData;
+ };
+
+ module.exports = LineGraph;
+
+/***/ },
+/* 51 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var DOMutil = __webpack_require__(7);
+ var Component = __webpack_require__(26);
+ var DataStep = __webpack_require__(52);
+
+ /**
+ * A horizontal time axis
+ * @param {Object} [options] See DataAxis.setOptions for the available
+ * options.
+ * @constructor DataAxis
+ * @extends Component
+ * @param body
+ */
+ function DataAxis(body, options, svg, linegraphOptions) {
+ this.id = util.randomUUID();
+ this.body = body;
+
+ this.defaultOptions = {
+ orientation: 'left', // supported: 'left', 'right'
+ showMinorLabels: true,
+ showMajorLabels: true,
+ icons: true,
+ majorLinesOffset: 7,
+ minorLinesOffset: 4,
+ labelOffsetX: 10,
+ labelOffsetY: 2,
+ iconWidth: 20,
+ width: '40px',
+ visible: true,
+ alignZeros: true,
+ left: {
+ range: { min: undefined, max: undefined },
+ format: function format(value) {
+ return value;
+ },
+ title: { text: undefined, style: undefined }
+ },
+ right: {
+ range: { min: undefined, max: undefined },
+ format: function format(value) {
+ return value;
+ },
+ title: { text: undefined, style: undefined }
+ }
+ };
+
+ this.linegraphOptions = linegraphOptions;
+ this.linegraphSVG = svg;
+ this.props = {};
+ this.DOMelements = { // dynamic elements
+ lines: {},
+ labels: {},
+ title: {}
+ };
+
+ this.dom = {};
+
+ this.range = { start: 0, end: 0 };
+
+ this.options = util.extend({}, this.defaultOptions);
+ this.conversionFactor = 1;
+
+ this.setOptions(options);
+ this.width = Number(('' + this.options.width).replace('px', ''));
+ this.minWidth = this.width;
+ this.height = this.linegraphSVG.offsetHeight;
+ this.hidden = false;
+
+ this.stepPixels = 25;
+ this.zeroCrossing = -1;
+ this.amountOfSteps = -1;
+
+ this.lineOffset = 0;
+ this.master = true;
+ this.svgElements = {};
+ this.iconsRemoved = false;
+
+ this.groups = {};
+ this.amountOfGroups = 0;
+
+ // create the HTML DOM
+ this._create();
+
+ var me = this;
+ this.body.emitter.on('verticalDrag', function () {
+ me.dom.lineContainer.style.top = me.body.domProps.scrollTop + 'px';
+ });
+ }
+
+ DataAxis.prototype = new Component();
+
+ DataAxis.prototype.addGroup = function (label, graphOptions) {
+ if (!this.groups.hasOwnProperty(label)) {
+ this.groups[label] = graphOptions;
+ }
+ this.amountOfGroups += 1;
+ };
+
+ DataAxis.prototype.updateGroup = function (label, graphOptions) {
+ this.groups[label] = graphOptions;
+ };
+
+ DataAxis.prototype.removeGroup = function (label) {
+ if (this.groups.hasOwnProperty(label)) {
+ delete this.groups[label];
+ this.amountOfGroups -= 1;
+ }
+ };
+
+ DataAxis.prototype.setOptions = function (options) {
+ if (options) {
+ var redraw = false;
+ if (this.options.orientation != options.orientation && options.orientation !== undefined) {
+ redraw = true;
+ }
+ var fields = ['orientation', 'showMinorLabels', 'showMajorLabels', 'icons', 'majorLinesOffset', 'minorLinesOffset', 'labelOffsetX', 'labelOffsetY', 'iconWidth', 'width', 'visible', 'left', 'right', 'alignZeros'];
+ util.selectiveExtend(fields, this.options, options);
+
+ this.minWidth = Number(('' + this.options.width).replace('px', ''));
+
+ if (redraw === true && this.dom.frame) {
+ this.hide();
+ this.show();
+ }
+ }
+ };
+
+ /**
+ * Create the HTML DOM for the DataAxis
+ */
+ DataAxis.prototype._create = function () {
+ this.dom.frame = document.createElement('div');
+ this.dom.frame.style.width = this.options.width;
+ this.dom.frame.style.height = this.height;
+
+ this.dom.lineContainer = document.createElement('div');
+ this.dom.lineContainer.style.width = '100%';
+ this.dom.lineContainer.style.height = this.height;
+ this.dom.lineContainer.style.position = 'relative';
+
+ // create svg element for graph drawing.
+ this.svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
+ this.svg.style.position = 'absolute';
+ this.svg.style.top = '0px';
+ this.svg.style.height = '100%';
+ this.svg.style.width = '100%';
+ this.svg.style.display = 'block';
+ this.dom.frame.appendChild(this.svg);
+ };
+
+ DataAxis.prototype._redrawGroupIcons = function () {
+ DOMutil.prepareElements(this.svgElements);
+
+ var x;
+ var iconWidth = this.options.iconWidth;
+ var iconHeight = 15;
+ var iconOffset = 4;
+ var y = iconOffset + 0.5 * iconHeight;
+
+ if (this.options.orientation === 'left') {
+ x = iconOffset;
+ } else {
+ x = this.width - iconWidth - iconOffset;
+ }
+
+ var groupArray = Object.keys(this.groups);
+ groupArray.sort(function (a, b) {
+ return a < b ? -1 : 1;
+ });
+
+ for (var i = 0; i < groupArray.length; i++) {
+ var groupId = groupArray[i];
+ if (this.groups[groupId].visible === true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] === true)) {
+ this.groups[groupId].drawIcon(x, y, this.svgElements, this.svg, iconWidth, iconHeight);
+ y += iconHeight + iconOffset;
+ }
+ }
+
+ DOMutil.cleanupElements(this.svgElements);
+ this.iconsRemoved = false;
+ };
+
+ DataAxis.prototype._cleanupIcons = function () {
+ if (this.iconsRemoved === false) {
+ DOMutil.prepareElements(this.svgElements);
+ DOMutil.cleanupElements(this.svgElements);
+ this.iconsRemoved = true;
+ }
+ };
+
+ /**
+ * Create the HTML DOM for the DataAxis
+ */
+ DataAxis.prototype.show = function () {
+ this.hidden = false;
+ if (!this.dom.frame.parentNode) {
+ if (this.options.orientation === 'left') {
+ this.body.dom.left.appendChild(this.dom.frame);
+ } else {
+ this.body.dom.right.appendChild(this.dom.frame);
+ }
+ }
+
+ if (!this.dom.lineContainer.parentNode) {
+ this.body.dom.backgroundHorizontal.appendChild(this.dom.lineContainer);
+ }
+ };
+
+ /**
+ * Create the HTML DOM for the DataAxis
+ */
+ DataAxis.prototype.hide = function () {
+ this.hidden = true;
+ if (this.dom.frame.parentNode) {
+ this.dom.frame.parentNode.removeChild(this.dom.frame);
+ }
+
+ if (this.dom.lineContainer.parentNode) {
+ this.dom.lineContainer.parentNode.removeChild(this.dom.lineContainer);
+ }
+ };
+
+ /**
+ * Set a range (start and end)
+ * @param end
+ * @param start
+ * @param end
+ */
+ DataAxis.prototype.setRange = function (start, end) {
+ if (this.master === false && this.options.alignZeros === true && this.zeroCrossing != -1) {
+ if (start > 0) {
+ start = 0;
+ }
+ }
+ this.range.start = start;
+ this.range.end = end;
+ };
+
+ /**
+ * Repaint the component
+ * @return {boolean} Returns true if the component is resized
+ */
+ DataAxis.prototype.redraw = function () {
+ var resized = false;
+ var activeGroups = 0;
+
+ // Make sure the line container adheres to the vertical scrolling.
+ this.dom.lineContainer.style.top = this.body.domProps.scrollTop + 'px';
+
+ for (var groupId in this.groups) {
+ if (this.groups.hasOwnProperty(groupId)) {
+ if (this.groups[groupId].visible === true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] === true)) {
+ activeGroups++;
+ }
+ }
+ }
+ if (this.amountOfGroups === 0 || activeGroups === 0) {
+ this.hide();
+ } else {
+ this.show();
+ this.height = Number(this.linegraphSVG.style.height.replace('px', ''));
+
+ // svg offsetheight did not work in firefox and explorer...
+ this.dom.lineContainer.style.height = this.height + 'px';
+ this.width = this.options.visible === true ? Number(('' + this.options.width).replace('px', '')) : 0;
+
+ var props = this.props;
+ var frame = this.dom.frame;
+
+ // update classname
+ frame.className = 'vis-data-axis';
+
+ // calculate character width and height
+ this._calculateCharSize();
+
+ var orientation = this.options.orientation;
+ var showMinorLabels = this.options.showMinorLabels;
+ var showMajorLabels = this.options.showMajorLabels;
+
+ // determine the width and height of the elements for the axis
+ props.minorLabelHeight = showMinorLabels ? props.minorCharHeight : 0;
+ props.majorLabelHeight = showMajorLabels ? props.majorCharHeight : 0;
+
+ props.minorLineWidth = this.body.dom.backgroundHorizontal.offsetWidth - this.lineOffset - this.width + 2 * this.options.minorLinesOffset;
+ props.minorLineHeight = 1;
+ props.majorLineWidth = this.body.dom.backgroundHorizontal.offsetWidth - this.lineOffset - this.width + 2 * this.options.majorLinesOffset;
+ props.majorLineHeight = 1;
+
+ // take frame offline while updating (is almost twice as fast)
+ if (orientation === 'left') {
+ frame.style.top = '0';
+ frame.style.left = '0';
+ frame.style.bottom = '';
+ frame.style.width = this.width + 'px';
+ frame.style.height = this.height + 'px';
+ this.props.width = this.body.domProps.left.width;
+ this.props.height = this.body.domProps.left.height;
+ } else {
+ // right
+ frame.style.top = '';
+ frame.style.bottom = '0';
+ frame.style.left = '0';
+ frame.style.width = this.width + 'px';
+ frame.style.height = this.height + 'px';
+ this.props.width = this.body.domProps.right.width;
+ this.props.height = this.body.domProps.right.height;
+ }
+
+ resized = this._redrawLabels();
+ resized = this._isResized() || resized;
+
+ if (this.options.icons === true) {
+ this._redrawGroupIcons();
+ } else {
+ this._cleanupIcons();
+ }
+
+ this._redrawTitle(orientation);
+ }
+ return resized;
+ };
+
+ /**
+ * Repaint major and minor text labels and vertical grid lines
+ * @private
+ */
+ DataAxis.prototype._redrawLabels = function () {
+ var resized = false;
+ DOMutil.prepareElements(this.DOMelements.lines);
+ DOMutil.prepareElements(this.DOMelements.labels);
+ var orientation = this.options['orientation'];
+
+ // get the range for the slaved axis
+ var step;
+ if (this.master === false) {
+ var stepSize, rangeStart, rangeEnd, minimumStep;
+ if (this.zeroCrossing !== -1 && this.options.alignZeros === true) {
+ if (this.range.end > 0) {
+ stepSize = this.range.end / this.zeroCrossing; // size of one step
+ rangeStart = this.range.end - this.amountOfSteps * stepSize;
+ rangeEnd = this.range.end;
+ } else {
+ // all of the range (including start) has to be done before the zero crossing.
+ stepSize = -1 * this.range.start / (this.amountOfSteps - this.zeroCrossing); // absolute size of a step
+ rangeStart = this.range.start;
+ rangeEnd = this.range.start + stepSize * this.amountOfSteps;
+ }
+ } else {
+ rangeStart = this.range.start;
+ rangeEnd = this.range.end;
+ }
+ minimumStep = this.stepPixels;
+ } else {
+ // calculate range and step (step such that we have space for 7 characters per label)
+ minimumStep = this.props.majorCharHeight;
+ rangeStart = this.range.start;
+ rangeEnd = this.range.end;
+ }
+
+ this.step = step = new DataStep(rangeStart, rangeEnd, minimumStep, this.dom.frame.offsetHeight, this.options[this.options.orientation].range, this.options[this.options.orientation].format, this.master === false && this.options.alignZeros // does the step have to align zeros? only if not master and the options is on
+ );
+
+ // the slave axis needs to use the same horizontal lines as the master axis.
+ if (this.master === true) {
+ this.stepPixels = this.dom.frame.offsetHeight / step.marginRange * step.step;
+ this.amountOfSteps = Math.ceil(this.dom.frame.offsetHeight / this.stepPixels);
+ } else {
+ // align with zero
+ if (this.options.alignZeros === true && this.zeroCrossing !== -1) {
+ // distance is the amount of steps away from the zero crossing we are.
+ var distance = (step.current - this.zeroCrossing * step.step) / step.step;
+ this.step.shift(distance);
+ }
+ }
+
+ // value at the bottom of the SVG
+ this.valueAtBottom = step.marginEnd;
+
+ this.maxLabelSize = 0;
+ var y = 0; // init value
+ var stepIndex = 0; // init value
+ var isMajor = false; // init value
+ while (stepIndex < this.amountOfSteps) {
+ y = Math.round(stepIndex * this.stepPixels);
+ isMajor = step.isMajor();
+
+ if (stepIndex > 0 && stepIndex !== this.amountOfSteps) {
+ if (this.options['showMinorLabels'] && isMajor === false || this.master === false && this.options['showMinorLabels'] === true) {
+ this._redrawLabel(y - 2, step.getCurrent(), orientation, 'vis-y-axis vis-minor', this.props.minorCharHeight);
+ }
+
+ if (isMajor && this.options['showMajorLabels'] && this.master === true || this.options['showMinorLabels'] === false && this.master === false && isMajor === true) {
+ if (y >= 0) {
+ this._redrawLabel(y - 2, step.getCurrent(), orientation, 'vis-y-axis vis-major', this.props.majorCharHeight);
+ }
+ this._redrawLine(y, orientation, 'vis-grid vis-horizontal vis-major', this.options.majorLinesOffset, this.props.majorLineWidth);
+ } else {
+ this._redrawLine(y, orientation, 'vis-grid vis-horizontal vis-minor', this.options.minorLinesOffset, this.props.minorLineWidth);
+ }
+ }
+
+ // get zero crossing
+ if (this.master === true && step.current === 0) {
+ this.zeroCrossing = stepIndex;
+ }
+
+ step.next();
+ stepIndex += 1;
+ }
+
+ // get zero crossing if it's the last step
+ if (this.master === true && step.current === 0) {
+ this.zeroCrossing = stepIndex;
+ }
+
+ this.conversionFactor = this.stepPixels / step.step;
+
+ // Note that title is rotated, so we're using the height, not width!
+ var titleWidth = 0;
+ if (this.options[orientation].title !== undefined && this.options[orientation].title.text !== undefined) {
+ titleWidth = this.props.titleCharHeight;
+ }
+ var offset = this.options.icons === true ? Math.max(this.options.iconWidth, titleWidth) + this.options.labelOffsetX + 15 : titleWidth + this.options.labelOffsetX + 15;
+
+ // this will resize the yAxis to accommodate the labels.
+ if (this.maxLabelSize > this.width - offset && this.options.visible === true) {
+ this.width = this.maxLabelSize + offset;
+ this.options.width = this.width + 'px';
+ DOMutil.cleanupElements(this.DOMelements.lines);
+ DOMutil.cleanupElements(this.DOMelements.labels);
+ this.redraw();
+ resized = true;
+ }
+ // this will resize the yAxis if it is too big for the labels.
+ else if (this.maxLabelSize < this.width - offset && this.options.visible === true && this.width > this.minWidth) {
+ this.width = Math.max(this.minWidth, this.maxLabelSize + offset);
+ this.options.width = this.width + 'px';
+ DOMutil.cleanupElements(this.DOMelements.lines);
+ DOMutil.cleanupElements(this.DOMelements.labels);
+ this.redraw();
+ resized = true;
+ } else {
+ DOMutil.cleanupElements(this.DOMelements.lines);
+ DOMutil.cleanupElements(this.DOMelements.labels);
+ resized = false;
+ }
+
+ return resized;
+ };
+
+ DataAxis.prototype.convertValue = function (value) {
+ var invertedValue = this.valueAtBottom - value;
+ var convertedValue = invertedValue * this.conversionFactor;
+ return convertedValue;
+ };
+
+ DataAxis.prototype.screenToValue = function (x) {
+ return this.valueAtBottom - x / this.conversionFactor;
+ };
+
+ /**
+ * Create a label for the axis at position x
+ * @private
+ * @param y
+ * @param text
+ * @param orientation
+ * @param className
+ * @param characterHeight
+ */
+ DataAxis.prototype._redrawLabel = function (y, text, orientation, className, characterHeight) {
+ // reuse redundant label
+ var label = DOMutil.getDOMElement('div', this.DOMelements.labels, this.dom.frame); //this.dom.redundant.labels.shift();
+ label.className = className;
+ label.innerHTML = text;
+ if (orientation === 'left') {
+ label.style.left = '-' + this.options.labelOffsetX + 'px';
+ label.style.textAlign = 'right';
+ } else {
+ label.style.right = '-' + this.options.labelOffsetX + 'px';
+ label.style.textAlign = 'left';
+ }
+
+ label.style.top = y - 0.5 * characterHeight + this.options.labelOffsetY + 'px';
+
+ text += '';
+
+ var largestWidth = Math.max(this.props.majorCharWidth, this.props.minorCharWidth);
+ if (this.maxLabelSize < text.length * largestWidth) {
+ this.maxLabelSize = text.length * largestWidth;
+ }
+ };
+
+ /**
+ * Create a minor line for the axis at position y
+ * @param y
+ * @param orientation
+ * @param className
+ * @param offset
+ * @param width
+ */
+ DataAxis.prototype._redrawLine = function (y, orientation, className, offset, width) {
+ if (this.master === true) {
+ var line = DOMutil.getDOMElement('div', this.DOMelements.lines, this.dom.lineContainer); //this.dom.redundant.lines.shift();
+ line.className = className;
+ line.innerHTML = '';
+
+ if (orientation === 'left') {
+ line.style.left = this.width - offset + 'px';
+ } else {
+ line.style.right = this.width - offset + 'px';
+ }
+
+ line.style.width = width + 'px';
+ line.style.top = y + 'px';
+ }
+ };
+
+ /**
+ * Create a title for the axis
+ * @private
+ * @param orientation
+ */
+ DataAxis.prototype._redrawTitle = function (orientation) {
+ DOMutil.prepareElements(this.DOMelements.title);
+
+ // Check if the title is defined for this axes
+ if (this.options[orientation].title !== undefined && this.options[orientation].title.text !== undefined) {
+ var title = DOMutil.getDOMElement('div', this.DOMelements.title, this.dom.frame);
+ title.className = 'vis-y-axis vis-title vis-' + orientation;
+ title.innerHTML = this.options[orientation].title.text;
+
+ // Add style - if provided
+ if (this.options[orientation].title.style !== undefined) {
+ util.addCssText(title, this.options[orientation].title.style);
+ }
+
+ if (orientation === 'left') {
+ title.style.left = this.props.titleCharHeight + 'px';
+ } else {
+ title.style.right = this.props.titleCharHeight + 'px';
+ }
+
+ title.style.width = this.height + 'px';
+ }
+
+ // we need to clean up in case we did not use all elements.
+ DOMutil.cleanupElements(this.DOMelements.title);
+ };
+
+ /**
+ * Determine the size of text on the axis (both major and minor axis).
+ * The size is calculated only once and then cached in this.props.
+ * @private
+ */
+ DataAxis.prototype._calculateCharSize = function () {
+ // determine the char width and height on the minor axis
+ if (!('minorCharHeight' in this.props)) {
+ var textMinor = document.createTextNode('0');
+ var measureCharMinor = document.createElement('div');
+ measureCharMinor.className = 'vis-y-axis vis-minor vis-measure';
+ measureCharMinor.appendChild(textMinor);
+ this.dom.frame.appendChild(measureCharMinor);
+
+ this.props.minorCharHeight = measureCharMinor.clientHeight;
+ this.props.minorCharWidth = measureCharMinor.clientWidth;
+
+ this.dom.frame.removeChild(measureCharMinor);
+ }
+
+ if (!('majorCharHeight' in this.props)) {
+ var textMajor = document.createTextNode('0');
+ var measureCharMajor = document.createElement('div');
+ measureCharMajor.className = 'vis-y-axis vis-major vis-measure';
+ measureCharMajor.appendChild(textMajor);
+ this.dom.frame.appendChild(measureCharMajor);
+
+ this.props.majorCharHeight = measureCharMajor.clientHeight;
+ this.props.majorCharWidth = measureCharMajor.clientWidth;
+
+ this.dom.frame.removeChild(measureCharMajor);
+ }
+
+ if (!('titleCharHeight' in this.props)) {
+ var textTitle = document.createTextNode('0');
+ var measureCharTitle = document.createElement('div');
+ measureCharTitle.className = 'vis-y-axis vis-title vis-measure';
+ measureCharTitle.appendChild(textTitle);
+ this.dom.frame.appendChild(measureCharTitle);
+
+ this.props.titleCharHeight = measureCharTitle.clientHeight;
+ this.props.titleCharWidth = measureCharTitle.clientWidth;
+
+ this.dom.frame.removeChild(measureCharTitle);
+ }
+ };
+
+ module.exports = DataAxis;
+
+/***/ },
+/* 52 */
+/***/ function(module, exports) {
+
+ /**
+ * @constructor DataStep
+ * The class DataStep is an iterator for data for the lineGraph. You provide a start data point and an
+ * end data point. The class itself determines the best scale (step size) based on the
+ * provided start Date, end Date, and minimumStep.
+ *
+ * If minimumStep is provided, the step size is chosen as close as possible
+ * to the minimumStep but larger than minimumStep. If minimumStep is not
+ * provided, the scale is set to 1 DAY.
+ * The minimumStep should correspond with the onscreen size of about 6 characters
+ *
+ * Alternatively, you can set a scale by hand.
+ * After creation, you can initialize the class by executing first(). Then you
+ * can iterate from the start date to the end date via next(). You can check if
+ * the end date is reached with the function hasNext(). After each step, you can
+ * retrieve the current date via getCurrent().
+ * The DataStep has scales ranging from milliseconds, seconds, minutes, hours,
+ * days, to years.
+ *
+ * Version: 1.2
+ *
+ * @param {Date} [start] The start date, for example new Date(2010, 9, 21)
+ * or new Date(2010, 9, 21, 23, 45, 00)
+ * @param {Date} [end] The end date
+ * @param {Number} [minimumStep] Optional. Minimum step size in milliseconds
+ */
+ 'use strict';
+
+ function DataStep(start, end, minimumStep, containerHeight, customRange, formattingFunction, alignZeros) {
+ // variables
+ this.current = 0;
+
+ this.autoScale = true;
+ this.stepIndex = 0;
+ this.step = 1;
+ this.scale = 1;
+ this.formattingFunction = formattingFunction;
+
+ this.marginStart;
+ this.marginEnd;
+ this.deadSpace = 0;
+
+ this.majorSteps = [1, 2, 5, 10];
+ this.minorSteps = [0.25, 0.5, 1, 2];
+
+ this.alignZeros = alignZeros;
+
+ this.setRange(start, end, minimumStep, containerHeight, customRange);
+ }
+
+ /**
+ * Set a new range
+ * If minimumStep is provided, the step size is chosen as close as possible
+ * to the minimumStep but larger than minimumStep. If minimumStep is not
+ * provided, the scale is set to 1 DAY.
+ * The minimumStep should correspond with the onscreen size of about 6 characters
+ * @param {Number} [start] The start date and time.
+ * @param {Number} [end] The end date and time.
+ * @param {Number} [minimumStep] Optional. Minimum step size in milliseconds
+ */
+ DataStep.prototype.setRange = function (start, end, minimumStep, containerHeight, customRange) {
+ this._start = customRange.min === undefined ? start : customRange.min;
+ this._end = customRange.max === undefined ? end : customRange.max;
+ if (this._start === this._end) {
+ this._start = customRange.min === undefined ? this._start - 0.75 : this._start;
+ this._end = customRange.max === undefined ? this._end + 1 : this._end;;
+ }
+
+ if (this.autoScale === true) {
+ this.setMinimumStep(minimumStep, containerHeight);
+ }
+
+ this.setFirst(customRange);
+ };
+
+ /**
+ * Automatically determine the scale that bests fits the provided minimum step
+ * @param {Number} [minimumStep] The minimum step size in pixels
+ */
+ DataStep.prototype.setMinimumStep = function (minimumStep, containerHeight) {
+ // round to floor
+ var range = this._end - this._start;
+ var safeRange = range * 1.2;
+ var minimumStepValue = minimumStep * (safeRange / containerHeight);
+ var orderOfMagnitude = Math.round(Math.log(safeRange) / Math.LN10);
+
+ var minorStepIdx = -1;
+ var magnitudefactor = Math.pow(10, orderOfMagnitude);
+
+ var start = 0;
+ if (orderOfMagnitude < 0) {
+ start = orderOfMagnitude;
+ }
+
+ var solutionFound = false;
+ for (var i = start; Math.abs(i) <= Math.abs(orderOfMagnitude); i++) {
+ magnitudefactor = Math.pow(10, i);
+ for (var j = 0; j < this.minorSteps.length; j++) {
+ var stepSize = magnitudefactor * this.minorSteps[j];
+ if (stepSize >= minimumStepValue) {
+ solutionFound = true;
+ minorStepIdx = j;
+ break;
+ }
+ }
+ if (solutionFound === true) {
+ break;
+ }
+ }
+ this.stepIndex = minorStepIdx;
+ this.scale = magnitudefactor;
+ this.step = magnitudefactor * this.minorSteps[minorStepIdx];
+ };
+
+ /**
+ * Round the current date to the first minor date value
+ * This must be executed once when the current date is set to start Date
+ */
+ DataStep.prototype.setFirst = function (customRange) {
+ if (customRange === undefined) {
+ customRange = {};
+ }
+
+ var niceStart = customRange.min === undefined ? this._start - this.scale * 2 * this.minorSteps[this.stepIndex] : customRange.min;
+ var niceEnd = customRange.max === undefined ? this._end + this.scale * this.minorSteps[this.stepIndex] : customRange.max;
+
+ this.marginEnd = customRange.max === undefined ? this.roundToMinor(niceEnd) : customRange.max;
+ this.marginStart = customRange.min === undefined ? this.roundToMinor(niceStart) : customRange.min;
+
+ // if we need to align the zero's we need to make sure that there is a zero to use.
+ if (this.alignZeros === true && (this.marginEnd - this.marginStart) % this.step != 0) {
+ this.marginEnd += this.marginEnd % this.step;
+ }
+
+ this.deadSpace = this.roundToMinor(niceEnd) - niceEnd + this.roundToMinor(niceStart) - niceStart;
+ this.marginRange = this.marginEnd - this.marginStart;
+
+ this.current = this.marginEnd;
+ };
+
+ DataStep.prototype.roundToMinor = function (value) {
+ var rounded = value - value % (this.scale * this.minorSteps[this.stepIndex]);
+ if (value % (this.scale * this.minorSteps[this.stepIndex]) > 0.5 * (this.scale * this.minorSteps[this.stepIndex])) {
+ return rounded + this.scale * this.minorSteps[this.stepIndex];
+ } else {
+ return rounded;
+ }
+ };
+
+ /**
+ * Check if the there is a next step
+ * @return {boolean} true if the current date has not passed the end date
+ */
+ DataStep.prototype.hasNext = function () {
+ return this.current >= this.marginStart;
+ };
+
+ /**
+ * Do the next step
+ */
+ DataStep.prototype.next = function () {
+ var prev = this.current;
+ this.current -= this.step;
+
+ // safety mechanism: if current time is still unchanged, move to the end
+ if (this.current === prev) {
+ this.current = this._end;
+ }
+ };
+
+ /**
+ * Do the next step
+ */
+ DataStep.prototype.previous = function () {
+ this.current += this.step;
+ this.marginEnd += this.step;
+ this.marginRange = this.marginEnd - this.marginStart;
+ };
+
+ /**
+ * Get the current datetime
+ * @return {String} current The current date
+ */
+ DataStep.prototype.getCurrent = function () {
+ // prevent round-off errors when close to zero
+ var current = Math.abs(this.current) < this.step / 2 ? 0 : this.current;
+ var returnValue = current.toPrecision(5);
+ if (typeof this.formattingFunction === 'function') {
+ returnValue = this.formattingFunction(current);
+ }
+
+ if (typeof returnValue === 'number') {
+ return '' + returnValue;
+ } else if (typeof returnValue === 'string') {
+ return returnValue;
+ } else {
+ return current.toPrecision(5);
+ }
+ };
+
+ /**
+ * Check if the current value is a major value (for example when the step
+ * is DAY, a major value is each first day of the MONTH)
+ * @return {boolean} true if current date is major, else false.
+ */
+ DataStep.prototype.isMajor = function () {
+ return this.current % (this.scale * this.majorSteps[this.stepIndex]) === 0;
+ };
+
+ DataStep.prototype.shift = function (steps) {
+ if (steps < 0) {
+ for (var i = 0; i < -steps; i++) {
+ this.previous();
+ }
+ } else if (steps > 0) {
+ for (var i = 0; i < steps; i++) {
+ this.next();
+ }
+ }
+ };
+
+ module.exports = DataStep;
+
+/***/ },
+/* 53 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var DOMutil = __webpack_require__(7);
+ var Line = __webpack_require__(54);
+ var Bar = __webpack_require__(56);
+ var Points = __webpack_require__(55);
+
+ /**
+ * /**
+ * @param {object} group | the object of the group from the dataset
+ * @param {string} groupId | ID of the group
+ * @param {object} options | the default options
+ * @param {array} groupsUsingDefaultStyles | this array has one entree.
+ * It is passed as an array so it is passed by reference.
+ * It enumerates through the default styles
+ * @constructor
+ */
+ function GraphGroup(group, groupId, options, groupsUsingDefaultStyles) {
+ this.id = groupId;
+ var fields = ['sampling', 'style', 'sort', 'yAxisOrientation', 'barChart', 'drawPoints', 'shaded', 'interpolation'];
+ this.options = util.selectiveBridgeObject(fields, options);
+ this.usingDefaultStyle = group.className === undefined;
+ this.groupsUsingDefaultStyles = groupsUsingDefaultStyles;
+ this.zeroPosition = 0;
+ this.update(group);
+ if (this.usingDefaultStyle == true) {
+ this.groupsUsingDefaultStyles[0] += 1;
+ }
+ this.itemsData = [];
+ this.visible = group.visible === undefined ? true : group.visible;
+ }
+
+ /**
+ * this loads a reference to all items in this group into this group.
+ * @param {array} items
+ */
+ GraphGroup.prototype.setItems = function (items) {
+ if (items != null) {
+ this.itemsData = items;
+ if (this.options.sort == true) {
+ this.itemsData.sort(function (a, b) {
+ return a.x - b.x;
+ });
+ }
+ // typecast all items to numbers. Takes around 10ms for 500.000 items
+ for (var i = 0; i < this.itemsData.length; i++) {
+ this.itemsData[i].y = Number(this.itemsData[i].y);
+ }
+ } else {
+ this.itemsData = [];
+ }
+ };
+
+ /**
+ * this is used for plotting barcharts, this way, we only have to calculate it once.
+ * @param pos
+ */
+ GraphGroup.prototype.setZeroPosition = function (pos) {
+ this.zeroPosition = pos;
+ };
+
+ /**
+ * set the options of the graph group over the default options.
+ * @param options
+ */
+ GraphGroup.prototype.setOptions = function (options) {
+ if (options !== undefined) {
+ var fields = ['sampling', 'style', 'sort', 'yAxisOrientation', 'barChart', 'excludeFromLegend'];
+ util.selectiveDeepExtend(fields, this.options, options);
+
+ // if the group's drawPoints is a function delegate the callback to the onRender property
+ if (typeof options.drawPoints == 'function') {
+ options.drawPoints = {
+ onRender: options.drawPoints
+ };
+ }
+
+ util.mergeOptions(this.options, options, 'interpolation');
+ util.mergeOptions(this.options, options, 'drawPoints');
+ util.mergeOptions(this.options, options, 'shaded');
+
+ if (options.interpolation) {
+ if (typeof options.interpolation == 'object') {
+ if (options.interpolation.parametrization) {
+ if (options.interpolation.parametrization == 'uniform') {
+ this.options.interpolation.alpha = 0;
+ } else if (options.interpolation.parametrization == 'chordal') {
+ this.options.interpolation.alpha = 1.0;
+ } else {
+ this.options.interpolation.parametrization = 'centripetal';
+ this.options.interpolation.alpha = 0.5;
+ }
+ }
+ }
+ }
+ }
+
+ if (this.options.style == 'line') {
+ this.type = new Line(this.id, this.options);
+ } else if (this.options.style == 'bar') {
+ this.type = new Bar(this.id, this.options);
+ } else if (this.options.style == 'points') {
+ this.type = new Points(this.id, this.options);
+ }
+ };
+
+ /**
+ * this updates the current group class with the latest group dataset entree, used in _updateGroup in linegraph
+ * @param group
+ */
+ GraphGroup.prototype.update = function (group) {
+ this.group = group;
+ this.content = group.content || 'graph';
+ this.className = group.className || this.className || 'vis-graph-group' + this.groupsUsingDefaultStyles[0] % 10;
+ this.visible = group.visible === undefined ? true : group.visible;
+ this.style = group.style;
+ this.setOptions(group.options);
+ };
+
+ /**
+ * draw the icon for the legend.
+ *
+ * @param x
+ * @param y
+ * @param JSONcontainer
+ * @param SVGcontainer
+ * @param iconWidth
+ * @param iconHeight
+ */
+ GraphGroup.prototype.drawIcon = function (x, y, JSONcontainer, SVGcontainer, iconWidth, iconHeight) {
+ var fillHeight = iconHeight * 0.5;
+ var path, fillPath;
+
+ var outline = DOMutil.getSVGElement('rect', JSONcontainer, SVGcontainer);
+ outline.setAttributeNS(null, 'x', x);
+ outline.setAttributeNS(null, 'y', y - fillHeight);
+ outline.setAttributeNS(null, 'width', iconWidth);
+ outline.setAttributeNS(null, 'height', 2 * fillHeight);
+ outline.setAttributeNS(null, 'class', 'vis-outline');
+
+ if (this.options.style == 'line') {
+ path = DOMutil.getSVGElement('path', JSONcontainer, SVGcontainer);
+ path.setAttributeNS(null, 'class', this.className);
+ if (this.style !== undefined) {
+ path.setAttributeNS(null, 'style', this.style);
+ }
+
+ path.setAttributeNS(null, 'd', 'M' + x + ',' + y + ' L' + (x + iconWidth) + ',' + y + '');
+ if (this.options.shaded.enabled == true) {
+ fillPath = DOMutil.getSVGElement('path', JSONcontainer, SVGcontainer);
+ if (this.options.shaded.orientation == 'top') {
+ fillPath.setAttributeNS(null, 'd', 'M' + x + ', ' + (y - fillHeight) + 'L' + x + ',' + y + ' L' + (x + iconWidth) + ',' + y + ' L' + (x + iconWidth) + ',' + (y - fillHeight));
+ } else {
+ fillPath.setAttributeNS(null, 'd', 'M' + x + ',' + y + ' ' + 'L' + x + ',' + (y + fillHeight) + ' ' + 'L' + (x + iconWidth) + ',' + (y + fillHeight) + 'L' + (x + iconWidth) + ',' + y);
+ }
+ fillPath.setAttributeNS(null, 'class', this.className + ' vis-icon-fill');
+ }
+
+ if (this.options.drawPoints.enabled == true) {
+ var groupTemplate = {
+ style: this.options.drawPoints.style,
+ styles: this.options.drawPoints.styles,
+ size: this.options.drawPoints.size,
+ className: this.className
+ };
+ DOMutil.drawPoint(x + 0.5 * iconWidth, y, groupTemplate, JSONcontainer, SVGcontainer);
+ }
+ } else {
+ var barWidth = Math.round(0.3 * iconWidth);
+ var bar1Height = Math.round(0.4 * iconHeight);
+ var bar2Height = Math.round(0.75 * iconHeight);
+
+ var offset = Math.round((iconWidth - 2 * barWidth) / 3);
+
+ DOMutil.drawBar(x + 0.5 * barWidth + offset, y + fillHeight - bar1Height - 1, barWidth, bar1Height, this.className + ' vis-bar', JSONcontainer, SVGcontainer, this.style);
+ DOMutil.drawBar(x + 1.5 * barWidth + offset + 2, y + fillHeight - bar2Height - 1, barWidth, bar2Height, this.className + ' vis-bar', JSONcontainer, SVGcontainer, this.style);
+ }
+ };
+
+ /**
+ * return the legend entree for this group.
+ *
+ * @param iconWidth
+ * @param iconHeight
+ * @returns {{icon: HTMLElement, label: (group.content|*|string), orientation: (.options.yAxisOrientation|*)}}
+ */
+ GraphGroup.prototype.getLegend = function (iconWidth, iconHeight) {
+ var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
+ this.drawIcon(0, 0.5 * iconHeight, [], svg, iconWidth, iconHeight);
+ return { icon: svg, label: this.content, orientation: this.options.yAxisOrientation };
+ };
+
+ GraphGroup.prototype.getYRange = function (groupData) {
+ return this.type.getYRange(groupData);
+ };
+
+ GraphGroup.prototype.getData = function (groupData) {
+ return this.type.getData(groupData);
+ };
+
+ GraphGroup.prototype.draw = function (dataset, group, framework) {
+ this.type.draw(dataset, group, framework);
+ };
+
+ module.exports = GraphGroup;
+
+/***/ },
+/* 54 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var DOMutil = __webpack_require__(7);
+ var Points = __webpack_require__(55);
+
+ function Line(groupId, options) {
+ this.groupId = groupId;
+ this.options = options;
+ }
+
+ Line.prototype.getData = function (groupData) {
+ var combinedData = [];
+ for (var j = 0; j < groupData.length; j++) {
+ combinedData.push({
+ x: groupData[j].x,
+ y: groupData[j].y,
+ groupId: this.groupId
+ });
+ }
+ return combinedData;
+ };
+
+ Line.prototype.getYRange = function (groupData) {
+ var yMin = groupData[0].y;
+ var yMax = groupData[0].y;
+ for (var j = 0; j < groupData.length; j++) {
+ yMin = yMin > groupData[j].y ? groupData[j].y : yMin;
+ yMax = yMax < groupData[j].y ? groupData[j].y : yMax;
+ }
+ return { min: yMin, max: yMax, yAxisOrientation: this.options.yAxisOrientation };
+ };
+
+ Line.getStackedYRange = function (combinedData, groupRanges, groupIds, groupLabel, orientation) {
+ if (combinedData.length > 0) {
+ // sort by time and by group
+ combinedData.sort(function (a, b) {
+ if (a.x === b.x) {
+ return a.groupId < b.groupId ? -1 : 1;
+ } else {
+ return a.x - b.x;
+ }
+ });
+ var intersections = {};
+
+ Line._getDataIntersections(intersections, combinedData);
+ groupRanges[groupLabel] = Line._getStackedYRange(intersections, combinedData);
+ groupRanges[groupLabel].yAxisOrientation = orientation;
+ groupIds.push(groupLabel);
+ }
+ };
+
+ Line._getStackedYRange = function (intersections, combinedData) {
+ var key;
+ var yMin = combinedData[0].y;
+ var yMax = combinedData[0].y;
+ for (var i = 0; i < combinedData.length; i++) {
+ key = combinedData[i].x;
+ if (intersections[key] === undefined) {
+ yMin = yMin > combinedData[i].y ? combinedData[i].y : yMin;
+ yMax = yMax < combinedData[i].y ? combinedData[i].y : yMax;
+ } else {
+ if (combinedData[i].y < 0) {
+ intersections[key].accumulatedNegative += combinedData[i].y;
+ } else {
+ intersections[key].accumulatedPositive += combinedData[i].y;
+ }
+ }
+ }
+ for (var xpos in intersections) {
+ if (intersections.hasOwnProperty(xpos)) {
+ yMin = yMin > intersections[xpos].accumulatedNegative ? intersections[xpos].accumulatedNegative : yMin;
+ yMin = yMin > intersections[xpos].accumulatedPositive ? intersections[xpos].accumulatedPositive : yMin;
+ yMax = yMax < intersections[xpos].accumulatedNegative ? intersections[xpos].accumulatedNegative : yMax;
+ yMax = yMax < intersections[xpos].accumulatedPositive ? intersections[xpos].accumulatedPositive : yMax;
+ }
+ }
+
+ return { min: yMin, max: yMax };
+ };
+
+ /**
+ * Fill the intersections object with counters of how many datapoints share the same x coordinates
+ * @param intersections
+ * @param combinedData
+ * @private
+ */
+ Line._getDataIntersections = function (intersections, combinedData) {
+ // get intersections
+ var coreDistance;
+ for (var i = 0; i < combinedData.length; i++) {
+ if (i + 1 < combinedData.length) {
+ coreDistance = Math.abs(combinedData[i + 1].x - combinedData[i].x);
+ }
+ if (i > 0) {
+ coreDistance = Math.min(coreDistance, Math.abs(combinedData[i - 1].x - combinedData[i].x));
+ }
+ if (coreDistance === 0) {
+ if (intersections[combinedData[i].x] === undefined) {
+ intersections[combinedData[i].x] = { amount: 0, resolved: 0, accumulatedPositive: 0, accumulatedNegative: 0 };
+ }
+ intersections[combinedData[i].x].amount += 1;
+ }
+ }
+ };
+
+ /**
+ * draw a line graph
+ *
+ * @param dataset
+ * @param group
+ */
+ Line.prototype.draw = function (dataset, group, framework) {
+ if (dataset != null) {
+ if (dataset.length > 0) {
+ var path, d;
+ var svgHeight = Number(framework.svg.style.height.replace('px', ''));
+ path = DOMutil.getSVGElement('path', framework.svgElements, framework.svg);
+ path.setAttributeNS(null, 'class', group.className);
+ if (group.style !== undefined) {
+ path.setAttributeNS(null, 'style', group.style);
+ }
+
+ // construct path from dataset
+ if (group.options.interpolation.enabled == true) {
+ d = Line._catmullRom(dataset, group);
+ } else {
+ d = Line._linear(dataset);
+ }
+
+ // append with points for fill and finalize the path
+ if (group.options.shaded.enabled == true) {
+ var fillPath = DOMutil.getSVGElement('path', framework.svgElements, framework.svg);
+ var dFill;
+ if (group.options.shaded.orientation == 'top') {
+ dFill = 'M' + dataset[0].x + ',' + 0 + ' ' + d + 'L' + dataset[dataset.length - 1].x + ',' + 0;
+ } else {
+ dFill = 'M' + dataset[0].x + ',' + svgHeight + ' ' + d + 'L' + dataset[dataset.length - 1].x + ',' + svgHeight;
+ }
+ fillPath.setAttributeNS(null, 'class', group.className + ' vis-fill');
+ if (group.options.shaded.style !== undefined) {
+ fillPath.setAttributeNS(null, 'style', group.options.shaded.style);
+ }
+ fillPath.setAttributeNS(null, 'd', dFill);
+ }
+ // copy properties to path for drawing.
+ path.setAttributeNS(null, 'd', 'M' + d);
+
+ // draw points
+ if (group.options.drawPoints.enabled == true) {
+ Points.draw(dataset, group, framework);
+ }
+ }
+ }
+ };
+
+ /**
+ * This uses an uniform parametrization of the interpolation algorithm:
+ * 'On the Parameterization of Catmull-Rom Curves' by Cem Yuksel et al.
+ * @param data
+ * @returns {string}
+ * @private
+ */
+ Line._catmullRomUniform = function (data) {
+ // catmull rom
+ var p0, p1, p2, p3, bp1, bp2;
+ var d = Math.round(data[0].x) + ',' + Math.round(data[0].y) + ' ';
+ var normalization = 1 / 6;
+ var length = data.length;
+ for (var i = 0; i < length - 1; i++) {
+
+ p0 = i == 0 ? data[0] : data[i - 1];
+ p1 = data[i];
+ p2 = data[i + 1];
+ p3 = i + 2 < length ? data[i + 2] : p2;
+
+ // Catmull-Rom to Cubic Bezier conversion matrix
+ // 0 1 0 0
+ // -1/6 1 1/6 0
+ // 0 1/6 1 -1/6
+ // 0 0 1 0
+
+ // bp0 = { x: p1.x, y: p1.y };
+ bp1 = { x: (-p0.x + 6 * p1.x + p2.x) * normalization, y: (-p0.y + 6 * p1.y + p2.y) * normalization };
+ bp2 = { x: (p1.x + 6 * p2.x - p3.x) * normalization, y: (p1.y + 6 * p2.y - p3.y) * normalization };
+ // bp0 = { x: p2.x, y: p2.y };
+
+ d += 'C' + bp1.x + ',' + bp1.y + ' ' + bp2.x + ',' + bp2.y + ' ' + p2.x + ',' + p2.y + ' ';
+ }
+
+ return d;
+ };
+
+ /**
+ * This uses either the chordal or centripetal parameterization of the catmull-rom algorithm.
+ * By default, the centripetal parameterization is used because this gives the nicest results.
+ * These parameterizations are relatively heavy because the distance between 4 points have to be calculated.
+ *
+ * One optimization can be used to reuse distances since this is a sliding window approach.
+ * @param data
+ * @param group
+ * @returns {string}
+ * @private
+ */
+ Line._catmullRom = function (data, group) {
+ var alpha = group.options.interpolation.alpha;
+ if (alpha == 0 || alpha === undefined) {
+ return this._catmullRomUniform(data);
+ } else {
+ var p0, p1, p2, p3, bp1, bp2, d1, d2, d3, A, B, N, M;
+ var d3powA, d2powA, d3pow2A, d2pow2A, d1pow2A, d1powA;
+ var d = Math.round(data[0].x) + ',' + Math.round(data[0].y) + ' ';
+ var length = data.length;
+ for (var i = 0; i < length - 1; i++) {
+
+ p0 = i == 0 ? data[0] : data[i - 1];
+ p1 = data[i];
+ p2 = data[i + 1];
+ p3 = i + 2 < length ? data[i + 2] : p2;
+
+ d1 = Math.sqrt(Math.pow(p0.x - p1.x, 2) + Math.pow(p0.y - p1.y, 2));
+ d2 = Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
+ d3 = Math.sqrt(Math.pow(p2.x - p3.x, 2) + Math.pow(p2.y - p3.y, 2));
+
+ // Catmull-Rom to Cubic Bezier conversion matrix
+
+ // A = 2d1^2a + 3d1^a * d2^a + d3^2a
+ // B = 2d3^2a + 3d3^a * d2^a + d2^2a
+
+ // [ 0 1 0 0 ]
+ // [ -d2^2a /N A/N d1^2a /N 0 ]
+ // [ 0 d3^2a /M B/M -d2^2a /M ]
+ // [ 0 0 1 0 ]
+
+ d3powA = Math.pow(d3, alpha);
+ d3pow2A = Math.pow(d3, 2 * alpha);
+ d2powA = Math.pow(d2, alpha);
+ d2pow2A = Math.pow(d2, 2 * alpha);
+ d1powA = Math.pow(d1, alpha);
+ d1pow2A = Math.pow(d1, 2 * alpha);
+
+ A = 2 * d1pow2A + 3 * d1powA * d2powA + d2pow2A;
+ B = 2 * d3pow2A + 3 * d3powA * d2powA + d2pow2A;
+ N = 3 * d1powA * (d1powA + d2powA);
+ if (N > 0) {
+ N = 1 / N;
+ }
+ M = 3 * d3powA * (d3powA + d2powA);
+ if (M > 0) {
+ M = 1 / M;
+ }
+
+ bp1 = { x: (-d2pow2A * p0.x + A * p1.x + d1pow2A * p2.x) * N,
+ y: (-d2pow2A * p0.y + A * p1.y + d1pow2A * p2.y) * N };
+
+ bp2 = { x: (d3pow2A * p1.x + B * p2.x - d2pow2A * p3.x) * M,
+ y: (d3pow2A * p1.y + B * p2.y - d2pow2A * p3.y) * M };
+
+ if (bp1.x == 0 && bp1.y == 0) {
+ bp1 = p1;
+ }
+ if (bp2.x == 0 && bp2.y == 0) {
+ bp2 = p2;
+ }
+ d += 'C' + bp1.x + ',' + bp1.y + ' ' + bp2.x + ',' + bp2.y + ' ' + p2.x + ',' + p2.y + ' ';
+ }
+
+ return d;
+ }
+ };
+
+ /**
+ * this generates the SVG path for a linear drawing between datapoints.
+ * @param data
+ * @returns {string}
+ * @private
+ */
+ Line._linear = function (data) {
+ // linear
+ var d = '';
+ for (var i = 0; i < data.length; i++) {
+ if (i == 0) {
+ d += data[i].x + ',' + data[i].y;
+ } else {
+ d += ' ' + data[i].x + ',' + data[i].y;
+ }
+ }
+ return d;
+ };
+
+ module.exports = Line;
+
+/***/ },
+/* 55 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var DOMutil = __webpack_require__(7);
+
+ function Points(groupId, options) {
+ this.groupId = groupId;
+ this.options = options;
+ }
+
+ Points.prototype.getYRange = function (groupData) {
+ var yMin = groupData[0].y;
+ var yMax = groupData[0].y;
+ for (var j = 0; j < groupData.length; j++) {
+ yMin = yMin > groupData[j].y ? groupData[j].y : yMin;
+ yMax = yMax < groupData[j].y ? groupData[j].y : yMax;
+ }
+ return { min: yMin, max: yMax, yAxisOrientation: this.options.yAxisOrientation };
+ };
+
+ Points.prototype.draw = function (dataset, group, framework, offset) {
+ Points.draw(dataset, group, framework, offset);
+ };
+
+ /**
+ * draw the data points
+ *
+ * @param {Array} dataset
+ * @param {Object} JSONcontainer
+ * @param {Object} svg | SVG DOM element
+ * @param {GraphGroup} group
+ * @param {Number} [offset]
+ */
+ Points.draw = function (dataset, group, framework, offset) {
+ offset = offset || 0;
+ var callback = getCallback();
+
+ for (var i = 0; i < dataset.length; i++) {
+ if (!callback) {
+ // draw the point the simple way.
+ DOMutil.drawPoint(dataset[i].x + offset, dataset[i].y, getGroupTemplate(), framework.svgElements, framework.svg, dataset[i].label);
+ } else {
+ var callbackResult = callback(dataset[i], group, framework); // result might be true, false or an object
+ if (callbackResult === true || typeof callbackResult === 'object') {
+ DOMutil.drawPoint(dataset[i].x + offset, dataset[i].y, getGroupTemplate(callbackResult), framework.svgElements, framework.svg, dataset[i].label);
+ }
+ }
+ }
+
+ function getGroupTemplate(callbackResult) {
+ callbackResult = typeof callbackResult === 'undefined' ? {} : callbackResult;
+ return {
+ style: callbackResult.style || group.options.drawPoints.style,
+ styles: callbackResult.styles || group.options.drawPoints.styles,
+ size: callbackResult.size || group.options.drawPoints.size,
+ className: callbackResult.className || group.className
+ };
+ }
+
+ function getCallback() {
+ var callback = undefined;
+ // check for the graph2d onRender
+ if (framework.options.drawPoints.onRender && typeof framework.options.drawPoints.onRender == 'function') {
+ callback = framework.options.drawPoints.onRender;
+ }
+
+ // override it with the group onRender if defined
+ if (group.group.options && group.group.options.drawPoints && group.group.options.drawPoints.onRender && typeof group.group.options.drawPoints.onRender == 'function') {
+ callback = group.group.options.drawPoints.onRender;
+ }
+
+ return callback;
+ }
+ };
+
+ module.exports = Points;
+
+/***/ },
+/* 56 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var DOMutil = __webpack_require__(7);
+ var Points = __webpack_require__(55);
+
+ function Bargraph(groupId, options) {
+ this.groupId = groupId;
+ this.options = options;
+ }
+
+ Bargraph.prototype.getYRange = function (groupData) {
+ var yMin = groupData[0].y;
+ var yMax = groupData[0].y;
+ for (var j = 0; j < groupData.length; j++) {
+ yMin = yMin > groupData[j].y ? groupData[j].y : yMin;
+ yMax = yMax < groupData[j].y ? groupData[j].y : yMax;
+ }
+ return { min: yMin, max: yMax, yAxisOrientation: this.options.yAxisOrientation };
+ };
+
+ Bargraph.prototype.getData = function (groupData) {
+ var combinedData = [];
+ for (var j = 0; j < groupData.length; j++) {
+ combinedData.push({
+ x: groupData[j].x,
+ y: groupData[j].y,
+ groupId: this.groupId
+ });
+ }
+ return combinedData;
+ };
+
+ /**
+ * draw a bar graph
+ *
+ * @param groupIds
+ * @param processedGroupData
+ */
+ Bargraph.draw = function (groupIds, processedGroupData, framework) {
+ var combinedData = [];
+ var intersections = {};
+ var coreDistance;
+ var key, drawData;
+ var group;
+ var i, j;
+ var barPoints = 0;
+
+ // combine all barchart data
+ for (i = 0; i < groupIds.length; i++) {
+ group = framework.groups[groupIds[i]];
+ if (group.options.style === 'bar') {
+ if (group.visible === true && (framework.options.groups.visibility[groupIds[i]] === undefined || framework.options.groups.visibility[groupIds[i]] === true)) {
+ for (j = 0; j < processedGroupData[groupIds[i]].length; j++) {
+ combinedData.push({
+ x: processedGroupData[groupIds[i]][j].x,
+ y: processedGroupData[groupIds[i]][j].y,
+ groupId: groupIds[i],
+ label: processedGroupData[groupIds[i]][j].label
+ });
+ barPoints += 1;
+ }
+ }
+ }
+ }
+
+ if (barPoints === 0) {
+ return;
+ }
+
+ // sort by time and by group
+ combinedData.sort(function (a, b) {
+ if (a.x === b.x) {
+ return a.groupId < b.groupId ? -1 : 1;
+ } else {
+ return a.x - b.x;
+ }
+ });
+
+ // get intersections
+ Bargraph._getDataIntersections(intersections, combinedData);
+
+ // plot barchart
+ for (i = 0; i < combinedData.length; i++) {
+ group = framework.groups[combinedData[i].groupId];
+ var minWidth = 0.1 * group.options.barChart.width;
+
+ key = combinedData[i].x;
+ var heightOffset = 0;
+ if (intersections[key] === undefined) {
+ if (i + 1 < combinedData.length) {
+ coreDistance = Math.abs(combinedData[i + 1].x - key);
+ }
+ if (i > 0) {
+ coreDistance = Math.min(coreDistance, Math.abs(combinedData[i - 1].x - key));
+ }
+ drawData = Bargraph._getSafeDrawData(coreDistance, group, minWidth);
+ } else {
+ var nextKey = i + (intersections[key].amount - intersections[key].resolved);
+ var prevKey = i - (intersections[key].resolved + 1);
+ if (nextKey < combinedData.length) {
+ coreDistance = Math.abs(combinedData[nextKey].x - key);
+ }
+ if (prevKey > 0) {
+ coreDistance = Math.min(coreDistance, Math.abs(combinedData[prevKey].x - key));
+ }
+ drawData = Bargraph._getSafeDrawData(coreDistance, group, minWidth);
+ intersections[key].resolved += 1;
+
+ if (group.options.stack === true) {
+ if (combinedData[i].y < group.zeroPosition) {
+ heightOffset = intersections[key].accumulatedNegative;
+ intersections[key].accumulatedNegative += group.zeroPosition - combinedData[i].y;
+ } else {
+ heightOffset = intersections[key].accumulatedPositive;
+ intersections[key].accumulatedPositive += group.zeroPosition - combinedData[i].y;
+ }
+ } else if (group.options.barChart.sideBySide === true) {
+ drawData.width = drawData.width / intersections[key].amount;
+ drawData.offset += intersections[key].resolved * drawData.width - 0.5 * drawData.width * (intersections[key].amount + 1);
+ if (group.options.barChart.align === 'left') {
+ drawData.offset -= 0.5 * drawData.width;
+ } else if (group.options.barChart.align === 'right') {
+ drawData.offset += 0.5 * drawData.width;
+ }
+ }
+ }
+ DOMutil.drawBar(combinedData[i].x + drawData.offset, combinedData[i].y - heightOffset, drawData.width, group.zeroPosition - combinedData[i].y, group.className + ' vis-bar', framework.svgElements, framework.svg, group.style);
+ // draw points
+ if (group.options.drawPoints.enabled === true) {
+ var pointData = {
+ x: combinedData[i].x + drawData.offset,
+ y: combinedData[i].y - heightOffset,
+ groupId: combinedData[i].groupId,
+ label: combinedData[i].label
+ };
+ Points.draw([pointData], group, framework, drawData.offset);
+ //DOMutil.drawPoint(combinedData[i].x + drawData.offset, combinedData[i].y, group, framework.svgElements, framework.svg);
+ }
+ }
+ };
+
+ /**
+ * Fill the intersections object with counters of how many datapoints share the same x coordinates
+ * @param intersections
+ * @param combinedData
+ * @private
+ */
+ Bargraph._getDataIntersections = function (intersections, combinedData) {
+ // get intersections
+ var coreDistance;
+ for (var i = 0; i < combinedData.length; i++) {
+ if (i + 1 < combinedData.length) {
+ coreDistance = Math.abs(combinedData[i + 1].x - combinedData[i].x);
+ }
+ if (i > 0) {
+ coreDistance = Math.min(coreDistance, Math.abs(combinedData[i - 1].x - combinedData[i].x));
+ }
+ if (coreDistance === 0) {
+ if (intersections[combinedData[i].x] === undefined) {
+ intersections[combinedData[i].x] = { amount: 0, resolved: 0, accumulatedPositive: 0, accumulatedNegative: 0 };
+ }
+ intersections[combinedData[i].x].amount += 1;
+ }
+ }
+ };
+
+ /**
+ * Get the width and offset for bargraphs based on the coredistance between datapoints
+ *
+ * @param coreDistance
+ * @param group
+ * @param minWidth
+ * @returns {{width: Number, offset: Number}}
+ * @private
+ */
+ Bargraph._getSafeDrawData = function (coreDistance, group, minWidth) {
+ var width, offset;
+ if (coreDistance < group.options.barChart.width && coreDistance > 0) {
+ width = coreDistance < minWidth ? minWidth : coreDistance;
+
+ offset = 0; // recalculate offset with the new width;
+ if (group.options.barChart.align === 'left') {
+ offset -= 0.5 * coreDistance;
+ } else if (group.options.barChart.align === 'right') {
+ offset += 0.5 * coreDistance;
+ }
+ } else {
+ // default settings
+ width = group.options.barChart.width;
+ offset = 0;
+ if (group.options.barChart.align === 'left') {
+ offset -= 0.5 * group.options.barChart.width;
+ } else if (group.options.barChart.align === 'right') {
+ offset += 0.5 * group.options.barChart.width;
+ }
+ }
+
+ return { width: width, offset: offset };
+ };
+
+ Bargraph.getStackedYRange = function (combinedData, groupRanges, groupIds, groupLabel, orientation) {
+ if (combinedData.length > 0) {
+ // sort by time and by group
+ combinedData.sort(function (a, b) {
+ if (a.x === b.x) {
+ return a.groupId < b.groupId ? -1 : 1;
+ } else {
+ return a.x - b.x;
+ }
+ });
+ var intersections = {};
+
+ Bargraph._getDataIntersections(intersections, combinedData);
+ groupRanges[groupLabel] = Bargraph._getStackedYRange(intersections, combinedData);
+ groupRanges[groupLabel].yAxisOrientation = orientation;
+ groupIds.push(groupLabel);
+ }
+ };
+
+ Bargraph._getStackedYRange = function (intersections, combinedData) {
+ var key;
+ var yMin = combinedData[0].y;
+ var yMax = combinedData[0].y;
+ for (var i = 0; i < combinedData.length; i++) {
+ key = combinedData[i].x;
+ if (intersections[key] === undefined) {
+ yMin = yMin > combinedData[i].y ? combinedData[i].y : yMin;
+ yMax = yMax < combinedData[i].y ? combinedData[i].y : yMax;
+ } else {
+ if (combinedData[i].y < 0) {
+ intersections[key].accumulatedNegative += combinedData[i].y;
+ } else {
+ intersections[key].accumulatedPositive += combinedData[i].y;
+ }
+ }
+ }
+ for (var xpos in intersections) {
+ if (intersections.hasOwnProperty(xpos)) {
+ yMin = yMin > intersections[xpos].accumulatedNegative ? intersections[xpos].accumulatedNegative : yMin;
+ yMin = yMin > intersections[xpos].accumulatedPositive ? intersections[xpos].accumulatedPositive : yMin;
+ yMax = yMax < intersections[xpos].accumulatedNegative ? intersections[xpos].accumulatedNegative : yMax;
+ yMax = yMax < intersections[xpos].accumulatedPositive ? intersections[xpos].accumulatedPositive : yMax;
+ }
+ }
+
+ return { min: yMin, max: yMax };
+ };
+
+ module.exports = Bargraph;
+
+/***/ },
+/* 57 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var util = __webpack_require__(1);
+ var DOMutil = __webpack_require__(7);
+ var Component = __webpack_require__(26);
+
+ /**
+ * Legend for Graph2d
+ */
+ function Legend(body, options, side, linegraphOptions) {
+ this.body = body;
+ this.defaultOptions = {
+ enabled: true,
+ icons: true,
+ iconSize: 20,
+ iconSpacing: 6,
+ left: {
+ visible: true,
+ position: 'top-left' // top/bottom - left,center,right
+ },
+ right: {
+ visible: true,
+ position: 'top-left' // top/bottom - left,center,right
+ }
+ };
+ this.side = side;
+ this.options = util.extend({}, this.defaultOptions);
+ this.linegraphOptions = linegraphOptions;
+
+ this.svgElements = {};
+ this.dom = {};
+ this.groups = {};
+ this.amountOfGroups = 0;
+ this._create();
+
+ this.setOptions(options);
+ }
+
+ Legend.prototype = new Component();
+
+ Legend.prototype.clear = function () {
+ this.groups = {};
+ this.amountOfGroups = 0;
+ };
+
+ Legend.prototype.addGroup = function (label, graphOptions) {
+
+ // Include a group only if the group option 'excludeFromLegend: false' is not set.
+ if (graphOptions.options.excludeFromLegend != true) {
+ if (!this.groups.hasOwnProperty(label)) {
+ this.groups[label] = graphOptions;
+ }
+ this.amountOfGroups += 1;
+ }
+ };
+
+ Legend.prototype.updateGroup = function (label, graphOptions) {
+ this.groups[label] = graphOptions;
+ };
+
+ Legend.prototype.removeGroup = function (label) {
+ if (this.groups.hasOwnProperty(label)) {
+ delete this.groups[label];
+ this.amountOfGroups -= 1;
+ }
+ };
+
+ Legend.prototype._create = function () {
+ this.dom.frame = document.createElement('div');
+ this.dom.frame.className = 'vis-legend';
+ this.dom.frame.style.position = 'absolute';
+ this.dom.frame.style.top = '10px';
+ this.dom.frame.style.display = 'block';
+
+ this.dom.textArea = document.createElement('div');
+ this.dom.textArea.className = 'vis-legend-text';
+ this.dom.textArea.style.position = 'relative';
+ this.dom.textArea.style.top = '0px';
+
+ this.svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
+ this.svg.style.position = 'absolute';
+ this.svg.style.top = 0 + 'px';
+ this.svg.style.width = this.options.iconSize + 5 + 'px';
+ this.svg.style.height = '100%';
+
+ this.dom.frame.appendChild(this.svg);
+ this.dom.frame.appendChild(this.dom.textArea);
+ };
+
+ /**
+ * Hide the component from the DOM
+ */
+ Legend.prototype.hide = function () {
+ // remove the frame containing the items
+ if (this.dom.frame.parentNode) {
+ this.dom.frame.parentNode.removeChild(this.dom.frame);
+ }
+ };
+
+ /**
+ * Show the component in the DOM (when not already visible).
+ * @return {Boolean} changed
+ */
+ Legend.prototype.show = function () {
+ // show frame containing the items
+ if (!this.dom.frame.parentNode) {
+ this.body.dom.center.appendChild(this.dom.frame);
+ }
+ };
+
+ Legend.prototype.setOptions = function (options) {
+ var fields = ['enabled', 'orientation', 'icons', 'left', 'right'];
+ util.selectiveDeepExtend(fields, this.options, options);
+ };
+
+ Legend.prototype.redraw = function () {
+ var activeGroups = 0;
+ var groupArray = Object.keys(this.groups);
+ groupArray.sort(function (a, b) {
+ return a < b ? -1 : 1;
+ });
+
+ for (var i = 0; i < groupArray.length; i++) {
+ var groupId = groupArray[i];
+ if (this.groups[groupId].visible == true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] == true)) {
+ activeGroups++;
+ }
+ }
+
+ if (this.options[this.side].visible == false || this.amountOfGroups == 0 || this.options.enabled == false || activeGroups == 0) {
+ this.hide();
+ } else {
+ this.show();
+ if (this.options[this.side].position == 'top-left' || this.options[this.side].position == 'bottom-left') {
+ this.dom.frame.style.left = '4px';
+ this.dom.frame.style.textAlign = 'left';
+ this.dom.textArea.style.textAlign = 'left';
+ this.dom.textArea.style.left = this.options.iconSize + 15 + 'px';
+ this.dom.textArea.style.right = '';
+ this.svg.style.left = 0 + 'px';
+ this.svg.style.right = '';
+ } else {
+ this.dom.frame.style.right = '4px';
+ this.dom.frame.style.textAlign = 'right';
+ this.dom.textArea.style.textAlign = 'right';
+ this.dom.textArea.style.right = this.options.iconSize + 15 + 'px';
+ this.dom.textArea.style.left = '';
+ this.svg.style.right = 0 + 'px';
+ this.svg.style.left = '';
+ }
+
+ if (this.options[this.side].position == 'top-left' || this.options[this.side].position == 'top-right') {
+ this.dom.frame.style.top = 4 - Number(this.body.dom.center.style.top.replace('px', '')) + 'px';
+ this.dom.frame.style.bottom = '';
+ } else {
+ var scrollableHeight = this.body.domProps.center.height - this.body.domProps.centerContainer.height;
+ this.dom.frame.style.bottom = 4 + scrollableHeight + Number(this.body.dom.center.style.top.replace('px', '')) + 'px';
+ this.dom.frame.style.top = '';
+ }
+
+ if (this.options.icons == false) {
+ this.dom.frame.style.width = this.dom.textArea.offsetWidth + 10 + 'px';
+ this.dom.textArea.style.right = '';
+ this.dom.textArea.style.left = '';
+ this.svg.style.width = '0px';
+ } else {
+ this.dom.frame.style.width = this.options.iconSize + 15 + this.dom.textArea.offsetWidth + 10 + 'px';
+ this.drawLegendIcons();
+ }
+
+ var content = '';
+ for (var i = 0; i < groupArray.length; i++) {
+ var groupId = groupArray[i];
+ if (this.groups[groupId].visible == true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] == true)) {
+ content += this.groups[groupId].content + ' ';
+ }
+ }
+ this.dom.textArea.innerHTML = content;
+ this.dom.textArea.style.lineHeight = 0.75 * this.options.iconSize + this.options.iconSpacing + 'px';
+ }
+ };
+
+ Legend.prototype.drawLegendIcons = function () {
+ if (this.dom.frame.parentNode) {
+ var groupArray = Object.keys(this.groups);
+ groupArray.sort(function (a, b) {
+ return a < b ? -1 : 1;
+ });
+
+ DOMutil.prepareElements(this.svgElements);
+ var padding = window.getComputedStyle(this.dom.frame).paddingTop;
+ var iconOffset = Number(padding.replace('px', ''));
+ var x = iconOffset;
+ var iconWidth = this.options.iconSize;
+ var iconHeight = 0.75 * this.options.iconSize;
+ var y = iconOffset + 0.5 * iconHeight + 3;
+
+ this.svg.style.width = iconWidth + 5 + iconOffset + 'px';
+
+ for (var i = 0; i < groupArray.length; i++) {
+ var groupId = groupArray[i];
+ if (this.groups[groupId].visible == true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] == true)) {
+ this.groups[groupId].drawIcon(x, y, this.svgElements, this.svg, iconWidth, iconHeight);
+ y += iconHeight + this.options.iconSpacing;
+ }
+ }
+
+ DOMutil.cleanupElements(this.svgElements);
+ }
+ };
+
+ module.exports = Legend;
+
+/***/ },
+/* 58 */
+/***/ function(module, exports) {
+
+ /**
+ * This object contains all possible options. It will check if the types are correct, if required if the option is one
+ * of the allowed values.
+ *
+ * __any__ means that the name of the property does not matter.
+ * __type__ is a required field for all objects and contains the allowed types of all objects
+ */
+ 'use strict';
+
+ Object.defineProperty(exports, '__esModule', {
+ value: true
+ });
+ var string = 'string';
+ var boolean = 'boolean';
+ var number = 'number';
+ var array = 'array';
+ var date = 'date';
+ var object = 'object'; // should only be in a __type__ property
+ var dom = 'dom';
+ var moment = 'moment';
+ var any = 'any';
+
+ var allOptions = {
+ configure: {
+ enabled: { boolean: boolean },
+ filter: { boolean: boolean, 'function': 'function' },
+ container: { dom: dom },
+ __type__: { object: object, boolean: boolean, 'function': 'function' }
+ },
+
+ //globals :
+ yAxisOrientation: { string: ['left', 'right'] },
+ defaultGroup: { string: string },
+ sort: { boolean: boolean },
+ sampling: { boolean: boolean },
+ stack: { boolean: boolean },
+ graphHeight: { string: string, number: number },
+ shaded: {
+ enabled: { boolean: boolean },
+ orientation: { string: ['bottom', 'top'] }, // top, bottom
+ __type__: { boolean: boolean, object: object }
+ },
+ style: { string: ['line', 'bar', 'points'] }, // line, bar
+ barChart: {
+ width: { number: number },
+ sideBySide: { boolean: boolean },
+ align: { string: ['left', 'center', 'right'] },
+ __type__: { object: object }
+ },
+ interpolation: {
+ enabled: { boolean: boolean },
+ parametrization: { string: ['centripetal', 'chordal', 'uniform'] }, // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5)
+ alpha: { number: number },
+ __type__: { object: object, boolean: boolean }
+ },
+ drawPoints: {
+ enabled: { boolean: boolean },
+ onRender: { 'function': 'function' },
+ size: { number: number },
+ style: { string: ['square', 'circle'] }, // square, circle
+ __type__: { object: object, boolean: boolean, 'function': 'function' }
+ },
+ dataAxis: {
+ showMinorLabels: { boolean: boolean },
+ showMajorLabels: { boolean: boolean },
+ icons: { boolean: boolean },
+ width: { string: string, number: number },
+ visible: { boolean: boolean },
+ alignZeros: { boolean: boolean },
+ left: {
+ range: { min: { number: number }, max: { number: number }, __type__: { object: object } },
+ format: { 'function': 'function' },
+ title: { text: { string: string, number: number }, style: { string: string }, __type__: { object: object } },
+ __type__: { object: object }
+ },
+ right: {
+ range: { min: { number: number }, max: { number: number }, __type__: { object: object } },
+ format: { 'function': 'function' },
+ title: { text: { string: string, number: number }, style: { string: string }, __type__: { object: object } },
+ __type__: { object: object }
+ },
+ __type__: { object: object }
+ },
+ legend: {
+ enabled: { boolean: boolean },
+ icons: { boolean: boolean },
+ left: {
+ visible: { boolean: boolean },
+ position: { string: ['top-right', 'bottom-right', 'top-left', 'bottom-left'] },
+ __type__: { object: object }
+ },
+ right: {
+ visible: { boolean: boolean },
+ position: { string: ['top-right', 'bottom-right', 'top-left', 'bottom-left'] },
+ __type__: { object: object }
+ },
+ __type__: { object: object, boolean: boolean }
+ },
+ groups: {
+ visibility: { any: any },
+ __type__: { object: object }
+ },
+
+ autoResize: { boolean: boolean },
+ throttleRedraw: { number: number },
+ clickToUse: { boolean: boolean },
+ end: { number: number, date: date, string: string, moment: moment },
+ format: {
+ minorLabels: {
+ millisecond: { string: string, 'undefined': 'undefined' },
+ second: { string: string, 'undefined': 'undefined' },
+ minute: { string: string, 'undefined': 'undefined' },
+ hour: { string: string, 'undefined': 'undefined' },
+ weekday: { string: string, 'undefined': 'undefined' },
+ day: { string: string, 'undefined': 'undefined' },
+ month: { string: string, 'undefined': 'undefined' },
+ year: { string: string, 'undefined': 'undefined' },
+ __type__: { object: object }
+ },
+ majorLabels: {
+ millisecond: { string: string, 'undefined': 'undefined' },
+ second: { string: string, 'undefined': 'undefined' },
+ minute: { string: string, 'undefined': 'undefined' },
+ hour: { string: string, 'undefined': 'undefined' },
+ weekday: { string: string, 'undefined': 'undefined' },
+ day: { string: string, 'undefined': 'undefined' },
+ month: { string: string, 'undefined': 'undefined' },
+ year: { string: string, 'undefined': 'undefined' },
+ __type__: { object: object }
+ },
+ __type__: { object: object }
+ },
+ moment: { 'function': 'function' },
+ height: { string: string, number: number },
+ hiddenDates: {
+ start: { date: date, number: number, string: string, moment: moment },
+ end: { date: date, number: number, string: string, moment: moment },
+ repeat: { string: string },
+ __type__: { object: object, array: array }
+ },
+ locale: { string: string },
+ locales: {
+ __any__: { any: any },
+ __type__: { object: object }
+ },
+ max: { date: date, number: number, string: string, moment: moment },
+ maxHeight: { number: number, string: string },
+ min: { date: date, number: number, string: string, moment: moment },
+ minHeight: { number: number, string: string },
+ moveable: { boolean: boolean },
+ multiselect: { boolean: boolean },
+ orientation: { string: string },
+ showCurrentTime: { boolean: boolean },
+ showMajorLabels: { boolean: boolean },
+ showMinorLabels: { boolean: boolean },
+ start: { date: date, number: number, string: string, moment: moment },
+ timeAxis: {
+ scale: { string: string, 'undefined': 'undefined' },
+ step: { number: number, 'undefined': 'undefined' },
+ __type__: { object: object }
+ },
+ width: { string: string, number: number },
+ zoomable: { boolean: boolean },
+ zoomKey: { string: ['ctrlKey', 'altKey', 'metaKey', ''] },
+ zoomMax: { number: number },
+ zoomMin: { number: number },
+ __type__: { object: object }
+ };
+
+ var configureOptions = {
+ global: {
+ //yAxisOrientation: ['left','right'], // TDOO: enable as soon as Grahp2d doesn't crash when changing this on the fly
+ sort: true,
+ sampling: true,
+ stack: false,
+ shaded: {
+ enabled: false,
+ orientation: ['top', 'bottom'] // top, bottom
+ },
+ style: ['line', 'bar', 'points'], // line, bar
+ barChart: {
+ width: [50, 5, 100, 5],
+ sideBySide: false,
+ align: ['left', 'center', 'right'] // left, center, right
+ },
+ interpolation: {
+ enabled: true,
+ parametrization: ['centripetal', 'chordal', 'uniform'] // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5)
+ },
+ drawPoints: {
+ enabled: true,
+ size: [6, 2, 30, 1],
+ style: ['square', 'circle'] // square, circle
+ },
+ dataAxis: {
+ showMinorLabels: true,
+ showMajorLabels: true,
+ icons: false,
+ width: [40, 0, 200, 1],
+ visible: true,
+ alignZeros: true,
+ left: {
+ //range: {min:'undefined': 'undefined'ined,max:'undefined': 'undefined'ined},
+ //format: function (value) {return value;},
+ title: { text: '', style: '' }
+ },
+ right: {
+ //range: {min:'undefined': 'undefined'ined,max:'undefined': 'undefined'ined},
+ //format: function (value) {return value;},
+ title: { text: '', style: '' }
+ }
+ },
+ legend: {
+ enabled: false,
+ icons: true,
+ left: {
+ visible: true,
+ position: ['top-right', 'bottom-right', 'top-left', 'bottom-left'] // top/bottom - left,right
+ },
+ right: {
+ visible: true,
+ position: ['top-right', 'bottom-right', 'top-left', 'bottom-left'] // top/bottom - left,right
+ }
+ },
+
+ autoResize: true,
+ throttleRedraw: [10, 0, 1000, 10],
+ clickToUse: false,
+ end: '',
+ format: {
+ minorLabels: {
+ millisecond: 'SSS',
+ second: 's',
+ minute: 'HH:mm',
+ hour: 'HH:mm',
+ weekday: 'ddd D',
+ day: 'D',
+ month: 'MMM',
+ year: 'YYYY'
+ },
+ majorLabels: {
+ millisecond: 'HH:mm:ss',
+ second: 'D MMMM HH:mm',
+ minute: 'ddd D MMMM',
+ hour: 'ddd D MMMM',
+ weekday: 'MMMM YYYY',
+ day: 'MMMM YYYY',
+ month: 'YYYY',
+ year: ''
+ }
+ },
+
+ height: '',
+ locale: '',
+ max: '',
+ maxHeight: '',
+ min: '',
+ minHeight: '',
+ moveable: true,
+ orientation: ['both', 'bottom', 'top'],
+ showCurrentTime: false,
+ showMajorLabels: true,
+ showMinorLabels: true,
+ start: '',
+ width: '100%',
+ zoomable: true,
+ zoomKey: ['ctrlKey', 'altKey', 'metaKey', ''],
+ zoomMax: [315360000000000, 10, 315360000000000, 1],
+ zoomMin: [10, 10, 315360000000000, 1]
+ }
+ };
+
+ exports.allOptions = allOptions;
+ exports.configureOptions = configureOptions;
+
+/***/ },
+/* 59 */
+/***/ function(module, exports, __webpack_require__) {
+
+ // Load custom shapes into CanvasRenderingContext2D
+ 'use strict';
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+
+ var _modulesGroups = __webpack_require__(60);
+
+ var _modulesGroups2 = _interopRequireDefault(_modulesGroups);
+
+ var _modulesNodesHandler = __webpack_require__(61);
+
+ var _modulesNodesHandler2 = _interopRequireDefault(_modulesNodesHandler);
+
+ var _modulesEdgesHandler = __webpack_require__(81);
+
+ var _modulesEdgesHandler2 = _interopRequireDefault(_modulesEdgesHandler);
+
+ var _modulesPhysicsEngine = __webpack_require__(90);
+
+ var _modulesPhysicsEngine2 = _interopRequireDefault(_modulesPhysicsEngine);
+
+ var _modulesClustering = __webpack_require__(99);
+
+ var _modulesClustering2 = _interopRequireDefault(_modulesClustering);
+
+ var _modulesCanvasRenderer = __webpack_require__(101);
+
+ var _modulesCanvasRenderer2 = _interopRequireDefault(_modulesCanvasRenderer);
+
+ var _modulesCanvas = __webpack_require__(102);
+
+ var _modulesCanvas2 = _interopRequireDefault(_modulesCanvas);
+
+ var _modulesView = __webpack_require__(103);
+
+ var _modulesView2 = _interopRequireDefault(_modulesView);
+
+ var _modulesInteractionHandler = __webpack_require__(105);
+
+ var _modulesInteractionHandler2 = _interopRequireDefault(_modulesInteractionHandler);
+
+ var _modulesSelectionHandler = __webpack_require__(108);
+
+ var _modulesSelectionHandler2 = _interopRequireDefault(_modulesSelectionHandler);
+
+ var _modulesLayoutEngine = __webpack_require__(109);
+
+ var _modulesLayoutEngine2 = _interopRequireDefault(_modulesLayoutEngine);
+
+ var _modulesManipulationSystem = __webpack_require__(110);
+
+ var _modulesManipulationSystem2 = _interopRequireDefault(_modulesManipulationSystem);
+
+ var _sharedConfigurator = __webpack_require__(45);
+
+ var _sharedConfigurator2 = _interopRequireDefault(_sharedConfigurator);
+
+ var _sharedValidator = __webpack_require__(47);
+
+ var _sharedValidator2 = _interopRequireDefault(_sharedValidator);
+
+ var _optionsJs = __webpack_require__(111);
+
+ var _modulesKamadaKawaiJs = __webpack_require__(112);
+
+ var _modulesKamadaKawaiJs2 = _interopRequireDefault(_modulesKamadaKawaiJs);
+
+ __webpack_require__(114);
+
+ var Emitter = __webpack_require__(12);
+ var Hammer = __webpack_require__(20);
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(8);
+ var DataView = __webpack_require__(10);
+ var dotparser = __webpack_require__(115);
+ var gephiParser = __webpack_require__(116);
+ var Images = __webpack_require__(117);
+ var Activator = __webpack_require__(40);
+ var locales = __webpack_require__(118);
+
+ /**
+ * @constructor Network
+ * Create a network visualization, displaying nodes and edges.
+ *
+ * @param {Element} container The DOM element in which the Network will
+ * be created. Normally a div element.
+ * @param {Object} data An object containing parameters
+ * {Array} nodes
+ * {Array} edges
+ * @param {Object} options Options
+ */
+ function Network(container, data, options) {
+ var _this = this;
+
+ if (!(this instanceof Network)) {
+ throw new SyntaxError('Constructor must be called with the new operator');
+ }
+
+ // set constant values
+ this.options = {};
+ this.defaultOptions = {
+ locale: 'en',
+ locales: locales,
+ clickToUse: false
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ // containers for nodes and edges
+ this.body = {
+ container: container,
+ nodes: {},
+ nodeIndices: [],
+ edges: {},
+ edgeIndices: [],
+ emitter: {
+ on: this.on.bind(this),
+ off: this.off.bind(this),
+ emit: this.emit.bind(this),
+ once: this.once.bind(this)
+ },
+ eventListeners: {
+ onTap: function onTap() {},
+ onTouch: function onTouch() {},
+ onDoubleTap: function onDoubleTap() {},
+ onHold: function onHold() {},
+ onDragStart: function onDragStart() {},
+ onDrag: function onDrag() {},
+ onDragEnd: function onDragEnd() {},
+ onMouseWheel: function onMouseWheel() {},
+ onPinch: function onPinch() {},
+ onMouseMove: function onMouseMove() {},
+ onRelease: function onRelease() {},
+ onContext: function onContext() {}
+ },
+ data: {
+ nodes: null, // A DataSet or DataView
+ edges: null // A DataSet or DataView
+ },
+ functions: {
+ createNode: function createNode() {},
+ createEdge: function createEdge() {},
+ getPointer: function getPointer() {}
+ },
+ modules: {},
+ view: {
+ scale: 1,
+ translation: { x: 0, y: 0 }
+ }
+ };
+
+ // bind the event listeners
+ this.bindEventListeners();
+
+ // setting up all modules
+ this.images = new Images(function () {
+ return _this.body.emitter.emit('_requestRedraw');
+ }); // object with images
+ this.groups = new _modulesGroups2['default'](); // object with groups
+ this.canvas = new _modulesCanvas2['default'](this.body); // DOM handler
+ this.selectionHandler = new _modulesSelectionHandler2['default'](this.body, this.canvas); // Selection handler
+ this.interactionHandler = new _modulesInteractionHandler2['default'](this.body, this.canvas, this.selectionHandler); // Interaction handler handles all the hammer bindings (that are bound by canvas), key
+ this.view = new _modulesView2['default'](this.body, this.canvas); // camera handler, does animations and zooms
+ this.renderer = new _modulesCanvasRenderer2['default'](this.body, this.canvas); // renderer, starts renderloop, has events that modules can hook into
+ this.physics = new _modulesPhysicsEngine2['default'](this.body); // physics engine, does all the simulations
+ this.layoutEngine = new _modulesLayoutEngine2['default'](this.body); // layout engine for inital layout and hierarchical layout
+ this.clustering = new _modulesClustering2['default'](this.body); // clustering api
+ this.manipulation = new _modulesManipulationSystem2['default'](this.body, this.canvas, this.selectionHandler); // data manipulation system
+
+ this.nodesHandler = new _modulesNodesHandler2['default'](this.body, this.images, this.groups, this.layoutEngine); // Handle adding, deleting and updating of nodes as well as global options
+ this.edgesHandler = new _modulesEdgesHandler2['default'](this.body, this.images, this.groups); // Handle adding, deleting and updating of edges as well as global options
+
+ this.body.modules['kamadaKawai'] = new _modulesKamadaKawaiJs2['default'](this.body, 150, 0.05); // Layouting algorithm.
+ this.body.modules['clustering'] = this.clustering;
+
+ // create the DOM elements
+ this.canvas._create();
+
+ // apply options
+ this.setOptions(options);
+
+ // load data (the disable start variable will be the same as the enabled clustering)
+ this.setData(data);
+ }
+
+ // Extend Network with an Emitter mixin
+ Emitter(Network.prototype);
+
+ /**
+ * Set options
+ * @param {Object} options
+ */
+ Network.prototype.setOptions = function (options) {
+ var _this2 = this;
+
+ if (options !== undefined) {
+
+ var errorFound = _sharedValidator2['default'].validate(options, _optionsJs.allOptions);
+ if (errorFound === true) {
+ console.log('%cErrors have been found in the supplied options object.', _sharedValidator.printStyle);
+ }
+
+ // copy the global fields over
+ var fields = ['locale', 'locales', 'clickToUse'];
+ util.selectiveDeepExtend(fields, this.options, options);
+
+ // the hierarchical system can adapt the edges and the physics to it's own options because not all combinations work with the hierarichical system.
+ options = this.layoutEngine.setOptions(options.layout, options);
+
+ this.canvas.setOptions(options); // options for canvas are in globals
+
+ // pass the options to the modules
+ this.groups.setOptions(options.groups);
+ this.nodesHandler.setOptions(options.nodes);
+ this.edgesHandler.setOptions(options.edges);
+ this.physics.setOptions(options.physics);
+ this.manipulation.setOptions(options.manipulation, options, this.options); // manipulation uses the locales in the globals
+
+ this.interactionHandler.setOptions(options.interaction);
+ this.renderer.setOptions(options.interaction); // options for rendering are in interaction
+ this.selectionHandler.setOptions(options.interaction); // options for selection are in interaction
+
+ // reload the settings of the nodes to apply changes in groups that are not referenced by pointer.
+ if (options.groups !== undefined) {
+ this.body.emitter.emit('refreshNodes');
+ }
+ // these two do not have options at the moment, here for completeness
+ //this.view.setOptions(options.view);
+ //this.clustering.setOptions(options.clustering);
+
+ if ('configure' in options) {
+ if (!this.configurator) {
+ this.configurator = new _sharedConfigurator2['default'](this, this.body.container, _optionsJs.configureOptions, this.canvas.pixelRatio);
+ }
+
+ this.configurator.setOptions(options.configure);
+ }
+
+ // if the configuration system is enabled, copy all options and put them into the config system
+ if (this.configurator && this.configurator.options.enabled === true) {
+ var networkOptions = { nodes: {}, edges: {}, layout: {}, interaction: {}, manipulation: {}, physics: {}, global: {} };
+ util.deepExtend(networkOptions.nodes, this.nodesHandler.options);
+ util.deepExtend(networkOptions.edges, this.edgesHandler.options);
+ util.deepExtend(networkOptions.layout, this.layoutEngine.options);
+ // load the selectionHandler and render default options in to the interaction group
+ util.deepExtend(networkOptions.interaction, this.selectionHandler.options);
+ util.deepExtend(networkOptions.interaction, this.renderer.options);
+
+ util.deepExtend(networkOptions.interaction, this.interactionHandler.options);
+ util.deepExtend(networkOptions.manipulation, this.manipulation.options);
+ util.deepExtend(networkOptions.physics, this.physics.options);
+
+ // load globals into the global object
+ util.deepExtend(networkOptions.global, this.canvas.options);
+ util.deepExtend(networkOptions.global, this.options);
+
+ this.configurator.setModuleOptions(networkOptions);
+ }
+
+ // handle network global options
+ if (options.clickToUse !== undefined) {
+ if (options.clickToUse === true) {
+ if (this.activator === undefined) {
+ this.activator = new Activator(this.canvas.frame);
+ this.activator.on('change', function () {
+ _this2.body.emitter.emit('activate');
+ });
+ }
+ } else {
+ if (this.activator !== undefined) {
+ this.activator.destroy();
+ delete this.activator;
+ }
+ this.body.emitter.emit('activate');
+ }
+ } else {
+ this.body.emitter.emit('activate');
+ }
+
+ this.canvas.setSize();
+ // start the physics simulation. Can be safely called multiple times.
+ this.body.emitter.emit('startSimulation');
+ }
+ };
+
+ /**
+ * Update the this.body.nodeIndices with the most recent node index list
+ * @private
+ */
+ Network.prototype._updateVisibleIndices = function () {
+ var nodes = this.body.nodes;
+ var edges = this.body.edges;
+ this.body.nodeIndices = [];
+ this.body.edgeIndices = [];
+
+ for (var nodeId in nodes) {
+ if (nodes.hasOwnProperty(nodeId)) {
+ if (nodes[nodeId].options.hidden === false) {
+ this.body.nodeIndices.push(nodeId);
+ }
+ }
+ }
+
+ for (var edgeId in edges) {
+ if (edges.hasOwnProperty(edgeId)) {
+ if (edges[edgeId].options.hidden === false) {
+ this.body.edgeIndices.push(edgeId);
+ }
+ }
+ }
+ };
+
+ /**
+ * Bind all events
+ */
+ Network.prototype.bindEventListeners = function () {
+ var _this3 = this;
+
+ // this event will trigger a rebuilding of the cache everything. Used when nodes or edges have been added or removed.
+ this.body.emitter.on('_dataChanged', function () {
+ // update shortcut lists
+ _this3._updateVisibleIndices();
+ _this3.physics.updatePhysicsData();
+ _this3.body.emitter.emit('_requestRedraw');
+ // call the dataUpdated event because the only difference between the two is the updating of the indices
+ _this3.body.emitter.emit('_dataUpdated');
+ });
+
+ // this is called when options of EXISTING nodes or edges have changed.
+ this.body.emitter.on('_dataUpdated', function () {
+ // update values
+ _this3._updateValueRange(_this3.body.nodes);
+ _this3._updateValueRange(_this3.body.edges);
+ // start simulation (can be called safely, even if already running)
+ _this3.body.emitter.emit('startSimulation');
+ _this3.body.emitter.emit('_requestRedraw');
+ });
+ };
+
+ /**
+ * Set nodes and edges, and optionally options as well.
+ *
+ * @param {Object} data Object containing parameters:
+ * {Array | DataSet | DataView} [nodes] Array with nodes
+ * {Array | DataSet | DataView} [edges] Array with edges
+ * {String} [dot] String containing data in DOT format
+ * {String} [gephi] String containing data in gephi JSON format
+ * {Options} [options] Object with options
+ */
+ Network.prototype.setData = function (data) {
+ // reset the physics engine.
+ this.body.emitter.emit('resetPhysics');
+ this.body.emitter.emit('_resetData');
+
+ // unselect all to ensure no selections from old data are carried over.
+ this.selectionHandler.unselectAll();
+
+ if (data && data.dot && (data.nodes || data.edges)) {
+ throw new SyntaxError('Data must contain either parameter "dot" or ' + ' parameter pair "nodes" and "edges", but not both.');
+ }
+
+ // set options
+ this.setOptions(data && data.options);
+ // set all data
+ if (data && data.dot) {
+ console.log('The dot property has been depricated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);');
+ // parse DOT file
+ var dotData = dotparser.DOTToGraph(data.dot);
+ this.setData(dotData);
+ return;
+ } else if (data && data.gephi) {
+ // parse DOT file
+ console.log('The gephi property has been depricated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);');
+ var gephiData = gephiParser.parseGephi(data.gephi);
+ this.setData(gephiData);
+ return;
+ } else {
+ this.nodesHandler.setData(data && data.nodes, true);
+ this.edgesHandler.setData(data && data.edges, true);
+ }
+
+ // emit change in data
+ this.body.emitter.emit('_dataChanged');
+
+ // emit data loaded
+ this.body.emitter.emit('_dataLoaded');
+
+ // find a stable position or start animating to a stable position
+ this.body.emitter.emit('initPhysics');
+ };
+
+ /**
+ * Cleans up all bindings of the network, removing it fully from the memory IF the variable is set to null after calling this function.
+ * var network = new vis.Network(..);
+ * network.destroy();
+ * network = null;
+ */
+ Network.prototype.destroy = function () {
+ this.body.emitter.emit('destroy');
+ // clear events
+ this.body.emitter.off();
+ this.off();
+
+ // delete modules
+ delete this.groups;
+ delete this.canvas;
+ delete this.selectionHandler;
+ delete this.interactionHandler;
+ delete this.view;
+ delete this.renderer;
+ delete this.physics;
+ delete this.layoutEngine;
+ delete this.clustering;
+ delete this.manipulation;
+ delete this.nodesHandler;
+ delete this.edgesHandler;
+ delete this.configurator;
+ delete this.images;
+
+ for (var nodeId in this.body.nodes) {
+ delete this.body.nodes[nodeId];
+ }
+ for (var edgeId in this.body.edges) {
+ delete this.body.edges[edgeId];
+ }
+
+ // remove the container and everything inside it recursively
+ util.recursiveDOMDelete(this.body.container);
+ };
+
+ /**
+ * Update the values of all object in the given array according to the current
+ * value range of the objects in the array.
+ * @param {Object} obj An object containing a set of Edges or Nodes
+ * The objects must have a method getValue() and
+ * setValueRange(min, max).
+ * @private
+ */
+ Network.prototype._updateValueRange = function (obj) {
+ var id;
+
+ // determine the range of the objects
+ var valueMin = undefined;
+ var valueMax = undefined;
+ var valueTotal = 0;
+ for (id in obj) {
+ if (obj.hasOwnProperty(id)) {
+ var value = obj[id].getValue();
+ if (value !== undefined) {
+ valueMin = valueMin === undefined ? value : Math.min(value, valueMin);
+ valueMax = valueMax === undefined ? value : Math.max(value, valueMax);
+ valueTotal += value;
+ }
+ }
+ }
+
+ // adjust the range of all objects
+ if (valueMin !== undefined && valueMax !== undefined) {
+ for (id in obj) {
+ if (obj.hasOwnProperty(id)) {
+ obj[id].setValueRange(valueMin, valueMax, valueTotal);
+ }
+ }
+ }
+ };
+
+ /**
+ * Returns true when the Network is active.
+ * @returns {boolean}
+ */
+ Network.prototype.isActive = function () {
+ return !this.activator || this.activator.active;
+ };
+
+ Network.prototype.setSize = function () {
+ return this.canvas.setSize.apply(this.canvas, arguments);
+ };
+ Network.prototype.canvasToDOM = function () {
+ return this.canvas.canvasToDOM.apply(this.canvas, arguments);
+ };
+ Network.prototype.DOMtoCanvas = function () {
+ return this.canvas.DOMtoCanvas.apply(this.canvas, arguments);
+ };
+ Network.prototype.findNode = function () {
+ return this.clustering.findNode.apply(this.clustering, arguments);
+ };
+ Network.prototype.isCluster = function () {
+ return this.clustering.isCluster.apply(this.clustering, arguments);
+ };
+ Network.prototype.openCluster = function () {
+ return this.clustering.openCluster.apply(this.clustering, arguments);
+ };
+ Network.prototype.cluster = function () {
+ return this.clustering.cluster.apply(this.clustering, arguments);
+ };
+ Network.prototype.getNodesInCluster = function () {
+ return this.clustering.getNodesInCluster.apply(this.clustering, arguments);
+ };
+ Network.prototype.clusterByConnection = function () {
+ return this.clustering.clusterByConnection.apply(this.clustering, arguments);
+ };
+ Network.prototype.clusterByHubsize = function () {
+ return this.clustering.clusterByHubsize.apply(this.clustering, arguments);
+ };
+ Network.prototype.clusterOutliers = function () {
+ return this.clustering.clusterOutliers.apply(this.clustering, arguments);
+ };
+ Network.prototype.getSeed = function () {
+ return this.layoutEngine.getSeed.apply(this.layoutEngine, arguments);
+ };
+ Network.prototype.enableEditMode = function () {
+ return this.manipulation.enableEditMode.apply(this.manipulation, arguments);
+ };
+ Network.prototype.disableEditMode = function () {
+ return this.manipulation.disableEditMode.apply(this.manipulation, arguments);
+ };
+ Network.prototype.addNodeMode = function () {
+ return this.manipulation.addNodeMode.apply(this.manipulation, arguments);
+ };
+ Network.prototype.editNode = function () {
+ return this.manipulation.editNode.apply(this.manipulation, arguments);
+ };
+ Network.prototype.editNodeMode = function () {
+ console.log('Deprecated: Please use editNode instead of editNodeMode.');return this.manipulation.editNode.apply(this.manipulation, arguments);
+ };
+ Network.prototype.addEdgeMode = function () {
+ return this.manipulation.addEdgeMode.apply(this.manipulation, arguments);
+ };
+ Network.prototype.editEdgeMode = function () {
+ return this.manipulation.editEdgeMode.apply(this.manipulation, arguments);
+ };
+ Network.prototype.deleteSelected = function () {
+ return this.manipulation.deleteSelected.apply(this.manipulation, arguments);
+ };
+ Network.prototype.getPositions = function () {
+ return this.nodesHandler.getPositions.apply(this.nodesHandler, arguments);
+ };
+ Network.prototype.storePositions = function () {
+ return this.nodesHandler.storePositions.apply(this.nodesHandler, arguments);
+ };
+ Network.prototype.moveNode = function () {
+ return this.nodesHandler.moveNode.apply(this.nodesHandler, arguments);
+ };
+ Network.prototype.getBoundingBox = function () {
+ return this.nodesHandler.getBoundingBox.apply(this.nodesHandler, arguments);
+ };
+ Network.prototype.getConnectedNodes = function (objectId) {
+ if (this.body.nodes[objectId] !== undefined) {
+ return this.nodesHandler.getConnectedNodes.apply(this.nodesHandler, arguments);
+ } else {
+ return this.edgesHandler.getConnectedNodes.apply(this.edgesHandler, arguments);
+ }
+ };
+ Network.prototype.getConnectedEdges = function () {
+ return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler, arguments);
+ };
+ Network.prototype.startSimulation = function () {
+ return this.physics.startSimulation.apply(this.physics, arguments);
+ };
+ Network.prototype.stopSimulation = function () {
+ return this.physics.stopSimulation.apply(this.physics, arguments);
+ };
+ Network.prototype.stabilize = function () {
+ return this.physics.stabilize.apply(this.physics, arguments);
+ };
+ Network.prototype.getSelection = function () {
+ return this.selectionHandler.getSelection.apply(this.selectionHandler, arguments);
+ };
+ Network.prototype.getSelectedNodes = function () {
+ return this.selectionHandler.getSelectedNodes.apply(this.selectionHandler, arguments);
+ };
+ Network.prototype.getSelectedEdges = function () {
+ return this.selectionHandler.getSelectedEdges.apply(this.selectionHandler, arguments);
+ };
+ Network.prototype.getNodeAt = function () {
+ var node = this.selectionHandler.getNodeAt.apply(this.selectionHandler, arguments);
+ if (node !== undefined && node.id !== undefined) {
+ return node.id;
+ }
+ return node;
+ };
+ Network.prototype.getEdgeAt = function () {
+ var edge = this.selectionHandler.getEdgeAt.apply(this.selectionHandler, arguments);
+ if (edge !== undefined && edge.id !== undefined) {
+ return edge.id;
+ }
+ return edge;
+ };
+ Network.prototype.selectNodes = function () {
+ return this.selectionHandler.selectNodes.apply(this.selectionHandler, arguments);
+ };
+ Network.prototype.selectEdges = function () {
+ return this.selectionHandler.selectEdges.apply(this.selectionHandler, arguments);
+ };
+ Network.prototype.unselectAll = function () {
+ this.selectionHandler.unselectAll.apply(this.selectionHandler, arguments);
+ this.redraw();
+ };
+ Network.prototype.redraw = function () {
+ return this.renderer.redraw.apply(this.renderer, arguments);
+ };
+ Network.prototype.getScale = function () {
+ return this.view.getScale.apply(this.view, arguments);
+ };
+ Network.prototype.getViewPosition = function () {
+ return this.view.getViewPosition.apply(this.view, arguments);
+ };
+ Network.prototype.fit = function () {
+ return this.view.fit.apply(this.view, arguments);
+ };
+ Network.prototype.moveTo = function () {
+ return this.view.moveTo.apply(this.view, arguments);
+ };
+ Network.prototype.focus = function () {
+ return this.view.focus.apply(this.view, arguments);
+ };
+ Network.prototype.releaseNode = function () {
+ return this.view.releaseNode.apply(this.view, arguments);
+ };
+ Network.prototype.getOptionsFromConfigurator = function () {
+ var options = {};
+ if (this.configurator) {
+ options = this.configurator.getOptions.apply(this.configurator);
+ }
+ return options;
+ };
+
+ module.exports = Network;
+
+/***/ },
+/* 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; }; })();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var util = __webpack_require__(1);
+
+ /**
+ * @class Groups
+ * This class can store groups and options specific for groups.
+ */
+
+ var Groups = (function () {
+ function Groups() {
+ _classCallCheck(this, Groups);
+
+ this.clear();
+ this.defaultIndex = 0;
+ this.groupsArray = [];
+ this.groupIndex = 0;
+
+ this.defaultGroups = [{ border: "#2B7CE9", background: "#97C2FC", highlight: { border: "#2B7CE9", background: "#D2E5FF" }, hover: { border: "#2B7CE9", background: "#D2E5FF" } }, // 0: blue
+ { border: "#FFA500", background: "#FFFF00", highlight: { border: "#FFA500", background: "#FFFFA3" }, hover: { border: "#FFA500", background: "#FFFFA3" } }, // 1: yellow
+ { border: "#FA0A10", background: "#FB7E81", highlight: { border: "#FA0A10", background: "#FFAFB1" }, hover: { border: "#FA0A10", background: "#FFAFB1" } }, // 2: red
+ { border: "#41A906", background: "#7BE141", highlight: { border: "#41A906", background: "#A1EC76" }, hover: { border: "#41A906", background: "#A1EC76" } }, // 3: green
+ { border: "#E129F0", background: "#EB7DF4", highlight: { border: "#E129F0", background: "#F0B3F5" }, hover: { border: "#E129F0", background: "#F0B3F5" } }, // 4: magenta
+ { border: "#7C29F0", background: "#AD85E4", highlight: { border: "#7C29F0", background: "#D3BDF0" }, hover: { border: "#7C29F0", background: "#D3BDF0" } }, // 5: purple
+ { border: "#C37F00", background: "#FFA807", highlight: { border: "#C37F00", background: "#FFCA66" }, hover: { border: "#C37F00", background: "#FFCA66" } }, // 6: orange
+ { border: "#4220FB", background: "#6E6EFD", highlight: { border: "#4220FB", background: "#9B9BFD" }, hover: { border: "#4220FB", background: "#9B9BFD" } }, // 7: darkblue
+ { border: "#FD5A77", background: "#FFC0CB", highlight: { border: "#FD5A77", background: "#FFD1D9" }, hover: { border: "#FD5A77", background: "#FFD1D9" } }, // 8: pink
+ { border: "#4AD63A", background: "#C2FABC", highlight: { border: "#4AD63A", background: "#E6FFE3" }, hover: { border: "#4AD63A", background: "#E6FFE3" } }, // 9: mint
+
+ { border: "#990000", background: "#EE0000", highlight: { border: "#BB0000", background: "#FF3333" }, hover: { border: "#BB0000", background: "#FF3333" } }, // 10:bright red
+
+ { border: "#FF6000", background: "#FF6000", highlight: { border: "#FF6000", background: "#FF6000" }, hover: { border: "#FF6000", background: "#FF6000" } }, // 12: real orange
+ { border: "#97C2FC", background: "#2B7CE9", highlight: { border: "#D2E5FF", background: "#2B7CE9" }, hover: { border: "#D2E5FF", background: "#2B7CE9" } }, // 13: blue
+ { border: "#399605", background: "#255C03", highlight: { border: "#399605", background: "#255C03" }, hover: { border: "#399605", background: "#255C03" } }, // 14: green
+ { border: "#B70054", background: "#FF007E", highlight: { border: "#B70054", background: "#FF007E" }, hover: { border: "#B70054", background: "#FF007E" } }, // 15: magenta
+ { border: "#AD85E4", background: "#7C29F0", highlight: { border: "#D3BDF0", background: "#7C29F0" }, hover: { border: "#D3BDF0", background: "#7C29F0" } }, // 16: purple
+ { border: "#4557FA", background: "#000EA1", highlight: { border: "#6E6EFD", background: "#000EA1" }, hover: { border: "#6E6EFD", background: "#000EA1" } }, // 17: darkblue
+ { border: "#FFC0CB", background: "#FD5A77", highlight: { border: "#FFD1D9", background: "#FD5A77" }, hover: { border: "#FFD1D9", background: "#FD5A77" } }, // 18: pink
+ { border: "#C2FABC", background: "#74D66A", highlight: { border: "#E6FFE3", background: "#74D66A" }, hover: { border: "#E6FFE3", background: "#74D66A" } }, // 19: mint
+
+ { border: "#EE0000", background: "#990000", highlight: { border: "#FF3333", background: "#BB0000" }, hover: { border: "#FF3333", background: "#BB0000" } } // 20:bright red
+ ];
+
+ this.options = {};
+ this.defaultOptions = {
+ useDefaultGroups: true
+ };
+ util.extend(this.options, this.defaultOptions);
+ }
+
+ _createClass(Groups, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ var optionFields = ["useDefaultGroups"];
+
+ if (options !== undefined) {
+ for (var groupName in options) {
+ if (options.hasOwnProperty(groupName)) {
+ if (optionFields.indexOf(groupName) === -1) {
+ var group = options[groupName];
+ this.add(groupName, group);
+ }
+ }
+ }
+ }
+ }
+ }, {
+ key: "clear",
+
+ /**
+ * Clear all groups
+ */
+ value: function clear() {
+ this.groups = {};
+ this.groupsArray = [];
+ }
+ }, {
+ key: "get",
+
+ /**
+ * get group options of a groupname. If groupname is not found, a new group
+ * is added.
+ * @param {*} groupname Can be a number, string, Date, etc.
+ * @return {Object} group The created group, containing all group options
+ */
+ value: function get(groupname) {
+ var group = this.groups[groupname];
+ if (group === undefined) {
+ if (this.options.useDefaultGroups === false && this.groupsArray.length > 0) {
+ // create new group
+ var index = this.groupIndex % this.groupsArray.length;
+ this.groupIndex++;
+ group = {};
+ group.color = this.groups[this.groupsArray[index]];
+ this.groups[groupname] = group;
+ } else {
+ // create new group
+ var index = this.defaultIndex % this.defaultGroups.length;
+ this.defaultIndex++;
+ group = {};
+ group.color = this.defaultGroups[index];
+ this.groups[groupname] = group;
+ }
+ }
+
+ return group;
+ }
+ }, {
+ key: "add",
+
+ /**
+ * Add a custom group style
+ * @param {String} groupName
+ * @param {Object} style An object containing borderColor,
+ * backgroundColor, etc.
+ * @return {Object} group The created group object
+ */
+ value: function add(groupName, style) {
+ this.groups[groupName] = style;
+ this.groupsArray.push(groupName);
+ return style;
+ }
+ }]);
+
+ return Groups;
+ })();
+
+ exports["default"] = Groups;
+ module.exports = exports["default"];
+
+/***/ },
+/* 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 _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 _componentsNode = __webpack_require__(62);
+
+ var _componentsNode2 = _interopRequireDefault(_componentsNode);
+
+ var _componentsSharedLabel = __webpack_require__(63);
+
+ var _componentsSharedLabel2 = _interopRequireDefault(_componentsSharedLabel);
+
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(8);
+ var DataView = __webpack_require__(10);
+
+ var NodesHandler = (function () {
+ function NodesHandler(body, images, groups, layoutEngine) {
+ var _this = this;
+
+ _classCallCheck(this, NodesHandler);
+
+ this.body = body;
+ this.images = images;
+ this.groups = groups;
+ this.layoutEngine = layoutEngine;
+
+ // create the node API in the body container
+ this.body.functions.createNode = this.create.bind(this);
+
+ this.nodesListeners = {
+ add: function add(event, params) {
+ _this.add(params.items);
+ },
+ update: function update(event, params) {
+ _this.update(params.items, params.data);
+ },
+ remove: function remove(event, params) {
+ _this.remove(params.items);
+ }
+ };
+
+ this.options = {};
+ this.defaultOptions = {
+ borderWidth: 1,
+ borderWidthSelected: 2,
+ brokenImage: undefined,
+ color: {
+ border: '#2B7CE9',
+ background: '#97C2FC',
+ highlight: {
+ border: '#2B7CE9',
+ background: '#D2E5FF'
+ },
+ hover: {
+ border: '#2B7CE9',
+ background: '#D2E5FF'
+ }
+ },
+ fixed: {
+ x: false,
+ y: false
+ },
+ font: {
+ color: '#343434',
+ size: 14, // px
+ face: 'arial',
+ background: 'none',
+ strokeWidth: 0, // px
+ strokeColor: '#ffffff',
+ align: 'horizontal'
+ },
+ group: undefined,
+ hidden: false,
+ icon: {
+ face: 'FontAwesome', //'FontAwesome',
+ code: undefined, //'\uf007',
+ size: 50, //50,
+ color: '#2B7CE9' //'#aa00ff'
+ },
+ image: undefined, // --> URL
+ label: undefined,
+ labelHighlightBold: true,
+ level: undefined,
+ mass: 1,
+ physics: true,
+ scaling: {
+ min: 10,
+ max: 30,
+ label: {
+ enabled: false,
+ min: 14,
+ max: 30,
+ maxVisible: 30,
+ drawThreshold: 5
+ },
+ customScalingFunction: function customScalingFunction(min, max, total, value) {
+ if (max === min) {
+ return 0.5;
+ } else {
+ var scale = 1 / (max - min);
+ return Math.max(0, (value - min) * scale);
+ }
+ }
+ },
+ shadow: {
+ enabled: false,
+ size: 10,
+ x: 5,
+ y: 5
+ },
+ shape: 'ellipse',
+ shapeProperties: {
+ borderDashes: false, // only for borders
+ borderRadius: 6, // only for box shape
+ useImageSize: false, // only for image and circularImage shapes
+ useBorderWithImage: false // only for image shape
+ },
+ size: 25,
+ title: undefined,
+ value: undefined,
+ x: undefined,
+ y: undefined
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ this.bindEventListeners();
+ }
+
+ _createClass(NodesHandler, [{
+ key: 'bindEventListeners',
+ value: function bindEventListeners() {
+ var _this2 = this;
+
+ // refresh the nodes. Used when reverting from hierarchical layout
+ this.body.emitter.on('refreshNodes', this.refresh.bind(this));
+ this.body.emitter.on('refresh', this.refresh.bind(this));
+ this.body.emitter.on('destroy', function () {
+ delete _this2.body.functions.createNode;
+ delete _this2.nodesListeners.add;
+ delete _this2.nodesListeners.update;
+ delete _this2.nodesListeners.remove;
+ delete _this2.nodesListeners;
+ });
+ }
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options) {
+ if (options !== undefined) {
+ _componentsNode2['default'].parseOptions(this.options, options);
+
+ // update the shape in all nodes
+ if (options.shape !== undefined) {
+ for (var nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ this.body.nodes[nodeId].updateShape();
+ }
+ }
+ }
+
+ // update the font in all nodes
+ if (options.font !== undefined) {
+ _componentsSharedLabel2['default'].parseOptions(this.options.font, options);
+ for (var nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ this.body.nodes[nodeId].updateLabelModule();
+ this.body.nodes[nodeId]._reset();
+ }
+ }
+ }
+
+ // update the shape size in all nodes
+ if (options.size !== undefined) {
+ for (var nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ this.body.nodes[nodeId]._reset();
+ }
+ }
+ }
+
+ // update the state of the letiables if needed
+ if (options.hidden !== undefined || options.physics !== undefined) {
+ this.body.emitter.emit('_dataChanged');
+ }
+ }
+ }
+ }, {
+ key: 'setData',
+
+ /**
+ * Set a data set with nodes for the network
+ * @param {Array | DataSet | DataView} nodes The data containing the nodes.
+ * @private
+ */
+ value: function setData(nodes) {
+ var _this3 = this;
+
+ var doNotEmit = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ var oldNodesData = this.body.data.nodes;
+
+ if (nodes instanceof DataSet || nodes instanceof DataView) {
+ this.body.data.nodes = nodes;
+ } else if (Array.isArray(nodes)) {
+ this.body.data.nodes = new DataSet();
+ this.body.data.nodes.add(nodes);
+ } else if (!nodes) {
+ this.body.data.nodes = new DataSet();
+ } else {
+ throw new TypeError('Array or DataSet expected');
+ }
+
+ if (oldNodesData) {
+ // unsubscribe from old dataset
+ util.forEach(this.nodesListeners, function (callback, event) {
+ oldNodesData.off(event, callback);
+ });
+ }
+
+ // remove drawn nodes
+ this.body.nodes = {};
+
+ if (this.body.data.nodes) {
+ (function () {
+ // subscribe to new dataset
+ var me = _this3;
+ util.forEach(_this3.nodesListeners, function (callback, event) {
+ me.body.data.nodes.on(event, callback);
+ });
+
+ // draw all new nodes
+ var ids = _this3.body.data.nodes.getIds();
+ _this3.add(ids, true);
+ })();
+ }
+
+ if (doNotEmit === false) {
+ this.body.emitter.emit('_dataChanged');
+ }
+ }
+ }, {
+ key: 'add',
+
+ /**
+ * Add nodes
+ * @param {Number[] | String[]} ids
+ * @private
+ */
+ value: function add(ids) {
+ var doNotEmit = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ var id = undefined;
+ var newNodes = [];
+ for (var i = 0; i < ids.length; i++) {
+ id = ids[i];
+ var properties = this.body.data.nodes.get(id);
+ var node = this.create(properties);
+ newNodes.push(node);
+ this.body.nodes[id] = node; // note: this may replace an existing node
+ }
+
+ this.layoutEngine.positionInitially(newNodes);
+
+ if (doNotEmit === false) {
+ this.body.emitter.emit('_dataChanged');
+ }
+ }
+ }, {
+ key: 'update',
+
+ /**
+ * Update existing nodes, or create them when not yet existing
+ * @param {Number[] | String[]} ids
+ * @private
+ */
+ value: function update(ids, changedData) {
+ var nodes = this.body.nodes;
+ var dataChanged = false;
+ for (var i = 0; i < ids.length; i++) {
+ var id = ids[i];
+ var node = nodes[id];
+ var data = changedData[i];
+ if (node !== undefined) {
+ // update node
+ dataChanged = node.setOptions(data);
+ } else {
+ dataChanged = true;
+ // create node
+ node = this.create(data);
+ nodes[id] = node;
+ }
+ }
+ if (dataChanged === true) {
+ this.body.emitter.emit('_dataChanged');
+ } else {
+ this.body.emitter.emit('_dataUpdated');
+ }
+ }
+ }, {
+ key: 'remove',
+
+ /**
+ * Remove existing nodes. If nodes do not exist, the method will just ignore it.
+ * @param {Number[] | String[]} ids
+ * @private
+ */
+ value: function remove(ids) {
+ var nodes = this.body.nodes;
+
+ for (var i = 0; i < ids.length; i++) {
+ var id = ids[i];
+ delete nodes[id];
+ }
+
+ this.body.emitter.emit('_dataChanged');
+ }
+ }, {
+ key: 'create',
+
+ /**
+ * create a node
+ * @param properties
+ * @param constructorClass
+ */
+ value: function create(properties) {
+ var constructorClass = arguments.length <= 1 || arguments[1] === undefined ? _componentsNode2['default'] : arguments[1];
+
+ return new constructorClass(properties, this.body, this.images, this.groups, this.options);
+ }
+ }, {
+ key: 'refresh',
+ value: function refresh() {
+ var clearPositions = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];
+
+ var nodes = this.body.nodes;
+ for (var nodeId in nodes) {
+ var node = undefined;
+ if (nodes.hasOwnProperty(nodeId)) {
+ node = nodes[nodeId];
+ }
+ var data = this.body.data.nodes._data[nodeId];
+ if (node !== undefined && data !== undefined) {
+ if (clearPositions === true) {
+ node.setOptions({ x: null, y: null });
+ }
+ node.setOptions({ fixed: false });
+ node.setOptions(data);
+ }
+ }
+ }
+ }, {
+ key: 'getPositions',
+
+ /**
+ * Returns the positions of the nodes.
+ * @param ids --> optional, can be array of nodeIds, can be string
+ * @returns {{}}
+ */
+ value: function getPositions(ids) {
+ var dataArray = {};
+ if (ids !== undefined) {
+ if (Array.isArray(ids) === true) {
+ for (var i = 0; i < ids.length; i++) {
+ if (this.body.nodes[ids[i]] !== undefined) {
+ var node = this.body.nodes[ids[i]];
+ dataArray[ids[i]] = { x: Math.round(node.x), y: Math.round(node.y) };
+ }
+ }
+ } else {
+ if (this.body.nodes[ids] !== undefined) {
+ var node = this.body.nodes[ids];
+ dataArray[ids] = { x: Math.round(node.x), y: Math.round(node.y) };
+ }
+ }
+ } else {
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ var node = this.body.nodes[this.body.nodeIndices[i]];
+ dataArray[this.body.nodeIndices[i]] = { x: Math.round(node.x), y: Math.round(node.y) };
+ }
+ }
+ return dataArray;
+ }
+ }, {
+ key: 'storePositions',
+
+ /**
+ * Load the XY positions of the nodes into the dataset.
+ */
+ value: function storePositions() {
+ // todo: add support for clusters and hierarchical.
+ var dataArray = [];
+ var dataset = this.body.data.nodes.getDataSet();
+
+ for (var nodeId in dataset._data) {
+ if (dataset._data.hasOwnProperty(nodeId)) {
+ var node = this.body.nodes[nodeId];
+ if (dataset._data[nodeId].x != Math.round(node.x) || dataset._data[nodeId].y != Math.round(node.y)) {
+ dataArray.push({ id: nodeId, x: Math.round(node.x), y: Math.round(node.y) });
+ }
+ }
+ }
+ dataset.update(dataArray);
+ }
+ }, {
+ key: 'getBoundingBox',
+
+ /**
+ * get the bounding box of a node.
+ * @param nodeId
+ * @returns {j|*}
+ */
+ value: function getBoundingBox(nodeId) {
+ if (this.body.nodes[nodeId] !== undefined) {
+ return this.body.nodes[nodeId].shape.boundingBox;
+ }
+ }
+ }, {
+ key: 'getConnectedNodes',
+
+ /**
+ * Get the Ids of nodes connected to this node.
+ * @param nodeId
+ * @returns {Array}
+ */
+ value: function getConnectedNodes(nodeId) {
+ var nodeList = [];
+ if (this.body.nodes[nodeId] !== undefined) {
+ var node = this.body.nodes[nodeId];
+ var nodeObj = {}; // used to quickly check if node already exists
+ for (var i = 0; i < node.edges.length; i++) {
+ var edge = node.edges[i];
+ if (edge.toId == nodeId) {
+ // these are double equals since ids can be numeric or string
+ if (nodeObj[edge.fromId] === undefined) {
+ nodeList.push(edge.fromId);
+ nodeObj[edge.fromId] = true;
+ }
+ } else if (edge.fromId == nodeId) {
+ // these are double equals since ids can be numeric or string
+ if (nodeObj[edge.toId] === undefined) {
+ nodeList.push(edge.toId);
+ nodeObj[edge.toId] = true;
+ }
+ }
+ }
+ }
+ return nodeList;
+ }
+ }, {
+ key: 'getConnectedEdges',
+
+ /**
+ * Get the ids of the edges connected to this node.
+ * @param nodeId
+ * @returns {*}
+ */
+ value: function getConnectedEdges(nodeId) {
+ var edgeList = [];
+ if (this.body.nodes[nodeId] !== undefined) {
+ var node = this.body.nodes[nodeId];
+ for (var i = 0; i < node.edges.length; i++) {
+ edgeList.push(node.edges[i].id);
+ }
+ } else {
+ console.log('NodeId provided for getConnectedEdges does not exist. Provided: ', nodeId);
+ }
+ return edgeList;
+ }
+ }, {
+ key: 'moveNode',
+
+ /**
+ * Move a node.
+ * @param String nodeId
+ * @param Number x
+ * @param Number y
+ */
+ value: function moveNode(nodeId, x, y) {
+ var _this4 = this;
+
+ if (this.body.nodes[nodeId] !== undefined) {
+ this.body.nodes[nodeId].x = Number(x);
+ this.body.nodes[nodeId].y = Number(y);
+ setTimeout(function () {
+ _this4.body.emitter.emit('startSimulation');
+ }, 0);
+ } else {
+ console.log('Node id supplied to moveNode does not exist. Provided: ', nodeId);
+ }
+ }
+ }]);
+
+ return NodesHandler;
+ })();
+
+ exports['default'] = NodesHandler;
+ module.exports = exports['default'];
+
+/***/ },
+/* 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; }; })();
+
+ 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 _sharedLabel = __webpack_require__(63);
+
+ var _sharedLabel2 = _interopRequireDefault(_sharedLabel);
+
+ var _nodesShapesBox = __webpack_require__(64);
+
+ var _nodesShapesBox2 = _interopRequireDefault(_nodesShapesBox);
+
+ var _nodesShapesCircle = __webpack_require__(66);
+
+ var _nodesShapesCircle2 = _interopRequireDefault(_nodesShapesCircle);
+
+ var _nodesShapesCircularImage = __webpack_require__(68);
+
+ var _nodesShapesCircularImage2 = _interopRequireDefault(_nodesShapesCircularImage);
+
+ var _nodesShapesDatabase = __webpack_require__(69);
+
+ var _nodesShapesDatabase2 = _interopRequireDefault(_nodesShapesDatabase);
+
+ var _nodesShapesDiamond = __webpack_require__(70);
+
+ var _nodesShapesDiamond2 = _interopRequireDefault(_nodesShapesDiamond);
+
+ var _nodesShapesDot = __webpack_require__(72);
+
+ var _nodesShapesDot2 = _interopRequireDefault(_nodesShapesDot);
+
+ var _nodesShapesEllipse = __webpack_require__(73);
+
+ var _nodesShapesEllipse2 = _interopRequireDefault(_nodesShapesEllipse);
+
+ var _nodesShapesIcon = __webpack_require__(74);
+
+ var _nodesShapesIcon2 = _interopRequireDefault(_nodesShapesIcon);
+
+ var _nodesShapesImage = __webpack_require__(75);
+
+ var _nodesShapesImage2 = _interopRequireDefault(_nodesShapesImage);
+
+ var _nodesShapesSquare = __webpack_require__(76);
+
+ var _nodesShapesSquare2 = _interopRequireDefault(_nodesShapesSquare);
+
+ var _nodesShapesStar = __webpack_require__(77);
+
+ var _nodesShapesStar2 = _interopRequireDefault(_nodesShapesStar);
+
+ var _nodesShapesText = __webpack_require__(78);
+
+ var _nodesShapesText2 = _interopRequireDefault(_nodesShapesText);
+
+ var _nodesShapesTriangle = __webpack_require__(79);
+
+ var _nodesShapesTriangle2 = _interopRequireDefault(_nodesShapesTriangle);
+
+ var _nodesShapesTriangleDown = __webpack_require__(80);
+
+ var _nodesShapesTriangleDown2 = _interopRequireDefault(_nodesShapesTriangleDown);
+
+ var _sharedValidator = __webpack_require__(47);
+
+ var _sharedValidator2 = _interopRequireDefault(_sharedValidator);
+
+ var util = __webpack_require__(1);
+
+ /**
+ * @class Node
+ * A node. A node can be connected to other nodes via one or multiple edges.
+ * @param {object} options An object containing options for the node. All
+ * options are optional, except for the id.
+ * {number} id Id of the node. Required
+ * {string} label Text label for the node
+ * {number} x Horizontal position of the node
+ * {number} y Vertical position of the node
+ * {string} shape Node shape, available:
+ * "database", "circle", "ellipse",
+ * "box", "image", "text", "dot",
+ * "star", "triangle", "triangleDown",
+ * "square", "icon"
+ * {string} image An image url
+ * {string} title An title text, can be HTML
+ * {anytype} group A group name or number
+ * @param {Network.Images} imagelist A list with images. Only needed
+ * when the node has an image
+ * @param {Network.Groups} grouplist A list with groups. Needed for
+ * retrieving group options
+ * @param {Object} constants An object with default values for
+ * example for the color
+ *
+ */
+
+ var Node = (function () {
+ function Node(options, body, imagelist, grouplist, globalOptions) {
+ _classCallCheck(this, Node);
+
+ this.options = util.bridgeObject(globalOptions);
+ this.globalOptions = globalOptions;
+ this.body = body;
+
+ this.edges = []; // all edges connected to this node
+
+ // set defaults for the options
+ this.id = undefined;
+ this.imagelist = imagelist;
+ this.grouplist = grouplist;
+
+ // state options
+ this.x = undefined;
+ this.y = undefined;
+ this.baseSize = this.options.size;
+ this.baseFontSize = this.options.font.size;
+ this.predefinedPosition = false; // used to check if initial fit should just take the range or approximate
+ this.selected = false;
+ this.hover = false;
+
+ this.labelModule = new _sharedLabel2['default'](this.body, this.options);
+ this.setOptions(options);
+ }
+
+ _createClass(Node, [{
+ key: 'attachEdge',
+
+ /**
+ * Attach a edge to the node
+ * @param {Edge} edge
+ */
+ value: function attachEdge(edge) {
+ if (this.edges.indexOf(edge) === -1) {
+ this.edges.push(edge);
+ }
+ }
+ }, {
+ key: 'detachEdge',
+
+ /**
+ * Detach a edge from the node
+ * @param {Edge} edge
+ */
+ value: function detachEdge(edge) {
+ var index = this.edges.indexOf(edge);
+ if (index != -1) {
+ this.edges.splice(index, 1);
+ }
+ }
+ }, {
+ key: 'setOptions',
+
+ /**
+ * Set or overwrite options for the node
+ * @param {Object} options an object with options
+ * @param {Object} constants and object with default, global options
+ */
+ value: function setOptions(options) {
+ var currentShape = this.options.shape;
+ if (!options) {
+ return;
+ }
+ // basic options
+ if (options.id !== undefined) {
+ this.id = options.id;
+ }
+
+ if (this.id === undefined) {
+ throw 'Node must have an id';
+ }
+
+ // set these options locally
+ // clear x and y positions
+ if (options.x !== undefined) {
+ if (options.x === null) {
+ this.x = undefined;this.predefinedPosition = false;
+ } else {
+ this.x = parseInt(options.x);this.predefinedPosition = true;
+ }
+ }
+ if (options.y !== undefined) {
+ if (options.y === null) {
+ this.y = undefined;this.predefinedPosition = false;
+ } else {
+ this.y = parseInt(options.y);this.predefinedPosition = true;
+ }
+ }
+ if (options.size !== undefined) {
+ this.baseSize = options.size;
+ }
+ if (options.value !== undefined) {
+ options.value = parseFloat(options.value);
+ }
+
+ // copy group options
+ if (typeof options.group === 'number' || typeof options.group === 'string' && options.group != '') {
+ var groupObj = this.grouplist.get(options.group);
+ util.deepExtend(this.options, groupObj);
+ // the color object needs to be completely defined. Since groups can partially overwrite the colors, we parse it again, just in case.
+ this.options.color = util.parseColor(this.options.color);
+ }
+
+ // this transforms all shorthands into fully defined options
+ Node.parseOptions(this.options, options, true, this.globalOptions);
+
+ // load the images
+ if (this.options.image !== undefined) {
+ if (this.imagelist) {
+ this.imageObj = this.imagelist.load(this.options.image, this.options.brokenImage, this.id);
+ } else {
+ throw 'No imagelist provided';
+ }
+ }
+
+ this.updateLabelModule();
+ this.updateShape(currentShape);
+
+ if (options.hidden !== undefined || options.physics !== undefined) {
+ return true;
+ }
+ return false;
+ }
+ }, {
+ key: 'updateLabelModule',
+ value: function updateLabelModule() {
+ if (this.options.label === undefined || this.options.label === null) {
+ this.options.label = '';
+ }
+ this.labelModule.setOptions(this.options, true);
+ if (this.labelModule.baseSize !== undefined) {
+ this.baseFontSize = this.labelModule.baseSize;
+ }
+ }
+ }, {
+ key: 'updateShape',
+ value: function updateShape(currentShape) {
+ if (currentShape === this.options.shape && this.shape) {
+ this.shape.setOptions(this.options, this.imageObj);
+ } else {
+ // choose draw method depending on the shape
+ switch (this.options.shape) {
+ case 'box':
+ this.shape = new _nodesShapesBox2['default'](this.options, this.body, this.labelModule);
+ break;
+ case 'circle':
+ this.shape = new _nodesShapesCircle2['default'](this.options, this.body, this.labelModule);
+ break;
+ case 'circularImage':
+ this.shape = new _nodesShapesCircularImage2['default'](this.options, this.body, this.labelModule, this.imageObj);
+ break;
+ case 'database':
+ this.shape = new _nodesShapesDatabase2['default'](this.options, this.body, this.labelModule);
+ break;
+ case 'diamond':
+ this.shape = new _nodesShapesDiamond2['default'](this.options, this.body, this.labelModule);
+ break;
+ case 'dot':
+ this.shape = new _nodesShapesDot2['default'](this.options, this.body, this.labelModule);
+ break;
+ case 'ellipse':
+ this.shape = new _nodesShapesEllipse2['default'](this.options, this.body, this.labelModule);
+ break;
+ case 'icon':
+ this.shape = new _nodesShapesIcon2['default'](this.options, this.body, this.labelModule);
+ break;
+ case 'image':
+ this.shape = new _nodesShapesImage2['default'](this.options, this.body, this.labelModule, this.imageObj);
+ break;
+ case 'square':
+ this.shape = new _nodesShapesSquare2['default'](this.options, this.body, this.labelModule);
+ break;
+ case 'star':
+ this.shape = new _nodesShapesStar2['default'](this.options, this.body, this.labelModule);
+ break;
+ case 'text':
+ this.shape = new _nodesShapesText2['default'](this.options, this.body, this.labelModule);
+ break;
+ case 'triangle':
+ this.shape = new _nodesShapesTriangle2['default'](this.options, this.body, this.labelModule);
+ break;
+ case 'triangleDown':
+ this.shape = new _nodesShapesTriangleDown2['default'](this.options, this.body, this.labelModule);
+ break;
+ default:
+ this.shape = new _nodesShapesEllipse2['default'](this.options, this.body, this.labelModule);
+ break;
+ }
+ }
+ this._reset();
+ }
+ }, {
+ key: 'select',
+
+ /**
+ * select this node
+ */
+ value: function select() {
+ this.selected = true;
+ this._reset();
+ }
+ }, {
+ key: 'unselect',
+
+ /**
+ * unselect this node
+ */
+ value: function unselect() {
+ this.selected = false;
+ this._reset();
+ }
+ }, {
+ key: '_reset',
+
+ /**
+ * Reset the calculated size of the node, forces it to recalculate its size
+ * @private
+ */
+ value: function _reset() {
+ this.shape.width = undefined;
+ this.shape.height = undefined;
+ }
+ }, {
+ key: 'getTitle',
+
+ /**
+ * get the title of this node.
+ * @return {string} title The title of the node, or undefined when no title
+ * has been set.
+ */
+ value: function getTitle() {
+ return this.options.title;
+ }
+ }, {
+ key: 'distanceToBorder',
+
+ /**
+ * Calculate the distance to the border of the Node
+ * @param {CanvasRenderingContext2D} ctx
+ * @param {Number} angle Angle in radians
+ * @returns {number} distance Distance to the border in pixels
+ */
+ value: function distanceToBorder(ctx, angle) {
+ return this.shape.distanceToBorder(ctx, angle);
+ }
+ }, {
+ key: 'isFixed',
+
+ /**
+ * Check if this node has a fixed x and y position
+ * @return {boolean} true if fixed, false if not
+ */
+ value: function isFixed() {
+ return this.options.fixed.x && this.options.fixed.y;
+ }
+ }, {
+ key: 'isSelected',
+
+ /**
+ * check if this node is selecte
+ * @return {boolean} selected True if node is selected, else false
+ */
+ value: function isSelected() {
+ return this.selected;
+ }
+ }, {
+ key: 'getValue',
+
+ /**
+ * Retrieve the value of the node. Can be undefined
+ * @return {Number} value
+ */
+ value: function getValue() {
+ return this.options.value;
+ }
+ }, {
+ key: 'setValueRange',
+
+ /**
+ * Adjust the value range of the node. The node will adjust it's size
+ * based on its value.
+ * @param {Number} min
+ * @param {Number} max
+ */
+ value: function setValueRange(min, max, total) {
+ if (this.options.value !== undefined) {
+ var scale = this.options.scaling.customScalingFunction(min, max, total, this.options.value);
+ var sizeDiff = this.options.scaling.max - this.options.scaling.min;
+ if (this.options.scaling.label.enabled === true) {
+ var fontDiff = this.options.scaling.label.max - this.options.scaling.label.min;
+ this.options.font.size = this.options.scaling.label.min + scale * fontDiff;
+ }
+ this.options.size = this.options.scaling.min + scale * sizeDiff;
+ } else {
+ this.options.size = this.baseSize;
+ this.options.font.size = this.baseFontSize;
+ }
+ }
+ }, {
+ key: 'draw',
+
+ /**
+ * Draw this node in the given canvas
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
+ * @param {CanvasRenderingContext2D} ctx
+ */
+ value: function draw(ctx) {
+ this.shape.draw(ctx, this.x, this.y, this.selected, this.hover);
+ }
+ }, {
+ key: 'updateBoundingBox',
+
+ /**
+ * Update the bounding box of the shape
+ */
+ value: function updateBoundingBox(ctx) {
+ this.shape.updateBoundingBox(this.x, this.y, ctx);
+ }
+ }, {
+ key: 'resize',
+
+ /**
+ * Recalculate the size of this node in the given canvas
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
+ * @param {CanvasRenderingContext2D} ctx
+ */
+ value: function resize(ctx) {
+ this.shape.resize(ctx, this.selected);
+ }
+ }, {
+ key: 'isOverlappingWith',
+
+ /**
+ * Check if this object is overlapping with the provided object
+ * @param {Object} obj an object with parameters left, top, right, bottom
+ * @return {boolean} True if location is located on node
+ */
+ value: function isOverlappingWith(obj) {
+ return this.shape.left < obj.right && this.shape.left + this.shape.width > obj.left && this.shape.top < obj.bottom && this.shape.top + this.shape.height > obj.top;
+ }
+ }, {
+ key: 'isBoundingBoxOverlappingWith',
+
+ /**
+ * Check if this object is overlapping with the provided object
+ * @param {Object} obj an object with parameters left, top, right, bottom
+ * @return {boolean} True if location is located on node
+ */
+ value: function isBoundingBoxOverlappingWith(obj) {
+ return this.shape.boundingBox.left < obj.right && this.shape.boundingBox.right > obj.left && this.shape.boundingBox.top < obj.bottom && this.shape.boundingBox.bottom > obj.top;
+ }
+ }], [{
+ key: 'parseOptions',
+
+ /**
+ * This process all possible shorthands in the new options and makes sure that the parentOptions are fully defined.
+ * Static so it can also be used by the handler.
+ * @param parentOptions
+ * @param newOptions
+ */
+ value: function parseOptions(parentOptions, newOptions) {
+ var allowDeletion = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+ var globalOptions = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
+
+ var fields = ['color', 'font', 'fixed', 'shadow'];
+ util.selectiveNotDeepExtend(fields, parentOptions, newOptions, allowDeletion);
+
+ // merge the shadow options into the parent.
+ util.mergeOptions(parentOptions, newOptions, 'shadow', allowDeletion, globalOptions);
+
+ // individual shape newOptions
+ if (newOptions.color !== undefined && newOptions.color !== null) {
+ var parsedColor = util.parseColor(newOptions.color);
+ util.fillIfDefined(parentOptions.color, parsedColor);
+ } else if (allowDeletion === true && newOptions.color === null) {
+ parentOptions.color = Object.create(globalOptions.color); // this sets the pointer of the option back to the global option.
+ }
+
+ // handle the fixed options
+ if (newOptions.fixed !== undefined && newOptions.fixed !== null) {
+ if (typeof newOptions.fixed === 'boolean') {
+ parentOptions.fixed.x = newOptions.fixed;
+ parentOptions.fixed.y = newOptions.fixed;
+ } else {
+ if (newOptions.fixed.x !== undefined && typeof newOptions.fixed.x === 'boolean') {
+ parentOptions.fixed.x = newOptions.fixed.x;
+ }
+ if (newOptions.fixed.y !== undefined && typeof newOptions.fixed.y === 'boolean') {
+ parentOptions.fixed.y = newOptions.fixed.y;
+ }
+ }
+ }
+
+ // handle the font options
+ if (newOptions.font !== undefined && newOptions.font !== null) {
+ _sharedLabel2['default'].parseOptions(parentOptions.font, newOptions);
+ } else if (allowDeletion === true && newOptions.font === null) {
+ parentOptions.font = Object.create(globalOptions.font); // this sets the pointer of the option back to the global option.
+ }
+
+ // handle the scaling options, specifically the label part
+ if (newOptions.scaling !== undefined) {
+ util.mergeOptions(parentOptions.scaling, newOptions.scaling, 'label', allowDeletion, globalOptions.scaling);
+ }
+ }
+ }]);
+
+ return Node;
+ })();
+
+ exports['default'] = Node;
+ module.exports = exports['default'];
+
+/***/ },
+/* 63 */
+/***/ 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; }; })();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ var util = __webpack_require__(1);
+
+ var Label = (function () {
+ function Label(body, options) {
+ _classCallCheck(this, Label);
+
+ this.body = body;
+
+ this.pointToSelf = false;
+ this.baseSize = undefined;
+ this.fontOptions = {};
+ this.setOptions(options);
+ this.size = { top: 0, left: 0, width: 0, height: 0, yLine: 0 }; // could be cached
+ }
+
+ _createClass(Label, [{
+ key: 'setOptions',
+ value: function setOptions(options) {
+ var allowDeletion = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ this.nodeOptions = options;
+
+ // We want to keep the font options seperated from the node options.
+ // The node options have to mirror the globals when they are not overruled.
+ this.fontOptions = util.deepExtend({}, options.font, true);
+
+ if (options.label !== undefined) {
+ this.labelDirty = true;
+ }
+
+ if (options.font !== undefined) {
+ Label.parseOptions(this.fontOptions, options, allowDeletion);
+ if (typeof options.font === 'string') {
+ this.baseSize = this.fontOptions.size;
+ } else if (typeof options.font === 'object') {
+ if (options.font.size !== undefined) {
+ this.baseSize = options.font.size;
+ }
+ }
+ }
+ }
+ }, {
+ key: 'draw',
+
+ /**
+ * Main function. This is called from anything that wants to draw a label.
+ * @param ctx
+ * @param x
+ * @param y
+ * @param selected
+ * @param baseline
+ */
+ value: function draw(ctx, x, y, selected) {
+ var baseline = arguments.length <= 4 || arguments[4] === undefined ? 'middle' : arguments[4];
+
+ // if no label, return
+ if (this.nodeOptions.label === undefined) return;
+
+ // check if we have to render the label
+ var viewFontSize = this.fontOptions.size * this.body.view.scale;
+ if (this.nodeOptions.label && viewFontSize < this.nodeOptions.scaling.label.drawThreshold - 1) return;
+
+ // update the size cache if required
+ this.calculateLabelSize(ctx, selected, x, y, baseline);
+
+ // create the fontfill background
+ this._drawBackground(ctx);
+ // draw text
+ this._drawText(ctx, selected, x, y, baseline);
+ }
+ }, {
+ key: '_drawBackground',
+
+ /**
+ * Draws the label background
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+ value: function _drawBackground(ctx) {
+ if (this.fontOptions.background !== undefined && this.fontOptions.background !== 'none') {
+ ctx.fillStyle = this.fontOptions.background;
+
+ var lineMargin = 2;
+
+ switch (this.fontOptions.align) {
+ case 'middle':
+ ctx.fillRect(-this.size.width * 0.5, -this.size.height * 0.5, this.size.width, this.size.height);
+ break;
+ case 'top':
+ ctx.fillRect(-this.size.width * 0.5, -(this.size.height + lineMargin), this.size.width, this.size.height);
+ break;
+ case 'bottom':
+ ctx.fillRect(-this.size.width * 0.5, lineMargin, this.size.width, this.size.height);
+ break;
+ default:
+ ctx.fillRect(this.size.left, this.size.top - 0.5 * lineMargin, this.size.width, this.size.height);
+ break;
+ }
+ }
+ }
+ }, {
+ key: '_drawText',
+
+ /**
+ *
+ * @param ctx
+ * @param x
+ * @param baseline
+ * @private
+ */
+ value: function _drawText(ctx, selected, x, y) {
+ var baseline = arguments.length <= 4 || arguments[4] === undefined ? 'middle' : arguments[4];
+
+ var fontSize = this.fontOptions.size;
+ var viewFontSize = fontSize * this.body.view.scale;
+ // this ensures that there will not be HUGE letters on screen by setting an upper limit on the visible text size (regardless of zoomLevel)
+ if (viewFontSize >= this.nodeOptions.scaling.label.maxVisible) {
+ fontSize = Number(this.nodeOptions.scaling.label.maxVisible) / this.body.view.scale;
+ }
+
+ var yLine = this.size.yLine;
+
+ var _getColor2 = this._getColor(viewFontSize);
+
+ var _getColor22 = _slicedToArray(_getColor2, 2);
+
+ var fontColor = _getColor22[0];
+ var strokeColor = _getColor22[1];
+
+ var _setAlignment2 = this._setAlignment(ctx, x, yLine, baseline);
+
+ var _setAlignment22 = _slicedToArray(_setAlignment2, 2);
+
+ x = _setAlignment22[0];
+ yLine = _setAlignment22[1];
+
+ // configure context for drawing the text
+ ctx.font = (selected && this.nodeOptions.labelHighlightBold ? 'bold ' : '') + fontSize + 'px ' + this.fontOptions.face;
+ ctx.fillStyle = fontColor;
+ ctx.textAlign = 'center';
+
+ // set the strokeWidth
+ if (this.fontOptions.strokeWidth > 0) {
+ ctx.lineWidth = this.fontOptions.strokeWidth;
+ ctx.strokeStyle = strokeColor;
+ ctx.lineJoin = 'round';
+ }
+
+ // draw the text
+ for (var i = 0; i < this.lineCount; i++) {
+ if (this.fontOptions.strokeWidth > 0) {
+ ctx.strokeText(this.lines[i], x, yLine);
+ }
+ ctx.fillText(this.lines[i], x, yLine);
+ yLine += fontSize;
+ }
+ }
+ }, {
+ key: '_setAlignment',
+ value: function _setAlignment(ctx, x, yLine, baseline) {
+ // check for label alignment (for edges)
+ // TODO: make alignment for nodes
+ if (this.fontOptions.align !== 'horizontal' && this.pointToSelf === false) {
+ x = 0;
+ yLine = 0;
+
+ var lineMargin = 2;
+ if (this.fontOptions.align === 'top') {
+ ctx.textBaseline = 'alphabetic';
+ yLine -= 2 * lineMargin; // distance from edge, required because we use alphabetic. Alphabetic has less difference between browsers
+ } else if (this.fontOptions.align === 'bottom') {
+ ctx.textBaseline = 'hanging';
+ yLine += 2 * lineMargin; // distance from edge, required because we use hanging. Hanging has less difference between browsers
+ } else {
+ ctx.textBaseline = 'middle';
+ }
+ } else {
+ ctx.textBaseline = baseline;
+ }
+
+ return [x, yLine];
+ }
+ }, {
+ key: '_getColor',
+
+ /**
+ * fade in when relative scale is between threshold and threshold - 1.
+ * If the relative scale would be smaller than threshold -1 the draw function would have returned before coming here.
+ *
+ * @param viewFontSize
+ * @returns {*[]}
+ * @private
+ */
+ value: function _getColor(viewFontSize) {
+ var fontColor = this.fontOptions.color || '#000000';
+ var strokeColor = this.fontOptions.strokeColor || '#ffffff';
+ if (viewFontSize <= this.nodeOptions.scaling.label.drawThreshold) {
+ var opacity = Math.max(0, Math.min(1, 1 - (this.nodeOptions.scaling.label.drawThreshold - viewFontSize)));
+ fontColor = util.overrideOpacity(fontColor, opacity);
+ strokeColor = util.overrideOpacity(strokeColor, opacity);
+ }
+ return [fontColor, strokeColor];
+ }
+ }, {
+ key: 'getTextSize',
+
+ /**
+ *
+ * @param ctx
+ * @param selected
+ * @returns {{width: number, height: number}}
+ */
+ value: function getTextSize(ctx) {
+ var selected = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ var size = {
+ width: this._processLabel(ctx, selected),
+ height: this.fontOptions.size * this.lineCount,
+ lineCount: this.lineCount
+ };
+ return size;
+ }
+ }, {
+ key: 'calculateLabelSize',
+
+ /**
+ *
+ * @param ctx
+ * @param selected
+ * @param x
+ * @param y
+ * @param baseline
+ */
+ value: function calculateLabelSize(ctx, selected) {
+ var x = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];
+ var y = arguments.length <= 3 || arguments[3] === undefined ? 0 : arguments[3];
+ var baseline = arguments.length <= 4 || arguments[4] === undefined ? 'middle' : arguments[4];
+
+ if (this.labelDirty === true) {
+ this.size.width = this._processLabel(ctx, selected);
+ }
+ this.size.height = this.fontOptions.size * this.lineCount;
+ this.size.left = x - this.size.width * 0.5;
+ this.size.top = y - this.size.height * 0.5;
+ this.size.yLine = y + (1 - this.lineCount) * 0.5 * this.fontOptions.size;
+ if (baseline === 'hanging') {
+ this.size.top += 0.5 * this.fontOptions.size;
+ this.size.top += 4; // distance from node, required because we use hanging. Hanging has less difference between browsers
+ this.size.yLine += 4; // distance from node
+ }
+
+ this.labelDirty = false;
+ }
+ }, {
+ key: '_processLabel',
+
+ /**
+ * This calculates the width as well as explodes the label string and calculates the amount of lines.
+ * @param ctx
+ * @param selected
+ * @returns {number}
+ * @private
+ */
+ value: function _processLabel(ctx, selected) {
+ var width = 0;
+ var lines = [''];
+ var lineCount = 0;
+ if (this.nodeOptions.label !== undefined) {
+ lines = String(this.nodeOptions.label).split('\n');
+ lineCount = lines.length;
+ ctx.font = (selected && this.nodeOptions.labelHighlightBold ? 'bold ' : '') + this.fontOptions.size + 'px ' + this.fontOptions.face;
+ width = ctx.measureText(lines[0]).width;
+ for (var i = 1; i < lineCount; i++) {
+ var lineWidth = ctx.measureText(lines[i]).width;
+ width = lineWidth > width ? lineWidth : width;
+ }
+ }
+ this.lines = lines;
+ this.lineCount = lineCount;
+
+ return width;
+ }
+ }], [{
+ key: 'parseOptions',
+ value: function parseOptions(parentOptions, newOptions) {
+ var allowDeletion = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+
+ if (typeof newOptions.font === 'string') {
+ var newOptionsArray = newOptions.font.split(' ');
+ parentOptions.size = newOptionsArray[0].replace('px', '');
+ parentOptions.face = newOptionsArray[1];
+ parentOptions.color = newOptionsArray[2];
+ } else if (typeof newOptions.font === 'object') {
+ util.fillIfDefined(parentOptions, newOptions.font, allowDeletion);
+ }
+ parentOptions.size = Number(parentOptions.size);
+ }
+ }]);
+
+ return Label;
+ })();
+
+ exports['default'] = Label;
+ module.exports = exports['default'];
+
+/***/ },
+/* 64 */
+/***/ 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilNodeBase = __webpack_require__(65);
+
+ var _utilNodeBase2 = _interopRequireDefault(_utilNodeBase);
+
+ var Box = (function (_NodeBase) {
+ _inherits(Box, _NodeBase);
+
+ function Box(options, body, labelModule) {
+ _classCallCheck(this, Box);
+
+ _get(Object.getPrototypeOf(Box.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(Box, [{
+ key: 'resize',
+ value: function resize(ctx, selected) {
+ if (this.width === undefined) {
+ var margin = 5;
+ var textSize = this.labelModule.getTextSize(ctx, selected);
+ this.width = textSize.width + 2 * margin;
+ this.height = textSize.height + 2 * margin;
+ this.radius = 0.5 * this.width;
+ }
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this.resize(ctx, selected);
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ var borderWidth = this.options.borderWidth;
+ var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth;
+
+ ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border;
+ ctx.lineWidth = selected ? selectionLineWidth : borderWidth;
+ ctx.lineWidth /= this.body.view.scale;
+ ctx.lineWidth = Math.min(this.width, ctx.lineWidth);
+
+ ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background;
+
+ var borderRadius = this.options.shapeProperties.borderRadius; // only effective for box
+ ctx.roundRect(this.left, this.top, this.width, this.height, borderRadius);
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ // draw the background
+ ctx.fill();
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+
+ //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.
+ ctx.save();
+ this.enableBorderDashes(ctx);
+ //draw the border
+ ctx.stroke();
+ //disable dashed border for other elements
+ this.disableBorderDashes(ctx);
+ ctx.restore();
+
+ this.updateBoundingBox(x, y, ctx, selected);
+ this.labelModule.draw(ctx, x, y, selected);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y, ctx, selected) {
+ this.resize(ctx, selected);
+ this.left = x - this.width * 0.5;
+ this.top = y - this.height * 0.5;
+
+ this.boundingBox.left = this.left;
+ this.boundingBox.top = this.top;
+ this.boundingBox.bottom = this.top + this.height;
+ this.boundingBox.right = this.left + this.width;
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ this.resize(ctx);
+ var a = this.width / 2;
+ var b = this.height / 2;
+ var w = Math.sin(angle) * a;
+ var h = Math.cos(angle) * b;
+ return a * b / Math.sqrt(w * w + h * h);
+ }
+ }]);
+
+ return Box;
+ })(_utilNodeBase2['default']);
+
+ exports['default'] = Box;
+ module.exports = exports['default'];
+
+/***/ },
+/* 65 */
+/***/ 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 NodeBase = (function () {
+ function NodeBase(options, body, labelModule) {
+ _classCallCheck(this, NodeBase);
+
+ this.body = body;
+ this.labelModule = labelModule;
+ this.setOptions(options);
+ this.top = undefined;
+ this.left = undefined;
+ this.height = undefined;
+ this.width = undefined;
+ this.radius = undefined;
+ this.boundingBox = { top: 0, left: 0, right: 0, bottom: 0 };
+ }
+
+ _createClass(NodeBase, [{
+ key: 'setOptions',
+ value: function setOptions(options) {
+ this.options = options;
+ }
+ }, {
+ key: '_distanceToBorder',
+ value: function _distanceToBorder(ctx, angle) {
+ var borderWidth = 1;
+ this.resize(ctx);
+ return Math.min(Math.abs(this.width / 2 / Math.cos(angle)), Math.abs(this.height / 2 / Math.sin(angle))) + borderWidth;
+ }
+ }, {
+ key: 'enableShadow',
+ value: function enableShadow(ctx) {
+ if (this.options.shadow.enabled === true) {
+ ctx.shadowColor = 'rgba(0,0,0,0.5)';
+ ctx.shadowBlur = this.options.shadow.size;
+ ctx.shadowOffsetX = this.options.shadow.x;
+ ctx.shadowOffsetY = this.options.shadow.y;
+ }
+ }
+ }, {
+ key: 'disableShadow',
+ value: function disableShadow(ctx) {
+ if (this.options.shadow.enabled === true) {
+ ctx.shadowColor = 'rgba(0,0,0,0)';
+ ctx.shadowBlur = 0;
+ ctx.shadowOffsetX = 0;
+ ctx.shadowOffsetY = 0;
+ }
+ }
+ }, {
+ key: 'enableBorderDashes',
+ value: function enableBorderDashes(ctx) {
+ if (this.options.shapeProperties.borderDashes !== false) {
+ if (ctx.setLineDash !== undefined) {
+ var dashes = this.options.shapeProperties.borderDashes;
+ if (dashes === true) {
+ dashes = [5, 15];
+ }
+ ctx.setLineDash(dashes);
+ } else {
+ console.warn('setLineDash is not supported in this browser. The dashed borders cannot be used.');
+ this.options.shapeProperties.borderDashes = false;
+ }
+ }
+ }
+ }, {
+ key: 'disableBorderDashes',
+ value: function disableBorderDashes(ctx) {
+ if (this.options.shapeProperties.borderDashes !== false) {
+ if (ctx.setLineDash !== undefined) {
+ ctx.setLineDash([0]);
+ } else {
+ console.warn('setLineDash is not supported in this browser. The dashed borders cannot be used.');
+ this.options.shapeProperties.borderDashes = false;
+ }
+ }
+ }
+ }]);
+
+ return NodeBase;
+ })();
+
+ exports['default'] = NodeBase;
+ module.exports = exports['default'];
+
+/***/ },
+/* 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 _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilCircleImageBase = __webpack_require__(67);
+
+ var _utilCircleImageBase2 = _interopRequireDefault(_utilCircleImageBase);
+
+ var Circle = (function (_CircleImageBase) {
+ _inherits(Circle, _CircleImageBase);
+
+ function Circle(options, body, labelModule) {
+ _classCallCheck(this, Circle);
+
+ _get(Object.getPrototypeOf(Circle.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(Circle, [{
+ key: 'resize',
+ value: function resize(ctx, selected) {
+ if (this.width === undefined) {
+ var margin = 5;
+ var textSize = this.labelModule.getTextSize(ctx, selected);
+ var diameter = Math.max(textSize.width, textSize.height) + 2 * margin;
+ this.options.size = diameter / 2;
+
+ this.width = diameter;
+ this.height = diameter;
+ this.radius = 0.5 * this.width;
+ }
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this.resize(ctx, selected);
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ this._drawRawCircle(ctx, x, y, selected, hover, this.options.size);
+
+ this.boundingBox.top = y - this.options.size;
+ this.boundingBox.left = x - this.options.size;
+ this.boundingBox.right = x + this.options.size;
+ this.boundingBox.bottom = y + this.options.size;
+
+ this.updateBoundingBox(x, y);
+ this.labelModule.draw(ctx, x, y, selected);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y) {
+ this.boundingBox.top = y - this.options.size;
+ this.boundingBox.left = x - this.options.size;
+ this.boundingBox.right = x + this.options.size;
+ this.boundingBox.bottom = y + this.options.size;
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ this.resize(ctx);
+ var a = this.width / 2;
+ var b = this.height / 2;
+ var w = Math.sin(angle) * a;
+ var h = Math.cos(angle) * b;
+ return a * b / Math.sqrt(w * w + h * h);
+ }
+ }]);
+
+ return Circle;
+ })(_utilCircleImageBase2['default']);
+
+ exports['default'] = Circle;
+ module.exports = exports['default'];
+
+/***/ },
+/* 67 */
+/***/ 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilNodeBase = __webpack_require__(65);
+
+ var _utilNodeBase2 = _interopRequireDefault(_utilNodeBase);
+
+ var CircleImageBase = (function (_NodeBase) {
+ _inherits(CircleImageBase, _NodeBase);
+
+ function CircleImageBase(options, body, labelModule) {
+ _classCallCheck(this, CircleImageBase);
+
+ _get(Object.getPrototypeOf(CircleImageBase.prototype), 'constructor', this).call(this, options, body, labelModule);
+ this.labelOffset = 0;
+ this.imageLoaded = false;
+ }
+
+ _createClass(CircleImageBase, [{
+ key: 'setOptions',
+ value: function setOptions(options, imageObj) {
+ this.options = options;
+ if (imageObj) {
+ this.imageObj = imageObj;
+ }
+ }
+ }, {
+ key: '_resizeImage',
+
+ /**
+ * This function resizes the image by the options size when the image has not yet loaded. If the image has loaded, we
+ * force the update of the size again.
+ *
+ * @private
+ */
+ value: function _resizeImage() {
+ var force = false;
+ if (!this.imageObj.width || !this.imageObj.height) {
+ // undefined or 0
+ this.imageLoaded = false;
+ } else if (this.imageLoaded === false) {
+ this.imageLoaded = true;
+ force = true;
+ }
+
+ if (!this.width || !this.height || force === true) {
+ // undefined or 0
+ var width, height, ratio;
+ if (this.imageObj.width && this.imageObj.height) {
+ // not undefined or 0
+ width = 0;
+ height = 0;
+ }
+ if (this.options.shapeProperties.useImageSize === false) {
+ if (this.imageObj.width > this.imageObj.height) {
+ ratio = this.imageObj.width / this.imageObj.height;
+ width = this.options.size * 2 * ratio || this.imageObj.width;
+ height = this.options.size * 2 || this.imageObj.height;
+ } else {
+ if (this.imageObj.width && this.imageObj.height) {
+ // not undefined or 0
+ ratio = this.imageObj.height / this.imageObj.width;
+ } else {
+ ratio = 1;
+ }
+ width = this.options.size * 2;
+ height = this.options.size * 2 * ratio;
+ }
+ } else {
+ // when not using the size property, we use the image size
+ width = this.imageObj.width;
+ height = this.imageObj.height;
+ }
+ this.width = width;
+ this.height = height;
+ this.radius = 0.5 * this.width;
+ }
+ }
+ }, {
+ key: '_drawRawCircle',
+ value: function _drawRawCircle(ctx, x, y, selected, hover, size) {
+ var borderWidth = this.options.borderWidth;
+ var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth;
+
+ ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border;
+
+ ctx.lineWidth = selected ? selectionLineWidth : borderWidth;
+ ctx.lineWidth *= this.networkScaleInv;
+ ctx.lineWidth = Math.min(this.width, ctx.lineWidth);
+ ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background;
+ ctx.circle(x, y, size);
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ // draw the background
+ ctx.fill();
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+
+ //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.
+ ctx.save();
+ this.enableBorderDashes(ctx);
+ //draw the border
+ ctx.stroke();
+ //disable dashed border for other elements
+ this.disableBorderDashes(ctx);
+ ctx.restore();
+ }
+ }, {
+ key: '_drawImageAtPosition',
+ value: function _drawImageAtPosition(ctx) {
+ if (this.imageObj.width != 0) {
+ // draw the image
+ ctx.globalAlpha = 1.0;
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+
+ // draw image
+ ctx.drawImage(this.imageObj, this.left, this.top, this.width, this.height);
+
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+ }
+ }
+ }, {
+ key: '_drawImageLabel',
+ value: function _drawImageLabel(ctx, x, y, selected) {
+ var yLabel;
+ var offset = 0;
+
+ if (this.height !== undefined) {
+ offset = this.height * 0.5;
+ var labelDimensions = this.labelModule.getTextSize(ctx);
+ if (labelDimensions.lineCount >= 1) {
+ offset += labelDimensions.height / 2;
+ }
+ }
+
+ yLabel = y + offset;
+
+ if (this.options.label) {
+ this.labelOffset = offset;
+ }
+ this.labelModule.draw(ctx, x, yLabel, selected, 'hanging');
+ }
+ }]);
+
+ return CircleImageBase;
+ })(_utilNodeBase2['default']);
+
+ exports['default'] = CircleImageBase;
+ module.exports = exports['default'];
+
+/***/ },
+/* 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilCircleImageBase = __webpack_require__(67);
+
+ var _utilCircleImageBase2 = _interopRequireDefault(_utilCircleImageBase);
+
+ var CircularImage = (function (_CircleImageBase) {
+ _inherits(CircularImage, _CircleImageBase);
+
+ function CircularImage(options, body, labelModule, imageObj) {
+ _classCallCheck(this, CircularImage);
+
+ _get(Object.getPrototypeOf(CircularImage.prototype), 'constructor', this).call(this, options, body, labelModule);
+ this.imageObj = imageObj;
+ this._swapToImageResizeWhenImageLoaded = true;
+ }
+
+ _createClass(CircularImage, [{
+ key: 'resize',
+ value: function resize() {
+ if (this.imageObj.src === undefined || this.imageObj.width === undefined || this.imageObj.height === undefined) {
+ if (!this.width) {
+ var diameter = this.options.size * 2;
+ this.width = diameter;
+ this.height = diameter;
+ this._swapToImageResizeWhenImageLoaded = true;
+ this.radius = 0.5 * this.width;
+ }
+ } else {
+ if (this._swapToImageResizeWhenImageLoaded) {
+ this.width = undefined;
+ this.height = undefined;
+ this._swapToImageResizeWhenImageLoaded = false;
+ }
+ this._resizeImage();
+ }
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this.resize();
+
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ var size = Math.min(0.5 * this.height, 0.5 * this.width);
+
+ // draw the backgroun circle. IMPORTANT: the stroke in this method is used by the clip method below.
+ this._drawRawCircle(ctx, x, y, selected, hover, size);
+
+ // now we draw in the cicle, we save so we can revert the clip operation after drawing.
+ ctx.save();
+ // clip is used to use the stroke in drawRawCircle as an area that we can draw in.
+ ctx.clip();
+ // draw the image
+ this._drawImageAtPosition(ctx);
+ // restore so we can again draw on the full canvas
+ ctx.restore();
+
+ this._drawImageLabel(ctx, x, y, selected);
+
+ this.updateBoundingBox(x, y);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y) {
+ this.boundingBox.top = y - this.options.size;
+ this.boundingBox.left = x - this.options.size;
+ this.boundingBox.right = x + this.options.size;
+ this.boundingBox.bottom = y + this.options.size;
+ this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left);
+ this.boundingBox.right = Math.max(this.boundingBox.right, this.labelModule.size.left + this.labelModule.size.width);
+ this.boundingBox.bottom = Math.max(this.boundingBox.bottom, this.boundingBox.bottom + this.labelOffset);
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ this.resize(ctx);
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return CircularImage;
+ })(_utilCircleImageBase2['default']);
+
+ exports['default'] = CircularImage;
+ module.exports = exports['default'];
+
+/***/ },
+/* 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilNodeBase = __webpack_require__(65);
+
+ var _utilNodeBase2 = _interopRequireDefault(_utilNodeBase);
+
+ var Database = (function (_NodeBase) {
+ _inherits(Database, _NodeBase);
+
+ function Database(options, body, labelModule) {
+ _classCallCheck(this, Database);
+
+ _get(Object.getPrototypeOf(Database.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(Database, [{
+ key: 'resize',
+ value: function resize(ctx, selected) {
+ if (this.width === undefined) {
+ var margin = 5;
+ var textSize = this.labelModule.getTextSize(ctx, selected);
+ var size = textSize.width + 2 * margin;
+ this.width = size;
+ this.height = size;
+ this.radius = 0.5 * this.width;
+ }
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this.resize(ctx, selected);
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ var borderWidth = this.options.borderWidth;
+ var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth;
+
+ ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border;
+ ctx.lineWidth = this.selected ? selectionLineWidth : borderWidth;
+ ctx.lineWidth *= this.networkScaleInv;
+ ctx.lineWidth = Math.min(this.width, ctx.lineWidth);
+
+ ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background;
+ ctx.database(x - this.width / 2, y - this.height * 0.5, this.width, this.height);
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ // draw the background
+ ctx.fill();
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+
+ //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.
+ ctx.save();
+ this.enableBorderDashes(ctx);
+ //draw the border
+ ctx.stroke();
+ //disable dashed border for other elements
+ this.disableBorderDashes(ctx);
+ ctx.restore();
+
+ this.updateBoundingBox(x, y, ctx, selected);
+ this.labelModule.draw(ctx, x, y, selected);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y, ctx, selected) {
+ this.resize(ctx, selected);
+
+ this.left = x - this.width * 0.5;
+ this.top = y - this.height * 0.5;
+
+ this.boundingBox.left = this.left;
+ this.boundingBox.top = this.top;
+ this.boundingBox.bottom = this.top + this.height;
+ this.boundingBox.right = this.left + this.width;
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ this.resize(ctx);
+ var a = this.width / 2;
+ var b = this.height / 2;
+ var w = Math.sin(angle) * a;
+ var h = Math.cos(angle) * b;
+ return a * b / Math.sqrt(w * w + h * h);
+ }
+ }]);
+
+ return Database;
+ })(_utilNodeBase2['default']);
+
+ exports['default'] = Database;
+ module.exports = exports['default'];
+
+/***/ },
+/* 70 */
+/***/ 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilShapeBase = __webpack_require__(71);
+
+ var _utilShapeBase2 = _interopRequireDefault(_utilShapeBase);
+
+ var Diamond = (function (_ShapeBase) {
+ _inherits(Diamond, _ShapeBase);
+
+ function Diamond(options, body, labelModule) {
+ _classCallCheck(this, Diamond);
+
+ _get(Object.getPrototypeOf(Diamond.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(Diamond, [{
+ key: 'resize',
+ value: function resize(ctx) {
+ this._resizeShape();
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this._drawShape(ctx, 'diamond', 4, x, y, selected, hover);
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return Diamond;
+ })(_utilShapeBase2['default']);
+
+ exports['default'] = Diamond;
+ module.exports = exports['default'];
+
+/***/ },
+/* 71 */
+/***/ 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilNodeBase = __webpack_require__(65);
+
+ var _utilNodeBase2 = _interopRequireDefault(_utilNodeBase);
+
+ var ShapeBase = (function (_NodeBase) {
+ _inherits(ShapeBase, _NodeBase);
+
+ function ShapeBase(options, body, labelModule) {
+ _classCallCheck(this, ShapeBase);
+
+ _get(Object.getPrototypeOf(ShapeBase.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(ShapeBase, [{
+ key: '_resizeShape',
+ value: function _resizeShape() {
+ if (this.width === undefined) {
+ var size = 2 * this.options.size;
+ this.width = size;
+ this.height = size;
+ this.radius = 0.5 * this.width;
+ }
+ }
+ }, {
+ key: '_drawShape',
+ value: function _drawShape(ctx, shape, sizeMultiplier, x, y, selected, hover) {
+ this._resizeShape();
+
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ var borderWidth = this.options.borderWidth;
+ var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth;
+
+ ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border;
+ ctx.lineWidth = selected ? selectionLineWidth : borderWidth;
+ ctx.lineWidth /= this.body.view.scale;
+ ctx.lineWidth = Math.min(this.width, ctx.lineWidth);
+ ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background;
+ ctx[shape](x, y, this.options.size);
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ // draw the background
+ ctx.fill();
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+
+ //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.
+ ctx.save();
+ this.enableBorderDashes(ctx);
+ //draw the border
+ ctx.stroke();
+ //disable dashed border for other elements
+ this.disableBorderDashes(ctx);
+ ctx.restore();
+
+ if (this.options.label !== undefined) {
+ var yLabel = y + 0.5 * this.height + 3; // the + 3 is to offset it a bit below the node.
+ this.labelModule.draw(ctx, x, yLabel, selected, 'hanging');
+ }
+
+ this.updateBoundingBox(x, y);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y) {
+ this.boundingBox.top = y - this.options.size;
+ this.boundingBox.left = x - this.options.size;
+ this.boundingBox.right = x + this.options.size;
+ this.boundingBox.bottom = y + this.options.size;
+
+ if (this.options.label !== undefined && this.labelModule.size.width > 0) {
+ this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left);
+ this.boundingBox.right = Math.max(this.boundingBox.right, this.labelModule.size.left + this.labelModule.size.width);
+ this.boundingBox.bottom = Math.max(this.boundingBox.bottom, this.boundingBox.bottom + this.labelModule.size.height + 3);
+ }
+ }
+ }]);
+
+ return ShapeBase;
+ })(_utilNodeBase2['default']);
+
+ exports['default'] = ShapeBase;
+ module.exports = exports['default'];
+
+/***/ },
+/* 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilShapeBase = __webpack_require__(71);
+
+ var _utilShapeBase2 = _interopRequireDefault(_utilShapeBase);
+
+ var Dot = (function (_ShapeBase) {
+ _inherits(Dot, _ShapeBase);
+
+ function Dot(options, body, labelModule) {
+ _classCallCheck(this, Dot);
+
+ _get(Object.getPrototypeOf(Dot.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(Dot, [{
+ key: 'resize',
+ value: function resize(ctx) {
+ this._resizeShape();
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this._drawShape(ctx, 'circle', 2, x, y, selected, hover);
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ this.resize(ctx);
+ return this.options.size + this.options.borderWidth;
+ }
+ }]);
+
+ return Dot;
+ })(_utilShapeBase2['default']);
+
+ exports['default'] = Dot;
+ module.exports = exports['default'];
+
+/***/ },
+/* 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilNodeBase = __webpack_require__(65);
+
+ var _utilNodeBase2 = _interopRequireDefault(_utilNodeBase);
+
+ var Ellipse = (function (_NodeBase) {
+ _inherits(Ellipse, _NodeBase);
+
+ function Ellipse(options, body, labelModule) {
+ _classCallCheck(this, Ellipse);
+
+ _get(Object.getPrototypeOf(Ellipse.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(Ellipse, [{
+ key: 'resize',
+ value: function resize(ctx, selected) {
+ if (this.width === undefined) {
+ var textSize = this.labelModule.getTextSize(ctx, selected);
+
+ this.width = textSize.width * 1.5;
+ this.height = textSize.height * 2;
+ if (this.width < this.height) {
+ this.width = this.height;
+ }
+ this.radius = 0.5 * this.width;
+ }
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this.resize(ctx, selected);
+ this.left = x - this.width * 0.5;
+ this.top = y - this.height * 0.5;
+
+ var borderWidth = this.options.borderWidth;
+ var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth;
+
+ ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border;
+
+ ctx.lineWidth = selected ? selectionLineWidth : borderWidth;
+ ctx.lineWidth /= this.body.view.scale;
+ ctx.lineWidth = Math.min(this.width, ctx.lineWidth);
+
+ ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background;
+ ctx.ellipse(this.left, this.top, this.width, this.height);
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ // draw the background
+ ctx.fill();
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+
+ //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.
+ ctx.save();
+ this.enableBorderDashes(ctx);
+ //draw the border
+ ctx.stroke();
+ //disable dashed border for other elements
+ this.disableBorderDashes(ctx);
+ ctx.restore();
+
+ this.updateBoundingBox(x, y, ctx, selected);
+ this.labelModule.draw(ctx, x, y, selected);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y, ctx, selected) {
+ this.resize(ctx, selected); // just in case
+
+ this.left = x - this.width * 0.5;
+ this.top = y - this.height * 0.5;
+
+ this.boundingBox.left = this.left;
+ this.boundingBox.top = this.top;
+ this.boundingBox.bottom = this.top + this.height;
+ this.boundingBox.right = this.left + this.width;
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ this.resize(ctx);
+ var a = this.width * 0.5;
+ var b = this.height * 0.5;
+ var w = Math.sin(angle) * a;
+ var h = Math.cos(angle) * b;
+ return a * b / Math.sqrt(w * w + h * h);
+ }
+ }]);
+
+ return Ellipse;
+ })(_utilNodeBase2['default']);
+
+ exports['default'] = Ellipse;
+ module.exports = exports['default'];
+
+/***/ },
+/* 74 */
+/***/ 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilNodeBase = __webpack_require__(65);
+
+ var _utilNodeBase2 = _interopRequireDefault(_utilNodeBase);
+
+ var Icon = (function (_NodeBase) {
+ _inherits(Icon, _NodeBase);
+
+ function Icon(options, body, labelModule) {
+ _classCallCheck(this, Icon);
+
+ _get(Object.getPrototypeOf(Icon.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(Icon, [{
+ key: 'resize',
+ value: function resize(ctx) {
+ if (this.width === undefined) {
+ var margin = 5;
+ var iconSize = {
+ width: Number(this.options.icon.size),
+ height: Number(this.options.icon.size)
+ };
+ this.width = iconSize.width + 2 * margin;
+ this.height = iconSize.height + 2 * margin;
+ this.radius = 0.5 * this.width;
+ }
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this.resize(ctx);
+ this.options.icon.size = this.options.icon.size || 50;
+
+ this.left = x - this.width * 0.5;
+ this.top = y - this.height * 0.5;
+ this._icon(ctx, x, y, selected);
+
+ if (this.options.label !== undefined) {
+ var iconTextSpacing = 5;
+ this.labelModule.draw(ctx, x, y + this.height * 0.5 + iconTextSpacing, selected);
+ }
+
+ this.updateBoundingBox(x, y);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y) {
+ this.boundingBox.top = y - this.options.icon.size * 0.5;
+ this.boundingBox.left = x - this.options.icon.size * 0.5;
+ this.boundingBox.right = x + this.options.icon.size * 0.5;
+ this.boundingBox.bottom = y + this.options.icon.size * 0.5;
+
+ if (this.options.label !== undefined && this.labelModule.size.width > 0) {
+ var iconTextSpacing = 5;
+ this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left);
+ this.boundingBox.right = Math.max(this.boundingBox.right, this.labelModule.size.left + this.labelModule.size.width);
+ this.boundingBox.bottom = Math.max(this.boundingBox.bottom, this.boundingBox.bottom + this.labelModule.size.height + iconTextSpacing);
+ }
+ }
+ }, {
+ key: '_icon',
+ value: function _icon(ctx, x, y, selected) {
+ var iconSize = Number(this.options.icon.size);
+
+ if (this.options.icon.code !== undefined) {
+ ctx.font = (selected ? 'bold ' : '') + iconSize + 'px ' + this.options.icon.face;
+
+ // draw icon
+ ctx.fillStyle = this.options.icon.color || 'black';
+ ctx.textAlign = 'center';
+ ctx.textBaseline = 'middle';
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ ctx.fillText(this.options.icon.code, x, y);
+
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+ } else {
+ console.error('When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.');
+ }
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return Icon;
+ })(_utilNodeBase2['default']);
+
+ exports['default'] = Icon;
+ module.exports = exports['default'];
+
+/***/ },
+/* 75 */
+/***/ 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilCircleImageBase = __webpack_require__(67);
+
+ var _utilCircleImageBase2 = _interopRequireDefault(_utilCircleImageBase);
+
+ var Image = (function (_CircleImageBase) {
+ _inherits(Image, _CircleImageBase);
+
+ function Image(options, body, labelModule, imageObj) {
+ _classCallCheck(this, Image);
+
+ _get(Object.getPrototypeOf(Image.prototype), 'constructor', this).call(this, options, body, labelModule);
+ this.imageObj = imageObj;
+ }
+
+ _createClass(Image, [{
+ key: 'resize',
+ value: function resize() {
+ this._resizeImage();
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this.resize();
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ if (this.options.shapeProperties.useBorderWithImage === true) {
+ var borderWidth = this.options.borderWidth;
+
+ var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth;
+
+ ctx.beginPath();
+
+ // setup the line properties.
+ ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border;
+ ctx.lineWidth = selected ? selectionLineWidth : borderWidth;
+ ctx.lineWidth /= this.body.view.scale;
+ ctx.lineWidth = Math.min(this.width, ctx.lineWidth);
+
+ // set a fillstyle
+ ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background;
+
+ // draw a rectangle to form the border around. This rectangle is filled so the opacity of a picture (in future vis releases?) can be used to tint the image
+ ctx.rect(this.left - 0.5 * ctx.lineWidth, this.top - 0.5 * ctx.lineWidth, this.width + ctx.lineWidth, this.height + ctx.lineWidth);
+ ctx.fill();
+
+ //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.
+ ctx.save();
+ this.enableBorderDashes(ctx);
+ //draw the border
+ ctx.stroke();
+ //disable dashed border for other elements
+ this.disableBorderDashes(ctx);
+ ctx.restore();
+
+ ctx.closePath();
+ }
+
+ this._drawImageAtPosition(ctx);
+
+ this._drawImageLabel(ctx, x, y, selected || hover);
+
+ this.updateBoundingBox(x, y);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y) {
+ this.resize();
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ this.boundingBox.top = this.top;
+ this.boundingBox.left = this.left;
+ this.boundingBox.right = this.left + this.width;
+ this.boundingBox.bottom = this.top + this.height;
+
+ if (this.options.label !== undefined && this.labelModule.size.width > 0) {
+ this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left);
+ this.boundingBox.right = Math.max(this.boundingBox.right, this.labelModule.size.left + this.labelModule.size.width);
+ this.boundingBox.bottom = Math.max(this.boundingBox.bottom, this.boundingBox.bottom + this.labelOffset);
+ }
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ this.resize(ctx);
+ var a = this.width / 2;
+ var b = this.height / 2;
+ var w = Math.sin(angle) * a;
+ var h = Math.cos(angle) * b;
+ return a * b / Math.sqrt(w * w + h * h);
+ }
+ }]);
+
+ return Image;
+ })(_utilCircleImageBase2['default']);
+
+ exports['default'] = Image;
+ module.exports = exports['default'];
+
+/***/ },
+/* 76 */
+/***/ 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilShapeBase = __webpack_require__(71);
+
+ var _utilShapeBase2 = _interopRequireDefault(_utilShapeBase);
+
+ var Square = (function (_ShapeBase) {
+ _inherits(Square, _ShapeBase);
+
+ function Square(options, body, labelModule) {
+ _classCallCheck(this, Square);
+
+ _get(Object.getPrototypeOf(Square.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(Square, [{
+ key: 'resize',
+ value: function resize() {
+ this._resizeShape();
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this._drawShape(ctx, 'square', 2, x, y, selected, hover);
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return Square;
+ })(_utilShapeBase2['default']);
+
+ exports['default'] = Square;
+ module.exports = exports['default'];
+
+/***/ },
+/* 77 */
+/***/ 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilShapeBase = __webpack_require__(71);
+
+ var _utilShapeBase2 = _interopRequireDefault(_utilShapeBase);
+
+ var Star = (function (_ShapeBase) {
+ _inherits(Star, _ShapeBase);
+
+ function Star(options, body, labelModule) {
+ _classCallCheck(this, Star);
+
+ _get(Object.getPrototypeOf(Star.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(Star, [{
+ key: 'resize',
+ value: function resize(ctx) {
+ this._resizeShape();
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this._drawShape(ctx, 'star', 4, x, y, selected, hover);
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return Star;
+ })(_utilShapeBase2['default']);
+
+ exports['default'] = Star;
+ module.exports = exports['default'];
+
+/***/ },
+/* 78 */
+/***/ 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilNodeBase = __webpack_require__(65);
+
+ var _utilNodeBase2 = _interopRequireDefault(_utilNodeBase);
+
+ var Text = (function (_NodeBase) {
+ _inherits(Text, _NodeBase);
+
+ function Text(options, body, labelModule) {
+ _classCallCheck(this, Text);
+
+ _get(Object.getPrototypeOf(Text.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(Text, [{
+ key: 'resize',
+ value: function resize(ctx, selected) {
+ if (this.width === undefined) {
+ var margin = 5;
+ var textSize = this.labelModule.getTextSize(ctx, selected);
+ this.width = textSize.width + 2 * margin;
+ this.height = textSize.height + 2 * margin;
+ this.radius = 0.5 * this.width;
+ }
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this.resize(ctx, selected || hover);
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ this.labelModule.draw(ctx, x, y, selected || hover);
+
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+
+ this.updateBoundingBox(x, y, ctx, selected);
+ }
+ }, {
+ key: 'updateBoundingBox',
+ value: function updateBoundingBox(x, y, ctx, selected) {
+ this.resize(ctx, selected);
+
+ this.left = x - this.width / 2;
+ this.top = y - this.height / 2;
+
+ this.boundingBox.top = this.top;
+ this.boundingBox.left = this.left;
+ this.boundingBox.right = this.left + this.width;
+ this.boundingBox.bottom = this.top + this.height;
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return Text;
+ })(_utilNodeBase2['default']);
+
+ exports['default'] = Text;
+ module.exports = exports['default'];
+
+/***/ },
+/* 79 */
+/***/ 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilShapeBase = __webpack_require__(71);
+
+ var _utilShapeBase2 = _interopRequireDefault(_utilShapeBase);
+
+ var Triangle = (function (_ShapeBase) {
+ _inherits(Triangle, _ShapeBase);
+
+ function Triangle(options, body, labelModule) {
+ _classCallCheck(this, Triangle);
+
+ _get(Object.getPrototypeOf(Triangle.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(Triangle, [{
+ key: 'resize',
+ value: function resize(ctx) {
+ this._resizeShape();
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this._drawShape(ctx, 'triangle', 3, x, y, selected, hover);
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return Triangle;
+ })(_utilShapeBase2['default']);
+
+ exports['default'] = Triangle;
+ module.exports = exports['default'];
+
+/***/ },
+/* 80 */
+/***/ 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilShapeBase = __webpack_require__(71);
+
+ var _utilShapeBase2 = _interopRequireDefault(_utilShapeBase);
+
+ var TriangleDown = (function (_ShapeBase) {
+ _inherits(TriangleDown, _ShapeBase);
+
+ function TriangleDown(options, body, labelModule) {
+ _classCallCheck(this, TriangleDown);
+
+ _get(Object.getPrototypeOf(TriangleDown.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(TriangleDown, [{
+ key: 'resize',
+ value: function resize(ctx) {
+ this._resizeShape();
+ }
+ }, {
+ key: 'draw',
+ value: function draw(ctx, x, y, selected, hover) {
+ this._drawShape(ctx, 'triangleDown', 3, x, y, selected, hover);
+ }
+ }, {
+ key: 'distanceToBorder',
+ value: function distanceToBorder(ctx, angle) {
+ return this._distanceToBorder(ctx, angle);
+ }
+ }]);
+
+ return TriangleDown;
+ })(_utilShapeBase2['default']);
+
+ exports['default'] = TriangleDown;
+ module.exports = exports['default'];
+
+/***/ },
+/* 81 */
+/***/ 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 _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 _componentsEdge = __webpack_require__(82);
+
+ var _componentsEdge2 = _interopRequireDefault(_componentsEdge);
+
+ var _componentsSharedLabel = __webpack_require__(63);
+
+ var _componentsSharedLabel2 = _interopRequireDefault(_componentsSharedLabel);
+
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(8);
+ var DataView = __webpack_require__(10);
+
+ var EdgesHandler = (function () {
+ function EdgesHandler(body, images, groups) {
+ var _this = this;
+
+ _classCallCheck(this, EdgesHandler);
+
+ this.body = body;
+ this.images = images;
+ this.groups = groups;
+
+ // create the edge API in the body container
+ this.body.functions.createEdge = this.create.bind(this);
+
+ this.edgesListeners = {
+ add: function add(event, params) {
+ _this.add(params.items);
+ },
+ update: function update(event, params) {
+ _this.update(params.items);
+ },
+ remove: function remove(event, params) {
+ _this.remove(params.items);
+ }
+ };
+
+ this.options = {};
+ this.defaultOptions = {
+ arrows: {
+ to: { enabled: false, scaleFactor: 1 }, // boolean / {arrowScaleFactor:1} / {enabled: false, arrowScaleFactor:1}
+ middle: { enabled: false, scaleFactor: 1 },
+ from: { enabled: false, scaleFactor: 1 }
+ },
+ color: {
+ color: '#848484',
+ highlight: '#848484',
+ hover: '#848484',
+ inherit: 'from',
+ opacity: 1.0
+ },
+ dashes: false,
+ font: {
+ color: '#343434',
+ size: 14, // px
+ face: 'arial',
+ background: 'none',
+ strokeWidth: 2, // px
+ strokeColor: '#ffffff',
+ align: 'horizontal'
+ },
+ hidden: false,
+ hoverWidth: 1.5,
+ label: undefined,
+ labelHighlightBold: true,
+ length: undefined,
+ physics: true,
+ scaling: {
+ min: 1,
+ max: 15,
+ label: {
+ enabled: true,
+ min: 14,
+ max: 30,
+ maxVisible: 30,
+ drawThreshold: 5
+ },
+ customScalingFunction: function customScalingFunction(min, max, total, value) {
+ if (max === min) {
+ return 0.5;
+ } else {
+ var scale = 1 / (max - min);
+ return Math.max(0, (value - min) * scale);
+ }
+ }
+ },
+ selectionWidth: 1.5,
+ selfReferenceSize: 20,
+ shadow: {
+ enabled: false,
+ size: 10,
+ x: 5,
+ y: 5
+ },
+ smooth: {
+ enabled: true,
+ type: 'dynamic',
+ forceDirection: 'none',
+ roundness: 0.5
+ },
+ title: undefined,
+ width: 1,
+ value: undefined
+ };
+
+ util.extend(this.options, this.defaultOptions);
+
+ this.bindEventListeners();
+ }
+
+ _createClass(EdgesHandler, [{
+ key: 'bindEventListeners',
+ value: function bindEventListeners() {
+ var _this2 = this;
+
+ // this allows external modules to force all dynamic curves to turn static.
+ this.body.emitter.on('_forceDisableDynamicCurves', function (type) {
+ if (type === 'dynamic') {
+ type = 'continuous';
+ }
+ var emitChange = false;
+ for (var edgeId in _this2.body.edges) {
+ if (_this2.body.edges.hasOwnProperty(edgeId)) {
+ var edge = _this2.body.edges[edgeId];
+ var edgeData = _this2.body.data.edges._data[edgeId];
+
+ // only forcilby remove the smooth curve if the data has been set of the edge has the smooth curves defined.
+ // this is because a change in the global would not affect these curves.
+ if (edgeData !== undefined) {
+ var edgeOptions = edgeData.smooth;
+ if (edgeOptions !== undefined) {
+ if (edgeOptions.enabled === true && edgeOptions.type === 'dynamic') {
+ if (type === undefined) {
+ edge.setOptions({ smooth: false });
+ } else {
+ edge.setOptions({ smooth: { type: type } });
+ }
+ emitChange = true;
+ }
+ }
+ }
+ }
+ }
+ if (emitChange === true) {
+ _this2.body.emitter.emit('_dataChanged');
+ }
+ });
+
+ // this is called when options of EXISTING nodes or edges have changed.
+ this.body.emitter.on('_dataUpdated', function () {
+ _this2.reconnectEdges();
+ _this2.markAllEdgesAsDirty();
+ });
+
+ // refresh the edges. Used when reverting from hierarchical layout
+ this.body.emitter.on('refreshEdges', this.refresh.bind(this));
+ this.body.emitter.on('refresh', this.refresh.bind(this));
+ this.body.emitter.on('destroy', function () {
+ delete _this2.body.functions.createEdge;
+ delete _this2.edgesListeners.add;
+ delete _this2.edgesListeners.update;
+ delete _this2.edgesListeners.remove;
+ delete _this2.edgesListeners;
+ });
+ }
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options) {
+ if (options !== undefined) {
+ // use the parser from the Edge class to fill in all shorthand notations
+ _componentsEdge2['default'].parseOptions(this.options, options);
+
+ // hanlde multiple input cases for color
+ if (options.color !== undefined) {
+ this.markAllEdgesAsDirty();
+ }
+
+ // update smooth settings in all edges
+ var dataChanged = false;
+ if (options.smooth !== undefined) {
+ for (var edgeId in this.body.edges) {
+ if (this.body.edges.hasOwnProperty(edgeId)) {
+ dataChanged = this.body.edges[edgeId].updateEdgeType() || dataChanged;
+ }
+ }
+ }
+
+ // update fonts in all edges
+ if (options.font !== undefined) {
+ // use the parser from the Label class to fill in all shorthand notations
+ _componentsSharedLabel2['default'].parseOptions(this.options.font, options);
+ for (var edgeId in this.body.edges) {
+ if (this.body.edges.hasOwnProperty(edgeId)) {
+ this.body.edges[edgeId].updateLabelModule();
+ }
+ }
+ }
+
+ // update the state of the variables if needed
+ if (options.hidden !== undefined || options.physics !== undefined || dataChanged === true) {
+ this.body.emitter.emit('_dataChanged');
+ }
+ }
+ }
+ }, {
+ key: 'setData',
+
+ /**
+ * Load edges by reading the data table
+ * @param {Array | DataSet | DataView} edges The data containing the edges.
+ * @private
+ * @private
+ */
+ value: function setData(edges) {
+ var _this3 = this;
+
+ var doNotEmit = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ var oldEdgesData = this.body.data.edges;
+
+ if (edges instanceof DataSet || edges instanceof DataView) {
+ this.body.data.edges = edges;
+ } else if (Array.isArray(edges)) {
+ this.body.data.edges = new DataSet();
+ this.body.data.edges.add(edges);
+ } else if (!edges) {
+ this.body.data.edges = new DataSet();
+ } else {
+ throw new TypeError('Array or DataSet expected');
+ }
+
+ // TODO: is this null or undefined or false?
+ if (oldEdgesData) {
+ // unsubscribe from old dataset
+ util.forEach(this.edgesListeners, function (callback, event) {
+ oldEdgesData.off(event, callback);
+ });
+ }
+
+ // remove drawn edges
+ this.body.edges = {};
+
+ // TODO: is this null or undefined or false?
+ if (this.body.data.edges) {
+ // subscribe to new dataset
+ util.forEach(this.edgesListeners, function (callback, event) {
+ _this3.body.data.edges.on(event, callback);
+ });
+
+ // draw all new nodes
+ var ids = this.body.data.edges.getIds();
+ this.add(ids, true);
+ }
+
+ if (doNotEmit === false) {
+ this.body.emitter.emit('_dataChanged');
+ }
+ }
+ }, {
+ key: 'add',
+
+ /**
+ * Add edges
+ * @param {Number[] | String[]} ids
+ * @private
+ */
+ value: function add(ids) {
+ var doNotEmit = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ var edges = this.body.edges;
+ var edgesData = this.body.data.edges;
+
+ for (var i = 0; i < ids.length; i++) {
+ var id = ids[i];
+
+ var oldEdge = edges[id];
+ if (oldEdge) {
+ oldEdge.disconnect();
+ }
+
+ var data = edgesData.get(id, { 'showInternalIds': true });
+ edges[id] = this.create(data);
+ }
+
+ if (doNotEmit === false) {
+ this.body.emitter.emit('_dataChanged');
+ }
+ }
+ }, {
+ key: 'update',
+
+ /**
+ * Update existing edges, or create them when not yet existing
+ * @param {Number[] | String[]} ids
+ * @private
+ */
+ value: function update(ids) {
+ var edges = this.body.edges;
+ var edgesData = this.body.data.edges;
+ var dataChanged = false;
+ for (var i = 0; i < ids.length; i++) {
+ var id = ids[i];
+ var data = edgesData.get(id);
+ var edge = edges[id];
+ if (edge !== undefined) {
+ // update edge
+ edge.disconnect();
+ dataChanged = edge.setOptions(data) || dataChanged; // if a support node is added, data can be changed.
+ edge.connect();
+ } else {
+ // create edge
+ this.body.edges[id] = this.create(data);
+ dataChanged = true;
+ }
+ }
+
+ if (dataChanged === true) {
+ this.body.emitter.emit('_dataChanged');
+ } else {
+ this.body.emitter.emit('_dataUpdated');
+ }
+ }
+ }, {
+ key: 'remove',
+
+ /**
+ * Remove existing edges. Non existing ids will be ignored
+ * @param {Number[] | String[]} ids
+ * @private
+ */
+ value: function remove(ids) {
+ var edges = this.body.edges;
+ for (var i = 0; i < ids.length; i++) {
+ var id = ids[i];
+ var edge = edges[id];
+ if (edge !== undefined) {
+ edge.cleanup();
+ edge.disconnect();
+ delete edges[id];
+ }
+ }
+
+ this.body.emitter.emit('_dataChanged');
+ }
+ }, {
+ key: 'refresh',
+ value: function refresh() {
+ var edges = this.body.edges;
+ for (var edgeId in edges) {
+ var edge = undefined;
+ if (edges.hasOwnProperty(edgeId)) {
+ edge = edges[edgeId];
+ }
+ var data = this.body.data.edges._data[edgeId];
+ if (edge !== undefined && data !== undefined) {
+ edge.setOptions(data);
+ }
+ }
+ }
+ }, {
+ key: 'create',
+ value: function create(properties) {
+ return new _componentsEdge2['default'](properties, this.body, this.options);
+ }
+ }, {
+ key: 'markAllEdgesAsDirty',
+ value: function markAllEdgesAsDirty() {
+ for (var edgeId in this.body.edges) {
+ this.body.edges[edgeId].edgeType.colorDirty = true;
+ }
+ }
+ }, {
+ key: 'reconnectEdges',
+
+ /**
+ * Reconnect all edges
+ * @private
+ */
+ value: function reconnectEdges() {
+ var id;
+ var nodes = this.body.nodes;
+ var edges = this.body.edges;
+
+ for (id in nodes) {
+ if (nodes.hasOwnProperty(id)) {
+ nodes[id].edges = [];
+ }
+ }
+
+ for (id in edges) {
+ if (edges.hasOwnProperty(id)) {
+ var edge = edges[id];
+ edge.from = null;
+ edge.to = null;
+ edge.connect();
+ }
+ }
+ }
+ }, {
+ key: 'getConnectedNodes',
+ value: function getConnectedNodes(edgeId) {
+ var nodeList = [];
+ if (this.body.edges[edgeId] !== undefined) {
+ var edge = this.body.edges[edgeId];
+ if (edge.fromId) {
+ nodeList.push(edge.fromId);
+ }
+ if (edge.toId) {
+ nodeList.push(edge.toId);
+ }
+ }
+ return nodeList;
+ }
+ }]);
+
+ return EdgesHandler;
+ })();
+
+ exports['default'] = EdgesHandler;
+ module.exports = exports['default'];
+
+/***/ },
+/* 82 */
+/***/ 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 _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 _sharedLabel = __webpack_require__(63);
+
+ var _sharedLabel2 = _interopRequireDefault(_sharedLabel);
+
+ var _edgesCubicBezierEdge = __webpack_require__(83);
+
+ var _edgesCubicBezierEdge2 = _interopRequireDefault(_edgesCubicBezierEdge);
+
+ var _edgesBezierEdgeDynamic = __webpack_require__(87);
+
+ var _edgesBezierEdgeDynamic2 = _interopRequireDefault(_edgesBezierEdgeDynamic);
+
+ var _edgesBezierEdgeStatic = __webpack_require__(88);
+
+ var _edgesBezierEdgeStatic2 = _interopRequireDefault(_edgesBezierEdgeStatic);
+
+ var _edgesStraightEdge = __webpack_require__(89);
+
+ var _edgesStraightEdge2 = _interopRequireDefault(_edgesStraightEdge);
+
+ var util = __webpack_require__(1);
+
+ /**
+ * @class Edge
+ *
+ * A edge connects two nodes
+ * @param {Object} properties Object with options. Must contain
+ * At least options from and to.
+ * Available options: from (number),
+ * to (number), label (string, color (string),
+ * width (number), style (string),
+ * length (number), title (string)
+ * @param {Network} network A Network object, used to find and edge to
+ * nodes.
+ * @param {Object} constants An object with default values for
+ * example for the color
+ */
+
+ var Edge = (function () {
+ function Edge(options, body, globalOptions) {
+ _classCallCheck(this, Edge);
+
+ if (body === undefined) {
+ throw 'No body provided';
+ }
+ this.options = util.bridgeObject(globalOptions);
+ this.globalOptions = globalOptions;
+ this.body = body;
+
+ // initialize variables
+ this.id = undefined;
+ this.fromId = undefined;
+ this.toId = undefined;
+ this.selected = false;
+ this.hover = false;
+ this.labelDirty = true;
+ this.colorDirty = true;
+
+ this.baseWidth = this.options.width;
+ this.baseFontSize = this.options.font.size;
+
+ this.from = undefined; // a node
+ this.to = undefined; // a node
+
+ this.edgeType = undefined;
+
+ this.connected = false;
+
+ this.labelModule = new _sharedLabel2['default'](this.body, this.options);
+
+ this.setOptions(options);
+ }
+
+ _createClass(Edge, [{
+ key: 'setOptions',
+
+ /**
+ * Set or overwrite options for the edge
+ * @param {Object} options an object with options
+ * @param doNotEmit
+ */
+ value: function setOptions(options) {
+ if (!options) {
+ return;
+ }
+ this.colorDirty = true;
+
+ Edge.parseOptions(this.options, options, true, this.globalOptions);
+
+ if (options.id !== undefined) {
+ this.id = options.id;
+ }
+ if (options.from !== undefined) {
+ this.fromId = options.from;
+ }
+ if (options.to !== undefined) {
+ this.toId = options.to;
+ }
+ if (options.title !== undefined) {
+ this.title = options.title;
+ }
+ if (options.value !== undefined) {
+ options.value = parseFloat(options.value);
+ }
+
+ // update label Module
+ this.updateLabelModule();
+
+ var dataChanged = this.updateEdgeType();
+
+ // if anything has been updates, reset the selection width and the hover width
+ this._setInteractionWidths();
+
+ // A node is connected when it has a from and to node that both exist in the network.body.nodes.
+ this.connect();
+
+ if (options.hidden !== undefined || options.physics !== undefined) {
+ dataChanged = true;
+ }
+
+ return dataChanged;
+ }
+ }, {
+ key: 'updateLabelModule',
+
+ /**
+ * update the options in the label module
+ */
+ value: function updateLabelModule() {
+ this.labelModule.setOptions(this.options, true);
+ if (this.labelModule.baseSize !== undefined) {
+ this.baseFontSize = this.labelModule.baseSize;
+ }
+ }
+ }, {
+ key: 'updateEdgeType',
+
+ /**
+ * update the edge type, set the options
+ * @returns {boolean}
+ */
+ value: function updateEdgeType() {
+ var dataChanged = false;
+ var changeInType = true;
+ var smooth = this.options.smooth;
+ if (this.edgeType !== undefined) {
+ if (this.edgeType instanceof _edgesBezierEdgeDynamic2['default'] && smooth.enabled === true && smooth.type === 'dynamic') {
+ changeInType = false;
+ }
+ if (this.edgeType instanceof _edgesCubicBezierEdge2['default'] && smooth.enabled === true && smooth.type === 'cubicBezier') {
+ changeInType = false;
+ }
+ if (this.edgeType instanceof _edgesBezierEdgeStatic2['default'] && smooth.enabled === true && smooth.type !== 'dynamic' && smooth.type !== 'cubicBezier') {
+ changeInType = false;
+ }
+ if (this.edgeType instanceof _edgesStraightEdge2['default'] && smooth.enabled === false) {
+ changeInType = false;
+ }
+
+ if (changeInType === true) {
+ dataChanged = this.cleanup();
+ }
+ }
+
+ if (changeInType === true) {
+ if (this.options.smooth.enabled === true) {
+ if (this.options.smooth.type === 'dynamic') {
+ dataChanged = true;
+ this.edgeType = new _edgesBezierEdgeDynamic2['default'](this.options, this.body, this.labelModule);
+ } else if (this.options.smooth.type === 'cubicBezier') {
+ this.edgeType = new _edgesCubicBezierEdge2['default'](this.options, this.body, this.labelModule);
+ } else {
+ this.edgeType = new _edgesBezierEdgeStatic2['default'](this.options, this.body, this.labelModule);
+ }
+ } else {
+ this.edgeType = new _edgesStraightEdge2['default'](this.options, this.body, this.labelModule);
+ }
+ } else {
+ // if nothing changes, we just set the options.
+ this.edgeType.setOptions(this.options);
+ }
+
+ return dataChanged;
+ }
+ }, {
+ key: 'connect',
+
+ /**
+ * Connect an edge to its nodes
+ */
+ value: function connect() {
+ this.disconnect();
+
+ this.from = this.body.nodes[this.fromId] || undefined;
+ this.to = this.body.nodes[this.toId] || undefined;
+ this.connected = this.from !== undefined && this.to !== undefined;
+
+ if (this.connected === true) {
+ this.from.attachEdge(this);
+ this.to.attachEdge(this);
+ } else {
+ if (this.from) {
+ this.from.detachEdge(this);
+ }
+ if (this.to) {
+ this.to.detachEdge(this);
+ }
+ }
+
+ this.edgeType.connect();
+ }
+ }, {
+ key: 'disconnect',
+
+ /**
+ * Disconnect an edge from its nodes
+ */
+ value: function disconnect() {
+ if (this.from) {
+ this.from.detachEdge(this);
+ this.from = undefined;
+ }
+ if (this.to) {
+ this.to.detachEdge(this);
+ this.to = undefined;
+ }
+
+ this.connected = false;
+ }
+ }, {
+ key: 'getTitle',
+
+ /**
+ * get the title of this edge.
+ * @return {string} title The title of the edge, or undefined when no title
+ * has been set.
+ */
+ value: function getTitle() {
+ return this.title;
+ }
+ }, {
+ key: 'isSelected',
+
+ /**
+ * check if this node is selecte
+ * @return {boolean} selected True if node is selected, else false
+ */
+ value: function isSelected() {
+ return this.selected;
+ }
+ }, {
+ key: 'getValue',
+
+ /**
+ * Retrieve the value of the edge. Can be undefined
+ * @return {Number} value
+ */
+ value: function getValue() {
+ return this.options.value;
+ }
+ }, {
+ key: 'setValueRange',
+
+ /**
+ * Adjust the value range of the edge. The edge will adjust it's width
+ * based on its value.
+ * @param {Number} min
+ * @param {Number} max
+ * @param total
+ */
+ value: function setValueRange(min, max, total) {
+ if (this.options.value !== undefined) {
+ var scale = this.options.scaling.customScalingFunction(min, max, total, this.options.value);
+ var widthDiff = this.options.scaling.max - this.options.scaling.min;
+ if (this.options.scaling.label.enabled === true) {
+ var fontDiff = this.options.scaling.label.max - this.options.scaling.label.min;
+ this.options.font.size = this.options.scaling.label.min + scale * fontDiff;
+ }
+ this.options.width = this.options.scaling.min + scale * widthDiff;
+ } else {
+ this.options.width = this.baseWidth;
+ this.options.font.size = this.baseFontSize;
+ }
+
+ this._setInteractionWidths();
+ }
+ }, {
+ key: '_setInteractionWidths',
+ value: function _setInteractionWidths() {
+ if (typeof this.options.hoverWidth === 'function') {
+ this.edgeType.hoverWidth = this.options.hoverWidth(this.options.width);
+ } else {
+ this.edgeType.hoverWidth = this.options.hoverWidth + this.options.width;
+ }
+
+ if (typeof this.options.selectionWidth === 'function') {
+ this.edgeType.selectionWidth = this.options.selectionWidth(this.options.width);
+ } else {
+ this.edgeType.selectionWidth = this.options.selectionWidth + this.options.width;
+ }
+ }
+ }, {
+ key: 'draw',
+
+ /**
+ * Redraw a edge
+ * Draw this edge in the given canvas
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
+ * @param {CanvasRenderingContext2D} ctx
+ */
+ value: function draw(ctx) {
+ var via = this.edgeType.drawLine(ctx, this.selected, this.hover);
+ this.drawArrows(ctx, via);
+ this.drawLabel(ctx, via);
+ }
+ }, {
+ key: 'drawArrows',
+ value: function drawArrows(ctx, viaNode) {
+ if (this.options.arrows.from.enabled === true) {
+ this.edgeType.drawArrowHead(ctx, 'from', viaNode, this.selected, this.hover);
+ }
+ if (this.options.arrows.middle.enabled === true) {
+ this.edgeType.drawArrowHead(ctx, 'middle', viaNode, this.selected, this.hover);
+ }
+ if (this.options.arrows.to.enabled === true) {
+ this.edgeType.drawArrowHead(ctx, 'to', viaNode, this.selected, this.hover);
+ }
+ }
+ }, {
+ key: 'drawLabel',
+ value: function drawLabel(ctx, viaNode) {
+ if (this.options.label !== undefined) {
+ // set style
+ var node1 = this.from;
+ var node2 = this.to;
+ var selected = this.from.selected || this.to.selected || this.selected;
+ if (node1.id != node2.id) {
+ this.labelModule.pointToSelf = false;
+ var point = this.edgeType.getPoint(0.5, viaNode);
+ ctx.save();
+
+ // if the label has to be rotated:
+ if (this.options.font.align !== 'horizontal') {
+ this.labelModule.calculateLabelSize(ctx, selected, point.x, point.y);
+ ctx.translate(point.x, this.labelModule.size.yLine);
+ this._rotateForLabelAlignment(ctx);
+ }
+
+ // draw the label
+ this.labelModule.draw(ctx, point.x, point.y, selected);
+ ctx.restore();
+ } else {
+ // Ignore the orientations.
+ this.labelModule.pointToSelf = true;
+ var x, y;
+ var radius = this.options.selfReferenceSize;
+ if (node1.shape.width > node1.shape.height) {
+ x = node1.x + node1.shape.width * 0.5;
+ y = node1.y - radius;
+ } else {
+ x = node1.x + radius;
+ y = node1.y - node1.shape.height * 0.5;
+ }
+ point = this._pointOnCircle(x, y, radius, 0.125);
+ this.labelModule.draw(ctx, point.x, point.y, selected);
+ }
+ }
+ }
+ }, {
+ key: 'isOverlappingWith',
+
+ /**
+ * Check if this object is overlapping with the provided object
+ * @param {Object} obj an object with parameters left, top
+ * @return {boolean} True if location is located on the edge
+ */
+ value: function isOverlappingWith(obj) {
+ if (this.connected) {
+ var distMax = 10;
+ var xFrom = this.from.x;
+ var yFrom = this.from.y;
+ var xTo = this.to.x;
+ var yTo = this.to.y;
+ var xObj = obj.left;
+ var yObj = obj.top;
+
+ var dist = this.edgeType.getDistanceToEdge(xFrom, yFrom, xTo, yTo, xObj, yObj);
+
+ return dist < distMax;
+ } else {
+ return false;
+ }
+ }
+ }, {
+ key: '_rotateForLabelAlignment',
+
+ /**
+ * Rotates the canvas so the text is most readable
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+ value: function _rotateForLabelAlignment(ctx) {
+ var dy = this.from.y - this.to.y;
+ var dx = this.from.x - this.to.x;
+ var angleInDegrees = Math.atan2(dy, dx);
+
+ // rotate so label it is readable
+ if (angleInDegrees < -1 && dx < 0 || angleInDegrees > 0 && dx < 0) {
+ angleInDegrees = angleInDegrees + Math.PI;
+ }
+
+ ctx.rotate(angleInDegrees);
+ }
+ }, {
+ key: '_pointOnCircle',
+
+ /**
+ * Get a point on a circle
+ * @param {Number} x
+ * @param {Number} y
+ * @param {Number} radius
+ * @param {Number} percentage. Value between 0 (line start) and 1 (line end)
+ * @return {Object} point
+ * @private
+ */
+ value: function _pointOnCircle(x, y, radius, percentage) {
+ var angle = percentage * 2 * Math.PI;
+ return {
+ x: x + radius * Math.cos(angle),
+ y: y - radius * Math.sin(angle)
+ };
+ }
+ }, {
+ key: 'select',
+ value: function select() {
+ this.selected = true;
+ }
+ }, {
+ key: 'unselect',
+ value: function unselect() {
+ this.selected = false;
+ }
+ }, {
+ key: 'cleanup',
+
+ /**
+ * cleans all required things on delete
+ * @returns {*}
+ */
+ value: function cleanup() {
+ return this.edgeType.cleanup();
+ }
+ }], [{
+ key: 'parseOptions',
+ value: function parseOptions(parentOptions, newOptions) {
+ var allowDeletion = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+ var globalOptions = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
+
+ var fields = ['id', 'from', 'hidden', 'hoverWidth', 'label', 'labelHighlightBold', 'length', 'line', 'opacity', 'physics', 'scaling', 'selectionWidth', 'selfReferenceSize', 'to', 'title', 'value', 'width'];
+
+ // only deep extend the items in the field array. These do not have shorthand.
+ util.selectiveDeepExtend(fields, parentOptions, newOptions, allowDeletion);
+
+ util.mergeOptions(parentOptions, newOptions, 'smooth', allowDeletion, globalOptions);
+ util.mergeOptions(parentOptions, newOptions, 'shadow', allowDeletion, globalOptions);
+
+ if (newOptions.dashes !== undefined && newOptions.dashes !== null) {
+ parentOptions.dashes = newOptions.dashes;
+ } else if (allowDeletion === true && newOptions.dashes === null) {
+ parentOptions.dashes = Object.create(globalOptions.dashes); // this sets the pointer of the option back to the global option.
+ }
+
+ // set the scaling newOptions
+ if (newOptions.scaling !== undefined && newOptions.scaling !== null) {
+ if (newOptions.scaling.min !== undefined) {
+ parentOptions.scaling.min = newOptions.scaling.min;
+ }
+ if (newOptions.scaling.max !== undefined) {
+ parentOptions.scaling.max = newOptions.scaling.max;
+ }
+ util.mergeOptions(parentOptions.scaling, newOptions.scaling, 'label', allowDeletion, globalOptions.scaling);
+ } else if (allowDeletion === true && newOptions.scaling === null) {
+ parentOptions.scaling = Object.create(globalOptions.scaling); // this sets the pointer of the option back to the global option.
+ }
+
+ // hanlde multiple input cases for arrows
+ if (newOptions.arrows !== undefined && newOptions.arrows !== null) {
+ if (typeof newOptions.arrows === 'string') {
+ var arrows = newOptions.arrows.toLowerCase();
+ if (arrows.indexOf('to') != -1) {
+ parentOptions.arrows.to.enabled = true;
+ }
+ if (arrows.indexOf('middle') != -1) {
+ parentOptions.arrows.middle.enabled = true;
+ }
+ if (arrows.indexOf('from') != -1) {
+ parentOptions.arrows.from.enabled = true;
+ }
+ } else if (typeof newOptions.arrows === 'object') {
+ util.mergeOptions(parentOptions.arrows, newOptions.arrows, 'to', allowDeletion, globalOptions.arrows);
+ util.mergeOptions(parentOptions.arrows, newOptions.arrows, 'middle', allowDeletion, globalOptions.arrows);
+ util.mergeOptions(parentOptions.arrows, newOptions.arrows, 'from', allowDeletion, globalOptions.arrows);
+ } else {
+ throw new Error('The arrow newOptions can only be an object or a string. Refer to the documentation. You used:' + JSON.stringify(newOptions.arrows));
+ }
+ } else if (allowDeletion === true && newOptions.arrows === null) {
+ parentOptions.arrows = Object.create(globalOptions.arrows); // this sets the pointer of the option back to the global option.
+ }
+
+ // hanlde multiple input cases for color
+ if (newOptions.color !== undefined && newOptions.color !== null) {
+ if (util.isString(newOptions.color)) {
+ parentOptions.color.color = newOptions.color;
+ parentOptions.color.highlight = newOptions.color;
+ parentOptions.color.hover = newOptions.color;
+ parentOptions.color.inherit = false;
+ } else {
+ var colorsDefined = false;
+ if (newOptions.color.color !== undefined) {
+ parentOptions.color.color = newOptions.color.color;colorsDefined = true;
+ }
+ if (newOptions.color.highlight !== undefined) {
+ parentOptions.color.highlight = newOptions.color.highlight;colorsDefined = true;
+ }
+ if (newOptions.color.hover !== undefined) {
+ parentOptions.color.hover = newOptions.color.hover;colorsDefined = true;
+ }
+ if (newOptions.color.inherit !== undefined) {
+ parentOptions.color.inherit = newOptions.color.inherit;
+ }
+ if (newOptions.color.opacity !== undefined) {
+ parentOptions.color.opacity = Math.min(1, Math.max(0, newOptions.color.opacity));
+ }
+
+ if (newOptions.color.inherit === undefined && colorsDefined === true) {
+ parentOptions.color.inherit = false;
+ }
+ }
+ } else if (allowDeletion === true && newOptions.color === null) {
+ parentOptions.color = Object.create(globalOptions.color); // this sets the pointer of the option back to the global option.
+ }
+
+ // handle the font settings
+ if (newOptions.font !== undefined && newOptions.font !== null) {
+ _sharedLabel2['default'].parseOptions(parentOptions.font, newOptions);
+ } else if (allowDeletion === true && newOptions.font === null) {
+ parentOptions.font = Object.create(globalOptions.font); // this sets the pointer of the option back to the global option.
+ }
+ }
+ }]);
+
+ return Edge;
+ })();
+
+ exports['default'] = Edge;
+ module.exports = exports['default'];
+
+/***/ },
+/* 83 */
+/***/ 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(_x3, _x4, _x5) { var _again = true; _function: while (_again) { var object = _x3, property = _x4, receiver = _x5; desc = parent = getter = undefined; _again = false; 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 { _x3 = parent; _x4 = property; _x5 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilCubicBezierEdgeBase = __webpack_require__(84);
+
+ var _utilCubicBezierEdgeBase2 = _interopRequireDefault(_utilCubicBezierEdgeBase);
+
+ var CubicBezierEdge = (function (_CubicBezierEdgeBase) {
+ _inherits(CubicBezierEdge, _CubicBezierEdgeBase);
+
+ function CubicBezierEdge(options, body, labelModule) {
+ _classCallCheck(this, CubicBezierEdge);
+
+ _get(Object.getPrototypeOf(CubicBezierEdge.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(CubicBezierEdge, [{
+ key: '_line',
+
+ /**
+ * Draw a line between two nodes
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+ value: function _line(ctx) {
+ // get the coordinates of the support points.
+
+ var _getViaCoordinates2 = this._getViaCoordinates();
+
+ var _getViaCoordinates22 = _slicedToArray(_getViaCoordinates2, 2);
+
+ var via1 = _getViaCoordinates22[0];
+ var via2 = _getViaCoordinates22[1];
+
+ var returnValue = [via1, via2];
+
+ // start drawing the line.
+ ctx.beginPath();
+ ctx.moveTo(this.from.x, this.from.y);
+
+ // fallback to normal straight edges
+ if (via1.x === undefined) {
+ ctx.lineTo(this.to.x, this.to.y);
+ returnValue = undefined;
+ } else {
+ ctx.bezierCurveTo(via1.x, via1.y, via2.x, via2.y, this.to.x, this.to.y);
+ }
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ ctx.stroke();
+ this.disableShadow(ctx);
+ return returnValue;
+ }
+ }, {
+ key: '_getViaCoordinates',
+ value: function _getViaCoordinates() {
+ var dx = this.from.x - this.to.x;
+ var dy = this.from.y - this.to.y;
+
+ var x1 = undefined,
+ y1 = undefined,
+ x2 = undefined,
+ y2 = undefined;
+ var roundness = this.options.smooth.roundness;;
+
+ // horizontal if x > y or if direction is forced or if direction is horizontal
+ if ((Math.abs(dx) > Math.abs(dy) || this.options.smooth.forceDirection === true || this.options.smooth.forceDirection === 'horizontal') && this.options.smooth.forceDirection !== 'vertical') {
+ y1 = this.from.y;
+ y2 = this.to.y;
+ x1 = this.from.x - roundness * dx;
+ x2 = this.to.x + roundness * dx;
+ } else {
+ y1 = this.from.y - roundness * dy;
+ y2 = this.to.y + roundness * dy;
+ x1 = this.from.x;
+ x2 = this.to.x;
+ }
+
+ return [{ x: x1, y: y1 }, { x: x2, y: y2 }];
+ }
+ }, {
+ key: '_findBorderPosition',
+ value: function _findBorderPosition(nearNode, ctx) {
+ return this._findBorderPositionBezier(nearNode, ctx);
+ }
+ }, {
+ key: '_getDistanceToEdge',
+ value: function _getDistanceToEdge(x1, y1, x2, y2, x3, y3) {
+ var _ref = arguments.length <= 6 || arguments[6] === undefined ? this._getViaCoordinates() : arguments[6];
+
+ var _ref2 = _slicedToArray(_ref, 2);
+
+ var via1 = _ref2[0];
+ var via2 = _ref2[1];
+ // x3,y3 is the point
+ return this._getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, via1, via2);
+ }
+ }, {
+ key: 'getPoint',
+
+ /**
+ * Combined function of pointOnLine and pointOnBezier. This gives the coordinates of a point on the line at a certain percentage of the way
+ * @param percentage
+ * @param via
+ * @returns {{x: number, y: number}}
+ * @private
+ */
+ value: function getPoint(percentage) {
+ var _ref3 = arguments.length <= 1 || arguments[1] === undefined ? this._getViaCoordinates() : arguments[1];
+
+ var _ref32 = _slicedToArray(_ref3, 2);
+
+ var via1 = _ref32[0];
+ var via2 = _ref32[1];
+
+ var t = percentage;
+ var vec = [];
+ vec[0] = Math.pow(1 - t, 3);
+ vec[1] = 3 * t * Math.pow(1 - t, 2);
+ vec[2] = 3 * Math.pow(t, 2) * (1 - t);
+ vec[3] = Math.pow(t, 3);
+ var x = vec[0] * this.from.x + vec[1] * via1.x + vec[2] * via2.x + vec[3] * this.to.x;
+ var y = vec[0] * this.from.y + vec[1] * via1.y + vec[2] * via2.y + vec[3] * this.to.y;
+
+ return { x: x, y: y };
+ }
+ }]);
+
+ return CubicBezierEdge;
+ })(_utilCubicBezierEdgeBase2['default']);
+
+ exports['default'] = CubicBezierEdge;
+ module.exports = exports['default'];
+
+/***/ },
+/* 84 */
+/***/ 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _BezierEdgeBase2 = __webpack_require__(85);
+
+ var _BezierEdgeBase3 = _interopRequireDefault(_BezierEdgeBase2);
+
+ var CubicBezierEdgeBase = (function (_BezierEdgeBase) {
+ _inherits(CubicBezierEdgeBase, _BezierEdgeBase);
+
+ function CubicBezierEdgeBase(options, body, labelModule) {
+ _classCallCheck(this, CubicBezierEdgeBase);
+
+ _get(Object.getPrototypeOf(CubicBezierEdgeBase.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(CubicBezierEdgeBase, [{
+ key: '_getDistanceToBezierEdge',
+
+ /**
+ * Calculate the distance between a point (x3,y3) and a line segment from
+ * (x1,y1) to (x2,y2).
+ * http://stackoverflow.com/questions/849211/shortest-distancae-between-a-point-and-a-line-segment
+ * https://en.wikipedia.org/wiki/B%C3%A9zier_curve
+ * @param {number} x1 from x
+ * @param {number} y1 from y
+ * @param {number} x2 to x
+ * @param {number} y2 to y
+ * @param {number} x3 point to check x
+ * @param {number} y3 point to check y
+ * @private
+ */
+ value: function _getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, via1, via2) {
+ // x3,y3 is the point
+ var minDistance = 1e9;
+ var distance = undefined;
+ var i = undefined,
+ t = undefined,
+ x = undefined,
+ y = undefined;
+ var lastX = x1;
+ var lastY = y1;
+ var vec = [0, 0, 0, 0];
+ for (i = 1; i < 10; i++) {
+ t = 0.1 * i;
+ vec[0] = Math.pow(1 - t, 3);
+ vec[1] = 3 * t * Math.pow(1 - t, 2);
+ vec[2] = 3 * Math.pow(t, 2) * (1 - t);
+ vec[3] = Math.pow(t, 3);
+ x = vec[0] * x1 + vec[1] * via1.x + vec[2] * via2.x + vec[3] * x2;
+ y = vec[0] * y1 + vec[1] * via1.y + vec[2] * via2.y + vec[3] * y2;
+ if (i > 0) {
+ distance = this._getDistanceToLine(lastX, lastY, x, y, x3, y3);
+ minDistance = distance < minDistance ? distance : minDistance;
+ }
+ lastX = x;
+ lastY = y;
+ }
+
+ return minDistance;
+ }
+ }]);
+
+ return CubicBezierEdgeBase;
+ })(_BezierEdgeBase3['default']);
+
+ exports['default'] = CubicBezierEdgeBase;
+ module.exports = exports['default'];
+
+/***/ },
+/* 85 */
+/***/ 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(_x2, _x3, _x4) { var _again = true; _function: while (_again) { var object = _x2, property = _x3, receiver = _x4; desc = parent = getter = undefined; _again = false; 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 { _x2 = parent; _x3 = property; _x4 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _EdgeBase2 = __webpack_require__(86);
+
+ var _EdgeBase3 = _interopRequireDefault(_EdgeBase2);
+
+ var BezierEdgeBase = (function (_EdgeBase) {
+ _inherits(BezierEdgeBase, _EdgeBase);
+
+ function BezierEdgeBase(options, body, labelModule) {
+ _classCallCheck(this, BezierEdgeBase);
+
+ _get(Object.getPrototypeOf(BezierEdgeBase.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(BezierEdgeBase, [{
+ key: '_findBorderPositionBezier',
+
+ /**
+ * This function uses binary search to look for the point where the bezier curve crosses the border of the node.
+ *
+ * @param nearNode
+ * @param ctx
+ * @param viaNode
+ * @param nearNode
+ * @param ctx
+ * @param viaNode
+ * @param nearNode
+ * @param ctx
+ * @param viaNode
+ */
+ value: function _findBorderPositionBezier(nearNode, ctx) {
+ var viaNode = arguments.length <= 2 || arguments[2] === undefined ? this._getViaCoordinates() : arguments[2];
+
+ var maxIterations = 10;
+ var iteration = 0;
+ var low = 0;
+ var high = 1;
+ var pos, angle, distanceToBorder, distanceToPoint, difference;
+ var threshold = 0.2;
+ var node = this.to;
+ var from = false;
+ if (nearNode.id === this.from.id) {
+ node = this.from;
+ from = true;
+ }
+
+ while (low <= high && iteration < maxIterations) {
+ var middle = (low + high) * 0.5;
+
+ pos = this.getPoint(middle, viaNode);
+ angle = Math.atan2(node.y - pos.y, node.x - pos.x);
+ distanceToBorder = node.distanceToBorder(ctx, angle);
+ distanceToPoint = Math.sqrt(Math.pow(pos.x - node.x, 2) + Math.pow(pos.y - node.y, 2));
+ difference = distanceToBorder - distanceToPoint;
+ if (Math.abs(difference) < threshold) {
+ break; // found
+ } else if (difference < 0) {
+ // distance to nodes is larger than distance to border --> t needs to be bigger if we're looking at the to node.
+ if (from === false) {
+ low = middle;
+ } else {
+ high = middle;
+ }
+ } else {
+ if (from === false) {
+ high = middle;
+ } else {
+ low = middle;
+ }
+ }
+
+ iteration++;
+ }
+ pos.t = middle;
+
+ return pos;
+ }
+ }, {
+ key: '_getDistanceToBezierEdge',
+
+ /**
+ * Calculate the distance between a point (x3,y3) and a line segment from
+ * (x1,y1) to (x2,y2).
+ * http://stackoverflow.com/questions/849211/shortest-distancae-between-a-point-and-a-line-segment
+ * @param {number} x1 from x
+ * @param {number} y1 from y
+ * @param {number} x2 to x
+ * @param {number} y2 to y
+ * @param {number} x3 point to check x
+ * @param {number} y3 point to check y
+ * @private
+ */
+ value: function _getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, via) {
+ // x3,y3 is the point
+ var minDistance = 1e9;
+ var distance = undefined;
+ var i = undefined,
+ t = undefined,
+ x = undefined,
+ y = undefined;
+ var lastX = x1;
+ var lastY = y1;
+ for (i = 1; i < 10; i++) {
+ t = 0.1 * i;
+ x = Math.pow(1 - t, 2) * x1 + 2 * t * (1 - t) * via.x + Math.pow(t, 2) * x2;
+ y = Math.pow(1 - t, 2) * y1 + 2 * t * (1 - t) * via.y + Math.pow(t, 2) * y2;
+ if (i > 0) {
+ distance = this._getDistanceToLine(lastX, lastY, x, y, x3, y3);
+ minDistance = distance < minDistance ? distance : minDistance;
+ }
+ lastX = x;
+ lastY = y;
+ }
+
+ return minDistance;
+ }
+ }]);
+
+ return BezierEdgeBase;
+ })(_EdgeBase3['default']);
+
+ exports['default'] = BezierEdgeBase;
+ module.exports = exports['default'];
+
+/***/ },
+/* 86 */
+/***/ 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; }; })();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ var util = __webpack_require__(1);
+
+ var EdgeBase = (function () {
+ function EdgeBase(options, body, labelModule) {
+ _classCallCheck(this, EdgeBase);
+
+ this.body = body;
+ this.labelModule = labelModule;
+ this.setOptions(options);
+ this.colorDirty = true;
+ this.color = {};
+ this.selectionWidth = 2;
+ this.hoverWidth = 1.5;
+ }
+
+ _createClass(EdgeBase, [{
+ key: 'connect',
+ value: function connect() {
+ this.from = this.body.nodes[this.options.from];
+ this.to = this.body.nodes[this.options.to];
+ }
+ }, {
+ key: 'cleanup',
+ value: function cleanup() {
+ return false;
+ }
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options) {
+ this.options = options;
+ this.from = this.body.nodes[this.options.from];
+ this.to = this.body.nodes[this.options.to];
+ this.id = this.options.id;
+ }
+ }, {
+ key: 'drawLine',
+
+ /**
+ * Redraw a edge as a line
+ * Draw this edge in the given canvas
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+ value: function drawLine(ctx, selected, hover) {
+ // set style
+ ctx.strokeStyle = this.getColor(ctx, selected, hover);
+ ctx.lineWidth = this.getLineWidth(selected, hover);
+ var via = undefined;
+ if (this.options.dashes !== false) {
+ via = this._drawDashedLine(ctx);
+ } else {
+ via = this._drawLine(ctx);
+ }
+ return via;
+ }
+ }, {
+ key: '_drawLine',
+ value: function _drawLine(ctx) {
+ var via = undefined;
+ if (this.from != this.to) {
+ // draw line
+ via = this._line(ctx);
+ } else {
+ var _getCircleData2 = this._getCircleData(ctx);
+
+ var _getCircleData22 = _slicedToArray(_getCircleData2, 3);
+
+ var x = _getCircleData22[0];
+ var y = _getCircleData22[1];
+ var radius = _getCircleData22[2];
+
+ this._circle(ctx, x, y, radius);
+ }
+ return via;
+ }
+ }, {
+ key: '_drawDashedLine',
+ value: function _drawDashedLine(ctx) {
+ var via = undefined;
+ ctx.lineCap = 'round';
+ var pattern = [5, 5];
+ if (Array.isArray(this.options.dashes) === true) {
+ pattern = this.options.dashes;
+ }
+
+ // only firefox and chrome support this method, else we use the legacy one.
+ if (ctx.setLineDash !== undefined) {
+ ctx.save();
+
+ // set dash settings for chrome or firefox
+ ctx.setLineDash(pattern);
+ ctx.lineDashOffset = 0;
+
+ // draw the line
+ if (this.from != this.to) {
+ // draw line
+ via = this._line(ctx);
+ } else {
+ var _getCircleData3 = this._getCircleData(ctx);
+
+ var _getCircleData32 = _slicedToArray(_getCircleData3, 3);
+
+ var x = _getCircleData32[0];
+ var y = _getCircleData32[1];
+ var radius = _getCircleData32[2];
+
+ this._circle(ctx, x, y, radius);
+ }
+
+ // restore the dash settings.
+ ctx.setLineDash([0]);
+ ctx.lineDashOffset = 0;
+ ctx.restore();
+ } else {
+ // unsupporting smooth lines
+ if (this.from != this.to) {
+ // draw line
+ ctx.dashedLine(this.from.x, this.from.y, this.to.x, this.to.y, pattern);
+ } else {
+ var _getCircleData4 = this._getCircleData(ctx);
+
+ var _getCircleData42 = _slicedToArray(_getCircleData4, 3);
+
+ var x = _getCircleData42[0];
+ var y = _getCircleData42[1];
+ var radius = _getCircleData42[2];
+
+ this._circle(ctx, x, y, radius);
+ }
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+
+ ctx.stroke();
+
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+ }
+ return via;
+ }
+ }, {
+ key: 'findBorderPosition',
+ value: function findBorderPosition(nearNode, ctx, options) {
+ if (this.from != this.to) {
+ return this._findBorderPosition(nearNode, ctx, options);
+ } else {
+ return this._findBorderPositionCircle(nearNode, ctx, options);
+ }
+ }
+ }, {
+ key: 'findBorderPositions',
+ value: function findBorderPositions(ctx) {
+ var from = {};
+ var to = {};
+ if (this.from != this.to) {
+ from = this._findBorderPosition(this.from, ctx);
+ to = this._findBorderPosition(this.to, ctx);
+ } else {
+ var _getCircleData5 = this._getCircleData(ctx);
+
+ var _getCircleData52 = _slicedToArray(_getCircleData5, 3);
+
+ var x = _getCircleData52[0];
+ var y = _getCircleData52[1];
+ var radius = _getCircleData52[2];
+
+ from = this._findBorderPositionCircle(this.from, ctx, { x: x, y: y, low: 0.25, high: 0.6, direction: -1 });
+ to = this._findBorderPositionCircle(this.from, ctx, { x: x, y: y, low: 0.6, high: 0.8, direction: 1 });
+ }
+ return { from: from, to: to };
+ }
+ }, {
+ key: '_getCircleData',
+ value: function _getCircleData(ctx) {
+ var x = undefined,
+ y = undefined;
+ var node = this.from;
+ var radius = this.options.selfReferenceSize;
+
+ if (ctx !== undefined) {
+ if (node.shape.width === undefined) {
+ node.shape.resize(ctx);
+ }
+ }
+
+ // get circle coordinates
+ if (node.shape.width > node.shape.height) {
+ x = node.x + node.shape.width * 0.5;
+ y = node.y - radius;
+ } else {
+ x = node.x + radius;
+ y = node.y - node.shape.height * 0.5;
+ }
+ return [x, y, radius];
+ }
+ }, {
+ key: '_pointOnCircle',
+
+ /**
+ * Get a point on a circle
+ * @param {Number} x
+ * @param {Number} y
+ * @param {Number} radius
+ * @param {Number} percentage. Value between 0 (line start) and 1 (line end)
+ * @return {Object} point
+ * @private
+ */
+ value: function _pointOnCircle(x, y, radius, percentage) {
+ var angle = percentage * 2 * Math.PI;
+ return {
+ x: x + radius * Math.cos(angle),
+ y: y - radius * Math.sin(angle)
+ };
+ }
+ }, {
+ key: '_findBorderPositionCircle',
+
+ /**
+ * This function uses binary search to look for the point where the circle crosses the border of the node.
+ * @param node
+ * @param ctx
+ * @param options
+ * @returns {*}
+ * @private
+ */
+ value: function _findBorderPositionCircle(node, ctx, options) {
+ var x = options.x;
+ var y = options.y;
+ var low = options.low;
+ var high = options.high;
+ var direction = options.direction;
+
+ var maxIterations = 10;
+ var iteration = 0;
+ var radius = this.options.selfReferenceSize;
+ var pos = undefined,
+ angle = undefined,
+ distanceToBorder = undefined,
+ distanceToPoint = undefined,
+ difference = undefined;
+ var threshold = 0.05;
+ var middle = (low + high) * 0.5;
+
+ while (low <= high && iteration < maxIterations) {
+ middle = (low + high) * 0.5;
+
+ pos = this._pointOnCircle(x, y, radius, middle);
+ angle = Math.atan2(node.y - pos.y, node.x - pos.x);
+ distanceToBorder = node.distanceToBorder(ctx, angle);
+ distanceToPoint = Math.sqrt(Math.pow(pos.x - node.x, 2) + Math.pow(pos.y - node.y, 2));
+ difference = distanceToBorder - distanceToPoint;
+ if (Math.abs(difference) < threshold) {
+ break; // found
+ } else if (difference > 0) {
+ // distance to nodes is larger than distance to border --> t needs to be bigger if we're looking at the to node.
+ if (direction > 0) {
+ low = middle;
+ } else {
+ high = middle;
+ }
+ } else {
+ if (direction > 0) {
+ high = middle;
+ } else {
+ low = middle;
+ }
+ }
+ iteration++;
+ }
+ pos.t = middle;
+
+ return pos;
+ }
+ }, {
+ key: 'getLineWidth',
+
+ /**
+ * Get the line width of the edge. Depends on width and whether one of the
+ * connected nodes is selected.
+ * @return {Number} width
+ * @private
+ */
+ value: function getLineWidth(selected, hover) {
+ if (selected === true) {
+ return Math.max(this.selectionWidth, 0.3 / this.body.view.scale);
+ } else {
+ if (hover === true) {
+ return Math.max(this.hoverWidth, 0.3 / this.body.view.scale);
+ } else {
+ return Math.max(this.options.width, 0.3 / this.body.view.scale);
+ }
+ }
+ }
+ }, {
+ key: 'getColor',
+ value: function getColor(ctx, selected, hover) {
+ var colorOptions = this.options.color;
+ if (colorOptions.inherit !== false) {
+ // when this is a loop edge, just use the 'from' method
+ if (colorOptions.inherit === 'both' && this.from.id !== this.to.id) {
+ var grd = ctx.createLinearGradient(this.from.x, this.from.y, this.to.x, this.to.y);
+ var fromColor = undefined,
+ toColor = undefined;
+ fromColor = this.from.options.color.highlight.border;
+ toColor = this.to.options.color.highlight.border;
+
+ if (this.from.selected === false && this.to.selected === false) {
+ fromColor = util.overrideOpacity(this.from.options.color.border, this.options.color.opacity);
+ toColor = util.overrideOpacity(this.to.options.color.border, this.options.color.opacity);
+ } else if (this.from.selected === true && this.to.selected === false) {
+ toColor = this.to.options.color.border;
+ } else if (this.from.selected === false && this.to.selected === true) {
+ fromColor = this.from.options.color.border;
+ }
+ grd.addColorStop(0, fromColor);
+ grd.addColorStop(1, toColor);
+
+ // -------------------- this returns -------------------- //
+ return grd;
+ }
+
+ if (this.colorDirty === true) {
+ if (colorOptions.inherit === 'to') {
+ this.color.highlight = this.to.options.color.highlight.border;
+ this.color.hover = this.to.options.color.hover.border;
+ this.color.color = util.overrideOpacity(this.to.options.color.border, colorOptions.opacity);
+ } else {
+ // (this.options.color.inherit.source === "from") {
+ this.color.highlight = this.from.options.color.highlight.border;
+ this.color.hover = this.from.options.color.hover.border;
+ this.color.color = util.overrideOpacity(this.from.options.color.border, colorOptions.opacity);
+ }
+ }
+ } else if (this.colorDirty === true) {
+ this.color.highlight = colorOptions.highlight;
+ this.color.hover = colorOptions.hover;
+ this.color.color = util.overrideOpacity(colorOptions.color, colorOptions.opacity);
+ }
+
+ // if color inherit is on and gradients are used, the function has already returned by now.
+ this.colorDirty = false;
+
+ if (selected === true) {
+ return this.color.highlight;
+ } else if (hover === true) {
+ return this.color.hover;
+ } else {
+ return this.color.color;
+ }
+ }
+ }, {
+ key: '_circle',
+
+ /**
+ * Draw a line from a node to itself, a circle
+ * @param {CanvasRenderingContext2D} ctx
+ * @param {Number} x
+ * @param {Number} y
+ * @param {Number} radius
+ * @private
+ */
+ value: function _circle(ctx, x, y, radius) {
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+
+ // draw a circle
+ ctx.beginPath();
+ ctx.arc(x, y, radius, 0, 2 * Math.PI, false);
+ ctx.stroke();
+
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+ }
+ }, {
+ key: 'getDistanceToEdge',
+
+ /**
+ * Calculate the distance between a point (x3,y3) and a line segment from
+ * (x1,y1) to (x2,y2).
+ * http://stackoverflow.com/questions/849211/shortest-distancae-between-a-point-and-a-line-segment
+ * @param {number} x1
+ * @param {number} y1
+ * @param {number} x2
+ * @param {number} y2
+ * @param {number} x3
+ * @param {number} y3
+ * @private
+ */
+ value: function getDistanceToEdge(x1, y1, x2, y2, x3, y3, via) {
+ // x3,y3 is the point
+ var returnValue = 0;
+ if (this.from != this.to) {
+ returnValue = this._getDistanceToEdge(x1, y1, x2, y2, x3, y3, via);
+ } else {
+ var _getCircleData6 = this._getCircleData();
+
+ var _getCircleData62 = _slicedToArray(_getCircleData6, 3);
+
+ var x = _getCircleData62[0];
+ var y = _getCircleData62[1];
+ var radius = _getCircleData62[2];
+
+ var dx = x - x3;
+ var dy = y - y3;
+ returnValue = Math.abs(Math.sqrt(dx * dx + dy * dy) - radius);
+ }
+
+ if (this.labelModule.size.left < x3 && this.labelModule.size.left + this.labelModule.size.width > x3 && this.labelModule.size.top < y3 && this.labelModule.size.top + this.labelModule.size.height > y3) {
+ return 0;
+ } else {
+ return returnValue;
+ }
+ }
+ }, {
+ key: '_getDistanceToLine',
+ value: function _getDistanceToLine(x1, y1, x2, y2, x3, y3) {
+ var px = x2 - x1;
+ var py = y2 - y1;
+ var something = px * px + py * py;
+ var u = ((x3 - x1) * px + (y3 - y1) * py) / something;
+
+ if (u > 1) {
+ u = 1;
+ } else if (u < 0) {
+ u = 0;
+ }
+
+ var x = x1 + u * px;
+ var y = y1 + u * py;
+ var dx = x - x3;
+ var dy = y - y3;
+
+ //# Note: If the actual distance does not matter,
+ //# if you only want to compare what this function
+ //# returns to other results of this function, you
+ //# can just return the squared distance instead
+ //# (i.e. remove the sqrt) to gain a little performance
+
+ return Math.sqrt(dx * dx + dy * dy);
+ }
+ }, {
+ key: 'drawArrowHead',
+
+ /**
+ *
+ * @param ctx
+ * @param position
+ * @param viaNode
+ */
+ value: function drawArrowHead(ctx, position, viaNode, selected, hover) {
+ // set style
+ ctx.strokeStyle = this.getColor(ctx, selected, hover);
+ ctx.fillStyle = ctx.strokeStyle;
+ ctx.lineWidth = this.getLineWidth(selected, hover);
+
+ // set lets
+ var angle = undefined;
+ var length = undefined;
+ var arrowPos = undefined;
+ var node1 = undefined;
+ var node2 = undefined;
+ var guideOffset = undefined;
+ var scaleFactor = undefined;
+
+ if (position === 'from') {
+ node1 = this.from;
+ node2 = this.to;
+ guideOffset = 0.1;
+ scaleFactor = this.options.arrows.from.scaleFactor;
+ } else if (position === 'to') {
+ node1 = this.to;
+ node2 = this.from;
+ guideOffset = -0.1;
+ scaleFactor = this.options.arrows.to.scaleFactor;
+ } else {
+ node1 = this.to;
+ node2 = this.from;
+ scaleFactor = this.options.arrows.middle.scaleFactor;
+ }
+
+ // if not connected to itself
+ if (node1 != node2) {
+ if (position !== 'middle') {
+ // draw arrow head
+ if (this.options.smooth.enabled === true) {
+ arrowPos = this.findBorderPosition(node1, ctx, { via: viaNode });
+ var guidePos = this.getPoint(Math.max(0.0, Math.min(1.0, arrowPos.t + guideOffset)), viaNode);
+ angle = Math.atan2(arrowPos.y - guidePos.y, arrowPos.x - guidePos.x);
+ } else {
+ angle = Math.atan2(node1.y - node2.y, node1.x - node2.x);
+ arrowPos = this.findBorderPosition(node1, ctx);
+ }
+ } else {
+ angle = Math.atan2(node1.y - node2.y, node1.x - node2.x);
+ arrowPos = this.getPoint(0.6, viaNode); // this is 0.6 to account for the size of the arrow.
+ }
+ // draw arrow at the end of the line
+ length = (10 + 5 * this.options.width) * scaleFactor;
+ ctx.arrow(arrowPos.x, arrowPos.y, angle, length);
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ ctx.fill();
+
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+ ctx.stroke();
+ } else {
+ // draw circle
+ var _angle = undefined,
+ point = undefined;
+
+ var _getCircleData7 = this._getCircleData(ctx);
+
+ var _getCircleData72 = _slicedToArray(_getCircleData7, 3);
+
+ var x = _getCircleData72[0];
+ var y = _getCircleData72[1];
+ var radius = _getCircleData72[2];
+
+ if (position === 'from') {
+ point = this.findBorderPosition(this.from, ctx, { x: x, y: y, low: 0.25, high: 0.6, direction: -1 });
+ _angle = point.t * -2 * Math.PI + 1.5 * Math.PI + 0.1 * Math.PI;
+ } else if (position === 'to') {
+ point = this.findBorderPosition(this.from, ctx, { x: x, y: y, low: 0.6, high: 1.0, direction: 1 });
+ _angle = point.t * -2 * Math.PI + 1.5 * Math.PI - 1.1 * Math.PI;
+ } else {
+ point = this._pointOnCircle(x, y, radius, 0.175);
+ _angle = 3.9269908169872414; // === 0.175 * -2 * Math.PI + 1.5 * Math.PI + 0.1 * Math.PI;
+ }
+
+ // draw the arrowhead
+ var _length = (10 + 5 * this.options.width) * scaleFactor;
+ ctx.arrow(point.x, point.y, _angle, _length);
+
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ ctx.fill();
+
+ // disable shadows for other elements.
+ this.disableShadow(ctx);
+ ctx.stroke();
+ }
+ }
+ }, {
+ key: 'enableShadow',
+ value: function enableShadow(ctx) {
+ if (this.options.shadow.enabled === true) {
+ ctx.shadowColor = 'rgba(0,0,0,0.5)';
+ ctx.shadowBlur = this.options.shadow.size;
+ ctx.shadowOffsetX = this.options.shadow.x;
+ ctx.shadowOffsetY = this.options.shadow.y;
+ }
+ }
+ }, {
+ key: 'disableShadow',
+ value: function disableShadow(ctx) {
+ if (this.options.shadow.enabled === true) {
+ ctx.shadowColor = 'rgba(0,0,0,0)';
+ ctx.shadowBlur = 0;
+ ctx.shadowOffsetX = 0;
+ ctx.shadowOffsetY = 0;
+ }
+ }
+ }]);
+
+ return EdgeBase;
+ })();
+
+ exports['default'] = EdgeBase;
+ module.exports = exports['default'];
+
+/***/ },
+/* 87 */
+/***/ 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilBezierEdgeBase = __webpack_require__(85);
+
+ var _utilBezierEdgeBase2 = _interopRequireDefault(_utilBezierEdgeBase);
+
+ var BezierEdgeDynamic = (function (_BezierEdgeBase) {
+ _inherits(BezierEdgeDynamic, _BezierEdgeBase);
+
+ function BezierEdgeDynamic(options, body, labelModule) {
+ var _this = this;
+
+ _classCallCheck(this, BezierEdgeDynamic);
+
+ //this.via = undefined; // Here for completeness but not allowed to defined before super() is invoked.
+ _get(Object.getPrototypeOf(BezierEdgeDynamic.prototype), "constructor", this).call(this, options, body, labelModule); // --> this calls the setOptions below
+ this._boundFunction = function () {
+ _this.positionBezierNode();
+ };
+ this.body.emitter.on("_repositionBezierNodes", this._boundFunction);
+ }
+
+ _createClass(BezierEdgeDynamic, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ this.options = options;
+ this.id = this.options.id;
+ this.setupSupportNode();
+
+ // when we change the physics state of the edge, we reposition the support node.
+ if (this.options.physics !== options.physics) {
+ this.via.setOptions({ physics: this.options.physics });
+ this.positionBezierNode();
+ }
+ this.connect();
+ }
+ }, {
+ key: "connect",
+ value: function connect() {
+ this.from = this.body.nodes[this.options.from];
+ this.to = this.body.nodes[this.options.to];
+ if (this.from === undefined || this.to === undefined || this.options.physics === false) {
+ this.via.setOptions({ physics: false });
+ } else {
+ // fix weird behaviour where a selfreferencing node has physics enabled
+ if (this.from.id === this.to.id) {
+ this.via.setOptions({ physics: false });
+ } else {
+ this.via.setOptions({ physics: true });
+ }
+ }
+ }
+ }, {
+ key: "cleanup",
+
+ /**
+ * remove the support nodes
+ * @returns {boolean}
+ */
+ value: function cleanup() {
+ this.body.emitter.off("_repositionBezierNodes", this._boundFunction);
+ if (this.via !== undefined) {
+ delete this.body.nodes[this.via.id];
+ this.via = undefined;
+ return true;
+ }
+ return false;
+ }
+ }, {
+ key: "setupSupportNode",
+
+ /**
+ * Bezier curves require an anchor point to calculate the smooth flow. These points are nodes. These nodes are invisible but
+ * are used for the force calculation.
+ *
+ * The changed data is not called, if needed, it is returned by the main edge constructor.
+ * @private
+ */
+ value: function setupSupportNode() {
+ if (this.via === undefined) {
+ var nodeId = "edgeId:" + this.id;
+ var node = this.body.functions.createNode({
+ id: nodeId,
+ shape: "circle",
+ physics: true,
+ hidden: true
+ });
+ this.body.nodes[nodeId] = node;
+ this.via = node;
+ this.via.parentEdgeId = this.id;
+ this.positionBezierNode();
+ }
+ }
+ }, {
+ key: "positionBezierNode",
+ value: function positionBezierNode() {
+ if (this.via !== undefined && this.from !== undefined && this.to !== undefined) {
+ this.via.x = 0.5 * (this.from.x + this.to.x);
+ this.via.y = 0.5 * (this.from.y + this.to.y);
+ } else if (this.via !== undefined) {
+ this.via.x = 0;
+ this.via.y = 0;
+ }
+ }
+ }, {
+ key: "_line",
+
+ /**
+ * Draw a line between two nodes
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+ value: function _line(ctx) {
+ // draw a straight line
+ ctx.beginPath();
+ ctx.moveTo(this.from.x, this.from.y);
+ ctx.quadraticCurveTo(this.via.x, this.via.y, this.to.x, this.to.y);
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ ctx.stroke();
+ this.disableShadow(ctx);
+ return this.via;
+ }
+ }, {
+ key: "getPoint",
+
+ /**
+ * Combined function of pointOnLine and pointOnBezier. This gives the coordinates of a point on the line at a certain percentage of the way
+ * @param percentage
+ * @param via
+ * @returns {{x: number, y: number}}
+ * @private
+ */
+ value: function getPoint(percentage) {
+ var t = percentage;
+ var x = Math.pow(1 - t, 2) * this.from.x + 2 * t * (1 - t) * this.via.x + Math.pow(t, 2) * this.to.x;
+ var y = Math.pow(1 - t, 2) * this.from.y + 2 * t * (1 - t) * this.via.y + Math.pow(t, 2) * this.to.y;
+
+ return { x: x, y: y };
+ }
+ }, {
+ key: "_findBorderPosition",
+ value: function _findBorderPosition(nearNode, ctx) {
+ return this._findBorderPositionBezier(nearNode, ctx, this.via);
+ }
+ }, {
+ key: "_getDistanceToEdge",
+ value: function _getDistanceToEdge(x1, y1, x2, y2, x3, y3) {
+ // x3,y3 is the point
+ return this._getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, this.via);
+ }
+ }]);
+
+ return BezierEdgeDynamic;
+ })(_utilBezierEdgeBase2["default"]);
+
+ exports["default"] = BezierEdgeDynamic;
+ module.exports = exports["default"];
+
+/***/ },
+/* 88 */
+/***/ 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(_x4, _x5, _x6) { var _again = true; _function: while (_again) { var object = _x4, property = _x5, receiver = _x6; desc = parent = getter = undefined; _again = false; 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 { _x4 = parent; _x5 = property; _x6 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilBezierEdgeBase = __webpack_require__(85);
+
+ var _utilBezierEdgeBase2 = _interopRequireDefault(_utilBezierEdgeBase);
+
+ var BezierEdgeStatic = (function (_BezierEdgeBase) {
+ _inherits(BezierEdgeStatic, _BezierEdgeBase);
+
+ function BezierEdgeStatic(options, body, labelModule) {
+ _classCallCheck(this, BezierEdgeStatic);
+
+ _get(Object.getPrototypeOf(BezierEdgeStatic.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(BezierEdgeStatic, [{
+ key: '_line',
+
+ /**
+ * Draw a line between two nodes
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+ value: function _line(ctx) {
+ // draw a straight line
+ ctx.beginPath();
+ ctx.moveTo(this.from.x, this.from.y);
+ var via = this._getViaCoordinates();
+ var returnValue = via;
+
+ // fallback to normal straight edges
+ if (via.x === undefined) {
+ ctx.lineTo(this.to.x, this.to.y);
+ returnValue = undefined;
+ } else {
+ ctx.quadraticCurveTo(via.x, via.y, this.to.x, this.to.y);
+ }
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ ctx.stroke();
+ this.disableShadow(ctx);
+ return returnValue;
+ }
+ }, {
+ key: '_getViaCoordinates',
+ value: function _getViaCoordinates() {
+ var xVia = undefined;
+ var yVia = undefined;
+ var factor = this.options.smooth.roundness;
+ var type = this.options.smooth.type;
+ var dx = Math.abs(this.from.x - this.to.x);
+ var dy = Math.abs(this.from.y - this.to.y);
+ if (type === 'discrete' || type === 'diagonalCross') {
+ if (Math.abs(this.from.x - this.to.x) <= Math.abs(this.from.y - this.to.y)) {
+ if (this.from.y >= this.to.y) {
+ if (this.from.x <= this.to.x) {
+ xVia = this.from.x + factor * dy;
+ yVia = this.from.y - factor * dy;
+ } else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dy;
+ yVia = this.from.y - factor * dy;
+ }
+ } else if (this.from.y < this.to.y) {
+ if (this.from.x <= this.to.x) {
+ xVia = this.from.x + factor * dy;
+ yVia = this.from.y + factor * dy;
+ } else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dy;
+ yVia = this.from.y + factor * dy;
+ }
+ }
+ if (type === 'discrete') {
+ xVia = dx < factor * dy ? this.from.x : xVia;
+ }
+ } else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) {
+ if (this.from.y >= this.to.y) {
+ if (this.from.x <= this.to.x) {
+ xVia = this.from.x + factor * dx;
+ yVia = this.from.y - factor * dx;
+ } else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dx;
+ yVia = this.from.y - factor * dx;
+ }
+ } else if (this.from.y < this.to.y) {
+ if (this.from.x <= this.to.x) {
+ xVia = this.from.x + factor * dx;
+ yVia = this.from.y + factor * dx;
+ } else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dx;
+ yVia = this.from.y + factor * dx;
+ }
+ }
+ if (type === 'discrete') {
+ yVia = dy < factor * dx ? this.from.y : yVia;
+ }
+ }
+ } else if (type === 'straightCross') {
+ if (Math.abs(this.from.x - this.to.x) <= Math.abs(this.from.y - this.to.y)) {
+ // up - down
+ xVia = this.from.x;
+ if (this.from.y < this.to.y) {
+ yVia = this.to.y - (1 - factor) * dy;
+ } else {
+ yVia = this.to.y + (1 - factor) * dy;
+ }
+ } else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) {
+ // left - right
+ if (this.from.x < this.to.x) {
+ xVia = this.to.x - (1 - factor) * dx;
+ } else {
+ xVia = this.to.x + (1 - factor) * dx;
+ }
+ yVia = this.from.y;
+ }
+ } else if (type === 'horizontal') {
+ if (this.from.x < this.to.x) {
+ xVia = this.to.x - (1 - factor) * dx;
+ } else {
+ xVia = this.to.x + (1 - factor) * dx;
+ }
+ yVia = this.from.y;
+ } else if (type === 'vertical') {
+ xVia = this.from.x;
+ if (this.from.y < this.to.y) {
+ yVia = this.to.y - (1 - factor) * dy;
+ } else {
+ yVia = this.to.y + (1 - factor) * dy;
+ }
+ } else if (type === 'curvedCW') {
+ dx = this.to.x - this.from.x;
+ dy = this.from.y - this.to.y;
+ var radius = Math.sqrt(dx * dx + dy * dy);
+ var pi = Math.PI;
+
+ var originalAngle = Math.atan2(dy, dx);
+ var myAngle = (originalAngle + (factor * 0.5 + 0.5) * pi) % (2 * pi);
+
+ xVia = this.from.x + (factor * 0.5 + 0.5) * radius * Math.sin(myAngle);
+ yVia = this.from.y + (factor * 0.5 + 0.5) * radius * Math.cos(myAngle);
+ } else if (type === 'curvedCCW') {
+ dx = this.to.x - this.from.x;
+ dy = this.from.y - this.to.y;
+ var radius = Math.sqrt(dx * dx + dy * dy);
+ var pi = Math.PI;
+
+ var originalAngle = Math.atan2(dy, dx);
+ var myAngle = (originalAngle + (-factor * 0.5 + 0.5) * pi) % (2 * pi);
+
+ xVia = this.from.x + (factor * 0.5 + 0.5) * radius * Math.sin(myAngle);
+ yVia = this.from.y + (factor * 0.5 + 0.5) * radius * Math.cos(myAngle);
+ } else {
+ // continuous
+ if (Math.abs(this.from.x - this.to.x) <= Math.abs(this.from.y - this.to.y)) {
+ if (this.from.y >= this.to.y) {
+ if (this.from.x <= this.to.x) {
+ xVia = this.from.x + factor * dy;
+ yVia = this.from.y - factor * dy;
+ xVia = this.to.x < xVia ? this.to.x : xVia;
+ } else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dy;
+ yVia = this.from.y - factor * dy;
+ xVia = this.to.x > xVia ? this.to.x : xVia;
+ }
+ } else if (this.from.y < this.to.y) {
+ if (this.from.x <= this.to.x) {
+ xVia = this.from.x + factor * dy;
+ yVia = this.from.y + factor * dy;
+ xVia = this.to.x < xVia ? this.to.x : xVia;
+ } else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dy;
+ yVia = this.from.y + factor * dy;
+ xVia = this.to.x > xVia ? this.to.x : xVia;
+ }
+ }
+ } else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) {
+ if (this.from.y >= this.to.y) {
+ if (this.from.x <= this.to.x) {
+ xVia = this.from.x + factor * dx;
+ yVia = this.from.y - factor * dx;
+ yVia = this.to.y > yVia ? this.to.y : yVia;
+ } else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dx;
+ yVia = this.from.y - factor * dx;
+ yVia = this.to.y > yVia ? this.to.y : yVia;
+ }
+ } else if (this.from.y < this.to.y) {
+ if (this.from.x <= this.to.x) {
+ xVia = this.from.x + factor * dx;
+ yVia = this.from.y + factor * dx;
+ yVia = this.to.y < yVia ? this.to.y : yVia;
+ } else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dx;
+ yVia = this.from.y + factor * dx;
+ yVia = this.to.y < yVia ? this.to.y : yVia;
+ }
+ }
+ }
+ }
+ return { x: xVia, y: yVia };
+ }
+ }, {
+ key: '_findBorderPosition',
+ value: function _findBorderPosition(nearNode, ctx) {
+ var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
+
+ return this._findBorderPositionBezier(nearNode, ctx, options.via);
+ }
+ }, {
+ key: '_getDistanceToEdge',
+ value: function _getDistanceToEdge(x1, y1, x2, y2, x3, y3) {
+ var via = arguments.length <= 6 || arguments[6] === undefined ? this._getViaCoordinates() : arguments[6];
+ // x3,y3 is the point
+ return this._getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, via);
+ }
+ }, {
+ key: 'getPoint',
+
+ /**
+ * Combined function of pointOnLine and pointOnBezier. This gives the coordinates of a point on the line at a certain percentage of the way
+ * @param percentage
+ * @param via
+ * @returns {{x: number, y: number}}
+ * @private
+ */
+ value: function getPoint(percentage) {
+ var via = arguments.length <= 1 || arguments[1] === undefined ? this._getViaCoordinates() : arguments[1];
+
+ var t = percentage;
+ var x = Math.pow(1 - t, 2) * this.from.x + 2 * t * (1 - t) * via.x + Math.pow(t, 2) * this.to.x;
+ var y = Math.pow(1 - t, 2) * this.from.y + 2 * t * (1 - t) * via.y + Math.pow(t, 2) * this.to.y;
+
+ return { x: x, y: y };
+ }
+ }]);
+
+ return BezierEdgeStatic;
+ })(_utilBezierEdgeBase2['default']);
+
+ exports['default'] = BezierEdgeStatic;
+ module.exports = exports['default'];
+
+/***/ },
+/* 89 */
+/***/ 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _utilEdgeBase = __webpack_require__(86);
+
+ var _utilEdgeBase2 = _interopRequireDefault(_utilEdgeBase);
+
+ var StraightEdge = (function (_EdgeBase) {
+ _inherits(StraightEdge, _EdgeBase);
+
+ function StraightEdge(options, body, labelModule) {
+ _classCallCheck(this, StraightEdge);
+
+ _get(Object.getPrototypeOf(StraightEdge.prototype), 'constructor', this).call(this, options, body, labelModule);
+ }
+
+ _createClass(StraightEdge, [{
+ key: '_line',
+
+ /**
+ * Draw a line between two nodes
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+ value: function _line(ctx) {
+ // draw a straight line
+ ctx.beginPath();
+ ctx.moveTo(this.from.x, this.from.y);
+ ctx.lineTo(this.to.x, this.to.y);
+ // draw shadow if enabled
+ this.enableShadow(ctx);
+ ctx.stroke();
+ this.disableShadow(ctx);
+ return undefined;
+ }
+ }, {
+ key: 'getPoint',
+
+ /**
+ * Combined function of pointOnLine and pointOnBezier. This gives the coordinates of a point on the line at a certain percentage of the way
+ * @param percentage
+ * @param via
+ * @returns {{x: number, y: number}}
+ * @private
+ */
+ value: function getPoint(percentage) {
+ return {
+ x: (1 - percentage) * this.from.x + percentage * this.to.x,
+ y: (1 - percentage) * this.from.y + percentage * this.to.y
+ };
+ }
+ }, {
+ key: '_findBorderPosition',
+ value: function _findBorderPosition(nearNode, ctx) {
+ var node1 = this.to;
+ var node2 = this.from;
+ if (nearNode.id === this.from.id) {
+ node1 = this.from;
+ node2 = this.to;
+ }
+
+ var angle = Math.atan2(node1.y - node2.y, node1.x - node2.x);
+ var dx = node1.x - node2.x;
+ var dy = node1.y - node2.y;
+ var edgeSegmentLength = Math.sqrt(dx * dx + dy * dy);
+ var toBorderDist = nearNode.distanceToBorder(ctx, angle);
+ var toBorderPoint = (edgeSegmentLength - toBorderDist) / edgeSegmentLength;
+
+ var borderPos = {};
+ borderPos.x = (1 - toBorderPoint) * node2.x + toBorderPoint * node1.x;
+ borderPos.y = (1 - toBorderPoint) * node2.y + toBorderPoint * node1.y;
+
+ return borderPos;
+ }
+ }, {
+ key: '_getDistanceToEdge',
+ value: function _getDistanceToEdge(x1, y1, x2, y2, x3, y3) {
+ // x3,y3 is the point
+ return this._getDistanceToLine(x1, y1, x2, y2, x3, y3);
+ }
+ }]);
+
+ return StraightEdge;
+ })(_utilEdgeBase2['default']);
+
+ exports['default'] = StraightEdge;
+ module.exports = exports['default'];
+
+/***/ },
+/* 90 */
+/***/ 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 _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 _componentsPhysicsBarnesHutSolver = __webpack_require__(91);
+
+ var _componentsPhysicsBarnesHutSolver2 = _interopRequireDefault(_componentsPhysicsBarnesHutSolver);
+
+ var _componentsPhysicsRepulsionSolver = __webpack_require__(92);
+
+ var _componentsPhysicsRepulsionSolver2 = _interopRequireDefault(_componentsPhysicsRepulsionSolver);
+
+ var _componentsPhysicsHierarchicalRepulsionSolver = __webpack_require__(93);
+
+ var _componentsPhysicsHierarchicalRepulsionSolver2 = _interopRequireDefault(_componentsPhysicsHierarchicalRepulsionSolver);
+
+ var _componentsPhysicsSpringSolver = __webpack_require__(94);
+
+ var _componentsPhysicsSpringSolver2 = _interopRequireDefault(_componentsPhysicsSpringSolver);
+
+ var _componentsPhysicsHierarchicalSpringSolver = __webpack_require__(95);
+
+ var _componentsPhysicsHierarchicalSpringSolver2 = _interopRequireDefault(_componentsPhysicsHierarchicalSpringSolver);
+
+ var _componentsPhysicsCentralGravitySolver = __webpack_require__(96);
+
+ var _componentsPhysicsCentralGravitySolver2 = _interopRequireDefault(_componentsPhysicsCentralGravitySolver);
+
+ var _componentsPhysicsFA2BasedRepulsionSolver = __webpack_require__(97);
+
+ var _componentsPhysicsFA2BasedRepulsionSolver2 = _interopRequireDefault(_componentsPhysicsFA2BasedRepulsionSolver);
+
+ var _componentsPhysicsFA2BasedCentralGravitySolver = __webpack_require__(98);
+
+ var _componentsPhysicsFA2BasedCentralGravitySolver2 = _interopRequireDefault(_componentsPhysicsFA2BasedCentralGravitySolver);
+
+ var util = __webpack_require__(1);
+
+ var PhysicsEngine = (function () {
+ function PhysicsEngine(body) {
+ _classCallCheck(this, PhysicsEngine);
+
+ this.body = body;
+ this.physicsBody = { physicsNodeIndices: [], physicsEdgeIndices: [], forces: {}, velocities: {} };
+
+ this.physicsEnabled = true;
+ this.simulationInterval = 1000 / 60;
+ this.requiresTimeout = true;
+ this.previousStates = {};
+ this.referenceState = {};
+ this.freezeCache = {};
+ this.renderTimer = undefined;
+
+ // parameters for the adaptive timestep
+ this.adaptiveTimestep = false;
+ this.adaptiveTimestepEnabled = false;
+ this.adaptiveCounter = 0;
+ this.adaptiveInterval = 3;
+
+ this.stabilized = false;
+ this.startedStabilization = false;
+ this.stabilizationIterations = 0;
+ this.ready = false; // will be set to true if the stabilize
+
+ // default options
+ this.options = {};
+ this.defaultOptions = {
+ enabled: true,
+ barnesHut: {
+ theta: 0.5,
+ gravitationalConstant: -2000,
+ centralGravity: 0.3,
+ springLength: 95,
+ springConstant: 0.04,
+ damping: 0.09,
+ avoidOverlap: 0
+ },
+ forceAtlas2Based: {
+ theta: 0.5,
+ gravitationalConstant: -50,
+ centralGravity: 0.01,
+ springConstant: 0.08,
+ springLength: 100,
+ damping: 0.4,
+ avoidOverlap: 0
+ },
+ repulsion: {
+ centralGravity: 0.2,
+ springLength: 200,
+ springConstant: 0.05,
+ nodeDistance: 100,
+ damping: 0.09,
+ avoidOverlap: 0
+ },
+ hierarchicalRepulsion: {
+ centralGravity: 0.0,
+ springLength: 100,
+ springConstant: 0.01,
+ nodeDistance: 120,
+ damping: 0.09
+ },
+ maxVelocity: 50,
+ minVelocity: 0.75, // px/s
+ solver: 'barnesHut',
+ stabilization: {
+ enabled: true,
+ iterations: 1000, // maximum number of iteration to stabilize
+ updateInterval: 50,
+ onlyDynamicEdges: false,
+ fit: true
+ },
+ timestep: 0.5,
+ adaptiveTimestep: true
+ };
+ util.extend(this.options, this.defaultOptions);
+ this.timestep = 0.5;
+ this.layoutFailed = false;
+
+ this.bindEventListeners();
+ }
+
+ _createClass(PhysicsEngine, [{
+ key: 'bindEventListeners',
+ value: function bindEventListeners() {
+ var _this = this;
+
+ this.body.emitter.on('initPhysics', function () {
+ _this.initPhysics();
+ });
+ this.body.emitter.on('_layoutFailed', function () {
+ _this.layoutFailed = true;
+ });
+ this.body.emitter.on('resetPhysics', function () {
+ _this.stopSimulation();_this.ready = false;
+ });
+ this.body.emitter.on('disablePhysics', function () {
+ _this.physicsEnabled = false;_this.stopSimulation();
+ });
+ this.body.emitter.on('restorePhysics', function () {
+ _this.setOptions(_this.options);
+ if (_this.ready === true) {
+ _this.startSimulation();
+ }
+ });
+ this.body.emitter.on('startSimulation', function () {
+ if (_this.ready === true) {
+ _this.startSimulation();
+ }
+ });
+ this.body.emitter.on('stopSimulation', function () {
+ _this.stopSimulation();
+ });
+ this.body.emitter.on('destroy', function () {
+ _this.stopSimulation(false);
+ _this.body.emitter.off();
+ });
+ }
+ }, {
+ key: 'setOptions',
+
+ /**
+ * set the physics options
+ * @param options
+ */
+ value: function setOptions(options) {
+ if (options !== undefined) {
+ if (options === false) {
+ this.options.enabled = false;
+ this.physicsEnabled = false;
+ this.stopSimulation();
+ } else {
+ this.physicsEnabled = true;
+ util.selectiveNotDeepExtend(['stabilization'], this.options, options);
+ util.mergeOptions(this.options, options, 'stabilization');
+
+ if (options.enabled === undefined) {
+ this.options.enabled = true;
+ }
+
+ if (this.options.enabled === false) {
+ this.physicsEnabled = false;
+ this.stopSimulation();
+ }
+
+ // set the timestep
+ this.timestep = this.options.timestep;
+ }
+ }
+ this.init();
+ }
+ }, {
+ key: 'init',
+
+ /**
+ * configure the engine.
+ */
+ value: function init() {
+ var options;
+ if (this.options.solver === 'forceAtlas2Based') {
+ options = this.options.forceAtlas2Based;
+ this.nodesSolver = new _componentsPhysicsFA2BasedRepulsionSolver2['default'](this.body, this.physicsBody, options);
+ this.edgesSolver = new _componentsPhysicsSpringSolver2['default'](this.body, this.physicsBody, options);
+ this.gravitySolver = new _componentsPhysicsFA2BasedCentralGravitySolver2['default'](this.body, this.physicsBody, options);
+ } else if (this.options.solver === 'repulsion') {
+ options = this.options.repulsion;
+ this.nodesSolver = new _componentsPhysicsRepulsionSolver2['default'](this.body, this.physicsBody, options);
+ this.edgesSolver = new _componentsPhysicsSpringSolver2['default'](this.body, this.physicsBody, options);
+ this.gravitySolver = new _componentsPhysicsCentralGravitySolver2['default'](this.body, this.physicsBody, options);
+ } else if (this.options.solver === 'hierarchicalRepulsion') {
+ options = this.options.hierarchicalRepulsion;
+ this.nodesSolver = new _componentsPhysicsHierarchicalRepulsionSolver2['default'](this.body, this.physicsBody, options);
+ this.edgesSolver = new _componentsPhysicsHierarchicalSpringSolver2['default'](this.body, this.physicsBody, options);
+ this.gravitySolver = new _componentsPhysicsCentralGravitySolver2['default'](this.body, this.physicsBody, options);
+ } else {
+ // barnesHut
+ options = this.options.barnesHut;
+ this.nodesSolver = new _componentsPhysicsBarnesHutSolver2['default'](this.body, this.physicsBody, options);
+ this.edgesSolver = new _componentsPhysicsSpringSolver2['default'](this.body, this.physicsBody, options);
+ this.gravitySolver = new _componentsPhysicsCentralGravitySolver2['default'](this.body, this.physicsBody, options);
+ }
+
+ this.modelOptions = options;
+ }
+ }, {
+ key: 'initPhysics',
+
+ /**
+ * initialize the engine
+ */
+ value: function initPhysics() {
+ if (this.physicsEnabled === true && this.options.enabled === true) {
+ if (this.options.stabilization.enabled === true) {
+ this.stabilize();
+ } else {
+ this.stabilized = false;
+ this.ready = true;
+ this.body.emitter.emit('fit', {}, this.layoutFailed); // if the layout failed, we use the approximation for the zoom
+ this.startSimulation();
+ }
+ } else {
+ this.ready = true;
+ this.body.emitter.emit('fit');
+ }
+ }
+ }, {
+ key: 'startSimulation',
+
+ /**
+ * Start the simulation
+ */
+ value: function startSimulation() {
+ if (this.physicsEnabled === true && this.options.enabled === true) {
+ this.stabilized = false;
+
+ // when visible, adaptivity is disabled.
+ this.adaptiveTimestep = false;
+
+ // this sets the width of all nodes initially which could be required for the avoidOverlap
+ this.body.emitter.emit('_resizeNodes');
+ if (this.viewFunction === undefined) {
+ this.viewFunction = this.simulationStep.bind(this);
+ this.body.emitter.on('initRedraw', this.viewFunction);
+ this.body.emitter.emit('_startRendering');
+ }
+ } else {
+ this.body.emitter.emit('_redraw');
+ }
+ }
+ }, {
+ key: 'stopSimulation',
+
+ /**
+ * Stop the simulation, force stabilization.
+ */
+ value: function stopSimulation() {
+ var emit = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];
+
+ this.stabilized = true;
+ if (emit === true) {
+ this._emitStabilized();
+ }
+ if (this.viewFunction !== undefined) {
+ this.body.emitter.off('initRedraw', this.viewFunction);
+ this.viewFunction = undefined;
+ if (emit === true) {
+ this.body.emitter.emit('_stopRendering');
+ }
+ }
+ }
+ }, {
+ key: 'simulationStep',
+
+ /**
+ * The viewFunction inserts this step into each renderloop. It calls the physics tick and handles the cleanup at stabilized.
+ *
+ */
+ value: function simulationStep() {
+ // check if the physics have settled
+ var startTime = Date.now();
+ this.physicsTick();
+ var physicsTime = Date.now() - startTime;
+
+ // run double speed if it is a little graph
+ if ((physicsTime < 0.4 * this.simulationInterval || this.runDoubleSpeed === true) && this.stabilized === false) {
+ this.physicsTick();
+
+ // this makes sure there is no jitter. The decision is taken once to run it at double speed.
+ this.runDoubleSpeed = true;
+ }
+
+ if (this.stabilized === true) {
+ this.stopSimulation();
+ }
+ }
+ }, {
+ key: '_emitStabilized',
+
+ /**
+ * trigger the stabilized event.
+ * @private
+ */
+ value: function _emitStabilized() {
+ var _this2 = this;
+
+ var amountOfIterations = arguments.length <= 0 || arguments[0] === undefined ? this.stabilizationIterations : arguments[0];
+
+ if (this.stabilizationIterations > 1 || this.startedStabilization === true) {
+ setTimeout(function () {
+ _this2.body.emitter.emit('stabilized', { iterations: amountOfIterations });
+ _this2.startedStabilization = false;
+ _this2.stabilizationIterations = 0;
+ }, 0);
+ }
+ }
+ }, {
+ key: 'physicsTick',
+
+ /**
+ * A single simulation step (or 'tick') in the physics simulation
+ *
+ * @private
+ */
+ value: function physicsTick() {
+ // this is here to ensure that there is no start event when the network is already stable.
+ if (this.startedStabilization === false) {
+ this.body.emitter.emit('startStabilizing');
+ this.startedStabilization = true;
+ }
+
+ if (this.stabilized === false) {
+ // adaptivity means the timestep adapts to the situation, only applicable for stabilization
+ if (this.adaptiveTimestep === true && this.adaptiveTimestepEnabled === true) {
+ // this is the factor for increasing the timestep on success.
+ var factor = 1.2;
+
+ // we assume the adaptive interval is
+ if (this.adaptiveCounter % this.adaptiveInterval === 0) {
+ // we leave the timestep stable for "interval" iterations.
+ // first the big step and revert. Revert saves the reference state.
+ this.timestep = 2 * this.timestep;
+ this.calculateForces();
+ this.moveNodes();
+ this.revert();
+
+ // now the normal step. Since this is the last step, it is the more stable one and we will take this.
+ this.timestep = 0.5 * this.timestep;
+
+ // since it's half the step, we do it twice.
+ this.calculateForces();
+ this.moveNodes();
+ this.calculateForces();
+ this.moveNodes();
+
+ // we compare the two steps. if it is acceptable we double the step.
+ if (this._evaluateStepQuality() === true) {
+ this.timestep = factor * this.timestep;
+ } else {
+ // if not, we decrease the step to a minimum of the options timestep.
+ // if the decreased timestep is smaller than the options step, we do not reset the counter
+ // we assume that the options timestep is stable enough.
+ if (this.timestep / factor < this.options.timestep) {
+ this.timestep = this.options.timestep;
+ } else {
+ // if the timestep was larger than 2 times the option one we check the adaptivity again to ensure
+ // that large instabilities do not form.
+ this.adaptiveCounter = -1; // check again next iteration
+ this.timestep = Math.max(this.options.timestep, this.timestep / factor);
+ }
+ }
+ } else {
+ // normal step, keeping timestep constant
+ this.calculateForces();
+ this.moveNodes();
+ }
+
+ // increment the counter
+ this.adaptiveCounter += 1;
+ } else {
+ // case for the static timestep, we reset it to the one in options and take a normal step.
+ this.timestep = this.options.timestep;
+ this.calculateForces();
+ this.moveNodes();
+ }
+
+ // determine if the network has stabilzied
+ if (this.stabilized === true) {
+ this.revert();
+ }
+
+ this.stabilizationIterations++;
+ }
+ }
+ }, {
+ key: 'updatePhysicsData',
+
+ /**
+ * Nodes and edges can have the physics toggles on or off. A collection of indices is created here so we can skip the check all the time.
+ *
+ * @private
+ */
+ value: function updatePhysicsData() {
+ this.physicsBody.forces = {};
+ this.physicsBody.physicsNodeIndices = [];
+ this.physicsBody.physicsEdgeIndices = [];
+ var nodes = this.body.nodes;
+ var edges = this.body.edges;
+
+ // get node indices for physics
+ for (var nodeId in nodes) {
+ if (nodes.hasOwnProperty(nodeId)) {
+ if (nodes[nodeId].options.physics === true) {
+ this.physicsBody.physicsNodeIndices.push(nodeId);
+ }
+ }
+ }
+
+ // get edge indices for physics
+ for (var edgeId in edges) {
+ if (edges.hasOwnProperty(edgeId)) {
+ if (edges[edgeId].options.physics === true) {
+ this.physicsBody.physicsEdgeIndices.push(edgeId);
+ }
+ }
+ }
+
+ // get the velocity and the forces vector
+ for (var i = 0; i < this.physicsBody.physicsNodeIndices.length; i++) {
+ var nodeId = this.physicsBody.physicsNodeIndices[i];
+ this.physicsBody.forces[nodeId] = { x: 0, y: 0 };
+
+ // forces can be reset because they are recalculated. Velocities have to persist.
+ if (this.physicsBody.velocities[nodeId] === undefined) {
+ this.physicsBody.velocities[nodeId] = { x: 0, y: 0 };
+ }
+ }
+
+ // clean deleted nodes from the velocity vector
+ for (var nodeId in this.physicsBody.velocities) {
+ if (nodes[nodeId] === undefined) {
+ delete this.physicsBody.velocities[nodeId];
+ }
+ }
+ }
+ }, {
+ key: 'revert',
+
+ /**
+ * Revert the simulation one step. This is done so after stabilization, every new start of the simulation will also say stabilized.
+ */
+ value: function revert() {
+ var nodeIds = Object.keys(this.previousStates);
+ var nodes = this.body.nodes;
+ var velocities = this.physicsBody.velocities;
+ this.referenceState = {};
+
+ for (var i = 0; i < nodeIds.length; i++) {
+ var nodeId = nodeIds[i];
+ if (nodes[nodeId] !== undefined) {
+ if (nodes[nodeId].options.physics === true) {
+ this.referenceState[nodeId] = {
+ positions: { x: nodes[nodeId].x, y: nodes[nodeId].y }
+ };
+ velocities[nodeId].x = this.previousStates[nodeId].vx;
+ velocities[nodeId].y = this.previousStates[nodeId].vy;
+ nodes[nodeId].x = this.previousStates[nodeId].x;
+ nodes[nodeId].y = this.previousStates[nodeId].y;
+ }
+ } else {
+ delete this.previousStates[nodeId];
+ }
+ }
+ }
+ }, {
+ key: '_evaluateStepQuality',
+
+ /**
+ * This compares the reference state to the current state
+ */
+ value: function _evaluateStepQuality() {
+ var dx = undefined,
+ dy = undefined,
+ dpos = undefined;
+ var nodes = this.body.nodes;
+ var reference = this.referenceState;
+ var posThreshold = 0.3;
+
+ for (var nodeId in this.referenceState) {
+ if (this.referenceState.hasOwnProperty(nodeId) && nodes[nodeId] !== undefined) {
+ dx = nodes[nodeId].x - reference[nodeId].positions.x;
+ dy = nodes[nodeId].y - reference[nodeId].positions.y;
+
+ dpos = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
+
+ if (dpos > posThreshold) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+ }, {
+ key: 'moveNodes',
+
+ /**
+ * move the nodes one timestap and check if they are stabilized
+ * @returns {boolean}
+ */
+ value: function moveNodes() {
+ var nodeIndices = this.physicsBody.physicsNodeIndices;
+ var maxVelocity = this.options.maxVelocity ? this.options.maxVelocity : 1e9;
+ var maxNodeVelocity = 0;
+ var averageNodeVelocity = 0;
+
+ // the velocity threshold (energy in the system) for the adaptivity toggle
+ var velocityAdaptiveThreshold = 5;
+
+ for (var i = 0; i < nodeIndices.length; i++) {
+ var nodeId = nodeIndices[i];
+ var nodeVelocity = this._performStep(nodeId, maxVelocity);
+ // stabilized is true if stabilized is true and velocity is smaller than vmin --> all nodes must be stabilized
+ maxNodeVelocity = Math.max(maxNodeVelocity, nodeVelocity);
+ averageNodeVelocity += nodeVelocity;
+ }
+
+ // evaluating the stabilized and adaptiveTimestepEnabled conditions
+ this.adaptiveTimestepEnabled = averageNodeVelocity / nodeIndices.length < velocityAdaptiveThreshold;
+ this.stabilized = maxNodeVelocity < this.options.minVelocity;
+ }
+ }, {
+ key: '_performStep',
+
+ /**
+ * Perform the actual step
+ *
+ * @param nodeId
+ * @param maxVelocity
+ * @returns {number}
+ * @private
+ */
+ value: function _performStep(nodeId, maxVelocity) {
+ var node = this.body.nodes[nodeId];
+ var timestep = this.timestep;
+ var forces = this.physicsBody.forces;
+ var velocities = this.physicsBody.velocities;
+
+ // store the state so we can revert
+ this.previousStates[nodeId] = { x: node.x, y: node.y, vx: velocities[nodeId].x, vy: velocities[nodeId].y };
+
+ if (node.options.fixed.x === false) {
+ var dx = this.modelOptions.damping * velocities[nodeId].x; // damping force
+ var ax = (forces[nodeId].x - dx) / node.options.mass; // acceleration
+ velocities[nodeId].x += ax * timestep; // velocity
+ velocities[nodeId].x = Math.abs(velocities[nodeId].x) > maxVelocity ? velocities[nodeId].x > 0 ? maxVelocity : -maxVelocity : velocities[nodeId].x;
+ node.x += velocities[nodeId].x * timestep; // position
+ } else {
+ forces[nodeId].x = 0;
+ velocities[nodeId].x = 0;
+ }
+
+ if (node.options.fixed.y === false) {
+ var dy = this.modelOptions.damping * velocities[nodeId].y; // damping force
+ var ay = (forces[nodeId].y - dy) / node.options.mass; // acceleration
+ velocities[nodeId].y += ay * timestep; // velocity
+ velocities[nodeId].y = Math.abs(velocities[nodeId].y) > maxVelocity ? velocities[nodeId].y > 0 ? maxVelocity : -maxVelocity : velocities[nodeId].y;
+ node.y += velocities[nodeId].y * timestep; // position
+ } else {
+ forces[nodeId].y = 0;
+ velocities[nodeId].y = 0;
+ }
+
+ var totalVelocity = Math.sqrt(Math.pow(velocities[nodeId].x, 2) + Math.pow(velocities[nodeId].y, 2));
+ return totalVelocity;
+ }
+ }, {
+ key: 'calculateForces',
+
+ /**
+ * calculate the forces for one physics iteration.
+ */
+ value: function calculateForces() {
+ this.gravitySolver.solve();
+ this.nodesSolver.solve();
+ this.edgesSolver.solve();
+ }
+ }, {
+ key: '_freezeNodes',
+
+ /**
+ * When initializing and stabilizing, we can freeze nodes with a predefined position. This greatly speeds up stabilization
+ * because only the supportnodes for the smoothCurves have to settle.
+ *
+ * @private
+ */
+ value: function _freezeNodes() {
+ var nodes = this.body.nodes;
+ for (var id in nodes) {
+ if (nodes.hasOwnProperty(id)) {
+ if (nodes[id].x && nodes[id].y) {
+ this.freezeCache[id] = { x: nodes[id].options.fixed.x, y: nodes[id].options.fixed.y };
+ nodes[id].options.fixed.x = true;
+ nodes[id].options.fixed.y = true;
+ }
+ }
+ }
+ }
+ }, {
+ key: '_restoreFrozenNodes',
+
+ /**
+ * Unfreezes the nodes that have been frozen by _freezeDefinedNodes.
+ *
+ * @private
+ */
+ value: function _restoreFrozenNodes() {
+ var nodes = this.body.nodes;
+ for (var id in nodes) {
+ if (nodes.hasOwnProperty(id)) {
+ if (this.freezeCache[id] !== undefined) {
+ nodes[id].options.fixed.x = this.freezeCache[id].x;
+ nodes[id].options.fixed.y = this.freezeCache[id].y;
+ }
+ }
+ }
+ this.freezeCache = {};
+ }
+ }, {
+ key: 'stabilize',
+
+ /**
+ * Find a stable position for all nodes
+ * @private
+ */
+ value: function stabilize() {
+ var _this3 = this;
+
+ var iterations = arguments.length <= 0 || arguments[0] === undefined ? this.options.stabilization.iterations : arguments[0];
+
+ if (typeof iterations !== 'number') {
+ console.log('The stabilize method needs a numeric amount of iterations. Switching to default: ', this.options.stabilization.iterations);
+ iterations = this.options.stabilization.iterations;
+ }
+
+ if (this.physicsBody.physicsNodeIndices.length === 0) {
+ this.ready = true;
+ return;
+ }
+
+ // enable adaptive timesteps
+ this.adaptiveTimestep = true && this.options.adaptiveTimestep;
+
+ // this sets the width of all nodes initially which could be required for the avoidOverlap
+ this.body.emitter.emit('_resizeNodes');
+
+ // stop the render loop
+ this.stopSimulation();
+
+ // set stabilze to false
+ this.stabilized = false;
+
+ // block redraw requests
+ this.body.emitter.emit('_blockRedraw');
+ this.targetIterations = iterations;
+
+ // start the stabilization
+ if (this.options.stabilization.onlyDynamicEdges === true) {
+ this._freezeNodes();
+ }
+ this.stabilizationIterations = 0;
+
+ setTimeout(function () {
+ return _this3._stabilizationBatch();
+ }, 0);
+ }
+ }, {
+ key: '_stabilizationBatch',
+
+ /**
+ * One batch of stabilization
+ * @private
+ */
+ value: function _stabilizationBatch() {
+ // this is here to ensure that there is at least one start event.
+ if (this.startedStabilization === false) {
+ this.body.emitter.emit('startStabilizing');
+ this.startedStabilization = true;
+ }
+
+ var count = 0;
+ while (this.stabilized === false && count < this.options.stabilization.updateInterval && this.stabilizationIterations < this.targetIterations) {
+ this.physicsTick();
+ count++;
+ }
+
+ if (this.stabilized === false && this.stabilizationIterations < this.targetIterations) {
+ this.body.emitter.emit('stabilizationProgress', { iterations: this.stabilizationIterations, total: this.targetIterations });
+ setTimeout(this._stabilizationBatch.bind(this), 0);
+ } else {
+ this._finalizeStabilization();
+ }
+ }
+ }, {
+ key: '_finalizeStabilization',
+
+ /**
+ * Wrap up the stabilization, fit and emit the events.
+ * @private
+ */
+ value: function _finalizeStabilization() {
+ this.body.emitter.emit('_allowRedraw');
+ if (this.options.stabilization.fit === true) {
+ this.body.emitter.emit('fit');
+ }
+
+ if (this.options.stabilization.onlyDynamicEdges === true) {
+ this._restoreFrozenNodes();
+ }
+
+ this.body.emitter.emit('stabilizationIterationsDone');
+ this.body.emitter.emit('_requestRedraw');
+
+ if (this.stabilized === true) {
+ this._emitStabilized();
+ } else {
+ this.startSimulation();
+ }
+
+ this.ready = true;
+ }
+ }]);
+
+ return PhysicsEngine;
+ })();
+
+ exports['default'] = PhysicsEngine;
+ module.exports = exports['default'];
+
+/***/ },
+/* 91 */
+/***/ 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 BarnesHutSolver = (function () {
+ function BarnesHutSolver(body, physicsBody, options) {
+ _classCallCheck(this, BarnesHutSolver);
+
+ this.body = body;
+ this.physicsBody = physicsBody;
+ this.barnesHutTree;
+ this.setOptions(options);
+ this.randomSeed = 5;
+ }
+
+ _createClass(BarnesHutSolver, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ this.options = options;
+ this.thetaInversed = 1 / this.options.theta;
+ this.overlapAvoidanceFactor = 1 - Math.max(0, Math.min(1, this.options.avoidOverlap)); // if 1 then min distance = 0.5, if 0.5 then min distance = 0.5 + 0.5*node.shape.radius
+ }
+ }, {
+ key: "seededRandom",
+ value: function seededRandom() {
+ var x = Math.sin(this.randomSeed++) * 10000;
+ return x - Math.floor(x);
+ }
+ }, {
+ key: "solve",
+
+ /**
+ * This function calculates the forces the nodes apply on eachother based on a gravitational model.
+ * The Barnes Hut method is used to speed up this N-body simulation.
+ *
+ * @private
+ */
+ value: function solve() {
+ if (this.options.gravitationalConstant !== 0 && this.physicsBody.physicsNodeIndices.length > 0) {
+ var node = undefined;
+ var nodes = this.body.nodes;
+ var nodeIndices = this.physicsBody.physicsNodeIndices;
+ var nodeCount = nodeIndices.length;
+
+ // create the tree
+ var barnesHutTree = this._formBarnesHutTree(nodes, nodeIndices);
+
+ // for debugging
+ this.barnesHutTree = barnesHutTree;
+
+ // place the nodes one by one recursively
+ for (var i = 0; i < nodeCount; i++) {
+ node = nodes[nodeIndices[i]];
+ if (node.options.mass > 0) {
+ // starting with root is irrelevant, it never passes the BarnesHutSolver condition
+ this._getForceContribution(barnesHutTree.root.children.NW, node);
+ this._getForceContribution(barnesHutTree.root.children.NE, node);
+ this._getForceContribution(barnesHutTree.root.children.SW, node);
+ this._getForceContribution(barnesHutTree.root.children.SE, node);
+ }
+ }
+ }
+ }
+ }, {
+ key: "_getForceContribution",
+
+ /**
+ * This function traverses the barnesHutTree. It checks when it can approximate distant nodes with their center of mass.
+ * If a region contains a single node, we check if it is not itself, then we apply the force.
+ *
+ * @param parentBranch
+ * @param node
+ * @private
+ */
+ value: function _getForceContribution(parentBranch, node) {
+ // we get no force contribution from an empty region
+ if (parentBranch.childrenCount > 0) {
+ var dx = undefined,
+ dy = undefined,
+ distance = undefined;
+
+ // get the distance from the center of mass to the node.
+ dx = parentBranch.centerOfMass.x - node.x;
+ dy = parentBranch.centerOfMass.y - node.y;
+ distance = Math.sqrt(dx * dx + dy * dy);
+
+ // BarnesHutSolver condition
+ // original condition : s/d < theta = passed === d/s > 1/theta = passed
+ // calcSize = 1/s --> d * 1/s > 1/theta = passed
+ if (distance * parentBranch.calcSize > this.thetaInversed) {
+ this._calculateForces(distance, dx, dy, node, parentBranch);
+ } else {
+ // Did not pass the condition, go into children if available
+ if (parentBranch.childrenCount === 4) {
+ this._getForceContribution(parentBranch.children.NW, node);
+ this._getForceContribution(parentBranch.children.NE, node);
+ this._getForceContribution(parentBranch.children.SW, node);
+ this._getForceContribution(parentBranch.children.SE, node);
+ } else {
+ // parentBranch must have only one node, if it was empty we wouldnt be here
+ if (parentBranch.children.data.id != node.id) {
+ // if it is not self
+ this._calculateForces(distance, dx, dy, node, parentBranch);
+ }
+ }
+ }
+ }
+ }
+ }, {
+ key: "_calculateForces",
+
+ /**
+ * Calculate the forces based on the distance.
+ *
+ * @param distance
+ * @param dx
+ * @param dy
+ * @param node
+ * @param parentBranch
+ * @private
+ */
+ value: function _calculateForces(distance, dx, dy, node, parentBranch) {
+ if (distance === 0) {
+ distance = 0.1;
+ dx = distance;
+ }
+
+ if (this.overlapAvoidanceFactor < 1) {
+ distance = Math.max(0.1 + this.overlapAvoidanceFactor * node.shape.radius, distance - node.shape.radius);
+ }
+
+ // the dividing by the distance cubed instead of squared allows us to get the fx and fy components without sines and cosines
+ // it is shorthand for gravityforce with distance squared and fx = dx/distance * gravityForce
+ var gravityForce = this.options.gravitationalConstant * parentBranch.mass * node.options.mass / Math.pow(distance, 3);
+ var fx = dx * gravityForce;
+ var fy = dy * gravityForce;
+
+ this.physicsBody.forces[node.id].x += fx;
+ this.physicsBody.forces[node.id].y += fy;
+ }
+ }, {
+ key: "_formBarnesHutTree",
+
+ /**
+ * This function constructs the barnesHut tree recursively. It creates the root, splits it and starts placing the nodes.
+ *
+ * @param nodes
+ * @param nodeIndices
+ * @private
+ */
+ value: function _formBarnesHutTree(nodes, nodeIndices) {
+ var node = undefined;
+ var nodeCount = nodeIndices.length;
+
+ var minX = nodes[nodeIndices[0]].x;
+ var minY = nodes[nodeIndices[0]].y;
+ var maxX = nodes[nodeIndices[0]].x;
+ var maxY = nodes[nodeIndices[0]].y;
+
+ // get the range of the nodes
+ for (var i = 1; i < nodeCount; i++) {
+ var x = nodes[nodeIndices[i]].x;
+ var y = nodes[nodeIndices[i]].y;
+ if (nodes[nodeIndices[i]].options.mass > 0) {
+ if (x < minX) {
+ minX = x;
+ }
+ if (x > maxX) {
+ maxX = x;
+ }
+ if (y < minY) {
+ minY = y;
+ }
+ if (y > maxY) {
+ maxY = y;
+ }
+ }
+ }
+ // make the range a square
+ var sizeDiff = Math.abs(maxX - minX) - Math.abs(maxY - minY); // difference between X and Y
+ if (sizeDiff > 0) {
+ minY -= 0.5 * sizeDiff;
+ maxY += 0.5 * sizeDiff;
+ } // xSize > ySize
+ else {
+ minX += 0.5 * sizeDiff;
+ maxX -= 0.5 * sizeDiff;
+ } // xSize < ySize
+
+ var minimumTreeSize = 1e-5;
+ var rootSize = Math.max(minimumTreeSize, Math.abs(maxX - minX));
+ var halfRootSize = 0.5 * rootSize;
+ var centerX = 0.5 * (minX + maxX),
+ centerY = 0.5 * (minY + maxY);
+
+ // construct the barnesHutTree
+ var barnesHutTree = {
+ root: {
+ centerOfMass: { x: 0, y: 0 },
+ mass: 0,
+ range: {
+ minX: centerX - halfRootSize, maxX: centerX + halfRootSize,
+ minY: centerY - halfRootSize, maxY: centerY + halfRootSize
+ },
+ size: rootSize,
+ calcSize: 1 / rootSize,
+ children: { data: null },
+ maxWidth: 0,
+ level: 0,
+ childrenCount: 4
+ }
+ };
+ this._splitBranch(barnesHutTree.root);
+
+ // place the nodes one by one recursively
+ for (var i = 0; i < nodeCount; i++) {
+ node = nodes[nodeIndices[i]];
+ if (node.options.mass > 0) {
+ this._placeInTree(barnesHutTree.root, node);
+ }
+ }
+
+ // make global
+ return barnesHutTree;
+ }
+ }, {
+ key: "_updateBranchMass",
+
+ /**
+ * this updates the mass of a branch. this is increased by adding a node.
+ *
+ * @param parentBranch
+ * @param node
+ * @private
+ */
+ value: function _updateBranchMass(parentBranch, node) {
+ var totalMass = parentBranch.mass + node.options.mass;
+ var totalMassInv = 1 / totalMass;
+
+ parentBranch.centerOfMass.x = parentBranch.centerOfMass.x * parentBranch.mass + node.x * node.options.mass;
+ parentBranch.centerOfMass.x *= totalMassInv;
+
+ parentBranch.centerOfMass.y = parentBranch.centerOfMass.y * parentBranch.mass + node.y * node.options.mass;
+ parentBranch.centerOfMass.y *= totalMassInv;
+
+ parentBranch.mass = totalMass;
+ var biggestSize = Math.max(Math.max(node.height, node.radius), node.width);
+ parentBranch.maxWidth = parentBranch.maxWidth < biggestSize ? biggestSize : parentBranch.maxWidth;
+ }
+ }, {
+ key: "_placeInTree",
+
+ /**
+ * determine in which branch the node will be placed.
+ *
+ * @param parentBranch
+ * @param node
+ * @param skipMassUpdate
+ * @private
+ */
+ value: function _placeInTree(parentBranch, node, skipMassUpdate) {
+ if (skipMassUpdate != true || skipMassUpdate === undefined) {
+ // update the mass of the branch.
+ this._updateBranchMass(parentBranch, node);
+ }
+
+ if (parentBranch.children.NW.range.maxX > node.x) {
+ // in NW or SW
+ if (parentBranch.children.NW.range.maxY > node.y) {
+ // in NW
+ this._placeInRegion(parentBranch, node, "NW");
+ } else {
+ // in SW
+ this._placeInRegion(parentBranch, node, "SW");
+ }
+ } else {
+ // in NE or SE
+ if (parentBranch.children.NW.range.maxY > node.y) {
+ // in NE
+ this._placeInRegion(parentBranch, node, "NE");
+ } else {
+ // in SE
+ this._placeInRegion(parentBranch, node, "SE");
+ }
+ }
+ }
+ }, {
+ key: "_placeInRegion",
+
+ /**
+ * actually place the node in a region (or branch)
+ *
+ * @param parentBranch
+ * @param node
+ * @param region
+ * @private
+ */
+ value: function _placeInRegion(parentBranch, node, region) {
+ switch (parentBranch.children[region].childrenCount) {
+ case 0:
+ // place node here
+ parentBranch.children[region].children.data = node;
+ parentBranch.children[region].childrenCount = 1;
+ this._updateBranchMass(parentBranch.children[region], node);
+ break;
+ case 1:
+ // convert into children
+ // if there are two nodes exactly overlapping (on init, on opening of cluster etc.)
+ // we move one node a pixel and we do not put it in the tree.
+ if (parentBranch.children[region].children.data.x === node.x && parentBranch.children[region].children.data.y === node.y) {
+ node.x += this.seededRandom();
+ node.y += this.seededRandom();
+ } else {
+ this._splitBranch(parentBranch.children[region]);
+ this._placeInTree(parentBranch.children[region], node);
+ }
+ break;
+ case 4:
+ // place in branch
+ this._placeInTree(parentBranch.children[region], node);
+ break;
+ }
+ }
+ }, {
+ key: "_splitBranch",
+
+ /**
+ * this function splits a branch into 4 sub branches. If the branch contained a node, we place it in the subbranch
+ * after the split is complete.
+ *
+ * @param parentBranch
+ * @private
+ */
+ value: function _splitBranch(parentBranch) {
+ // if the branch is shaded with a node, replace the node in the new subset.
+ var containedNode = null;
+ if (parentBranch.childrenCount === 1) {
+ containedNode = parentBranch.children.data;
+ parentBranch.mass = 0;
+ parentBranch.centerOfMass.x = 0;
+ parentBranch.centerOfMass.y = 0;
+ }
+ parentBranch.childrenCount = 4;
+ parentBranch.children.data = null;
+ this._insertRegion(parentBranch, "NW");
+ this._insertRegion(parentBranch, "NE");
+ this._insertRegion(parentBranch, "SW");
+ this._insertRegion(parentBranch, "SE");
+
+ if (containedNode != null) {
+ this._placeInTree(parentBranch, containedNode);
+ }
+ }
+ }, {
+ key: "_insertRegion",
+
+ /**
+ * This function subdivides the region into four new segments.
+ * Specifically, this inserts a single new segment.
+ * It fills the children section of the parentBranch
+ *
+ * @param parentBranch
+ * @param region
+ * @param parentRange
+ * @private
+ */
+ value: function _insertRegion(parentBranch, region) {
+ var minX = undefined,
+ maxX = undefined,
+ minY = undefined,
+ maxY = undefined;
+ var childSize = 0.5 * parentBranch.size;
+ switch (region) {
+ case "NW":
+ minX = parentBranch.range.minX;
+ maxX = parentBranch.range.minX + childSize;
+ minY = parentBranch.range.minY;
+ maxY = parentBranch.range.minY + childSize;
+ break;
+ case "NE":
+ minX = parentBranch.range.minX + childSize;
+ maxX = parentBranch.range.maxX;
+ minY = parentBranch.range.minY;
+ maxY = parentBranch.range.minY + childSize;
+ break;
+ case "SW":
+ minX = parentBranch.range.minX;
+ maxX = parentBranch.range.minX + childSize;
+ minY = parentBranch.range.minY + childSize;
+ maxY = parentBranch.range.maxY;
+ break;
+ case "SE":
+ minX = parentBranch.range.minX + childSize;
+ maxX = parentBranch.range.maxX;
+ minY = parentBranch.range.minY + childSize;
+ maxY = parentBranch.range.maxY;
+ break;
+ }
+
+ parentBranch.children[region] = {
+ centerOfMass: { x: 0, y: 0 },
+ mass: 0,
+ range: { minX: minX, maxX: maxX, minY: minY, maxY: maxY },
+ size: 0.5 * parentBranch.size,
+ calcSize: 2 * parentBranch.calcSize,
+ children: { data: null },
+ maxWidth: 0,
+ level: parentBranch.level + 1,
+ childrenCount: 0
+ };
+ }
+ }, {
+ key: "_debug",
+
+ //--------------------------- DEBUGGING BELOW ---------------------------//
+
+ /**
+ * This function is for debugging purposed, it draws the tree.
+ *
+ * @param ctx
+ * @param color
+ * @private
+ */
+ value: function _debug(ctx, color) {
+ if (this.barnesHutTree !== undefined) {
+
+ ctx.lineWidth = 1;
+
+ this._drawBranch(this.barnesHutTree.root, ctx, color);
+ }
+ }
+ }, {
+ key: "_drawBranch",
+
+ /**
+ * This function is for debugging purposes. It draws the branches recursively.
+ *
+ * @param branch
+ * @param ctx
+ * @param color
+ * @private
+ */
+ value: function _drawBranch(branch, ctx, color) {
+ if (color === undefined) {
+ color = "#FF0000";
+ }
+
+ if (branch.childrenCount === 4) {
+ this._drawBranch(branch.children.NW, ctx);
+ this._drawBranch(branch.children.NE, ctx);
+ this._drawBranch(branch.children.SE, ctx);
+ this._drawBranch(branch.children.SW, ctx);
+ }
+ ctx.strokeStyle = color;
+ ctx.beginPath();
+ ctx.moveTo(branch.range.minX, branch.range.minY);
+ ctx.lineTo(branch.range.maxX, branch.range.minY);
+ ctx.stroke();
+
+ ctx.beginPath();
+ ctx.moveTo(branch.range.maxX, branch.range.minY);
+ ctx.lineTo(branch.range.maxX, branch.range.maxY);
+ ctx.stroke();
+
+ ctx.beginPath();
+ ctx.moveTo(branch.range.maxX, branch.range.maxY);
+ ctx.lineTo(branch.range.minX, branch.range.maxY);
+ ctx.stroke();
+
+ ctx.beginPath();
+ ctx.moveTo(branch.range.minX, branch.range.maxY);
+ ctx.lineTo(branch.range.minX, branch.range.minY);
+ ctx.stroke();
+
+ /*
+ if (branch.mass > 0) {
+ ctx.circle(branch.centerOfMass.x, branch.centerOfMass.y, 3*branch.mass);
+ ctx.stroke();
+ }
+ */
+ }
+ }]);
+
+ return BarnesHutSolver;
+ })();
+
+ exports["default"] = BarnesHutSolver;
+ module.exports = exports["default"];
+
+/***/ },
+/* 92 */
+/***/ 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 RepulsionSolver = (function () {
+ function RepulsionSolver(body, physicsBody, options) {
+ _classCallCheck(this, RepulsionSolver);
+
+ this.body = body;
+ this.physicsBody = physicsBody;
+ this.setOptions(options);
+ }
+
+ _createClass(RepulsionSolver, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ this.options = options;
+ }
+ }, {
+ key: "solve",
+
+ /**
+ * Calculate the forces the nodes apply on each other based on a repulsion field.
+ * This field is linearly approximated.
+ *
+ * @private
+ */
+ value: function solve() {
+ var dx, dy, distance, fx, fy, repulsingForce, node1, node2;
+
+ var nodes = this.body.nodes;
+ var nodeIndices = this.physicsBody.physicsNodeIndices;
+ var forces = this.physicsBody.forces;
+
+ // repulsing forces between nodes
+ var nodeDistance = this.options.nodeDistance;
+
+ // approximation constants
+ var a = -2 / 3 / nodeDistance;
+ var b = 4 / 3;
+
+ // we loop from i over all but the last entree in the array
+ // j loops from i+1 to the last. This way we do not double count any of the indices, nor i === j
+ for (var i = 0; i < nodeIndices.length - 1; i++) {
+ node1 = nodes[nodeIndices[i]];
+ for (var j = i + 1; j < nodeIndices.length; j++) {
+ node2 = nodes[nodeIndices[j]];
+
+ dx = node2.x - node1.x;
+ dy = node2.y - node1.y;
+ distance = Math.sqrt(dx * dx + dy * dy);
+
+ // same condition as BarnesHutSolver, making sure nodes are never 100% overlapping.
+ if (distance === 0) {
+ distance = 0.1 * Math.random();
+ dx = distance;
+ }
+
+ if (distance < 2 * nodeDistance) {
+ if (distance < 0.5 * nodeDistance) {
+ repulsingForce = 1.0;
+ } else {
+ repulsingForce = a * distance + b; // linear approx of 1 / (1 + Math.exp((distance / nodeDistance - 1) * steepness))
+ }
+ repulsingForce = repulsingForce / distance;
+
+ fx = dx * repulsingForce;
+ fy = dy * repulsingForce;
+
+ forces[node1.id].x -= fx;
+ forces[node1.id].y -= fy;
+ forces[node2.id].x += fx;
+ forces[node2.id].y += fy;
+ }
+ }
+ }
+ }
+ }]);
+
+ return RepulsionSolver;
+ })();
+
+ exports["default"] = RepulsionSolver;
+ module.exports = exports["default"];
+
+/***/ },
+/* 93 */
+/***/ 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 HierarchicalRepulsionSolver = (function () {
+ function HierarchicalRepulsionSolver(body, physicsBody, options) {
+ _classCallCheck(this, HierarchicalRepulsionSolver);
+
+ this.body = body;
+ this.physicsBody = physicsBody;
+ this.setOptions(options);
+ }
+
+ _createClass(HierarchicalRepulsionSolver, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ this.options = options;
+ }
+ }, {
+ key: "solve",
+
+ /**
+ * Calculate the forces the nodes apply on each other based on a repulsion field.
+ * This field is linearly approximated.
+ *
+ * @private
+ */
+ value: function solve() {
+ var dx, dy, distance, fx, fy, repulsingForce, node1, node2, i, j;
+
+ var nodes = this.body.nodes;
+ var nodeIndices = this.physicsBody.physicsNodeIndices;
+ var forces = this.physicsBody.forces;
+
+ // repulsing forces between nodes
+ var nodeDistance = this.options.nodeDistance;
+
+ // we loop from i over all but the last entree in the array
+ // j loops from i+1 to the last. This way we do not double count any of the indices, nor i === j
+ for (i = 0; i < nodeIndices.length - 1; i++) {
+ node1 = nodes[nodeIndices[i]];
+ for (j = i + 1; j < nodeIndices.length; j++) {
+ node2 = nodes[nodeIndices[j]];
+
+ // nodes only affect nodes on their level
+ if (node1.level === node2.level) {
+ dx = node2.x - node1.x;
+ dy = node2.y - node1.y;
+ distance = Math.sqrt(dx * dx + dy * dy);
+
+ var steepness = 0.05;
+ if (distance < nodeDistance) {
+ repulsingForce = -Math.pow(steepness * distance, 2) + Math.pow(steepness * nodeDistance, 2);
+ } else {
+ repulsingForce = 0;
+ }
+ // normalize force with
+ if (distance === 0) {
+ distance = 0.01;
+ } else {
+ repulsingForce = repulsingForce / distance;
+ }
+ fx = dx * repulsingForce;
+ fy = dy * repulsingForce;
+
+ forces[node1.id].x -= fx;
+ forces[node1.id].y -= fy;
+ forces[node2.id].x += fx;
+ forces[node2.id].y += fy;
+ }
+ }
+ }
+ }
+ }]);
+
+ return HierarchicalRepulsionSolver;
+ })();
+
+ exports["default"] = HierarchicalRepulsionSolver;
+ module.exports = exports["default"];
+
+/***/ },
+/* 94 */
+/***/ 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 SpringSolver = (function () {
+ function SpringSolver(body, physicsBody, options) {
+ _classCallCheck(this, SpringSolver);
+
+ this.body = body;
+ this.physicsBody = physicsBody;
+ this.setOptions(options);
+ }
+
+ _createClass(SpringSolver, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ this.options = options;
+ }
+ }, {
+ key: "solve",
+
+ /**
+ * This function calculates the springforces on the nodes, accounting for the support nodes.
+ *
+ * @private
+ */
+ value: function solve() {
+ var edgeLength = undefined,
+ edge = undefined;
+ var edgeIndices = this.physicsBody.physicsEdgeIndices;
+ var edges = this.body.edges;
+ var node1 = undefined,
+ node2 = undefined,
+ node3 = undefined;
+
+ // forces caused by the edges, modelled as springs
+ for (var i = 0; i < edgeIndices.length; i++) {
+ edge = edges[edgeIndices[i]];
+ if (edge.connected === true && edge.toId !== edge.fromId) {
+ // only calculate forces if nodes are in the same sector
+ if (this.body.nodes[edge.toId] !== undefined && this.body.nodes[edge.fromId] !== undefined) {
+ if (edge.edgeType.via !== undefined) {
+ edgeLength = edge.options.length === undefined ? this.options.springLength : edge.options.length;
+ node1 = edge.to;
+ node2 = edge.edgeType.via;
+ node3 = edge.from;
+
+ this._calculateSpringForce(node1, node2, 0.5 * edgeLength);
+ this._calculateSpringForce(node2, node3, 0.5 * edgeLength);
+ } else {
+ // the * 1.5 is here so the edge looks as large as a smooth edge. It does not initially because the smooth edges use
+ // the support nodes which exert a repulsive force on the to and from nodes, making the edge appear larger.
+ edgeLength = edge.options.length === undefined ? this.options.springLength * 1.5 : edge.options.length;
+ this._calculateSpringForce(edge.from, edge.to, edgeLength);
+ }
+ }
+ }
+ }
+ }
+ }, {
+ key: "_calculateSpringForce",
+
+ /**
+ * This is the code actually performing the calculation for the function above.
+ *
+ * @param node1
+ * @param node2
+ * @param edgeLength
+ * @private
+ */
+ value: function _calculateSpringForce(node1, node2, edgeLength) {
+ var dx = node1.x - node2.x;
+ var dy = node1.y - node2.y;
+ var distance = Math.max(Math.sqrt(dx * dx + dy * dy), 0.01);
+
+ // the 1/distance is so the fx and fy can be calculated without sine or cosine.
+ var springForce = this.options.springConstant * (edgeLength - distance) / distance;
+
+ var fx = dx * springForce;
+ var fy = dy * springForce;
+
+ // handle the case where one node is not part of the physcis
+ if (this.physicsBody.forces[node1.id] !== undefined) {
+ this.physicsBody.forces[node1.id].x += fx;
+ this.physicsBody.forces[node1.id].y += fy;
+ }
+
+ if (this.physicsBody.forces[node2.id] !== undefined) {
+ this.physicsBody.forces[node2.id].x -= fx;
+ this.physicsBody.forces[node2.id].y -= fy;
+ }
+ }
+ }]);
+
+ return SpringSolver;
+ })();
+
+ exports["default"] = SpringSolver;
+ module.exports = exports["default"];
+
+/***/ },
+/* 95 */
+/***/ 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 HierarchicalSpringSolver = (function () {
+ function HierarchicalSpringSolver(body, physicsBody, options) {
+ _classCallCheck(this, HierarchicalSpringSolver);
+
+ this.body = body;
+ this.physicsBody = physicsBody;
+ this.setOptions(options);
+ }
+
+ _createClass(HierarchicalSpringSolver, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ this.options = options;
+ }
+ }, {
+ key: "solve",
+
+ /**
+ * This function calculates the springforces on the nodes, accounting for the support nodes.
+ *
+ * @private
+ */
+ value: function solve() {
+ var edgeLength, edge;
+ var dx, dy, fx, fy, springForce, distance;
+ var edges = this.body.edges;
+ var factor = 0.5;
+
+ var edgeIndices = this.physicsBody.physicsEdgeIndices;
+ var nodeIndices = this.physicsBody.physicsNodeIndices;
+ var forces = this.physicsBody.forces;
+
+ // initialize the spring force counters
+ for (var i = 0; i < nodeIndices.length; i++) {
+ var nodeId = nodeIndices[i];
+ forces[nodeId].springFx = 0;
+ forces[nodeId].springFy = 0;
+ }
+
+ // forces caused by the edges, modelled as springs
+ for (var i = 0; i < edgeIndices.length; i++) {
+ edge = edges[edgeIndices[i]];
+ if (edge.connected === true) {
+ edgeLength = edge.options.length === undefined ? this.options.springLength : edge.options.length;
+
+ dx = edge.from.x - edge.to.x;
+ dy = edge.from.y - edge.to.y;
+ distance = Math.sqrt(dx * dx + dy * dy);
+ distance = distance === 0 ? 0.01 : distance;
+
+ // the 1/distance is so the fx and fy can be calculated without sine or cosine.
+ springForce = this.options.springConstant * (edgeLength - distance) / distance;
+
+ fx = dx * springForce;
+ fy = dy * springForce;
+
+ if (edge.to.level != edge.from.level) {
+ if (forces[edge.toId] !== undefined) {
+ forces[edge.toId].springFx -= fx;
+ forces[edge.toId].springFy -= fy;
+ }
+ if (forces[edge.fromId] !== undefined) {
+ forces[edge.fromId].springFx += fx;
+ forces[edge.fromId].springFy += fy;
+ }
+ } else {
+ if (forces[edge.toId] !== undefined) {
+ forces[edge.toId].x -= factor * fx;
+ forces[edge.toId].y -= factor * fy;
+ }
+ if (forces[edge.fromId] !== undefined) {
+ forces[edge.fromId].x += factor * fx;
+ forces[edge.fromId].y += factor * fy;
+ }
+ }
+ }
+ }
+
+ // normalize spring forces
+ var springForce = 1;
+ var springFx, springFy;
+ for (var i = 0; i < nodeIndices.length; i++) {
+ var nodeId = nodeIndices[i];
+ springFx = Math.min(springForce, Math.max(-springForce, forces[nodeId].springFx));
+ springFy = Math.min(springForce, Math.max(-springForce, forces[nodeId].springFy));
+
+ forces[nodeId].x += springFx;
+ forces[nodeId].y += springFy;
+ }
+
+ // retain energy balance
+ var totalFx = 0;
+ var totalFy = 0;
+ for (var i = 0; i < nodeIndices.length; i++) {
+ var nodeId = nodeIndices[i];
+ totalFx += forces[nodeId].x;
+ totalFy += forces[nodeId].y;
+ }
+ var correctionFx = totalFx / nodeIndices.length;
+ var correctionFy = totalFy / nodeIndices.length;
+
+ for (var i = 0; i < nodeIndices.length; i++) {
+ var nodeId = nodeIndices[i];
+ forces[nodeId].x -= correctionFx;
+ forces[nodeId].y -= correctionFy;
+ }
+ }
+ }]);
+
+ return HierarchicalSpringSolver;
+ })();
+
+ exports["default"] = HierarchicalSpringSolver;
+ module.exports = exports["default"];
+
+/***/ },
+/* 96 */
+/***/ 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 CentralGravitySolver = (function () {
+ function CentralGravitySolver(body, physicsBody, options) {
+ _classCallCheck(this, CentralGravitySolver);
+
+ this.body = body;
+ this.physicsBody = physicsBody;
+ this.setOptions(options);
+ }
+
+ _createClass(CentralGravitySolver, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ this.options = options;
+ }
+ }, {
+ key: "solve",
+ value: function solve() {
+ var dx = undefined,
+ dy = undefined,
+ distance = undefined,
+ node = undefined;
+ var nodes = this.body.nodes;
+ var nodeIndices = this.physicsBody.physicsNodeIndices;
+ var forces = this.physicsBody.forces;
+
+ for (var i = 0; i < nodeIndices.length; i++) {
+ var nodeId = nodeIndices[i];
+ node = nodes[nodeId];
+ dx = -node.x;
+ dy = -node.y;
+ distance = Math.sqrt(dx * dx + dy * dy);
+
+ this._calculateForces(distance, dx, dy, forces, node);
+ }
+ }
+ }, {
+ key: "_calculateForces",
+
+ /**
+ * Calculate the forces based on the distance.
+ * @private
+ */
+ value: function _calculateForces(distance, dx, dy, forces, node) {
+ var gravityForce = distance === 0 ? 0 : this.options.centralGravity / distance;
+ forces[node.id].x = dx * gravityForce;
+ forces[node.id].y = dy * gravityForce;
+ }
+ }]);
+
+ return CentralGravitySolver;
+ })();
+
+ exports["default"] = CentralGravitySolver;
+ module.exports = exports["default"];
+
+/***/ },
+/* 97 */
+/***/ 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _BarnesHutSolver2 = __webpack_require__(91);
+
+ var _BarnesHutSolver3 = _interopRequireDefault(_BarnesHutSolver2);
+
+ var ForceAtlas2BasedRepulsionSolver = (function (_BarnesHutSolver) {
+ _inherits(ForceAtlas2BasedRepulsionSolver, _BarnesHutSolver);
+
+ function ForceAtlas2BasedRepulsionSolver(body, physicsBody, options) {
+ _classCallCheck(this, ForceAtlas2BasedRepulsionSolver);
+
+ _get(Object.getPrototypeOf(ForceAtlas2BasedRepulsionSolver.prototype), "constructor", this).call(this, body, physicsBody, options);
+ }
+
+ _createClass(ForceAtlas2BasedRepulsionSolver, [{
+ key: "_calculateForces",
+
+ /**
+ * Calculate the forces based on the distance.
+ *
+ * @param distance
+ * @param dx
+ * @param dy
+ * @param node
+ * @param parentBranch
+ * @private
+ */
+ value: function _calculateForces(distance, dx, dy, node, parentBranch) {
+ if (distance === 0) {
+ distance = 0.1 * Math.random();
+ dx = distance;
+ }
+
+ if (this.overlapAvoidanceFactor < 1) {
+ distance = Math.max(0.1 + this.overlapAvoidanceFactor * node.shape.radius, distance - node.shape.radius);
+ }
+
+ var degree = node.edges.length + 1;
+ // the dividing by the distance cubed instead of squared allows us to get the fx and fy components without sines and cosines
+ // it is shorthand for gravityforce with distance squared and fx = dx/distance * gravityForce
+ var gravityForce = this.options.gravitationalConstant * parentBranch.mass * node.options.mass * degree / Math.pow(distance, 2);
+ var fx = dx * gravityForce;
+ var fy = dy * gravityForce;
+
+ this.physicsBody.forces[node.id].x += fx;
+ this.physicsBody.forces[node.id].y += fy;
+ }
+ }]);
+
+ return ForceAtlas2BasedRepulsionSolver;
+ })(_BarnesHutSolver3["default"]);
+
+ exports["default"] = ForceAtlas2BasedRepulsionSolver;
+ module.exports = exports["default"];
+
+/***/ },
+/* 98 */
+/***/ 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(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _CentralGravitySolver2 = __webpack_require__(96);
+
+ var _CentralGravitySolver3 = _interopRequireDefault(_CentralGravitySolver2);
+
+ var ForceAtlas2BasedCentralGravitySolver = (function (_CentralGravitySolver) {
+ _inherits(ForceAtlas2BasedCentralGravitySolver, _CentralGravitySolver);
+
+ function ForceAtlas2BasedCentralGravitySolver(body, physicsBody, options) {
+ _classCallCheck(this, ForceAtlas2BasedCentralGravitySolver);
+
+ _get(Object.getPrototypeOf(ForceAtlas2BasedCentralGravitySolver.prototype), "constructor", this).call(this, body, physicsBody, options);
+ }
+
+ _createClass(ForceAtlas2BasedCentralGravitySolver, [{
+ key: "_calculateForces",
+
+ /**
+ * Calculate the forces based on the distance.
+ * @private
+ */
+ value: function _calculateForces(distance, dx, dy, forces, node) {
+ if (distance > 0) {
+ var degree = node.edges.length + 1;
+ var gravityForce = this.options.centralGravity * degree * node.options.mass;
+ forces[node.id].x = dx * gravityForce;
+ forces[node.id].y = dy * gravityForce;
+ }
+ }
+ }]);
+
+ return ForceAtlas2BasedCentralGravitySolver;
+ })(_CentralGravitySolver3["default"]);
+
+ exports["default"] = ForceAtlas2BasedCentralGravitySolver;
+ module.exports = exports["default"];
+
+/***/ },
+/* 99 */
+/***/ 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 _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 _componentsNodesCluster = __webpack_require__(100);
+
+ var _componentsNodesCluster2 = _interopRequireDefault(_componentsNodesCluster);
+
+ var util = __webpack_require__(1);
+
+ var ClusterEngine = (function () {
+ function ClusterEngine(body) {
+ var _this = this;
+
+ _classCallCheck(this, ClusterEngine);
+
+ this.body = body;
+ this.clusteredNodes = {};
+
+ this.options = {};
+ this.defaultOptions = {};
+ util.extend(this.options, this.defaultOptions);
+
+ this.body.emitter.on('_resetData', function () {
+ _this.clusteredNodes = {};
+ });
+ }
+
+ _createClass(ClusterEngine, [{
+ key: 'setOptions',
+ value: function setOptions(options) {
+ if (options !== undefined) {}
+ }
+ }, {
+ key: 'clusterByHubsize',
+
+ /**
+ *
+ * @param hubsize
+ * @param options
+ */
+ value: function clusterByHubsize(hubsize, options) {
+ if (hubsize === undefined) {
+ hubsize = this._getHubSize();
+ } else if (typeof hubsize === 'object') {
+ options = this._checkOptions(hubsize);
+ hubsize = this._getHubSize();
+ }
+
+ var nodesToCluster = [];
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ var node = this.body.nodes[this.body.nodeIndices[i]];
+ if (node.edges.length >= hubsize) {
+ nodesToCluster.push(node.id);
+ }
+ }
+
+ for (var i = 0; i < nodesToCluster.length; i++) {
+ this.clusterByConnection(nodesToCluster[i], options, true);
+ }
+
+ this.body.emitter.emit('_dataChanged');
+ }
+ }, {
+ key: 'cluster',
+
+ /**
+ * loop over all nodes, check if they adhere to the condition and cluster if needed.
+ * @param options
+ * @param refreshData
+ */
+ value: function cluster() {
+ var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+ var refreshData = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ if (options.joinCondition === undefined) {
+ throw new Error('Cannot call clusterByNodeData without a joinCondition function in the options.');
+ }
+
+ // check if the options object is fine, append if needed
+ options = this._checkOptions(options);
+
+ var childNodesObj = {};
+ var childEdgesObj = {};
+
+ // collect the nodes that will be in the cluster
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ var nodeId = this.body.nodeIndices[i];
+ var node = this.body.nodes[nodeId];
+ var clonedOptions = this._cloneOptions(node);
+ if (options.joinCondition(clonedOptions) === true) {
+ childNodesObj[nodeId] = this.body.nodes[nodeId];
+
+ // collect the nodes that will be in the cluster
+ for (var _i = 0; _i < node.edges.length; _i++) {
+ var edge = node.edges[_i];
+ if (edge.hiddenByCluster !== true) {
+ childEdgesObj[edge.id] = edge;
+ }
+ }
+ }
+ }
+
+ this._cluster(childNodesObj, childEdgesObj, options, refreshData);
+ }
+ }, {
+ key: 'clusterByEdgeCount',
+
+ /**
+ * Cluster all nodes in the network that have only X edges
+ * @param edgeCount
+ * @param options
+ * @param refreshData
+ */
+ value: function clusterByEdgeCount(edgeCount, options) {
+ var refreshData = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];
+
+ options = this._checkOptions(options);
+ var clusters = [];
+ var usedNodes = {};
+ var edge = undefined,
+ edges = undefined,
+ node = undefined,
+ nodeId = undefined,
+ relevantEdgeCount = undefined;
+ // collect the nodes that will be in the cluster
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ var childNodesObj = {};
+ var childEdgesObj = {};
+ nodeId = this.body.nodeIndices[i];
+
+ // if this node is already used in another cluster this session, we do not have to re-evaluate it.
+ if (usedNodes[nodeId] === undefined) {
+ relevantEdgeCount = 0;
+ node = this.body.nodes[nodeId];
+ edges = [];
+ for (var j = 0; j < node.edges.length; j++) {
+ edge = node.edges[j];
+ if (edge.hiddenByCluster !== true) {
+ if (edge.toId !== edge.fromId) {
+ relevantEdgeCount++;
+ }
+ edges.push(edge);
+ }
+ }
+
+ // this node qualifies, we collect its neighbours to start the clustering process.
+ if (relevantEdgeCount === edgeCount) {
+ var gatheringSuccessful = true;
+ for (var j = 0; j < edges.length; j++) {
+ edge = edges[j];
+ var childNodeId = this._getConnectedId(edge, nodeId);
+ // add the nodes to the list by the join condition.
+ if (options.joinCondition === undefined) {
+ childEdgesObj[edge.id] = edge;
+ childNodesObj[nodeId] = this.body.nodes[nodeId];
+ childNodesObj[childNodeId] = this.body.nodes[childNodeId];
+ usedNodes[nodeId] = true;
+ } else {
+ var clonedOptions = this._cloneOptions(this.body.nodes[nodeId]);
+ if (options.joinCondition(clonedOptions) === true) {
+ childEdgesObj[edge.id] = edge;
+ childNodesObj[nodeId] = this.body.nodes[nodeId];
+ usedNodes[nodeId] = true;
+ } else {
+ // this node does not qualify after all.
+ gatheringSuccessful = false;
+ break;
+ }
+ }
+ }
+
+ // add to the cluster queue
+ if (Object.keys(childNodesObj).length > 0 && Object.keys(childEdgesObj).length > 0 && gatheringSuccessful === true) {
+ clusters.push({ nodes: childNodesObj, edges: childEdgesObj });
+ }
+ }
+ }
+ }
+
+ for (var i = 0; i < clusters.length; i++) {
+ this._cluster(clusters[i].nodes, clusters[i].edges, options, false);
+ }
+
+ if (refreshData === true) {
+ this.body.emitter.emit('_dataChanged');
+ }
+ }
+ }, {
+ key: 'clusterOutliers',
+
+ /**
+ * Cluster all nodes in the network that have only 1 edge
+ * @param options
+ * @param refreshData
+ */
+ value: function clusterOutliers(options) {
+ var refreshData = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ this.clusterByEdgeCount(1, options, refreshData);
+ }
+ }, {
+ key: 'clusterBridges',
+
+ /**
+ * Cluster all nodes in the network that have only 2 edge
+ * @param options
+ * @param refreshData
+ */
+ value: function clusterBridges(options) {
+ var refreshData = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ this.clusterByEdgeCount(2, options, refreshData);
+ }
+ }, {
+ key: 'clusterByConnection',
+
+ /**
+ * suck all connected nodes of a node into the node.
+ * @param nodeId
+ * @param options
+ * @param refreshData
+ */
+ value: function clusterByConnection(nodeId, options) {
+ var refreshData = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];
+
+ // kill conditions
+ if (nodeId === undefined) {
+ throw new Error('No nodeId supplied to clusterByConnection!');
+ }
+ if (this.body.nodes[nodeId] === undefined) {
+ throw new Error('The nodeId given to clusterByConnection does not exist!');
+ }
+
+ var node = this.body.nodes[nodeId];
+ options = this._checkOptions(options, node);
+ if (options.clusterNodeProperties.x === undefined) {
+ options.clusterNodeProperties.x = node.x;
+ }
+ if (options.clusterNodeProperties.y === undefined) {
+ options.clusterNodeProperties.y = node.y;
+ }
+ if (options.clusterNodeProperties.fixed === undefined) {
+ options.clusterNodeProperties.fixed = {};
+ options.clusterNodeProperties.fixed.x = node.options.fixed.x;
+ options.clusterNodeProperties.fixed.y = node.options.fixed.y;
+ }
+
+ var childNodesObj = {};
+ var childEdgesObj = {};
+ var parentNodeId = node.id;
+ var parentClonedOptions = this._cloneOptions(node);
+ childNodesObj[parentNodeId] = node;
+
+ // collect the nodes that will be in the cluster
+ for (var i = 0; i < node.edges.length; i++) {
+ var edge = node.edges[i];
+ if (edge.hiddenByCluster !== true) {
+ var childNodeId = this._getConnectedId(edge, parentNodeId);
+
+ // if the child node is not in a cluster (may not be needed now with the edge.hiddenByCluster check)
+ if (this.clusteredNodes[childNodeId] === undefined) {
+ if (childNodeId !== parentNodeId) {
+ if (options.joinCondition === undefined) {
+ childEdgesObj[edge.id] = edge;
+ childNodesObj[childNodeId] = this.body.nodes[childNodeId];
+ } else {
+ // clone the options and insert some additional parameters that could be interesting.
+ var childClonedOptions = this._cloneOptions(this.body.nodes[childNodeId]);
+ if (options.joinCondition(parentClonedOptions, childClonedOptions) === true) {
+ childEdgesObj[edge.id] = edge;
+ childNodesObj[childNodeId] = this.body.nodes[childNodeId];
+ }
+ }
+ } else {
+ // swallow the edge if it is self-referencing.
+ childEdgesObj[edge.id] = edge;
+ }
+ }
+ }
+ }
+
+ this._cluster(childNodesObj, childEdgesObj, options, refreshData);
+ }
+ }, {
+ key: '_cloneOptions',
+
+ /**
+ * This returns a clone of the options or options of the edge or node to be used for construction of new edges or check functions for new nodes.
+ * @param objId
+ * @param type
+ * @returns {{}}
+ * @private
+ */
+ value: function _cloneOptions(item, type) {
+ var clonedOptions = {};
+ if (type === undefined || type === 'node') {
+ util.deepExtend(clonedOptions, item.options, true);
+ clonedOptions.x = item.x;
+ clonedOptions.y = item.y;
+ clonedOptions.amountOfConnections = item.edges.length;
+ } else {
+ util.deepExtend(clonedOptions, item.options, true);
+ }
+ return clonedOptions;
+ }
+ }, {
+ key: '_createClusterEdges',
+
+ /**
+ * This function creates the edges that will be attached to the cluster
+ * It looks for edges that are connected to the nodes from the "outside' of the cluster.
+ *
+ * @param childNodesObj
+ * @param newEdges
+ * @param options
+ * @private
+ */
+ value: function _createClusterEdges(childNodesObj, childEdgesObj, clusterNodeProperties, clusterEdgeProperties) {
+ var edge = undefined,
+ childNodeId = undefined,
+ childNode = undefined,
+ toId = undefined,
+ fromId = undefined,
+ otherNodeId = undefined;
+
+ // loop over all child nodes and their edges to find edges going out of the cluster
+ // these edges will be replaced by clusterEdges.
+ var childKeys = Object.keys(childNodesObj);
+ var createEdges = [];
+ for (var i = 0; i < childKeys.length; i++) {
+ childNodeId = childKeys[i];
+ childNode = childNodesObj[childNodeId];
+
+ // construct new edges from the cluster to others
+ for (var j = 0; j < childNode.edges.length; j++) {
+ edge = childNode.edges[j];
+ // we only handle edges that are visible to the system, not the disabled ones from the clustering process.
+ if (edge.hiddenByCluster !== true) {
+ // self-referencing edges will be added to the "hidden" list
+ if (edge.toId == edge.fromId) {
+ childEdgesObj[edge.id] = edge;
+ } else {
+ // set up the from and to.
+ if (edge.toId == childNodeId) {
+ // this is a double equals because ints and strings can be interchanged here.
+ toId = clusterNodeProperties.id;
+ fromId = edge.fromId;
+ otherNodeId = fromId;
+ } else {
+ toId = edge.toId;
+ fromId = clusterNodeProperties.id;
+ otherNodeId = toId;
+ }
+ }
+
+ // Only edges from the cluster outwards are being replaced.
+ if (childNodesObj[otherNodeId] === undefined) {
+ createEdges.push({ edge: edge, fromId: fromId, toId: toId });
+ }
+ }
+ }
+ }
+
+ // here we actually create the replacement edges. We could not do this in the loop above as the creation process
+ // would add an edge to the edges array we are iterating over.
+ for (var j = 0; j < createEdges.length; j++) {
+ var _edge = createEdges[j].edge;
+ // copy the options of the edge we will replace
+ var clonedOptions = this._cloneOptions(_edge, 'edge');
+ // make sure the properties of clusterEdges are superimposed on it
+ util.deepExtend(clonedOptions, clusterEdgeProperties);
+
+ // set up the edge
+ clonedOptions.from = createEdges[j].fromId;
+ clonedOptions.to = createEdges[j].toId;
+ clonedOptions.id = 'clusterEdge:' + util.randomUUID();
+ //clonedOptions.id = '(cf: ' + createEdges[j].fromId + " to: " + createEdges[j].toId + ")" + Math.random();
+
+ // create the edge and give a reference to the one it replaced.
+ var newEdge = this.body.functions.createEdge(clonedOptions);
+ newEdge.clusteringEdgeReplacingId = _edge.id;
+
+ // connect the edge.
+ this.body.edges[newEdge.id] = newEdge;
+ newEdge.connect();
+
+ // hide the replaced edge
+ _edge.setOptions({ physics: false, hidden: true });
+ _edge.hiddenByCluster = true;
+ }
+ }
+ }, {
+ key: '_checkOptions',
+
+ /**
+ * This function checks the options that can be supplied to the different cluster functions
+ * for certain fields and inserts defaults if needed
+ * @param options
+ * @returns {*}
+ * @private
+ */
+ value: function _checkOptions() {
+ var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
+ if (options.clusterEdgeProperties === undefined) {
+ options.clusterEdgeProperties = {};
+ }
+ if (options.clusterNodeProperties === undefined) {
+ options.clusterNodeProperties = {};
+ }
+
+ return options;
+ }
+ }, {
+ key: '_cluster',
+
+ /**
+ *
+ * @param {Object} childNodesObj | object with node objects, id as keys, same as childNodes except it also contains a source node
+ * @param {Object} childEdgesObj | object with edge objects, id as keys
+ * @param {Array} options | object with {clusterNodeProperties, clusterEdgeProperties, processProperties}
+ * @param {Boolean} refreshData | when true, do not wrap up
+ * @private
+ */
+ value: function _cluster(childNodesObj, childEdgesObj, options) {
+ var refreshData = arguments.length <= 3 || arguments[3] === undefined ? true : arguments[3];
+
+ // kill condition: no children so can't cluster or only one node in the cluster, dont bother
+ if (Object.keys(childNodesObj).length < 2) {
+ return;
+ }
+
+ // check if this cluster call is not trying to cluster anything that is in another cluster.
+ for (var nodeId in childNodesObj) {
+ if (childNodesObj.hasOwnProperty(nodeId)) {
+ if (this.clusteredNodes[nodeId] !== undefined) {
+ return;
+ }
+ }
+ }
+
+ var clusterNodeProperties = util.deepExtend({}, options.clusterNodeProperties);
+
+ // construct the clusterNodeProperties
+ if (options.processProperties !== undefined) {
+ // get the childNode options
+ var childNodesOptions = [];
+ for (var nodeId in childNodesObj) {
+ if (childNodesObj.hasOwnProperty(nodeId)) {
+ var clonedOptions = this._cloneOptions(childNodesObj[nodeId]);
+ childNodesOptions.push(clonedOptions);
+ }
+ }
+
+ // get clusterproperties based on childNodes
+ var childEdgesOptions = [];
+ for (var edgeId in childEdgesObj) {
+ if (childEdgesObj.hasOwnProperty(edgeId)) {
+ // these cluster edges will be removed on creation of the cluster.
+ if (edgeId.substr(0, 12) !== 'clusterEdge:') {
+ var clonedOptions = this._cloneOptions(childEdgesObj[edgeId], 'edge');
+ childEdgesOptions.push(clonedOptions);
+ }
+ }
+ }
+
+ clusterNodeProperties = options.processProperties(clusterNodeProperties, childNodesOptions, childEdgesOptions);
+ if (!clusterNodeProperties) {
+ throw new Error('The processProperties function does not return properties!');
+ }
+ }
+
+ // check if we have an unique id;
+ if (clusterNodeProperties.id === undefined) {
+ clusterNodeProperties.id = 'cluster:' + util.randomUUID();
+ }
+ var clusterId = clusterNodeProperties.id;
+
+ if (clusterNodeProperties.label === undefined) {
+ clusterNodeProperties.label = 'cluster';
+ }
+
+ // give the clusterNode a postion if it does not have one.
+ var pos = undefined;
+ if (clusterNodeProperties.x === undefined) {
+ pos = this._getClusterPosition(childNodesObj);
+ clusterNodeProperties.x = pos.x;
+ }
+ if (clusterNodeProperties.y === undefined) {
+ if (pos === undefined) {
+ pos = this._getClusterPosition(childNodesObj);
+ }
+ clusterNodeProperties.y = pos.y;
+ }
+
+ // force the ID to remain the same
+ clusterNodeProperties.id = clusterId;
+
+ // create the clusterNode
+ var clusterNode = this.body.functions.createNode(clusterNodeProperties, _componentsNodesCluster2['default']);
+ clusterNode.isCluster = true;
+ clusterNode.containedNodes = childNodesObj;
+ clusterNode.containedEdges = childEdgesObj;
+ // cache a copy from the cluster edge properties if we have to reconnect others later on
+ clusterNode.clusterEdgeProperties = options.clusterEdgeProperties;
+
+ // finally put the cluster node into global
+ this.body.nodes[clusterNodeProperties.id] = clusterNode;
+
+ // create the new edges that will connect to the cluster, all self-referencing edges will be added to childEdgesObject here.
+ this._createClusterEdges(childNodesObj, childEdgesObj, clusterNodeProperties, options.clusterEdgeProperties);
+
+ // disable the childEdges
+ for (var edgeId in childEdgesObj) {
+ if (childEdgesObj.hasOwnProperty(edgeId)) {
+ if (this.body.edges[edgeId] !== undefined) {
+ var edge = this.body.edges[edgeId];
+ edge.setOptions({ physics: false, hidden: true });
+ edge.hiddenByCluster = true;
+ }
+ }
+ }
+
+ // disable the childNodes
+ for (var nodeId in childNodesObj) {
+ if (childNodesObj.hasOwnProperty(nodeId)) {
+ this.clusteredNodes[nodeId] = { clusterId: clusterNodeProperties.id, node: this.body.nodes[nodeId] };
+ this.body.nodes[nodeId].setOptions({ hidden: true, physics: false });
+ }
+ }
+
+ // set ID to undefined so no duplicates arise
+ clusterNodeProperties.id = undefined;
+
+ // wrap up
+ if (refreshData === true) {
+ this.body.emitter.emit('_dataChanged');
+ }
+ }
+ }, {
+ key: 'isCluster',
+
+ /**
+ * Check if a node is a cluster.
+ * @param nodeId
+ * @returns {*}
+ */
+ value: function isCluster(nodeId) {
+ if (this.body.nodes[nodeId] !== undefined) {
+ return this.body.nodes[nodeId].isCluster === true;
+ } else {
+ console.log('Node does not exist.');
+ return false;
+ }
+ }
+ }, {
+ key: '_getClusterPosition',
+
+ /**
+ * get the position of the cluster node based on what's inside
+ * @param {object} childNodesObj | object with node objects, id as keys
+ * @returns {{x: number, y: number}}
+ * @private
+ */
+ value: function _getClusterPosition(childNodesObj) {
+ var childKeys = Object.keys(childNodesObj);
+ var minX = childNodesObj[childKeys[0]].x;
+ var maxX = childNodesObj[childKeys[0]].x;
+ var minY = childNodesObj[childKeys[0]].y;
+ var maxY = childNodesObj[childKeys[0]].y;
+ var node = undefined;
+ for (var i = 1; i < childKeys.length; i++) {
+ node = childNodesObj[childKeys[i]];
+ minX = node.x < minX ? node.x : minX;
+ maxX = node.x > maxX ? node.x : maxX;
+ minY = node.y < minY ? node.y : minY;
+ maxY = node.y > maxY ? node.y : maxY;
+ }
+
+ return { x: 0.5 * (minX + maxX), y: 0.5 * (minY + maxY) };
+ }
+ }, {
+ key: 'openCluster',
+
+ /**
+ * Open a cluster by calling this function.
+ * @param {String} clusterNodeId | the ID of the cluster node
+ * @param {Boolean} refreshData | wrap up afterwards if not true
+ */
+ value: function openCluster(clusterNodeId, options) {
+ var refreshData = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];
+
+ // kill conditions
+ if (clusterNodeId === undefined) {
+ throw new Error('No clusterNodeId supplied to openCluster.');
+ }
+ if (this.body.nodes[clusterNodeId] === undefined) {
+ throw new Error('The clusterNodeId supplied to openCluster does not exist.');
+ }
+ if (this.body.nodes[clusterNodeId].containedNodes === undefined) {
+ console.log('The node:' + clusterNodeId + ' is not a cluster.');
+ return;
+ }
+ var clusterNode = this.body.nodes[clusterNodeId];
+ var containedNodes = clusterNode.containedNodes;
+ var containedEdges = clusterNode.containedEdges;
+
+ // allow the user to position the nodes after release.
+ if (options !== undefined && options.releaseFunction !== undefined && typeof options.releaseFunction === 'function') {
+ var positions = {};
+ var clusterPosition = { x: clusterNode.x, y: clusterNode.y };
+ for (var nodeId in containedNodes) {
+ if (containedNodes.hasOwnProperty(nodeId)) {
+ var containedNode = this.body.nodes[nodeId];
+ positions[nodeId] = { x: containedNode.x, y: containedNode.y };
+ }
+ }
+ var newPositions = options.releaseFunction(clusterPosition, positions);
+
+ for (var nodeId in containedNodes) {
+ if (containedNodes.hasOwnProperty(nodeId)) {
+ var containedNode = this.body.nodes[nodeId];
+ if (newPositions[nodeId] !== undefined) {
+ containedNode.x = newPositions[nodeId].x === undefined ? clusterNode.x : newPositions[nodeId].x;
+ containedNode.y = newPositions[nodeId].y === undefined ? clusterNode.y : newPositions[nodeId].y;
+ }
+ }
+ }
+ } else {
+ // copy the position from the cluster
+ for (var nodeId in containedNodes) {
+ if (containedNodes.hasOwnProperty(nodeId)) {
+ var containedNode = this.body.nodes[nodeId];
+ containedNode = containedNodes[nodeId];
+ // inherit position
+ containedNode.x = clusterNode.x;
+ containedNode.y = clusterNode.y;
+ }
+ }
+ }
+
+ // release nodes
+ for (var nodeId in containedNodes) {
+ if (containedNodes.hasOwnProperty(nodeId)) {
+ var containedNode = this.body.nodes[nodeId];
+
+ // inherit speed
+ containedNode.vx = clusterNode.vx;
+ containedNode.vy = clusterNode.vy;
+
+ // we use these methods to avoid reinstantiating the shape, which happens with setOptions.
+ containedNode.setOptions({ hidden: false, physics: true });
+
+ delete this.clusteredNodes[nodeId];
+ }
+ }
+
+ // copy the clusterNode edges because we cannot iterate over an object that we add or remove from.
+ var edgesToBeDeleted = [];
+ for (var i = 0; i < clusterNode.edges.length; i++) {
+ edgesToBeDeleted.push(clusterNode.edges[i]);
+ }
+
+ // actually handling the deleting.
+ for (var i = 0; i < edgesToBeDeleted.length; i++) {
+ var edge = edgesToBeDeleted[i];
+
+ var otherNodeId = this._getConnectedId(edge, clusterNodeId);
+ // if the other node is in another cluster, we transfer ownership of this edge to the other cluster
+ if (this.clusteredNodes[otherNodeId] !== undefined) {
+ // transfer ownership:
+ var otherCluster = this.body.nodes[this.clusteredNodes[otherNodeId].clusterId];
+ var transferEdge = this.body.edges[edge.clusteringEdgeReplacingId];
+ if (transferEdge !== undefined) {
+ otherCluster.containedEdges[transferEdge.id] = transferEdge;
+
+ // delete local reference
+ delete containedEdges[transferEdge.id];
+
+ // create new cluster edge from the otherCluster:
+ // get to and from
+ var fromId = transferEdge.fromId;
+ var toId = transferEdge.toId;
+ if (transferEdge.toId == otherNodeId) {
+ toId = this.clusteredNodes[otherNodeId].clusterId;
+ } else {
+ fromId = this.clusteredNodes[otherNodeId].clusterId;
+ }
+
+ // clone the options and apply the cluster options to them
+ var clonedOptions = this._cloneOptions(transferEdge, 'edge');
+ util.deepExtend(clonedOptions, otherCluster.clusterEdgeProperties);
+
+ // apply the edge specific options to it.
+ var id = 'clusterEdge:' + util.randomUUID();
+ util.deepExtend(clonedOptions, { from: fromId, to: toId, hidden: false, physics: true, id: id });
+
+ // create it
+ var newEdge = this.body.functions.createEdge(clonedOptions);
+ newEdge.clusteringEdgeReplacingId = transferEdge.id;
+ this.body.edges[id] = newEdge;
+ this.body.edges[id].connect();
+ }
+ } else {
+ var replacedEdge = this.body.edges[edge.clusteringEdgeReplacingId];
+ if (replacedEdge !== undefined) {
+ replacedEdge.setOptions({ physics: true, hidden: false });
+ replacedEdge.hiddenByCluster = false;
+ }
+ }
+ edge.cleanup();
+ // this removes the edge from node.edges, which is why edgeIds is formed
+ edge.disconnect();
+ delete this.body.edges[edge.id];
+ }
+
+ // handle the releasing of the edges
+ for (var edgeId in containedEdges) {
+ if (containedEdges.hasOwnProperty(edgeId)) {
+ var edge = containedEdges[edgeId];
+ edge.setOptions({ physics: true, hidden: false });
+ edge.hiddenByCluster = undefined;
+ delete edge.hiddenByCluster;
+ }
+ }
+
+ // remove clusterNode
+ delete this.body.nodes[clusterNodeId];
+
+ if (refreshData === true) {
+ this.body.emitter.emit('_dataChanged');
+ }
+ }
+ }, {
+ key: 'getNodesInCluster',
+ value: function getNodesInCluster(clusterId) {
+ var nodesArray = [];
+ if (this.isCluster(clusterId) === true) {
+ var containedNodes = this.body.nodes[clusterId].containedNodes;
+ for (var nodeId in containedNodes) {
+ if (containedNodes.hasOwnProperty(nodeId)) {
+ nodesArray.push(nodeId);
+ }
+ }
+ }
+
+ return nodesArray;
+ }
+ }, {
+ key: 'findNode',
+
+ /**
+ * Get the stack clusterId's that a certain node resides in. cluster A -> cluster B -> cluster C -> node
+ * @param nodeId
+ * @returns {Array}
+ * @private
+ */
+ value: function findNode(nodeId) {
+ var stack = [];
+ var max = 100;
+ var counter = 0;
+
+ while (this.clusteredNodes[nodeId] !== undefined && counter < max) {
+ stack.push(this.clusteredNodes[nodeId].node);
+ nodeId = this.clusteredNodes[nodeId].clusterId;
+ counter++;
+ }
+ stack.push(this.body.nodes[nodeId]);
+ return stack;
+ }
+ }, {
+ key: '_getConnectedId',
+
+ /**
+ * Get the Id the node is connected to
+ * @param edge
+ * @param nodeId
+ * @returns {*}
+ * @private
+ */
+ value: function _getConnectedId(edge, nodeId) {
+ if (edge.toId != nodeId) {
+ return edge.toId;
+ } else if (edge.fromId != nodeId) {
+ return edge.fromId;
+ } else {
+ return edge.fromId;
+ }
+ }
+ }, {
+ key: '_getHubSize',
+
+ /**
+ * We determine how many connections denote an important hub.
+ * We take the mean + 2*std as the important hub size. (Assuming a normal distribution of data, ~2.2%)
+ *
+ * @private
+ */
+ value: function _getHubSize() {
+ var average = 0;
+ var averageSquared = 0;
+ var hubCounter = 0;
+ var largestHub = 0;
+
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ var node = this.body.nodes[this.body.nodeIndices[i]];
+ if (node.edges.length > largestHub) {
+ largestHub = node.edges.length;
+ }
+ average += node.edges.length;
+ averageSquared += Math.pow(node.edges.length, 2);
+ hubCounter += 1;
+ }
+ average = average / hubCounter;
+ averageSquared = averageSquared / hubCounter;
+
+ var variance = averageSquared - Math.pow(average, 2);
+ var standardDeviation = Math.sqrt(variance);
+
+ var hubThreshold = Math.floor(average + 2 * standardDeviation);
+
+ // always have at least one to cluster
+ if (hubThreshold > largestHub) {
+ hubThreshold = largestHub;
+ }
+
+ return hubThreshold;
+ }
+ }]);
+
+ return ClusterEngine;
+ })();
+
+ exports['default'] = ClusterEngine;
+ module.exports = exports['default'];
+
+/***/ },
+/* 100 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, '__esModule', {
+ value: true
+ });
+
+ var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; 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 { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+ 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) subClass.__proto__ = superClass; }
+
+ var _Node2 = __webpack_require__(62);
+
+ var _Node3 = _interopRequireDefault(_Node2);
+
+ /**
+ *
+ */
+
+ var Cluster = (function (_Node) {
+ _inherits(Cluster, _Node);
+
+ function Cluster(options, body, imagelist, grouplist, globalOptions) {
+ _classCallCheck(this, Cluster);
+
+ _get(Object.getPrototypeOf(Cluster.prototype), 'constructor', this).call(this, options, body, imagelist, grouplist, globalOptions);
+
+ this.isCluster = true;
+ this.containedNodes = {};
+ this.containedEdges = {};
+ }
+
+ return Cluster;
+ })(_Node3['default']);
+
+ exports['default'] = Cluster;
+ module.exports = exports['default'];
+
+/***/ },
+/* 101 */
+/***/ 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'); } }
+
+ if (typeof window !== 'undefined') {
+ window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
+ }
+
+ var util = __webpack_require__(1);
+
+ var CanvasRenderer = (function () {
+ function CanvasRenderer(body, canvas) {
+ _classCallCheck(this, CanvasRenderer);
+
+ this.body = body;
+ this.canvas = canvas;
+
+ this.redrawRequested = false;
+ this.renderTimer = undefined;
+ this.requiresTimeout = true;
+ this.renderingActive = false;
+ this.renderRequests = 0;
+ this.pixelRatio = undefined;
+ this.allowRedraw = true;
+
+ this.dragging = false;
+ this.options = {};
+ this.defaultOptions = {
+ hideEdgesOnDrag: false,
+ hideNodesOnDrag: false
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ this._determineBrowserMethod();
+ this.bindEventListeners();
+ }
+
+ _createClass(CanvasRenderer, [{
+ key: 'bindEventListeners',
+ value: function bindEventListeners() {
+ var _this = this;
+
+ this.body.emitter.on('dragStart', function () {
+ _this.dragging = true;
+ });
+ this.body.emitter.on('dragEnd', function () {
+ return _this.dragging = false;
+ });
+ this.body.emitter.on('_resizeNodes', function () {
+ return _this._resizeNodes();
+ });
+ this.body.emitter.on('_redraw', function () {
+ if (_this.renderingActive === false) {
+ _this._redraw();
+ }
+ });
+ this.body.emitter.on('_blockRedraw', function () {
+ _this.allowRedraw = false;
+ });
+ this.body.emitter.on('_allowRedraw', function () {
+ _this.allowRedraw = true;_this.redrawRequested = false;
+ });
+ this.body.emitter.on('_requestRedraw', this._requestRedraw.bind(this));
+ this.body.emitter.on('_startRendering', function () {
+ _this.renderRequests += 1;
+ _this.renderingActive = true;
+ _this._startRendering();
+ });
+ this.body.emitter.on('_stopRendering', function () {
+ _this.renderRequests -= 1;
+ _this.renderingActive = _this.renderRequests > 0;
+ _this.renderTimer = undefined;
+ });
+ this.body.emitter.on('destroy', function () {
+ _this.renderRequests = 0;
+ _this.allowRedraw = false;
+ _this.renderingActive = false;
+ if (_this.requiresTimeout === true) {
+ clearTimeout(_this.renderTimer);
+ } else {
+ cancelAnimationFrame(_this.renderTimer);
+ }
+ _this.body.emitter.off();
+ });
+ }
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options) {
+ if (options !== undefined) {
+ var fields = ['hideEdgesOnDrag', 'hideNodesOnDrag'];
+ util.selectiveDeepExtend(fields, this.options, options);
+ }
+ }
+ }, {
+ key: '_startRendering',
+ value: function _startRendering() {
+ if (this.renderingActive === true) {
+ if (this.renderTimer === undefined) {
+ if (this.requiresTimeout === true) {
+ this.renderTimer = window.setTimeout(this._renderStep.bind(this), this.simulationInterval); // wait this.renderTimeStep milliseconds and perform the animation step function
+ } else {
+ this.renderTimer = window.requestAnimationFrame(this._renderStep.bind(this)); // wait this.renderTimeStep milliseconds and perform the animation step function
+ }
+ }
+ }
+ }
+ }, {
+ key: '_renderStep',
+ value: function _renderStep() {
+ if (this.renderingActive === true) {
+ // reset the renderTimer so a new scheduled animation step can be set
+ this.renderTimer = undefined;
+
+ if (this.requiresTimeout === true) {
+ // this schedules a new simulation step
+ this._startRendering();
+ }
+
+ this._redraw();
+
+ if (this.requiresTimeout === false) {
+ // this schedules a new simulation step
+ this._startRendering();
+ }
+ }
+ }
+ }, {
+ key: 'redraw',
+
+ /**
+ * Redraw the network with the current data
+ * chart will be resized too.
+ */
+ value: function redraw() {
+ this.body.emitter.emit('setSize');
+ this._redraw();
+ }
+ }, {
+ key: '_requestRedraw',
+
+ /**
+ * Redraw the network with the current data
+ * @param hidden | used to get the first estimate of the node sizes. only the nodes are drawn after which they are quickly drawn over.
+ * @private
+ */
+ value: function _requestRedraw() {
+ var _this2 = this;
+
+ if (this.redrawRequested !== true && this.renderingActive === false && this.allowRedraw === true) {
+ this.redrawRequested = true;
+ if (this.requiresTimeout === true) {
+ window.setTimeout(function () {
+ _this2._redraw(false);
+ }, 0);
+ } else {
+ window.requestAnimationFrame(function () {
+ _this2._redraw(false);
+ });
+ }
+ }
+ }
+ }, {
+ key: '_redraw',
+ value: function _redraw() {
+ var hidden = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];
+
+ if (this.allowRedraw === true) {
+ this.body.emitter.emit('initRedraw');
+
+ this.redrawRequested = false;
+ var ctx = this.canvas.frame.canvas.getContext('2d');
+
+ // when the container div was hidden, this fixes it back up!
+ if (this.canvas.frame.canvas.width === 0 || this.canvas.frame.canvas.height === 0) {
+ this.canvas.setSize();
+ }
+
+ this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
+
+ ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
+
+ // clear the canvas
+ var w = this.canvas.frame.canvas.clientWidth;
+ var h = this.canvas.frame.canvas.clientHeight;
+ ctx.clearRect(0, 0, w, h);
+
+ // if the div is hidden, we stop the redraw here for performance.
+ if (this.canvas.frame.clientWidth === 0) {
+ return;
+ }
+
+ // set scaling and translation
+ ctx.save();
+ ctx.translate(this.body.view.translation.x, this.body.view.translation.y);
+ ctx.scale(this.body.view.scale, this.body.view.scale);
+
+ ctx.beginPath();
+ this.body.emitter.emit('beforeDrawing', ctx);
+ ctx.closePath();
+
+ if (hidden === false) {
+ if (this.dragging === false || this.dragging === true && this.options.hideEdgesOnDrag === false) {
+ this._drawEdges(ctx);
+ }
+ }
+
+ if (this.dragging === false || this.dragging === true && this.options.hideNodesOnDrag === false) {
+ this._drawNodes(ctx, hidden);
+ }
+
+ if (this.controlNodesActive === true) {
+ this._drawControlNodes(ctx);
+ }
+
+ ctx.beginPath();
+ //this.physics.nodesSolver._debug(ctx,"#F00F0F");
+ this.body.emitter.emit('afterDrawing', ctx);
+ ctx.closePath();
+ // restore original scaling and translation
+ ctx.restore();
+
+ if (hidden === true) {
+ ctx.clearRect(0, 0, w, h);
+ }
+ }
+ }
+ }, {
+ key: '_resizeNodes',
+
+ /**
+ * Redraw all nodes
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');
+ * @param {CanvasRenderingContext2D} ctx
+ * @param {Boolean} [alwaysShow]
+ * @private
+ */
+ value: function _resizeNodes() {
+ var ctx = this.canvas.frame.canvas.getContext('2d');
+ if (this.pixelRatio === undefined) {
+ this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
+ }
+ ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
+ ctx.save();
+ ctx.translate(this.body.view.translation.x, this.body.view.translation.y);
+ ctx.scale(this.body.view.scale, this.body.view.scale);
+
+ var nodes = this.body.nodes;
+ var node = undefined;
+
+ // resize all nodes
+ for (var nodeId in nodes) {
+ if (nodes.hasOwnProperty(nodeId)) {
+ node = nodes[nodeId];
+ node.resize(ctx);
+ node.updateBoundingBox(ctx, node.selected);
+ }
+ }
+
+ // restore original scaling and translation
+ ctx.restore();
+ }
+ }, {
+ key: '_drawNodes',
+
+ /**
+ * Redraw all nodes
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');
+ * @param {CanvasRenderingContext2D} ctx
+ * @param {Boolean} [alwaysShow]
+ * @private
+ */
+ value: function _drawNodes(ctx) {
+ var alwaysShow = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ var nodes = this.body.nodes;
+ var nodeIndices = this.body.nodeIndices;
+ var node = undefined;
+ var selected = [];
+ var margin = 20;
+ var topLeft = this.canvas.DOMtoCanvas({ x: -margin, y: -margin });
+ var bottomRight = this.canvas.DOMtoCanvas({
+ x: this.canvas.frame.canvas.clientWidth + margin,
+ y: this.canvas.frame.canvas.clientHeight + margin
+ });
+ var viewableArea = { top: topLeft.y, left: topLeft.x, bottom: bottomRight.y, right: bottomRight.x };
+
+ // draw unselected nodes;
+ for (var i = 0; i < nodeIndices.length; i++) {
+ node = nodes[nodeIndices[i]];
+ // set selected nodes aside
+ if (node.isSelected()) {
+ selected.push(nodeIndices[i]);
+ } else {
+ if (alwaysShow === true) {
+ node.draw(ctx);
+ } else if (node.isBoundingBoxOverlappingWith(viewableArea) === true) {
+ node.draw(ctx);
+ } else {
+ node.updateBoundingBox(ctx, node.selected);
+ }
+ }
+ }
+
+ // draw the selected nodes on top
+ for (var i = 0; i < selected.length; i++) {
+ node = nodes[selected[i]];
+ node.draw(ctx);
+ }
+ }
+ }, {
+ key: '_drawEdges',
+
+ /**
+ * Redraw all edges
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+ value: function _drawEdges(ctx) {
+ var edges = this.body.edges;
+ var edgeIndices = this.body.edgeIndices;
+ var edge = undefined;
+
+ for (var i = 0; i < edgeIndices.length; i++) {
+ edge = edges[edgeIndices[i]];
+ if (edge.connected === true) {
+ edge.draw(ctx);
+ }
+ }
+ }
+ }, {
+ key: '_drawControlNodes',
+
+ /**
+ * Redraw all edges
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+ value: function _drawControlNodes(ctx) {
+ var edges = this.body.edges;
+ var edgeIndices = this.body.edgeIndices;
+ var edge = undefined;
+
+ for (var i = 0; i < edgeIndices.length; i++) {
+ edge = edges[edgeIndices[i]];
+ edge._drawControlNodes(ctx);
+ }
+ }
+ }, {
+ key: '_determineBrowserMethod',
+
+ /**
+ * Determine if the browser requires a setTimeout or a requestAnimationFrame. This was required because
+ * some implementations (safari and IE9) did not support requestAnimationFrame
+ * @private
+ */
+ value: function _determineBrowserMethod() {
+ if (typeof window !== 'undefined') {
+ var browserType = navigator.userAgent.toLowerCase();
+ this.requiresTimeout = false;
+ if (browserType.indexOf('msie 9.0') != -1) {
+ // IE 9
+ this.requiresTimeout = true;
+ } else if (browserType.indexOf('safari') != -1) {
+ // safari
+ if (browserType.indexOf('chrome') <= -1) {
+ this.requiresTimeout = true;
+ }
+ }
+ } else {
+ this.requiresTimeout = true;
+ }
+ }
+ }]);
+
+ return CanvasRenderer;
+ })();
+
+ exports['default'] = CanvasRenderer;
+ module.exports = exports['default'];
+
+/***/ },
+/* 102 */
+/***/ 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 Hammer = __webpack_require__(20);
+ var hammerUtil = __webpack_require__(25);
+
+ var util = __webpack_require__(1);
+
+ /**
+ * Create the main frame for the Network.
+ * This function is executed once when a Network object is created. The frame
+ * contains a canvas, and this canvas contains all objects like the axis and
+ * nodes.
+ * @private
+ */
+
+ var Canvas = (function () {
+ function Canvas(body) {
+ _classCallCheck(this, Canvas);
+
+ this.body = body;
+ this.pixelRatio = 1;
+ this.resizeTimer = undefined;
+ this.resizeFunction = this._onResize.bind(this);
+ this.cameraState = {};
+
+ this.options = {};
+ this.defaultOptions = {
+ autoResize: true,
+ height: '100%',
+ width: '100%'
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ this.bindEventListeners();
+ }
+
+ _createClass(Canvas, [{
+ key: 'bindEventListeners',
+ value: function bindEventListeners() {
+ var _this = this;
+
+ // bind the events
+ this.body.emitter.once('resize', function (obj) {
+ if (obj.width !== 0) {
+ _this.body.view.translation.x = obj.width * 0.5;
+ }
+ if (obj.height !== 0) {
+ _this.body.view.translation.y = obj.height * 0.5;
+ }
+ });
+ this.body.emitter.on('setSize', this.setSize.bind(this));
+ this.body.emitter.on('destroy', function () {
+ _this.hammerFrame.destroy();
+ _this.hammer.destroy();
+ _this._cleanUp();
+ });
+ }
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options) {
+ var _this2 = this;
+
+ if (options !== undefined) {
+ var fields = ['width', 'height', 'autoResize'];
+ util.selectiveDeepExtend(fields, this.options, options);
+ }
+
+ if (this.options.autoResize === true) {
+ // automatically adapt to a changing size of the browser.
+ this._cleanUp();
+ this.resizeTimer = setInterval(function () {
+ var changed = _this2.setSize();
+ if (changed === true) {
+ _this2.body.emitter.emit('_requestRedraw');
+ }
+ }, 1000);
+ this.resizeFunction = this._onResize.bind(this);
+ util.addEventListener(window, 'resize', this.resizeFunction);
+ }
+ }
+ }, {
+ key: '_cleanUp',
+ value: function _cleanUp() {
+ // automatically adapt to a changing size of the browser.
+ if (this.resizeTimer !== undefined) {
+ clearInterval(this.resizeTimer);
+ }
+ util.removeEventListener(window, 'resize', this.resizeFunction);
+ this.resizeFunction = undefined;
+ }
+ }, {
+ key: '_onResize',
+ value: function _onResize() {
+ this.setSize();
+ this.body.emitter.emit('_redraw');
+ }
+ }, {
+ key: '_getCameraState',
+
+ /**
+ * Get and store the cameraState
+ * @private
+ */
+ value: function _getCameraState() {
+ var pixelRatio = arguments.length <= 0 || arguments[0] === undefined ? this.pixelRatio : arguments[0];
+
+ this.cameraState.previousWidth = this.frame.canvas.width / pixelRatio;
+ this.cameraState.previousHeight = this.frame.canvas.height / pixelRatio;
+ this.cameraState.scale = this.body.view.scale;
+ this.cameraState.position = this.DOMtoCanvas({ x: 0.5 * this.frame.canvas.width / pixelRatio, y: 0.5 * this.frame.canvas.height / pixelRatio });
+ }
+ }, {
+ key: '_setCameraState',
+
+ /**
+ * Set the cameraState
+ * @private
+ */
+ value: function _setCameraState() {
+ if (this.cameraState.scale !== undefined && this.frame.canvas.clientWidth !== 0 && this.frame.canvas.clientHeight !== 0 && this.pixelRatio !== 0 && this.cameraState.previousWidth > 0) {
+
+ this.body.view.scale = this.cameraState.scale * Math.min(this.frame.canvas.width / this.pixelRatio / this.cameraState.previousWidth, this.frame.canvas.height / this.pixelRatio / this.cameraState.previousHeight);
+
+ // this comes from the view module.
+ var currentViewCenter = this.DOMtoCanvas({
+ x: 0.5 * this.frame.canvas.clientWidth,
+ y: 0.5 * this.frame.canvas.clientHeight
+ });
+
+ var distanceFromCenter = { // offset from view, distance view has to change by these x and y to center the node
+ x: currentViewCenter.x - this.cameraState.position.x,
+ y: currentViewCenter.y - this.cameraState.position.y
+ };
+ this.body.view.translation.x += distanceFromCenter.x * this.body.view.scale;
+ this.body.view.translation.y += distanceFromCenter.y * this.body.view.scale;
+ }
+ }
+ }, {
+ key: '_prepareValue',
+ value: function _prepareValue(value) {
+ if (typeof value === 'number') {
+ return value + 'px';
+ } else if (typeof value === 'string') {
+ if (value.indexOf('%') !== -1 || value.indexOf('px') !== -1) {
+ return value;
+ } else if (value.indexOf('%') === -1) {
+ return value + 'px';
+ }
+ }
+ throw new Error('Could not use the value supplied for width or height:' + value);
+ }
+ }, {
+ key: '_create',
+
+ /**
+ * Create the HTML
+ */
+ value: function _create() {
+ // remove all elements from the container element.
+ while (this.body.container.hasChildNodes()) {
+ this.body.container.removeChild(this.body.container.firstChild);
+ }
+
+ this.frame = document.createElement('div');
+ this.frame.className = 'vis-network';
+ this.frame.style.position = 'relative';
+ this.frame.style.overflow = 'hidden';
+ this.frame.tabIndex = 900; // tab index is required for keycharm to bind keystrokes to the div instead of the window
+
+ //////////////////////////////////////////////////////////////////
+
+ this.frame.canvas = document.createElement('canvas');
+ this.frame.canvas.style.position = 'relative';
+ this.frame.appendChild(this.frame.canvas);
+
+ if (!this.frame.canvas.getContext) {
+ var noCanvas = document.createElement('DIV');
+ noCanvas.style.color = 'red';
+ noCanvas.style.fontWeight = 'bold';
+ noCanvas.style.padding = '10px';
+ noCanvas.innerHTML = 'Error: your browser does not support HTML canvas';
+ this.frame.canvas.appendChild(noCanvas);
+ } else {
+ var ctx = this.frame.canvas.getContext('2d');
+ this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
+
+ this.frame.canvas.getContext('2d').setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
+ }
+
+ // add the frame to the container element
+ this.body.container.appendChild(this.frame);
+
+ this.body.view.scale = 1;
+ this.body.view.translation = { x: 0.5 * this.frame.canvas.clientWidth, y: 0.5 * this.frame.canvas.clientHeight };
+
+ this._bindHammer();
+ }
+ }, {
+ key: '_bindHammer',
+
+ /**
+ * This function binds hammer, it can be repeated over and over due to the uniqueness check.
+ * @private
+ */
+ value: function _bindHammer() {
+ var _this3 = this;
+
+ if (this.hammer !== undefined) {
+ this.hammer.destroy();
+ }
+ this.drag = {};
+ this.pinch = {};
+
+ // init hammer
+ this.hammer = new Hammer(this.frame.canvas);
+ this.hammer.get('pinch').set({ enable: true });
+ // enable to get better response, todo: test on mobile.
+ this.hammer.get('pan').set({ threshold: 5, direction: 30 }); // 30 is ALL_DIRECTIONS in hammer.
+
+ hammerUtil.onTouch(this.hammer, function (event) {
+ _this3.body.eventListeners.onTouch(event);
+ });
+ this.hammer.on('tap', function (event) {
+ _this3.body.eventListeners.onTap(event);
+ });
+ this.hammer.on('doubletap', function (event) {
+ _this3.body.eventListeners.onDoubleTap(event);
+ });
+ this.hammer.on('press', function (event) {
+ _this3.body.eventListeners.onHold(event);
+ });
+ this.hammer.on('panstart', function (event) {
+ _this3.body.eventListeners.onDragStart(event);
+ });
+ this.hammer.on('panmove', function (event) {
+ _this3.body.eventListeners.onDrag(event);
+ });
+ this.hammer.on('panend', function (event) {
+ _this3.body.eventListeners.onDragEnd(event);
+ });
+ this.hammer.on('pinch', function (event) {
+ _this3.body.eventListeners.onPinch(event);
+ });
+
+ // TODO: neatly cleanup these handlers when re-creating the Canvas, IF these are done with hammer, event.stopPropagation will not work?
+ this.frame.canvas.addEventListener('mousewheel', function (event) {
+ _this3.body.eventListeners.onMouseWheel(event);
+ });
+ this.frame.canvas.addEventListener('DOMMouseScroll', function (event) {
+ _this3.body.eventListeners.onMouseWheel(event);
+ });
+
+ this.frame.canvas.addEventListener('mousemove', function (event) {
+ _this3.body.eventListeners.onMouseMove(event);
+ });
+ this.frame.canvas.addEventListener('contextmenu', function (event) {
+ _this3.body.eventListeners.onContext(event);
+ });
+
+ this.hammerFrame = new Hammer(this.frame);
+ hammerUtil.onRelease(this.hammerFrame, function (event) {
+ _this3.body.eventListeners.onRelease(event);
+ });
+ }
+ }, {
+ key: 'setSize',
+
+ /**
+ * Set a new size for the network
+ * @param {string} width Width in pixels or percentage (for example '800px'
+ * or '50%')
+ * @param {string} height Height in pixels or percentage (for example '400px'
+ * or '30%')
+ */
+ value: function setSize() {
+ var width = arguments.length <= 0 || arguments[0] === undefined ? this.options.width : arguments[0];
+ var height = arguments.length <= 1 || arguments[1] === undefined ? this.options.height : arguments[1];
+
+ width = this._prepareValue(width);
+ height = this._prepareValue(height);
+
+ var emitEvent = false;
+ var oldWidth = this.frame.canvas.width;
+ var oldHeight = this.frame.canvas.height;
+
+ // update the pixelratio
+ var ctx = this.frame.canvas.getContext('2d');
+ var previousRation = this.pixelRatio; // we cache this because the camera state storage needs the old value
+ this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
+
+ if (width != this.options.width || height != this.options.height || this.frame.style.width != width || this.frame.style.height != height) {
+ this._getCameraState(previousRation);
+
+ this.frame.style.width = width;
+ this.frame.style.height = height;
+
+ this.frame.canvas.style.width = '100%';
+ this.frame.canvas.style.height = '100%';
+
+ this.frame.canvas.width = Math.round(this.frame.canvas.clientWidth * this.pixelRatio);
+ this.frame.canvas.height = Math.round(this.frame.canvas.clientHeight * this.pixelRatio);
+
+ this.options.width = width;
+ this.options.height = height;
+
+ emitEvent = true;
+ } else {
+ // this would adapt the width of the canvas to the width from 100% if and only if
+ // there is a change.
+
+ // store the camera if there is a change in size.
+ if (this.frame.canvas.width != Math.round(this.frame.canvas.clientWidth * this.pixelRatio) || this.frame.canvas.height != Math.round(this.frame.canvas.clientHeight * this.pixelRatio)) {
+ this._getCameraState(previousRation);
+ }
+
+ if (this.frame.canvas.width != Math.round(this.frame.canvas.clientWidth * this.pixelRatio)) {
+ this.frame.canvas.width = Math.round(this.frame.canvas.clientWidth * this.pixelRatio);
+ emitEvent = true;
+ }
+ if (this.frame.canvas.height != Math.round(this.frame.canvas.clientHeight * this.pixelRatio)) {
+ this.frame.canvas.height = Math.round(this.frame.canvas.clientHeight * this.pixelRatio);
+ emitEvent = true;
+ }
+ }
+
+ if (emitEvent === true) {
+ this.body.emitter.emit('resize', {
+ width: Math.round(this.frame.canvas.width / this.pixelRatio),
+ height: Math.round(this.frame.canvas.height / this.pixelRatio),
+ oldWidth: Math.round(oldWidth / this.pixelRatio),
+ oldHeight: Math.round(oldHeight / this.pixelRatio)
+ });
+
+ // restore the camera on change.
+ this._setCameraState();
+ }
+
+ return emitEvent;
+ }
+ }, {
+ key: '_XconvertDOMtoCanvas',
+
+ /**
+ * Convert the X coordinate in DOM-space (coordinate point in browser relative to the container div) to
+ * the X coordinate in canvas-space (the simulation sandbox, which the camera looks upon)
+ * @param {number} x
+ * @returns {number}
+ * @private
+ */
+ value: function _XconvertDOMtoCanvas(x) {
+ return (x - this.body.view.translation.x) / this.body.view.scale;
+ }
+ }, {
+ key: '_XconvertCanvasToDOM',
+
+ /**
+ * Convert the X coordinate in canvas-space (the simulation sandbox, which the camera looks upon) to
+ * the X coordinate in DOM-space (coordinate point in browser relative to the container div)
+ * @param {number} x
+ * @returns {number}
+ * @private
+ */
+ value: function _XconvertCanvasToDOM(x) {
+ return x * this.body.view.scale + this.body.view.translation.x;
+ }
+ }, {
+ key: '_YconvertDOMtoCanvas',
+
+ /**
+ * Convert the Y coordinate in DOM-space (coordinate point in browser relative to the container div) to
+ * the Y coordinate in canvas-space (the simulation sandbox, which the camera looks upon)
+ * @param {number} y
+ * @returns {number}
+ * @private
+ */
+ value: function _YconvertDOMtoCanvas(y) {
+ return (y - this.body.view.translation.y) / this.body.view.scale;
+ }
+ }, {
+ key: '_YconvertCanvasToDOM',
+
+ /**
+ * Convert the Y coordinate in canvas-space (the simulation sandbox, which the camera looks upon) to
+ * the Y coordinate in DOM-space (coordinate point in browser relative to the container div)
+ * @param {number} y
+ * @returns {number}
+ * @private
+ */
+ value: function _YconvertCanvasToDOM(y) {
+ return y * this.body.view.scale + this.body.view.translation.y;
+ }
+ }, {
+ key: 'canvasToDOM',
+
+ /**
+ *
+ * @param {object} pos = {x: number, y: number}
+ * @returns {{x: number, y: number}}
+ * @constructor
+ */
+ value: function canvasToDOM(pos) {
+ return { x: this._XconvertCanvasToDOM(pos.x), y: this._YconvertCanvasToDOM(pos.y) };
+ }
+ }, {
+ key: 'DOMtoCanvas',
+
+ /**
+ *
+ * @param {object} pos = {x: number, y: number}
+ * @returns {{x: number, y: number}}
+ * @constructor
+ */
+ value: function DOMtoCanvas(pos) {
+ return { x: this._XconvertDOMtoCanvas(pos.x), y: this._YconvertDOMtoCanvas(pos.y) };
+ }
+ }]);
+
+ return Canvas;
+ })();
+
+ exports['default'] = Canvas;
+ module.exports = exports['default'];
+
+/***/ },
+/* 103 */
+/***/ 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 _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 _NetworkUtil = __webpack_require__(104);
+
+ var _NetworkUtil2 = _interopRequireDefault(_NetworkUtil);
+
+ var util = __webpack_require__(1);
+
+ var View = (function () {
+ function View(body, canvas) {
+ var _this = this;
+
+ _classCallCheck(this, View);
+
+ this.body = body;
+ this.canvas = canvas;
+
+ this.animationSpeed = 1 / this.renderRefreshRate;
+ this.animationEasingFunction = 'easeInOutQuint';
+ this.easingTime = 0;
+ this.sourceScale = 0;
+ this.targetScale = 0;
+ this.sourceTranslation = 0;
+ this.targetTranslation = 0;
+ this.lockedOnNodeId = undefined;
+ this.lockedOnNodeOffset = undefined;
+ this.touchTime = 0;
+
+ this.viewFunction = undefined;
+
+ this.body.emitter.on('fit', this.fit.bind(this));
+ this.body.emitter.on('animationFinished', function () {
+ _this.body.emitter.emit('_stopRendering');
+ });
+ this.body.emitter.on('unlockNode', this.releaseNode.bind(this));
+ }
+
+ _createClass(View, [{
+ key: 'setOptions',
+ value: function setOptions() {
+ var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
+ this.options = options;
+ }
+ }, {
+ key: 'fit',
+
+ /**
+ * This function zooms out to fit all data on screen based on amount of nodes
+ * @param {Object} Options
+ * @param {Boolean} [initialZoom] | zoom based on fitted formula or range, true = fitted, default = false;
+ */
+ value: function fit() {
+ var options = arguments.length <= 0 || arguments[0] === undefined ? { nodes: [] } : arguments[0];
+ var initialZoom = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ var range = undefined;
+ var zoomLevel = undefined;
+ if (options.nodes === undefined || options.nodes.length === 0) {
+ options.nodes = this.body.nodeIndices;
+ }
+
+ if (initialZoom === true) {
+ // check if more than half of the nodes have a predefined position. If so, we use the range, not the approximation.
+ var positionDefined = 0;
+ for (var nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ var node = this.body.nodes[nodeId];
+ if (node.predefinedPosition === true) {
+ positionDefined += 1;
+ }
+ }
+ }
+ if (positionDefined > 0.5 * this.body.nodeIndices.length) {
+ this.fit(options, false);
+ return;
+ }
+
+ range = _NetworkUtil2['default']._getRange(this.body.nodes, options.nodes);
+
+ var numberOfNodes = this.body.nodeIndices.length;
+ zoomLevel = 12.662 / (numberOfNodes + 7.4147) + 0.0964822; // this is obtained from fitting a dataset from 5 points with scale levels that looked good.
+
+ // correct for larger canvasses.
+ var factor = Math.min(this.canvas.frame.canvas.clientWidth / 600, this.canvas.frame.canvas.clientHeight / 600);
+ zoomLevel *= factor;
+ } else {
+ this.body.emitter.emit('_resizeNodes');
+ range = _NetworkUtil2['default']._getRange(this.body.nodes, options.nodes);
+
+ var xDistance = Math.abs(range.maxX - range.minX) * 1.1;
+ var yDistance = Math.abs(range.maxY - range.minY) * 1.1;
+
+ var xZoomLevel = this.canvas.frame.canvas.clientWidth / xDistance;
+ var yZoomLevel = this.canvas.frame.canvas.clientHeight / yDistance;
+
+ zoomLevel = xZoomLevel <= yZoomLevel ? xZoomLevel : yZoomLevel;
+ }
+
+ if (zoomLevel > 1.0) {
+ zoomLevel = 1.0;
+ } else if (zoomLevel === 0) {
+ zoomLevel = 1.0;
+ }
+
+ var center = _NetworkUtil2['default']._findCenter(range);
+ var animationOptions = { position: center, scale: zoomLevel, animation: options.animation };
+ this.moveTo(animationOptions);
+ }
+ }, {
+ key: 'focus',
+
+ // animation
+
+ /**
+ * Center a node in view.
+ *
+ * @param {Number} nodeId
+ * @param {Number} [options]
+ */
+ value: function focus(nodeId) {
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
+
+ if (this.body.nodes[nodeId] !== undefined) {
+ var nodePosition = { x: this.body.nodes[nodeId].x, y: this.body.nodes[nodeId].y };
+ options.position = nodePosition;
+ options.lockedOnNode = nodeId;
+
+ this.moveTo(options);
+ } else {
+ console.log('Node: ' + nodeId + ' cannot be found.');
+ }
+ }
+ }, {
+ key: 'moveTo',
+
+ /**
+ *
+ * @param {Object} options | options.offset = {x:Number, y:Number} // offset from the center in DOM pixels
+ * | options.scale = Number // scale to move to
+ * | options.position = {x:Number, y:Number} // position to move to
+ * | options.animation = {duration:Number, easingFunction:String} || Boolean // position to move to
+ */
+ value: function moveTo(options) {
+ if (options === undefined) {
+ options = {};
+ return;
+ }
+ if (options.offset === undefined) {
+ options.offset = { x: 0, y: 0 };
+ }
+ if (options.offset.x === undefined) {
+ options.offset.x = 0;
+ }
+ if (options.offset.y === undefined) {
+ options.offset.y = 0;
+ }
+ if (options.scale === undefined) {
+ options.scale = this.body.view.scale;
+ }
+ if (options.position === undefined) {
+ options.position = this.getViewPosition();
+ }
+ if (options.animation === undefined) {
+ options.animation = { duration: 0 };
+ }
+ if (options.animation === false) {
+ options.animation = { duration: 0 };
+ }
+ if (options.animation === true) {
+ options.animation = {};
+ }
+ if (options.animation.duration === undefined) {
+ options.animation.duration = 1000;
+ } // default duration
+ if (options.animation.easingFunction === undefined) {
+ options.animation.easingFunction = 'easeInOutQuad';
+ } // default easing function
+
+ this.animateView(options);
+ }
+ }, {
+ key: 'animateView',
+
+ /**
+ *
+ * @param {Object} options | options.offset = {x:Number, y:Number} // offset from the center in DOM pixels
+ * | options.time = Number // animation time in milliseconds
+ * | options.scale = Number // scale to animate to
+ * | options.position = {x:Number, y:Number} // position to animate to
+ * | options.easingFunction = String // linear, easeInQuad, easeOutQuad, easeInOutQuad,
+ * // easeInCubic, easeOutCubic, easeInOutCubic,
+ * // easeInQuart, easeOutQuart, easeInOutQuart,
+ * // easeInQuint, easeOutQuint, easeInOutQuint
+ */
+ value: function animateView(options) {
+ if (options === undefined) {
+ return;
+ }
+ this.animationEasingFunction = options.animation.easingFunction;
+ // release if something focussed on the node
+ this.releaseNode();
+ if (options.locked === true) {
+ this.lockedOnNodeId = options.lockedOnNode;
+ this.lockedOnNodeOffset = options.offset;
+ }
+
+ // forcefully complete the old animation if it was still running
+ if (this.easingTime != 0) {
+ this._transitionRedraw(true); // by setting easingtime to 1, we finish the animation.
+ }
+
+ this.sourceScale = this.body.view.scale;
+ this.sourceTranslation = this.body.view.translation;
+ this.targetScale = options.scale;
+
+ // set the scale so the viewCenter is based on the correct zoom level. This is overridden in the transitionRedraw
+ // but at least then we'll have the target transition
+ this.body.view.scale = this.targetScale;
+ var viewCenter = this.canvas.DOMtoCanvas({ x: 0.5 * this.canvas.frame.canvas.clientWidth, y: 0.5 * this.canvas.frame.canvas.clientHeight });
+
+ var distanceFromCenter = { // offset from view, distance view has to change by these x and y to center the node
+ x: viewCenter.x - options.position.x,
+ y: viewCenter.y - options.position.y
+ };
+ this.targetTranslation = {
+ x: this.sourceTranslation.x + distanceFromCenter.x * this.targetScale + options.offset.x,
+ y: this.sourceTranslation.y + distanceFromCenter.y * this.targetScale + options.offset.y
+ };
+
+ // if the time is set to 0, don't do an animation
+ if (options.animation.duration === 0) {
+ if (this.lockedOnNodeId != undefined) {
+ this.viewFunction = this._lockedRedraw.bind(this);
+ this.body.emitter.on('initRedraw', this.viewFunction);
+ } else {
+ this.body.view.scale = this.targetScale;
+ this.body.view.translation = this.targetTranslation;
+ this.body.emitter.emit('_requestRedraw');
+ }
+ } else {
+ this.animationSpeed = 1 / (60 * options.animation.duration * 0.001) || 1 / 60; // 60 for 60 seconds, 0.001 for milli's
+ this.animationEasingFunction = options.animation.easingFunction;
+
+ this.viewFunction = this._transitionRedraw.bind(this);
+ this.body.emitter.on('initRedraw', this.viewFunction);
+ this.body.emitter.emit('_startRendering');
+ }
+ }
+ }, {
+ key: '_lockedRedraw',
+
+ /**
+ * used to animate smoothly by hijacking the redraw function.
+ * @private
+ */
+ value: function _lockedRedraw() {
+ var nodePosition = { x: this.body.nodes[this.lockedOnNodeId].x, y: this.body.nodes[this.lockedOnNodeId].y };
+ var viewCenter = this.canvas.DOMtoCanvas({ x: 0.5 * this.canvas.frame.canvas.clientWidth, y: 0.5 * this.canvas.frame.canvas.clientHeight });
+ var distanceFromCenter = { // offset from view, distance view has to change by these x and y to center the node
+ x: viewCenter.x - nodePosition.x,
+ y: viewCenter.y - nodePosition.y
+ };
+ var sourceTranslation = this.body.view.translation;
+ var targetTranslation = {
+ x: sourceTranslation.x + distanceFromCenter.x * this.body.view.scale + this.lockedOnNodeOffset.x,
+ y: sourceTranslation.y + distanceFromCenter.y * this.body.view.scale + this.lockedOnNodeOffset.y
+ };
+
+ this.body.view.translation = targetTranslation;
+ }
+ }, {
+ key: 'releaseNode',
+ value: function releaseNode() {
+ if (this.lockedOnNodeId !== undefined && this.viewFunction !== undefined) {
+ this.body.emitter.off('initRedraw', this.viewFunction);
+ this.lockedOnNodeId = undefined;
+ this.lockedOnNodeOffset = undefined;
+ }
+ }
+ }, {
+ key: '_transitionRedraw',
+
+ /**
+ *
+ * @param easingTime
+ * @private
+ */
+ value: function _transitionRedraw() {
+ var finished = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];
+
+ this.easingTime += this.animationSpeed;
+ this.easingTime = finished === true ? 1.0 : this.easingTime;
+
+ var progress = util.easingFunctions[this.animationEasingFunction](this.easingTime);
+
+ this.body.view.scale = this.sourceScale + (this.targetScale - this.sourceScale) * progress;
+ this.body.view.translation = {
+ x: this.sourceTranslation.x + (this.targetTranslation.x - this.sourceTranslation.x) * progress,
+ y: this.sourceTranslation.y + (this.targetTranslation.y - this.sourceTranslation.y) * progress
+ };
+
+ // cleanup
+ if (this.easingTime >= 1.0) {
+ this.body.emitter.off('initRedraw', this.viewFunction);
+ this.easingTime = 0;
+ if (this.lockedOnNodeId != undefined) {
+ this.viewFunction = this._lockedRedraw.bind(this);
+ this.body.emitter.on('initRedraw', this.viewFunction);
+ }
+ this.body.emitter.emit('animationFinished');
+ }
+ }
+ }, {
+ key: 'getScale',
+ value: function getScale() {
+ return this.body.view.scale;
+ }
+ }, {
+ key: 'getViewPosition',
+ value: function getViewPosition() {
+ return this.canvas.DOMtoCanvas({ x: 0.5 * this.canvas.frame.canvas.clientWidth, y: 0.5 * this.canvas.frame.canvas.clientHeight });
+ }
+ }]);
+
+ return View;
+ })();
+
+ exports['default'] = View;
+ module.exports = exports['default'];
+
+/***/ },
+/* 104 */
+/***/ 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 NetworkUtil = (function () {
+ function NetworkUtil() {
+ _classCallCheck(this, NetworkUtil);
+ }
+
+ _createClass(NetworkUtil, null, [{
+ key: "_getRange",
+
+ /**
+ * Find the center position of the network considering the bounding boxes
+ * @private
+ */
+ value: function _getRange(allNodes) {
+ var specificNodes = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];
+
+ var minY = 1e9,
+ maxY = -1e9,
+ minX = 1e9,
+ maxX = -1e9,
+ node;
+ if (specificNodes.length > 0) {
+ for (var i = 0; i < specificNodes.length; i++) {
+ node = allNodes[specificNodes[i]];
+ if (minX > node.shape.boundingBox.left) {
+ minX = node.shape.boundingBox.left;
+ }
+ if (maxX < node.shape.boundingBox.right) {
+ maxX = node.shape.boundingBox.right;
+ }
+ if (minY > node.shape.boundingBox.top) {
+ minY = node.shape.boundingBox.top;
+ } // top is negative, bottom is positive
+ if (maxY < node.shape.boundingBox.bottom) {
+ maxY = node.shape.boundingBox.bottom;
+ } // top is negative, bottom is positive
+ }
+ }
+
+ if (minX === 1e9 && maxX === -1e9 && minY === 1e9 && maxY === -1e9) {
+ minY = 0, maxY = 0, minX = 0, maxX = 0;
+ }
+ return { minX: minX, maxX: maxX, minY: minY, maxY: maxY };
+ }
+ }, {
+ key: "_getRangeCore",
+
+ /**
+ * Find the center position of the network
+ * @private
+ */
+ value: function _getRangeCore(allNodes) {
+ var specificNodes = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];
+
+ var minY = 1e9,
+ maxY = -1e9,
+ minX = 1e9,
+ maxX = -1e9,
+ node;
+ if (specificNodes.length > 0) {
+ for (var i = 0; i < specificNodes.length; i++) {
+ node = allNodes[specificNodes[i]];
+ if (minX > node.x) {
+ minX = node.x;
+ }
+ if (maxX < node.x) {
+ maxX = node.x;
+ }
+ if (minY > node.y) {
+ minY = node.y;
+ } // top is negative, bottom is positive
+ if (maxY < node.y) {
+ maxY = node.y;
+ } // top is negative, bottom is positive
+ }
+ }
+
+ if (minX === 1e9 && maxX === -1e9 && minY === 1e9 && maxY === -1e9) {
+ minY = 0, maxY = 0, minX = 0, maxX = 0;
+ }
+ return { minX: minX, maxX: maxX, minY: minY, maxY: maxY };
+ }
+ }, {
+ key: "_findCenter",
+
+ /**
+ * @param {object} range = {minX: minX, maxX: maxX, minY: minY, maxY: maxY};
+ * @returns {{x: number, y: number}}
+ * @private
+ */
+ value: function _findCenter(range) {
+ return { x: 0.5 * (range.maxX + range.minX),
+ y: 0.5 * (range.maxY + range.minY) };
+ }
+ }]);
+
+ return NetworkUtil;
+ })();
+
+ exports["default"] = NetworkUtil;
+ module.exports = exports["default"];
+
+/***/ },
+/* 105 */
+/***/ 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 _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 _componentsNavigationHandler = __webpack_require__(106);
+
+ var _componentsNavigationHandler2 = _interopRequireDefault(_componentsNavigationHandler);
+
+ var _componentsPopup = __webpack_require__(107);
+
+ var _componentsPopup2 = _interopRequireDefault(_componentsPopup);
+
+ var util = __webpack_require__(1);
+
+ var InteractionHandler = (function () {
+ function InteractionHandler(body, canvas, selectionHandler) {
+ _classCallCheck(this, InteractionHandler);
+
+ this.body = body;
+ this.canvas = canvas;
+ this.selectionHandler = selectionHandler;
+ this.navigationHandler = new _componentsNavigationHandler2['default'](body, canvas);
+
+ // bind the events from hammer to functions in this object
+ this.body.eventListeners.onTap = this.onTap.bind(this);
+ this.body.eventListeners.onTouch = this.onTouch.bind(this);
+ this.body.eventListeners.onDoubleTap = this.onDoubleTap.bind(this);
+ this.body.eventListeners.onHold = this.onHold.bind(this);
+ this.body.eventListeners.onDragStart = this.onDragStart.bind(this);
+ this.body.eventListeners.onDrag = this.onDrag.bind(this);
+ this.body.eventListeners.onDragEnd = this.onDragEnd.bind(this);
+ this.body.eventListeners.onMouseWheel = this.onMouseWheel.bind(this);
+ this.body.eventListeners.onPinch = this.onPinch.bind(this);
+ this.body.eventListeners.onMouseMove = this.onMouseMove.bind(this);
+ this.body.eventListeners.onRelease = this.onRelease.bind(this);
+ this.body.eventListeners.onContext = this.onContext.bind(this);
+
+ this.touchTime = 0;
+ this.drag = {};
+ this.pinch = {};
+ this.popup = undefined;
+ this.popupObj = undefined;
+ this.popupTimer = undefined;
+
+ this.body.functions.getPointer = this.getPointer.bind(this);
+
+ this.options = {};
+ this.defaultOptions = {
+ dragNodes: true,
+ dragView: true,
+ hover: false,
+ keyboard: {
+ enabled: false,
+ speed: { x: 10, y: 10, zoom: 0.02 },
+ bindToWindow: true
+ },
+ navigationButtons: false,
+ tooltipDelay: 300,
+ zoomView: true
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ this.bindEventListeners();
+ }
+
+ _createClass(InteractionHandler, [{
+ key: 'bindEventListeners',
+ value: function bindEventListeners() {
+ var _this = this;
+
+ this.body.emitter.on('destroy', function () {
+ clearTimeout(_this.popupTimer);
+ delete _this.body.functions.getPointer;
+ });
+ }
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options) {
+ if (options !== undefined) {
+ // extend all but the values in fields
+ var fields = ['hideEdgesOnDrag', 'hideNodesOnDrag', 'keyboard', 'multiselect', 'selectable', 'selectConnectedEdges'];
+ util.selectiveNotDeepExtend(fields, this.options, options);
+
+ // merge the keyboard options in.
+ util.mergeOptions(this.options, options, 'keyboard');
+
+ if (options.tooltip) {
+ util.extend(this.options.tooltip, options.tooltip);
+ if (options.tooltip.color) {
+ this.options.tooltip.color = util.parseColor(options.tooltip.color);
+ }
+ }
+ }
+
+ this.navigationHandler.setOptions(this.options);
+ }
+ }, {
+ key: 'getPointer',
+
+ /**
+ * Get the pointer location from a touch location
+ * @param {{x: Number, y: Number}} touch
+ * @return {{x: Number, y: Number}} pointer
+ * @private
+ */
+ value: function getPointer(touch) {
+ return {
+ x: touch.x - util.getAbsoluteLeft(this.canvas.frame.canvas),
+ y: touch.y - util.getAbsoluteTop(this.canvas.frame.canvas)
+ };
+ }
+ }, {
+ key: 'onTouch',
+
+ /**
+ * On start of a touch gesture, store the pointer
+ * @param event
+ * @private
+ */
+ value: function onTouch(event) {
+ if (new Date().valueOf() - this.touchTime > 50) {
+ this.drag.pointer = this.getPointer(event.center);
+ this.drag.pinched = false;
+ this.pinch.scale = this.body.view.scale;
+ // to avoid double fireing of this event because we have two hammer instances. (on canvas and on frame)
+ this.touchTime = new Date().valueOf();
+ }
+ }
+ }, {
+ key: 'onTap',
+
+ /**
+ * handle tap/click event: select/unselect a node
+ * @private
+ */
+ value: function onTap(event) {
+ var pointer = this.getPointer(event.center);
+ var multiselect = this.selectionHandler.options.multiselect && (event.changedPointers[0].ctrlKey || event.changedPointers[0].metaKey);
+
+ this.checkSelectionChanges(pointer, event, multiselect);
+ this.selectionHandler._generateClickEvent('click', event, pointer);
+ }
+ }, {
+ key: 'onDoubleTap',
+
+ /**
+ * handle doubletap event
+ * @private
+ */
+ value: function onDoubleTap(event) {
+ var pointer = this.getPointer(event.center);
+ this.selectionHandler._generateClickEvent('doubleClick', event, pointer);
+ }
+ }, {
+ key: 'onHold',
+
+ /**
+ * handle long tap event: multi select nodes
+ * @private
+ */
+ value: function onHold(event) {
+ var pointer = this.getPointer(event.center);
+ var multiselect = this.selectionHandler.options.multiselect;
+
+ this.checkSelectionChanges(pointer, event, multiselect);
+
+ this.selectionHandler._generateClickEvent('click', event, pointer);
+ this.selectionHandler._generateClickEvent('hold', event, pointer);
+ }
+ }, {
+ key: 'onRelease',
+
+ /**
+ * handle the release of the screen
+ *
+ * @private
+ */
+ value: function onRelease(event) {
+ if (new Date().valueOf() - this.touchTime > 10) {
+ var pointer = this.getPointer(event.center);
+ this.selectionHandler._generateClickEvent('release', event, pointer);
+ // to avoid double fireing of this event because we have two hammer instances. (on canvas and on frame)
+ this.touchTime = new Date().valueOf();
+ }
+ }
+ }, {
+ key: 'onContext',
+ value: function onContext(event) {
+ var pointer = this.getPointer({ x: event.clientX, y: event.clientY });
+ this.selectionHandler._generateClickEvent('oncontext', event, pointer);
+ }
+ }, {
+ key: 'checkSelectionChanges',
+
+ /**
+ *
+ * @param pointer
+ * @param add
+ */
+ value: function checkSelectionChanges(pointer, event) {
+ var add = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+
+ var previouslySelectedEdgeCount = this.selectionHandler._getSelectedEdgeCount();
+ var previouslySelectedNodeCount = this.selectionHandler._getSelectedNodeCount();
+ var previousSelection = this.selectionHandler.getSelection();
+ var selected = undefined;
+ if (add === true) {
+ selected = this.selectionHandler.selectAdditionalOnPoint(pointer);
+ } else {
+ selected = this.selectionHandler.selectOnPoint(pointer);
+ }
+ var selectedEdgesCount = this.selectionHandler._getSelectedEdgeCount();
+ var selectedNodesCount = this.selectionHandler._getSelectedNodeCount();
+ var currentSelection = this.selectionHandler.getSelection();
+
+ var _determineIfDifferent2 = this._determineIfDifferent(previousSelection, currentSelection);
+
+ var nodesChanges = _determineIfDifferent2.nodesChanges;
+ var edgesChanges = _determineIfDifferent2.edgesChanges;
+
+ var nodeSelected = false;
+
+ if (selectedNodesCount - previouslySelectedNodeCount > 0) {
+ // node was selected
+ this.selectionHandler._generateClickEvent('selectNode', event, pointer);
+ selected = true;
+ nodeSelected = true;
+ } else if (selectedNodesCount - previouslySelectedNodeCount < 0) {
+ // node was deselected
+ this.selectionHandler._generateClickEvent('deselectNode', event, pointer, previousSelection);
+ selected = true;
+ } else if (selectedNodesCount === previouslySelectedNodeCount && nodesChanges === true) {
+ this.selectionHandler._generateClickEvent('deselectNode', event, pointer, previousSelection);
+ this.selectionHandler._generateClickEvent('selectNode', event, pointer);
+ nodeSelected = true;
+ selected = true;
+ }
+
+ // handle the selected edges
+ if (selectedEdgesCount - previouslySelectedEdgeCount > 0 && nodeSelected === false) {
+ // edge was selected
+ this.selectionHandler._generateClickEvent('selectEdge', event, pointer);
+ selected = true;
+ } else if (selectedEdgesCount - previouslySelectedEdgeCount < 0) {
+ // edge was deselected
+ this.selectionHandler._generateClickEvent('deselectEdge', event, pointer, previousSelection);
+ selected = true;
+ } else if (selectedEdgesCount === previouslySelectedEdgeCount && edgesChanges === true) {
+ this.selectionHandler._generateClickEvent('deselectEdge', event, pointer, previousSelection);
+ this.selectionHandler._generateClickEvent('selectEdge', event, pointer);
+ selected = true;
+ }
+
+ // fire the select event if anything has been selected or deselected
+ if (selected === true) {
+ // select or unselect
+ this.selectionHandler._generateClickEvent('select', event, pointer);
+ }
+ }
+ }, {
+ key: '_determineIfDifferent',
+
+ /**
+ * This function checks if the nodes and edges previously selected have changed.
+ * @param previousSelection
+ * @param currentSelection
+ * @returns {{nodesChanges: boolean, edgesChanges: boolean}}
+ * @private
+ */
+ value: function _determineIfDifferent(previousSelection, currentSelection) {
+ var nodesChanges = false;
+ var edgesChanges = false;
+
+ for (var i = 0; i < previousSelection.nodes.length; i++) {
+ if (currentSelection.nodes.indexOf(previousSelection.nodes[i]) === -1) {
+ nodesChanges = true;
+ }
+ }
+ for (var i = 0; i < currentSelection.nodes.length; i++) {
+ if (previousSelection.nodes.indexOf(previousSelection.nodes[i]) === -1) {
+ nodesChanges = true;
+ }
+ }
+ for (var i = 0; i < previousSelection.edges.length; i++) {
+ if (currentSelection.edges.indexOf(previousSelection.edges[i]) === -1) {
+ edgesChanges = true;
+ }
+ }
+ for (var i = 0; i < currentSelection.edges.length; i++) {
+ if (previousSelection.edges.indexOf(previousSelection.edges[i]) === -1) {
+ edgesChanges = true;
+ }
+ }
+
+ return { nodesChanges: nodesChanges, edgesChanges: edgesChanges };
+ }
+ }, {
+ key: 'onDragStart',
+
+ /**
+ * This function is called by onDragStart.
+ * It is separated out because we can then overload it for the datamanipulation system.
+ *
+ * @private
+ */
+ value: function onDragStart(event) {
+ //in case the touch event was triggered on an external div, do the initial touch now.
+ if (this.drag.pointer === undefined) {
+ this.onTouch(event);
+ }
+
+ // note: drag.pointer is set in onTouch to get the initial touch location
+ var node = this.selectionHandler.getNodeAt(this.drag.pointer);
+
+ this.drag.dragging = true;
+ this.drag.selection = [];
+ this.drag.translation = util.extend({}, this.body.view.translation); // copy the object
+ this.drag.nodeId = undefined;
+
+ if (node !== undefined && this.options.dragNodes === true) {
+ this.drag.nodeId = node.id;
+ // select the clicked node if not yet selected
+ if (node.isSelected() === false) {
+ this.selectionHandler.unselectAll();
+ this.selectionHandler.selectObject(node);
+ }
+
+ // after select to contain the node
+ this.selectionHandler._generateClickEvent('dragStart', event, this.drag.pointer);
+
+ var selection = this.selectionHandler.selectionObj.nodes;
+ // create an array with the selected nodes and their original location and status
+ for (var nodeId in selection) {
+ if (selection.hasOwnProperty(nodeId)) {
+ var object = selection[nodeId];
+ var s = {
+ id: object.id,
+ node: object,
+
+ // store original x, y, xFixed and yFixed, make the node temporarily Fixed
+ x: object.x,
+ y: object.y,
+ xFixed: object.options.fixed.x,
+ yFixed: object.options.fixed.y
+ };
+
+ object.options.fixed.x = true;
+ object.options.fixed.y = true;
+
+ this.drag.selection.push(s);
+ }
+ }
+ } else {
+ // fallback if no node is selected and thus the view is dragged.
+ this.selectionHandler._generateClickEvent('dragStart', event, this.drag.pointer, undefined, true);
+ }
+ }
+ }, {
+ key: 'onDrag',
+
+ /**
+ * handle drag event
+ * @private
+ */
+ value: function onDrag(event) {
+ var _this2 = this;
+
+ if (this.drag.pinched === true) {
+ return;
+ }
+
+ // remove the focus on node if it is focussed on by the focusOnNode
+ this.body.emitter.emit('unlockNode');
+
+ var pointer = this.getPointer(event.center);
+
+ var selection = this.drag.selection;
+ if (selection && selection.length && this.options.dragNodes === true) {
+ (function () {
+ _this2.selectionHandler._generateClickEvent('dragging', event, pointer);
+
+ // calculate delta's and new location
+ var deltaX = pointer.x - _this2.drag.pointer.x;
+ var deltaY = pointer.y - _this2.drag.pointer.y;
+
+ // update position of all selected nodes
+ selection.forEach(function (selection) {
+ var node = selection.node;
+ // only move the node if it was not fixed initially
+ if (selection.xFixed === false) {
+ node.x = _this2.canvas._XconvertDOMtoCanvas(_this2.canvas._XconvertCanvasToDOM(selection.x) + deltaX);
+ }
+ // only move the node if it was not fixed initially
+ if (selection.yFixed === false) {
+ node.y = _this2.canvas._YconvertDOMtoCanvas(_this2.canvas._YconvertCanvasToDOM(selection.y) + deltaY);
+ }
+ });
+
+ // start the simulation of the physics
+ _this2.body.emitter.emit('startSimulation');
+ })();
+ } else {
+ // move the network
+ if (this.options.dragView === true) {
+ this.selectionHandler._generateClickEvent('dragging', event, pointer, undefined, true);
+
+ // if the drag was not started properly because the click started outside the network div, start it now.
+ if (this.drag.pointer === undefined) {
+ this.onDragStart(event);
+ return;
+ }
+ var diffX = pointer.x - this.drag.pointer.x;
+ var diffY = pointer.y - this.drag.pointer.y;
+
+ this.body.view.translation = { x: this.drag.translation.x + diffX, y: this.drag.translation.y + diffY };
+ this.body.emitter.emit('_redraw');
+ }
+ }
+ }
+ }, {
+ key: 'onDragEnd',
+
+ /**
+ * handle drag start event
+ * @private
+ */
+ value: function onDragEnd(event) {
+ this.drag.dragging = false;
+ var selection = this.drag.selection;
+ if (selection && selection.length) {
+ selection.forEach(function (s) {
+ // restore original xFixed and yFixed
+ s.node.options.fixed.x = s.xFixed;
+ s.node.options.fixed.y = s.yFixed;
+ });
+ this.selectionHandler._generateClickEvent('dragEnd', event, this.getPointer(event.center));
+ this.body.emitter.emit('startSimulation');
+ } else {
+ this.selectionHandler._generateClickEvent('dragEnd', event, this.getPointer(event.center), undefined, true);
+ this.body.emitter.emit('_requestRedraw');
+ }
+ }
+ }, {
+ key: 'onPinch',
+
+ /**
+ * Handle pinch event
+ * @param event
+ * @private
+ */
+ value: function onPinch(event) {
+ var pointer = this.getPointer(event.center);
+
+ this.drag.pinched = true;
+ if (this.pinch['scale'] === undefined) {
+ this.pinch.scale = 1;
+ }
+
+ // TODO: enabled moving while pinching?
+ var scale = this.pinch.scale * event.scale;
+ this.zoom(scale, pointer);
+ }
+ }, {
+ key: 'zoom',
+
+ /**
+ * Zoom the network in or out
+ * @param {Number} scale a number around 1, and between 0.01 and 10
+ * @param {{x: Number, y: Number}} pointer Position on screen
+ * @return {Number} appliedScale scale is limited within the boundaries
+ * @private
+ */
+ value: function zoom(scale, pointer) {
+ if (this.options.zoomView === true) {
+ var scaleOld = this.body.view.scale;
+ if (scale < 0.00001) {
+ scale = 0.00001;
+ }
+ if (scale > 10) {
+ scale = 10;
+ }
+
+ var preScaleDragPointer = undefined;
+ if (this.drag !== undefined) {
+ if (this.drag.dragging === true) {
+ preScaleDragPointer = this.canvas.DOMtoCanvas(this.drag.pointer);
+ }
+ }
+ // + this.canvas.frame.canvas.clientHeight / 2
+ var translation = this.body.view.translation;
+
+ var scaleFrac = scale / scaleOld;
+ var tx = (1 - scaleFrac) * pointer.x + translation.x * scaleFrac;
+ var ty = (1 - scaleFrac) * pointer.y + translation.y * scaleFrac;
+
+ this.body.view.scale = scale;
+ this.body.view.translation = { x: tx, y: ty };
+
+ if (preScaleDragPointer != undefined) {
+ var postScaleDragPointer = this.canvas.canvasToDOM(preScaleDragPointer);
+ this.drag.pointer.x = postScaleDragPointer.x;
+ this.drag.pointer.y = postScaleDragPointer.y;
+ }
+
+ this.body.emitter.emit('_requestRedraw');
+
+ if (scaleOld < scale) {
+ this.body.emitter.emit('zoom', { direction: '+', scale: this.body.view.scale });
+ } else {
+ this.body.emitter.emit('zoom', { direction: '-', scale: this.body.view.scale });
+ }
+ }
+ }
+ }, {
+ key: 'onMouseWheel',
+
+ /**
+ * Event handler for mouse wheel event, used to zoom the timeline
+ * See http://adomas.org/javascript-mouse-wheel/
+ * https://github.com/EightMedia/hammer.js/issues/256
+ * @param {MouseEvent} event
+ * @private
+ */
+ value: function onMouseWheel(event) {
+ // retrieve delta
+ var delta = 0;
+ if (event.wheelDelta) {
+ /* IE/Opera. */
+ delta = event.wheelDelta / 120;
+ } else if (event.detail) {
+ /* Mozilla case. */
+ // In Mozilla, sign of delta is different than in IE.
+ // Also, delta is multiple of 3.
+ delta = -event.detail / 3;
+ }
+
+ // If delta is nonzero, handle it.
+ // Basically, delta is now positive if wheel was scrolled up,
+ // and negative, if wheel was scrolled down.
+ if (delta !== 0) {
+
+ // calculate the new scale
+ var scale = this.body.view.scale;
+ var zoom = delta / 10;
+ if (delta < 0) {
+ zoom = zoom / (1 - zoom);
+ }
+ scale *= 1 + zoom;
+
+ // calculate the pointer location
+ var pointer = this.getPointer({ x: event.clientX, y: event.clientY });
+
+ // apply the new scale
+ this.zoom(scale, pointer);
+ }
+
+ // Prevent default actions caused by mouse wheel.
+ event.preventDefault();
+ }
+ }, {
+ key: 'onMouseMove',
+
+ /**
+ * Mouse move handler for checking whether the title moves over a node with a title.
+ * @param {Event} event
+ * @private
+ */
+ value: function onMouseMove(event) {
+ var _this3 = this;
+
+ var pointer = this.getPointer({ x: event.clientX, y: event.clientY });
+ var popupVisible = false;
+
+ // check if the previously selected node is still selected
+ if (this.popup !== undefined) {
+ if (this.popup.hidden === false) {
+ this._checkHidePopup(pointer);
+ }
+
+ // if the popup was not hidden above
+ if (this.popup.hidden === false) {
+ popupVisible = true;
+ this.popup.setPosition(pointer.x + 3, pointer.y - 5);
+ this.popup.show();
+ }
+ }
+
+ // if we bind the keyboard to the div, we have to highlight it to use it. This highlights it on mouse over.
+ if (this.options.keyboard.bindToWindow === false && this.options.keyboard.enabled === true) {
+ this.canvas.frame.focus();
+ }
+
+ // start a timeout that will check if the mouse is positioned above an element
+ if (popupVisible === false) {
+ if (this.popupTimer !== undefined) {
+ clearInterval(this.popupTimer); // stop any running calculationTimer
+ this.popupTimer = undefined;
+ }
+ if (!this.drag.dragging) {
+ this.popupTimer = setTimeout(function () {
+ return _this3._checkShowPopup(pointer);
+ }, this.options.tooltipDelay);
+ }
+ }
+
+ /**
+ * Adding hover highlights
+ */
+ if (this.options.hover === true) {
+ // adding hover highlights
+ var obj = this.selectionHandler.getNodeAt(pointer);
+ if (obj === undefined) {
+ obj = this.selectionHandler.getEdgeAt(pointer);
+ }
+ this.selectionHandler.hoverObject(obj);
+ }
+ }
+ }, {
+ key: '_checkShowPopup',
+
+ /**
+ * Check if there is an element on the given position in the network
+ * (a node or edge). If so, and if this element has a title,
+ * show a popup window with its title.
+ *
+ * @param {{x:Number, y:Number}} pointer
+ * @private
+ */
+ value: function _checkShowPopup(pointer) {
+ var x = this.canvas._XconvertDOMtoCanvas(pointer.x);
+ var y = this.canvas._YconvertDOMtoCanvas(pointer.y);
+ var pointerObj = {
+ left: x,
+ top: y,
+ right: x,
+ bottom: y
+ };
+
+ var previousPopupObjId = this.popupObj === undefined ? undefined : this.popupObj.id;
+ var nodeUnderCursor = false;
+ var popupType = 'node';
+
+ // check if a node is under the cursor.
+ if (this.popupObj === undefined) {
+ // search the nodes for overlap, select the top one in case of multiple nodes
+ var nodeIndices = this.body.nodeIndices;
+ var nodes = this.body.nodes;
+ var node = undefined;
+ var overlappingNodes = [];
+ for (var i = 0; i < nodeIndices.length; i++) {
+ node = nodes[nodeIndices[i]];
+ if (node.isOverlappingWith(pointerObj) === true) {
+ if (node.getTitle() !== undefined) {
+ overlappingNodes.push(nodeIndices[i]);
+ }
+ }
+ }
+
+ if (overlappingNodes.length > 0) {
+ // if there are overlapping nodes, select the last one, this is the one which is drawn on top of the others
+ this.popupObj = nodes[overlappingNodes[overlappingNodes.length - 1]];
+ // if you hover over a node, the title of the edge is not supposed to be shown.
+ nodeUnderCursor = true;
+ }
+ }
+
+ if (this.popupObj === undefined && nodeUnderCursor === false) {
+ // search the edges for overlap
+ var edgeIndices = this.body.edgeIndices;
+ var edges = this.body.edges;
+ var edge = undefined;
+ var overlappingEdges = [];
+ for (var i = 0; i < edgeIndices.length; i++) {
+ edge = edges[edgeIndices[i]];
+ if (edge.isOverlappingWith(pointerObj) === true) {
+ if (edge.connected === true && edge.getTitle() !== undefined) {
+ overlappingEdges.push(edgeIndices[i]);
+ }
+ }
+ }
+
+ if (overlappingEdges.length > 0) {
+ this.popupObj = edges[overlappingEdges[overlappingEdges.length - 1]];
+ popupType = 'edge';
+ }
+ }
+
+ if (this.popupObj !== undefined) {
+ // show popup message window
+ if (this.popupObj.id !== previousPopupObjId) {
+ if (this.popup === undefined) {
+ this.popup = new _componentsPopup2['default'](this.canvas.frame);
+ }
+
+ this.popup.popupTargetType = popupType;
+ this.popup.popupTargetId = this.popupObj.id;
+
+ // adjust a small offset such that the mouse cursor is located in the
+ // bottom left location of the popup, and you can easily move over the
+ // popup area
+ this.popup.setPosition(pointer.x + 3, pointer.y - 5);
+ this.popup.setText(this.popupObj.getTitle());
+ this.popup.show();
+ this.body.emitter.emit('showPopup', this.popupObj.id);
+ }
+ } else {
+ if (this.popup !== undefined) {
+ this.popup.hide();
+ this.body.emitter.emit('hidePopup');
+ }
+ }
+ }
+ }, {
+ key: '_checkHidePopup',
+
+ /**
+ * Check if the popup must be hidden, which is the case when the mouse is no
+ * longer hovering on the object
+ * @param {{x:Number, y:Number}} pointer
+ * @private
+ */
+ value: function _checkHidePopup(pointer) {
+ var pointerObj = this.selectionHandler._pointerToPositionObject(pointer);
+
+ var stillOnObj = false;
+ if (this.popup.popupTargetType === 'node') {
+ if (this.body.nodes[this.popup.popupTargetId] !== undefined) {
+ stillOnObj = this.body.nodes[this.popup.popupTargetId].isOverlappingWith(pointerObj);
+
+ // if the mouse is still one the node, we have to check if it is not also on one that is drawn on top of it.
+ // we initially only check stillOnObj because this is much faster.
+ if (stillOnObj === true) {
+ var overNode = this.selectionHandler.getNodeAt(pointer);
+ stillOnObj = overNode.id === this.popup.popupTargetId;
+ }
+ }
+ } else {
+ if (this.selectionHandler.getNodeAt(pointer) === undefined) {
+ if (this.body.edges[this.popup.popupTargetId] !== undefined) {
+ stillOnObj = this.body.edges[this.popup.popupTargetId].isOverlappingWith(pointerObj);
+ }
+ }
+ }
+
+ if (stillOnObj === false) {
+ this.popupObj = undefined;
+ this.popup.hide();
+ this.body.emitter.emit('hidePopup');
+ }
+ }
+ }]);
+
+ return InteractionHandler;
+ })();
+
+ exports['default'] = InteractionHandler;
+ module.exports = exports['default'];
+
+/***/ },
+/* 106 */
+/***/ 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 util = __webpack_require__(1);
+ var Hammer = __webpack_require__(20);
+ var hammerUtil = __webpack_require__(25);
+ var keycharm = __webpack_require__(41);
+
+ var NavigationHandler = (function () {
+ function NavigationHandler(body, canvas) {
+ var _this = this;
+
+ _classCallCheck(this, NavigationHandler);
+
+ this.body = body;
+ this.canvas = canvas;
+
+ this.iconsCreated = false;
+ this.navigationHammers = [];
+ this.boundFunctions = {};
+ this.touchTime = 0;
+ this.activated = false;
+
+ this.body.emitter.on('activate', function () {
+ _this.activated = true;_this.configureKeyboardBindings();
+ });
+ this.body.emitter.on('deactivate', function () {
+ _this.activated = false;_this.configureKeyboardBindings();
+ });
+ this.body.emitter.on('destroy', function () {
+ if (_this.keycharm !== undefined) {
+ _this.keycharm.destroy();
+ }
+ });
+
+ this.options = {};
+ }
+
+ _createClass(NavigationHandler, [{
+ key: 'setOptions',
+ value: function setOptions(options) {
+ if (options !== undefined) {
+ this.options = options;
+ this.create();
+ }
+ }
+ }, {
+ key: 'create',
+ value: function create() {
+ if (this.options.navigationButtons === true) {
+ if (this.iconsCreated === false) {
+ this.loadNavigationElements();
+ }
+ } else if (this.iconsCreated === true) {
+ this.cleanNavigation();
+ }
+
+ this.configureKeyboardBindings();
+ }
+ }, {
+ key: 'cleanNavigation',
+ value: function cleanNavigation() {
+ // clean hammer bindings
+ if (this.navigationHammers.length != 0) {
+ for (var i = 0; i < this.navigationHammers.length; i++) {
+ this.navigationHammers[i].destroy();
+ }
+ this.navigationHammers = [];
+ }
+
+ // clean up previous navigation items
+ if (this.navigationDOM && this.navigationDOM['wrapper'] && this.navigationDOM['wrapper'].parentNode) {
+ this.navigationDOM['wrapper'].parentNode.removeChild(this.navigationDOM['wrapper']);
+ }
+
+ this.iconsCreated = false;
+ }
+ }, {
+ key: 'loadNavigationElements',
+
+ /**
+ * Creation of the navigation controls nodes. They are drawn over the rest of the nodes and are not affected by scale and translation
+ * they have a triggerFunction which is called on click. If the position of the navigation controls is dependent
+ * on this.frame.canvas.clientWidth or this.frame.canvas.clientHeight, we flag horizontalAlignLeft and verticalAlignTop false.
+ * This means that the location will be corrected by the _relocateNavigation function on a size change of the canvas.
+ *
+ * @private
+ */
+ value: function loadNavigationElements() {
+ var _this2 = this;
+
+ this.cleanNavigation();
+
+ this.navigationDOM = {};
+ var navigationDivs = ['up', 'down', 'left', 'right', 'zoomIn', 'zoomOut', 'zoomExtends'];
+ var navigationDivActions = ['_moveUp', '_moveDown', '_moveLeft', '_moveRight', '_zoomIn', '_zoomOut', '_fit'];
+
+ this.navigationDOM['wrapper'] = document.createElement('div');
+ this.navigationDOM['wrapper'].className = 'vis-navigation';
+ this.canvas.frame.appendChild(this.navigationDOM['wrapper']);
+
+ for (var i = 0; i < navigationDivs.length; i++) {
+ this.navigationDOM[navigationDivs[i]] = document.createElement('div');
+ this.navigationDOM[navigationDivs[i]].className = 'vis-button vis-' + navigationDivs[i];
+ this.navigationDOM['wrapper'].appendChild(this.navigationDOM[navigationDivs[i]]);
+
+ var hammer = new Hammer(this.navigationDOM[navigationDivs[i]]);
+ if (navigationDivActions[i] === '_fit') {
+ hammerUtil.onTouch(hammer, this._fit.bind(this));
+ } else {
+ hammerUtil.onTouch(hammer, this.bindToRedraw.bind(this, navigationDivActions[i]));
+ }
+
+ this.navigationHammers.push(hammer);
+ }
+
+ // use a hammer for the release so we do not require the one used in the rest of the network
+ // the one the rest uses can be overloaded by the manipulation system.
+ var hammerFrame = new Hammer(this.canvas.frame);
+ hammerUtil.onRelease(hammerFrame, function () {
+ _this2._stopMovement();
+ });
+ this.navigationHammers.push(hammerFrame);
+
+ this.iconsCreated = true;
+ }
+ }, {
+ key: 'bindToRedraw',
+ value: function bindToRedraw(action) {
+ if (this.boundFunctions[action] === undefined) {
+ this.boundFunctions[action] = this[action].bind(this);
+ this.body.emitter.on('initRedraw', this.boundFunctions[action]);
+ this.body.emitter.emit('_startRendering');
+ }
+ }
+ }, {
+ key: 'unbindFromRedraw',
+ value: function unbindFromRedraw(action) {
+ if (this.boundFunctions[action] !== undefined) {
+ this.body.emitter.off('initRedraw', this.boundFunctions[action]);
+ this.body.emitter.emit('_stopRendering');
+ delete this.boundFunctions[action];
+ }
+ }
+ }, {
+ key: '_fit',
+
+ /**
+ * this stops all movement induced by the navigation buttons
+ *
+ * @private
+ */
+ value: function _fit() {
+ if (new Date().valueOf() - this.touchTime > 700) {
+ // TODO: fix ugly hack to avoid hammer's double fireing of event (because we use release?)
+ this.body.emitter.emit('fit', { duration: 700 });
+ this.touchTime = new Date().valueOf();
+ }
+ }
+ }, {
+ key: '_stopMovement',
+
+ /**
+ * this stops all movement induced by the navigation buttons
+ *
+ * @private
+ */
+ value: function _stopMovement() {
+ for (var boundAction in this.boundFunctions) {
+ if (this.boundFunctions.hasOwnProperty(boundAction)) {
+ this.body.emitter.off('initRedraw', this.boundFunctions[boundAction]);
+ this.body.emitter.emit('_stopRendering');
+ }
+ }
+ this.boundFunctions = {};
+ }
+ }, {
+ key: '_moveUp',
+ value: function _moveUp() {
+ this.body.view.translation.y += this.options.keyboard.speed.y;
+ }
+ }, {
+ key: '_moveDown',
+ value: function _moveDown() {
+ this.body.view.translation.y -= this.options.keyboard.speed.y;
+ }
+ }, {
+ key: '_moveLeft',
+ value: function _moveLeft() {
+ this.body.view.translation.x += this.options.keyboard.speed.x;
+ }
+ }, {
+ key: '_moveRight',
+ value: function _moveRight() {
+ this.body.view.translation.x -= this.options.keyboard.speed.x;
+ }
+ }, {
+ key: '_zoomIn',
+ value: function _zoomIn() {
+ this.body.view.scale *= 1 + this.options.keyboard.speed.zoom;
+ this.body.emitter.emit('zoom', { direction: '+', scale: this.body.view.scale });
+ }
+ }, {
+ key: '_zoomOut',
+ value: function _zoomOut() {
+ this.body.view.scale /= 1 + this.options.keyboard.speed.zoom;
+ this.body.emitter.emit('zoom', { direction: '-', scale: this.body.view.scale });
+ }
+ }, {
+ key: 'configureKeyboardBindings',
+
+ /**
+ * bind all keys using keycharm.
+ */
+ value: function configureKeyboardBindings() {
+ var _this3 = this;
+
+ if (this.keycharm !== undefined) {
+ this.keycharm.destroy();
+ }
+
+ if (this.options.keyboard.enabled === true) {
+ if (this.options.keyboard.bindToWindow === true) {
+ this.keycharm = keycharm({ container: window, preventDefault: true });
+ } else {
+ this.keycharm = keycharm({ container: this.canvas.frame, preventDefault: true });
+ }
+
+ this.keycharm.reset();
+
+ if (this.activated === true) {
+ this.keycharm.bind('up', function () {
+ _this3.bindToRedraw('_moveUp');
+ }, 'keydown');
+ this.keycharm.bind('down', function () {
+ _this3.bindToRedraw('_moveDown');
+ }, 'keydown');
+ this.keycharm.bind('left', function () {
+ _this3.bindToRedraw('_moveLeft');
+ }, 'keydown');
+ this.keycharm.bind('right', function () {
+ _this3.bindToRedraw('_moveRight');
+ }, 'keydown');
+ this.keycharm.bind('=', function () {
+ _this3.bindToRedraw('_zoomIn');
+ }, 'keydown');
+ this.keycharm.bind('num+', function () {
+ _this3.bindToRedraw('_zoomIn');
+ }, 'keydown');
+ this.keycharm.bind('num-', function () {
+ _this3.bindToRedraw('_zoomOut');
+ }, 'keydown');
+ this.keycharm.bind('-', function () {
+ _this3.bindToRedraw('_zoomOut');
+ }, 'keydown');
+ this.keycharm.bind('[', function () {
+ _this3.bindToRedraw('_zoomOut');
+ }, 'keydown');
+ this.keycharm.bind(']', function () {
+ _this3.bindToRedraw('_zoomIn');
+ }, 'keydown');
+ this.keycharm.bind('pageup', function () {
+ _this3.bindToRedraw('_zoomIn');
+ }, 'keydown');
+ this.keycharm.bind('pagedown', function () {
+ _this3.bindToRedraw('_zoomOut');
+ }, 'keydown');
+
+ this.keycharm.bind('up', function () {
+ _this3.unbindFromRedraw('_moveUp');
+ }, 'keyup');
+ this.keycharm.bind('down', function () {
+ _this3.unbindFromRedraw('_moveDown');
+ }, 'keyup');
+ this.keycharm.bind('left', function () {
+ _this3.unbindFromRedraw('_moveLeft');
+ }, 'keyup');
+ this.keycharm.bind('right', function () {
+ _this3.unbindFromRedraw('_moveRight');
+ }, 'keyup');
+ this.keycharm.bind('=', function () {
+ _this3.unbindFromRedraw('_zoomIn');
+ }, 'keyup');
+ this.keycharm.bind('num+', function () {
+ _this3.unbindFromRedraw('_zoomIn');
+ }, 'keyup');
+ this.keycharm.bind('num-', function () {
+ _this3.unbindFromRedraw('_zoomOut');
+ }, 'keyup');
+ this.keycharm.bind('-', function () {
+ _this3.unbindFromRedraw('_zoomOut');
+ }, 'keyup');
+ this.keycharm.bind('[', function () {
+ _this3.unbindFromRedraw('_zoomOut');
+ }, 'keyup');
+ this.keycharm.bind(']', function () {
+ _this3.unbindFromRedraw('_zoomIn');
+ }, 'keyup');
+ this.keycharm.bind('pageup', function () {
+ _this3.unbindFromRedraw('_zoomIn');
+ }, 'keyup');
+ this.keycharm.bind('pagedown', function () {
+ _this3.unbindFromRedraw('_zoomOut');
+ }, 'keyup');
+ }
+ }
+ }
+ }]);
+
+ return NavigationHandler;
+ })();
+
+ exports['default'] = NavigationHandler;
+ module.exports = exports['default'];
+
+/***/ },
+/* 107 */
+/***/ function(module, exports) {
+
+ /**
+ * Popup is a class to create a popup window with some text
+ * @param {Element} container The container object.
+ * @param {Number} [x]
+ * @param {Number} [y]
+ * @param {String} [text]
+ * @param {Object} [style] An object containing borderColor,
+ * backgroundColor, etc.
+ */
+ '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 Popup = (function () {
+ function Popup(container) {
+ _classCallCheck(this, Popup);
+
+ this.container = container;
+
+ this.x = 0;
+ this.y = 0;
+ this.padding = 5;
+ this.hidden = false;
+
+ // create the frame
+ this.frame = document.createElement('div');
+ this.frame.className = 'vis-network-tooltip';
+ this.container.appendChild(this.frame);
+ }
+
+ _createClass(Popup, [{
+ key: 'setPosition',
+
+ /**
+ * @param {number} x Horizontal position of the popup window
+ * @param {number} y Vertical position of the popup window
+ */
+ value: function setPosition(x, y) {
+ this.x = parseInt(x);
+ this.y = parseInt(y);
+ }
+ }, {
+ key: 'setText',
+
+ /**
+ * Set the content for the popup window. This can be HTML code or text.
+ * @param {string | Element} content
+ */
+ value: function setText(content) {
+ if (content instanceof Element) {
+ this.frame.innerHTML = '';
+ this.frame.appendChild(content);
+ } else {
+ this.frame.innerHTML = content; // string containing text or HTML
+ }
+ }
+ }, {
+ key: 'show',
+
+ /**
+ * Show the popup window
+ * @param {boolean} [doShow] Show or hide the window
+ */
+ value: function show(doShow) {
+ if (doShow === undefined) {
+ doShow = true;
+ }
+
+ if (doShow === true) {
+ var height = this.frame.clientHeight;
+ var width = this.frame.clientWidth;
+ var maxHeight = this.frame.parentNode.clientHeight;
+ var maxWidth = this.frame.parentNode.clientWidth;
+
+ var top = this.y - height;
+ if (top + height + this.padding > maxHeight) {
+ top = maxHeight - height - this.padding;
+ }
+ if (top < this.padding) {
+ top = this.padding;
+ }
+
+ var left = this.x;
+ if (left + width + this.padding > maxWidth) {
+ left = maxWidth - width - this.padding;
+ }
+ if (left < this.padding) {
+ left = this.padding;
+ }
+
+ this.frame.style.left = left + 'px';
+ this.frame.style.top = top + 'px';
+ this.frame.style.visibility = 'visible';
+ this.hidden = false;
+ } else {
+ this.hide();
+ }
+ }
+ }, {
+ key: 'hide',
+
+ /**
+ * Hide the popup window
+ */
+ value: function hide() {
+ this.hidden = true;
+ this.frame.style.visibility = 'hidden';
+ }
+ }]);
+
+ return Popup;
+ })();
+
+ exports['default'] = Popup;
+ module.exports = exports['default'];
+
+/***/ },
+/* 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; }; })();
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var Node = __webpack_require__(62);
+ var Edge = __webpack_require__(82);
+ var util = __webpack_require__(1);
+
+ var SelectionHandler = (function () {
+ function SelectionHandler(body, canvas) {
+ var _this = this;
+
+ _classCallCheck(this, SelectionHandler);
+
+ this.body = body;
+ this.canvas = canvas;
+ this.selectionObj = { nodes: [], edges: [] };
+ this.hoverObj = { nodes: {}, edges: {} };
+
+ this.options = {};
+ this.defaultOptions = {
+ multiselect: false,
+ selectable: true,
+ selectConnectedEdges: true,
+ hoverConnectedEdges: true
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ this.body.emitter.on("_dataChanged", function () {
+ _this.updateSelection();
+ });
+ }
+
+ _createClass(SelectionHandler, [{
+ key: "setOptions",
+ value: function setOptions(options) {
+ if (options !== undefined) {
+ var fields = ["multiselect", "hoverConnectedEdges", "selectable", "selectConnectedEdges"];
+ util.selectiveDeepExtend(fields, this.options, options);
+ }
+ }
+ }, {
+ key: "selectOnPoint",
+
+ /**
+ * handles the selection part of the tap;
+ *
+ * @param {Object} pointer
+ * @private
+ */
+ value: function selectOnPoint(pointer) {
+ var selected = false;
+ if (this.options.selectable === true) {
+ var obj = this.getNodeAt(pointer) || this.getEdgeAt(pointer);
+
+ // unselect after getting the objects in order to restore width and height.
+ this.unselectAll();
+
+ if (obj !== undefined) {
+ selected = this.selectObject(obj);
+ }
+ this.body.emitter.emit("_requestRedraw");
+ }
+ return selected;
+ }
+ }, {
+ key: "selectAdditionalOnPoint",
+ value: function selectAdditionalOnPoint(pointer) {
+ var selectionChanged = false;
+ if (this.options.selectable === true) {
+ var obj = this.getNodeAt(pointer) || this.getEdgeAt(pointer);
+
+ if (obj !== undefined) {
+ selectionChanged = true;
+ if (obj.isSelected() === true) {
+ this.deselectObject(obj);
+ } else {
+ this.selectObject(obj);
+ }
+
+ this.body.emitter.emit("_requestRedraw");
+ }
+ }
+ return selectionChanged;
+ }
+ }, {
+ key: "_generateClickEvent",
+ value: function _generateClickEvent(eventType, event, pointer, oldSelection) {
+ var emptySelection = arguments.length <= 4 || arguments[4] === undefined ? false : arguments[4];
+
+ var properties = undefined;
+ if (emptySelection === true) {
+ properties = { nodes: [], edges: [] };
+ } else {
+ properties = this.getSelection();
+ }
+ properties["pointer"] = {
+ DOM: { x: pointer.x, y: pointer.y },
+ canvas: this.canvas.DOMtoCanvas(pointer)
+ };
+ properties["event"] = event;
+
+ if (oldSelection !== undefined) {
+ properties["previousSelection"] = oldSelection;
+ }
+ this.body.emitter.emit(eventType, properties);
+ }
+ }, {
+ key: "selectObject",
+ value: function selectObject(obj) {
+ var highlightEdges = arguments.length <= 1 || arguments[1] === undefined ? this.options.selectConnectedEdges : arguments[1];
+
+ if (obj !== undefined) {
+ if (obj instanceof Node) {
+ if (highlightEdges === true) {
+ this._selectConnectedEdges(obj);
+ }
+ }
+ obj.select();
+ this._addToSelection(obj);
+ return true;
+ }
+ return false;
+ }
+ }, {
+ key: "deselectObject",
+ value: function deselectObject(obj) {
+ if (obj.isSelected() === true) {
+ obj.selected = false;
+ this._removeFromSelection(obj);
+ }
+ }
+ }, {
+ key: "_getAllNodesOverlappingWith",
+
+ /**
+ * retrieve all nodes overlapping with given object
+ * @param {Object} object An object with parameters left, top, right, bottom
+ * @return {Number[]} An array with id's of the overlapping nodes
+ * @private
+ */
+ value: function _getAllNodesOverlappingWith(object) {
+ var overlappingNodes = [];
+ var nodes = this.body.nodes;
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ var nodeId = this.body.nodeIndices[i];
+ if (nodes[nodeId].isOverlappingWith(object)) {
+ overlappingNodes.push(nodeId);
+ }
+ }
+ return overlappingNodes;
+ }
+ }, {
+ key: "_pointerToPositionObject",
+
+ /**
+ * Return a position object in canvasspace from a single point in screenspace
+ *
+ * @param pointer
+ * @returns {{left: number, top: number, right: number, bottom: number}}
+ * @private
+ */
+ value: function _pointerToPositionObject(pointer) {
+ var canvasPos = this.canvas.DOMtoCanvas(pointer);
+ return {
+ left: canvasPos.x - 1,
+ top: canvasPos.y + 1,
+ right: canvasPos.x + 1,
+ bottom: canvasPos.y - 1
+ };
+ }
+ }, {
+ key: "getNodeAt",
+
+ /**
+ * Get the top node at the a specific point (like a click)
+ *
+ * @param {{x: Number, y: Number}} pointer
+ * @return {Node | undefined} node
+ * @private
+ */
+ value: function getNodeAt(pointer) {
+ var returnNode = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ // we first check if this is an navigation controls element
+ var positionObject = this._pointerToPositionObject(pointer);
+ var overlappingNodes = this._getAllNodesOverlappingWith(positionObject);
+ // if there are overlapping nodes, select the last one, this is the
+ // one which is drawn on top of the others
+ if (overlappingNodes.length > 0) {
+ if (returnNode === true) {
+ return this.body.nodes[overlappingNodes[overlappingNodes.length - 1]];
+ } else {
+ return overlappingNodes[overlappingNodes.length - 1];
+ }
+ } else {
+ return undefined;
+ }
+ }
+ }, {
+ key: "_getEdgesOverlappingWith",
+
+ /**
+ * retrieve all edges overlapping with given object, selector is around center
+ * @param {Object} object An object with parameters left, top, right, bottom
+ * @return {Number[]} An array with id's of the overlapping nodes
+ * @private
+ */
+ value: function _getEdgesOverlappingWith(object, overlappingEdges) {
+ var edges = this.body.edges;
+ for (var i = 0; i < this.body.edgeIndices.length; i++) {
+ var edgeId = this.body.edgeIndices[i];
+ if (edges[edgeId].isOverlappingWith(object)) {
+ overlappingEdges.push(edgeId);
+ }
+ }
+ }
+ }, {
+ key: "_getAllEdgesOverlappingWith",
+
+ /**
+ * retrieve all nodes overlapping with given object
+ * @param {Object} object An object with parameters left, top, right, bottom
+ * @return {Number[]} An array with id's of the overlapping nodes
+ * @private
+ */
+ value: function _getAllEdgesOverlappingWith(object) {
+ var overlappingEdges = [];
+ this._getEdgesOverlappingWith(object, overlappingEdges);
+ return overlappingEdges;
+ }
+ }, {
+ key: "getEdgeAt",
+
+ /**
+ * Place holder. To implement change the getNodeAt to a _getObjectAt. Have the _getObjectAt call
+ * getNodeAt and _getEdgesAt, then priortize the selection to user preferences.
+ *
+ * @param pointer
+ * @returns {undefined}
+ * @private
+ */
+ value: function getEdgeAt(pointer) {
+ var returnEdge = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ var positionObject = this._pointerToPositionObject(pointer);
+ var overlappingEdges = this._getAllEdgesOverlappingWith(positionObject);
+
+ if (overlappingEdges.length > 0) {
+ if (returnEdge === true) {
+ return this.body.edges[overlappingEdges[overlappingEdges.length - 1]];
+ } else {
+ return overlappingEdges[overlappingEdges.length - 1];
+ }
+ } else {
+ return undefined;
+ }
+ }
+ }, {
+ key: "_addToSelection",
+
+ /**
+ * Add object to the selection array.
+ *
+ * @param obj
+ * @private
+ */
+ value: function _addToSelection(obj) {
+ if (obj instanceof Node) {
+ this.selectionObj.nodes[obj.id] = obj;
+ } else {
+ this.selectionObj.edges[obj.id] = obj;
+ }
+ }
+ }, {
+ key: "_addToHover",
+
+ /**
+ * Add object to the selection array.
+ *
+ * @param obj
+ * @private
+ */
+ value: function _addToHover(obj) {
+ if (obj instanceof Node) {
+ this.hoverObj.nodes[obj.id] = obj;
+ } else {
+ this.hoverObj.edges[obj.id] = obj;
+ }
+ }
+ }, {
+ key: "_removeFromSelection",
+
+ /**
+ * Remove a single option from selection.
+ *
+ * @param {Object} obj
+ * @private
+ */
+ value: function _removeFromSelection(obj) {
+ if (obj instanceof Node) {
+ delete this.selectionObj.nodes[obj.id];
+ } else {
+ delete this.selectionObj.edges[obj.id];
+ }
+ }
+ }, {
+ key: "unselectAll",
+
+ /**
+ * Unselect all. The selectionObj is useful for this.
+ *
+ * @private
+ */
+ value: function unselectAll() {
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ this.selectionObj.nodes[nodeId].unselect();
+ }
+ }
+ for (var edgeId in this.selectionObj.edges) {
+ if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ this.selectionObj.edges[edgeId].unselect();
+ }
+ }
+
+ this.selectionObj = { nodes: {}, edges: {} };
+ }
+ }, {
+ key: "_getSelectedNodeCount",
+
+ /**
+ * return the number of selected nodes
+ *
+ * @returns {number}
+ * @private
+ */
+ value: function _getSelectedNodeCount() {
+ var count = 0;
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ count += 1;
+ }
+ }
+ return count;
+ }
+ }, {
+ key: "_getSelectedNode",
+
+ /**
+ * return the selected node
+ *
+ * @returns {number}
+ * @private
+ */
+ value: function _getSelectedNode() {
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ return this.selectionObj.nodes[nodeId];
+ }
+ }
+ return undefined;
+ }
+ }, {
+ key: "_getSelectedEdge",
+
+ /**
+ * return the selected edge
+ *
+ * @returns {number}
+ * @private
+ */
+ value: function _getSelectedEdge() {
+ for (var edgeId in this.selectionObj.edges) {
+ if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ return this.selectionObj.edges[edgeId];
+ }
+ }
+ return undefined;
+ }
+ }, {
+ key: "_getSelectedEdgeCount",
+
+ /**
+ * return the number of selected edges
+ *
+ * @returns {number}
+ * @private
+ */
+ value: function _getSelectedEdgeCount() {
+ var count = 0;
+ for (var edgeId in this.selectionObj.edges) {
+ if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ count += 1;
+ }
+ }
+ return count;
+ }
+ }, {
+ key: "_getSelectedObjectCount",
+
+ /**
+ * return the number of selected objects.
+ *
+ * @returns {number}
+ * @private
+ */
+ value: function _getSelectedObjectCount() {
+ var count = 0;
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ count += 1;
+ }
+ }
+ for (var edgeId in this.selectionObj.edges) {
+ if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ count += 1;
+ }
+ }
+ return count;
+ }
+ }, {
+ key: "_selectionIsEmpty",
+
+ /**
+ * Check if anything is selected
+ *
+ * @returns {boolean}
+ * @private
+ */
+ value: function _selectionIsEmpty() {
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ return false;
+ }
+ }
+ for (var edgeId in this.selectionObj.edges) {
+ if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ }, {
+ key: "_clusterInSelection",
+
+ /**
+ * check if one of the selected nodes is a cluster.
+ *
+ * @returns {boolean}
+ * @private
+ */
+ value: function _clusterInSelection() {
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ if (this.selectionObj.nodes[nodeId].clusterSize > 1) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ }, {
+ key: "_selectConnectedEdges",
+
+ /**
+ * select the edges connected to the node that is being selected
+ *
+ * @param {Node} node
+ * @private
+ */
+ value: function _selectConnectedEdges(node) {
+ for (var i = 0; i < node.edges.length; i++) {
+ var edge = node.edges[i];
+ edge.select();
+ this._addToSelection(edge);
+ }
+ }
+ }, {
+ key: "_hoverConnectedEdges",
+
+ /**
+ * select the edges connected to the node that is being selected
+ *
+ * @param {Node} node
+ * @private
+ */
+ value: function _hoverConnectedEdges(node) {
+ for (var i = 0; i < node.edges.length; i++) {
+ var edge = node.edges[i];
+ edge.hover = true;
+ this._addToHover(edge);
+ }
+ }
+ }, {
+ key: "_unselectConnectedEdges",
+
+ /**
+ * unselect the edges connected to the node that is being selected
+ *
+ * @param {Node} node
+ * @private
+ */
+ value: function _unselectConnectedEdges(node) {
+ for (var i = 0; i < node.edges.length; i++) {
+ var edge = node.edges[i];
+ edge.unselect();
+ this._removeFromSelection(edge);
+ }
+ }
+ }, {
+ key: "blurObject",
+
+ /**
+ * This is called when someone clicks on a node. either select or deselect it.
+ * If there is an existing selection and we don't want to append to it, clear the existing selection
+ *
+ * @param {Node || Edge} object
+ * @private
+ */
+ value: function blurObject(object) {
+ if (object.hover === true) {
+ object.hover = false;
+ if (object instanceof Node) {
+ this.body.emitter.emit("blurNode", { node: object.id });
+ } else {
+ this.body.emitter.emit("blurEdge", { edge: object.id });
+ }
+ }
+ }
+ }, {
+ key: "hoverObject",
+
+ /**
+ * This is called when someone clicks on a node. either select or deselect it.
+ * If there is an existing selection and we don't want to append to it, clear the existing selection
+ *
+ * @param {Node || Edge} object
+ * @private
+ */
+ value: function hoverObject(object) {
+ var hoverChanged = false;
+ // remove all node hover highlights
+ for (var nodeId in this.hoverObj.nodes) {
+ if (this.hoverObj.nodes.hasOwnProperty(nodeId)) {
+ if (object === undefined || object instanceof Node && object.id != nodeId || object instanceof Edge) {
+ this.blurObject(this.hoverObj.nodes[nodeId]);
+ delete this.hoverObj.nodes[nodeId];
+ hoverChanged = true;
+ }
+ }
+ }
+
+ // removing all edge hover highlights
+ for (var edgeId in this.hoverObj.edges) {
+ if (this.hoverObj.edges.hasOwnProperty(edgeId)) {
+ // if the hover has been changed here it means that the node has been hovered over or off
+ // we then do not use the blurObject method here.
+ if (hoverChanged === true) {
+ this.hoverObj.edges[edgeId].hover = false;
+ delete this.hoverObj.edges[edgeId];
+ }
+ // if the blur remains the same and the object is undefined (mouse off), we blur the edge
+ else if (object === undefined) {
+ this.blurObject(this.hoverObj.edges[edgeId]);
+ delete this.hoverObj.edges[edgeId];
+ hoverChanged = true;
+ }
+ }
+ }
+
+ if (object !== undefined) {
+ if (object.hover === false) {
+ object.hover = true;
+ this._addToHover(object);
+ hoverChanged = true;
+ if (object instanceof Node) {
+ this.body.emitter.emit("hoverNode", { node: object.id });
+ } else {
+ this.body.emitter.emit("hoverEdge", { edge: object.id });
+ }
+ }
+ if (object instanceof Node && this.options.hoverConnectedEdges === true) {
+ this._hoverConnectedEdges(object);
+ }
+ }
+
+ if (hoverChanged === true) {
+ this.body.emitter.emit("_requestRedraw");
+ }
+ }
+ }, {
+ key: "getSelection",
+
+ /**
+ *
+ * retrieve the currently selected objects
+ * @return {{nodes: Array., edges: Array.}} selection
+ */
+ value: function getSelection() {
+ var nodeIds = this.getSelectedNodes();
+ var edgeIds = this.getSelectedEdges();
+ return { nodes: nodeIds, edges: edgeIds };
+ }
+ }, {
+ key: "getSelectedNodes",
+
+ /**
+ *
+ * retrieve the currently selected nodes
+ * @return {String[]} selection An array with the ids of the
+ * selected nodes.
+ */
+ value: function getSelectedNodes() {
+ var idArray = [];
+ if (this.options.selectable === true) {
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ idArray.push(nodeId);
+ }
+ }
+ }
+ return idArray;
+ }
+ }, {
+ key: "getSelectedEdges",
+
+ /**
+ *
+ * retrieve the currently selected edges
+ * @return {Array} selection An array with the ids of the
+ * selected nodes.
+ */
+ value: function getSelectedEdges() {
+ var idArray = [];
+ if (this.options.selectable === true) {
+ for (var edgeId in this.selectionObj.edges) {
+ if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ idArray.push(edgeId);
+ }
+ }
+ }
+ return idArray;
+ }
+ }, {
+ key: "selectNodes",
+
+ /**
+ * select zero or more nodes with the option to highlight edges
+ * @param {Number[] | String[]} selection An array with the ids of the
+ * selected nodes.
+ * @param {boolean} [highlightEdges]
+ */
+ value: function selectNodes(selection) {
+ var highlightEdges = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ var i = undefined,
+ id = undefined;
+
+ if (!selection || selection.length === undefined) throw "Selection must be an array with ids";
+
+ // first unselect any selected node
+ this.unselectAll();
+
+ for (i = 0; i < selection.length; i++) {
+ id = selection[i];
+
+ var node = this.body.nodes[id];
+ if (!node) {
+ throw new RangeError("Node with id \"" + id + "\" not found");
+ }
+ this.selectObject(node, highlightEdges);
+ }
+ this.body.emitter.emit("_requestRedraw");
+ }
+ }, {
+ key: "selectEdges",
+
+ /**
+ * select zero or more edges
+ * @param {Number[] | String[]} selection An array with the ids of the
+ * selected nodes.
+ */
+ value: function selectEdges(selection) {
+ var i = undefined,
+ id = undefined;
+
+ if (!selection || selection.length === undefined) throw "Selection must be an array with ids";
+
+ // first unselect any selected objects
+ this.unselectAll();
+
+ for (i = 0; i < selection.length; i++) {
+ id = selection[i];
+
+ var edge = this.body.edges[id];
+ if (!edge) {
+ throw new RangeError("Edge with id \"" + id + "\" not found");
+ }
+ this.selectObject(edge);
+ }
+ this.body.emitter.emit("_requestRedraw");
+ }
+ }, {
+ key: "updateSelection",
+
+ /**
+ * Validate the selection: remove ids of nodes which no longer exist
+ * @private
+ */
+ value: function updateSelection() {
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ if (!this.body.nodes.hasOwnProperty(nodeId)) {
+ delete this.selectionObj.nodes[nodeId];
+ }
+ }
+ }
+ for (var edgeId in this.selectionObj.edges) {
+ if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ if (!this.body.edges.hasOwnProperty(edgeId)) {
+ delete this.selectionObj.edges[edgeId];
+ }
+ }
+ }
+ }
+ }]);
+
+ return SelectionHandler;
+ })();
+
+ exports["default"] = SelectionHandler;
+ module.exports = exports["default"];
+
+/***/ },
+/* 109 */
+/***/ 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 _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 _NetworkUtil = __webpack_require__(104);
+
+ var _NetworkUtil2 = _interopRequireDefault(_NetworkUtil);
+
+ var util = __webpack_require__(1);
+
+ var LayoutEngine = (function () {
+ function LayoutEngine(body) {
+ _classCallCheck(this, LayoutEngine);
+
+ this.body = body;
+
+ this.initialRandomSeed = Math.round(Math.random() * 1000000);
+ this.randomSeed = this.initialRandomSeed;
+ this.options = {};
+ this.optionsBackup = {};
+
+ this.defaultOptions = {
+ randomSeed: undefined,
+ improvedLayout: true,
+ hierarchical: {
+ enabled: false,
+ levelSeparation: 150,
+ direction: 'UD', // UD, DU, LR, RL
+ sortMethod: 'hubsize' // hubsize, directed
+ }
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ this.hierarchicalLevels = {};
+
+ this.bindEventListeners();
+ }
+
+ _createClass(LayoutEngine, [{
+ key: 'bindEventListeners',
+ value: function bindEventListeners() {
+ var _this = this;
+
+ this.body.emitter.on('_dataChanged', function () {
+ _this.setupHierarchicalLayout();
+ });
+ this.body.emitter.on('_dataLoaded', function () {
+ _this.layoutNetwork();
+ });
+ this.body.emitter.on('_resetHierarchicalLayout', function () {
+ _this.setupHierarchicalLayout();
+ });
+ }
+ }, {
+ key: 'setOptions',
+ value: function setOptions(options, allOptions) {
+ if (options !== undefined) {
+ var prevHierarchicalState = this.options.hierarchical.enabled;
+ util.selectiveDeepExtend(['randomSeed', 'improvedLayout'], this.options, options);
+ util.mergeOptions(this.options, options, 'hierarchical');
+ if (options.randomSeed !== undefined) {
+ this.initialRandomSeed = options.randomSeed;
+ }
+
+ if (this.options.hierarchical.enabled === true) {
+ if (prevHierarchicalState === true) {
+ // refresh the overridden options for nodes and edges.
+ this.body.emitter.emit('refresh', true);
+ }
+
+ // make sure the level seperation is the right way up
+ if (this.options.hierarchical.direction === 'RL' || this.options.hierarchical.direction === 'DU') {
+ if (this.options.hierarchical.levelSeparation > 0) {
+ this.options.hierarchical.levelSeparation *= -1;
+ }
+ } else {
+ if (this.options.hierarchical.levelSeparation < 0) {
+ this.options.hierarchical.levelSeparation *= -1;
+ }
+ }
+
+ this.body.emitter.emit('_resetHierarchicalLayout');
+ // because the hierarchical system needs it's own physics and smooth curve settings, we adapt the other options if needed.
+ return this.adaptAllOptions(allOptions);
+ } else {
+ if (prevHierarchicalState === true) {
+ // refresh the overridden options for nodes and edges.
+ this.body.emitter.emit('refresh');
+ return util.deepExtend(allOptions, this.optionsBackup);
+ }
+ }
+ }
+ return allOptions;
+ }
+ }, {
+ key: 'adaptAllOptions',
+ value: function adaptAllOptions(allOptions) {
+ if (this.options.hierarchical.enabled === true) {
+ // set the physics
+ if (allOptions.physics === undefined || allOptions.physics === true) {
+ allOptions.physics = { solver: 'hierarchicalRepulsion' };
+ this.optionsBackup.physics = { solver: 'barnesHut' };
+ } else if (typeof allOptions.physics === 'object') {
+ this.optionsBackup.physics = { solver: 'barnesHut' };
+ if (allOptions.physics.solver !== undefined) {
+ this.optionsBackup.physics = { solver: allOptions.physics.solver };
+ }
+ allOptions.physics['solver'] = 'hierarchicalRepulsion';
+ } else if (allOptions.physics !== false) {
+ this.optionsBackup.physics = { solver: 'barnesHut' };
+ allOptions.physics['solver'] = 'hierarchicalRepulsion';
+ }
+
+ // get the type of static smooth curve in case it is required
+ var type = 'horizontal';
+ if (this.options.hierarchical.direction === 'RL' || this.options.hierarchical.direction === 'LR') {
+ type = 'vertical';
+ }
+
+ // disable smooth curves if nothing is defined. If smooth curves have been turned on, turn them into static smooth curves.
+ if (allOptions.edges === undefined) {
+ this.optionsBackup.edges = { smooth: { enabled: true, type: 'dynamic' } };
+ allOptions.edges = { smooth: false };
+ } else if (allOptions.edges.smooth === undefined) {
+ this.optionsBackup.edges = { smooth: { enabled: true, type: 'dynamic' } };
+ allOptions.edges.smooth = false;
+ } else {
+ if (typeof allOptions.edges.smooth === 'boolean') {
+ this.optionsBackup.edges = { smooth: allOptions.edges.smooth };
+ allOptions.edges.smooth = { enabled: allOptions.edges.smooth, type: type };
+ } else {
+ // allow custom types except for dynamic
+ if (allOptions.edges.smooth.type !== undefined && allOptions.edges.smooth.type !== 'dynamic') {
+ type = allOptions.edges.smooth.type;
+ }
+
+ this.optionsBackup.edges = {
+ smooth: allOptions.edges.smooth.enabled === undefined ? true : allOptions.edges.smooth.enabled,
+ type: allOptions.edges.smooth.type === undefined ? 'dynamic' : allOptions.edges.smooth.type,
+ roundness: allOptions.edges.smooth.roundness === undefined ? 0.5 : allOptions.edges.smooth.roundness,
+ forceDirection: allOptions.edges.smooth.forceDirection === undefined ? false : allOptions.edges.smooth.forceDirection
+ };
+ allOptions.edges.smooth = {
+ enabled: allOptions.edges.smooth.enabled === undefined ? true : allOptions.edges.smooth.enabled,
+ type: type,
+ roundness: allOptions.edges.smooth.roundness === undefined ? 0.5 : allOptions.edges.smooth.roundness,
+ forceDirection: allOptions.edges.smooth.forceDirection === undefined ? false : allOptions.edges.smooth.forceDirection
+ };
+ }
+ }
+
+ // force all edges into static smooth curves. Only applies to edges that do not use the global options for smooth.
+ this.body.emitter.emit('_forceDisableDynamicCurves', type);
+ }
+ return allOptions;
+ }
+ }, {
+ key: 'seededRandom',
+ value: function seededRandom() {
+ var x = Math.sin(this.randomSeed++) * 10000;
+ return x - Math.floor(x);
+ }
+ }, {
+ key: 'positionInitially',
+ value: function positionInitially(nodesArray) {
+ if (this.options.hierarchical.enabled !== true) {
+ this.randomSeed = this.initialRandomSeed;
+ for (var i = 0; i < nodesArray.length; i++) {
+ var node = nodesArray[i];
+ var radius = 10 * 0.1 * nodesArray.length + 10;
+ var angle = 2 * Math.PI * this.seededRandom();
+ if (node.x === undefined) {
+ node.x = radius * Math.cos(angle);
+ }
+ if (node.y === undefined) {
+ node.y = radius * Math.sin(angle);
+ }
+ }
+ }
+ }
+ }, {
+ key: 'layoutNetwork',
+
+ /**
+ * Use KamadaKawai to position nodes. This is quite a heavy algorithm so if there are a lot of nodes we
+ * cluster them first to reduce the amount.
+ */
+ value: function layoutNetwork() {
+ if (this.options.hierarchical.enabled !== true && this.options.improvedLayout === true) {
+ // first check if we should KamadaKawai to layout. The threshold is if less than half of the visible
+ // nodes have predefined positions we use this.
+ var positionDefined = 0;
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ var node = this.body.nodes[this.body.nodeIndices[i]];
+ if (node.predefinedPosition === true) {
+ positionDefined += 1;
+ }
+ }
+
+ // if less than half of the nodes have a predefined position we continue
+ if (positionDefined < 0.5 * this.body.nodeIndices.length) {
+ var MAX_LEVELS = 10;
+ var level = 0;
+ var clusterThreshold = 100;
+ // if there are a lot of nodes, we cluster before we run the algorithm.
+ if (this.body.nodeIndices.length > clusterThreshold) {
+ var startLength = this.body.nodeIndices.length;
+ while (this.body.nodeIndices.length > clusterThreshold) {
+ //console.time("clustering")
+ level += 1;
+ var before = this.body.nodeIndices.length;
+ // if there are many nodes we do a hubsize cluster
+ if (level % 3 === 0) {
+ this.body.modules.clustering.clusterBridges();
+ } else {
+ this.body.modules.clustering.clusterOutliers();
+ }
+ var after = this.body.nodeIndices.length;
+ if (before == after && level % 3 !== 0 || level > MAX_LEVELS) {
+ this._declusterAll();
+ this.body.emitter.emit('_layoutFailed');
+ console.info('This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.');
+ return;
+ }
+ //console.timeEnd("clustering")
+ //console.log(level,after)
+ }
+ // increase the size of the edges
+ this.body.modules.kamadaKawai.setOptions({ springLength: Math.max(150, 2 * startLength) });
+ }
+
+ // position the system for these nodes and edges
+ this.body.modules.kamadaKawai.solve(this.body.nodeIndices, this.body.edgeIndices, true);
+
+ // shift to center point
+ this._shiftToCenter();
+
+ // perturb the nodes a little bit to force the physics to kick in
+ var offset = 70;
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ this.body.nodes[this.body.nodeIndices[i]].x += (0.5 - this.seededRandom()) * offset;
+ this.body.nodes[this.body.nodeIndices[i]].y += (0.5 - this.seededRandom()) * offset;
+ }
+
+ // uncluster all clusters
+ this._declusterAll();
+
+ // reposition all bezier nodes.
+ this.body.emitter.emit('_repositionBezierNodes');
+ }
+ }
+ }
+ }, {
+ key: '_shiftToCenter',
+
+ /**
+ * Move all the nodes towards to the center so gravitational pull wil not move the nodes away from view
+ * @private
+ */
+ value: function _shiftToCenter() {
+ var range = _NetworkUtil2['default']._getRangeCore(this.body.nodes, this.body.nodeIndices);
+ var center = _NetworkUtil2['default']._findCenter(range);
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ this.body.nodes[this.body.nodeIndices[i]].x -= center.x;
+ this.body.nodes[this.body.nodeIndices[i]].y -= center.y;
+ }
+ }
+ }, {
+ key: '_declusterAll',
+ value: function _declusterAll() {
+ var clustersPresent = true;
+ while (clustersPresent === true) {
+ clustersPresent = false;
+ for (var i = 0; i < this.body.nodeIndices.length; i++) {
+ if (this.body.nodes[this.body.nodeIndices[i]].isCluster === true) {
+ clustersPresent = true;
+ this.body.modules.clustering.openCluster(this.body.nodeIndices[i], {}, false);
+ }
+ }
+ if (clustersPresent === true) {
+ this.body.emitter.emit('_dataChanged');
+ }
+ }
+ }
+ }, {
+ key: 'getSeed',
+ value: function getSeed() {
+ return this.initialRandomSeed;
+ }
+ }, {
+ key: 'setupHierarchicalLayout',
+
+ /**
+ * This is the main function to layout the nodes in a hierarchical way.
+ * It checks if the node details are supplied correctly
+ *
+ * @private
+ */
+ value: function setupHierarchicalLayout() {
+ if (this.options.hierarchical.enabled === true && this.body.nodeIndices.length > 0) {
+ // get the size of the largest hubs and check if the user has defined a level for a node.
+ var node = undefined,
+ nodeId = undefined;
+ var definedLevel = false;
+ var undefinedLevel = false;
+ this.hierarchicalLevels = {};
+ this.nodeSpacing = 100;
+
+ for (nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ node = this.body.nodes[nodeId];
+ if (node.options.level !== undefined) {
+ definedLevel = true;
+ this.hierarchicalLevels[nodeId] = node.options.level;
+ } else {
+ undefinedLevel = true;
+ }
+ }
+ }
+
+ // if the user defined some levels but not all, alert and run without hierarchical layout
+ if (undefinedLevel === true && definedLevel === true) {
+ throw new Error('To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.');
+ return;
+ } else {
+ // setup the system to use hierarchical method.
+ //this._changeConstants();
+
+ // define levels if undefined by the users. Based on hubsize
+ if (undefinedLevel === true) {
+ if (this.options.hierarchical.sortMethod === 'hubsize') {
+ this._determineLevelsByHubsize();
+ } else if (this.options.hierarchical.sortMethod === 'directed' || 'direction') {
+ this._determineLevelsDirected();
+ }
+ }
+
+ // check the distribution of the nodes per level.
+ var distribution = this._getDistribution();
+
+ // place the nodes on the canvas.
+ this._placeNodesByHierarchy(distribution);
+ }
+ }
+ }
+ }, {
+ key: '_placeNodesByHierarchy',
+
+ /**
+ * This function places the nodes on the canvas based on the hierarchial distribution.
+ *
+ * @param {Object} distribution | obtained by the function this._getDistribution()
+ * @private
+ */
+ value: function _placeNodesByHierarchy(distribution) {
+ var nodeId = undefined,
+ node = undefined;
+ this.positionedNodes = {};
+ // start placing all the level 0 nodes first. Then recursively position their branches.
+ for (var level in distribution) {
+ if (distribution.hasOwnProperty(level)) {
+ for (nodeId in distribution[level].nodes) {
+ if (distribution[level].nodes.hasOwnProperty(nodeId)) {
+
+ node = distribution[level].nodes[nodeId];
+
+ if (this.options.hierarchical.direction === 'UD' || this.options.hierarchical.direction === 'DU') {
+ if (node.x === undefined) {
+ node.x = distribution[level].distance;
+ }
+ distribution[level].distance = node.x + this.nodeSpacing;
+ } else {
+ if (node.y === undefined) {
+ node.y = distribution[level].distance;
+ }
+ distribution[level].distance = node.y + this.nodeSpacing;
+ }
+
+ this.positionedNodes[nodeId] = true;
+ this._placeBranchNodes(node.edges, node.id, distribution, level);
+ }
+ }
+ }
+ }
+ }
+ }, {
+ key: '_getDistribution',
+
+ /**
+ * This function get the distribution of levels based on hubsize
+ *
+ * @returns {Object}
+ * @private
+ */
+ value: function _getDistribution() {
+ var distribution = {};
+ var nodeId = undefined,
+ node = undefined;
+
+ // we fix Y because the hierarchy is vertical, we fix X so we do not give a node an x position for a second time.
+ // the fix of X is removed after the x value has been set.
+ for (nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ node = this.body.nodes[nodeId];
+ var level = this.hierarchicalLevels[nodeId] === undefined ? 0 : this.hierarchicalLevels[nodeId];
+ if (this.options.hierarchical.direction === 'UD' || this.options.hierarchical.direction === 'DU') {
+ node.y = this.options.hierarchical.levelSeparation * level;
+ node.options.fixed.y = true;
+ } else {
+ node.x = this.options.hierarchical.levelSeparation * level;
+ node.options.fixed.x = true;
+ }
+ if (distribution[level] === undefined) {
+ distribution[level] = { amount: 0, nodes: {}, distance: 0 };
+ }
+ distribution[level].amount += 1;
+ distribution[level].nodes[nodeId] = node;
+ }
+ }
+ return distribution;
+ }
+ }, {
+ key: '_getHubSize',
+
+ /**
+ * Get the hubsize from all remaining unlevelled nodes.
+ *
+ * @returns {number}
+ * @private
+ */
+ value: function _getHubSize() {
+ var hubSize = 0;
+ for (var nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ var node = this.body.nodes[nodeId];
+ if (this.hierarchicalLevels[nodeId] === undefined) {
+ hubSize = node.edges.length < hubSize ? hubSize : node.edges.length;
+ }
+ }
+ }
+ return hubSize;
+ }
+ }, {
+ key: '_determineLevelsByHubsize',
+
+ /**
+ * this function allocates nodes in levels based on the recursive branching from the largest hubs.
+ *
+ * @param hubsize
+ * @private
+ */
+ value: function _determineLevelsByHubsize() {
+ var nodeId = undefined,
+ node = undefined;
+ var hubSize = 1;
+
+ while (hubSize > 0) {
+ // determine hubs
+ hubSize = this._getHubSize();
+ if (hubSize === 0) break;
+
+ for (nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ node = this.body.nodes[nodeId];
+ if (node.edges.length === hubSize) {
+ this._setLevelByHubsize(0, node);
+ }
+ }
+ }
+ }
+ }
+ }, {
+ key: '_setLevelByHubsize',
+
+ /**
+ * this function is called recursively to enumerate the barnches of the largest hubs and give each node a level.
+ *
+ * @param level
+ * @param edges
+ * @param parentId
+ * @private
+ */
+ value: function _setLevelByHubsize(level, node) {
+ if (this.hierarchicalLevels[node.id] !== undefined) return;
+
+ var childNode = undefined;
+ this.hierarchicalLevels[node.id] = level;
+ for (var i = 0; i < node.edges.length; i++) {
+ if (node.edges[i].toId === node.id) {
+ childNode = node.edges[i].from;
+ } else {
+ childNode = node.edges[i].to;
+ }
+ this._setLevelByHubsize(level + 1, childNode);
+ }
+ }
+ }, {
+ key: '_determineLevelsDirected',
+
+ /**
+ * this function allocates nodes in levels based on the direction of the edges
+ *
+ * @param hubsize
+ * @private
+ */
+ value: function _determineLevelsDirected() {
+ var nodeId = undefined,
+ node = undefined;
+ var minLevel = 10000;
+
+ // set first node to source
+ for (nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ node = this.body.nodes[nodeId];
+ this._setLevelDirected(minLevel, node);
+ }
+ }
+
+ // get the minimum level
+ for (nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ minLevel = this.hierarchicalLevels[nodeId] < minLevel ? this.hierarchicalLevels[nodeId] : minLevel;
+ }
+ }
+
+ // subtract the minimum from the set so we have a range starting from 0
+ for (nodeId in this.body.nodes) {
+ if (this.body.nodes.hasOwnProperty(nodeId)) {
+ this.hierarchicalLevels[nodeId] -= minLevel;
+ }
+ }
+ }
+ }, {
+ key: '_setLevelDirected',
+
+ /**
+ * this function is called recursively to enumerate the branched of the first node and give each node a level based on edge direction
+ *
+ * @param level
+ * @param edges
+ * @param parentId
+ * @private
+ */
+ value: function _setLevelDirected(level, node) {
+ if (this.hierarchicalLevels[node.id] !== undefined) return;
+
+ var childNode = undefined;
+ this.hierarchicalLevels[node.id] = level;
+
+ for (var i = 0; i < node.edges.length; i++) {
+ if (node.edges[i].toId === node.id) {
+ childNode = node.edges[i].from;
+ this._setLevelDirected(level - 1, childNode);
+ } else {
+ childNode = node.edges[i].to;
+ this._setLevelDirected(level + 1, childNode);
+ }
+ }
+ }
+ }, {
+ key: '_placeBranchNodes',
+
+ /**
+ * This is a recursively called function to enumerate the branches from the largest hubs and place the nodes
+ * on a X position that ensures there will be no overlap.
+ *
+ * @param edges
+ * @param parentId
+ * @param distribution
+ * @param parentLevel
+ * @private
+ */
+ value: function _placeBranchNodes(edges, parentId, distribution, parentLevel) {
+ for (var i = 0; i < edges.length; i++) {
+ var childNode = undefined;
+ var parentNode = undefined;
+ if (edges[i].toId === parentId) {
+ childNode = edges[i].from;
+ parentNode = edges[i].to;
+ } else {
+ childNode = edges[i].to;
+ parentNode = edges[i].from;
+ }
+ var childNodeLevel = this.hierarchicalLevels[childNode.id];
+
+ if (this.positionedNodes[childNode.id] === undefined) {
+ // if a node is conneceted to another node on the same level (or higher (means lower level))!, this is not handled here.
+ if (childNodeLevel > parentLevel) {
+ if (this.options.hierarchical.direction === 'UD' || this.options.hierarchical.direction === 'DU') {
+ if (childNode.x === undefined) {
+ childNode.x = Math.max(distribution[childNodeLevel].distance, parentNode.x);
+ }
+ distribution[childNodeLevel].distance = childNode.x + this.nodeSpacing;
+ this.positionedNodes[childNode.id] = true;
+ } else {
+ if (childNode.y === undefined) {
+ childNode.y = Math.max(distribution[childNodeLevel].distance, parentNode.y);
+ }
+ distribution[childNodeLevel].distance = childNode.y + this.nodeSpacing;
+ }
+ this.positionedNodes[childNode.id] = true;
+
+ if (childNode.edges.length > 1) {
+ this._placeBranchNodes(childNode.edges, childNode.id, distribution, childNodeLevel);
+ }
+ }
+ }
+ }
+ }
+ }]);
+
+ return LayoutEngine;
+ })();
+
+ exports['default'] = LayoutEngine;
+ module.exports = exports['default'];
+
+/***/ },
+/* 110 */
+/***/ 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 util = __webpack_require__(1);
+ var Hammer = __webpack_require__(20);
+ var hammerUtil = __webpack_require__(25);
+
+ /**
+ * clears the toolbar div element of children
+ *
+ * @private
+ */
+
+ var ManipulationSystem = (function () {
+ function ManipulationSystem(body, canvas, selectionHandler) {
+ var _this = this;
+
+ _classCallCheck(this, ManipulationSystem);
+
+ this.body = body;
+ this.canvas = canvas;
+ this.selectionHandler = selectionHandler;
+
+ this.editMode = false;
+ this.manipulationDiv = undefined;
+ this.editModeDiv = undefined;
+ this.closeDiv = undefined;
+
+ this.manipulationHammers = [];
+ this.temporaryUIFunctions = {};
+ this.temporaryEventFunctions = [];
+
+ this.touchTime = 0;
+ this.temporaryIds = { nodes: [], edges: [] };
+ this.guiEnabled = false;
+ this.inMode = false;
+ this.selectedControlNode = undefined;
+
+ this.options = {};
+ this.defaultOptions = {
+ enabled: false,
+ initiallyActive: false,
+ addNode: true,
+ addEdge: true,
+ editNode: undefined,
+ editEdge: true,
+ deleteNode: true,
+ deleteEdge: true,
+ controlNodeStyle: {
+ shape: 'dot',
+ size: 6,
+ color: { background: '#ff0000', border: '#3c3c3c', highlight: { background: '#07f968', border: '#3c3c3c' } },
+ borderWidth: 2,
+ borderWidthSelected: 2
+ }
+ };
+ util.extend(this.options, this.defaultOptions);
+
+ this.body.emitter.on('destroy', function () {
+ _this._clean();
+ });
+ this.body.emitter.on('_dataChanged', this._restore.bind(this));
+ this.body.emitter.on('_resetData', this._restore.bind(this));
+ }
+
+ _createClass(ManipulationSystem, [{
+ key: '_restore',
+
+ /**
+ * If something changes in the data during editing, switch back to the initial datamanipulation state and close all edit modes.
+ * @private
+ */
+ value: function _restore() {
+ if (this.inMode !== false) {
+ if (this.options.initiallyActive === true) {
+ this.enableEditMode();
+ } else {
+ this.disableEditMode();
+ }
+ }
+ }
+ }, {
+ key: 'setOptions',
+
+ /**
+ * Set the Options
+ * @param options
+ */
+ value: function setOptions(options, allOptions, globalOptions) {
+ if (allOptions !== undefined) {
+ if (allOptions.locale !== undefined) {
+ this.options.locale = allOptions.locale;
+ } else {
+ this.options.locale = globalOptions.locale;
+ }
+ if (allOptions.locales !== undefined) {
+ this.options.locales = allOptions.locales;
+ } else {
+ this.options.locales = globalOptions.locales;
+ }
+ }
+
+ if (options !== undefined) {
+ if (typeof options === 'boolean') {
+ this.options.enabled = options;
+ } else {
+ this.options.enabled = true;
+ util.deepExtend(this.options, options);
+ }
+ if (this.options.initiallyActive === true) {
+ this.editMode = true;
+ }
+ this._setup();
+ }
+ }
+ }, {
+ key: 'toggleEditMode',
+
+ /**
+ * Enable or disable edit-mode. Draws the DOM required and cleans up after itself.
+ *
+ * @private
+ */
+ value: function toggleEditMode() {
+ if (this.editMode === true) {
+ this.disableEditMode();
+ } else {
+ this.enableEditMode();
+ }
+ }
+ }, {
+ key: 'enableEditMode',
+ value: function enableEditMode() {
+ this.editMode = true;
+
+ this._clean();
+ if (this.guiEnabled === true) {
+ this.manipulationDiv.style.display = 'block';
+ this.closeDiv.style.display = 'block';
+ this.editModeDiv.style.display = 'none';
+ this.showManipulatorToolbar();
+ }
+ }
+ }, {
+ key: 'disableEditMode',
+ value: function disableEditMode() {
+ this.editMode = false;
+
+ this._clean();
+ if (this.guiEnabled === true) {
+ this.manipulationDiv.style.display = 'none';
+ this.closeDiv.style.display = 'none';
+ this.editModeDiv.style.display = 'block';
+ this._createEditButton();
+ }
+ }
+ }, {
+ key: 'showManipulatorToolbar',
+
+ /**
+ * Creates the main toolbar. Removes functions bound to the select event. Binds all the buttons of the toolbar.
+ *
+ * @private
+ */
+ value: function showManipulatorToolbar() {
+ // restore the state of any bound functions or events, remove control nodes, restore physics
+ this._clean();
+
+ // reset global letiables
+ this.manipulationDOM = {};
+
+ // if the gui is enabled, draw all elements.
+ if (this.guiEnabled === true) {
+ // a _restore will hide these menus
+ this.editMode = true;
+ this.manipulationDiv.style.display = 'block';
+ this.closeDiv.style.display = 'block';
+
+ var selectedNodeCount = this.selectionHandler._getSelectedNodeCount();
+ var selectedEdgeCount = this.selectionHandler._getSelectedEdgeCount();
+ var selectedTotalCount = selectedNodeCount + selectedEdgeCount;
+ var locale = this.options.locales[this.options.locale];
+ var needSeperator = false;
+
+ if (this.options.addNode !== false) {
+ this._createAddNodeButton(locale);
+ needSeperator = true;
+ }
+ if (this.options.addEdge !== false) {
+ if (needSeperator === true) {
+ this._createSeperator(1);
+ } else {
+ needSeperator = true;
+ }
+ this._createAddEdgeButton(locale);
+ }
+
+ if (selectedNodeCount === 1 && typeof this.options.editNode === 'function') {
+ if (needSeperator === true) {
+ this._createSeperator(2);
+ } else {
+ needSeperator = true;
+ }
+ this._createEditNodeButton(locale);
+ } else if (selectedEdgeCount === 1 && selectedNodeCount === 0 && this.options.editEdge !== false) {
+ if (needSeperator === true) {
+ this._createSeperator(3);
+ } else {
+ needSeperator = true;
+ }
+ this._createEditEdgeButton(locale);
+ }
+
+ // remove buttons
+ if (selectedTotalCount !== 0) {
+ if (selectedNodeCount > 0 && this.options.deleteNode !== false) {
+ if (needSeperator === true) {
+ this._createSeperator(4);
+ }
+ this._createDeleteButton(locale);
+ } else if (selectedNodeCount === 0 && this.options.deleteEdge !== false) {
+ if (needSeperator === true) {
+ this._createSeperator(4);
+ }
+ this._createDeleteButton(locale);
+ }
+ }
+
+ // bind the close button
+ this._bindHammerToDiv(this.closeDiv, this.toggleEditMode.bind(this));
+
+ // refresh this bar based on what has been selected
+ this._temporaryBindEvent('select', this.showManipulatorToolbar.bind(this));
+ }
+
+ // redraw to show any possible changes
+ this.body.emitter.emit('_redraw');
+ }
+ }, {
+ key: 'addNodeMode',
+
+ /**
+ * Create the toolbar for adding Nodes
+ *
+ * @private
+ */
+ value: function addNodeMode() {
+ // when using the gui, enable edit mode if it wasnt already.
+ if (this.editMode !== true) {
+ this.enableEditMode();
+ }
+
+ // restore the state of any bound functions or events, remove control nodes, restore physics
+ this._clean();
+
+ this.inMode = 'addNode';
+ if (this.guiEnabled === true) {
+ var locale = this.options.locales[this.options.locale];
+ this.manipulationDOM = {};
+ this._createBackButton(locale);
+ this._createSeperator();
+ this._createDescription(locale['addDescription'] || this.options.locales['en']['addDescription']);
+
+ // bind the close button
+ this._bindHammerToDiv(this.closeDiv, this.toggleEditMode.bind(this));
+ }
+
+ this._temporaryBindEvent('click', this._performAddNode.bind(this));
+ }
+ }, {
+ key: 'editNode',
+
+ /**
+ * call the bound function to handle the editing of the node. The node has to be selected.
+ *
+ * @private
+ */
+ value: function editNode() {
+ var _this2 = this;
+
+ // when using the gui, enable edit mode if it wasnt already.
+ if (this.editMode !== true) {
+ this.enableEditMode();
+ }
+
+ // restore the state of any bound functions or events, remove control nodes, restore physics
+ this._clean();
+ var node = this.selectionHandler._getSelectedNode();
+ if (node !== undefined) {
+ this.inMode = 'editNode';
+ if (typeof this.options.editNode === 'function') {
+ if (node.isCluster !== true) {
+ var data = util.deepExtend({}, node.options, true);
+ data.x = node.x;
+ data.y = node.y;
+
+ if (this.options.editNode.length === 2) {
+ this.options.editNode(data, function (finalizedData) {
+ if (finalizedData !== null && finalizedData !== undefined && _this2.inMode === 'editNode') {
+ // if for whatever reason the mode has changes (due to dataset change) disregard the callback) {
+ _this2.body.data.nodes.getDataSet().update(finalizedData);
+ }
+ _this2.showManipulatorToolbar();
+ });
+ } else {
+ throw new Error('The function for edit does not support two arguments (data, callback)');
+ }
+ } else {
+ alert(this.options.locales[this.options.locale]['editClusterError'] || this.options.locales['en']['editClusterError']);
+ }
+ } else {
+ throw new Error('No function has been configured to handle the editing of nodes.');
+ }
+ } else {
+ this.showManipulatorToolbar();
+ }
+ }
+ }, {
+ key: 'addEdgeMode',
+
+ /**
+ * create the toolbar to connect nodes
+ *
+ * @private
+ */
+ value: function addEdgeMode() {
+ // when using the gui, enable edit mode if it wasnt already.
+ if (this.editMode !== true) {
+ this.enableEditMode();
+ }
+
+ // restore the state of any bound functions or events, remove control nodes, restore physics
+ this._clean();
+
+ this.inMode = 'addEdge';
+ if (this.guiEnabled === true) {
+ var locale = this.options.locales[this.options.locale];
+ this.manipulationDOM = {};
+ this._createBackButton(locale);
+ this._createSeperator();
+ this._createDescription(locale['edgeDescription'] || this.options.locales['en']['edgeDescription']);
+
+ // bind the close button
+ this._bindHammerToDiv(this.closeDiv, this.toggleEditMode.bind(this));
+ }
+
+ // temporarily overload functions
+ this._temporaryBindUI('onTouch', this._handleConnect.bind(this));
+ this._temporaryBindUI('onDragEnd', this._finishConnect.bind(this));
+ this._temporaryBindUI('onDrag', this._dragControlNode.bind(this));
+ this._temporaryBindUI('onRelease', this._finishConnect.bind(this));
+
+ this._temporaryBindUI('onDragStart', function () {});
+ this._temporaryBindUI('onHold', function () {});
+ }
+ }, {
+ key: 'editEdgeMode',
+
+ /**
+ * create the toolbar to edit edges
+ *
+ * @private
+ */
+ value: function editEdgeMode() {
+ var _this3 = this;
+
+ // when using the gui, enable edit mode if it wasnt already.
+ if (this.editMode !== true) {
+ this.enableEditMode();
+ }
+
+ // restore the state of any bound functions or events, remove control nodes, restore physics
+ this._clean();
+
+ this.inMode = 'editEdge';
+ if (this.guiEnabled === true) {
+ var locale = this.options.locales[this.options.locale];
+ this.manipulationDOM = {};
+ this._createBackButton(locale);
+ this._createSeperator();
+ this._createDescription(locale['editEdgeDescription'] || this.options.locales['en']['editEdgeDescription']);
+
+ // bind the close button
+ this._bindHammerToDiv(this.closeDiv, this.toggleEditMode.bind(this));
+ }
+
+ this.edgeBeingEditedId = this.selectionHandler.getSelectedEdges()[0];
+ if (this.edgeBeingEditedId !== undefined) {
+ (function () {
+ var edge = _this3.body.edges[_this3.edgeBeingEditedId];
+
+ // create control nodes
+ var controlNodeFrom = _this3._getNewTargetNode(edge.from.x, edge.from.y);
+ var controlNodeTo = _this3._getNewTargetNode(edge.to.x, edge.to.y);
+
+ _this3.temporaryIds.nodes.push(controlNodeFrom.id);
+ _this3.temporaryIds.nodes.push(controlNodeTo.id);
+
+ _this3.body.nodes[controlNodeFrom.id] = controlNodeFrom;
+ _this3.body.nodeIndices.push(controlNodeFrom.id);
+ _this3.body.nodes[controlNodeTo.id] = controlNodeTo;
+ _this3.body.nodeIndices.push(controlNodeTo.id);
+
+ // temporarily overload UI functions, cleaned up automatically because of _temporaryBindUI
+ _this3._temporaryBindUI('onTouch', _this3._controlNodeTouch.bind(_this3)); // used to get the position
+ _this3._temporaryBindUI('onTap', function () {}); // disabled
+ _this3._temporaryBindUI('onHold', function () {}); // disabled
+ _this3._temporaryBindUI('onDragStart', _this3._controlNodeDragStart.bind(_this3)); // used to select control node
+ _this3._temporaryBindUI('onDrag', _this3._controlNodeDrag.bind(_this3)); // used to drag control node
+ _this3._temporaryBindUI('onDragEnd', _this3._controlNodeDragEnd.bind(_this3)); // used to connect or revert control nodes
+ _this3._temporaryBindUI('onMouseMove', function () {}); // disabled
+
+ // create function to position control nodes correctly on movement
+ // automatically cleaned up because we use the temporary bind
+ _this3._temporaryBindEvent('beforeDrawing', function (ctx) {
+ var positions = edge.edgeType.findBorderPositions(ctx);
+ if (controlNodeFrom.selected === false) {
+ controlNodeFrom.x = positions.from.x;
+ controlNodeFrom.y = positions.from.y;
+ }
+ if (controlNodeTo.selected === false) {
+ controlNodeTo.x = positions.to.x;
+ controlNodeTo.y = positions.to.y;
+ }
+ });
+
+ _this3.body.emitter.emit('_redraw');
+ })();
+ } else {
+ this.showManipulatorToolbar();
+ }
+ }
+ }, {
+ key: 'deleteSelected',
+
+ /**
+ * delete everything in the selection
+ *
+ * @private
+ */
+ value: function deleteSelected() {
+ var _this4 = this;
+
+ // when using the gui, enable edit mode if it wasnt already.
+ if (this.editMode !== true) {
+ this.enableEditMode();
+ }
+
+ // restore the state of any bound functions or events, remove control nodes, restore physics
+ this._clean();
+
+ this.inMode = 'delete';
+ var selectedNodes = this.selectionHandler.getSelectedNodes();
+ var selectedEdges = this.selectionHandler.getSelectedEdges();
+ var deleteFunction = undefined;
+ if (selectedNodes.length > 0) {
+ for (var i = 0; i < selectedNodes.length; i++) {
+ if (this.body.nodes[selectedNodes[i]].isCluster === true) {
+ alert(this.options.locales[this.options.locale]['deleteClusterError'] || this.options.locales['en']['deleteClusterError']);
+ return;
+ }
+ }
+
+ if (typeof this.options.deleteNode === 'function') {
+ deleteFunction = this.options.deleteNode;
+ }
+ } else if (selectedEdges.length > 0) {
+ if (typeof this.options.deleteEdge === 'function') {
+ deleteFunction = this.options.deleteEdge;
+ }
+ }
+
+ if (typeof deleteFunction === 'function') {
+ var data = { nodes: selectedNodes, edges: selectedEdges };
+ if (deleteFunction.length === 2) {
+ deleteFunction(data, function (finalizedData) {
+ if (finalizedData !== null && finalizedData !== undefined && _this4.inMode === 'delete') {
+ // if for whatever reason the mode has changes (due to dataset change) disregard the callback) {
+ _this4.body.data.edges.getDataSet().remove(finalizedData.edges);
+ _this4.body.data.nodes.getDataSet().remove(finalizedData.nodes);
+ _this4.body.emitter.emit('startSimulation');
+ _this4.showManipulatorToolbar();
+ } else {
+ _this4.body.emitter.emit('startSimulation');
+ _this4.showManipulatorToolbar();
+ }
+ });
+ } else {
+ throw new Error('The function for delete does not support two arguments (data, callback)');
+ }
+ } else {
+ this.body.data.edges.getDataSet().remove(selectedEdges);
+ this.body.data.nodes.getDataSet().remove(selectedNodes);
+ this.body.emitter.emit('startSimulation');
+ this.showManipulatorToolbar();
+ }
+ }
+ }, {
+ key: '_setup',
+
+ //********************************************** PRIVATE ***************************************//
+
+ /**
+ * draw or remove the DOM
+ * @private
+ */
+ value: function _setup() {
+ if (this.options.enabled === true) {
+ // Enable the GUI
+ this.guiEnabled = true;
+
+ this._createWrappers();
+ if (this.editMode === false) {
+ this._createEditButton();
+ } else {
+ this.showManipulatorToolbar();
+ }
+ } else {
+ this._removeManipulationDOM();
+
+ // disable the gui
+ this.guiEnabled = false;
+ }
+ }
+ }, {
+ key: '_createWrappers',
+
+ /**
+ * create the div overlays that contain the DOM
+ * @private
+ */
+ value: function _createWrappers() {
+ // load the manipulator HTML elements. All styling done in css.
+ if (this.manipulationDiv === undefined) {
+ this.manipulationDiv = document.createElement('div');
+ this.manipulationDiv.className = 'vis-manipulation';
+ if (this.editMode === true) {
+ this.manipulationDiv.style.display = 'block';
+ } else {
+ this.manipulationDiv.style.display = 'none';
+ }
+ this.canvas.frame.appendChild(this.manipulationDiv);
+ }
+
+ // container for the edit button.
+ if (this.editModeDiv === undefined) {
+ this.editModeDiv = document.createElement('div');
+ this.editModeDiv.className = 'vis-edit-mode';
+ if (this.editMode === true) {
+ this.editModeDiv.style.display = 'none';
+ } else {
+ this.editModeDiv.style.display = 'block';
+ }
+ this.canvas.frame.appendChild(this.editModeDiv);
+ }
+
+ // container for the close div button
+ if (this.closeDiv === undefined) {
+ this.closeDiv = document.createElement('div');
+ this.closeDiv.className = 'vis-close';
+ this.closeDiv.style.display = this.manipulationDiv.style.display;
+ this.canvas.frame.appendChild(this.closeDiv);
+ }
+ }
+ }, {
+ key: '_getNewTargetNode',
+
+ /**
+ * generate a new target node. Used for creating new edges and editing edges
+ * @param x
+ * @param y
+ * @returns {*}
+ * @private
+ */
+ value: function _getNewTargetNode(x, y) {
+ var controlNodeStyle = util.deepExtend({}, this.options.controlNodeStyle);
+
+ controlNodeStyle.id = 'targetNode' + util.randomUUID();
+ controlNodeStyle.hidden = false;
+ controlNodeStyle.physics = false;
+ controlNodeStyle.x = x;
+ controlNodeStyle.y = y;
+
+ return this.body.functions.createNode(controlNodeStyle);
+ }
+ }, {
+ key: '_createEditButton',
+
+ /**
+ * Create the edit button
+ */
+ value: function _createEditButton() {
+ // restore everything to it's original state (if applicable)
+ this._clean();
+
+ // reset the manipulationDOM
+ this.manipulationDOM = {};
+
+ // empty the editModeDiv
+ util.recursiveDOMDelete(this.editModeDiv);
+
+ // create the contents for the editMode button
+ var locale = this.options.locales[this.options.locale];
+ var button = this._createButton('editMode', 'vis-button vis-edit vis-edit-mode', locale['edit'] || this.options.locales['en']['edit']);
+ this.editModeDiv.appendChild(button);
+
+ // bind a hammer listener to the button, calling the function toggleEditMode.
+ this._bindHammerToDiv(button, this.toggleEditMode.bind(this));
+ }
+ }, {
+ key: '_clean',
+
+ /**
+ * this function cleans up after everything this module does. Temporary elements, functions and events are removed, physics restored, hammers removed.
+ * @private
+ */
+ value: function _clean() {
+ // not in mode
+ this.inMode = false;
+
+ // _clean the divs
+ if (this.guiEnabled === true) {
+ util.recursiveDOMDelete(this.editModeDiv);
+ util.recursiveDOMDelete(this.manipulationDiv);
+
+ // removes all the bindings and overloads
+ this._cleanManipulatorHammers();
+ }
+
+ // remove temporary nodes and edges
+ this._cleanupTemporaryNodesAndEdges();
+
+ // restore overloaded UI functions
+ this._unbindTemporaryUIs();
+
+ // remove the temporaryEventFunctions
+ this._unbindTemporaryEvents();
+
+ // restore the physics if required
+ this.body.emitter.emit('restorePhysics');
+ }
+ }, {
+ key: '_cleanManipulatorHammers',
+
+ /**
+ * Each dom element has it's own hammer. They are stored in this.manipulationHammers. This cleans them up.
+ * @private
+ */
+ value: function _cleanManipulatorHammers() {
+ // _clean hammer bindings
+ if (this.manipulationHammers.length != 0) {
+ for (var i = 0; i < this.manipulationHammers.length; i++) {
+ this.manipulationHammers[i].destroy();
+ }
+ this.manipulationHammers = [];
+ }
+ }
+ }, {
+ key: '_removeManipulationDOM',
+
+ /**
+ * Remove all DOM elements created by this module.
+ * @private
+ */
+ value: function _removeManipulationDOM() {
+ // removes all the bindings and overloads
+ this._clean();
+
+ // empty the manipulation divs
+ util.recursiveDOMDelete(this.manipulationDiv);
+ util.recursiveDOMDelete(this.editModeDiv);
+ util.recursiveDOMDelete(this.closeDiv);
+
+ // remove the manipulation divs
+ if (this.manipulationDiv) {
+ this.canvas.frame.removeChild(this.manipulationDiv);
+ }
+ if (this.editModeDiv) {
+ this.canvas.frame.removeChild(this.editModeDiv);
+ }
+ if (this.closeDiv) {
+ this.canvas.frame.removeChild(this.manipulationDiv);
+ }
+
+ // set the references to undefined
+ this.manipulationDiv = undefined;
+ this.editModeDiv = undefined;
+ this.closeDiv = undefined;
+ }
+ }, {
+ key: '_createSeperator',
+
+ /**
+ * create a seperator line. the index is to differentiate in the manipulation dom
+ * @param index
+ * @private
+ */
+ value: function _createSeperator() {
+ var index = arguments.length <= 0 || arguments[0] === undefined ? 1 : arguments[0];
+
+ this.manipulationDOM['seperatorLineDiv' + index] = document.createElement('div');
+ this.manipulationDOM['seperatorLineDiv' + index].className = 'vis-separator-line';
+ this.manipulationDiv.appendChild(this.manipulationDOM['seperatorLineDiv' + index]);
+ }
+ }, {
+ key: '_createAddNodeButton',
+
+ // ---------------------- DOM functions for buttons --------------------------//
+
+ value: function _createAddNodeButton(locale) {
+ var button = this._createButton('addNode', 'vis-button vis-add', locale['addNode'] || this.options.locales['en']['addNode']);
+ this.manipulationDiv.appendChild(button);
+ this._bindHammerToDiv(button, this.addNodeMode.bind(this));
+ }
+ }, {
+ key: '_createAddEdgeButton',
+ value: function _createAddEdgeButton(locale) {
+ var button = this._createButton('addEdge', 'vis-button vis-connect', locale['addEdge'] || this.options.locales['en']['addEdge']);
+ this.manipulationDiv.appendChild(button);
+ this._bindHammerToDiv(button, this.addEdgeMode.bind(this));
+ }
+ }, {
+ key: '_createEditNodeButton',
+ value: function _createEditNodeButton(locale) {
+ var button = this._createButton('editNode', 'vis-button vis-edit', locale['editNode'] || this.options.locales['en']['editNode']);
+ this.manipulationDiv.appendChild(button);
+ this._bindHammerToDiv(button, this.editNode.bind(this));
+ }
+ }, {
+ key: '_createEditEdgeButton',
+ value: function _createEditEdgeButton(locale) {
+ var button = this._createButton('editEdge', 'vis-button vis-edit', locale['editEdge'] || this.options.locales['en']['editEdge']);
+ this.manipulationDiv.appendChild(button);
+ this._bindHammerToDiv(button, this.editEdgeMode.bind(this));
+ }
+ }, {
+ key: '_createDeleteButton',
+ value: function _createDeleteButton(locale) {
+ var button = this._createButton('delete', 'vis-button vis-delete', locale['del'] || this.options.locales['en']['del']);
+ this.manipulationDiv.appendChild(button);
+ this._bindHammerToDiv(button, this.deleteSelected.bind(this));
+ }
+ }, {
+ key: '_createBackButton',
+ value: function _createBackButton(locale) {
+ var button = this._createButton('back', 'vis-button vis-back', locale['back'] || this.options.locales['en']['back']);
+ this.manipulationDiv.appendChild(button);
+ this._bindHammerToDiv(button, this.showManipulatorToolbar.bind(this));
+ }
+ }, {
+ key: '_createButton',
+ value: function _createButton(id, className, label) {
+ var labelClassName = arguments.length <= 3 || arguments[3] === undefined ? 'vis-label' : arguments[3];
+
+ this.manipulationDOM[id + 'Div'] = document.createElement('div');
+ this.manipulationDOM[id + 'Div'].className = className;
+ this.manipulationDOM[id + 'Label'] = document.createElement('div');
+ this.manipulationDOM[id + 'Label'].className = labelClassName;
+ this.manipulationDOM[id + 'Label'].innerHTML = label;
+ this.manipulationDOM[id + 'Div'].appendChild(this.manipulationDOM[id + 'Label']);
+ return this.manipulationDOM[id + 'Div'];
+ }
+ }, {
+ key: '_createDescription',
+ value: function _createDescription(label) {
+ this.manipulationDiv.appendChild(this._createButton('description', 'vis-button vis-none', label));
+ }
+ }, {
+ key: '_temporaryBindEvent',
+
+ // -------------------------- End of DOM functions for buttons ------------------------------//
+
+ /**
+ * this binds an event until cleanup by the clean functions.
+ * @param event
+ * @param newFunction
+ * @private
+ */
+ value: function _temporaryBindEvent(event, newFunction) {
+ this.temporaryEventFunctions.push({ event: event, boundFunction: newFunction });
+ this.body.emitter.on(event, newFunction);
+ }
+ }, {
+ key: '_temporaryBindUI',
+
+ /**
+ * this overrides an UI function until cleanup by the clean function
+ * @param UIfunctionName
+ * @param newFunction
+ * @private
+ */
+ value: function _temporaryBindUI(UIfunctionName, newFunction) {
+ if (this.body.eventListeners[UIfunctionName] !== undefined) {
+ this.temporaryUIFunctions[UIfunctionName] = this.body.eventListeners[UIfunctionName];
+ this.body.eventListeners[UIfunctionName] = newFunction;
+ } else {
+ throw new Error('This UI function does not exist. Typo? You tried: ' + UIfunctionName + ' possible are: ' + JSON.stringify(Object.keys(this.body.eventListeners)));
+ }
+ }
+ }, {
+ key: '_unbindTemporaryUIs',
+
+ /**
+ * Restore the overridden UI functions to their original state.
+ *
+ * @private
+ */
+ value: function _unbindTemporaryUIs() {
+ for (var functionName in this.temporaryUIFunctions) {
+ if (this.temporaryUIFunctions.hasOwnProperty(functionName)) {
+ this.body.eventListeners[functionName] = this.temporaryUIFunctions[functionName];
+ delete this.temporaryUIFunctions[functionName];
+ }
+ }
+ this.temporaryUIFunctions = {};
+ }
+ }, {
+ key: '_unbindTemporaryEvents',
+
+ /**
+ * Unbind the events created by _temporaryBindEvent
+ * @private
+ */
+ value: function _unbindTemporaryEvents() {
+ for (var i = 0; i < this.temporaryEventFunctions.length; i++) {
+ var eventName = this.temporaryEventFunctions[i].event;
+ var boundFunction = this.temporaryEventFunctions[i].boundFunction;
+ this.body.emitter.off(eventName, boundFunction);
+ }
+ this.temporaryEventFunctions = [];
+ }
+ }, {
+ key: '_bindHammerToDiv',
+
+ /**
+ * Bind an hammer instance to a DOM element.
+ * @param domElement
+ * @param funct
+ */
+ value: function _bindHammerToDiv(domElement, boundFunction) {
+ var hammer = new Hammer(domElement, {});
+ hammerUtil.onTouch(hammer, boundFunction);
+ this.manipulationHammers.push(hammer);
+ }
+ }, {
+ key: '_cleanupTemporaryNodesAndEdges',
+
+ /**
+ * Neatly clean up temporary edges and nodes
+ * @private
+ */
+ value: function _cleanupTemporaryNodesAndEdges() {
+ // _clean temporary edges
+ for (var i = 0; i < this.temporaryIds.edges.length; i++) {
+ this.body.edges[this.temporaryIds.edges[i]].disconnect();
+ delete this.body.edges[this.temporaryIds.edges[i]];
+ var indexTempEdge = this.body.edgeIndices.indexOf(this.temporaryIds.edges[i]);
+ if (indexTempEdge !== -1) {
+ this.body.edgeIndices.splice(indexTempEdge, 1);
+ }
+ }
+
+ // _clean temporary nodes
+ for (var i = 0; i < this.temporaryIds.nodes.length; i++) {
+ delete this.body.nodes[this.temporaryIds.nodes[i]];
+ var indexTempNode = this.body.nodeIndices.indexOf(this.temporaryIds.nodes[i]);
+ if (indexTempNode !== -1) {
+ this.body.nodeIndices.splice(indexTempNode, 1);
+ }
+ }
+
+ this.temporaryIds = { nodes: [], edges: [] };
+ }
+ }, {
+ key: '_controlNodeTouch',
+
+ // ------------------------------------------ EDIT EDGE FUNCTIONS -----------------------------------------//
+
+ /**
+ * the touch is used to get the position of the initial click
+ * @param event
+ * @private
+ */
+ value: function _controlNodeTouch(event) {
+ this.selectionHandler.unselectAll();
+ this.lastTouch = this.body.functions.getPointer(event.center);
+ this.lastTouch.translation = util.extend({}, this.body.view.translation); // copy the object
+ }
+ }, {
+ key: '_controlNodeDragStart',
+
+ /**
+ * the drag start is used to mark one of the control nodes as selected.
+ * @param event
+ * @private
+ */
+ value: function _controlNodeDragStart(event) {
+ var pointer = this.lastTouch;
+ var pointerObj = this.selectionHandler._pointerToPositionObject(pointer);
+ var from = this.body.nodes[this.temporaryIds.nodes[0]];
+ var to = this.body.nodes[this.temporaryIds.nodes[1]];
+ var edge = this.body.edges[this.edgeBeingEditedId];
+ this.selectedControlNode = undefined;
+
+ var fromSelect = from.isOverlappingWith(pointerObj);
+ var toSelect = to.isOverlappingWith(pointerObj);
+
+ if (fromSelect === true) {
+ this.selectedControlNode = from;
+ edge.edgeType.from = from;
+ } else if (toSelect === true) {
+ this.selectedControlNode = to;
+ edge.edgeType.to = to;
+ }
+
+ this.body.emitter.emit('_redraw');
+ }
+ }, {
+ key: '_controlNodeDrag',
+
+ /**
+ * dragging the control nodes or the canvas
+ * @param event
+ * @private
+ */
+ value: function _controlNodeDrag(event) {
+ this.body.emitter.emit('disablePhysics');
+ var pointer = this.body.functions.getPointer(event.center);
+ var pos = this.canvas.DOMtoCanvas(pointer);
+
+ if (this.selectedControlNode !== undefined) {
+ this.selectedControlNode.x = pos.x;
+ this.selectedControlNode.y = pos.y;
+ } else {
+ // if the drag was not started properly because the click started outside the network div, start it now.
+ var diffX = pointer.x - this.lastTouch.x;
+ var diffY = pointer.y - this.lastTouch.y;
+ this.body.view.translation = { x: this.lastTouch.translation.x + diffX, y: this.lastTouch.translation.y + diffY };
+ }
+ this.body.emitter.emit('_redraw');
+ }
+ }, {
+ key: '_controlNodeDragEnd',
+
+ /**
+ * connecting or restoring the control nodes.
+ * @param event
+ * @private
+ */
+ value: function _controlNodeDragEnd(event) {
+ var pointer = this.body.functions.getPointer(event.center);
+ var pointerObj = this.selectionHandler._pointerToPositionObject(pointer);
+ var edge = this.body.edges[this.edgeBeingEditedId];
+
+ // if the node that was dragged is not a control node, return
+ if (this.selectedControlNode === undefined) {
+ return;
+ }
+
+ var overlappingNodeIds = this.selectionHandler._getAllNodesOverlappingWith(pointerObj);
+ var node = undefined;
+ for (var i = overlappingNodeIds.length - 1; i >= 0; i--) {
+ if (overlappingNodeIds[i] !== this.selectedControlNode.id) {
+ node = this.body.nodes[overlappingNodeIds[i]];
+ break;
+ }
+ }
+
+ // perform the connection
+ if (node !== undefined && this.selectedControlNode !== undefined) {
+ if (node.isCluster === true) {
+ alert(this.options.locales[this.options.locale]['createEdgeError'] || this.options.locales['en']['createEdgeError']);
+ } else {
+ var from = this.body.nodes[this.temporaryIds.nodes[0]];
+ if (this.selectedControlNode.id === from.id) {
+ this._performEditEdge(node.id, edge.to.id);
+ } else {
+ this._performEditEdge(edge.from.id, node.id);
+ }
+ }
+ } else {
+ edge.updateEdgeType();
+ this.body.emitter.emit('restorePhysics');
+ }
+ this.body.emitter.emit('_redraw');
+ }
+ }, {
+ key: '_handleConnect',
+
+ // ------------------------------------ END OF EDIT EDGE FUNCTIONS -----------------------------------------//
+
+ // ------------------------------------------- ADD EDGE FUNCTIONS -----------------------------------------//
+ /**
+ * the function bound to the selection event. It checks if you want to connect a cluster and changes the description
+ * to walk the user through the process.
+ *
+ * @private
+ */
+ value: function _handleConnect(event) {
+ // check to avoid double fireing of this function.
+ if (new Date().valueOf() - this.touchTime > 100) {
+ this.lastTouch = this.body.functions.getPointer(event.center);
+ this.lastTouch.translation = util.extend({}, this.body.view.translation); // copy the object
+
+ var pointer = this.lastTouch;
+ var node = this.selectionHandler.getNodeAt(pointer);
+
+ if (node !== undefined) {
+ if (node.isCluster === true) {
+ alert(this.options.locales[this.options.locale]['createEdgeError'] || this.options.locales['en']['createEdgeError']);
+ } else {
+ // create a node the temporary line can look at
+ var targetNode = this._getNewTargetNode(node.x, node.y);
+ this.body.nodes[targetNode.id] = targetNode;
+ this.body.nodeIndices.push(targetNode.id);
+
+ // create a temporary edge
+ var connectionEdge = this.body.functions.createEdge({
+ id: 'connectionEdge' + util.randomUUID(),
+ from: node.id,
+ to: targetNode.id,
+ physics: false,
+ smooth: {
+ enabled: true,
+ type: 'continuous',
+ roundness: 0.5
+ }
+ });
+ this.body.edges[connectionEdge.id] = connectionEdge;
+ this.body.edgeIndices.push(connectionEdge.id);
+
+ this.temporaryIds.nodes.push(targetNode.id);
+ this.temporaryIds.edges.push(connectionEdge.id);
+ }
+ }
+ this.touchTime = new Date().valueOf();
+ }
+ }
+ }, {
+ key: '_dragControlNode',
+ value: function _dragControlNode(event) {
+ var pointer = this.body.functions.getPointer(event.center);
+ if (this.temporaryIds.nodes[0] !== undefined) {
+ var targetNode = this.body.nodes[this.temporaryIds.nodes[0]]; // there is only one temp node in the add edge mode.
+ targetNode.x = this.canvas._XconvertDOMtoCanvas(pointer.x);
+ targetNode.y = this.canvas._YconvertDOMtoCanvas(pointer.y);
+ this.body.emitter.emit('_redraw');
+ } else {
+ var diffX = pointer.x - this.lastTouch.x;
+ var diffY = pointer.y - this.lastTouch.y;
+ this.body.view.translation = { x: this.lastTouch.translation.x + diffX, y: this.lastTouch.translation.y + diffY };
+ }
+ }
+ }, {
+ key: '_finishConnect',
+
+ /**
+ * Connect the new edge to the target if one exists, otherwise remove temp line
+ * @param event
+ * @private
+ */
+ value: function _finishConnect(event) {
+ var pointer = this.body.functions.getPointer(event.center);
+ var pointerObj = this.selectionHandler._pointerToPositionObject(pointer);
+
+ // remember the edge id
+ var connectFromId = undefined;
+ if (this.temporaryIds.edges[0] !== undefined) {
+ connectFromId = this.body.edges[this.temporaryIds.edges[0]].fromId;
+ }
+
+ // get the overlapping node but NOT the temporary node;
+ var overlappingNodeIds = this.selectionHandler._getAllNodesOverlappingWith(pointerObj);
+ var node = undefined;
+ for (var i = overlappingNodeIds.length - 1; i >= 0; i--) {
+ // if the node id is NOT a temporary node, accept the node.
+ if (this.temporaryIds.nodes.indexOf(overlappingNodeIds[i]) === -1) {
+ node = this.body.nodes[overlappingNodeIds[i]];
+ break;
+ }
+ }
+
+ // clean temporary nodes and edges.
+ this._cleanupTemporaryNodesAndEdges();
+
+ // perform the connection
+ if (node !== undefined) {
+ if (node.isCluster === true) {
+ alert(this.options.locales[this.options.locale]['createEdgeError'] || this.options.locales['en']['createEdgeError']);
+ } else {
+ if (this.body.nodes[connectFromId] !== undefined && this.body.nodes[node.id] !== undefined) {
+ this._performAddEdge(connectFromId, node.id);
+ }
+ }
+ }
+ this.body.emitter.emit('_redraw');
+ }
+ }, {
+ key: '_performAddNode',
+
+ // --------------------------------------- END OF ADD EDGE FUNCTIONS -------------------------------------//
+
+ // ------------------------------ Performing all the actual data manipulation ------------------------//
+
+ /**
+ * Adds a node on the specified location
+ */
+ value: function _performAddNode(clickData) {
+ var _this5 = this;
+
+ var defaultData = {
+ id: util.randomUUID(),
+ x: clickData.pointer.canvas.x,
+ y: clickData.pointer.canvas.y,
+ label: 'new'
+ };
+
+ if (typeof this.options.addNode === 'function') {
+ if (this.options.addNode.length === 2) {
+ this.options.addNode(defaultData, function (finalizedData) {
+ if (finalizedData !== null && finalizedData !== undefined && _this5.inMode === 'addNode') {
+ // if for whatever reason the mode has changes (due to dataset change) disregard the callback
+ _this5.body.data.nodes.getDataSet().add(finalizedData);
+ _this5.showManipulatorToolbar();
+ }
+ });
+ } else {
+ throw new Error('The function for add does not support two arguments (data,callback)');
+ this.showManipulatorToolbar();
+ }
+ } else {
+ this.body.data.nodes.getDataSet().add(defaultData);
+ this.showManipulatorToolbar();
+ }
+ }
+ }, {
+ key: '_performAddEdge',
+
+ /**
+ * connect two nodes with a new edge.
+ *
+ * @private
+ */
+ value: function _performAddEdge(sourceNodeId, targetNodeId) {
+ var _this6 = this;
+
+ var defaultData = { from: sourceNodeId, to: targetNodeId };
+ if (typeof this.options.addEdge === 'function') {
+ if (this.options.addEdge.length === 2) {
+ this.options.addEdge(defaultData, function (finalizedData) {
+ if (finalizedData !== null && finalizedData !== undefined && _this6.inMode === 'addEdge') {
+ // if for whatever reason the mode has changes (due to dataset change) disregard the callback
+ _this6.body.data.edges.getDataSet().add(finalizedData);
+ _this6.selectionHandler.unselectAll();
+ _this6.showManipulatorToolbar();
+ }
+ });
+ } else {
+ throw new Error('The function for connect does not support two arguments (data,callback)');
+ }
+ } else {
+ this.body.data.edges.getDataSet().add(defaultData);
+ this.selectionHandler.unselectAll();
+ this.showManipulatorToolbar();
+ }
+ }
+ }, {
+ key: '_performEditEdge',
+
+ /**
+ * connect two nodes with a new edge.
+ *
+ * @private
+ */
+ value: function _performEditEdge(sourceNodeId, targetNodeId) {
+ var _this7 = this;
+
+ var defaultData = { id: this.edgeBeingEditedId, from: sourceNodeId, to: targetNodeId };
+ if (typeof this.options.editEdge === 'function') {
+ if (this.options.editEdge.length === 2) {
+ this.options.editEdge(defaultData, function (finalizedData) {
+ if (finalizedData === null || finalizedData === undefined || _this7.inMode !== 'editEdge') {
+ // if for whatever reason the mode has changes (due to dataset change) disregard the callback) {
+ _this7.body.edges[defaultData.id].updateEdgeType();
+ _this7.body.emitter.emit('_redraw');
+ } else {
+ _this7.body.data.edges.getDataSet().update(finalizedData);
+ _this7.selectionHandler.unselectAll();
+ _this7.showManipulatorToolbar();
+ }
+ });
+ } else {
+ throw new Error('The function for edit does not support two arguments (data, callback)');
+ }
+ } else {
+ this.body.data.edges.getDataSet().update(defaultData);
+ this.selectionHandler.unselectAll();
+ this.showManipulatorToolbar();
+ }
+ }
+ }]);
+
+ return ManipulationSystem;
+ })();
+
+ exports['default'] = ManipulationSystem;
+ module.exports = exports['default'];
+
+/***/ },
+/* 111 */
+/***/ function(module, exports) {
+
+ /**
+ * This object contains all possible options. It will check if the types are correct, if required if the option is one
+ * of the allowed values.
+ *
+ * __any__ means that the name of the property does not matter.
+ * __type__ is a required field for all objects and contains the allowed types of all objects
+ */
+ 'use strict';
+
+ Object.defineProperty(exports, '__esModule', {
+ value: true
+ });
+ var string = 'string';
+ var boolean = 'boolean';
+ var number = 'number';
+ var array = 'array';
+ var object = 'object'; // should only be in a __type__ property
+ var dom = 'dom';
+ var any = 'any';
+
+ var allOptions = {
+ configure: {
+ enabled: { boolean: boolean },
+ filter: { boolean: boolean, string: string, array: array, 'function': 'function' },
+ container: { dom: dom },
+ showButton: { boolean: boolean },
+ __type__: { object: object, boolean: boolean, string: string, array: array, 'function': 'function' }
+ },
+ edges: {
+ arrows: {
+ to: { enabled: { boolean: boolean }, scaleFactor: { number: number }, __type__: { object: object, boolean: boolean } },
+ middle: { enabled: { boolean: boolean }, scaleFactor: { number: number }, __type__: { object: object, boolean: boolean } },
+ from: { enabled: { boolean: boolean }, scaleFactor: { number: number }, __type__: { object: object, boolean: boolean } },
+ __type__: { string: ['from', 'to', 'middle'], object: object }
+ },
+ color: {
+ color: { string: string },
+ highlight: { string: string },
+ hover: { string: string },
+ inherit: { string: ['from', 'to', 'both'], boolean: boolean },
+ opacity: { number: number },
+ __type__: { object: object, string: string }
+ },
+ dashes: { boolean: boolean, array: array },
+ font: {
+ color: { string: string },
+ size: { number: number }, // px
+ face: { string: string },
+ background: { string: string },
+ strokeWidth: { number: number }, // px
+ strokeColor: { string: string },
+ align: { string: ['horizontal', 'top', 'middle', 'bottom'] },
+ __type__: { object: object, string: string }
+ },
+ hidden: { boolean: boolean },
+ hoverWidth: { 'function': 'function', number: number },
+ label: { string: string, 'undefined': 'undefined' },
+ labelHighlightBold: { boolean: boolean },
+ length: { number: number, 'undefined': 'undefined' },
+ physics: { boolean: boolean },
+ scaling: {
+ min: { number: number },
+ max: { number: number },
+ label: {
+ enabled: { boolean: boolean },
+ min: { number: number },
+ max: { number: number },
+ maxVisible: { number: number },
+ drawThreshold: { number: number },
+ __type__: { object: object, boolean: boolean }
+ },
+ customScalingFunction: { 'function': 'function' },
+ __type__: { object: object }
+ },
+ selectionWidth: { 'function': 'function', number: number },
+ selfReferenceSize: { number: number },
+ shadow: {
+ enabled: { boolean: boolean },
+ size: { number: number },
+ x: { number: number },
+ y: { number: number },
+ __type__: { object: object, boolean: boolean }
+ },
+ smooth: {
+ enabled: { boolean: boolean },
+ type: { string: ['dynamic', 'continuous', 'discrete', 'diagonalCross', 'straightCross', 'horizontal', 'vertical', 'curvedCW', 'curvedCCW', 'cubicBezier'] },
+ roundness: { number: number },
+ forceDirection: { string: ['horizontal', 'vertical', 'none'], boolean: boolean },
+ __type__: { object: object, boolean: boolean }
+ },
+ title: { string: string, 'undefined': 'undefined' },
+ width: { number: number },
+ value: { number: number, 'undefined': 'undefined' },
+ __type__: { object: object }
+ },
+ groups: {
+ useDefaultGroups: { boolean: boolean },
+ __any__: 'get from nodes, will be overwritten below',
+ __type__: { object: object }
+ },
+ interaction: {
+ dragNodes: { boolean: boolean },
+ dragView: { boolean: boolean },
+ hideEdgesOnDrag: { boolean: boolean },
+ hideNodesOnDrag: { boolean: boolean },
+ hover: { boolean: boolean },
+ keyboard: {
+ enabled: { boolean: boolean },
+ speed: { x: { number: number }, y: { number: number }, zoom: { number: number }, __type__: { object: object } },
+ bindToWindow: { boolean: boolean },
+ __type__: { object: object, boolean: boolean }
+ },
+ multiselect: { boolean: boolean },
+ navigationButtons: { boolean: boolean },
+ selectable: { boolean: boolean },
+ selectConnectedEdges: { boolean: boolean },
+ hoverConnectedEdges: { boolean: boolean },
+ tooltipDelay: { number: number },
+ zoomView: { boolean: boolean },
+ __type__: { object: object }
+ },
+ layout: {
+ randomSeed: { 'undefined': 'undefined', number: number },
+ improvedLayout: { boolean: boolean },
+ hierarchical: {
+ enabled: { boolean: boolean },
+ levelSeparation: { number: number },
+ direction: { string: ['UD', 'DU', 'LR', 'RL'] }, // UD, DU, LR, RL
+ sortMethod: { string: ['hubsize', 'directed'] }, // hubsize, directed
+ __type__: { object: object, boolean: boolean }
+ },
+ __type__: { object: object }
+ },
+ manipulation: {
+ enabled: { boolean: boolean },
+ initiallyActive: { boolean: boolean },
+ addNode: { boolean: boolean, 'function': 'function' },
+ addEdge: { boolean: boolean, 'function': 'function' },
+ editNode: { 'function': 'function' },
+ editEdge: { boolean: boolean, 'function': 'function' },
+ deleteNode: { boolean: boolean, 'function': 'function' },
+ deleteEdge: { boolean: boolean, 'function': 'function' },
+ controlNodeStyle: 'get from nodes, will be overwritten below',
+ __type__: { object: object, boolean: boolean }
+ },
+ nodes: {
+ borderWidth: { number: number },
+ borderWidthSelected: { number: number, 'undefined': 'undefined' },
+ brokenImage: { string: string, 'undefined': 'undefined' },
+ color: {
+ border: { string: string },
+ background: { string: string },
+ highlight: {
+ border: { string: string },
+ background: { string: string },
+ __type__: { object: object, string: string }
+ },
+ hover: {
+ border: { string: string },
+ background: { string: string },
+ __type__: { object: object, string: string }
+ },
+ __type__: { object: object, string: string }
+ },
+ fixed: {
+ x: { boolean: boolean },
+ y: { boolean: boolean },
+ __type__: { object: object, boolean: boolean }
+ },
+ font: {
+ color: { string: string },
+ size: { number: number }, // px
+ face: { string: string },
+ background: { string: string },
+ strokeWidth: { number: number }, // px
+ strokeColor: { string: string },
+ __type__: { object: object, string: string }
+ },
+ group: { string: string, number: number, 'undefined': 'undefined' },
+ hidden: { boolean: boolean },
+ icon: {
+ face: { string: string },
+ code: { string: string }, //'\uf007',
+ size: { number: number }, //50,
+ color: { string: string },
+ __type__: { object: object }
+ },
+ id: { string: string, number: number },
+ image: { string: string, 'undefined': 'undefined' }, // --> URL
+ label: { string: string, 'undefined': 'undefined' },
+ labelHighlightBold: { boolean: boolean },
+ level: { number: number, 'undefined': 'undefined' },
+ mass: { number: number },
+ physics: { boolean: boolean },
+ scaling: {
+ min: { number: number },
+ max: { number: number },
+ label: {
+ enabled: { boolean: boolean },
+ min: { number: number },
+ max: { number: number },
+ maxVisible: { number: number },
+ drawThreshold: { number: number },
+ __type__: { object: object, boolean: boolean }
+ },
+ customScalingFunction: { 'function': 'function' },
+ __type__: { object: object }
+ },
+ shadow: {
+ enabled: { boolean: boolean },
+ size: { number: number },
+ x: { number: number },
+ y: { number: number },
+ __type__: { object: object, boolean: boolean }
+ },
+ shape: { string: ['ellipse', 'circle', 'database', 'box', 'text', 'image', 'circularImage', 'diamond', 'dot', 'star', 'triangle', 'triangleDown', 'square', 'icon'] },
+ shapeProperties: {
+ borderDashes: { boolean: boolean, array: array },
+ borderRadius: { number: number },
+ useImageSize: { boolean: boolean },
+ useBorderWithImage: { boolean: boolean },
+ __type__: { object: object }
+ },
+ size: { number: number },
+ title: { string: string, 'undefined': 'undefined' },
+ value: { number: number, 'undefined': 'undefined' },
+ x: { number: number },
+ y: { number: number },
+ __type__: { object: object }
+ },
+ physics: {
+ enabled: { boolean: boolean },
+ barnesHut: {
+ gravitationalConstant: { number: number },
+ centralGravity: { number: number },
+ springLength: { number: number },
+ springConstant: { number: number },
+ damping: { number: number },
+ avoidOverlap: { number: number },
+ __type__: { object: object }
+ },
+ forceAtlas2Based: {
+ gravitationalConstant: { number: number },
+ centralGravity: { number: number },
+ springLength: { number: number },
+ springConstant: { number: number },
+ damping: { number: number },
+ avoidOverlap: { number: number },
+ __type__: { object: object }
+ },
+ repulsion: {
+ centralGravity: { number: number },
+ springLength: { number: number },
+ springConstant: { number: number },
+ nodeDistance: { number: number },
+ damping: { number: number },
+ __type__: { object: object }
+ },
+ hierarchicalRepulsion: {
+ centralGravity: { number: number },
+ springLength: { number: number },
+ springConstant: { number: number },
+ nodeDistance: { number: number },
+ damping: { number: number },
+ __type__: { object: object }
+ },
+ maxVelocity: { number: number },
+ minVelocity: { number: number }, // px/s
+ solver: { string: ['barnesHut', 'repulsion', 'hierarchicalRepulsion', 'forceAtlas2Based'] },
+ stabilization: {
+ enabled: { boolean: boolean },
+ iterations: { number: number }, // maximum number of iteration to stabilize
+ updateInterval: { number: number },
+ onlyDynamicEdges: { boolean: boolean },
+ fit: { boolean: boolean },
+ __type__: { object: object, boolean: boolean }
+ },
+ timestep: { number: number },
+ adaptiveTimestep: { boolean: boolean },
+ __type__: { object: object, boolean: boolean }
+ },
+
+ //globals :
+ autoResize: { boolean: boolean },
+ clickToUse: { boolean: boolean },
+ locale: { string: string },
+ locales: {
+ __any__: { any: any },
+ __type__: { object: object }
+ },
+ height: { string: string },
+ width: { string: string },
+ __type__: { object: object }
+ };
+
+ allOptions.groups.__any__ = allOptions.nodes;
+ allOptions.manipulation.controlNodeStyle = allOptions.nodes;
+
+ var configureOptions = {
+ nodes: {
+ borderWidth: [1, 0, 10, 1],
+ borderWidthSelected: [2, 0, 10, 1],
+ color: {
+ border: ['color', '#2B7CE9'],
+ background: ['color', '#97C2FC'],
+ highlight: {
+ border: ['color', '#2B7CE9'],
+ background: ['color', '#D2E5FF']
+ },
+ hover: {
+ border: ['color', '#2B7CE9'],
+ background: ['color', '#D2E5FF']
+ }
+ },
+ fixed: {
+ x: false,
+ y: false
+ },
+ font: {
+ color: ['color', '#343434'],
+ size: [14, 0, 100, 1], // px
+ face: ['arial', 'verdana', 'tahoma'],
+ background: ['color', 'none'],
+ strokeWidth: [0, 0, 50, 1], // px
+ strokeColor: ['color', '#ffffff']
+ },
+ //group: 'string',
+ hidden: false,
+ labelHighlightBold: true,
+ //icon: {
+ // face: 'string', //'FontAwesome',
+ // code: 'string', //'\uf007',
+ // size: [50, 0, 200, 1], //50,
+ // color: ['color','#2B7CE9'] //'#aa00ff'
+ //},
+ //image: 'string', // --> URL
+ physics: true,
+ scaling: {
+ min: [10, 0, 200, 1],
+ max: [30, 0, 200, 1],
+ label: {
+ enabled: false,
+ min: [14, 0, 200, 1],
+ max: [30, 0, 200, 1],
+ maxVisible: [30, 0, 200, 1],
+ drawThreshold: [5, 0, 20, 1]
+ }
+ },
+ shadow: {
+ enabled: false,
+ size: [10, 0, 20, 1],
+ x: [5, -30, 30, 1],
+ y: [5, -30, 30, 1]
+ },
+ shape: ['ellipse', 'box', 'circle', 'database', 'diamond', 'dot', 'square', 'star', 'text', 'triangle', 'triangleDown'],
+ shapeProperties: {
+ borderDashes: false,
+ borderRadius: [6, 0, 20, 1],
+ useImageSize: false
+ },
+ size: [25, 0, 200, 1]
+ },
+ edges: {
+ arrows: {
+ to: { enabled: false, scaleFactor: [1, 0, 3, 0.05] }, // boolean / {arrowScaleFactor:1} / {enabled: false, arrowScaleFactor:1}
+ middle: { enabled: false, scaleFactor: [1, 0, 3, 0.05] },
+ from: { enabled: false, scaleFactor: [1, 0, 3, 0.05] }
+ },
+ color: {
+ color: ['color', '#848484'],
+ highlight: ['color', '#848484'],
+ hover: ['color', '#848484'],
+ inherit: ['from', 'to', 'both', true, false],
+ opacity: [1, 0, 1, 0.05]
+ },
+ dashes: false,
+ font: {
+ color: ['color', '#343434'],
+ size: [14, 0, 100, 1], // px
+ face: ['arial', 'verdana', 'tahoma'],
+ background: ['color', 'none'],
+ strokeWidth: [2, 0, 50, 1], // px
+ strokeColor: ['color', '#ffffff'],
+ align: ['horizontal', 'top', 'middle', 'bottom']
+ },
+ hidden: false,
+ hoverWidth: [1.5, 0, 5, 0.1],
+ labelHighlightBold: true,
+ physics: true,
+ scaling: {
+ min: [1, 0, 100, 1],
+ max: [15, 0, 100, 1],
+ label: {
+ enabled: true,
+ min: [14, 0, 200, 1],
+ max: [30, 0, 200, 1],
+ maxVisible: [30, 0, 200, 1],
+ drawThreshold: [5, 0, 20, 1]
+ }
+ },
+ selectionWidth: [1.5, 0, 5, 0.1],
+ selfReferenceSize: [20, 0, 200, 1],
+ shadow: {
+ enabled: false,
+ size: [10, 0, 20, 1],
+ x: [5, -30, 30, 1],
+ y: [5, -30, 30, 1]
+ },
+ smooth: {
+ enabled: true,
+ type: ['dynamic', 'continuous', 'discrete', 'diagonalCross', 'straightCross', 'horizontal', 'vertical', 'curvedCW', 'curvedCCW', 'cubicBezier'],
+ forceDirection: ['horizontal', 'vertical', 'none'],
+ roundness: [0.5, 0, 1, 0.05]
+ },
+ width: [1, 0, 30, 1]
+ },
+ layout: {
+ //randomSeed: [0, 0, 500, 1],
+ //improvedLayout: true,
+ hierarchical: {
+ enabled: false,
+ levelSeparation: [150, 20, 500, 5],
+ direction: ['UD', 'DU', 'LR', 'RL'], // UD, DU, LR, RL
+ sortMethod: ['hubsize', 'directed'] // hubsize, directed
+ }
+ },
+ interaction: {
+ dragNodes: true,
+ dragView: true,
+ hideEdgesOnDrag: false,
+ hideNodesOnDrag: false,
+ hover: false,
+ keyboard: {
+ enabled: false,
+ speed: { x: [10, 0, 40, 1], y: [10, 0, 40, 1], zoom: [0.02, 0, 0.1, 0.005] },
+ bindToWindow: true
+ },
+ multiselect: false,
+ navigationButtons: false,
+ selectable: true,
+ selectConnectedEdges: true,
+ hoverConnectedEdges: true,
+ tooltipDelay: [300, 0, 1000, 25],
+ zoomView: true
+ },
+ manipulation: {
+ enabled: false,
+ initiallyActive: false
+ },
+ physics: {
+ enabled: true,
+ barnesHut: {
+ //theta: [0.5, 0.1, 1, 0.05],
+ gravitationalConstant: [-2000, -30000, 0, 50],
+ centralGravity: [0.3, 0, 10, 0.05],
+ springLength: [95, 0, 500, 5],
+ springConstant: [0.04, 0, 1.2, 0.005],
+ damping: [0.09, 0, 1, 0.01],
+ avoidOverlap: [0, 0, 1, 0.01]
+ },
+ forceAtlas2Based: {
+ //theta: [0.5, 0.1, 1, 0.05],
+ gravitationalConstant: [-50, -500, 0, 1],
+ centralGravity: [0.01, 0, 1, 0.005],
+ springLength: [95, 0, 500, 5],
+ springConstant: [0.08, 0, 1.2, 0.005],
+ damping: [0.4, 0, 1, 0.01],
+ avoidOverlap: [0, 0, 1, 0.01]
+ },
+ repulsion: {
+ centralGravity: [0.2, 0, 10, 0.05],
+ springLength: [200, 0, 500, 5],
+ springConstant: [0.05, 0, 1.2, 0.005],
+ nodeDistance: [100, 0, 500, 5],
+ damping: [0.09, 0, 1, 0.01]
+ },
+ hierarchicalRepulsion: {
+ centralGravity: [0.2, 0, 10, 0.05],
+ springLength: [100, 0, 500, 5],
+ springConstant: [0.01, 0, 1.2, 0.005],
+ nodeDistance: [120, 0, 500, 5],
+ damping: [0.09, 0, 1, 0.01]
+ },
+ maxVelocity: [50, 0, 150, 1],
+ minVelocity: [0.1, 0.01, 0.5, 0.01],
+ solver: ['barnesHut', 'forceAtlas2Based', 'repulsion', 'hierarchicalRepulsion'],
+ timestep: [0.5, 0.01, 1, 0.01]
+ },
+ global: {
+ locale: ['en', 'nl']
+ }
+ };
+
+ exports.allOptions = allOptions;
+ exports.configureOptions = configureOptions;
+ //adaptiveTimestep: true
+
+/***/ },
+/* 112 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Created by Alex on 8/7/2015.
+ */
+
+ // distance finding algorithm
+ "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; }; })();
+
+ 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 _componentsAlgorithmsFloydWarshallJs = __webpack_require__(113);
+
+ var _componentsAlgorithmsFloydWarshallJs2 = _interopRequireDefault(_componentsAlgorithmsFloydWarshallJs);
+
+ /**
+ * KamadaKawai positions the nodes initially based on
+ *
+ * "AN ALGORITHM FOR DRAWING GENERAL UNDIRECTED GRAPHS"
+ * -- Tomihisa KAMADA and Satoru KAWAI in 1989
+ *
+ * Possible optimizations in the distance calculation can be implemented.
+ */
+
+ var KamadaKawai = (function () {
+ function KamadaKawai(body, edgeLength, edgeStrength) {
+ _classCallCheck(this, KamadaKawai);
+
+ this.body = body;
+ this.springLength = edgeLength;
+ this.springConstant = edgeStrength;
+ this.distanceSolver = new _componentsAlgorithmsFloydWarshallJs2["default"]();
+ }
+
+ _createClass(KamadaKawai, [{
+ key: "setOptions",
+
+ /**
+ * Not sure if needed but can be used to update the spring length and spring constant
+ * @param options
+ */
+ value: function setOptions(options) {
+ if (options) {
+ if (options.springLength) {
+ this.springLength = options.springLength;
+ }
+ if (options.springConstant) {
+ this.springConstant = options.springConstant;
+ }
+ }
+ }
+ }, {
+ key: "solve",
+
+ /**
+ * Position the system
+ * @param nodesArray
+ * @param edgesArray
+ */
+ value: function solve(nodesArray, edgesArray) {
+ var ignoreClusters = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+
+ // get distance matrix
+ var D_matrix = this.distanceSolver.getDistances(this.body, nodesArray, edgesArray); // distance matrix
+
+ // get the L Matrix
+ this._createL_matrix(D_matrix);
+
+ // get the K Matrix
+ this._createK_matrix(D_matrix);
+
+ // calculate positions
+ var threshold = 0.01;
+ var innerThreshold = 1;
+ var iterations = 0;
+ var maxIterations = Math.max(1000, Math.min(10 * this.body.nodeIndices.length, 6000));
+ var maxInnerIterations = 5;
+
+ var maxEnergy = 1e9;
+ var highE_nodeId = 0,
+ dE_dx = 0,
+ dE_dy = 0,
+ delta_m = 0,
+ subIterations = 0;
+
+ while (maxEnergy > threshold && iterations < maxIterations) {
+ iterations += 1;
+
+ var _getHighestEnergyNode2 = this._getHighestEnergyNode(ignoreClusters);
+
+ var _getHighestEnergyNode22 = _slicedToArray(_getHighestEnergyNode2, 4);
+
+ highE_nodeId = _getHighestEnergyNode22[0];
+ maxEnergy = _getHighestEnergyNode22[1];
+ dE_dx = _getHighestEnergyNode22[2];
+ dE_dy = _getHighestEnergyNode22[3];
+
+ delta_m = maxEnergy;
+ subIterations = 0;
+ while (delta_m > innerThreshold && subIterations < maxInnerIterations) {
+ subIterations += 1;
+ this._moveNode(highE_nodeId, dE_dx, dE_dy);
+
+ var _getEnergy2 = this._getEnergy(highE_nodeId);
+
+ var _getEnergy22 = _slicedToArray(_getEnergy2, 3);
+
+ delta_m = _getEnergy22[0];
+ dE_dx = _getEnergy22[1];
+ dE_dy = _getEnergy22[2];
+ }
+ }
+ }
+ }, {
+ key: "_getHighestEnergyNode",
+
+ /**
+ * get the node with the highest energy
+ * @returns {*[]}
+ * @private
+ */
+ value: function _getHighestEnergyNode(ignoreClusters) {
+ var nodesArray = this.body.nodeIndices;
+ var nodes = this.body.nodes;
+ var maxEnergy = 0;
+ var maxEnergyNodeId = nodesArray[0];
+ var dE_dx_max = 0,
+ dE_dy_max = 0;
+
+ for (var nodeIdx = 0; nodeIdx < nodesArray.length; nodeIdx++) {
+ var m = nodesArray[nodeIdx];
+ // by not evaluating nodes with predefined positions we should only move nodes that have no positions.
+ if (nodes[m].predefinedPosition === false || nodes[m].isCluster === true && ignoreClusters === true || nodes[m].options.fixed.x === true || nodes[m].options.fixed.y === true) {
+ var _getEnergy3 = this._getEnergy(m);
+
+ var _getEnergy32 = _slicedToArray(_getEnergy3, 3);
+
+ var delta_m = _getEnergy32[0];
+ var dE_dx = _getEnergy32[1];
+ var dE_dy = _getEnergy32[2];
+
+ if (maxEnergy < delta_m) {
+ maxEnergy = delta_m;
+ maxEnergyNodeId = m;
+ dE_dx_max = dE_dx;
+ dE_dy_max = dE_dy;
+ }
+ }
+ }
+
+ return [maxEnergyNodeId, maxEnergy, dE_dx_max, dE_dy_max];
+ }
+ }, {
+ key: "_getEnergy",
+
+ /**
+ * calculate the energy of a single node
+ * @param m
+ * @returns {*[]}
+ * @private
+ */
+ value: function _getEnergy(m) {
+ var nodesArray = this.body.nodeIndices;
+ var nodes = this.body.nodes;
+
+ var x_m = nodes[m].x;
+ var y_m = nodes[m].y;
+ var dE_dx = 0;
+ var dE_dy = 0;
+ for (var iIdx = 0; iIdx < nodesArray.length; iIdx++) {
+ var i = nodesArray[iIdx];
+ if (i !== m) {
+ var x_i = nodes[i].x;
+ var y_i = nodes[i].y;
+ var denominator = 1.0 / Math.sqrt(Math.pow(x_m - x_i, 2) + Math.pow(y_m - y_i, 2));
+ dE_dx += this.K_matrix[m][i] * (x_m - x_i - this.L_matrix[m][i] * (x_m - x_i) * denominator);
+ dE_dy += this.K_matrix[m][i] * (y_m - y_i - this.L_matrix[m][i] * (y_m - y_i) * denominator);
+ }
+ }
+
+ var delta_m = Math.sqrt(Math.pow(dE_dx, 2) + Math.pow(dE_dy, 2));
+ return [delta_m, dE_dx, dE_dy];
+ }
+ }, {
+ key: "_moveNode",
+
+ /**
+ * move the node based on it's energy
+ * the dx and dy are calculated from the linear system proposed by Kamada and Kawai
+ * @param m
+ * @param dE_dx
+ * @param dE_dy
+ * @private
+ */
+ value: function _moveNode(m, dE_dx, dE_dy) {
+ var nodesArray = this.body.nodeIndices;
+ var nodes = this.body.nodes;
+ var d2E_dx2 = 0;
+ var d2E_dxdy = 0;
+ var d2E_dy2 = 0;
+
+ var x_m = nodes[m].x;
+ var y_m = nodes[m].y;
+ for (var iIdx = 0; iIdx < nodesArray.length; iIdx++) {
+ var i = nodesArray[iIdx];
+ if (i !== m) {
+ var x_i = nodes[i].x;
+ var y_i = nodes[i].y;
+ var denominator = 1.0 / Math.pow(Math.pow(x_m - x_i, 2) + Math.pow(y_m - y_i, 2), 1.5);
+ d2E_dx2 += this.K_matrix[m][i] * (1 - this.L_matrix[m][i] * Math.pow(y_m - y_i, 2) * denominator);
+ d2E_dxdy += this.K_matrix[m][i] * (this.L_matrix[m][i] * (x_m - x_i) * (y_m - y_i) * denominator);
+ d2E_dy2 += this.K_matrix[m][i] * (1 - this.L_matrix[m][i] * Math.pow(x_m - x_i, 2) * denominator);
+ }
+ }
+ // make the variable names easier to make the solving of the linear system easier to read
+ var A = d2E_dx2,
+ B = d2E_dxdy,
+ C = dE_dx,
+ D = d2E_dy2,
+ E = dE_dy;
+
+ // solve the linear system for dx and dy
+ var dy = (C / A + E / B) / (B / A - D / B);
+ var dx = -(B * dy + C) / A;
+
+ // move the node
+ nodes[m].x += dx;
+ nodes[m].y += dy;
+ }
+ }, {
+ key: "_createL_matrix",
+
+ /**
+ * Create the L matrix: edge length times shortest path
+ * @param D_matrix
+ * @private
+ */
+ value: function _createL_matrix(D_matrix) {
+ var nodesArray = this.body.nodeIndices;
+ var edgeLength = this.springLength;
+
+ this.L_matrix = [];
+ for (var i = 0; i < nodesArray.length; i++) {
+ this.L_matrix[nodesArray[i]] = {};
+ for (var j = 0; j < nodesArray.length; j++) {
+ this.L_matrix[nodesArray[i]][nodesArray[j]] = edgeLength * D_matrix[nodesArray[i]][nodesArray[j]];
+ }
+ }
+ }
+ }, {
+ key: "_createK_matrix",
+
+ /**
+ * Create the K matrix: spring constants times shortest path
+ * @param D_matrix
+ * @private
+ */
+ value: function _createK_matrix(D_matrix) {
+ var nodesArray = this.body.nodeIndices;
+ var edgeStrength = this.springConstant;
+
+ this.K_matrix = [];
+ for (var i = 0; i < nodesArray.length; i++) {
+ this.K_matrix[nodesArray[i]] = {};
+ for (var j = 0; j < nodesArray.length; j++) {
+ this.K_matrix[nodesArray[i]][nodesArray[j]] = edgeStrength * Math.pow(D_matrix[nodesArray[i]][nodesArray[j]], -2);
+ }
+ }
+ }
+ }]);
+
+ return KamadaKawai;
+ })();
+
+ exports["default"] = KamadaKawai;
+ module.exports = exports["default"];
+
+/***/ },
+/* 113 */
+/***/ function(module, exports) {
+
+ /**
+ * Created by Alex on 10-Aug-15.
+ */
+
+ "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 FloydWarshall = (function () {
+ function FloydWarshall() {
+ _classCallCheck(this, FloydWarshall);
+ }
+
+ _createClass(FloydWarshall, [{
+ key: "getDistances",
+ value: function getDistances(body, nodesArray, edgesArray) {
+ var D_matrix = {};
+ var edges = body.edges;
+
+ // prepare matrix with large numbers
+ for (var i = 0; i < nodesArray.length; i++) {
+ D_matrix[nodesArray[i]] = {};
+ D_matrix[nodesArray[i]] = {};
+ for (var j = 0; j < nodesArray.length; j++) {
+ D_matrix[nodesArray[i]][nodesArray[j]] = i == j ? 0 : 1e9;
+ D_matrix[nodesArray[i]][nodesArray[j]] = i == j ? 0 : 1e9;
+ }
+ }
+
+ // put the weights for the edges in. This assumes unidirectionality.
+ for (var i = 0; i < edgesArray.length; i++) {
+ var edge = edges[edgesArray[i]];
+ if (edge.connected === true) {
+ // edge has to be connected if it counts to the distances.
+ D_matrix[edge.fromId][edge.toId] = 1;
+ D_matrix[edge.toId][edge.fromId] = 1;
+ }
+ }
+
+ var nodeCount = nodesArray.length;
+
+ // Adapted FloydWarshall based on unidirectionality to greatly reduce complexity.
+ for (var k = 0; k < nodeCount; k++) {
+ for (var i = 0; i < nodeCount - 1; i++) {
+ for (var j = i + 1; j < nodeCount; j++) {
+ D_matrix[nodesArray[i]][nodesArray[j]] = Math.min(D_matrix[nodesArray[i]][nodesArray[j]], D_matrix[nodesArray[i]][nodesArray[k]] + D_matrix[nodesArray[k]][nodesArray[j]]);
+ D_matrix[nodesArray[j]][nodesArray[i]] = D_matrix[nodesArray[i]][nodesArray[j]];
+ }
+ }
+ }
+
+ return D_matrix;
+ }
+ }]);
+
+ return FloydWarshall;
+ })();
+
+ exports["default"] = FloydWarshall;
+ module.exports = exports["default"];
+
+/***/ },
+/* 114 */
+/***/ function(module, exports) {
+
+ /**
+ * Canvas shapes used by Network
+ */
+ 'use strict';
+
+ if (typeof CanvasRenderingContext2D !== 'undefined') {
+
+ /**
+ * Draw a circle shape
+ */
+ CanvasRenderingContext2D.prototype.circle = function (x, y, r) {
+ this.beginPath();
+ this.arc(x, y, r, 0, 2 * Math.PI, false);
+ this.closePath();
+ };
+
+ /**
+ * Draw a square shape
+ * @param {Number} x horizontal center
+ * @param {Number} y vertical center
+ * @param {Number} r size, width and height of the square
+ */
+ CanvasRenderingContext2D.prototype.square = function (x, y, r) {
+ this.beginPath();
+ this.rect(x - r, y - r, r * 2, r * 2);
+ this.closePath();
+ };
+
+ /**
+ * Draw a triangle shape
+ * @param {Number} x horizontal center
+ * @param {Number} y vertical center
+ * @param {Number} r radius, half the length of the sides of the triangle
+ */
+ CanvasRenderingContext2D.prototype.triangle = function (x, y, r) {
+ // http://en.wikipedia.org/wiki/Equilateral_triangle
+ this.beginPath();
+
+ // the change in radius and the offset is here to center the shape
+ r *= 1.15;
+ y += 0.275 * r;
+
+ var s = r * 2;
+ var s2 = s / 2;
+ var ir = Math.sqrt(3) / 6 * s; // radius of inner circle
+ var h = Math.sqrt(s * s - s2 * s2); // height
+
+ this.moveTo(x, y - (h - ir));
+ this.lineTo(x + s2, y + ir);
+ this.lineTo(x - s2, y + ir);
+ this.lineTo(x, y - (h - ir));
+ this.closePath();
+ };
+
+ /**
+ * Draw a triangle shape in downward orientation
+ * @param {Number} x horizontal center
+ * @param {Number} y vertical center
+ * @param {Number} r radius
+ */
+ CanvasRenderingContext2D.prototype.triangleDown = function (x, y, r) {
+ // http://en.wikipedia.org/wiki/Equilateral_triangle
+ this.beginPath();
+
+ // the change in radius and the offset is here to center the shape
+ r *= 1.15;
+ y -= 0.275 * r;
+
+ var s = r * 2;
+ var s2 = s / 2;
+ var ir = Math.sqrt(3) / 6 * s; // radius of inner circle
+ var h = Math.sqrt(s * s - s2 * s2); // height
+
+ this.moveTo(x, y + (h - ir));
+ this.lineTo(x + s2, y - ir);
+ this.lineTo(x - s2, y - ir);
+ this.lineTo(x, y + (h - ir));
+ this.closePath();
+ };
+
+ /**
+ * Draw a star shape, a star with 5 points
+ * @param {Number} x horizontal center
+ * @param {Number} y vertical center
+ * @param {Number} r radius, half the length of the sides of the triangle
+ */
+ CanvasRenderingContext2D.prototype.star = function (x, y, r) {
+ // http://www.html5canvastutorials.com/labs/html5-canvas-star-spinner/
+ this.beginPath();
+
+ // the change in radius and the offset is here to center the shape
+ r *= 0.82;
+ y += 0.1 * r;
+
+ for (var n = 0; n < 10; n++) {
+ var radius = n % 2 === 0 ? r * 1.3 : r * 0.5;
+ this.lineTo(x + radius * Math.sin(n * 2 * Math.PI / 10), y - radius * Math.cos(n * 2 * Math.PI / 10));
+ }
+
+ this.closePath();
+ };
+
+ /**
+ * Draw a Diamond shape
+ * @param {Number} x horizontal center
+ * @param {Number} y vertical center
+ * @param {Number} r radius, half the length of the sides of the triangle
+ */
+ CanvasRenderingContext2D.prototype.diamond = function (x, y, r) {
+ // http://www.html5canvastutorials.com/labs/html5-canvas-star-spinner/
+ this.beginPath();
+
+ this.lineTo(x, y + r);
+ this.lineTo(x + r, y);
+ this.lineTo(x, y - r);
+ this.lineTo(x - r, y);
+
+ this.closePath();
+ };
+
+ /**
+ * http://stackoverflow.com/questions/1255512/how-to-draw-a-rounded-rectangle-on-html-canvas
+ */
+ CanvasRenderingContext2D.prototype.roundRect = function (x, y, w, h, r) {
+ var r2d = Math.PI / 180;
+ if (w - 2 * r < 0) {
+ r = w / 2;
+ } //ensure that the radius isn't too large for x
+ if (h - 2 * r < 0) {
+ r = h / 2;
+ } //ensure that the radius isn't too large for y
+ this.beginPath();
+ this.moveTo(x + r, y);
+ this.lineTo(x + w - r, y);
+ this.arc(x + w - r, y + r, r, r2d * 270, r2d * 360, false);
+ this.lineTo(x + w, y + h - r);
+ this.arc(x + w - r, y + h - r, r, 0, r2d * 90, false);
+ this.lineTo(x + r, y + h);
+ this.arc(x + r, y + h - r, r, r2d * 90, r2d * 180, false);
+ this.lineTo(x, y + r);
+ this.arc(x + r, y + r, r, r2d * 180, r2d * 270, false);
+ this.closePath();
+ };
+
+ /**
+ * http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
+ */
+ CanvasRenderingContext2D.prototype.ellipse = function (x, y, w, h) {
+ var kappa = .5522848,
+ ox = w / 2 * kappa,
+ // control point offset horizontal
+ oy = h / 2 * kappa,
+ // control point offset vertical
+ xe = x + w,
+ // x-end
+ ye = y + h,
+ // y-end
+ xm = x + w / 2,
+ // x-middle
+ ym = y + h / 2; // y-middle
+
+ this.beginPath();
+ this.moveTo(x, ym);
+ this.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
+ this.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
+ this.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
+ this.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
+ this.closePath();
+ };
+
+ /**
+ * http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
+ */
+ CanvasRenderingContext2D.prototype.database = function (x, y, w, h) {
+ var f = 1 / 3;
+ var wEllipse = w;
+ var hEllipse = h * f;
+
+ var kappa = .5522848,
+ ox = wEllipse / 2 * kappa,
+ // control point offset horizontal
+ oy = hEllipse / 2 * kappa,
+ // control point offset vertical
+ xe = x + wEllipse,
+ // x-end
+ ye = y + hEllipse,
+ // y-end
+ xm = x + wEllipse / 2,
+ // x-middle
+ ym = y + hEllipse / 2,
+ // y-middle
+ ymb = y + (h - hEllipse / 2),
+ // y-midlle, bottom ellipse
+ yeb = y + h; // y-end, bottom ellipse
+
+ this.beginPath();
+ this.moveTo(xe, ym);
+
+ this.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
+ this.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
+
+ this.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
+ this.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
+
+ this.lineTo(xe, ymb);
+
+ this.bezierCurveTo(xe, ymb + oy, xm + ox, yeb, xm, yeb);
+ this.bezierCurveTo(xm - ox, yeb, x, ymb + oy, x, ymb);
+
+ this.lineTo(x, ym);
+ };
+
+ /**
+ * Draw an arrow point (no line)
+ */
+ CanvasRenderingContext2D.prototype.arrow = function (x, y, angle, length) {
+ // tail
+ var xt = x - length * Math.cos(angle);
+ var yt = y - length * Math.sin(angle);
+
+ // inner tail
+ var xi = x - length * 0.9 * Math.cos(angle);
+ var yi = y - length * 0.9 * Math.sin(angle);
+
+ // left
+ var xl = xt + length / 3 * Math.cos(angle + 0.5 * Math.PI);
+ var yl = yt + length / 3 * Math.sin(angle + 0.5 * Math.PI);
+
+ // right
+ var xr = xt + length / 3 * Math.cos(angle - 0.5 * Math.PI);
+ var yr = yt + length / 3 * Math.sin(angle - 0.5 * Math.PI);
+
+ this.beginPath();
+ this.moveTo(x, y);
+ this.lineTo(xl, yl);
+ this.lineTo(xi, yi);
+ this.lineTo(xr, yr);
+ this.closePath();
+ };
+
+ /**
+ * Sets up the dashedLine functionality for drawing
+ * Original code came from http://stackoverflow.com/questions/4576724/dotted-stroke-in-canvas
+ * @author David Jordan
+ * @date 2012-08-08
+ */
+ CanvasRenderingContext2D.prototype.dashedLine = function (x, y, x2, y2, pattern) {
+ this.beginPath();
+ this.moveTo(x, y);
+
+ var patternLength = pattern.length;
+ var dx = x2 - x;
+ var dy = y2 - y;
+ var slope = dy / dx;
+ var distRemaining = Math.sqrt(dx * dx + dy * dy);
+ var patternIndex = 0;
+ var draw = true;
+ var xStep = 0;
+ var dashLength = pattern[0];
+
+ while (distRemaining >= 0.1) {
+ dashLength = pattern[patternIndex++ % patternLength];
+ if (dashLength > distRemaining) {
+ dashLength = distRemaining;
+ }
+
+ xStep = Math.sqrt(dashLength * dashLength / (1 + slope * slope));
+ xStep = dx < 0 ? -xStep : xStep;
+ x += xStep;
+ y += slope * xStep;
+
+ if (draw === true) {
+ this.lineTo(x, y);
+ } else {
+ this.moveTo(x, y);
+ }
+
+ distRemaining -= dashLength;
+ draw = !draw;
+ }
+ };
+ }
+
+/***/ },
+/* 115 */
+/***/ function(module, exports) {
+
+ /**
+ * Parse a text source containing data in DOT language into a JSON object.
+ * The object contains two lists: one with nodes and one with edges.
+ *
+ * DOT language reference: http://www.graphviz.org/doc/info/lang.html
+ *
+ * DOT language attributes: http://graphviz.org/content/attrs
+ *
+ * @param {String} data Text containing a graph in DOT-notation
+ * @return {Object} graph An object containing two parameters:
+ * {Object[]} nodes
+ * {Object[]} edges
+ */
+ 'use strict';
+
+ function parseDOT(data) {
+ dot = data;
+ return parseGraph();
+ }
+
+ // mapping of attributes from DOT (the keys) to vis.js (the values)
+ var NODE_ATTR_MAPPING = {
+ 'fontsize': 'font.size',
+ 'fontcolor': 'font.color',
+ 'labelfontcolor': 'font.color',
+ 'fontname': 'font.face',
+ 'color': ['color.border', 'color.background'],
+ 'fillcolor': 'color.background',
+ 'tooltip': 'title',
+ 'labeltooltip': 'title'
+ };
+ var EDGE_ATTR_MAPPING = Object.create(NODE_ATTR_MAPPING);
+ EDGE_ATTR_MAPPING.color = 'color.color';
+
+ // token types enumeration
+ var TOKENTYPE = {
+ NULL: 0,
+ DELIMITER: 1,
+ IDENTIFIER: 2,
+ UNKNOWN: 3
+ };
+
+ // map with all delimiters
+ var DELIMITERS = {
+ '{': true,
+ '}': true,
+ '[': true,
+ ']': true,
+ ';': true,
+ '=': true,
+ ',': true,
+
+ '->': true,
+ '--': true
+ };
+
+ var dot = ''; // current dot file
+ var index = 0; // current index in dot file
+ var c = ''; // current token character in expr
+ var token = ''; // current token
+ var tokenType = TOKENTYPE.NULL; // type of the token
+
+ /**
+ * Get the first character from the dot file.
+ * The character is stored into the char c. If the end of the dot file is
+ * reached, the function puts an empty string in c.
+ */
+ function first() {
+ index = 0;
+ c = dot.charAt(0);
+ }
+
+ /**
+ * Get the next character from the dot file.
+ * The character is stored into the char c. If the end of the dot file is
+ * reached, the function puts an empty string in c.
+ */
+ function next() {
+ index++;
+ c = dot.charAt(index);
+ }
+
+ /**
+ * Preview the next character from the dot file.
+ * @return {String} cNext
+ */
+ function nextPreview() {
+ return dot.charAt(index + 1);
+ }
+
+ /**
+ * Test whether given character is alphabetic or numeric
+ * @param {String} c
+ * @return {Boolean} isAlphaNumeric
+ */
+ var regexAlphaNumeric = /[a-zA-Z_0-9.:#]/;
+ function isAlphaNumeric(c) {
+ return regexAlphaNumeric.test(c);
+ }
+
+ /**
+ * Merge all options of object b into object b
+ * @param {Object} a
+ * @param {Object} b
+ * @return {Object} a
+ */
+ function merge(a, b) {
+ if (!a) {
+ a = {};
+ }
+
+ if (b) {
+ for (var name in b) {
+ if (b.hasOwnProperty(name)) {
+ a[name] = b[name];
+ }
+ }
+ }
+ return a;
+ }
+
+ /**
+ * Set a value in an object, where the provided parameter name can be a
+ * path with nested parameters. For example:
+ *
+ * var obj = {a: 2};
+ * setValue(obj, 'b.c', 3); // obj = {a: 2, b: {c: 3}}
+ *
+ * @param {Object} obj
+ * @param {String} path A parameter name or dot-separated parameter path,
+ * like "color.highlight.border".
+ * @param {*} value
+ */
+ function setValue(obj, path, value) {
+ var keys = path.split('.');
+ var o = obj;
+ while (keys.length) {
+ var key = keys.shift();
+ if (keys.length) {
+ // this isn't the end point
+ if (!o[key]) {
+ o[key] = {};
+ }
+ o = o[key];
+ } else {
+ // this is the end point
+ o[key] = value;
+ }
+ }
+ }
+
+ /**
+ * Add a node to a graph object. If there is already a node with
+ * the same id, their attributes will be merged.
+ * @param {Object} graph
+ * @param {Object} node
+ */
+ function addNode(graph, node) {
+ var i, len;
+ var current = null;
+
+ // find root graph (in case of subgraph)
+ var graphs = [graph]; // list with all graphs from current graph to root graph
+ var root = graph;
+ while (root.parent) {
+ graphs.push(root.parent);
+ root = root.parent;
+ }
+
+ // find existing node (at root level) by its id
+ if (root.nodes) {
+ for (i = 0, len = root.nodes.length; i < len; i++) {
+ if (node.id === root.nodes[i].id) {
+ current = root.nodes[i];
+ break;
+ }
+ }
+ }
+
+ if (!current) {
+ // this is a new node
+ current = {
+ id: node.id
+ };
+ if (graph.node) {
+ // clone default attributes
+ current.attr = merge(current.attr, graph.node);
+ }
+ }
+
+ // add node to this (sub)graph and all its parent graphs
+ for (i = graphs.length - 1; i >= 0; i--) {
+ var g = graphs[i];
+
+ if (!g.nodes) {
+ g.nodes = [];
+ }
+ if (g.nodes.indexOf(current) === -1) {
+ g.nodes.push(current);
+ }
+ }
+
+ // merge attributes
+ if (node.attr) {
+ current.attr = merge(current.attr, node.attr);
+ }
+ }
+
+ /**
+ * Add an edge to a graph object
+ * @param {Object} graph
+ * @param {Object} edge
+ */
+ function addEdge(graph, edge) {
+ if (!graph.edges) {
+ graph.edges = [];
+ }
+ graph.edges.push(edge);
+ if (graph.edge) {
+ var attr = merge({}, graph.edge); // clone default attributes
+ edge.attr = merge(attr, edge.attr); // merge attributes
+ }
+ }
+
+ /**
+ * Create an edge to a graph object
+ * @param {Object} graph
+ * @param {String | Number | Object} from
+ * @param {String | Number | Object} to
+ * @param {String} type
+ * @param {Object | null} attr
+ * @return {Object} edge
+ */
+ function createEdge(graph, from, to, type, attr) {
+ var edge = {
+ from: from,
+ to: to,
+ type: type
+ };
+
+ if (graph.edge) {
+ edge.attr = merge({}, graph.edge); // clone default attributes
+ }
+ edge.attr = merge(edge.attr || {}, attr); // merge attributes
+
+ return edge;
+ }
+
+ /**
+ * Get next token in the current dot file.
+ * The token and token type are available as token and tokenType
+ */
+ function getToken() {
+ tokenType = TOKENTYPE.NULL;
+ token = '';
+
+ // skip over whitespaces
+ while (c === ' ' || c === '\t' || c === '\n' || c === '\r') {
+ // space, tab, enter
+ next();
+ }
+
+ do {
+ var isComment = false;
+
+ // skip comment
+ if (c === '#') {
+ // find the previous non-space character
+ var i = index - 1;
+ while (dot.charAt(i) === ' ' || dot.charAt(i) === '\t') {
+ i--;
+ }
+ if (dot.charAt(i) === '\n' || dot.charAt(i) === '') {
+ // the # is at the start of a line, this is indeed a line comment
+ while (c != '' && c != '\n') {
+ next();
+ }
+ isComment = true;
+ }
+ }
+ if (c === '/' && nextPreview() === '/') {
+ // skip line comment
+ while (c != '' && c != '\n') {
+ next();
+ }
+ isComment = true;
+ }
+ if (c === '/' && nextPreview() === '*') {
+ // skip block comment
+ while (c != '') {
+ if (c === '*' && nextPreview() === '/') {
+ // end of block comment found. skip these last two characters
+ next();
+ next();
+ break;
+ } else {
+ next();
+ }
+ }
+ isComment = true;
+ }
+
+ // skip over whitespaces
+ while (c === ' ' || c === '\t' || c === '\n' || c === '\r') {
+ // space, tab, enter
+ next();
+ }
+ } while (isComment);
+
+ // check for end of dot file
+ if (c === '') {
+ // token is still empty
+ tokenType = TOKENTYPE.DELIMITER;
+ return;
+ }
+
+ // check for delimiters consisting of 2 characters
+ var c2 = c + nextPreview();
+ if (DELIMITERS[c2]) {
+ tokenType = TOKENTYPE.DELIMITER;
+ token = c2;
+ next();
+ next();
+ return;
+ }
+
+ // check for delimiters consisting of 1 character
+ if (DELIMITERS[c]) {
+ tokenType = TOKENTYPE.DELIMITER;
+ token = c;
+ next();
+ return;
+ }
+
+ // check for an identifier (number or string)
+ // TODO: more precise parsing of numbers/strings (and the port separator ':')
+ if (isAlphaNumeric(c) || c === '-') {
+ token += c;
+ next();
+
+ while (isAlphaNumeric(c)) {
+ token += c;
+ next();
+ }
+ if (token === 'false') {
+ token = false; // convert to boolean
+ } else if (token === 'true') {
+ token = true; // convert to boolean
+ } else if (!isNaN(Number(token))) {
+ token = Number(token); // convert to number
+ }
+ tokenType = TOKENTYPE.IDENTIFIER;
+ return;
+ }
+
+ // check for a string enclosed by double quotes
+ if (c === '"') {
+ next();
+ while (c != '' && (c != '"' || c === '"' && nextPreview() === '"')) {
+ token += c;
+ if (c === '"') {
+ // skip the escape character
+ next();
+ }
+ next();
+ }
+ if (c != '"') {
+ throw newSyntaxError('End of string " expected');
+ }
+ next();
+ tokenType = TOKENTYPE.IDENTIFIER;
+ return;
+ }
+
+ // something unknown is found, wrong characters, a syntax error
+ tokenType = TOKENTYPE.UNKNOWN;
+ while (c != '') {
+ token += c;
+ next();
+ }
+ throw new SyntaxError('Syntax error in part "' + chop(token, 30) + '"');
+ }
+
+ /**
+ * Parse a graph.
+ * @returns {Object} graph
+ */
+ function parseGraph() {
+ var graph = {};
+
+ first();
+ getToken();
+
+ // optional strict keyword
+ if (token === 'strict') {
+ graph.strict = true;
+ getToken();
+ }
+
+ // graph or digraph keyword
+ if (token === 'graph' || token === 'digraph') {
+ graph.type = token;
+ getToken();
+ }
+
+ // optional graph id
+ if (tokenType === TOKENTYPE.IDENTIFIER) {
+ graph.id = token;
+ getToken();
+ }
+
+ // open angle bracket
+ if (token != '{') {
+ throw newSyntaxError('Angle bracket { expected');
+ }
+ getToken();
+
+ // statements
+ parseStatements(graph);
+
+ // close angle bracket
+ if (token != '}') {
+ throw newSyntaxError('Angle bracket } expected');
+ }
+ getToken();
+
+ // end of file
+ if (token !== '') {
+ throw newSyntaxError('End of file expected');
+ }
+ getToken();
+
+ // remove temporary default options
+ delete graph.node;
+ delete graph.edge;
+ delete graph.graph;
+
+ return graph;
+ }
+
+ /**
+ * Parse a list with statements.
+ * @param {Object} graph
+ */
+ function parseStatements(graph) {
+ while (token !== '' && token != '}') {
+ parseStatement(graph);
+ if (token === ';') {
+ getToken();
+ }
+ }
+ }
+
+ /**
+ * Parse a single statement. Can be a an attribute statement, node
+ * statement, a series of node statements and edge statements, or a
+ * parameter.
+ * @param {Object} graph
+ */
+ function parseStatement(graph) {
+ // parse subgraph
+ var subgraph = parseSubgraph(graph);
+ if (subgraph) {
+ // edge statements
+ parseEdge(graph, subgraph);
+
+ return;
+ }
+
+ // parse an attribute statement
+ var attr = parseAttributeStatement(graph);
+ if (attr) {
+ return;
+ }
+
+ // parse node
+ if (tokenType != TOKENTYPE.IDENTIFIER) {
+ throw newSyntaxError('Identifier expected');
+ }
+ var id = token; // id can be a string or a number
+ getToken();
+
+ if (token === '=') {
+ // id statement
+ getToken();
+ if (tokenType != TOKENTYPE.IDENTIFIER) {
+ throw newSyntaxError('Identifier expected');
+ }
+ graph[id] = token;
+ getToken();
+ // TODO: implement comma separated list with "a_list: ID=ID [','] [a_list] "
+ } else {
+ parseNodeStatement(graph, id);
+ }
+ }
+
+ /**
+ * Parse a subgraph
+ * @param {Object} graph parent graph object
+ * @return {Object | null} subgraph
+ */
+ function parseSubgraph(graph) {
+ var subgraph = null;
+
+ // optional subgraph keyword
+ if (token === 'subgraph') {
+ subgraph = {};
+ subgraph.type = 'subgraph';
+ getToken();
+
+ // optional graph id
+ if (tokenType === TOKENTYPE.IDENTIFIER) {
+ subgraph.id = token;
+ getToken();
+ }
+ }
+
+ // open angle bracket
+ if (token === '{') {
+ getToken();
+
+ if (!subgraph) {
+ subgraph = {};
+ }
+ subgraph.parent = graph;
+ subgraph.node = graph.node;
+ subgraph.edge = graph.edge;
+ subgraph.graph = graph.graph;
+
+ // statements
+ parseStatements(subgraph);
+
+ // close angle bracket
+ if (token != '}') {
+ throw newSyntaxError('Angle bracket } expected');
+ }
+ getToken();
+
+ // remove temporary default options
+ delete subgraph.node;
+ delete subgraph.edge;
+ delete subgraph.graph;
+ delete subgraph.parent;
+
+ // register at the parent graph
+ if (!graph.subgraphs) {
+ graph.subgraphs = [];
+ }
+ graph.subgraphs.push(subgraph);
+ }
+
+ return subgraph;
+ }
+
+ /**
+ * parse an attribute statement like "node [shape=circle fontSize=16]".
+ * Available keywords are 'node', 'edge', 'graph'.
+ * The previous list with default attributes will be replaced
+ * @param {Object} graph
+ * @returns {String | null} keyword Returns the name of the parsed attribute
+ * (node, edge, graph), or null if nothing
+ * is parsed.
+ */
+ function parseAttributeStatement(graph) {
+ // attribute statements
+ if (token === 'node') {
+ getToken();
+
+ // node attributes
+ graph.node = parseAttributeList();
+ return 'node';
+ } else if (token === 'edge') {
+ getToken();
+
+ // edge attributes
+ graph.edge = parseAttributeList();
+ return 'edge';
+ } else if (token === 'graph') {
+ getToken();
+
+ // graph attributes
+ graph.graph = parseAttributeList();
+ return 'graph';
+ }
+
+ return null;
+ }
+
+ /**
+ * parse a node statement
+ * @param {Object} graph
+ * @param {String | Number} id
+ */
+ function parseNodeStatement(graph, id) {
+ // node statement
+ var node = {
+ id: id
+ };
+ var attr = parseAttributeList();
+ if (attr) {
+ node.attr = attr;
+ }
+ addNode(graph, node);
+
+ // edge statements
+ parseEdge(graph, id);
+ }
+
+ /**
+ * Parse an edge or a series of edges
+ * @param {Object} graph
+ * @param {String | Number} from Id of the from node
+ */
+ function parseEdge(graph, from) {
+ while (token === '->' || token === '--') {
+ var to;
+ var type = token;
+ getToken();
+
+ var subgraph = parseSubgraph(graph);
+ if (subgraph) {
+ to = subgraph;
+ } else {
+ if (tokenType != TOKENTYPE.IDENTIFIER) {
+ throw newSyntaxError('Identifier or subgraph expected');
+ }
+ to = token;
+ addNode(graph, {
+ id: to
+ });
+ getToken();
+ }
+
+ // parse edge attributes
+ var attr = parseAttributeList();
+
+ // create edge
+ var edge = createEdge(graph, from, to, type, attr);
+ addEdge(graph, edge);
+
+ from = to;
+ }
+ }
+
+ /**
+ * Parse a set with attributes,
+ * for example [label="1.000", shape=solid]
+ * @return {Object | null} attr
+ */
+ function parseAttributeList() {
+ var attr = null;
+
+ while (token === '[') {
+ getToken();
+ attr = {};
+ while (token !== '' && token != ']') {
+ if (tokenType != TOKENTYPE.IDENTIFIER) {
+ throw newSyntaxError('Attribute name expected');
+ }
+ var name = token;
+
+ getToken();
+ if (token != '=') {
+ throw newSyntaxError('Equal sign = expected');
+ }
+ getToken();
+
+ if (tokenType != TOKENTYPE.IDENTIFIER) {
+ throw newSyntaxError('Attribute value expected');
+ }
+ var value = token;
+ setValue(attr, name, value); // name can be a path
+
+ getToken();
+ if (token == ',') {
+ getToken();
+ }
+ }
+
+ if (token != ']') {
+ throw newSyntaxError('Bracket ] expected');
+ }
+ getToken();
+ }
+
+ return attr;
+ }
+
+ /**
+ * Create a syntax error with extra information on current token and index.
+ * @param {String} message
+ * @returns {SyntaxError} err
+ */
+ function newSyntaxError(message) {
+ return new SyntaxError(message + ', got "' + chop(token, 30) + '" (char ' + index + ')');
+ }
+
+ /**
+ * Chop off text after a maximum length
+ * @param {String} text
+ * @param {Number} maxLength
+ * @returns {String}
+ */
+ function chop(text, maxLength) {
+ return text.length <= maxLength ? text : text.substr(0, 27) + '...';
+ }
+
+ /**
+ * Execute a function fn for each pair of elements in two arrays
+ * @param {Array | *} array1
+ * @param {Array | *} array2
+ * @param {function} fn
+ */
+ function forEach2(array1, array2, fn) {
+ if (Array.isArray(array1)) {
+ array1.forEach(function (elem1) {
+ if (Array.isArray(array2)) {
+ array2.forEach(function (elem2) {
+ fn(elem1, elem2);
+ });
+ } else {
+ fn(elem1, array2);
+ }
+ });
+ } else {
+ if (Array.isArray(array2)) {
+ array2.forEach(function (elem2) {
+ fn(array1, elem2);
+ });
+ } else {
+ fn(array1, array2);
+ }
+ }
+ }
+
+ /**
+ * Set a nested property on an object
+ * When nested objects are missing, they will be created.
+ * For example setProp({}, 'font.color', 'red') will return {font: {color: 'red'}}
+ * @param {Object} object
+ * @param {string} path A dot separated string like 'font.color'
+ * @param {*} value Value for the property
+ * @return {Object} Returns the original object, allows for chaining.
+ */
+ function setProp(object, path, value) {
+ var names = path.split('.');
+ var prop = names.pop();
+
+ // traverse over the nested objects
+ var obj = object;
+ for (var i = 0; i < names.length; i++) {
+ var name = names[i];
+ if (!(name in obj)) {
+ obj[name] = {};
+ }
+ obj = obj[name];
+ }
+
+ // set the property value
+ obj[prop] = value;
+
+ return object;
+ }
+
+ /**
+ * Convert an object with DOT attributes to their vis.js equivalents.
+ * @param {Object} attr Object with DOT attributes
+ * @param {Object} mapping
+ * @return {Object} Returns an object with vis.js attributes
+ */
+ function convertAttr(attr, mapping) {
+ var converted = {};
+
+ for (var prop in attr) {
+ if (attr.hasOwnProperty(prop)) {
+ var visProp = mapping[prop];
+ if (Array.isArray(visProp)) {
+ visProp.forEach(function (visPropI) {
+ setProp(converted, visPropI, attr[prop]);
+ });
+ } else if (typeof visProp === 'string') {
+ setProp(converted, visProp, attr[prop]);
+ } else {
+ setProp(converted, prop, attr[prop]);
+ }
+ }
+ }
+
+ return converted;
+ }
+
+ /**
+ * Convert a string containing a graph in DOT language into a map containing
+ * with nodes and edges in the format of graph.
+ * @param {String} data Text containing a graph in DOT-notation
+ * @return {Object} graphData
+ */
+ function DOTToGraph(data) {
+ // parse the DOT file
+ var dotData = parseDOT(data);
+ var graphData = {
+ nodes: [],
+ edges: [],
+ options: {}
+ };
+
+ // copy the nodes
+ if (dotData.nodes) {
+ dotData.nodes.forEach(function (dotNode) {
+ var graphNode = {
+ id: dotNode.id,
+ label: String(dotNode.label || dotNode.id)
+ };
+ merge(graphNode, convertAttr(dotNode.attr, NODE_ATTR_MAPPING));
+ if (graphNode.image) {
+ graphNode.shape = 'image';
+ }
+ graphData.nodes.push(graphNode);
+ });
+ }
+
+ // copy the edges
+ if (dotData.edges) {
+ /**
+ * Convert an edge in DOT format to an edge with VisGraph format
+ * @param {Object} dotEdge
+ * @returns {Object} graphEdge
+ */
+ var convertEdge = function convertEdge(dotEdge) {
+ var graphEdge = {
+ from: dotEdge.from,
+ to: dotEdge.to
+ };
+ merge(graphEdge, convertAttr(dotEdge.attr, EDGE_ATTR_MAPPING));
+ graphEdge.arrows = dotEdge.type === '->' ? 'to' : undefined;
+
+ return graphEdge;
+ };
+
+ dotData.edges.forEach(function (dotEdge) {
+ var from, to;
+ if (dotEdge.from instanceof Object) {
+ from = dotEdge.from.nodes;
+ } else {
+ from = {
+ id: dotEdge.from
+ };
+ }
+
+ // TODO: support of solid/dotted/dashed edges (attr = 'style')
+ // TODO: support for attributes 'dir' and 'arrowhead' (edge arrows)
+
+ if (dotEdge.to instanceof Object) {
+ to = dotEdge.to.nodes;
+ } else {
+ to = {
+ id: dotEdge.to
+ };
+ }
+
+ if (dotEdge.from instanceof Object && dotEdge.from.edges) {
+ dotEdge.from.edges.forEach(function (subEdge) {
+ var graphEdge = convertEdge(subEdge);
+ graphData.edges.push(graphEdge);
+ });
+ }
+
+ forEach2(from, to, function (from, to) {
+ var subEdge = createEdge(graphData, from.id, to.id, dotEdge.type, dotEdge.attr);
+ var graphEdge = convertEdge(subEdge);
+ graphData.edges.push(graphEdge);
+ });
+
+ if (dotEdge.to instanceof Object && dotEdge.to.edges) {
+ dotEdge.to.edges.forEach(function (subEdge) {
+ var graphEdge = convertEdge(subEdge);
+ graphData.edges.push(graphEdge);
+ });
+ }
+ });
+ }
+
+ // copy the options
+ if (dotData.attr) {
+ graphData.options = dotData.attr;
+ }
+
+ return graphData;
+ }
+
+ // exports
+ exports.parseDOT = parseDOT;
+ exports.DOTToGraph = DOTToGraph;
+
+/***/ },
+/* 116 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ function parseGephi(gephiJSON, optionsObj) {
+ var edges = [];
+ var nodes = [];
+ var options = {
+ edges: {
+ inheritColor: false
+ },
+ nodes: {
+ fixed: false,
+ parseColor: false
+ }
+ };
+
+ if (optionsObj !== undefined) {
+ if (optionsObj.fixed !== undefined) {
+ options.nodes.fixed = optionsObj.fixed;
+ }
+ if (optionsObj.parseColor !== undefined) {
+ options.nodes.parseColor = optionsObj.parseColor;
+ }
+ if (optionsObj.inheritColor !== undefined) {
+ options.edges.inheritColor = optionsObj.inheritColor;
+ }
+ }
+
+ var gEdges = gephiJSON.edges;
+ var gNodes = gephiJSON.nodes;
+ for (var i = 0; i < gEdges.length; i++) {
+ var edge = {};
+ var gEdge = gEdges[i];
+ edge['id'] = gEdge.id;
+ edge['from'] = gEdge.source;
+ edge['to'] = gEdge.target;
+ edge['attributes'] = gEdge.attributes;
+ edge['label'] = gEdge.label;
+ edge['title'] = gEdge.attributes !== undefined ? gEdge.attributes.title : undefined;
+ if (gEdge['type'] === 'Directed') {
+ edge['arrows'] = 'to';
+ }
+ // edge['value'] = gEdge.attributes !== undefined ? gEdge.attributes.Weight : undefined;
+ // edge['width'] = edge['value'] !== undefined ? undefined : edgegEdge.size;
+ if (gEdge.color && options.inheritColor === false) {
+ edge['color'] = gEdge.color;
+ }
+ edges.push(edge);
+ }
+
+ for (var i = 0; i < gNodes.length; i++) {
+ var node = {};
+ var gNode = gNodes[i];
+ node['id'] = gNode.id;
+ node['attributes'] = gNode.attributes;
+ node['title'] = gNode.title;
+ node['x'] = gNode.x;
+ node['y'] = gNode.y;
+ node['label'] = gNode.label;
+ node['title'] = gNode.attributes !== undefined ? gNode.attributes.title : undefined;
+ if (options.nodes.parseColor === true) {
+ node['color'] = gNode.color;
+ } else {
+ node['color'] = gNode.color !== undefined ? { background: gNode.color, border: gNode.color, highlight: { background: gNode.color, border: gNode.color }, hover: { background: gNode.color, border: gNode.color } } : undefined;
+ }
+ node['size'] = gNode.size;
+ node['fixed'] = options.nodes.fixed && gNode.x !== undefined && gNode.y !== undefined;
+ nodes.push(node);
+ }
+
+ return { nodes: nodes, edges: edges };
+ }
+
+ exports.parseGephi = parseGephi;
+
+/***/ },
+/* 117 */
+/***/ function(module, exports) {
+
+ /**
+ * @class Images
+ * This class loads images and keeps them stored.
+ */
+ "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 Images = (function () {
+ function Images(callback) {
+ _classCallCheck(this, Images);
+
+ this.images = {};
+ this.imageBroken = {};
+ this.callback = callback;
+ }
+
+ _createClass(Images, [{
+ key: "_addImageToCache",
+
+ /**
+ * @param {string} url The Url to cache the image as
+ * @return {Image} imageToLoadBrokenUrlOn The image object
+ */
+ value: function _addImageToCache(url, imageToCache) {
+ // IE11 fix -- thanks dponch!
+ if (imageToCache.width === 0) {
+ document.body.appendChild(imageToCache);
+ imageToCache.width = imageToCache.offsetWidth;
+ imageToCache.height = imageToCache.offsetHeight;
+ document.body.removeChild(imageToCache);
+ }
+
+ this.images[url] = imageToCache;
+ }
+ }, {
+ key: "_tryloadBrokenUrl",
+
+ /**
+ * @param {string} url The original Url that failed to load, if the broken image is successfully loaded it will be added to the cache using this Url as the key so that subsequent requests for this Url will return the broken image
+ * @param {string} brokenUrl Url the broken image to try and load
+ * @return {Image} imageToLoadBrokenUrlOn The image object
+ */
+ value: function _tryloadBrokenUrl(url, brokenUrl, imageToLoadBrokenUrlOn) {
+ var _this = this;
+
+ //If any of the parameters aren't specified then exit the function because nothing constructive can be done
+ if (url === undefined || brokenUrl === undefined || imageToLoadBrokenUrlOn === undefined) return;
+
+ //Clear the old subscription to the error event and put a new in place that only handle errors in loading the brokenImageUrl
+ imageToLoadBrokenUrlOn.onerror = function () {
+ console.error("Could not load brokenImage:", brokenUrl);
+ //Add an empty image to the cache so that when subsequent load calls are made for the url we don't try load the image and broken image again
+ _this._addImageToCache(url, new Image());
+ };
+
+ //Set the source of the image to the brokenUrl, this is actually what kicks off the loading of the broken image
+ imageToLoadBrokenUrlOn.src = brokenUrl;
+ }
+ }, {
+ key: "_redrawWithImage",
+
+ /**
+ * @return {Image} imageToRedrawWith The images that will be passed to the callback when it is invoked
+ */
+ value: function _redrawWithImage(imageToRedrawWith) {
+ if (this.callback) {
+ this.callback(imageToRedrawWith);
+ }
+ }
+ }, {
+ key: "load",
+
+ /**
+ * @param {string} url Url of the image
+ * @param {string} brokenUrl Url of an image to use if the url image is not found
+ * @return {Image} img The image object
+ */
+ value: function load(url, brokenUrl, id) {
+ var _this2 = this;
+
+ //Try and get the image from the cache, if successful then return the cached image
+ var cachedImage = this.images[url];
+ if (cachedImage) return cachedImage;
+
+ //Create a new image
+ var img = new Image();
+
+ //Subscribe to the event that is raised if the image loads successfully
+ img.onload = function () {
+ //Add the image to the cache and then request a redraw
+ _this2._addImageToCache(url, img);
+ _this2._redrawWithImage(img);
+ };
+
+ //Subscribe to the event that is raised if the image fails to load
+ img.onerror = function () {
+ console.error("Could not load image:", url);
+ //Try and load the image specified by the brokenUrl using
+ _this2._tryloadBrokenUrl(url, brokenUrl, img);
+ };
+
+ //Set the source of the image to the url, this is actuall what kicks off the loading of the image
+ img.src = url;
+
+ //Return the new image
+ return img;
+ }
+ }]);
+
+ return Images;
+ })();
+
+ exports["default"] = Images;
+ module.exports = exports["default"];
+
+/***/ },
+/* 118 */
+/***/ function(module, exports) {
+
+ // English
+ 'use strict';
+
+ exports['en'] = {
+ edit: 'Edit',
+ del: 'Delete selected',
+ back: 'Back',
+ addNode: 'Add Node',
+ addEdge: 'Add Edge',
+ editNode: 'Edit Node',
+ editEdge: 'Edit Edge',
+ addDescription: 'Click in an empty space to place a new node.',
+ edgeDescription: 'Click on a node and drag the edge to another node to connect them.',
+ editEdgeDescription: 'Click on the control points and drag them to a node to connect to it.',
+ createEdgeError: 'Cannot link edges to a cluster.',
+ deleteClusterError: 'Clusters cannot be deleted.',
+ editClusterError: 'Clusters cannot be edited.'
+ };
+ exports['en_EN'] = exports['en'];
+ exports['en_US'] = exports['en'];
+
+ // German
+ exports['de'] = {
+ edit: 'Editieren',
+ del: 'Lösche Auswahl',
+ back: 'Zurück',
+ addNode: 'Knoten hinzufügen',
+ addEdge: 'Kante hinzufügen',
+ editNode: 'Knoten editieren',
+ editEdge: 'Kante editieren',
+ addDescription: 'Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.',
+ edgeDescription: 'Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.',
+ editEdgeDescription: 'Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.',
+ createEdgeError: 'Es ist nicht möglich, Kanten mit Clustern zu verbinden.',
+ deleteClusterError: 'Cluster können nicht gelöscht werden.',
+ editClusterError: 'Cluster können nicht editiert werden.'
+ };
+ exports['de_DE'] = exports['de'];
+
+ // Spanish
+ exports['es'] = {
+ edit: 'Editar',
+ del: 'Eliminar selección',
+ back: 'Átras',
+ addNode: 'Añadir nodo',
+ addEdge: 'Añadir arista',
+ editNode: 'Editar nodo',
+ editEdge: 'Editar arista',
+ addDescription: 'Haga clic en un lugar vacío para colocar un nuevo nodo.',
+ edgeDescription: 'Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.',
+ editEdgeDescription: 'Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.',
+ createEdgeError: 'No se puede conectar una arista a un grupo.',
+ deleteClusterError: 'No es posible eliminar grupos.',
+ editClusterError: 'No es posible editar grupos.'
+ };
+ exports['es_ES'] = exports['es'];
+
+ // Dutch
+ exports['nl'] = {
+ edit: 'Wijzigen',
+ del: 'Selectie verwijderen',
+ back: 'Terug',
+ addNode: 'Node toevoegen',
+ addEdge: 'Link toevoegen',
+ editNode: 'Node wijzigen',
+ editEdge: 'Link wijzigen',
+ addDescription: 'Klik op een leeg gebied om een nieuwe node te maken.',
+ edgeDescription: 'Klik op een node en sleep de link naar een andere node om ze te verbinden.',
+ editEdgeDescription: 'Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.',
+ createEdgeError: 'Kan geen link maken naar een cluster.',
+ deleteClusterError: 'Clusters kunnen niet worden verwijderd.',
+ editClusterError: 'Clusters kunnen niet worden aangepast.'
+ };
+ exports['nl_NL'] = exports['nl'];
+ exports['nl_BE'] = exports['nl'];
+
+/***/ }
+/******/ ])
+});
+;
\ No newline at end of file
diff --git a/resources/visjs/vis.map b/resources/visjs/vis.map
new file mode 100644
index 00000000..9e937d41
--- /dev/null
+++ b/resources/visjs/vis.map
@@ -0,0 +1 @@
+{"version":3,"file":"vis.map","sources":["./dist/vis.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","util","DOMutil","DataSet","DataView","Queue","Graph3d","graph3d","Camera","Filter","Point2d","Point3d","Slider","StepNumber","Timeline","Graph2d","timeline","DateUtil","DataStep","Range","stack","TimeStep","components","items","Item","BackgroundItem","BoxItem","PointItem","RangeItem","Component","CurrentTime","CustomTime","DataAxis","GraphGroup","Group","BackgroundGroup","ItemSet","Legend","LineGraph","TimeAxis","Network","network","Images","dotparser","gephiParser","allOptions","convertDot","input","DOTToGraph","convertGephi","options","parseGephi","moment","Hammer","keycharm","uuid","isNumber","object","Number","recursiveDOMDelete","DOMobject","hasChildNodes","firstChild","removeChild","giveRange","min","max","total","value","scale","Math","isString","String","isDate","Date","match","ASPDateRegex","exec","isNaN","parse","randomUUID","v4","assignAllKeys","obj","prop","hasOwnProperty","fillIfDefined","a","b","allowDeletion","arguments","length","undefined","protoExtend","i","other","extend","selectiveExtend","props","Array","isArray","Error","selectiveDeepExtend","TypeError","constructor","Object","deepExtend","selectiveNotDeepExtend","indexOf","push","equalArray","len","convert","type","Boolean","valueOf","isMoment","toDate","getType","toISOString","copyAndExtendArray","arr","newValue","newArr","copyArray","getAbsoluteLeft","elem","getBoundingClientRect","left","getAbsoluteTop","top","addClassName","className","classes","split","join","removeClassName","index","splice","forEach","callback","toArray","array","updateProperty","key","throttle","fn","wait","timeout","needExecution","throttled","setTimeout","addEventListener","element","action","listener","useCapture","navigator","userAgent","attachEvent","removeEventListener","detachEvent","preventDefault","event","window","returnValue","getTarget","target","srcElement","nodeType","parentNode","hasParent","parent","e","option","asBoolean","defaultValue","asNumber","asString","asSize","asElement","hexToRGB","hex","shorthandRegex","replace","r","g","result","parseInt","overrideOpacity","color","opacity","rgb","substr","RGBToHex","red","green","blue","toString","slice","parseColor","isValidRGB","map","isValidHex","hsv","hexToHSV","lighterColorHSV","h","s","v","darkerColorHSV","darkerColorHex","HSVToHex","lighterColorHex","background","border","highlight","hover","RGBToHSV","minRGB","maxRGB","d","hue","saturation","cssUtil","cssText","styles","style","trim","parts","keys","addCssText","currentStyles","newStyles","removeCssText","removeStyles","HSVToRGB","floor","f","q","t","isOk","test","isValidRGBA","rgba","selectiveBridgeObject","fields","referenceObject","objectTo","create","bridgeObject","mergeOptions","mergeTarget","globalOptions","enabled","binarySearchCustom","orderedItems","searchFunction","field","field2","maxIterations","iteration","low","high","middle","item","searchResult","binarySearchValue","sidePreference","prevValue","nextValue","easingFunctions","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","global","utils_hooks__hooks","hookCallback","apply","setHookCallback","prototype","res","hasOwnProp","create_utc__createUTC","format","locale","strict","createLocalOrUTC","utc","defaultParsingFlags","empty","unusedTokens","unusedInput","overflow","charsLeftOver","nullInput","invalidMonth","invalidFormat","userInvalidated","iso","getParsingFlags","_pf","valid__isValid","_isValid","flags","_d","getTime","invalidWeekday","_strict","bigHour","valid__createInvalid","NaN","copyConfig","to","from","val","_isAMomentObject","_i","_f","_l","_tzm","_isUTC","_offset","_locale","momentProperties","Moment","config","updateInProgress","updateOffset","absFloor","number","ceil","toInt","argumentForCoercion","coercedNumber","isFinite","compareArrays","array1","array2","dontConvert","lengthDiff","abs","diffs","Locale","normalizeLocale","toLowerCase","chooseLocale","names","j","next","loadLocale","name","oldLocale","locales","globalLocale","_abbr","code","locale_locales__getSetGlobalLocale","values","data","locale_locales__getLocale","defineLocale","abbr","set","addUnitAlias","unit","shorthand","lowerCase","aliases","normalizeUnits","units","normalizeObjectUnits","inputObject","normalizedProp","normalizedInput","makeGetSet","keepTime","get_set__set","get_set__get","mom","getSet","zeroFill","targetLength","forceSign","absNumber","zerosToFill","sign","pow","addFormatToken","token","padded","ordinal","func","formatTokenFunctions","localeData","removeFormattingTokens","makeFormatFunction","formattingTokens","output","Function","formatMoment","isValid","expandFormat","formatFunctions","invalidDate","replaceLongDateFormatTokens","longDateFormat","localFormattingTokens","lastIndex","isFunction","sth","addRegexToken","regex","strictRegex","regexes","isStrict","getParseRegexForToken","RegExp","unescapeFormat","matched","p1","p2","p3","p4","addParseToken","tokens","addWeekParseToken","_w","addTimeToArrayFromToken","_a","daysInMonth","year","month","UTC","getUTCDate","localeMonths","_months","localeMonthsShort","_monthsShort","localeMonthsParse","monthName","_monthsParse","_longMonthsParse","_shortMonthsParse","months","monthsShort","setMonth","dayOfMonth","monthsParse","date","getSetMonth","getDaysInMonth","checkOverflow","MONTH","DATE","YEAR","HOUR","MINUTE","SECOND","MILLISECOND","_overflowDayOfYear","warn","msg","suppressDeprecationWarnings","console","deprecate","firstTime","deprecateSimple","deprecations","configFromISO","l","string","from_string__isoRegex","isoDates","isoTimes","matchOffset","configFromStringAndFormat","configFromString","aspNetJsonRegex","createFromInputFallback","createDate","y","M","ms","setFullYear","createUTCDate","setUTCFullYear","daysInYear","isLeapYear","getIsLeapYear","weekOfYear","firstDayOfWeek","firstDayOfWeekOfYear","adjustedMoment","end","daysToDayOfWeek","day","local__createLocal","add","week","dayOfYear","localeWeek","_week","dow","doy","localeFirstDayOfWeek","localeFirstDayOfYear","getSetWeek","getSetISOWeek","dayOfYearFromWeeks","weekday","week1Jan","janX","getUTCDay","getSetDayOfYear","round","clone","startOf","defaults","currentDateArray","now","_useUTC","getUTCFullYear","getUTCMonth","getFullYear","getMonth","getDate","configFromArray","currentDate","yearToUse","dayOfYearFromWeekInfo","_dayOfYear","_nextDay","setUTCMinutes","getUTCMinutes","w","weekYear","temp","GG","W","E","gg","ISO_8601","parsedInput","skipped","stringLength","totalParsedInputLength","meridiemFixWrap","_meridiem","hour","meridiem","isPm","meridiemHour","isPM","configFromStringAndArray","tempConfig","bestMoment","scoreToBeat","currentScore","score","configFromObject","minute","second","millisecond","createFromConfig","prepareConfig","preparse","configFromInput","isUTC","pickBy","moments","args","Duration","duration","years","quarters","quarter","weeks","days","hours","minutes","seconds","milliseconds","_milliseconds","_days","_data","_bubble","isDuration","offset","separator","utcOffset","offsetFromString","matches","chunk","chunkOffset","cloneWithOffset","model","diff","setTime","local","getDateOffset","getTimezoneOffset","getSetOffset","keepLocalTime","localAdjust","_changeInProgress","add_subtract__addSubtract","create__createDuration","getSetZone","setOffsetToUTC","setOffsetToLocal","subtract","setOffsetToParsedOffset","hasAlignedHourOffset","isDaylightSavingTime","isDaylightSavingTimeShifted","_isDSTShifted","isLocal","isUtcOffset","isUtc","ret","diffRes","aspNetRegex","create__isoRegex","parseIso","momentsDifference","inp","parseFloat","positiveMomentsDifference","base","isAfter","isBefore","createAdder","direction","period","dur","tmp","isAdding","moment_calendar__calendar","time","formats","sod","calendar","inputMs","endOf","isBetween","isSame","asFloat","delta","that","zoneDelta","monthDiff","anchor2","adjust","wholeMonthDiff","anchor","moment_format__toISOString","inputString","defaultFormat","postformat","withoutSuffix","humanize","fromNow","toNow","newLocaleData","isoWeekday","to_type__valueOf","unix","toObject","moment_valid__isValid","parsingFlags","invalidAt","addWeekYearFormatToken","getter","weeksInYear","getSetWeekYear","getSetISOWeekYear","getISOWeeksInYear","getWeeksInYear","weekInfo","getSetQuarter","parseWeekday","weekdaysParse","localeWeekdays","_weekdays","localeWeekdaysShort","_weekdaysShort","localeWeekdaysMin","_weekdaysMin","localeWeekdaysParse","weekdayName","_weekdaysParse","weekdays","weekdaysShort","weekdaysMin","getSetDayOfWeek","getDay","getSetLocaleDayOfWeek","getSetISODayOfWeek","lowercase","matchMeridiem","_meridiemParse","localeIsPM","charAt","localeMeridiem","isLower","parseMs","getZoneAbbr","getZoneName","moment__createUnix","moment__createInZone","parseZone","locale_calendar__calendar","_calendar","_longDateFormat","formatUpper","toUpperCase","_invalidDate","_ordinal","preParsePostFormat","relative__relativeTime","isFuture","_relativeTime","pastFuture","locale_set__set","_ordinalParseLenient","_ordinalParse","source","lists__get","setter","list","count","out","lists__listMonths","lists__listMonthsShort","lists__listWeekdays","lists__listWeekdaysShort","lists__listWeekdaysMin","duration_abs__abs","mathAbs","duration_add_subtract__addSubtract","duration_add_subtract__add","duration_add_subtract__subtract","absCeil","bubble","monthsFromDays","monthsToDays","daysToMonths","as","duration_as__valueOf","makeAs","alias","duration_get__get","makeGetter","substituteTimeAgo","relativeTime","duration_humanize__relativeTime","posNegDuration","thresholds","duration_humanize__getSetRelativeTimeThreshold","threshold","limit","withSuffix","iso_string__toISOString","iso_string__abs","Y","D","asSeconds","match1","match2","match3","match4","match6","match1to2","match1to3","match1to4","match1to6","matchUnsigned","matchSigned","matchTimestamp","matchWord","defaultLocaleMonths","defaultLocaleMonthsShort","parseTwoDigitYear","getSetYear","defaultLocaleWeek","prototypeMin","prototypeMax","add_subtract__add","add_subtract__subtract","lang","isoWeekYear","getSetDayOfMonth","defaultLocaleWeekdays","defaultLocaleWeekdaysShort","defaultLocaleWeekdaysMin","_isPm","defaultLocaleMeridiemParse","getSetHour","getSetMinute","getSetSecond","getSetMillisecond","momentPrototype__proto","get","toJSON","isoWeek","isoWeeks","isoWeeksInYear","isDST","isDSTShifted","zoneAbbr","zoneName","dates","zone","momentPrototype","defaultCalendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","defaultLongDateFormat","LTS","LT","L","LL","LLL","LLLL","defaultInvalidDate","defaultOrdinal","defaultOrdinalParse","defaultRelativeTime","future","past","mm","hh","dd","MM","yy","prototype__proto","firstDayOfYear","ordinalParse","langData","asMilliseconds","asMinutes","asHours","asDays","asWeeks","asMonths","asYears","duration_prototype__proto","toIsoString","version","invalid","relativeTimeThreshold","_moment","webpackPolyfill","paths","children","webpackContext","req","resolve","buf","ii","oct","_hexToByte","unparse","bth","_byteToHex","v1","clockseq","_clockseq","msecs","nsecs","_lastNSecs","dt","_lastMSecs","tl","tmh","node","_nodeId","n","rnds","random","rng","_rng","globalVar","crypto","getRandomValues","_rnds8","Uint8Array","_rnds","_seedBytes","prepareElements","JSONcontainer","elementType","redundant","used","cleanupElements","getSVGElement","svgContainer","shift","document","createElementNS","appendChild","getDOMElement","DOMContainer","insertBefore","createElement","drawPoint","x","groupTemplate","labelObj","point","setAttributeNS","size","label","xOffset","yOffset","content","textContent","drawBar","width","height","rect","_options","_fieldId","fieldId","_type","_subscribers","setOptions","queue","_queue","destroy","on","subscribers","subscribe","off","filter","unsubscribe","_trigger","params","senderId","concat","subscriber","addedIds","me","_addItem","update","updatedIds","updatedData","addOrUpdate","_updateItem","ids","firstType","returnType","allowedValues","itemId","_getItem","order","_sort","_filterFields","getIds","getDataSet","mappedItems","filteredItem","sort","av","bv","remove","removedId","removedIds","_remove","clear","maxField","itemField","minField","distinct","fieldType","exists","types","raw","converted","JSON","stringify","delay","Infinity","_timeout","_extended","_flushIfNeeded","flush","methods","original","method","context","entry","clearTimeout","_ids","_onEvent","setData","refresh","newIds","added","removed","viewOptions","getArguments","defaultFilter","dataSet","updated","container","SyntaxError","containerElement","margin","defaultXCenter","defaultYCenter","xLabel","yLabel","zLabel","passValueFn","xValueLabel","yValueLabel","zValueLabel","filterLabel","legendLabel","STYLE","DOT","showPerspective","showGrid","keepAspectRatio","showShadow","showGrayBottom","showTooltip","verticalRatio","animationInterval","animationPreload","camera","setArmRotation","setArmLength","eye","dataTable","dataPoints","colX","colY","colZ","colValue","colFilter","xMin","xStep","xMax","yMin","yStep","yMax","zMin","zStep","zMax","valueMin","valueMax","xBarWidth","yBarWidth","axisColor","gridColor","dataColor","fill","stroke","strokeWidth","getMouseX","clientX","targetTouches","getMouseY","clientY","Emitter","_setScale","z","xCenter","yCenter","zCenter","setArmLocation","_convert3Dto2D","point3d","translation","_convertPointToTranslation","_convertTranslationToScreen","ax","ay","az","cx","getCameraLocation","cy","cz","sinTx","sin","getCameraRotation","cosTx","cos","sinTy","cosTy","sinTz","cosTz","dx","dy","dz","bx","by","ex","ey","ez","getArmLength","xcenter","frame","canvas","clientWidth","ycenter","_setBackgroundColor","backgroundColor","borderColor","borderWidth","borderStyle","BAR","BARCOLOR","BARSIZE","DOTLINE","DOTCOLOR","DOTSIZE","GRID","LINE","SURFACE","_getStyleNumber","styleName","_determineColumnIndexes","getNumberOfColumns","getNumberOfRows","counter","column","getDistinctValues","distinctValues","getColumnRange","minMax","_dataInitialize","rawData","_onChange","dataFilter","setOnLoadCallback","redraw","withBars","defaultXBarWidth","dataX","defaultYBarWidth","dataY","xRange","defaultXMin","defaultXMax","defaultXStep","yRange","defaultYMin","defaultYMax","defaultYStep","zRange","defaultZMin","defaultZMax","defaultZStep","valueRange","defaultValueMin","defaultValueMax","_getDataPoints","sortNumber","dataMatrix","xIndex","yIndex","trans","screen","bottom","pointRight","pointTop","pointCross","position","noCanvas","fontWeight","padding","innerHTML","onmousedown","_onMouseDown","ontouchstart","_onTouchStart","onmousewheel","_onWheel","ontooltip","_onTooltip","onkeydown","setSize","_resizeCanvas","clientHeight","animationStart","slider","play","animationStop","stop","_resizeCenter","setCameraPosition","pos","horizontal","vertical","distance","getCameraPosition","getArmRotation","_readData","_redrawFilter","animationAutoStart","cameraPosition","styleNumber","tooltip","showAnimationControls","_redrawSlider","_redrawClear","_redrawAxis","_redrawDataGrid","_redrawDataLine","_redrawDataBar","_redrawDataDot","_redrawInfo","_redrawLegend","ctx","getContext","clearRect","widthMin","widthMax","dotSize","right","lineWidth","font","ymin","ymax","_hsv2rgb","strokeStyle","beginPath","moveTo","lineTo","strokeRect","fillStyle","closePath","gridLineLen","step","start","getCurrent","textAlign","textBaseline","fillText","visible","setValues","setPlayInterval","onchange","getIndex","selectValue","setOnChangeCallback","lineStyle","getLabel","getSelectedValue","prettyStep","text","xText","yText","zText","xMin2d","xMax2d","gridLenX","gridLenY","textMargin","armAngle","H","S","V","R","G","B","C","Hi","X","cross","topSideVisible","zAvg","lineJoin","lineCap","transBottom","dist","sortDepth","aDiff","bDiff","crossproduct","crossProduct","_getStrokeWidth","radius","arc","PI","surface","corners","xWidth","yWidth","surfaces","center","avg","transCenter","leftButtonDown","_onMouseUp","which","button","touchDown","startMouseX","startMouseY","startStart","startEnd","startArmRotation","cursor","onmousemove","_onMouseMove","onmouseup","diffX","diffY","horizontalNew","verticalNew","snapAngle","snapValue","parameters","emit","boundingRect","mouseX","mouseY","tooltipTimeout","_hideTooltip","dataPoint","_dataPointFromXY","_showTooltip","ontouchmove","_onTouchMove","ontouchend","_onTouchEnd","wheelDelta","detail","oldLength","newLength","_insideTriangle","triangle","bs","cs","distMax","closestDataPoint","closestDist","triangle1","triangle2","distX","distY","sqrt","line","dot","dom","borderRadius","boxShadow","borderLeft","contentWidth","offsetWidth","contentHeight","offsetHeight","lineHeight","dotWidth","dotHeight","mixin","_callbacks","once","self","removeListener","removeAllListeners","callbacks","cb","listeners","hasListeners","sub","sum","armLocation","armRotation","armLength","cameraLocation","cameraRotation","calculateCameraOrientation","rot","graph","onLoadCallback","loadInBackground","isLoaded","getLoadedProgress","getColumn","getValues","getValue","dataView","progress","prev","bar","MozBorderRadius","slide","onclick","togglePlay","onChangeCallback","playTimeout","playInterval","playLoop","setIndex","playNext","interval","clearInterval","getPlayInterval","setPlayLoop","doLoop","onChange","indexToLeft","startClientX","startSlideX","leftToIndex","_start","_end","_step","precision","_current","setRange","setStep","calculatePrettyStep","log10","log","LN10","step1","step2","step5","toPrecision","getStep","groups","forthArgument","defaultOptions","autoResize","throttleRedraw","orientation","axis","maxHeight","minHeight","_create","body","domProps","emitter","bind","hiddenDates","getScale","timeAxis","toScreen","_toScreen","toGlobalScreen","_toGlobalScreen","toTime","_toTime","toGlobalTime","_toGlobalTime","range","timeAxis2","currentTime","itemSet","itemsData","groupsData","getEventProperties","oncontextmenu","setGroups","setItems","_redraw","Core","Configurator","Validator","printStyle","configureOptions","_createConfigurator","markDirty","refreshItems","errorFound","validate","selection","getSelection","setSelection","newDataSet","initialLoad","getItemRange","setWindow","animation","fit","focus","itemData","_this","getDataRange","minItem","maxItem","factor","lhs","rhs","getStart","getEnd","show","getWidthLeft","getWidthRight","dataset","centerContainer","itemFromTarget","group","groupFromTarget","customTime","customTimeFromTarget","snap","snappedTime","what","foreground","labelSet","groupId","pageX","srcEvent","pageY","propagating","__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","_firstTarget","hammer","events","propagatedHandler","_handled","stopped","stopPropagation","firstTarget","_handlers","Manager","PropagatingHammer","o","wrapper","pointerType","isFirst","handler","eventType","exportName","setTimeoutContext","bindFn","invokeArrayArg","arg","each","iterator","dest","src","merge","inherit","child","properties","childP","baseP","_super","boolOrFn","TYPE_FUNCTION","ifUndefined","val1","val2","addEventListeners","splitStr","removeEventListeners","inStr","str","find","inArray","findByKey","uniqueArray","results","prefixed","property","prefix","camelProp","VENDOR_PREFIXES","uniqueId","_uniqueId","getWindowForElement","doc","ownerDocument","defaultView","parentWindow","Input","manager","inputTarget","domHandler","ev","enable","init","createInputInstance","Type","inputClass","SUPPORT_POINTER_EVENTS","PointerEventInput","SUPPORT_ONLY_TOUCH","TouchInput","SUPPORT_TOUCH","TouchMouseInput","MouseInput","inputHandler","pointersLen","pointers","changedPointersLen","changedPointers","INPUT_START","isFinal","INPUT_END","INPUT_CANCEL","session","computeInputData","recognize","prevInput","pointersLength","firstInput","simpleCloneInputData","firstMultiple","offsetCenter","getCenter","timeStamp","deltaTime","angle","getAngle","getDistance","computeDeltaXY","offsetDirection","getDirection","deltaX","deltaY","rotation","getRotation","computeIntervalInputData","offsetDelta","prevDelta","velocity","velocityX","velocityY","last","lastInterval","COMPUTE_INTERVAL","getVelocity","DIRECTION_NONE","DIRECTION_LEFT","DIRECTION_RIGHT","DIRECTION_UP","DIRECTION_DOWN","PROPS_XY","atan2","PROPS_CLIENT_XY","evEl","MOUSE_ELEMENT_EVENTS","evWin","MOUSE_WINDOW_EVENTS","allow","pressed","POINTER_ELEMENT_EVENTS","POINTER_WINDOW_EVENTS","store","pointerEvents","SingleTouchInput","evTarget","SINGLE_TOUCH_TARGET_EVENTS","SINGLE_TOUCH_WINDOW_EVENTS","started","normalizeSingleTouches","all","touches","changed","changedTouches","TOUCH_TARGET_EVENTS","targetIds","getTouches","allTouches","INPUT_MOVE","identifier","changedTargetTouches","touch","mouse","TouchAction","cleanTouchActions","actions","TOUCH_ACTION_NONE","hasPanX","TOUCH_ACTION_PAN_X","hasPanY","TOUCH_ACTION_PAN_Y","TOUCH_ACTION_MANIPULATION","TOUCH_ACTION_AUTO","Recognizer","state","STATE_POSSIBLE","simultaneous","requireFail","stateStr","STATE_CANCELLED","STATE_ENDED","STATE_CHANGED","STATE_BEGAN","directionStr","getRecognizerByNameIfManager","otherRecognizer","recognizer","AttrRecognizer","PanRecognizer","pX","pY","PinchRecognizer","PressRecognizer","_timer","_input","RotateRecognizer","SwipeRecognizer","TapRecognizer","pTime","pCenter","recognizers","preset","handlers","touchAction","toggleCssProps","recognizeWith","requireFailure","cssProps","triggerDomEvent","gestureEvent","createEvent","initEvent","gesture","dispatchEvent","TEST_ELEMENT","MOBILE_REGEX","INPUT_TYPE_TOUCH","INPUT_TYPE_PEN","INPUT_TYPE_MOUSE","INPUT_TYPE_KINECT","DIRECTION_HORIZONTAL","DIRECTION_VERTICAL","DIRECTION_ALL","MOUSE_INPUT_MAP","mousedown","mousemove","mouseup","POINTER_INPUT_MAP","pointerdown","pointermove","pointerup","pointercancel","pointerout","IE10_POINTER_TYPE_ENUM",2,3,4,5,"MSPointerEvent","removePointer","eventTypeNormalized","isTouch","storeIndex","pointerId","SINGLE_TOUCH_INPUT_MAP","touchstart","touchmove","touchend","touchcancel","TOUCH_INPUT_MAP","inputEvent","inputData","isMouse","PREFIXED_TOUCH_ACTION","NATIVE_TOUCH_ACTION","TOUCH_ACTION_COMPUTE","compute","getTouchAction","preventDefaults","prevented","hasNone","preventSrc","STATE_RECOGNIZED","STATE_FAILED","dropRecognizeWith","dropRequireFailure","hasRequireFailures","canRecognizeWith","withState","tryEmit","canEmit","inputDataClone","process","reset","attrTest","optionPointers","isRecognized","directionTest","hasMoved","inOut","validPointers","validMovement","validTime","taps","posThreshold","validTouchTime","failTimeout","validInterval","validMultiTap","tapCount","VERSION","domEvents","userSelect","touchSelect","touchCallout","contentZooming","userDrag","tapHighlightColor","STOP","FORCED_STOP","force","curRecognizer","existing","Tap","Pan","Swipe","Pinch","Rotate","Press","__webpack_amd_options__","deltaDifference","scaleOffset","startToFront","endToFront","moveable","zoomable","zoomMin","zoomMax","animationTimer","_onDragStart","_onDrag","_onDragEnd","_onMouseWheel","_onTouch","_onPinch","validateDirection","getPointer","byUser","finalStart","finalEnd","_cancelAnimation","initStart","initEnd","easingName","easingFunction","initTime","anyChanged","dragging","ease","done","_applyRange","updateHiddenDates","newStart","newEnd","getRange","conversion","totalHidden","previousDelta","_isInsideRange","allowDragging","getHiddenDurationBetween","diffRange","safeStart","snapAwayFromHidden","safeEnd","zoomKey","pointer","pointerDate","_pointerToDate","zoom","centerDate","hiddenDuration","hiddenDurationBefore","getHiddenDurationBefore","hiddenDurationAfter","move","onTouch","isTouching","onRelease","isReleasing","offTouch","offRelease","_isResized","resized","_previousWidth","_previousHeight","convertHiddenOptions","repeat","dateItem","totalRange","pixelTime","startDate","endDate","runUntil","dayOffset","removeDuplicates","startHidden","isHidden","endHidden","rangeStart","rangeEnd","hidden","safeDates","printDates","stepOverHiddenDates","timeStep","previousTime","stepInHidden","currentValue","current","switchedYear","switchedMonth","switchedDay","correctTimeForHidden","totalDuration","partialDuration","accumulatedHiddenDuration","getAccumulatedHiddenDuration","newTime","timeOffset","requiredDuration","previousPoint","correctionEnabled","hammerUtil","Activator","onMouseWheel","isActive","backgroundVertical","backgroundHorizontal","leftContainer","rightContainer","shadowTop","shadowBottom","shadowTopLeft","shadowBottomLeft","shadowTopRight","shadowBottomRight","_redrawTimer","scrollTop","scrollTopMin","customTimes","redrawCount","drawPoints","onRender","clickToUse","activator","_initAutoResize","component","configurator","configure","appliedOptions","setModuleOptions","_origRedraw","active","_stopAutoResize","setCustomTime","getCustomTime","setCustomTimeTitle","title","setCustomTitle","addCustomTime","timestamp","some","removeCustomTime","getVisibleItems","getWindow","borderRootHeight","borderRootWidth","autoHeight","containerHeight","centerWidth","_updateScrollTop","visibilityTop","visibilityBottom","visibility","MAX_REDRAWS","repaint","setCurrentTime","getCurrentTime","_startAutoResize","_onResize","lastWidth","lastHeight","watchTimer","setInterval","initialScrollTop","oldScrollTop","_getScrollTop","newScrollTop","_setScrollTop","align","groupOrderSwap","fromGroup","toGroup","targetOrder","groupOrder","selectable","multiselect","editable","updateTime","updateGroup","groupEditable","onAdd","onUpdate","onMove","onRemove","onMoving","onAddGroup","onMoveGroup","onRemoveGroup","itemOptions","itemListeners","_onAdd","_onUpdate","_onRemove","groupListeners","_onAddGroups","_onUpdateGroups","_onRemoveGroups","groupIds","stackDirty","touchParams","groupTouchParams","UNGROUPED","BACKGROUND","box","_updateUngrouped","backgroundGroup","_onSelectItem","_onMultiSelectItem","_onAddItem","groupHammer","_onGroupDragStart","_onGroupDrag","_onGroupDragEnd","addCallback","dirty","displayed","hide","unselect","select","rawVisibleItems","visibleItems","_deselect","_orderGroups","visibleInterval","zoomed","lastVisibleInterval","restack","firstGroup","_firstGroup","firstMargin","nonFirstMargin","groupMargin","groupResized","firstGroupIndex","firstGroupId","ungrouped","_getGroupId","getLabelSet","oldItemsData","getItems","_order","getGroups","removeItem","_getType","selected","_removeItem","groupData","groupOptions","oldGroupId","oldSubGroupId","subgroup","oldGroup","_constructByEndArray","endArray","dragLeftItem","dragRightItem","itemProps","_getGroupIndex","initialX","dragLeft","_cloneItemData","dragRight","selectedItem","baseGroupIndex","groupIndex","groupOffset","ctrlKey","metaKey","_onDragStartAddItem","xAbs","newItem","offsetLeft","updateGroupAllowed","newGroupBase","initial","updateTimeAllowed","initialStart","initialEnd","newOffset","_moveToGroup","originalOrder","movingUp","targetGroupTop","draggedGroupHeight","targetGroupHeight","targetGroup","draggedGroup","newOrder","origOrder","draggedId","numGroups","curPos","orgOffset","slippedPosition","switchGroup","shouldBeGroup","switchGroupId","shiftKey","oldSelection","newSelection","newItemData","_getItemRange","_item","itemSetFromTarget","minimumStep","autoScale","FORMAT","minorLabels","majorLabels","setMoment","setFormat","setMinimumStep","roundToMinor","hasNext","setScale","setAutoScale","stepYear","stepMonth","stepDay","stepHour","stepMinute","stepSecond","stepMillisecond","isMajor","getLabelMinor","getLabelMajor","getClassName","even","today","currentWeek","currentMonth","currentYear","subgroups","subgroupIndex","subgroupOrderer","subgroupOrder","byStart","byEnd","checkRangedItems","inner","marker","Element","getLabelWidth","markerHeight","lastMarkerHeight","limitSize","repositionX","customOrderedItems","_updateVisibleItems","nostack","_calculateHeight","offsetTop","repositionY","resetSubgroups","setParent","orderSubgroups","_checkIfVisible","sortArray","sortField","itemIndex","removeFromDataSet","startArray","orderByStart","orderByEnd","oldVisibleItems","visibleItemsLookup","lowerBound","upperBound","_checkIfVisibleWithReference","initialPosByStart","_traceVisible","initialPosByEnd","initialPos","breakCondition","isVisible","EPSILON","aTime","bTime","iMax","collidingItem","jj","collision","newTop","baseClassName","_updateContents","_updateTitle","_updateDataAttributes","_updateStyle","getComputedStyle","maxWidth","_repaintDeleteButton","_repaintDragLeft","_repaintDragRight","contentLeft","parentWidth","boxWidth","groupChanged","deleteButton","template","_contentToString","removeAttribute","dataAttributes","attributes","setAttribute","outerHTML","itemSetHeight","marginLeft","onTop","itemSubgroup","totalHeight","newHeight","lines","majorTexts","minorTexts","lineTop","showMinorLabels","showMajorLabels","parentChanged","_calculateCharSize","minorLabelHeight","minorCharHeight","majorLabelHeight","majorCharHeight","minorLineHeight","minorLineWidth","majorLineHeight","majorLineWidth","foregroundNextSibling","nextSibling","backgroundNextSibling","_repaintLabels","timeLabelsize","minorCharWidth","xNext","labelMinor","xFirstMajorLabel","labelFits","_repaintMinorText","_repaintMajorText","_repaintMajorLine","_repaintMinorLine","leftTime","leftText","widthText","majorCharWidth","pop","createTextNode","childNodes","nodeValue","measureCharMinor","measureCharMajor","overlay","_onTapOverlay","onClick","_hasParent","deactivate","escListener","activate","display","unbind","_exportFunctions","_bound","keydown","keyup","_keys","fromCharCode","down","handleEvent","up","keyCode","bound","bindAll","getKey","newBindings","eventParams","drag","warned","substring","showCurrentTime","currentTimeTimer","_interopRequireDefault","__esModule","default","_classCallCheck","instance","Constructor","defineProperty","_createClass","defineProperties","descriptor","enumerable","configurable","writable","protoProps","staticProps","_ColorPicker","_ColorPicker2","parentModule","defaultContainer","pixelRatio","changedOptions","allowCreation","initialized","popupCounter","showButton","moduleOptions","domElements","popupDiv","popupLimit","popupHistory","colorPicker","_removePopup","_clean","_handleObject","_makeItem","_makeHeader","generateButton","_printOptions","onmouseover","onmouseout","optionsContainer","_push","insertTo","_showPopupIfNeeded","path","_arguments","_this2","_len","_key","_ret2","div","objectLabel","selectedValue","_update","_makeLabel","err","popupString","popupValue","oninput","_setupPopup","_this3","html","hideTimeout","deleteTimeout","_this4","correspondingElement","checkbox","checked","_this5","defaultColor","_showColorPicker","_this6","bodyRect","pickerX","pickerY","setColor","setCallback","colorString","checkOnly","visibleInSet","subObj","newPath","_getValue","_handleArray","_makeTextInput","_makeCheckbox","draw","physics","solver","enabledPath","enabledValue","error","_makeColorField","_makeDropdown","_makeRange","_constructOptions","optionsObj","getOptions","ColorPicker","generated","centerCoordinates","hueCircle","initialColor","previousColor","applied","updateCallback","_bindHammer","_setSize","htmlColors","black","navy","darkblue","mediumblue","darkgreen","teal","darkcyan","deepskyblue","darkturquoise","mediumspringgreen","lime","springgreen","aqua","cyan","midnightblue","dodgerblue","lightseagreen","forestgreen","seagreen","darkslategray","limegreen","mediumseagreen","turquoise","royalblue","steelblue","darkslateblue","mediumturquoise","indigo","darkolivegreen","cadetblue","cornflowerblue","mediumaquamarine","dimgray","slateblue","olivedrab","slategray","lightslategray","mediumslateblue","lawngreen","chartreuse","aquamarine","maroon","purple","olive","gray","skyblue","lightskyblue","blueviolet","darkred","darkmagenta","saddlebrown","darkseagreen","lightgreen","mediumpurple","darkviolet","palegreen","darkorchid","yellowgreen","sienna","brown","darkgray","lightblue","greenyellow","paleturquoise","lightsteelblue","powderblue","firebrick","darkgoldenrod","mediumorchid","rosybrown","darkkhaki","silver","mediumvioletred","indianred","peru","chocolate","tan","lightgrey","palevioletred","thistle","orchid","goldenrod","crimson","gainsboro","plum","burlywood","lightcyan","lavender","darksalmon","violet","palegoldenrod","lightcoral","khaki","aliceblue","honeydew","azure","sandybrown","wheat","beige","whitesmoke","mintcream","ghostwhite","salmon","antiquewhite","linen","lightgoldenrodyellow","oldlace","fuchsia","magenta","deeppink","orangered","tomato","hotpink","coral","darkorange","lightsalmon","orange","lightpink","pink","gold","peachpuff","navajowhite","moccasin","bisque","mistyrose","blanchedalmond","papayawhip","lavenderblush","seashell","cornsilk","lemonchiffon","floralwhite","snow","yellow","lightyellow","ivory","white","setInitial","htmlColor","_isColorString","rgbaArray","rgbObj","alpha","_setColor","_generateHueCircle","storePrevious","_hide","_updatePicker","alert","angleConvert","colorPickerSelector","colorPickerCanvas","pixelRation","devicePixelRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","setTransform","putImageData","circle","brightnessRange","opacityRange","initialColorDiv","newColorDiv","colorPickerDiv","opacityDiv","brightnessDiv","arrowDiv","_setOpacity","_setBrightness","brightnessLabel","opacityLabel","cancelButton","applyButton","_apply","saveButton","_save","loadButton","_loadLast","pinch","_moveSelector","sat","hfac","sfac","fillRect","getImageData","centerY","centerX","newLeft","referenceOptions","subObject","usedOptions","check","__any__","getSuggestion","__type__","checkFields","referenceOption","refOptionObj","optionType","refOptionType","print","printLocation","localSearch","findInOptions","globalSearch","localSearchThreshold","globalSearchThreshold","indexMatch","closestMatch","recursive","closestMatchPath","lowerCaseOption","op","levenshteinDistance","matrix","boolean","function","null","groupsDraggable","linegraph","getLegend","isGroupVisible","yAxisLeft","yAxisRight","legendLeft","legendRight","screenToValue","yAxisOrientation","defaultGroup","sampling","graphHeight","shaded","barChart","sideBySide","interpolation","parametrization","dataAxis","icons","alignZeros","legend","abortedGraphUpdate","updateSVGheight","updateSVGheightOnResize","lastStart","svgElements","groupsUsingDefaultStyles","COUNTER","svg","framework","BarFunctions","_updateAllGroupData","_updateGroup","removeGroup","addGroup","groupsContent","ungroupedCounter","forceGraphUpdate","_updateGraph","rangePerPixelInv","preprocessedGroupData","processedGroupData","groupRanges","changeCalled","minDate","maxDate","_getRelevantData","_applySampling","_convertXcoordinates","_getYRanges","_updateYAxis","MAX_CYCLES","_convertYcoordinates","dataContainer","guess","increment","amountOfPoints","xDistance","pointsPerPixel","sampledData","combinedDataLeft","combinedDataRight","getData","getYRange","getStackedYRange","minVal","maxVal","yAxisLeftUsed","yAxisRightUsed","minLeft","minRight","maxLeft","maxRight","ignore","_toggleAxisVisiblity","drawIcons","master","lineOffset","stepPixels","zeroCrossing","amountOfSteps","tempGroups","axisUsed","datapoints","xValue","yValue","extractedData","svgHeight","labelValue","convertValue","setZeroPosition","linegraphOptions","majorLinesOffset","minorLinesOffset","labelOffsetX","labelOffsetY","iconWidth","linegraphSVG","DOMelements","labels","conversionFactor","minWidth","iconsRemoved","amountOfGroups","lineContainer","graphOptions","_redrawGroupIcons","iconHeight","iconOffset","groupArray","drawIcon","_cleanupIcons","activeGroups","_redrawLabels","_redrawTitle","stepSize","marginRange","valueAtBottom","marginEnd","maxLabelSize","stepIndex","_redrawLabel","_redrawLine","titleWidth","titleCharHeight","invertedValue","convertedValue","characterHeight","largestWidth","textMinor","textMajor","textTitle","measureCharTitle","titleCharWidth","customRange","formattingFunction","marginStart","deadSpace","majorSteps","minorSteps","setFirst","safeRange","minimumStepValue","orderOfMagnitude","minorStepIdx","magnitudefactor","solutionFound","niceStart","niceEnd","rounded","previous","steps","usingDefaultStyle","zeroPosition","Line","Bar","Points","SVGcontainer","fillPath","fillHeight","outline","barWidth","bar1Height","bar2Height","icon","combinedData","groupLabel","intersections","_getDataIntersections","_getStackedYRange","accumulatedNegative","accumulatedPositive","xpos","coreDistance","amount","resolved","_catmullRom","_linear","dFill","_catmullRomUniform","p0","bp1","bp2","normalization","d1","d2","d3","A","N","d3powA","d2powA","d3pow2A","d2pow2A","d1pow2A","d1powA","getGroupTemplate","callbackResult","getCallback","Bargraph","drawData","barPoints","heightOffset","_getSafeDrawData","nextKey","prevKey","pointData","side","iconSize","iconSpacing","excludeFromLegend","textArea","scrollableHeight","drawLegendIcons","paddingTop","any","nodes","nodeIndices","edges","edgeIndices","eventListeners","onTap","onDoubleTap","onHold","onDragStart","onDrag","onDragEnd","onPinch","onMouseMove","onContext","functions","createNode","createEdge","view","bindEventListeners","images","_modulesGroups2","_modulesCanvas2","selectionHandler","_modulesSelectionHandler2","interactionHandler","_modulesInteractionHandler2","_modulesView2","renderer","_modulesCanvasRenderer2","_modulesPhysicsEngine2","layoutEngine","_modulesLayoutEngine2","clustering","_modulesClustering2","manipulation","_modulesManipulationSystem2","nodesHandler","_modulesNodesHandler2","edgesHandler","_modulesEdgesHandler2","_modulesKamadaKawaiJs2","_modulesGroups","_modulesNodesHandler","_modulesEdgesHandler","_modulesPhysicsEngine","_modulesClustering","_modulesCanvasRenderer","_modulesCanvas","_modulesView","_modulesInteractionHandler","_modulesSelectionHandler","_modulesLayoutEngine","_modulesManipulationSystem","_sharedConfigurator","_sharedConfigurator2","_sharedValidator","_sharedValidator2","_optionsJs","_modulesKamadaKawaiJs","layout","interaction","networkOptions","_updateVisibleIndices","nodeId","edgeId","updatePhysicsData","_updateValueRange","unselectAll","dotData","gephi","gephiData","valueTotal","setValueRange","canvasToDOM","DOMtoCanvas","findNode","isCluster","openCluster","cluster","getNodesInCluster","clusterByConnection","clusterByHubsize","clusterOutliers","getSeed","enableEditMode","disableEditMode","addNodeMode","editNode","editNodeMode","addEdgeMode","editEdgeMode","deleteSelected","getPositions","storePositions","moveNode","getBoundingBox","getConnectedNodes","objectId","getConnectedEdges","startSimulation","stopSimulation","stabilize","getSelectedNodes","getSelectedEdges","getNodeAt","getEdgeAt","edge","selectNodes","selectEdges","getViewPosition","releaseNode","getOptionsFromConfigurator","Groups","defaultIndex","groupsArray","defaultGroups","useDefaultGroups","optionFields","groupName","groupname","_componentsNode","_componentsNode2","_componentsSharedLabel","_componentsSharedLabel2","NodesHandler","nodesListeners","borderWidthSelected","brokenImage","fixed","face","strokeColor","image","labelHighlightBold","level","mass","scaling","maxVisible","drawThreshold","customScalingFunction","shadow","shape","shapeProperties","borderDashes","useImageSize","useBorderWithImage","parseOptions","updateShape","updateLabelModule","_reset","doNotEmit","oldNodesData","newNodes","positionInitially","changedData","dataChanged","constructorClass","clearPositions","dataArray","boundingBox","nodeList","nodeObj","toId","fromId","edgeList","_sharedLabel","_sharedLabel2","_nodesShapesBox","_nodesShapesBox2","_nodesShapesCircle","_nodesShapesCircle2","_nodesShapesCircularImage","_nodesShapesCircularImage2","_nodesShapesDatabase","_nodesShapesDatabase2","_nodesShapesDiamond","_nodesShapesDiamond2","_nodesShapesDot","_nodesShapesDot2","_nodesShapesEllipse","_nodesShapesEllipse2","_nodesShapesIcon","_nodesShapesIcon2","_nodesShapesImage","_nodesShapesImage2","_nodesShapesSquare","_nodesShapesSquare2","_nodesShapesStar","_nodesShapesStar2","_nodesShapesText","_nodesShapesText2","_nodesShapesTriangle","_nodesShapesTriangle2","_nodesShapesTriangleDown","_nodesShapesTriangleDown2","Node","imagelist","grouplist","baseSize","baseFontSize","predefinedPosition","labelModule","currentShape","groupObj","imageObj","load","distanceToBorder","sizeDiff","fontDiff","updateBoundingBox","resize","parentOptions","newOptions","parsedColor","_slicedToArray","sliceIterator","_arr","_n","_e","_s","Symbol","Label","pointToSelf","fontOptions","yLine","nodeOptions","labelDirty","baseline","viewFontSize","calculateLabelSize","_drawBackground","_drawText","lineMargin","fontSize","_getColor2","_getColor","_getColor22","fontColor","_setAlignment2","_setAlignment","_setAlignment22","lineCount","strokeText","_processLabel","measureText","newOptionsArray","_inherits","subClass","superClass","__proto__","_get","_x","_x2","_x3","_again","receiver","desc","getOwnPropertyDescriptor","getPrototypeOf","_utilNodeBase","_utilNodeBase2","Box","_NodeBase","textSize","getTextSize","selectionLineWidth","roundRect","enableShadow","disableShadow","save","enableBorderDashes","disableBorderDashes","restore","NodeBase","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","setLineDash","dashes","_utilCircleImageBase","_utilCircleImageBase2","Circle","_CircleImageBase","diameter","_drawRawCircle","CircleImageBase","labelOffset","imageLoaded","ratio","networkScaleInv","globalAlpha","drawImage","labelDimensions","CircularImage","_swapToImageResizeWhenImageLoaded","_resizeImage","clip","_drawImageAtPosition","_drawImageLabel","_distanceToBorder","Database","database","_utilShapeBase","_utilShapeBase2","Diamond","_ShapeBase","_resizeShape","_drawShape","ShapeBase","sizeMultiplier","Dot","Ellipse","ellipse","Icon","_icon","iconTextSpacing","Image","Square","Star","Text","Triangle","TriangleDown","_componentsEdge","_componentsEdge2","EdgesHandler","edgesListeners","arrows","scaleFactor","hoverWidth","selectionWidth","selfReferenceSize","smooth","forceDirection","roundness","emitChange","edgeData","edgeOptions","reconnectEdges","markAllEdgesAsDirty","updateEdgeType","oldEdgesData","edgesData","oldEdge","disconnect","showInternalIds","connect","cleanup","edgeType","colorDirty","_edgesCubicBezierEdge","_edgesCubicBezierEdge2","_edgesBezierEdgeDynamic","_edgesBezierEdgeDynamic2","_edgesBezierEdgeStatic","_edgesBezierEdgeStatic2","_edgesStraightEdge","_edgesStraightEdge2","Edge","baseWidth","connected","_setInteractionWidths","changeInType","attachEdge","detachEdge","widthDiff","via","drawLine","drawArrows","drawLabel","viaNode","drawArrowHead","node1","node2","getPoint","translate","_rotateForLabelAlignment","_pointOnCircle","xFrom","yFrom","xTo","yTo","xObj","yObj","getDistanceToEdge","angleInDegrees","rotate","percentage","colorsDefined","_x4","_x5","_utilCubicBezierEdgeBase","_utilCubicBezierEdgeBase2","CubicBezierEdge","_CubicBezierEdgeBase","_getViaCoordinates2","_getViaCoordinates","_getViaCoordinates22","via1","via2","bezierCurveTo","x1","y1","x2","y2","nearNode","_findBorderPositionBezier","x3","y3","_ref","_ref2","_getDistanceToBezierEdge","_ref3","_ref32","vec","_BezierEdgeBase2","_BezierEdgeBase3","CubicBezierEdgeBase","_BezierEdgeBase","minDistance","lastX","lastY","_getDistanceToLine","_EdgeBase2","_EdgeBase3","BezierEdgeBase","_EdgeBase","distanceToPoint","difference","EdgeBase","getColor","getLineWidth","_drawDashedLine","_drawLine","_line","_getCircleData2","_getCircleData","_getCircleData22","_circle","pattern","lineDashOffset","_getCircleData3","_getCircleData32","dashedLine","_getCircleData4","_getCircleData42","_findBorderPosition","_findBorderPositionCircle","_getCircleData5","_getCircleData52","colorOptions","grd","createLinearGradient","fromColor","toColor","addColorStop","_getDistanceToEdge","_getCircleData6","_getCircleData62","px","py","something","u","arrowPos","guideOffset","findBorderPosition","guidePos","arrow","_angle","_getCircleData7","_getCircleData72","_length","_utilBezierEdgeBase","_utilBezierEdgeBase2","BezierEdgeDynamic","_boundFunction","positionBezierNode","setupSupportNode","parentEdgeId","quadraticCurveTo","_x6","BezierEdgeStatic","xVia","yVia","pi","originalAngle","myAngle","_utilEdgeBase","_utilEdgeBase2","StraightEdge","edgeSegmentLength","toBorderDist","toBorderPoint","borderPos","_componentsPhysicsBarnesHutSolver","_componentsPhysicsBarnesHutSolver2","_componentsPhysicsRepulsionSolver","_componentsPhysicsRepulsionSolver2","_componentsPhysicsHierarchicalRepulsionSolver","_componentsPhysicsHierarchicalRepulsionSolver2","_componentsPhysicsSpringSolver","_componentsPhysicsSpringSolver2","_componentsPhysicsHierarchicalSpringSolver","_componentsPhysicsHierarchicalSpringSolver2","_componentsPhysicsCentralGravitySolver","_componentsPhysicsCentralGravitySolver2","_componentsPhysicsFA2BasedRepulsionSolver","_componentsPhysicsFA2BasedRepulsionSolver2","_componentsPhysicsFA2BasedCentralGravitySolver","_componentsPhysicsFA2BasedCentralGravitySolver2","PhysicsEngine","physicsBody","physicsNodeIndices","physicsEdgeIndices","forces","velocities","physicsEnabled","simulationInterval","requiresTimeout","previousStates","referenceState","freezeCache","renderTimer","adaptiveTimestep","adaptiveTimestepEnabled","adaptiveCounter","adaptiveInterval","stabilized","startedStabilization","stabilizationIterations","ready","barnesHut","theta","gravitationalConstant","centralGravity","springLength","springConstant","damping","avoidOverlap","forceAtlas2Based","repulsion","nodeDistance","hierarchicalRepulsion","maxVelocity","minVelocity","stabilization","iterations","updateInterval","onlyDynamicEdges","timestep","layoutFailed","initPhysics","nodesSolver","edgesSolver","gravitySolver","modelOptions","viewFunction","simulationStep","_emitStabilized","startTime","physicsTick","physicsTime","runDoubleSpeed","amountOfIterations","calculateForces","moveNodes","revert","_evaluateStepQuality","nodeIds","positions","vx","vy","dpos","reference","maxNodeVelocity","averageNodeVelocity","velocityAdaptiveThreshold","nodeVelocity","_performStep","totalVelocity","solve","targetIterations","_freezeNodes","_stabilizationBatch","_finalizeStabilization","_restoreFrozenNodes","BarnesHutSolver","barnesHutTree","randomSeed","thetaInversed","overlapAvoidanceFactor","nodeCount","_formBarnesHutTree","_getForceContribution","NW","NE","SW","SE","parentBranch","childrenCount","centerOfMass","calcSize","_calculateForces","gravityForce","fx","fy","minX","minY","maxX","maxY","minimumTreeSize","rootSize","halfRootSize","_splitBranch","_placeInTree","totalMass","totalMassInv","biggestSize","skipMassUpdate","_updateBranchMass","_placeInRegion","region","seededRandom","containedNode","_insertRegion","childSize","_drawBranch","branch","RepulsionSolver","repulsingForce","HierarchicalRepulsionSolver","steepness","SpringSolver","edgeLength","node3","_calculateSpringForce","springForce","HierarchicalSpringSolver","springFx","springFy","totalFx","totalFy","correctionFx","correctionFy","CentralGravitySolver","_BarnesHutSolver2","_BarnesHutSolver3","ForceAtlas2BasedRepulsionSolver","_BarnesHutSolver","degree","_CentralGravitySolver2","_CentralGravitySolver3","ForceAtlas2BasedCentralGravitySolver","_CentralGravitySolver","_componentsNodesCluster","_componentsNodesCluster2","ClusterEngine","clusteredNodes","hubsize","_getHubSize","_checkOptions","nodesToCluster","refreshData","joinCondition","childNodesObj","childEdgesObj","clonedOptions","_cloneOptions","hiddenByCluster","_cluster","edgeCount","clusters","usedNodes","relevantEdgeCount","gatheringSuccessful","childNodeId","_getConnectedId","clusterByEdgeCount","clusterNodeProperties","parentNodeId","parentClonedOptions","childClonedOptions","amountOfConnections","clusterEdgeProperties","childNode","otherNodeId","childKeys","createEdges","_edge","newEdge","clusteringEdgeReplacingId","processProperties","childNodesOptions","childEdgesOptions","clusterId","_getClusterPosition","clusterNode","containedNodes","containedEdges","_createClusterEdges","clusterNodeId","releaseFunction","clusterPosition","newPositions","edgesToBeDeleted","otherCluster","transferEdge","replacedEdge","nodesArray","average","averageSquared","hubCounter","largestHub","variance","standardDeviation","hubThreshold","_Node2","_Node3","Cluster","_Node","requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","msRequestAnimationFrame","CanvasRenderer","redrawRequested","renderingActive","renderRequests","allowRedraw","hideEdgesOnDrag","hideNodesOnDrag","_determineBrowserMethod","_resizeNodes","_requestRedraw","_startRendering","cancelAnimationFrame","_renderStep","_drawEdges","_drawNodes","controlNodesActive","_drawControlNodes","alwaysShow","topLeft","bottomRight","viewableArea","isSelected","isBoundingBoxOverlappingWith","browserType","Canvas","resizeTimer","resizeFunction","cameraState","hammerFrame","_cleanUp","previousWidth","previousHeight","currentViewCenter","distanceFromCenter","tabIndex","_prepareValue","emitEvent","oldWidth","oldHeight","previousRation","_getCameraState","_setCameraState","_XconvertCanvasToDOM","_YconvertCanvasToDOM","_XconvertDOMtoCanvas","_YconvertDOMtoCanvas","_NetworkUtil","_NetworkUtil2","View","animationSpeed","renderRefreshRate","animationEasingFunction","easingTime","sourceScale","targetScale","sourceTranslation","targetTranslation","lockedOnNodeId","lockedOnNodeOffset","touchTime","initialZoom","zoomLevel","positionDefined","_getRange","numberOfNodes","yDistance","xZoomLevel","yZoomLevel","_findCenter","animationOptions","nodePosition","lockedOnNode","animateView","locked","_transitionRedraw","viewCenter","_lockedRedraw","finished","NetworkUtil","allNodes","specificNodes","_componentsNavigationHandler","_componentsNavigationHandler2","_componentsPopup","_componentsPopup2","InteractionHandler","navigationHandler","popup","popupObj","popupTimer","dragNodes","dragView","keyboard","speed","bindToWindow","navigationButtons","tooltipDelay","zoomView","pinched","checkSelectionChanges","_generateClickEvent","previouslySelectedEdgeCount","_getSelectedEdgeCount","previouslySelectedNodeCount","_getSelectedNodeCount","previousSelection","selectAdditionalOnPoint","selectOnPoint","selectedEdgesCount","selectedNodesCount","currentSelection","_determineIfDifferent2","_determineIfDifferent","nodesChanges","edgesChanges","nodeSelected","selectObject","selectionObj","xFixed","yFixed","scaleOld","preScaleDragPointer","scaleFrac","tx","ty","postScaleDragPointer","popupVisible","_checkHidePopup","setPosition","_checkShowPopup","hoverObject","pointerObj","previousPopupObjId","nodeUnderCursor","popupType","overlappingNodes","isOverlappingWith","getTitle","overlappingEdges","popupTargetType","popupTargetId","setText","_pointerToPositionObject","stillOnObj","overNode","NavigationHandler","iconsCreated","navigationHammers","boundFunctions","activated","configureKeyboardBindings","loadNavigationElements","cleanNavigation","navigationDOM","navigationDivs","navigationDivActions","_fit","bindToRedraw","_stopMovement","boundAction","unbindFromRedraw","Popup","doShow","SelectionHandler","hoverObj","selectConnectedEdges","hoverConnectedEdges","updateSelection","selectionChanged","deselectObject","emptySelection","DOM","highlightEdges","_selectConnectedEdges","_addToSelection","_removeFromSelection","canvasPos","returnNode","positionObject","_getAllNodesOverlappingWith","_getEdgesOverlappingWith","returnEdge","_getAllEdgesOverlappingWith","clusterSize","_addToHover","hoverChanged","blurObject","_hoverConnectedEdges","edgeIds","idArray","RangeError","LayoutEngine","initialRandomSeed","optionsBackup","improvedLayout","hierarchical","levelSeparation","sortMethod","hierarchicalLevels","setupHierarchicalLayout","layoutNetwork","prevHierarchicalState","adaptAllOptions","MAX_LEVELS","clusterThreshold","startLength","before","clusterBridges","after","_declusterAll","info","kamadaKawai","_shiftToCenter","_getRangeCore","clustersPresent","definedLevel","undefinedLevel","nodeSpacing","_determineLevelsByHubsize","_determineLevelsDirected","distribution","_getDistribution","_placeNodesByHierarchy","positionedNodes","_placeBranchNodes","hubSize","_setLevelByHubsize","minLevel","_setLevelDirected","parentId","parentLevel","childNodeLevel","ManipulationSystem","editMode","manipulationDiv","editModeDiv","closeDiv","manipulationHammers","temporaryUIFunctions","temporaryEventFunctions","temporaryIds","guiEnabled","inMode","selectedControlNode","initiallyActive","addNode","addEdge","editEdge","deleteNode","deleteEdge","controlNodeStyle","_restore","_setup","showManipulatorToolbar","_createEditButton","manipulationDOM","selectedNodeCount","selectedEdgeCount","selectedTotalCount","needSeperator","_createAddNodeButton","_createSeperator","_createAddEdgeButton","_createEditNodeButton","_createEditEdgeButton","_createDeleteButton","_bindHammerToDiv","toggleEditMode","_temporaryBindEvent","_createBackButton","_createDescription","_performAddNode","_getSelectedNode","finalizedData","_temporaryBindUI","_handleConnect","_finishConnect","_dragControlNode","edgeBeingEditedId","controlNodeFrom","_getNewTargetNode","controlNodeTo","_controlNodeTouch","_controlNodeDragStart","_controlNodeDrag","_controlNodeDragEnd","findBorderPositions","selectedNodes","selectedEdges","deleteFunction","_createWrappers","_removeManipulationDOM","_createButton","_cleanManipulatorHammers","_cleanupTemporaryNodesAndEdges","_unbindTemporaryUIs","_unbindTemporaryEvents","labelClassName","newFunction","boundFunction","UIfunctionName","functionName","eventName","domElement","indexTempEdge","indexTempNode","lastTouch","fromSelect","toSelect","overlappingNodeIds","_performEditEdge","targetNode","connectionEdge","connectFromId","_performAddEdge","clickData","defaultData","sourceNodeId","targetNodeId","_this7","_componentsAlgorithmsFloydWarshallJs","_componentsAlgorithmsFloydWarshallJs2","KamadaKawai","edgeStrength","distanceSolver","edgesArray","ignoreClusters","D_matrix","getDistances","_createL_matrix","_createK_matrix","innerThreshold","maxInnerIterations","maxEnergy","highE_nodeId","dE_dx","dE_dy","delta_m","subIterations","_getHighestEnergyNode2","_getHighestEnergyNode","_getHighestEnergyNode22","_moveNode","_getEnergy2","_getEnergy","_getEnergy22","maxEnergyNodeId","dE_dx_max","dE_dy_max","nodeIdx","_getEnergy3","_getEnergy32","x_m","y_m","iIdx","x_i","y_i","denominator","K_matrix","L_matrix","d2E_dx2","d2E_dxdy","d2E_dy2","FloydWarshall","k","CanvasRenderingContext2D","square","s2","ir","triangleDown","star","diamond","r2d","kappa","ox","oy","xe","ye","xm","ym","wEllipse","hEllipse","ymb","yeb","xt","yt","xi","yi","xl","yl","xr","yr","patternLength","slope","distRemaining","patternIndex","dashLength","parseDOT","parseGraph","first","nextPreview","isAlphaNumeric","regexAlphaNumeric","setValue","graphs","attr","getToken","tokenType","TOKENTYPE","NULL","isComment","DELIMITER","c2","DELIMITERS","IDENTIFIER","newSyntaxError","UNKNOWN","chop","parseStatements","parseStatement","subgraph","parseSubgraph","parseEdge","parseAttributeStatement","parseNodeStatement","subgraphs","parseAttributeList","message","maxLength","forEach2","elem1","elem2","setProp","convertAttr","mapping","visProp","visPropI","graphData","dotNode","graphNode","NODE_ATTR_MAPPING","convertEdge","dotEdge","graphEdge","EDGE_ATTR_MAPPING","subEdge","fontsize","fontcolor","labelfontcolor","fontname","fillcolor","labeltooltip","{","}","[","]",";","=",",","->","--","gephiJSON","inheritColor","gEdges","gNodes","gEdge","gNode","imageBroken","url","imageToCache","brokenUrl","imageToLoadBrokenUrlOn","onerror","_addImageToCache","imageToRedrawWith","cachedImage","img","onload","_redrawWithImage","_tryloadBrokenUrl","edit","del","back","addDescription","edgeDescription","editEdgeDescription","createEdgeError","deleteClusterError","editClusterError"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyBA,cAEA,SAA2CA,EAAMC,GAC1B,gBAAZC,UAA0C,gBAAXC,QACxCA,OAAOD,QAAUD,IACQ,kBAAXG,SAAyBA,OAAOC,IAC9CD,UAAWH,GACe,gBAAZC,SACdA,QAAa,IAAID,IAEjBD,EAAU,IAAIC,KACbK,KAAM,WACT,MAAgB,UAAUC,GAKhB,QAASC,GAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,GAAUP,OAGnC,IAAIC,GAASO,EAAiBD,IAC7BP,WACAS,GAAIF,EACJG,QAAQ,EAUT,OANAL,GAAQE,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOS,QAAS,EAGTT,EAAOD,QAvBf,GAAIQ,KAqCJ,OATAF,GAAoBM,EAAIP,EAGxBC,EAAoBO,EAAIL,EAGxBF,EAAoBQ,EAAI,GAGjBR,EAAoB,KAK/B,SAASL,EAAQD,EAASM,GAK9BN,EAAQe,KAAOT,EAAoB,GACnCN,EAAQgB,QAAUV,EAAoB,GAGtCN,EAAQiB,QAAUX,EAAoB,GACtCN,EAAQkB,SAAWZ,EAAoB,IACvCN,EAAQmB,MAAQb,EAAoB,GAGpCN,EAAQoB,QAAUd,EAAoB,IACtCN,EAAQqB,SACNC,OAAQhB,EAAoB,IAC5BiB,OAAQjB,EAAoB,IAC5BkB,QAASlB,EAAoB,IAC7BmB,QAASnB,EAAoB,IAC7BoB,OAAQpB,EAAoB,IAC5BqB,WAAYrB,EAAoB,KAIlCN,EAAQ4B,SAAWtB,EAAoB,IACvCN,EAAQ6B,QAAUvB,EAAoB,IACtCN,EAAQ8B,UACNC,SAAUzB,EAAoB,IAC9B0B,SAAU1B,EAAoB,IAC9B2B,MAAO3B,EAAoB,IAC3B4B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+H,KAAM,WACNC,IAAK,uBACLC,KAAM,QACN7O,QAAS,iBACTC,QAAS,iBACTl3B,SAAU,gBACVm3B,SAAU,gBACV4O,eAAgB,uDAChBC,gBAAiB,6EACjBC,oBAAqB,kFACrBC,gBAAiB,wCACjBC,mBAAoB,0CACpBC,iBAAkB,0CAEpBr/H,EAAe,MAAIA,EAAY,GAC/BA,EAAe,MAAIA,EAAY"}
\ No newline at end of file
diff --git a/resources/visjs/vis.min.css b/resources/visjs/vis.min.css
new file mode 100644
index 00000000..554e3b1e
--- /dev/null
+++ b/resources/visjs/vis.min.css
@@ -0,0 +1 @@
+.vis-background,.vis-labelset,.vis-timeline{overflow:hidden}.vis .overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}.vis [class*=span]{min-height:0;width:auto}div.vis-configuration{position:relative;display:block;float:left;font-size:9pt}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration.vis-config-option-container{display:block;width:495px;background-color:#fff;border:2px solid #f7f8fa;border-radius:4px;margin-top:20px;left:10px;padding-left:5px}div.vis-configuration.vis-config-button{display:block;width:495px;height:25px;vertical-align:middle;line-height:25px;background-color:#f7f8fa;border:2px solid #ceced0;border-radius:4px;margin-top:20px;left:10px;padding-left:5px;cursor:pointer;margin-bottom:30px}div.vis-configuration.vis-config-button.hover{background-color:#4588e6;border:2px solid #214373;color:#fff}div.vis-configuration.vis-config-item{display:block;float:left;width:495px;height:25px;vertical-align:middle;line-height:25px}div.vis-configuration.vis-config-item.vis-config-s2{left:10px;background-color:#f7f8fa;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s3{left:20px;background-color:#e4e9f0;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s4{left:30px;background-color:#cfd8e6;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-header{font-size:18px;font-weight:700}div.vis-configuration.vis-config-label{width:90pt;height:25px;line-height:25px}div.vis-configuration.vis-config-label.vis-config-s3{width:110px}div.vis-configuration.vis-config-label.vis-config-s4{width:75pt}div.vis-configuration.vis-config-colorBlock{top:1px;width:30px;height:19px;border:1px solid #444;border-radius:2px;padding:0;margin:0;cursor:pointer}input.vis-configuration.vis-config-checkbox{left:-5px}input.vis-configuration.vis-config-rangeinput{position:relative;top:-5px;width:60px;height:13px;padding:1px;margin:0;pointer-events:none}.vis-panel,.vis-timeline{padding:0;box-sizing:border-box}input.vis-configuration.vis-config-range{-webkit-appearance:none;border:0 solid #fff;background-color:transparent;width:300px;height:20px}input.vis-configuration.vis-config-range::-webkit-slider-runnable-track{width:300px;height:5px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(to bottom,#dedede 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8', GradientType=0 );border:1px solid #999;box-shadow:#aaa 0 0 3px 0;border-radius:3px}input.vis-configuration.vis-config-range::-webkit-slider-thumb{-webkit-appearance:none;border:1px solid #14334b;height:17px;width:17px;border-radius:50%;background:#3876c2;background:-moz-linear-gradient(top,#3876c2 0,#385380 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3876c2),color-stop(100%,#385380));background:-webkit-linear-gradient(top,#3876c2 0,#385380 100%);background:-o-linear-gradient(top,#3876c2 0,#385380 100%);background:-ms-linear-gradient(top,#3876c2 0,#385380 100%);background:linear-gradient(to bottom,#3876c2 0,#385380 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#3876c2', endColorstr='#385380', GradientType=0 );box-shadow:#111927 0 0 1px 0;margin-top:-7px}input.vis-configuration.vis-config-range:focus{outline:0}input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track{background:#9d9d9d;background:-moz-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#9d9d9d),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-o-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:linear-gradient(to bottom,#9d9d9d 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#9d9d9d', endColorstr='#c8c8c8', GradientType=0 )}input.vis-configuration.vis-config-range::-moz-range-track{width:300px;height:10px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(to bottom,#dedede 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8', GradientType=0 );border:1px solid #999;box-shadow:#aaa 0 0 3px 0;border-radius:3px}input.vis-configuration.vis-config-range::-moz-range-thumb{border:none;height:1pc;width:1pc;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:-moz-focusring{outline:#fff solid 1px;outline-offset:-1px}input.vis-configuration.vis-config-range::-ms-track{width:300px;height:5px;background:0 0;border-color:transparent;border-width:6px 0;color:transparent}input.vis-configuration.vis-config-range::-ms-fill-lower{background:#777;border-radius:10px}input.vis-configuration.vis-config-range::-ms-fill-upper{background:#ddd;border-radius:10px}input.vis-configuration.vis-config-range::-ms-thumb{border:none;height:1pc;width:1pc;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:focus::-ms-fill-lower{background:#888}input.vis-configuration.vis-config-range:focus::-ms-fill-upper{background:#ccc}.vis-configuration-popup{position:absolute;background:rgba(57,76,89,.85);border:2px solid #f2faff;line-height:30px;height:30px;width:150px;text-align:center;color:#fff;font-size:14px;border-radius:4px;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.vis-configuration-popup:after,.vis-configuration-popup:before{left:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.vis-configuration-popup:after{border-color:rgba(136,183,213,0);border-left-color:rgba(57,76,89,.85);border-width:8px;margin-top:-8px}.vis-configuration-popup:before{border-color:rgba(194,225,245,0);border-left-color:#f2faff;border-width:9pt;margin-top:-9pt}.vis-timeline{position:relative;border:1px solid #bfbfbf;margin:0}.vis-panel{position:absolute;margin:0}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-left,.vis-panel.vis-right,.vis-panel.vis-top{border:1px #bfbfbf}.vis-panel.vis-center,.vis-panel.vis-left,.vis-panel.vis-right{border-top-style:solid;border-bottom-style:solid;overflow:hidden}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-top{border-left-style:solid;border-right-style:solid}.vis-panel>.vis-content{position:relative}.vis-panel .vis-shadow{position:absolute;width:100%;height:1px;box-shadow:0 0 10px rgba(0,0,0,.8)}.vis-itemset,.vis-labelset,.vis-labelset .vis-label{position:relative;box-sizing:border-box}.vis-panel .vis-shadow.vis-top{top:-1px;left:0}.vis-panel .vis-shadow.vis-bottom{bottom:-1px;left:0}.vis-labelset .vis-label{left:0;top:0;width:100%;color:#4d4d4d;border-bottom:1px solid #bfbfbf}.vis-labelset .vis-label.draggable{cursor:pointer}.vis-labelset .vis-label:last-child{border-bottom:none}.vis-labelset .vis-label .vis-inner{display:inline-block;padding:5px}.vis-labelset .vis-label .vis-inner.vis-hidden{padding:0}.vis-itemset{padding:0;margin:0}.vis-itemset .vis-background,.vis-itemset .vis-foreground{position:absolute;width:100%;height:100%;overflow:visible}.vis-axis{position:absolute;width:100%;height:0;left:0;z-index:1}.vis-foreground .vis-group{position:relative;box-sizing:border-box;border-bottom:1px solid #bfbfbf}.vis-foreground .vis-group:last-child{border-bottom:none}.vis-overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-item{position:absolute;color:#1A1A1A;border-color:#97B0F8;border-width:1px;background-color:#D5DDF6;display:inline-block}.vis-item.vis-point.vis-selected,.vis-item.vis-selected{background-color:#FFF785}.vis-item.vis-selected{border-color:#FFC200;z-index:2}.vis-editable.vis-selected{cursor:move}.vis-item.vis-box{text-align:center;border-style:solid;border-radius:2px}.vis-item.vis-point{background:0 0}.vis-item.vis-dot{position:absolute;padding:0;border-width:4px;border-style:solid;border-radius:4px}.vis-item.vis-range{border-style:solid;border-radius:2px;box-sizing:border-box}.vis-item.vis-background{border:none;background-color:rgba(213,221,246,.4);box-sizing:border-box;padding:0;margin:0}.vis-item .vis-item-overflow{position:relative;width:100%;height:100%;padding:0;margin:0;overflow:hidden}.vis-item.vis-range .vis-item-content{position:relative;display:inline-block}.vis-item.vis-background .vis-item-content{position:absolute;display:inline-block}.vis-item.vis-line{padding:0;position:absolute;width:0;border-left-width:1px;border-left-style:solid}.vis-item .vis-item-content{white-space:nowrap;box-sizing:border-box;padding:5px}.vis-item .vis-delete{background:url(img/timeline/delete.png) center no-repeat;position:absolute;width:24px;height:24px;top:-4px;right:-24px;cursor:pointer}.vis-item.vis-range .vis-drag-left{position:absolute;width:24px;max-width:20%;min-width:2px;height:100%;top:0;left:-4px;cursor:w-resize}.vis-item.vis-range .vis-drag-right{position:absolute;width:24px;max-width:20%;min-width:2px;height:100%;top:0;right:-4px;cursor:e-resize}.vis-time-axis{position:relative;overflow:hidden}.vis-time-axis.vis-foreground{top:0;left:0;width:100%}.vis-time-axis.vis-background{position:absolute;top:0;left:0;width:100%;height:100%}.vis-time-axis .vis-text{position:absolute;color:#4d4d4d;padding:3px;overflow:hidden;box-sizing:border-box;white-space:nowrap}.vis-time-axis .vis-text.vis-measure{position:absolute;padding-left:0;padding-right:0;margin-left:0;margin-right:0;visibility:hidden}.vis-time-axis .vis-grid.vis-vertical{position:absolute;border-left:1px solid}.vis-time-axis .vis-grid.vis-minor{border-color:#e5e5e5}.vis-time-axis .vis-grid.vis-major{border-color:#bfbfbf}.vis-current-time{background-color:#FF7F6E;width:2px;z-index:1}.vis-custom-time{background-color:#6E94FF;width:2px;cursor:move;z-index:1}div.vis-network div.vis-close,div.vis-network div.vis-edit-mode div.vis-button,div.vis-network div.vis-manipulation div.vis-button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-touch-callout:none;-khtml-user-select:none}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-horizontal{position:absolute;width:100%;height:0;border-bottom:1px solid}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-minor{border-color:#e5e5e5}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-major{border-color:#bfbfbf}.vis-data-axis .vis-y-axis.vis-major{width:100%;position:absolute;color:#4d4d4d;white-space:nowrap}.vis-data-axis .vis-y-axis.vis-major.vis-measure{padding:0;margin:0;border:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-minor{position:absolute;width:100%;color:#bebebe;white-space:nowrap}.vis-data-axis .vis-y-axis.vis-minor.vis-measure{padding:0;margin:0;border:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-title{position:absolute;color:#4d4d4d;white-space:nowrap;bottom:20px;text-align:center}.vis-data-axis .vis-y-axis.vis-title.vis-measure{padding:0;margin:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-title.vis-left{bottom:0;-webkit-transform-origin:left top;-moz-transform-origin:left top;-ms-transform-origin:left top;-o-transform-origin:left top;transform-origin:left bottom;-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)}.vis-data-axis .vis-y-axis.vis-title.vis-right{bottom:0;-webkit-transform-origin:right bottom;-moz-transform-origin:right bottom;-ms-transform-origin:right bottom;-o-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.vis-legend{background-color:rgba(247,252,255,.65);padding:5px;border:1px solid #b3b3b3;box-shadow:2px 2px 10px rgba(154,154,154,.55)}.vis-legend-text{white-space:nowrap;display:inline-block}.vis-graph-group0{fill:#4f81bd;fill-opacity:0;stroke-width:2px;stroke:#4f81bd}.vis-graph-group1{fill:#f79646;fill-opacity:0;stroke-width:2px;stroke:#f79646}.vis-graph-group2{fill:#8c51cf;fill-opacity:0;stroke-width:2px;stroke:#8c51cf}.vis-graph-group3{fill:#75c841;fill-opacity:0;stroke-width:2px;stroke:#75c841}.vis-graph-group4{fill:#ff0100;fill-opacity:0;stroke-width:2px;stroke:#ff0100}.vis-graph-group5{fill:#37d8e6;fill-opacity:0;stroke-width:2px;stroke:#37d8e6}.vis-graph-group6{fill:#042662;fill-opacity:0;stroke-width:2px;stroke:#042662}.vis-graph-group7{fill:#00ff26;fill-opacity:0;stroke-width:2px;stroke:#00ff26}.vis-graph-group8{fill:#f0f;fill-opacity:0;stroke-width:2px;stroke:#f0f}.vis-graph-group9{fill:#8f3938;fill-opacity:0;stroke-width:2px;stroke:#8f3938}.vis-timeline .vis-fill{fill-opacity:.1;stroke:none}.vis-timeline .vis-bar{fill-opacity:.5;stroke-width:1px}.vis-timeline .vis-point{stroke-width:2px;fill-opacity:1}.vis-timeline .vis-legend-background{stroke-width:1px;fill-opacity:.9;fill:#fff;stroke:#c2c2c2}.vis-timeline .vis-outline{stroke-width:1px;fill-opacity:1;fill:#fff;stroke:#e5e5e5}.vis-timeline .vis-icon-fill{fill-opacity:.3;stroke:none}div.vis-network div.vis-manipulation{border-width:0;border-bottom:1px;border-style:solid;border-color:#d6d9d8;background:#fff;background:-moz-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(48%,#fcfcfc),color-stop(50%,#fafafa),color-stop(100%,#fcfcfc));background:-webkit-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-o-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-ms-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:linear-gradient(to bottom,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#fcfcfc', GradientType=0 );padding-top:4px;position:absolute;left:0;top:0;width:100%;height:28px}div.vis-network div.vis-edit-mode{position:absolute;left:0;top:5px;height:30px}div.vis-network div.vis-close{position:absolute;right:0;top:0;width:30px;height:30px;background-position:20px 3px;background-repeat:no-repeat;background-image:url(img/network/cross.png);user-select:none}div.vis-network div.vis-close:hover{opacity:.6}div.vis-network div.vis-edit-mode div.vis-button,div.vis-network div.vis-manipulation div.vis-button{float:left;font-family:verdana;font-size:9pt;-moz-border-radius:15px;border-radius:15px;display:inline-block;background-position:0 0;background-repeat:no-repeat;height:24px;margin-left:10px;padding:0 8px;user-select:none}div.vis-network div.vis-manipulation div.vis-button:hover{box-shadow:1px 1px 8px rgba(0,0,0,.2)}div.vis-network div.vis-manipulation div.vis-button:active{box-shadow:1px 1px 8px rgba(0,0,0,.5)}div.vis-network div.vis-manipulation div.vis-button.vis-back{background-image:url(img/network/backIcon.png)}div.vis-network div.vis-manipulation div.vis-button.vis-none:hover{box-shadow:1px 1px 8px transparent;cursor:default}div.vis-network div.vis-manipulation div.vis-button.vis-none:active{box-shadow:1px 1px 8px transparent}div.vis-network div.vis-manipulation div.vis-button.vis-none{padding:0}div.vis-network div.vis-manipulation div.notification{margin:2px;font-weight:700}div.vis-network div.vis-manipulation div.vis-button.vis-add{background-image:url(img/network/addNodeIcon.png)}div.vis-network div.vis-edit-mode div.vis-button.vis-edit,div.vis-network div.vis-manipulation div.vis-button.vis-edit{background-image:url(img/network/editIcon.png)}div.vis-network div.vis-edit-mode div.vis-button.vis-edit.vis-edit-mode{background-color:#fcfcfc;border:1px solid #ccc}div.vis-network div.vis-manipulation div.vis-button.vis-connect{background-image:url(img/network/connectIcon.png)}div.vis-network div.vis-manipulation div.vis-button.vis-delete{background-image:url(img/network/deleteIcon.png)}div.vis-network div.vis-edit-mode div.vis-label,div.vis-network div.vis-manipulation div.vis-label{margin:0 0 0 23px;line-height:25px}div.vis-network div.vis-manipulation div.vis-separator-line{float:left;display:inline-block;width:1px;height:21px;background-color:#bdbdbd;margin:0 7px 0 15px}div.vis-network-tooltip{position:absolute;visibility:hidden;padding:5px;white-space:nowrap;font-family:verdana;font-size:14px;font-color:#000;background-color:#f5f4ed;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:1px solid #808074;box-shadow:3px 3px 10px rgba(0,0,0,.2);pointer-events:none}div.vis-network div.vis-navigation div.vis-button{width:34px;height:34px;-moz-border-radius:17px;border-radius:17px;position:absolute;display:inline-block;background-position:2px 2px;background-repeat:no-repeat;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div.vis-network div.vis-navigation div.vis-button:hover{box-shadow:0 0 3px 3px rgba(56,207,21,.3)}div.vis-network div.vis-navigation div.vis-button:active{box-shadow:0 0 1px 3px rgba(56,207,21,.95)}div.vis-network div.vis-navigation div.vis-button.vis-up{background-image:url(img/network/upArrow.png);bottom:50px;left:55px}div.vis-network div.vis-navigation div.vis-button.vis-down{background-image:url(img/network/downArrow.png);bottom:10px;left:55px}div.vis-network div.vis-navigation div.vis-button.vis-left{background-image:url(img/network/leftArrow.png);bottom:10px;left:15px}div.vis-network div.vis-navigation div.vis-button.vis-right{background-image:url(img/network/rightArrow.png);bottom:10px;left:95px}div.vis-network div.vis-navigation div.vis-button.vis-zoomIn{background-image:url(img/network/plus.png);bottom:10px;right:15px}div.vis-network div.vis-navigation div.vis-button.vis-zoomOut{background-image:url(img/network/minus.png);bottom:10px;right:55px}div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends{background-image:url(img/network/zoomExtends.png);bottom:50px;right:15px}div.vis-color-picker{position:absolute;margin-top:-140px;margin-left:30px;width:293px;height:425px;padding:10px;border-radius:15px;background-color:#fff;display:none;box-shadow:rgba(0,0,0,.5) 0 0 10px 0}div.vis-color-picker div.vis-arrow{position:absolute;top:147px;left:5px}div.vis-color-picker div.vis-arrow:after,div.vis-color-picker div.vis-arrow:before{right:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}div.vis-color-picker div.vis-arrow:after{border-color:rgba(255,255,255,0);border-right-color:#fff;border-width:30px;margin-top:-30px}div.vis-color-picker div.vis-color{position:absolute;width:289px;height:289px;cursor:pointer}div.vis-color-picker div.vis-brightness{position:absolute;top:313px}div.vis-color-picker div.vis-opacity{position:absolute;top:350px}div.vis-color-picker div.vis-selector{position:absolute;top:137px;left:137px;width:15px;height:15px;border-radius:15px;border:1px solid #fff;background:#4c4c4c;background:-moz-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4c4c4c),color-stop(12%,#595959),color-stop(25%,#666),color-stop(39%,#474747),color-stop(50%,#2c2c2c),color-stop(51%,#000),color-stop(60%,#111),color-stop(76%,#2b2b2b),color-stop(91%,#1c1c1c),color-stop(100%,#131313));background:-webkit-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-o-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-ms-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:linear-gradient(to bottom,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#4c4c4c', endColorstr='#131313', GradientType=0 )}div.vis-color-picker div.vis-initial-color,div.vis-color-picker div.vis-new-color{width:140px;height:20px;top:380px;font-size:10px;color:rgba(0,0,0,.4);line-height:20px;position:absolute;vertical-align:middle}div.vis-color-picker div.vis-new-color{border:1px solid rgba(0,0,0,.1);border-radius:5px;left:159px;text-align:right;padding-right:2px}div.vis-color-picker div.vis-initial-color{border:1px solid rgba(0,0,0,.1);border-radius:5px;left:10px;text-align:left;padding-left:2px}div.vis-color-picker div.vis-label{position:absolute;width:300px;left:10px}div.vis-color-picker div.vis-label.vis-brightness{top:300px}div.vis-color-picker div.vis-label.vis-opacity{top:338px}div.vis-color-picker div.vis-button{position:absolute;width:68px;height:25px;border-radius:10px;vertical-align:middle;text-align:center;line-height:25px;top:410px;border:2px solid #d9d9d9;background-color:#f7f7f7;cursor:pointer}div.vis-color-picker div.vis-button.vis-cancel{left:5px}div.vis-color-picker div.vis-button.vis-load{left:82px}div.vis-color-picker div.vis-button.vis-apply{left:159px}div.vis-color-picker div.vis-button.vis-save{left:236px}div.vis-color-picker input.vis-range{width:290px;height:20px}
\ No newline at end of file
diff --git a/resources/visjs/vis.min.js b/resources/visjs/vis.min.js
new file mode 100644
index 00000000..6fc4277b
--- /dev/null
+++ b/resources/visjs/vis.min.js
@@ -0,0 +1,44 @@
+/**
+ * vis.js
+ * https://github.com/almende/vis
+ *
+ * A dynamic, browser-based visualization library.
+ *
+ * @version 4.9.0
+ * @date 2015-10-01
+ *
+ * @license
+ * Copyright (C) 2011-2015 Almende B.V, http://almende.com
+ *
+ * Vis.js is dual licensed under both
+ *
+ * * The Apache 2.0 License
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * and
+ *
+ * * The MIT License
+ * http://opensource.org/licenses/MIT
+ *
+ * Vis.js may be distributed under either license.
+ */
+"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.vis=e():t.vis=e()}(this,function(){return function(t){function e(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){e.util=i(1),e.DOMutil=i(7),e.DataSet=i(8),e.DataView=i(10),e.Queue=i(9),e.Graph3d=i(11),e.graph3d={Camera:i(15),Filter:i(16),Point2d:i(14),Point3d:i(13),Slider:i(17),StepNumber:i(18)},e.Timeline=i(19),e.Graph2d=i(49),e.timeline={DateUtil:i(27),DataStep:i(52),Range:i(24),stack:i(32),TimeStep:i(30),components:{items:{Item:i(34),BackgroundItem:i(38),BoxItem:i(36),PointItem:i(37),RangeItem:i(33)},Component:i(26),CurrentTime:i(44),CustomTime:i(42),DataAxis:i(51),GraphGroup:i(53),Group:i(31),BackgroundGroup:i(35),ItemSet:i(29),Legend:i(57),LineGraph:i(50),TimeAxis:i(39)}},e.Network=i(59),e.network={Images:i(117),dotparser:i(115),gephiParser:i(116),allOptions:i(111)},e.network.convertDot=function(t){return e.network.dotparser.DOTToGraph(t)},e.network.convertGephi=function(t,i){return e.network.gephiParser.parseGephi(t,i)},e.moment=i(2),e.Hammer=i(20),e.keycharm=i(41)},function(t,e,i){var o=i(2),n=i(6);e.isNumber=function(t){return t instanceof Number||"number"==typeof t},e.recursiveDOMDelete=function(t){if(t)for(;t.hasChildNodes()===!0;)e.recursiveDOMDelete(t.firstChild),t.removeChild(t.firstChild)},e.giveRange=function(t,e,i,o){if(e==t)return.5;var n=1/(e-t);return Math.max(0,(o-t)*n)},e.isString=function(t){return t instanceof String||"string"==typeof t},e.isDate=function(t){if(t instanceof Date)return!0;if(e.isString(t)){var i=s.exec(t);if(i)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},e.randomUUID=function(){return n.v4()},e.assignAllKeys=function(t,e){for(var i in t)t.hasOwnProperty(i)&&"object"!=typeof t[i]&&(t[i]=e)},e.fillIfDefined=function(t,i){var o=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];for(var n in t)void 0!==i[n]&&("object"!=typeof i[n]?void 0!==i[n]&&null!==i[n]||void 0===t[n]||o!==!0?t[n]=i[n]:delete t[n]:"object"==typeof t[n]&&e.fillIfDefined(t[n],i[n],o))},e.protoExtend=function(t,e){for(var i=1;ii;i++)if(t[i]!=e[i])return!1;return!0},e.convert=function(t,i){var n;if(void 0===t)return void 0;if(null===t)return null;if(!i)return t;if("string"!=typeof i&&!(i instanceof String))throw new Error("Type must be a string");switch(i){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return Number(t.valueOf());case"string":case"String":return String(t);case"Date":if(e.isNumber(t))return new Date(t);if(t instanceof Date)return new Date(t.valueOf());if(o.isMoment(t))return new Date(t.valueOf());if(e.isString(t))return n=s.exec(t),n?new Date(Number(n[1])):o(t).toDate();throw new Error("Cannot convert object of type "+e.getType(t)+" to type Date");case"Moment":if(e.isNumber(t))return o(t);if(t instanceof Date)return o(t.valueOf());if(o.isMoment(t))return o(t);if(e.isString(t))return n=s.exec(t),o(n?Number(n[1]):t);throw new Error("Cannot convert object of type "+e.getType(t)+" to type Date");case"ISODate":if(e.isNumber(t))return new Date(t);if(t instanceof Date)return t.toISOString();if(o.isMoment(t))return t.toDate().toISOString();if(e.isString(t))return n=s.exec(t),n?new Date(Number(n[1])).toISOString():new Date(t).toISOString();throw new Error("Cannot convert object of type "+e.getType(t)+" to type ISODate");case"ASPDate":if(e.isNumber(t))return"/Date("+t+")/";if(t instanceof Date)return"/Date("+t.valueOf()+")/";if(e.isString(t)){n=s.exec(t);var r;return r=n?new Date(Number(n[1])).valueOf():new Date(t).valueOf(),"/Date("+r+")/"}throw new Error("Cannot convert object of type "+e.getType(t)+" to type ASPDate");default:throw new Error('Unknown type "'+i+'"')}};var s=/^\/?Date\((\-?\d+)/i;e.getType=function(t){var e=typeof t;return"object"==e?null===t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":Array.isArray(t)?"Array":t instanceof Date?"Date":"Object":"number"==e?"Number":"boolean"==e?"Boolean":"string"==e?"String":void 0===e?"undefined":e},e.copyAndExtendArray=function(t,e){for(var i=[],o=0;oi;i++)e(t[i],i,t);else for(i in t)t.hasOwnProperty(i)&&e(t[i],i,t)},e.toArray=function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(t[i]);return e},e.updateProperty=function(t,e,i){return t[e]!==i?(t[e]=i,!0):!1},e.throttle=function(t,e){var i=null,o=!1;return function n(){i?o=!0:(o=!1,t(),i=setTimeout(function(){i=null,o&&n()},e))}},e.addEventListener=function(t,e,i,o){t.addEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,o)):t.attachEvent("on"+e,i)},e.removeEventListener=function(t,e,i,o){t.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,o)):t.detachEvent("on"+e,i)},e.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},e.getTarget=function(t){t||(t=window.event);var e;return t.target?e=t.target:t.srcElement&&(e=t.srcElement),void 0!=e.nodeType&&3==e.nodeType&&(e=e.parentNode),e},e.hasParent=function(t,e){for(var i=t;i;){if(i===e)return!0;i=i.parentNode}return!1},e.option={},e.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},e.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},e.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?String(t):e||null},e.option.asSize=function(t,i){return"function"==typeof t&&(t=t()),e.isString(t)?t:e.isNumber(t)?t+"px":i||null},e.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},e.hexToRGB=function(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,i,o){return e+e+i+i+o+o});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},e.overrideOpacity=function(t,i){if(-1!=t.indexOf("rgba"))return t;if(-1!=t.indexOf("rgb")){var o=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+o[0]+","+o[1]+","+o[2]+","+i+")"}var o=e.hexToRGB(t);return null==o?t:"rgba("+o.r+","+o.g+","+o.b+","+i+")"},e.RGBToHex=function(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},e.parseColor=function(t){var i;if(e.isString(t)===!0){if(e.isValidRGB(t)===!0){var o=t.substr(4).substr(0,t.length-5).split(",").map(function(t){return parseInt(t)});t=e.RGBToHex(o[0],o[1],o[2])}if(e.isValidHex(t)===!0){var n=e.hexToHSV(t),s={h:n.h,s:.8*n.s,v:Math.min(1,1.02*n.v)},r={h:n.h,s:Math.min(1,1.25*n.s),v:.8*n.v},a=e.HSVToHex(r.h,r.s,r.v),h=e.HSVToHex(s.h,s.s,s.v);i={background:t,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}else i={background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else i={},i.background=t.background||void 0,i.border=t.border||void 0,e.isString(t.highlight)?i.highlight={border:t.highlight,background:t.highlight}:(i.highlight={},i.highlight.background=t.highlight&&t.highlight.background||void 0,i.highlight.border=t.highlight&&t.highlight.border||void 0),e.isString(t.hover)?i.hover={border:t.hover,background:t.hover}:(i.hover={},i.hover.background=t.hover&&t.hover.background||void 0,i.hover.border=t.hover&&t.hover.border||void 0);return i},e.RGBToHSV=function(t,e,i){t/=255,e/=255,i/=255;var o=Math.min(t,Math.min(e,i)),n=Math.max(t,Math.max(e,i));if(o==n)return{h:0,s:0,v:o};var s=t==o?e-i:i==o?t-e:i-t,r=t==o?3:i==o?1:5,a=60*(r-s/(n-o))/360,h=(n-o)/n,d=n;return{h:a,s:h,v:d}};var r={split:function(t){var e={};return t.split(";").forEach(function(t){if(""!=t.trim()){var i=t.split(":"),o=i[0].trim(),n=i[1].trim();e[o]=n}}),e},join:function(t){return Object.keys(t).map(function(e){return e+": "+t[e]}).join("; ")}};e.addCssText=function(t,i){var o=r.split(t.style.cssText),n=r.split(i),s=e.extend(o,n);t.style.cssText=r.join(s)},e.removeCssText=function(t,e){var i=r.split(t.style.cssText),o=r.split(e);for(var n in o)o.hasOwnProperty(n)&&delete i[n];t.style.cssText=r.join(i)},e.HSVToRGB=function(t,e,i){var o,n,s,r=Math.floor(6*t),a=6*t-r,h=i*(1-e),d=i*(1-a*e),l=i*(1-(1-a)*e);switch(r%6){case 0:o=i,n=l,s=h;break;case 1:o=d,n=i,s=h;break;case 2:o=h,n=i,s=l;break;case 3:o=h,n=d,s=i;break;case 4:o=l,n=h,s=i;break;case 5:o=i,n=h,s=d}return{r:Math.floor(255*o),g:Math.floor(255*n),b:Math.floor(255*s)}},e.HSVToHex=function(t,i,o){var n=e.HSVToRGB(t,i,o);return e.RGBToHex(n.r,n.g,n.b)},e.hexToHSV=function(t){var i=e.hexToRGB(t);return e.RGBToHSV(i.r,i.g,i.b)},e.isValidHex=function(t){var e=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);return e},e.isValidRGB=function(t){t=t.replace(" ","");var e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(t);return e},e.isValidRGBA=function(t){t=t.replace(" ","");var e=/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(t);return e},e.selectiveBridgeObject=function(t,i){if("object"==typeof i){for(var o=Object.create(i),n=0;n=r&&n>s;){var h=Math.floor((r+a)/2),d=t[h],l=void 0===o?d[i]:d[i][o],u=e(l);if(0==u)return h;-1==u?r=h+1:a=h-1,s++}return-1},e.binarySearchValue=function(t,e,i,o){for(var n,s,r,a,h=1e4,d=0,l=0,u=t.length-1;u>=l&&h>d;){if(a=Math.floor(.5*(u+l)),n=t[Math.max(0,a-1)][i],s=t[a][i],r=t[Math.min(t.length-1,a+1)][i],s==e)return a;if(e>n&&s>e)return"before"==o?Math.max(0,a-1):a;if(e>s&&r>e)return"before"==o?a:Math.min(t.length-1,a+1);e>s?l=a+1:u=a-1,d++}return-1},e.easingFunctions={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return.5>t?2*t*t:-1+(4-2*t)*t},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return.5>t?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return.5>t?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return.5>t?16*t*t*t*t*t:1+16*--t*t*t*t*t}}},function(t,e,i){t.exports="undefined"!=typeof window&&window.moment||i(3)},function(t,e,i){(function(t){!function(e,i){t.exports=i()}(this,function(){function e(){return Ni.apply(null,arguments)}function i(t){Ni=t}function o(t){return"[object Array]"===Object.prototype.toString.call(t)}function n(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function s(t,e){var i,o=[];for(i=0;i0)for(i in Ai)o=Ai[i],n=e[o],"undefined"!=typeof n&&(t[o]=n);return t}function f(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),Bi===!1&&(Bi=!0,e.updateOffset(this),Bi=!1)}function m(t){return t instanceof f||null!=t&&null!=t._isAMomentObject}function v(t){return 0>t?Math.ceil(t):Math.floor(t)}function g(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=v(e)),i}function y(t,e,i){var o,n=Math.min(t.length,e.length),s=Math.abs(t.length-e.length),r=0;for(o=0;n>o;o++)(i&&t[o]!==e[o]||!i&&g(t[o])!==g(e[o]))&&r++;return r+s}function b(){}function w(t){return t?t.toLowerCase().replace("_","-"):t}function _(t){for(var e,i,o,n,s=0;s0;){if(o=x(n.slice(0,e).join("-")))return o;if(i&&i.length>=e&&y(n,i,!0)>=e-1)break;e--}s++}return null}function x(e){var i=null;if(!Ri[e]&&"undefined"!=typeof t&&t&&t.exports)try{i=Li._abbr,!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),k(i)}catch(o){}return Ri[e]}function k(t,e){var i;return t&&(i="undefined"==typeof e?D(t):O(t,e),i&&(Li=i)),Li._abbr}function O(t,e){return null!==e?(e.abbr=t,Ri[t]=Ri[t]||new b,Ri[t].set(e),k(t),Ri[t]):(delete Ri[t],null)}function D(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Li;if(!o(t)){if(e=x(t))return e;t=[t]}return _(t)}function M(t,e){var i=t.toLowerCase();Fi[i]=Fi[i+"s"]=Fi[e]=t}function C(t){return"string"==typeof t?Fi[t]||Fi[t.toLowerCase()]:void 0}function T(t){var e,i,o={};for(i in t)r(t,i)&&(e=C(i),e&&(o[e]=t[i]));return o}function E(t,i){return function(o){return null!=o?(P(this,t,o),e.updateOffset(this,i),this):S(this,t)}}function S(t,e){return t._d["get"+(t._isUTC?"UTC":"")+e]()}function P(t,e,i){return t._d["set"+(t._isUTC?"UTC":"")+e](i)}function I(t,e){var i;if("object"==typeof t)for(i in t)this.set(i,t[i]);else if(t=C(t),"function"==typeof this[t])return this[t](e);return this}function z(t,e,i){var o=""+Math.abs(t),n=e-o.length,s=t>=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+o}function N(t,e,i,o){var n=o;"string"==typeof o&&(n=function(){return this[o]()}),t&&(Yi[t]=n),e&&(Yi[e[0]]=function(){return z(n.apply(this,arguments),e[1],e[2])}),i&&(Yi[i]=function(){return this.localeData().ordinal(n.apply(this,arguments),t)})}function L(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function A(t){var e,i,o=t.match(ji);for(e=0,i=o.length;i>e;e++)Yi[o[e]]?o[e]=Yi[o[e]]:o[e]=L(o[e]);return function(n){var s="";for(e=0;i>e;e++)s+=o[e]instanceof Function?o[e].call(n,t):o[e];return s}}function B(t,e){return t.isValid()?(e=R(e,t.localeData()),Wi[e]=Wi[e]||A(e),Wi[e](t)):t.localeData().invalidDate()}function R(t,e){function i(t){return e.longDateFormat(t)||t}var o=5;for(Hi.lastIndex=0;o>=0&&Hi.test(t);)t=t.replace(Hi,i),Hi.lastIndex=0,o-=1;return t}function F(t){return"function"==typeof t&&"[object Function]"===Object.prototype.toString.call(t)}function j(t,e,i){no[t]=F(e)?e:function(t){return t&&i?i:e}}function H(t,e){return r(no,t)?no[t](e._strict,e._locale):new RegExp(W(t))}function W(t){return t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,i,o,n){return e||i||o||n}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Y(t,e){var i,o=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(o=function(t,i){i[e]=g(t)}),i=0;io;o++){if(n=h([2e3,o]),i&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(n,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(n,"").replace(".","")+"$","i")),i||this._monthsParse[o]||(s="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[o]=new RegExp(s.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[o].test(t))return o;if(i&&"MMM"===e&&this._shortMonthsParse[o].test(t))return o;if(!i&&this._monthsParse[o].test(t))return o}}function K(t,e){var i;return"string"==typeof e&&(e=t.localeData().monthsParse(e),"number"!=typeof e)?t:(i=Math.min(t.date(),V(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,i),t)}function J(t){return null!=t?(K(this,t),e.updateOffset(this,!0),this):S(this,"Month")}function Q(){return V(this.year(),this.month())}function $(t){var e,i=t._a;return i&&-2===l(t).overflow&&(e=i[ao]<0||i[ao]>11?ao:i[ho]<1||i[ho]>V(i[ro],i[ao])?ho:i[lo]<0||i[lo]>24||24===i[lo]&&(0!==i[uo]||0!==i[co]||0!==i[po])?lo:i[uo]<0||i[uo]>59?uo:i[co]<0||i[co]>59?co:i[po]<0||i[po]>999?po:-1,l(t)._overflowDayOfYear&&(ro>e||e>ho)&&(e=ho),l(t).overflow=e),t}function tt(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function et(t,e){var i=!0;return a(function(){return i&&(tt(t+"\n"+(new Error).stack),i=!1),e.apply(this,arguments)},e)}function it(t,e){vo[t]||(tt(e),vo[t]=!0)}function ot(t){var e,i,o=t._i,n=go.exec(o);if(n){for(l(t).iso=!0,e=0,i=yo.length;i>e;e++)if(yo[e][1].exec(o)){t._f=yo[e][0];break}for(e=0,i=bo.length;i>e;e++)if(bo[e][1].exec(o)){t._f+=(n[6]||" ")+bo[e][0];break}o.match(eo)&&(t._f+="Z"),xt(t)}else t._isValid=!1}function nt(t){var i=wo.exec(t._i);return null!==i?void(t._d=new Date(+i[1])):(ot(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function st(t,e,i,o,n,s,r){var a=new Date(t,e,i,o,n,s,r);return 1970>t&&a.setFullYear(t),a}function rt(t){var e=new Date(Date.UTC.apply(null,arguments));return 1970>t&&e.setUTCFullYear(t),e}function at(t){return ht(t)?366:365}function ht(t){return t%4===0&&t%100!==0||t%400===0}function dt(){return ht(this.year())}function lt(t,e,i){var o,n=i-e,s=i-t.day();return s>n&&(s-=7),n-7>s&&(s+=7),o=St(t).add(s,"d"),{week:Math.ceil(o.dayOfYear()/7),year:o.year()}}function ut(t){return lt(t,this._week.dow,this._week.doy).week}function ct(){return this._week.dow}function pt(){return this._week.doy}function ft(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function mt(t){var e=lt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function vt(t,e,i,o,n){var s,r=6+n-o,a=rt(t,0,1+r),h=a.getUTCDay();return n>h&&(h+=7),i=null!=i?1*i:n,s=1+r+7*(e-1)-h+i,{year:s>0?t:t-1,dayOfYear:s>0?s:at(t-1)+s}}function gt(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function yt(t,e,i){return null!=t?t:null!=e?e:i}function bt(t){var e=new Date;return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function wt(t){var e,i,o,n,s=[];if(!t._d){for(o=bt(t),t._w&&null==t._a[ho]&&null==t._a[ao]&&_t(t),t._dayOfYear&&(n=yt(t._a[ro],o[ro]),t._dayOfYear>at(n)&&(l(t)._overflowDayOfYear=!0),i=rt(n,0,t._dayOfYear),t._a[ao]=i.getUTCMonth(),t._a[ho]=i.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=s[e]=o[e];for(;7>e;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[lo]&&0===t._a[uo]&&0===t._a[co]&&0===t._a[po]&&(t._nextDay=!0,t._a[lo]=0),t._d=(t._useUTC?rt:st).apply(null,s),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[lo]=24)}}function _t(t){var e,i,o,n,s,r,a;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(s=1,r=4,i=yt(e.GG,t._a[ro],lt(St(),1,4).year),o=yt(e.W,1),n=yt(e.E,1)):(s=t._locale._week.dow,r=t._locale._week.doy,i=yt(e.gg,t._a[ro],lt(St(),s,r).year),o=yt(e.w,1),null!=e.d?(n=e.d,s>n&&++o):n=null!=e.e?e.e+s:s),a=vt(i,o,n,r,s),t._a[ro]=a.year,t._dayOfYear=a.dayOfYear}function xt(t){if(t._f===e.ISO_8601)return void ot(t);t._a=[],l(t).empty=!0;var i,o,n,s,r,a=""+t._i,h=a.length,d=0;for(n=R(t._f,t._locale).match(ji)||[],i=0;i0&&l(t).unusedInput.push(r),a=a.slice(a.indexOf(o)+o.length),d+=o.length),Yi[s]?(o?l(t).empty=!1:l(t).unusedTokens.push(s),U(s,o,t)):t._strict&&!o&&l(t).unusedTokens.push(s);l(t).charsLeftOver=h-d,a.length>0&&l(t).unusedInput.push(a),l(t).bigHour===!0&&t._a[lo]<=12&&t._a[lo]>0&&(l(t).bigHour=void 0),t._a[lo]=kt(t._locale,t._a[lo],t._meridiem),wt(t),$(t)}function kt(t,e,i){var o;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?(o=t.isPM(i),o&&12>e&&(e+=12),o||12!==e||(e=0),e):e}function Ot(t){var e,i,o,n,s;if(0===t._f.length)return l(t).invalidFormat=!0,void(t._d=new Date(NaN));for(n=0;ns)&&(o=s,i=e));a(t,i||e)}function Dt(t){if(!t._d){var e=T(t._i);t._a=[e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],wt(t)}}function Mt(t){var e=new f($(Ct(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Ct(t){var e=t._i,i=t._f;return t._locale=t._locale||D(t._l),null===e||void 0===i&&""===e?c({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),m(e)?new f($(e)):(o(i)?Ot(t):i?xt(t):n(e)?t._d=e:Tt(t),t))}function Tt(t){var i=t._i;void 0===i?t._d=new Date:n(i)?t._d=new Date(+i):"string"==typeof i?nt(t):o(i)?(t._a=s(i.slice(0),function(t){return parseInt(t,10)}),wt(t)):"object"==typeof i?Dt(t):"number"==typeof i?t._d=new Date(i):e.createFromInputFallback(t)}function Et(t,e,i,o,n){var s={};return"boolean"==typeof i&&(o=i,i=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=n,s._l=i,s._i=t,s._f=e,s._strict=o,Mt(s)}function St(t,e,i,o){return Et(t,e,i,o,!1)}function Pt(t,e){var i,n;if(1===e.length&&o(e[0])&&(e=e[0]),!e.length)return St();for(i=e[0],n=1;nt&&(t=-t,i="-"),i+z(~~(t/60),2)+e+z(~~t%60,2)})}function Bt(t){var e=(t||"").match(eo)||[],i=e[e.length-1]||[],o=(i+"").match(Do)||["-",0,0],n=+(60*o[1])+g(o[2]);return"+"===o[0]?n:-n}function Rt(t,i){var o,s;return i._isUTC?(o=i.clone(),s=(m(t)||n(t)?+t:+St(t))-+o,o._d.setTime(+o._d+s),e.updateOffset(o,!1),o):St(t).local()}function Ft(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function jt(t,i){var o,n=this._offset||0;return null!=t?("string"==typeof t&&(t=Bt(t)),Math.abs(t)<16&&(t=60*t),!this._isUTC&&i&&(o=Ft(this)),this._offset=t,this._isUTC=!0,null!=o&&this.add(o,"m"),n!==t&&(!i||this._changeInProgress?ie(this,Jt(t-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?n:Ft(this)}function Ht(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Wt(t){return this.utcOffset(0,t)}function Yt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ft(this),"m")),this}function Gt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Bt(this._i)),this}function Ut(t){return t=t?St(t).utcOffset():0,(this.utcOffset()-t)%60===0}function Vt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function qt(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var t={};if(p(t,this),t=Ct(t),t._a){var e=t._isUTC?h(t._a):St(t._a);this._isDSTShifted=this.isValid()&&y(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Xt(){return!this._isUTC}function Zt(){return this._isUTC}function Kt(){return this._isUTC&&0===this._offset}function Jt(t,e){var i,o,n,s=t,a=null;return Lt(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(s={},e?s[e]=t:s.milliseconds=t):(a=Mo.exec(t))?(i="-"===a[1]?-1:1,s={y:0,d:g(a[ho])*i,h:g(a[lo])*i,m:g(a[uo])*i,s:g(a[co])*i,ms:g(a[po])*i}):(a=Co.exec(t))?(i="-"===a[1]?-1:1,s={y:Qt(a[2],i),M:Qt(a[3],i),d:Qt(a[4],i),h:Qt(a[5],i),m:Qt(a[6],i),s:Qt(a[7],i),w:Qt(a[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(n=te(St(s.from),St(s.to)),s={},s.ms=n.milliseconds,s.M=n.months),o=new Nt(s),Lt(t)&&r(t,"_locale")&&(o._locale=t._locale),o}function Qt(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function $t(t,e){var i={milliseconds:0,months:0};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function te(t,e){var i;return e=Rt(e,t),t.isBefore(e)?i=$t(t,e):(i=$t(e,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i}function ee(t,e){return function(i,o){var n,s;return null===o||isNaN(+o)||(it(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),s=i,i=o,o=s),i="string"==typeof i?+i:i,n=Jt(i,o),ie(this,n,t),this}}function ie(t,i,o,n){var s=i._milliseconds,r=i._days,a=i._months;n=null==n?!0:n,s&&t._d.setTime(+t._d+s*o),r&&P(t,"Date",S(t,"Date")+r*o),a&&K(t,S(t,"Month")+a*o),n&&e.updateOffset(t,r||a)}function oe(t,e){var i=t||St(),o=Rt(i,this).startOf("day"),n=this.diff(o,"days",!0),s=-6>n?"sameElse":-1>n?"lastWeek":0>n?"lastDay":1>n?"sameDay":2>n?"nextDay":7>n?"nextWeek":"sameElse";return this.format(e&&e[s]||this.localeData().calendar(s,this,St(i)))}function ne(){return new f(this)}function se(t,e){var i;return e=C("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=m(t)?t:St(t),+this>+t):(i=m(t)?+t:+St(t),i<+this.clone().startOf(e))}function re(t,e){var i;return e=C("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=m(t)?t:St(t),+t>+this):(i=m(t)?+t:+St(t),+this.clone().endOf(e)e-s?(i=t.clone().add(n-1,"months"),o=(e-s)/(s-i)):(i=t.clone().add(n+1,"months"),o=(e-s)/(i-s)),-(n+o)}function ue(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ce(){var t=this.clone().utc();return 0e;e++)if(this._weekdaysParse[e]||(i=St([2e3,1]).day(e),o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[e]=new RegExp(o.replace(".",""),"i")),this._weekdaysParse[e].test(t))return e}function We(t){var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Be(t,this.localeData()),this.add(t-e,"d")):e}function Ye(t){var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Ge(t){return null==t?this.day()||7:this.day(this.day()%7?t:t-7)}function Ue(t,e){N(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Ve(t,e){return e._meridiemParse}function qe(t){return"p"===(t+"").toLowerCase().charAt(0)}function Xe(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"}function Ze(t,e){e[po]=g(1e3*("0."+t))}function Ke(){return this._isUTC?"UTC":""}function Je(){return this._isUTC?"Coordinated Universal Time":""}function Qe(t){return St(1e3*t)}function $e(){return St.apply(null,arguments).parseZone()}function ti(t,e,i){var o=this._calendar[t];return"function"==typeof o?o.call(e,i):o}function ei(t){var e=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return e||!i?e:(this._longDateFormat[t]=i.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function ii(){return this._invalidDate}function oi(t){return this._ordinal.replace("%d",t)}function ni(t){return t}function si(t,e,i,o){var n=this._relativeTime[i];return"function"==typeof n?n(t,e,i,o):n.replace(/%d/i,t)}function ri(t,e){var i=this._relativeTime[t>0?"future":"past"];return"function"==typeof i?i(e):i.replace(/%s/i,e)}function ai(t){var e,i;for(i in t)e=t[i],"function"==typeof e?this[i]=e:this["_"+i]=e;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function hi(t,e,i,o){var n=D(),s=h().set(o,e);return n[i](s,t)}function di(t,e,i,o,n){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return hi(t,e,i,n);var s,r=[];for(s=0;o>s;s++)r[s]=hi(t,s,i,n);return r}function li(t,e){return di(t,e,"months",12,"month")}function ui(t,e){return di(t,e,"monthsShort",12,"month")}function ci(t,e){return di(t,e,"weekdays",7,"day")}function pi(t,e){return di(t,e,"weekdaysShort",7,"day")}function fi(t,e){return di(t,e,"weekdaysMin",7,"day")}function mi(){var t=this._data;return this._milliseconds=Ko(this._milliseconds),this._days=Ko(this._days),this._months=Ko(this._months),t.milliseconds=Ko(t.milliseconds),t.seconds=Ko(t.seconds),t.minutes=Ko(t.minutes),t.hours=Ko(t.hours),t.months=Ko(t.months),t.years=Ko(t.years),this}function vi(t,e,i,o){var n=Jt(e,i);return t._milliseconds+=o*n._milliseconds,t._days+=o*n._days,t._months+=o*n._months,t._bubble()}function gi(t,e){return vi(this,t,e,1)}function yi(t,e){return vi(this,t,e,-1)}function bi(t){return 0>t?Math.floor(t):Math.ceil(t)}function wi(){var t,e,i,o,n,s=this._milliseconds,r=this._days,a=this._months,h=this._data;return s>=0&&r>=0&&a>=0||0>=s&&0>=r&&0>=a||(s+=864e5*bi(xi(a)+r),r=0,a=0),h.milliseconds=s%1e3,t=v(s/1e3),h.seconds=t%60,e=v(t/60),h.minutes=e%60,i=v(e/60),h.hours=i%24,r+=v(i/24),n=v(_i(r)),a+=n,r-=bi(xi(n)),o=v(a/12),a%=12,h.days=r,h.months=a,h.years=o,this}function _i(t){return 4800*t/146097}function xi(t){return 146097*t/4800}function ki(t){var e,i,o=this._milliseconds;if(t=C(t),"month"===t||"year"===t)return e=this._days+o/864e5,i=this._months+_i(e),"month"===t?i:i/12;switch(e=this._days+Math.round(xi(this._months)),t){case"week":return e/7+o/6048e5;case"day":return e+o/864e5;case"hour":return 24*e+o/36e5;case"minute":return 1440*e+o/6e4;case"second":return 86400*e+o/1e3;case"millisecond":return Math.floor(864e5*e)+o;default:throw new Error("Unknown unit "+t)}}function Oi(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*g(this._months/12)}function Di(t){return function(){return this.as(t)}}function Mi(t){return t=C(t),this[t+"s"]()}function Ci(t){return function(){return this._data[t]}}function Ti(){return v(this.days()/7)}function Ei(t,e,i,o,n){return n.relativeTime(e||1,!!i,t,o)}function Si(t,e,i){var o=Jt(t).abs(),n=pn(o.as("s")),s=pn(o.as("m")),r=pn(o.as("h")),a=pn(o.as("d")),h=pn(o.as("M")),d=pn(o.as("y")),l=n0,l[4]=i,Ei.apply(null,l)}function Pi(t,e){return void 0===fn[t]?!1:void 0===e?fn[t]:(fn[t]=e,!0)}function Ii(t){var e=this.localeData(),i=Si(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)}function zi(){var t,e,i,o=mn(this._milliseconds)/1e3,n=mn(this._days),s=mn(this._months);t=v(o/60),e=v(t/60),o%=60,t%=60,i=v(s/12),s%=12;var r=i,a=s,h=n,d=e,l=t,u=o,c=this.asSeconds();return c?(0>c?"-":"")+"P"+(r?r+"Y":"")+(a?a+"M":"")+(h?h+"D":"")+(d||l||u?"T":"")+(d?d+"H":"")+(l?l+"M":"")+(u?u+"S":""):"P0D"}var Ni,Li,Ai=e.momentProperties=[],Bi=!1,Ri={},Fi={},ji=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Hi=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Wi={},Yi={},Gi=/\d/,Ui=/\d\d/,Vi=/\d{3}/,qi=/\d{4}/,Xi=/[+-]?\d{6}/,Zi=/\d\d?/,Ki=/\d{1,3}/,Ji=/\d{1,4}/,Qi=/[+-]?\d{1,6}/,$i=/\d+/,to=/[+-]?\d+/,eo=/Z|[+-]\d\d:?\d\d/gi,io=/[+-]?\d+(\.\d{1,3})?/,oo=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,no={},so={},ro=0,ao=1,ho=2,lo=3,uo=4,co=5,po=6;N("M",["MM",2],"Mo",function(){return this.month()+1}),N("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),N("MMMM",0,0,function(t){return this.localeData().months(this,t)}),M("month","M"),j("M",Zi),j("MM",Zi,Ui),j("MMM",oo),j("MMMM",oo),Y(["M","MM"],function(t,e){e[ao]=g(t)-1}),Y(["MMM","MMMM"],function(t,e,i,o){var n=i._locale.monthsParse(t,o,i._strict);null!=n?e[ao]=n:l(i).invalidMonth=t});var fo="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),mo="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),vo={};e.suppressDeprecationWarnings=!1;var go=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,yo=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],bo=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],wo=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=et("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),N(0,["YY",2],0,function(){return this.year()%100}),N(0,["YYYY",4],0,"year"),N(0,["YYYYY",5],0,"year"),N(0,["YYYYYY",6,!0],0,"year"),M("year","y"),j("Y",to),j("YY",Zi,Ui),j("YYYY",Ji,qi),j("YYYYY",Qi,Xi),j("YYYYYY",Qi,Xi),Y(["YYYYY","YYYYYY"],ro),Y("YYYY",function(t,i){i[ro]=2===t.length?e.parseTwoDigitYear(t):g(t)}),Y("YY",function(t,i){i[ro]=e.parseTwoDigitYear(t)}),e.parseTwoDigitYear=function(t){return g(t)+(g(t)>68?1900:2e3)};var _o=E("FullYear",!1);N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),M("week","w"),M("isoWeek","W"),j("w",Zi),j("ww",Zi,Ui),j("W",Zi),j("WW",Zi,Ui),G(["w","ww","W","WW"],function(t,e,i,o){e[o.substr(0,1)]=g(t)});var xo={dow:0,doy:6};N("DDD",["DDDD",3],"DDDo","dayOfYear"),M("dayOfYear","DDD"),j("DDD",Ki),j("DDDD",Vi),Y(["DDD","DDDD"],function(t,e,i){i._dayOfYear=g(t)}),e.ISO_8601=function(){};var ko=et("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=St.apply(null,arguments);return this>t?this:t}),Oo=et("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=St.apply(null,arguments);return t>this?this:t});At("Z",":"),At("ZZ",""),j("Z",eo),j("ZZ",eo),Y(["Z","ZZ"],function(t,e,i){i._useUTC=!0,i._tzm=Bt(t)});var Do=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Mo=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Co=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Jt.fn=Nt.prototype;var To=ee(1,"add"),Eo=ee(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var So=et("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});N(0,["gg",2],0,function(){return this.weekYear()%100}),N(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Se("gggg","weekYear"),Se("ggggg","weekYear"),Se("GGGG","isoWeekYear"),Se("GGGGG","isoWeekYear"),M("weekYear","gg"),M("isoWeekYear","GG"),j("G",to),j("g",to),j("GG",Zi,Ui),j("gg",Zi,Ui),j("GGGG",Ji,qi),j("gggg",Ji,qi),j("GGGGG",Qi,Xi),j("ggggg",Qi,Xi),G(["gggg","ggggg","GGGG","GGGGG"],function(t,e,i,o){e[o.substr(0,2)]=g(t)}),G(["gg","GG"],function(t,i,o,n){i[n]=e.parseTwoDigitYear(t)}),N("Q",0,0,"quarter"),M("quarter","Q"),j("Q",Gi),Y("Q",function(t,e){e[ao]=3*(g(t)-1)}),N("D",["DD",2],"Do","date"),M("date","D"),j("D",Zi),j("DD",Zi,Ui),j("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),Y(["D","DD"],ho),Y("Do",function(t,e){e[ho]=g(t.match(Zi)[0],10)});var Po=E("Date",!0);N("d",0,"do","day"),N("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),N("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),N("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),M("day","d"),M("weekday","e"),M("isoWeekday","E"),j("d",Zi),j("e",Zi),j("E",Zi),j("dd",oo),j("ddd",oo),j("dddd",oo),G(["dd","ddd","dddd"],function(t,e,i){var o=i._locale.weekdaysParse(t);null!=o?e.d=o:l(i).invalidWeekday=t}),G(["d","e","E"],function(t,e,i,o){e[o]=g(t)});var Io="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),zo="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),No="Su_Mo_Tu_We_Th_Fr_Sa".split("_");N("H",["HH",2],0,"hour"),N("h",["hh",2],0,function(){return this.hours()%12||12}),Ue("a",!0),Ue("A",!1),M("hour","h"),j("a",Ve),j("A",Ve),j("H",Zi),j("h",Zi),j("HH",Zi,Ui),j("hh",Zi,Ui),Y(["H","HH"],lo),Y(["a","A"],function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t}),Y(["h","hh"],function(t,e,i){e[lo]=g(t),l(i).bigHour=!0});var Lo=/[ap]\.?m?\.?/i,Ao=E("Hours",!0);N("m",["mm",2],0,"minute"),M("minute","m"),j("m",Zi),j("mm",Zi,Ui),Y(["m","mm"],uo);var Bo=E("Minutes",!1);N("s",["ss",2],0,"second"),M("second","s"),j("s",Zi),j("ss",Zi,Ui),Y(["s","ss"],co);var Ro=E("Seconds",!1);N("S",0,0,function(){return~~(this.millisecond()/100)}),N(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,function(){return 10*this.millisecond()}),N(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),N(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),N(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),N(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),N(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),M("millisecond","ms"),j("S",Ki,Gi),j("SS",Ki,Ui),j("SSS",Ki,Vi);var Fo;for(Fo="SSSS";Fo.length<=9;Fo+="S")j(Fo,$i);for(Fo="S";Fo.length<=9;Fo+="S")Y(Fo,Ze);var jo=E("Milliseconds",!1);N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");var Ho=f.prototype;Ho.add=To,Ho.calendar=oe,Ho.clone=ne,Ho.diff=de,Ho.endOf=_e,Ho.format=pe,Ho.from=fe,Ho.fromNow=me,Ho.to=ve,Ho.toNow=ge,Ho.get=I,Ho.invalidAt=Ee,Ho.isAfter=se,Ho.isBefore=re,Ho.isBetween=ae,Ho.isSame=he,Ho.isValid=Ce,Ho.lang=So,Ho.locale=ye,Ho.localeData=be,Ho.max=Oo,Ho.min=ko,Ho.parsingFlags=Te,Ho.set=I,Ho.startOf=we,Ho.subtract=Eo,Ho.toArray=De,Ho.toObject=Me,Ho.toDate=Oe,Ho.toISOString=ce,Ho.toJSON=ce,Ho.toString=ue,Ho.unix=ke,Ho.valueOf=xe,Ho.year=_o,Ho.isLeapYear=dt,Ho.weekYear=Ie,Ho.isoWeekYear=ze,Ho.quarter=Ho.quarters=Ae,Ho.month=J,Ho.daysInMonth=Q,Ho.week=Ho.weeks=ft,Ho.isoWeek=Ho.isoWeeks=mt,Ho.weeksInYear=Le,Ho.isoWeeksInYear=Ne,Ho.date=Po,Ho.day=Ho.days=We,Ho.weekday=Ye,Ho.isoWeekday=Ge,Ho.dayOfYear=gt,Ho.hour=Ho.hours=Ao,Ho.minute=Ho.minutes=Bo,Ho.second=Ho.seconds=Ro,Ho.millisecond=Ho.milliseconds=jo,Ho.utcOffset=jt,Ho.utc=Wt,Ho.local=Yt,Ho.parseZone=Gt,Ho.hasAlignedHourOffset=Ut,Ho.isDST=Vt,Ho.isDSTShifted=qt,Ho.isLocal=Xt,Ho.isUtcOffset=Zt,Ho.isUtc=Kt,Ho.isUTC=Kt,Ho.zoneAbbr=Ke,Ho.zoneName=Je,Ho.dates=et("dates accessor is deprecated. Use date instead.",Po),Ho.months=et("months accessor is deprecated. Use month instead",J),Ho.years=et("years accessor is deprecated. Use year instead",_o),Ho.zone=et("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Ht);var Wo=Ho,Yo={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Go={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Uo="Invalid date",Vo="%d",qo=/\d{1,2}/,Xo={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Zo=b.prototype;Zo._calendar=Yo,Zo.calendar=ti,Zo._longDateFormat=Go,Zo.longDateFormat=ei,Zo._invalidDate=Uo,Zo.invalidDate=ii,Zo._ordinal=Vo,Zo.ordinal=oi,Zo._ordinalParse=qo,Zo.preparse=ni,Zo.postformat=ni,Zo._relativeTime=Xo,Zo.relativeTime=si,Zo.pastFuture=ri,Zo.set=ai,Zo.months=q,Zo._months=fo,Zo.monthsShort=X,Zo._monthsShort=mo,Zo.monthsParse=Z,Zo.week=ut,Zo._week=xo,Zo.firstDayOfYear=pt,Zo.firstDayOfWeek=ct,Zo.weekdays=Re,Zo._weekdays=Io,Zo.weekdaysMin=je,Zo._weekdaysMin=No,Zo.weekdaysShort=Fe,Zo._weekdaysShort=zo,Zo.weekdaysParse=He,Zo.isPM=qe,Zo._meridiemParse=Lo,Zo.meridiem=Xe,k("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,i=1===g(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),e.lang=et("moment.lang is deprecated. Use moment.locale instead.",k),e.langData=et("moment.langData is deprecated. Use moment.localeData instead.",D);var Ko=Math.abs,Jo=Di("ms"),Qo=Di("s"),$o=Di("m"),tn=Di("h"),en=Di("d"),on=Di("w"),nn=Di("M"),sn=Di("y"),rn=Ci("milliseconds"),an=Ci("seconds"),hn=Ci("minutes"),dn=Ci("hours"),ln=Ci("days"),un=Ci("months"),cn=Ci("years"),pn=Math.round,fn={s:45,m:45,h:22,d:26,M:11},mn=Math.abs,vn=Nt.prototype;vn.abs=mi,vn.add=gi,vn.subtract=yi,vn.as=ki,vn.asMilliseconds=Jo,vn.asSeconds=Qo,vn.asMinutes=$o,vn.asHours=tn,vn.asDays=en,vn.asWeeks=on,vn.asMonths=nn,vn.asYears=sn,vn.valueOf=Oi,vn._bubble=wi,vn.get=Mi,vn.milliseconds=rn,vn.seconds=an,vn.minutes=hn,vn.hours=dn,vn.days=ln,vn.weeks=Ti,vn.months=un,vn.years=cn,vn.humanize=Ii,vn.toISOString=zi,vn.toString=zi,vn.toJSON=zi,vn.locale=ye,vn.localeData=be,vn.toIsoString=et("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",zi),vn.lang=So,N("X",0,0,"unix"),N("x",0,0,"valueOf"),j("x",to),j("X",io),Y("X",function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))}),Y("x",function(t,e,i){i._d=new Date(g(t))}),e.version="2.10.6",i(St),e.fn=Wo,e.min=It,e.max=zt,e.utc=h,e.unix=Qe,e.months=li,e.isDate=n,e.locale=k,e.invalid=c,e.duration=Jt,e.isMoment=m,e.weekdays=ci,e.parseZone=$e,e.localeData=D,e.isDuration=Lt,e.monthsShort=ui,e.weekdaysMin=fi,e.defineLocale=O,e.weekdaysShort=pi,e.normalizeUnits=C,e.relativeTimeThreshold=Pi;var gn=e;return gn})}).call(e,i(4)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){function i(t){throw new Error("Cannot find module '"+t+"'.")}i.keys=function(){return[]},i.resolve=i,t.exports=i,i.id=5},function(t,e){(function(e){function i(t,e,i){var o=e&&i||0,n=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){16>n&&(e[o+n++]=u[t])});16>n;)e[o+n++]=0;return e}function o(t,e){var i=e||0,o=l;return o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]}function n(t,e,i){var n=e&&i||0,s=e||[];t=t||{};var r=void 0!==t.clockseq?t.clockseq:m,a=void 0!==t.msecs?t.msecs:(new Date).getTime(),h=void 0!==t.nsecs?t.nsecs:g+1,d=a-v+(h-g)/1e4;if(0>d&&void 0===t.clockseq&&(r=r+1&16383),(0>d||a>v)&&void 0===t.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");v=a,g=h,m=r,a+=122192928e5;var l=(1e4*(268435455&a)+h)%4294967296;s[n++]=l>>>24&255,s[n++]=l>>>16&255,s[n++]=l>>>8&255,s[n++]=255&l;var u=a/4294967296*1e4&268435455;s[n++]=u>>>8&255,s[n++]=255&u,s[n++]=u>>>24&15|16,s[n++]=u>>>16&255,s[n++]=r>>>8|128,s[n++]=255&r;for(var c=t.node||f,p=0;6>p;p++)s[n+p]=c[p];return e?e:o(s)}function s(t,e,i){var n=e&&i||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null),t=t||{};var s=t.random||(t.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var a=0;16>a;a++)e[n+a]=s[a];return e||o(s)}var r,a="undefined"!=typeof window?window:"undefined"!=typeof e?e:null;if(a&&a.crypto&&crypto.getRandomValues){var h=new Uint8Array(16);r=function(){return crypto.getRandomValues(h),h}}if(!r){var d=new Array(16);r=function(){for(var t,e=0;16>e;e++)0===(3&e)&&(t=4294967296*Math.random()),d[e]=t>>>((3&e)<<3)&255;return d}}for(var l=[],u={},c=0;256>c;c++)l[c]=(c+256).toString(16).substr(1),u[l[c]]=c;var p=r(),f=[1|p[0],p[1],p[2],p[3],p[4],p[5]],m=16383&(p[6]<<8|p[7]),v=0,g=0,y=s;y.v1=n,y.v4=s,y.parse=i,y.unparse=o,t.exports=y}).call(e,function(){return this}())},function(t,e){e.prepareElements=function(t){for(var e in t)t.hasOwnProperty(e)&&(t[e].redundant=t[e].used,t[e].used=[])},e.cleanupElements=function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].redundant){for(var i=0;i0?(o=e[t].redundant[0],e[t].redundant.shift()):(o=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(o)):(o=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(o)),e[t].used.push(o),o},e.getDOMElement=function(t,e,i,o){var n;return e.hasOwnProperty(t)?e[t].redundant.length>0?(n=e[t].redundant[0],e[t].redundant.shift()):(n=document.createElement(t),void 0!==o?i.insertBefore(n,o):i.appendChild(n)):(n=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==o?i.insertBefore(n,o):i.appendChild(n)),e[t].used.push(n),n},e.drawPoint=function(t,i,o,n,s,r){var a;if("circle"==o.style?(a=e.getSVGElement("circle",n,s),a.setAttributeNS(null,"cx",t),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*o.size)):(a=e.getSVGElement("rect",n,s),a.setAttributeNS(null,"x",t-.5*o.size),a.setAttributeNS(null,"y",i-.5*o.size),a.setAttributeNS(null,"width",o.size),a.setAttributeNS(null,"height",o.size)),void 0!==o.styles&&a.setAttributeNS(null,"style",o.styles),a.setAttributeNS(null,"class",o.className+" vis-point"),r){var h=e.getSVGElement("text",n,s);r.xOffset&&(t+=r.xOffset),r.yOffset&&(i+=r.yOffset),r.content&&(h.textContent=r.content),r.className&&h.setAttributeNS(null,"class",r.className+" vis-label"),h.setAttributeNS(null,"x",t),h.setAttributeNS(null,"y",i)}return a},e.drawBar=function(t,i,o,n,s,r,a,h){if(0!=n){0>n&&(n*=-1,i-=n);var d=e.getSVGElement("rect",r,a);d.setAttributeNS(null,"x",t-.5*o),d.setAttributeNS(null,"y",i),d.setAttributeNS(null,"width",o),d.setAttributeNS(null,"height",n),d.setAttributeNS(null,"class",s),h&&d.setAttributeNS(null,"style",h)}}},function(t,e,i){function o(t,e){if(t&&!Array.isArray(t)&&(e=t,t=null),this._options=e||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i in this._options.type)if(this._options.type.hasOwnProperty(i)){var o=this._options.type[i];"Date"==o||"ISODate"==o||"ASPDate"==o?this._type[i]="Date":this._type[i]=o}if(this._options.convert)throw new Error('Option "convert" is deprecated. Use "type" instead.');this._subscribers={},t&&this.add(t),this.setOptions(e)}var n=i(1),s=i(9);o.prototype.setOptions=function(t){t&&void 0!==t.queue&&(t.queue===!1?this._queue&&(this._queue.destroy(),delete this._queue):(this._queue||(this._queue=s.extend(this,{replace:["add","update","remove"]})),"object"==typeof t.queue&&this._queue.setOptions(t.queue)))},o.prototype.on=function(t,e){var i=this._subscribers[t];i||(i=[],this._subscribers[t]=i),i.push({callback:e})},o.prototype.subscribe=function(){throw new Error("DataSet.subscribe is deprecated. Use DataSet.on instead.")},o.prototype.off=function(t,e){var i=this._subscribers[t];i&&(this._subscribers[t]=i.filter(function(t){return t.callback!=e}))},o.prototype.unsubscribe=function(){throw new Error("DataSet.unsubscribe is deprecated. Use DataSet.off instead.")},o.prototype._trigger=function(t,e,i){if("*"==t)throw new Error("Cannot trigger event *");var o=[];t in this._subscribers&&(o=o.concat(this._subscribers[t])),"*"in this._subscribers&&(o=o.concat(this._subscribers["*"]));for(var n=0;ns;s++)i=n._addItem(t[s]),o.push(i);else{if(!(t instanceof Object))throw new Error("Unknown dataType");i=n._addItem(t),o.push(i)}return o.length&&this._trigger("add",{items:o},e),o},o.prototype.update=function(t,e){var i=[],o=[],n=[],s=this,r=s._fieldId,a=function(t){var e=t[r];s._data[e]?(e=s._updateItem(t),o.push(e),n.push(t)):(e=s._addItem(t),i.push(e))};if(Array.isArray(t))for(var h=0,d=t.length;d>h;h++)a(t[h]);else{if(!(t instanceof Object))throw new Error("Unknown dataType");a(t)}return i.length&&this._trigger("add",{items:i},e),o.length&&this._trigger("update",{items:o,data:n},e),i.concat(o)},o.prototype.get=function(t){var e,i,o,s=this,r=n.getType(arguments[0]);"String"==r||"Number"==r?(e=arguments[0],o=arguments[1]):"Array"==r?(i=arguments[0],o=arguments[1]):o=arguments[0];var a;if(o&&o.returnType){var h=["Array","Object"];a=-1==h.indexOf(o.returnType)?"Array":o.returnType}else a="Array";var d,l,u,c,p=o&&o.type||this._options.type,f=o&&o.filter,m=[];if(void 0!=e)d=s._getItem(e,p),f&&!f(d)&&(d=null);else if(void 0!=i)for(u=0,c=i.length;c>u;u++)d=s._getItem(i[u],p),(!f||f(d))&&m.push(d);else for(l in this._data)this._data.hasOwnProperty(l)&&(d=s._getItem(l,p),(!f||f(d))&&m.push(d));if(o&&o.order&&void 0==e&&this._sort(m,o.order),o&&o.fields){var v=o.fields;if(void 0!=e)d=this._filterFields(d,v);else for(u=0,c=m.length;c>u;u++)m[u]=this._filterFields(m[u],v)}if("Object"==a){var g={};for(u=0;ue;e++)l[e]=s[e][this._fieldId]}else for(o in r)r.hasOwnProperty(o)&&(n=this._getItem(o,d),a(n)&&l.push(n[this._fieldId]));else if(h){s=[];for(o in r)r.hasOwnProperty(o)&&s.push(r[o]);for(this._sort(s,h),e=0,i=s.length;i>e;e++)l[e]=s[e][this._fieldId]}else for(o in r)r.hasOwnProperty(o)&&(n=r[o],l.push(n[this._fieldId]));return l},o.prototype.getDataSet=function(){return this},o.prototype.forEach=function(t,e){var i,o,n=e&&e.filter,s=e&&e.type||this._options.type,r=this._data;if(e&&e.order)for(var a=this.get(e),h=0,d=a.length;d>h;h++)i=a[h],o=i[this._fieldId],t(i,o);else for(o in r)r.hasOwnProperty(o)&&(i=this._getItem(o,s),(!n||n(i))&&t(i,o))},o.prototype.map=function(t,e){var i,o=e&&e.filter,n=e&&e.type||this._options.type,s=[],r=this._data;for(var a in r)r.hasOwnProperty(a)&&(i=this._getItem(a,n),(!o||o(i))&&s.push(t(i,a)));return e&&e.order&&this._sort(s,e.order),s},o.prototype._filterFields=function(t,e){if(!t)return t;var i={};if(Array.isArray(e))for(var o in t)t.hasOwnProperty(o)&&-1!=e.indexOf(o)&&(i[o]=t[o]);else for(var o in t)t.hasOwnProperty(o)&&e.hasOwnProperty(o)&&(i[e[o]]=t[o]);return i},o.prototype._sort=function(t,e){if(n.isString(e)){var i=e;t.sort(function(t,e){var o=t[i],n=e[i];return o>n?1:n>o?-1:0})}else{if("function"!=typeof e)throw new TypeError("Order must be a function or a string");t.sort(e)}},o.prototype.remove=function(t,e){var i,o,n,s=[];if(Array.isArray(t))for(i=0,o=t.length;o>i;i++)n=this._remove(t[i]),null!=n&&s.push(n);else n=this._remove(t),null!=n&&s.push(n);return s.length&&this._trigger("remove",{items:s},e),s},o.prototype._remove=function(t){if(n.isNumber(t)||n.isString(t)){if(this._data[t])return delete this._data[t],this.length--,t}else if(t instanceof Object){var e=t[this._fieldId];if(e&&this._data[e])return delete this._data[e],this.length--,e}return null},o.prototype.clear=function(t){var e=Object.keys(this._data);return this._data={},this.length=0,this._trigger("remove",{items:e},t),e},o.prototype.max=function(t){var e=this._data,i=null,o=null;for(var n in e)if(e.hasOwnProperty(n)){var s=e[n],r=s[t];null!=r&&(!i||r>o)&&(i=s,o=r)}return i},o.prototype.min=function(t){var e=this._data,i=null,o=null;for(var n in e)if(e.hasOwnProperty(n)){var s=e[n],r=s[t];null!=r&&(!i||o>r)&&(i=s,o=r)}return i},o.prototype.distinct=function(t){var e,i=this._data,o=[],s=this._options.type&&this._options.type[t]||null,r=0;for(var a in i)if(i.hasOwnProperty(a)){var h=i[a],d=h[t],l=!1;for(e=0;r>e;e++)if(o[e]==d){l=!0;break}l||void 0===d||(o[r]=d,r++)}if(s)for(e=0;ethis.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var t=this;this._timeout=setTimeout(function(){t.flush()},this.delay)}},i.prototype.flush=function(){for(;this._queue.length>0;){var t=this._queue.shift();t.fn.apply(t.context||t.fn,t.args||[])}},t.exports=i},function(t,e,i){function o(t,e){this._data=null,this._ids={},this.length=0,this._options=e||{},this._fieldId="id",this._subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(t)}var n=i(1),s=i(8);o.prototype.setData=function(t){var e,i,o;if(this._data){this._data.off&&this._data.off("*",this.listener),e=[];for(var n in this._ids)this._ids.hasOwnProperty(n)&&e.push(n);this._ids={},this.length=0,this._trigger("remove",{items:e})}if(this._data=t,this._data){for(this._fieldId=this._options.fieldId||this._data&&this._data.options&&this._data.options.fieldId||"id",e=this._data.getIds({filter:this._options&&this._options.filter}),i=0,o=e.length;o>i;i++)n=e[i],this._ids[n]=!0;this.length=e.length,this._trigger("add",{items:e}),this._data.on&&this._data.on("*",this.listener)}},o.prototype.refresh=function(){for(var t,e=this._data.getIds({filter:this._options&&this._options.filter}),i={},o=[],n=[],s=0;so;o++)s=a[o],r=this.get(s),r&&(this._ids[s]=!0,l.push(s));break;case"update":for(o=0,n=a.length;n>o;o++)s=a[o],r=this.get(s),r?this._ids[s]?(u.push(s),d.push(e.data[o])):(this._ids[s]=!0,l.push(s)):this._ids[s]&&(delete this._ids[s],
+c.push(s));break;case"remove":for(o=0,n=a.length;n>o;o++)s=a[o],this._ids[s]&&(delete this._ids[s],c.push(s))}this.length+=l.length-c.length,l.length&&this._trigger("add",{items:l},i),u.length&&this._trigger("update",{items:u,data:d},i),c.length&&this._trigger("remove",{items:c},i)}},o.prototype.on=s.prototype.on,o.prototype.off=s.prototype.off,o.prototype._trigger=s.prototype._trigger,o.prototype.subscribe=o.prototype.on,o.prototype.unsubscribe=o.prototype.off,t.exports=o},function(t,e,i){function o(t,e,i){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");this.containerElement=t,this.width="400px",this.height="400px",this.margin=10,this.defaultXCenter="55%",this.defaultYCenter="50%",this.xLabel="x",this.yLabel="y",this.zLabel="z";var n=function(t){return t};this.xValueLabel=n,this.yValueLabel=n,this.zValueLabel=n,this.filterLabel="time",this.legendLabel="value",this.style=o.STYLE.DOT,this.showPerspective=!0,this.showGrid=!0,this.keepAspectRatio=!0,this.showShadow=!1,this.showGrayBottom=!1,this.showTooltip=!1,this.verticalRatio=.5,this.animationInterval=1e3,this.animationPreload=!1,this.camera=new c,this.camera.setArmRotation(1,.5),this.camera.setArmLength(1.7),this.eye=new l(0,0,-1),this.dataTable=null,this.dataPoints=null,this.colX=void 0,this.colY=void 0,this.colZ=void 0,this.colValue=void 0,this.colFilter=void 0,this.xMin=0,this.xStep=void 0,this.xMax=1,this.yMin=0,this.yStep=void 0,this.yMax=1,this.zMin=0,this.zStep=void 0,this.zMax=1,this.valueMin=0,this.valueMax=1,this.xBarWidth=1,this.yBarWidth=1,this.axisColor="#4D4D4D",this.gridColor="#D3D3D3",this.dataColor={fill:"#7DC1FF",stroke:"#3267D2",strokeWidth:1},this.create(),this.setOptions(i),e&&this.setData(e)}function n(t){return"clientX"in t?t.clientX:t.targetTouches[0]&&t.targetTouches[0].clientX||0}function s(t){return"clientY"in t?t.clientY:t.targetTouches[0]&&t.targetTouches[0].clientY||0}var r=i(12),a=i(8),h=i(10),d=i(1),l=i(13),u=i(14),c=i(15),p=i(16),f=i(17),m=i(18);r(o.prototype),o.prototype._setScale=function(){this.scale=new l(1/(this.xMax-this.xMin),1/(this.yMax-this.yMin),1/(this.zMax-this.zMin)),this.keepAspectRatio&&(this.scale.x3&&(this.colFilter=3);else{if(this.style!==o.STYLE.DOTCOLOR&&this.style!==o.STYLE.DOTSIZE&&this.style!==o.STYLE.BARCOLOR&&this.style!==o.STYLE.BARSIZE)throw'Unknown style "'+this.style+'"';this.colX=0,this.colY=1,this.colZ=2,this.colValue=3,t.getNumberOfColumns()>4&&(this.colFilter=4)}},o.prototype.getNumberOfRows=function(t){return t.length},o.prototype.getNumberOfColumns=function(t){var e=0;for(var i in t[0])t[0].hasOwnProperty(i)&&e++;return e},o.prototype.getDistinctValues=function(t,e){for(var i=[],o=0;ot[o][e]&&(i.min=t[o][e]),i.maxt;t++){var f=(t-c)/(p-c),v=240*f,g=this._hsv2rgb(v,1,1);u.strokeStyle=g,u.beginPath(),u.moveTo(h,r+t),u.lineTo(a,r+t),u.stroke()}u.strokeStyle=this.axisColor,u.strokeRect(h,r,i,s)}if(this.style===o.STYLE.DOTSIZE&&(u.strokeStyle=this.axisColor,u.fillStyle=this.dataColor.fill,u.beginPath(),u.moveTo(h,r),u.lineTo(a,r),u.lineTo(a-i+e,d),u.lineTo(h,d),u.closePath(),u.fill(),u.stroke()),this.style===o.STYLE.DOTCOLOR||this.style===o.STYLE.DOTSIZE){var y=5,b=new m(this.valueMin,this.valueMax,(this.valueMax-this.valueMin)/5,!0);for(b.start(),b.getCurrent()0?this.yMin:this.yMax,n=this._convert3Dto2D(new l(_,r,this.zMin)),Math.cos(2*w)>0?(v.textAlign="center",v.textBaseline="top",n.y+=b):Math.sin(2*w)<0?(v.textAlign="right",v.textBaseline="middle"):(v.textAlign="left",v.textBaseline="middle"),v.fillStyle=this.axisColor,v.fillText(" "+this.xValueLabel(i.getCurrent())+" ",n.x,n.y),i.next()}for(v.lineWidth=1,o=void 0===this.defaultYStep,i=new m(this.yMin,this.yMax,this.yStep,o),i.start(),i.getCurrent()0?this.xMin:this.xMax,n=this._convert3Dto2D(new l(s,i.getCurrent(),this.zMin)),Math.cos(2*w)<0?(v.textAlign="center",v.textBaseline="top",n.y+=b):Math.sin(2*w)>0?(v.textAlign="right",v.textBaseline="middle"):(v.textAlign="left",v.textBaseline="middle"),v.fillStyle=this.axisColor,v.fillText(" "+this.yValueLabel(i.getCurrent())+" ",n.x,n.y),i.next();for(v.lineWidth=1,o=void 0===this.defaultZStep,i=new m(this.zMin,this.zMax,this.zStep,o),i.start(),i.getCurrent()0?this.xMin:this.xMax,r=Math.sin(w)<0?this.yMin:this.yMax;!i.end();)t=this._convert3Dto2D(new l(s,r,i.getCurrent())),v.strokeStyle=this.axisColor,v.beginPath(),v.moveTo(t.x,t.y),v.lineTo(t.x-b,t.y),v.stroke(),v.textAlign="right",v.textBaseline="middle",v.fillStyle=this.axisColor,v.fillText(this.zValueLabel(i.getCurrent())+" ",t.x-5,t.y),i.next();v.lineWidth=1,t=this._convert3Dto2D(new l(s,r,this.zMin)),e=this._convert3Dto2D(new l(s,r,this.zMax)),v.strokeStyle=this.axisColor,v.beginPath(),v.moveTo(t.x,t.y),v.lineTo(e.x,e.y),v.stroke(),v.lineWidth=1,c=this._convert3Dto2D(new l(this.xMin,this.yMin,this.zMin)),p=this._convert3Dto2D(new l(this.xMax,this.yMin,this.zMin)),v.strokeStyle=this.axisColor,v.beginPath(),v.moveTo(c.x,c.y),v.lineTo(p.x,p.y),v.stroke(),c=this._convert3Dto2D(new l(this.xMin,this.yMax,this.zMin)),p=this._convert3Dto2D(new l(this.xMax,this.yMax,this.zMin)),v.strokeStyle=this.axisColor,v.beginPath(),v.moveTo(c.x,c.y),v.lineTo(p.x,p.y),v.stroke(),v.lineWidth=1,t=this._convert3Dto2D(new l(this.xMin,this.yMin,this.zMin)),e=this._convert3Dto2D(new l(this.xMin,this.yMax,this.zMin)),v.strokeStyle=this.axisColor,v.beginPath(),v.moveTo(t.x,t.y),v.lineTo(e.x,e.y),v.stroke(),t=this._convert3Dto2D(new l(this.xMax,this.yMin,this.zMin)),e=this._convert3Dto2D(new l(this.xMax,this.yMax,this.zMin)),v.strokeStyle=this.axisColor,v.beginPath(),v.moveTo(t.x,t.y),v.lineTo(e.x,e.y),v.stroke();var x=this.xLabel;x.length>0&&(u=.1/this.scale.y,s=(this.xMin+this.xMax)/2,r=Math.cos(w)>0?this.yMin-u:this.yMax+u,n=this._convert3Dto2D(new l(s,r,this.zMin)),Math.cos(2*w)>0?(v.textAlign="center",v.textBaseline="top"):Math.sin(2*w)<0?(v.textAlign="right",v.textBaseline="middle"):(v.textAlign="left",v.textBaseline="middle"),v.fillStyle=this.axisColor,v.fillText(x,n.x,n.y));var k=this.yLabel;k.length>0&&(d=.1/this.scale.x,s=Math.sin(w)>0?this.xMin-d:this.xMax+d,r=(this.yMin+this.yMax)/2,n=this._convert3Dto2D(new l(s,r,this.zMin)),Math.cos(2*w)<0?(v.textAlign="center",v.textBaseline="top"):Math.sin(2*w)>0?(v.textAlign="right",v.textBaseline="middle"):(v.textAlign="left",v.textBaseline="middle"),v.fillStyle=this.axisColor,v.fillText(k,n.x,n.y));var O=this.zLabel;O.length>0&&(h=30,s=Math.cos(w)>0?this.xMin:this.xMax,r=Math.sin(w)<0?this.yMin:this.yMax,a=(this.zMin+this.zMax)/2,n=this._convert3Dto2D(new l(s,r,a)),v.textAlign="right",v.textBaseline="middle",v.fillStyle=this.axisColor,v.fillText(O,n.x-h,n.y))},o.prototype._hsv2rgb=function(t,e,i){var o,n,s,r,a,h;switch(r=i*e,a=Math.floor(t/60),h=r*(1-Math.abs(t/60%2-1)),a){case 0:o=r,n=h,s=0;break;case 1:o=h,n=r,s=0;break;case 2:o=0,n=r,s=h;break;case 3:o=0,n=h,s=r;break;case 4:o=h,n=0,s=r;break;case 5:o=r,n=0,s=h;break;default:o=0,n=0,s=0}return"RGB("+parseInt(255*o)+","+parseInt(255*n)+","+parseInt(255*s)+")"},o.prototype._redrawDataGrid=function(){var t,e,i,n,s,r,a,h,d,u,c,p,f=this.frame.canvas,m=f.getContext("2d");if(m.lineJoin="round",m.lineCap="round",!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(s=0;s0}else r=!0;r?(p=(t.point.z+e.point.z+i.point.z+n.point.z)/4,d=240*(1-(p-this.zMin)*this.scale.z/this.verticalRatio),u=1,this.showShadow?(c=Math.min(1+x.x/k/2,1),a=this._hsv2rgb(d,u,c),h=a):(c=1,a=this._hsv2rgb(d,u,c),h=this.axisColor)):(a="gray",h=this.axisColor),m.lineWidth=this._getStrokeWidth(t),m.fillStyle=a,m.strokeStyle=h,m.beginPath(),m.moveTo(t.screen.x,t.screen.y),m.lineTo(e.screen.x,e.screen.y),m.lineTo(n.screen.x,n.screen.y),m.lineTo(i.screen.x,i.screen.y),m.closePath(),m.fill(),m.stroke()}}else for(s=0;sc&&(c=0);var p,f,m;this.style===o.STYLE.DOTCOLOR?(p=240*(1-(d.point.value-this.valueMin)*this.scale.value),f=this._hsv2rgb(p,1,1),m=this._hsv2rgb(p,1,.8)):this.style===o.STYLE.DOTSIZE?(f=this.dataColor.fill,m=this.dataColor.stroke):(p=240*(1-(d.point.z-this.zMin)*this.scale.z/this.verticalRatio),f=this._hsv2rgb(p,1,1),m=this._hsv2rgb(p,1,.8)),i.lineWidth=this._getStrokeWidth(d),i.strokeStyle=m,i.fillStyle=f,i.beginPath(),i.arc(d.screen.x,d.screen.y,c,0,2*Math.PI,!0),i.fill(),i.stroke()}}},o.prototype._redrawDataBar=function(){var t,e,i,n,s=this.frame.canvas,r=s.getContext("2d");if(!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(t=0;t0){for(t=this.dataPoints[0],o.lineWidth=this._getStrokeWidth(t),o.lineJoin="round",o.lineCap="round",o.strokeStyle=this.dataColor.stroke,o.beginPath(),o.moveTo(t.screen.x,t.screen.y),e=1;e0?1:0>t?-1:0}var o=e[0],n=e[1],s=e[2],r=i((n.x-o.x)*(t.y-o.y)-(n.y-o.y)*(t.x-o.x)),a=i((s.x-n.x)*(t.y-n.y)-(s.y-n.y)*(t.x-n.x)),h=i((o.x-s.x)*(t.y-s.y)-(o.y-s.y)*(t.x-s.x));return!(0!=r&&0!=a&&r!=a||0!=a&&0!=h&&a!=h||0!=r&&0!=h&&r!=h)},o.prototype._dataPointFromXY=function(t,e){var i,n=100,s=null,r=null,a=null,h=new u(t,e);if(this.style===o.STYLE.BAR||this.style===o.STYLE.BARCOLOR||this.style===o.STYLE.BARSIZE)for(i=this.dataPoints.length-1;i>=0;i--){s=this.dataPoints[i];var d=s.surfaces;if(d)for(var l=d.length-1;l>=0;l--){var c=d[l],p=c.corners,f=[p[0].screen,p[1].screen,p[2].screen],m=[p[2].screen,p[3].screen,p[0].screen];if(this._insideTriangle(h,f)||this._insideTriangle(h,m))return s}}else for(i=0;ib)&&n>b&&(a=b,r=s)}}return r},o.prototype._showTooltip=function(t){var e,i,o;this.tooltip?(e=this.tooltip.dom.content,i=this.tooltip.dom.line,o=this.tooltip.dom.dot):(e=document.createElement("div"),e.style.position="absolute",e.style.padding="10px",e.style.border="1px solid #4d4d4d",e.style.color="#1a1a1a",e.style.background="rgba(255,255,255,0.7)",e.style.borderRadius="2px",e.style.boxShadow="5px 5px 10px rgba(128,128,128,0.5)",i=document.createElement("div"),i.style.position="absolute",i.style.height="40px",i.style.width="0",i.style.borderLeft="1px solid #4d4d4d",o=document.createElement("div"),o.style.position="absolute",o.style.height="0",o.style.width="0",o.style.border="5px solid #4d4d4d",o.style.borderRadius="5px",this.tooltip={dataPoint:null,dom:{content:e,line:i,dot:o}}),this._hideTooltip(),this.tooltip.dataPoint=t,"function"==typeof this.showTooltip?e.innerHTML=this.showTooltip(t.point):e.innerHTML="x: "+t.point.x+" y: "+t.point.y+" z: "+t.point.z+"
",e.style.left="0",e.style.top="0",this.frame.appendChild(e),this.frame.appendChild(i),this.frame.appendChild(o);var n=e.offsetWidth,s=e.offsetHeight,r=i.offsetHeight,a=o.offsetWidth,h=o.offsetHeight,d=t.screen.x-n/2;d=Math.min(Math.max(d,10),this.frame.clientWidth-10-n),i.style.left=t.screen.x+"px",i.style.top=t.screen.y-r+"px",e.style.left=d+"px",e.style.top=t.screen.y-r-s+"px",o.style.left=t.screen.x-a/2+"px",o.style.top=t.screen.y-h/2+"px"},o.prototype._hideTooltip=function(){if(this.tooltip){this.tooltip.dataPoint=null;for(var t in this.tooltip.dom)if(this.tooltip.dom.hasOwnProperty(t)){var e=this.tooltip.dom[t];e&&e.parentNode&&e.parentNode.removeChild(e)}}},t.exports=o},function(t,e){function i(t){return t?o(t):void 0}function o(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}t.exports=i,i.prototype.on=i.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},i.prototype.once=function(t,e){function i(){o.off(t,i),e.apply(this,arguments)}var o=this;return this._callbacks=this._callbacks||{},i.fn=e,this.on(t,i),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks[t];if(!i)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var o,n=0;no;++o)i[o].apply(this,e)}return this},i.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks[t]||[]},i.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e){function i(t,e,i){this.x=void 0!==t?t:0,this.y=void 0!==e?e:0,this.z=void 0!==i?i:0}i.subtract=function(t,e){var o=new i;return o.x=t.x-e.x,o.y=t.y-e.y,o.z=t.z-e.z,o},i.add=function(t,e){var o=new i;return o.x=t.x+e.x,o.y=t.y+e.y,o.z=t.z+e.z,o},i.avg=function(t,e){return new i((t.x+e.x)/2,(t.y+e.y)/2,(t.z+e.z)/2)},i.crossProduct=function(t,e){var o=new i;return o.x=t.y*e.z-t.z*e.y,o.y=t.z*e.x-t.x*e.z,o.z=t.x*e.y-t.y*e.x,o},i.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},t.exports=i},function(t,e){function i(t,e){this.x=void 0!==t?t:0,this.y=void 0!==e?e:0}t.exports=i},function(t,e,i){function o(){this.armLocation=new n,this.armRotation={},this.armRotation.horizontal=0,this.armRotation.vertical=0,this.armLength=1.7,this.cameraLocation=new n,this.cameraRotation=new n(.5*Math.PI,0,0),this.calculateCameraOrientation()}var n=i(13);o.prototype.setArmLocation=function(t,e,i){this.armLocation.x=t,this.armLocation.y=e,this.armLocation.z=i,this.calculateCameraOrientation()},o.prototype.setArmRotation=function(t,e){void 0!==t&&(this.armRotation.horizontal=t),void 0!==e&&(this.armRotation.vertical=e,this.armRotation.vertical<0&&(this.armRotation.vertical=0),this.armRotation.vertical>.5*Math.PI&&(this.armRotation.vertical=.5*Math.PI)),(void 0!==t||void 0!==e)&&this.calculateCameraOrientation()},o.prototype.getArmRotation=function(){var t={};return t.horizontal=this.armRotation.horizontal,t.vertical=this.armRotation.vertical,t},o.prototype.setArmLength=function(t){void 0!==t&&(this.armLength=t,this.armLength<.71&&(this.armLength=.71),this.armLength>5&&(this.armLength=5),this.calculateCameraOrientation())},o.prototype.getArmLength=function(){return this.armLength},o.prototype.getCameraLocation=function(){return this.cameraLocation},o.prototype.getCameraRotation=function(){return this.cameraRotation},o.prototype.calculateCameraOrientation=function(){this.cameraLocation.x=this.armLocation.x-this.armLength*Math.sin(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.y=this.armLocation.y-this.armLength*Math.cos(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.z=this.armLocation.z+this.armLength*Math.sin(this.armRotation.vertical),this.cameraRotation.x=Math.PI/2-this.armRotation.vertical,this.cameraRotation.y=0,this.cameraRotation.z=-this.armRotation.horizontal},t.exports=o},function(t,e,i){function o(t,e,i){this.data=t,this.column=e,this.graph=i,this.index=void 0,this.value=void 0,this.values=i.getDistinctValues(t.get(),this.column),this.values.sort(function(t,e){return t>e?1:e>t?-1:0}),this.values.length>0&&this.selectValue(0),this.dataPoints=[],this.loaded=!1,this.onLoadCallback=void 0,i.animationPreload?(this.loaded=!1,this.loadInBackground()):this.loaded=!0}var n=i(10);o.prototype.isLoaded=function(){return this.loaded},o.prototype.getLoadedProgress=function(){for(var t=this.values.length,e=0;this.dataPoints[e];)e++;return Math.round(e/t*100)},o.prototype.getLabel=function(){return this.graph.filterLabel},o.prototype.getColumn=function(){return this.column},o.prototype.getSelectedValue=function(){return void 0===this.index?void 0:this.values[this.index]},o.prototype.getValues=function(){return this.values},o.prototype.getValue=function(t){if(t>=this.values.length)throw"Error: index out of range";return this.values[t]},o.prototype._getDataPoints=function(t){if(void 0===t&&(t=this.index),void 0===t)return[];var e;if(this.dataPoints[t])e=this.dataPoints[t];else{var i={};i.column=this.column,i.value=this.values[t];var o=new n(this.data,{filter:function(t){return t[i.column]==i.value}}).get();e=this.graph._getDataPoints(o),this.dataPoints[t]=e}return e},o.prototype.setOnLoadCallback=function(t){this.onLoadCallback=t},o.prototype.selectValue=function(t){if(t>=this.values.length)throw"Error: index out of range";this.index=t,this.value=this.values[t]},o.prototype.loadInBackground=function(t){void 0===t&&(t=0);var e=this.graph.frame;if(t0&&(t--,this.setIndex(t))},o.prototype.next=function(){var t=this.getIndex();t0?this.setIndex(0):this.index=void 0},o.prototype.setIndex=function(t){if(!(to&&(o=0),o>this.values.length-1&&(o=this.values.length-1),o},o.prototype.indexToLeft=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10,i=t/(this.values.length-1)*e,o=i+3;return o},o.prototype._onMouseMove=function(t){var e=t.clientX-this.startClientX,i=this.startSlideX+e,o=this.leftToIndex(i);this.setIndex(o),n.preventDefault()},o.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",n.removeEventListener(document,"mousemove",this.onmousemove),n.removeEventListener(document,"mouseup",this.onmouseup),n.preventDefault()},t.exports=o},function(t,e){function i(t,e,i,o){this._start=0,this._end=0,this._step=1,this.prettyStep=!0,this.precision=5,this._current=0,this.setRange(t,e,i,o)}i.prototype.setRange=function(t,e,i,o){this._start=t?t:0,this._end=e?e:0,this.setStep(i,o)},i.prototype.setStep=function(t,e){void 0===t||0>=t||(void 0!==e&&(this.prettyStep=e),this.prettyStep===!0?this._step=i.calculatePrettyStep(t):this._step=t)},i.calculatePrettyStep=function(t){var e=function(t){return Math.log(t)/Math.LN10},i=Math.pow(10,Math.round(e(t))),o=2*Math.pow(10,Math.round(e(t/2))),n=5*Math.pow(10,Math.round(e(t/5))),s=i;return Math.abs(o-t)<=Math.abs(s-t)&&(s=o),Math.abs(n-t)<=Math.abs(s-t)&&(s=n),0>=s&&(s=1),s},i.prototype.getCurrent=function(){return parseFloat(this._current.toPrecision(this.precision))},i.prototype.getStep=function(){return this._step},i.prototype.start=function(){this._current=this._start-this._start%this._step},i.prototype.next=function(){this._current+=this._step},i.prototype.end=function(){return this._current>this._end},t.exports=i},function(t,e,i){function o(t,e,i,d){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");if(!(Array.isArray(i)||i instanceof r||i instanceof a)&&i instanceof Object){var c=d;d=i,i=c}var f=this;this.defaultOptions={start:null,end:null,autoResize:!0,throttleRedraw:0,orientation:{axis:"bottom",item:"bottom"},moment:n,width:null,height:null,maxHeight:null,minHeight:null},this.options=s.deepExtend({},this.defaultOptions),this._create(t),this.components=[],this.body={dom:this.dom,domProps:this.props,emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this)},hiddenDates:[],util:{getScale:function(){return f.timeAxis.step.scale},getStep:function(){return f.timeAxis.step.step},toScreen:f._toScreen.bind(f),toGlobalScreen:f._toGlobalScreen.bind(f),toTime:f._toTime.bind(f),toGlobalTime:f._toGlobalTime.bind(f)}},this.range=new h(this.body),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new l(this.body),this.timeAxis2=null,this.components.push(this.timeAxis),this.currentTime=new u(this.body),this.components.push(this.currentTime),this.itemSet=new p(this.body),this.components.push(this.itemSet),this.itemsData=null,this.groupsData=null,this.on("tap",function(t){f.emit("click",f.getEventProperties(t))}),this.on("doubletap",function(t){f.emit("doubleClick",f.getEventProperties(t))}),this.dom.root.oncontextmenu=function(t){f.emit("contextmenu",f.getEventProperties(t))},d&&this.setOptions(d),i&&this.setGroups(i),e?this.setItems(e):this._redraw()}var n=(i(12),i(20),i(2)),s=i(1),r=i(8),a=i(10),h=i(24),d=i(28),l=i(39),u=i(44),c=i(42),p=i(29),f=i(45),m=i(47)["default"],v=i(47).printStyle,g=i(48).allOptions,y=i(48).configureOptions;o.prototype=new d,o.prototype._createConfigurator=function(){return new f(this,this.dom.container,y)},o.prototype.redraw=function(){this.itemSet&&this.itemSet.markDirty({refreshItems:!0}),this._redraw()},o.prototype.setOptions=function(t){var e=m.validate(t,g);if(e===!0&&console.log("%cErrors have been found in the supplied options object.",v),d.prototype.setOptions.call(this,t),"type"in t&&t.type!==this.options.type){this.options.type=t.type;var i=this.itemsData;if(i){var o=this.getSelection();this.setItems(null),this.setItems(i),this.setSelection(o)}}},o.prototype.setItems=function(t){var e,i=null==this.itemsData;if(e=t?t instanceof r||t instanceof a?t:new r(t,{type:{start:"Date",end:"Date"}}):null,this.itemsData=e,this.itemSet&&this.itemSet.setItems(e),i)if(void 0!=this.options.start||void 0!=this.options.end){if(void 0==this.options.start||void 0==this.options.end)var o=this.getItemRange();var n=void 0!=this.options.start?this.options.start:o.min,s=void 0!=this.options.end?this.options.end:o.max;this.setWindow(n,s,{animation:!1})}else this.fit({animation:!1})},o.prototype.setGroups=function(t){var e;e=t?t instanceof r||t instanceof a?t:new r(t):null,this.groupsData=e,this.itemSet.setGroups(e)},o.prototype.setData=function(t){t&&t.groups&&this.setGroups(t.groups),t&&t.items&&this.setItems(t.items)},o.prototype.setSelection=function(t,e){this.itemSet&&this.itemSet.setSelection(t),e&&e.focus&&this.focus(t,e)},o.prototype.getSelection=function(){return this.itemSet&&this.itemSet.getSelection()||[]},o.prototype.focus=function(t,e){if(this.itemsData&&void 0!=t){var i=Array.isArray(t)?t:[t],o=this.itemsData.getDataSet().get(i,{type:{start:"Date",end:"Date"}}),n=null,s=null;if(o.forEach(function(t){var e=t.start.valueOf(),i="end"in t?t.end.valueOf():t.start.valueOf();(null===n||n>e)&&(n=e),(null===s||i>s)&&(s=i)}),null!==n&&null!==s){var r=(n+s)/2,a=Math.max(this.range.end-this.range.start,1.1*(s-n)),h=e&&void 0!==e.animation?e.animation:!0;this.range.setRange(r-a/2,r+a/2,h)}}},o.prototype.fit=function(t){var e=t&&void 0!==t.animation?t.animation:!0,i=this.getItemRange();this.range.setRange(i.min,i.max,e)},o.prototype.getItemRange=function(){var t=this,e=this.getDataRange(),i=e.min,o=e.max,n=null,r=null;if(null!=i&&null!=o){var a,h,d,l,u;!function(){var e=function(t){return s.convert(t.data.start,"Date").valueOf()},c=function(t){var e=void 0!=t.data.end?t.data.end:t.data.start;return s.convert(e,"Date").valueOf()};a=o-i,0>=a&&(a=10),h=a/t.props.center.width,s.forEach(t.itemSet.items,function(t){t.show();var s=e(t),a=c(t),d=new Date(s-(t.getWidthLeft()+10)*h),l=new Date(a+(t.getWidthRight()+10)*h);i>d&&(i=d,n=t),l>o&&(o=l,r=t)}.bind(t)),n&&r&&(d=n.getWidthLeft()+10,l=r.getWidthRight()+10,u=t.props.center.width-d-l,u>0&&(i=e(n)-d*a/u,o=c(r)+l*a/u))}()}return{min:null!=i?new Date(i):null,max:null!=o?new Date(o):null}},o.prototype.getDataRange=function(){var t=null,e=null,i=this.itemsData&&this.itemsData.getDataSet();return i&&i.forEach(function(i){var o=s.convert(i.start,"Date").valueOf(),n=s.convert(void 0!=i.end?i.end:i.start,"Date").valueOf();(null===t||t>o)&&(t=o),(null===e||n>e)&&(e=o)}),{min:null!=t?new Date(t):null,max:null!=e?new Date(e):null}},o.prototype.getEventProperties=function(t){var e=t.center?t.center.x:t.clientX,i=t.center?t.center.y:t.clientY,o=e-s.getAbsoluteLeft(this.dom.centerContainer),n=i-s.getAbsoluteTop(this.dom.centerContainer),r=this.itemSet.itemFromTarget(t),a=this.itemSet.groupFromTarget(t),h=c.customTimeFromTarget(t),d=this.itemSet.options.snap||null,l=this.body.util.getScale(),u=this.body.util.getStep(),p=this._toTime(o),f=d?d(p,l,u):p,m=s.getTarget(t),v=null;return null!=r?v="item":null!=h?v="custom-time":s.hasParent(m,this.timeAxis.dom.foreground)?v="axis":this.timeAxis2&&s.hasParent(m,this.timeAxis2.dom.foreground)?v="axis":s.hasParent(m,this.itemSet.dom.labelSet)?v="group-label":s.hasParent(m,this.currentTime.bar)?v="current-time":s.hasParent(m,this.dom.center)&&(v="background"),{event:t,item:r?r.id:null,group:a?a.groupId:null,what:v,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:n,time:p,snappedTime:f}},t.exports=o},function(t,e,i){if("undefined"!=typeof window){var o=i(21),n=window.Hammer||i(22);t.exports=o(n,{preventDefault:"mouse"})}else t.exports=function(){throw Error("hammer.js is only available in a browser, not in node.js.")}},function(t,e,i){var o,n,s;!function(i){n=[],o=i,s="function"==typeof o?o.apply(e,n):o,!(void 0!==s&&(t.exports=s))}(function(){var t=null;return function e(i,o){function n(t){return t.match(/[^ ]+/g)}function s(e){if("hammer.input"!==e.type){if(e.srcEvent._handled||(e.srcEvent._handled={}),e.srcEvent._handled[e.type])return;e.srcEvent._handled[e.type]=!0}var i=!1;e.stopPropagation=function(){i=!0},e.firstTarget=t;for(var o=t;o&&!i;){var n=o.hammer&&o.hammer._handlers[e.type];if(n)for(var s=0;s0?d._handlers[t]=o:(i.off(t,s),delete d._handlers[t]))}),d},d.emit=function(e,o){t=o.target,i.emit(e,o)},d.destroy=function(){delete i.element.hammer,d._handlers={},i.destroy()},d}})},function(t,e,i){var o;!function(n,s,r,a){function h(t,e,i){return setTimeout(f(t,i),e)}function d(t,e,i){return Array.isArray(t)?(l(t,i[e],i),!0):!1}function l(t,e,i){var o;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==a)for(o=0;o-1}function _(t){return t.trim().split(/\s+/g)}function x(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var o=0;oi[e]}):o.sort()),o}function D(t,e){for(var i,o,n=e[0].toUpperCase()+e.slice(1),s=0;s1&&!i.firstMultiple?i.firstMultiple=N(e):1===n&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,h=e.center=L(o);e.timeStamp=gt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=F(a,h),e.distance=R(a,h),I(i,e),e.offsetDirection=B(e.deltaX,e.deltaY),e.scale=r?H(r.pointers,o):1,e.rotation=r?j(r.pointers,o):0,z(i,e);var d=t.element;b(e.srcEvent.target,d)&&(d=e.srcEvent.target),e.target=d}function I(t,e){var i=e.center,o=t.offsetDelta||{},n=t.prevDelta||{},s=t.prevInput||{};(e.eventType===Tt||s.eventType===St)&&(n=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},o=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=n.x+(i.x-o.x),e.deltaY=n.y+(i.y-o.y)}function z(t,e){var i,o,n,s,r=t.lastInterval||e,h=e.timeStamp-r.timeStamp;if(e.eventType!=Pt&&(h>Ct||r.velocity===a)){var d=r.deltaX-e.deltaX,l=r.deltaY-e.deltaY,u=A(h,d,l);o=u.x,n=u.y,i=vt(u.x)>vt(u.y)?u.x:u.y,s=B(d,l),t.lastInterval=e}else i=r.velocity,o=r.velocityX,n=r.velocityY,s=r.direction;e.velocity=i,e.velocityX=o,e.velocityY=n,e.direction=s}function N(t){for(var e=[],i=0;in;)i+=t[n].clientX,o+=t[n].clientY,n++;return{x:mt(i/e),y:mt(o/e)}}function A(t,e,i){return{x:e/t||0,y:i/t||0}}function B(t,e){return t===e?It:vt(t)>=vt(e)?t>0?zt:Nt:e>0?Lt:At}function R(t,e,i){i||(i=jt);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return Math.sqrt(o*o+n*n)}function F(t,e,i){i||(i=jt);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return 180*Math.atan2(n,o)/Math.PI}function j(t,e){return F(e[1],e[0],Ht)-F(t[1],t[0],Ht)}function H(t,e){return R(e[0],e[1],Ht)/R(t[0],t[1],Ht)}function W(){this.evEl=Yt,this.evWin=Gt,this.allow=!0,this.pressed=!1,T.apply(this,arguments)}function Y(){this.evEl=qt,this.evWin=Xt,T.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function G(){this.evTarget=Kt,this.evWin=Jt,this.started=!1,T.apply(this,arguments)}function U(t,e){var i=k(t.touches),o=k(t.changedTouches);return e&(St|Pt)&&(i=O(i.concat(o),"identifier",!0)),[i,o]}function V(){this.evTarget=$t,this.targetIds={},T.apply(this,arguments)}function q(t,e){var i=k(t.touches),o=this.targetIds;if(e&(Tt|Et)&&1===i.length)return o[i[0].identifier]=!0,[i,i];var n,s,r=k(t.changedTouches),a=[],h=this.target;if(s=i.filter(function(t){return b(t.target,h)}),e===Tt)for(n=0;na&&(e.push(t),a=e.length-1):n&(St|Pt)&&(i=!0),0>a||(e[a]=t,this.callback(this.manager,n,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),i&&e.splice(a,1))}});var Zt={touchstart:Tt,touchmove:Et,touchend:St,touchcancel:Pt},Kt="touchstart",Jt="touchstart touchmove touchend touchcancel";p(G,T,{handler:function(t){var e=Zt[t.type];if(e===Tt&&(this.started=!0),this.started){var i=U.call(this,t,e);e&(St|Pt)&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:kt,srcEvent:t})}}});var Qt={touchstart:Tt,touchmove:Et,touchend:St,touchcancel:Pt},$t="touchstart touchmove touchend touchcancel";
+p(V,T,{handler:function(t){var e=Qt[t.type],i=q.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:kt,srcEvent:t})}}),p(X,T,{handler:function(t,e,i){var o=i.pointerType==kt,n=i.pointerType==Dt;if(o)this.mouse.allow=!1;else if(n&&!this.mouse.allow)return;e&(St|Pt)&&(this.mouse.allow=!0),this.callback(t,e,i)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var te=D(pt.style,"touchAction"),ee=te!==a,ie="compute",oe="auto",ne="manipulation",se="none",re="pan-x",ae="pan-y";Z.prototype={set:function(t){t==ie&&(t=this.compute()),ee&&(this.manager.element.style[te]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return l(this.manager.recognizers,function(e){m(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),K(t.join(" "))},preventDefaults:function(t){if(!ee){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var o=this.actions,n=w(o,se),s=w(o,ae),r=w(o,re);return n||s&&i&Bt||r&&i&Rt?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var he=1,de=2,le=4,ue=8,ce=ue,pe=16,fe=32;J.prototype={defaults:{},set:function(t){return u(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(d(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=tt(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return d(t,"dropRecognizeWith",this)?this:(t=tt(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(d(t,"requireFailure",this))return this;var e=this.requireFail;return t=tt(t,this),-1===x(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(d(t,"dropRequireFailure",this))return this;t=tt(t,this);var e=x(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){i.manager.emit(i.options.event+(e?Q(o):""),t)}var i=this,o=this.state;ue>o&&e(!0),e(),o>=ue&&e(!0)},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=fe)},canEmit:function(){for(var t=0;ts?zt:Nt,i=s!=this.pX,o=Math.abs(t.deltaX)):(n=0===r?It:0>r?Lt:At,i=r!=this.pY,o=Math.abs(t.deltaY))),t.direction=n,i&&o>e.threshold&&n&e.direction},attrTest:function(t){return et.prototype.attrTest.call(this,t)&&(this.state&de||!(this.state&de)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=$(t.direction);e&&this.manager.emit(this.options.event+e,t),this._super.emit.call(this,t)}}),p(ot,et,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[se]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&de)},emit:function(t){if(this._super.emit.call(this,t),1!==t.scale){var e=t.scale<1?"in":"out";this.manager.emit(this.options.event+e,t)}}}),p(nt,J,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return[oe]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distancee.time;if(this._input=t,!o||!i||t.eventType&(St|Pt)&&!n)this.reset();else if(t.eventType&Tt)this.reset(),this._timer=h(function(){this.state=ce,this.tryEmit()},e.time,this);else if(t.eventType&St)return ce;return fe},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===ce&&(t&&t.eventType&St?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=gt(),this.manager.emit(this.options.event,this._input)))}}),p(st,et,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[se]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&de)}}),p(rt,et,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:Bt|Rt,pointers:1},getTouchAction:function(){return it.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Bt|Rt)?e=t.velocity:i&Bt?e=t.velocityX:i&Rt&&(e=t.velocityY),this._super.attrTest.call(this,t)&&i&t.direction&&t.distance>this.options.threshold&&vt(e)>this.options.velocity&&t.eventType&St},emit:function(t){var e=$(t.direction);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),p(at,J,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[ne]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distanceu,c=r||null===n?n:h+(n-h)*i,v=r||null===s?s:l+(s-l)*i;g=a._applyRange(c,v),d.updateHiddenDates(a.options.moment,a.body,a.options.hiddenDates),m=m||g,g&&a.body.emitter.emit("rangechange",{start:new Date(a.start),end:new Date(a.end),byUser:o}),r?m&&a.body.emitter.emit("rangechanged",{start:new Date(a.start),end:new Date(a.end),byUser:o}):a.animationTimer=setTimeout(b,20)}};return v()}var g=this._applyRange(n,s);if(d.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),g){var y={start:new Date(this.start),end:new Date(this.end),byUser:o};this.body.emitter.emit("rangechange",y),this.body.emitter.emit("rangechanged",y)}},o.prototype._cancelAnimation=function(){this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=null)},o.prototype._applyRange=function(t,e){var i,o=null!=t?r.convert(t,"Date").valueOf():this.start,n=null!=e?r.convert(e,"Date").valueOf():this.end,s=null!=this.options.max?r.convert(this.options.max,"Date").valueOf():null,a=null!=this.options.min?r.convert(this.options.min,"Date").valueOf():null;if(isNaN(o)||null===o)throw new Error('Invalid start "'+t+'"');if(isNaN(n)||null===n)throw new Error('Invalid end "'+e+'"');if(o>n&&(n=o),null!==a&&a>o&&(i=a-o,o+=i,n+=i,null!=s&&n>s&&(n=s)),null!==s&&n>s&&(i=n-s,o-=i,n-=i,null!=a&&a>o&&(o=a)),null!==this.options.zoomMin){var h=parseFloat(this.options.zoomMin);0>h&&(h=0),h>n-o&&(this.end-this.start===h&&o>this.start&&nd&&(d=0),n-o>d&&(this.end-this.start===d&&othis.end?(o=this.start,n=this.end):(i=n-o-d,o+=i/2,n-=i/2))}var l=this.start!=o||this.end!=n;return o>=this.start&&o<=this.end||n>=this.start&&n<=this.end||this.start>=o&&this.start<=n||this.end>=o&&this.end<=n||this.body.emitter.emit("checkRangedItems"),this.start=o,this.end=n,l},o.prototype.getRange=function(){return{start:this.start,end:this.end}},o.prototype.conversion=function(t,e){return o.conversion(this.start,this.end,t,e)},o.conversion=function(t,e,i,o){return void 0===o&&(o=0),0!=i&&e-t!=0?{offset:t,scale:i/(e-t-o)}:{offset:0,scale:1}},o.prototype._onDragStart=function(t){this.deltaDifference=0,this.previousDelta=0,this.options.moveable&&this._isInsideRange(t)&&this.props.touch.allowDragging&&(this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.dragging=!0,this.body.dom.root&&(this.body.dom.root.style.cursor="move"))},o.prototype._onDrag=function(t){if(this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging){var e=this.options.direction;n(e);var i="horizontal"==e?t.deltaX:t.deltaY;i-=this.deltaDifference;var o=this.props.touch.end-this.props.touch.start,s=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end);o-=s;var r="horizontal"==e?this.body.domProps.center.width:this.body.domProps.center.height,a=-i/r*o,h=this.props.touch.start+a,l=this.props.touch.end+a,u=d.snapAwayFromHidden(this.body.hiddenDates,h,this.previousDelta-i,!0),c=d.snapAwayFromHidden(this.body.hiddenDates,l,this.previousDelta-i,!0);if(u!=h||c!=l)return this.deltaDifference+=i,this.props.touch.start=u,this.props.touch.end=c,void this._onDrag(t);this.previousDelta=i,this._applyRange(h,l),this.body.emitter.emit("rangechange",{start:new Date(this.start),end:new Date(this.end),byUser:!0})}},o.prototype._onDragEnd=function(t){this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging&&(this.props.touch.dragging=!1,this.body.dom.root&&(this.body.dom.root.style.cursor="auto"),this.body.emitter.emit("rangechanged",{start:new Date(this.start),end:new Date(this.end),byUser:!0}))},o.prototype._onMouseWheel=function(t){if(this.options.zoomable&&this.options.moveable&&this._isInsideRange(t)&&(!this.options.zoomKey||t[this.options.zoomKey])){var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),e){var i;i=0>e?1-e/5:1/(1+e/5);var o=s({x:t.clientX,y:t.clientY},this.body.dom.center),n=this._pointerToDate(o);this.zoom(i,n,e)}t.preventDefault()}},o.prototype._onTouch=function(t){this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.allowDragging=!0,this.props.touch.center=null,this.scaleOffset=0,this.deltaDifference=0},o.prototype._onPinch=function(t){if(this.options.zoomable&&this.options.moveable){this.props.touch.allowDragging=!1,this.props.touch.center||(this.props.touch.center=s(t.center,this.body.dom.center));var e=1/(t.scale+this.scaleOffset),i=this._pointerToDate(this.props.touch.center),o=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=d.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,i),r=o-n,a=i-n+(this.props.touch.start-(i-n))*e,h=i+r+(this.props.touch.end-(i+r))*e;this.startToFront=0>=1-e,this.endToFront=0>=e-1;var l=d.snapAwayFromHidden(this.body.hiddenDates,a,1-e,!0),u=d.snapAwayFromHidden(this.body.hiddenDates,h,e-1,!0);(l!=a||u!=h)&&(this.props.touch.start=l,this.props.touch.end=u,this.scaleOffset=1-t.scale,a=l,h=u),this.setRange(a,h,!1,!0),this.startToFront=!1,this.endToFront=!0}},o.prototype._isInsideRange=function(t){var e=t.center?t.center.x:t.clientX,i=e-r.getAbsoluteLeft(this.body.dom.centerContainer),o=this.body.util.toTime(i);return o>=this.start&&o<=this.end},o.prototype._pointerToDate=function(t){var e,i=this.options.direction;if(n(i),"horizontal"==i)return this.body.util.toTime(t.x).valueOf();var o=this.body.domProps.center.height;return e=this.conversion(o),t.y/e.scale+e.offset},o.prototype.zoom=function(t,e,i){null==e&&(e=(this.start+this.end)/2);var o=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=d.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,e),s=o-n,r=e-n+(this.start-(e-n))*t,a=e+s+(this.end-(e+s))*t;this.startToFront=i>0?!1:!0,this.endToFront=-i>0?!1:!0;var h=d.snapAwayFromHidden(this.body.hiddenDates,r,i,!0),l=d.snapAwayFromHidden(this.body.hiddenDates,a,-i,!0);(h!=r||l!=a)&&(r=h,a=l),this.setRange(r,a,!1,!0),this.startToFront=!1,this.endToFront=!0},o.prototype.move=function(t){var e=this.end-this.start,i=this.start+e*t,o=this.end+e*t;this.start=i,this.end=o},o.prototype.moveTo=function(t){var e=(this.start+this.end)/2,i=e-t,o=this.start-i,n=this.end-i;this.setRange(o,n)},t.exports=o},function(t,e,i){i(20);e.onTouch=function(t,e){e.inputHandler=function(t){t.isFirst&&!o&&(e(t),o=!0,setTimeout(function(){o=!1},0))},t.on("hammer.input",e.inputHandler)};var o=!1;e.onRelease=function(t,e){return e.inputHandler=function(t){t.isFinal&&!n&&(e(t),n=!0,setTimeout(function(){n=!1},0))},t.on("hammer.input",e.inputHandler)};var n=!1;e.offTouch=function(t,e){t.off("hammer.input",e.inputHandler)},e.offRelease=e.offTouch},function(t,e){function i(t,e){this.options=null,this.props=null}i.prototype.setOptions=function(t){t&&util.extend(this.options,t)},i.prototype.redraw=function(){return!1},i.prototype.destroy=function(){},i.prototype._isResized=function(){var t=this.props._previousWidth!==this.props.width||this.props._previousHeight!==this.props.height;return this.props._previousWidth=this.props.width,this.props._previousHeight=this.props.height,t},t.exports=i},function(t,e){e.convertHiddenOptions=function(t,i,o){if(o&&!Array.isArray(o))return e.convertHiddenOptions(t,i,[o]);if(i.hiddenDates=[],o&&1==Array.isArray(o)){for(var n=0;n=4*a){var c=0,p=s.clone();switch(o[h].repeat){case"daily":d.day()!=l.day()&&(c=1),d.dayOfYear(n.dayOfYear()),d.year(n.year()),d.subtract(7,"days"),l.dayOfYear(n.dayOfYear()),l.year(n.year()),l.subtract(7-c,"days"),p.add(1,"weeks");break;case"weekly":var f=l.diff(d,"days"),m=d.day();d.date(n.date()),d.month(n.month()),d.year(n.year()),l=d.clone(),d.day(m),l.day(m),l.add(f,"days"),d.subtract(1,"weeks"),l.subtract(1,"weeks"),p.add(1,"weeks");break;case"monthly":d.month()!=l.month()&&(c=1),d.month(n.month()),d.year(n.year()),d.subtract(1,"months"),l.month(n.month()),l.year(n.year()),l.subtract(1,"months"),l.add(c,"months"),p.add(1,"months");break;case"yearly":d.year()!=l.year()&&(c=1),d.year(n.year()),d.subtract(1,"years"),l.year(n.year()),l.subtract(1,"years"),l.add(c,"years"),p.add(1,"years");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",o[h].repeat)}for(;p>d;)switch(i.hiddenDates.push({start:d.valueOf(),end:l.valueOf()}),o[h].repeat){case"daily":d.add(1,"days"),l.add(1,"days");break;case"weekly":d.add(1,"weeks"),l.add(1,"weeks");break;case"monthly":d.add(1,"months"),l.add(1,"months");break;case"yearly":d.add(1,"y"),l.add(1,"y");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",o[h].repeat)}i.hiddenDates.push({start:d.valueOf(),end:l.valueOf()})}}e.removeDuplicates(i);var v=e.isHidden(i.range.start,i.hiddenDates),g=e.isHidden(i.range.end,i.hiddenDates),y=i.range.start,b=i.range.end;1==v.hidden&&(y=1==i.range.startToFront?v.startDate-1:v.endDate+1),1==g.hidden&&(b=1==i.range.endToFront?g.startDate-1:g.endDate+1),(1==v.hidden||1==g.hidden)&&i.range._applyRange(y,b)}},e.removeDuplicates=function(t){for(var e=t.hiddenDates,i=[],o=0;o=e[o].start&&e[n].end<=e[o].end?e[n].remove=!0:e[n].start>=e[o].start&&e[n].start<=e[o].end?(e[o].end=e[n].end,e[n].remove=!0):e[n].end>=e[o].start&&e[n].end<=e[o].end&&(e[o].start=e[n].start,e[n].remove=!0));for(var o=0;o=r&&a>n){o=!0;break}}if(1==o&&n=e&&i>r&&(o+=r-s)}return o},e.correctTimeForHidden=function(t,i,o,n){return n=t(n).toDate().valueOf(),n-=e.getHiddenDurationBefore(t,i,o,n)},e.getHiddenDurationBefore=function(t,e,i,o){var n=0;o=t(o).toDate().valueOf();for(var s=0;s=i.start&&a=a&&(n+=a-r)}return n},e.getAccumulatedHiddenDuration=function(t,e,i){for(var o=0,n=0,s=e.start,r=0;r=e.start&&h=i)break;o+=h-a}}return o},e.snapAwayFromHidden=function(t,i,o,n){var s=e.isHidden(i,t);return 1==s.hidden?0>o?1==n?s.startDate-(s.endDate-i)-1:s.startDate-1:1==n?s.endDate+(i-s.startDate)+1:s.endDate+1:i},e.isHidden=function(t,e){for(var i=0;i=o&&n>t)return{hidden:!0,startDate:o,endDate:n}}return{hidden:!1,startDate:o,endDate:n}}},function(t,e,i){function o(){}var n=i(12),s=i(20),r=i(25),a=i(1),h=(i(8),i(10),i(24),i(29),i(39)),d=i(40),l=i(27),u=i(42);n(o.prototype),o.prototype._create=function(t){function e(t){i.isActive()&&i.emit("mousewheel",t)}this.dom={},this.dom.container=t,this.dom.root=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.backgroundVertical=document.createElement("div"),this.dom.backgroundHorizontal=document.createElement("div"),this.dom.centerContainer=document.createElement("div"),this.dom.leftContainer=document.createElement("div"),this.dom.rightContainer=document.createElement("div"),this.dom.center=document.createElement("div"),this.dom.left=document.createElement("div"),this.dom.right=document.createElement("div"),this.dom.top=document.createElement("div"),this.dom.bottom=document.createElement("div"),this.dom.shadowTop=document.createElement("div"),this.dom.shadowBottom=document.createElement("div"),this.dom.shadowTopLeft=document.createElement("div"),this.dom.shadowBottomLeft=document.createElement("div"),this.dom.shadowTopRight=document.createElement("div"),this.dom.shadowBottomRight=document.createElement("div"),this.dom.root.className="vis-timeline",this.dom.background.className="vis-panel vis-background",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical",this.dom.backgroundHorizontal.className="vis-panel vis-background vis-horizontal",this.dom.centerContainer.className="vis-panel vis-center",this.dom.leftContainer.className="vis-panel vis-left",this.dom.rightContainer.className="vis-panel vis-right",this.dom.top.className="vis-panel vis-top",this.dom.bottom.className="vis-panel vis-bottom",this.dom.left.className="vis-content",this.dom.center.className="vis-content",this.dom.right.className="vis-content",this.dom.shadowTop.className="vis-shadow vis-top",this.dom.shadowBottom.className="vis-shadow vis-bottom",this.dom.shadowTopLeft.className="vis-shadow vis-top",this.dom.shadowBottomLeft.className="vis-shadow vis-bottom",this.dom.shadowTopRight.className="vis-shadow vis-top",this.dom.shadowBottomRight.className="vis-shadow vis-bottom",this.dom.root.appendChild(this.dom.background),this.dom.root.appendChild(this.dom.backgroundVertical),this.dom.root.appendChild(this.dom.backgroundHorizontal),this.dom.root.appendChild(this.dom.centerContainer),this.dom.root.appendChild(this.dom.leftContainer),this.dom.root.appendChild(this.dom.rightContainer),this.dom.root.appendChild(this.dom.top),this.dom.root.appendChild(this.dom.bottom),this.dom.centerContainer.appendChild(this.dom.center),this.dom.leftContainer.appendChild(this.dom.left),this.dom.rightContainer.appendChild(this.dom.right),this.dom.centerContainer.appendChild(this.dom.shadowTop),this.dom.centerContainer.appendChild(this.dom.shadowBottom),this.dom.leftContainer.appendChild(this.dom.shadowTopLeft),this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft),this.dom.rightContainer.appendChild(this.dom.shadowTopRight),this.dom.rightContainer.appendChild(this.dom.shadowBottomRight),this.on("rangechange",function(){this._redraw()}.bind(this)),this.on("touch",this._onTouch.bind(this)),this.on("pan",this._onDrag.bind(this));var i=this;this.on("change",function(t){t&&1==t.queue?i._redrawTimer||(i._redrawTimer=setTimeout(function(){i._redrawTimer=null,i._redraw()},0)):i._redraw()}),this.hammer=new s(this.dom.root),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:30}),this.listeners={};var o=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];if(o.forEach(function(t){var e=function(e){i.isActive()&&i.emit(t,e)};i.hammer.on(t,e),i.listeners[t]=e}),r.onTouch(this.hammer,function(t){i.emit("touch",t)}.bind(this)),r.onRelease(this.hammer,function(t){i.emit("release",t)}.bind(this)),this.dom.root.addEventListener("mousewheel",e),this.dom.root.addEventListener("DOMMouseScroll",e),this.props={root:{},background:{},centerContainer:{},leftContainer:{},rightContainer:{},center:{},left:{},right:{},top:{},bottom:{},border:{},scrollTop:0,scrollTopMin:0},this.customTimes=[],this.touch={},this.redrawCount=0,!t)throw new Error("No container provided");t.appendChild(this.dom.root)},o.prototype.setOptions=function(t){if(t){var e=["width","height","minHeight","maxHeight","autoResize","start","end","clickToUse","dataAttributes","hiddenDates","locale","locales","moment","throttleRedraw"];if(a.selectiveExtend(e,this.options,t),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation={item:t.orientation,axis:t.orientation}:"object"==typeof t.orientation&&("item"in t.orientation&&(this.options.orientation.item=t.orientation.item),"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis))),"both"===this.options.orientation.axis){if(!this.timeAxis2){var i=this.timeAxis2=new h(this.body);i.setOptions=function(t){var e=t?a.extend({},t):{};e.orientation="top",h.prototype.setOptions.call(i,e)},this.components.push(i)}}else if(this.timeAxis2){var o=this.components.indexOf(this.timeAxis2);-1!==o&&this.components.splice(o,1),this.timeAxis2.destroy(),this.timeAxis2=null}if("function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),"hiddenDates"in this.options&&l.convertHiddenOptions(this.options.moment,this.body,this.options.hiddenDates),"clickToUse"in t&&(t.clickToUse?this.activator||(this.activator=new d(this.dom.root)):this.activator&&(this.activator.destroy(),delete this.activator)),"showCustomTime"in t)throw new Error("Option `showCustomTime` is deprecated. Create a custom time bar via timeline.addCustomTime(time [, id])");this._initAutoResize()}if(this.components.forEach(function(e){return e.setOptions(t)}),"configure"in t){this.configurator||(this.configurator=this._createConfigurator()),this.configurator.setOptions(t.configure);var n=a.deepExtend({},this.options);this.components.forEach(function(t){a.deepExtend(n,t.options)}),this.configurator.setModuleOptions({global:n})}this._origRedraw||(this._origRedraw=this._redraw.bind(this)),this._redraw=a.throttle(this._origRedraw,this.options.throttleRedraw),this._redraw()},o.prototype.isActive=function(){return!this.activator||this.activator.active},o.prototype.destroy=function(){this.setItems(null),this.setGroups(null),this.off(),this._stopAutoResize(),this.dom.root.parentNode&&this.dom.root.parentNode.removeChild(this.dom.root),this.dom=null,this.activator&&(this.activator.destroy(),delete this.activator);for(var t in this.listeners)this.listeners.hasOwnProperty(t)&&delete this.listeners[t];this.listeners=null,this.hammer=null,this.components.forEach(function(t){return t.destroy()}),this.body=null},o.prototype.setCustomTime=function(t,e){var i=this.customTimes.filter(function(t){return e===t.options.id});if(0===i.length)throw new Error("No custom time bar found with id "+JSON.stringify(e));i.length>0&&i[0].setCustomTime(t)},o.prototype.getCustomTime=function(t){var e=this.customTimes.filter(function(e){return e.options.id===t});if(0===e.length)throw new Error("No custom time bar found with id "+JSON.stringify(t));return e[0].getCustomTime()},o.prototype.setCustomTimeTitle=function(t,e){var i=this.customTimes.filter(function(t){return t.options.id===e});if(0===i.length)throw new Error("No custom time bar found with id "+JSON.stringify(e));return i.length>0?i[0].setCustomTitle(t):void 0},o.prototype.getEventProperties=function(t){return{event:t}},o.prototype.addCustomTime=function(t,e){var i=void 0!==t?a.convert(t,"Date").valueOf():new Date,o=this.customTimes.some(function(t){return t.options.id===e});if(o)throw new Error("A custom time with id "+JSON.stringify(e)+" already exists");var n=new u(this.body,a.extend({},this.options,{time:i,id:e}));return this.customTimes.push(n),this.components.push(n),this._redraw(),e},o.prototype.removeCustomTime=function(t){var e=this.customTimes.filter(function(e){return e.options.id===t});if(0===e.length)throw new Error("No custom time bar found with id "+JSON.stringify(t));e.forEach(function(t){this.customTimes.splice(this.customTimes.indexOf(t),1),
+this.components.splice(this.components.indexOf(t),1),t.destroy()}.bind(this))},o.prototype.getVisibleItems=function(){return this.itemSet&&this.itemSet.getVisibleItems()||[]},o.prototype.fit=function(t){var e=this.getDataRange();if(null!==e.min||null!==e.max){var i=e.max-e.min,o=new Date(e.min.valueOf()-.01*i),n=new Date(e.max.valueOf()+.01*i),s=t&&void 0!==t.animation?t.animation:!0;this.range.setRange(o,n,s)}},o.prototype.getDataRange=function(){throw new Error("Cannot invoke abstract method getDataRange")},o.prototype.setWindow=function(t,e,i){var o;if(1==arguments.length){var n=arguments[0];o=void 0!==n.animation?n.animation:!0,this.range.setRange(n.start,n.end,o)}else o=i&&void 0!==i.animation?i.animation:!0,this.range.setRange(t,e,o)},o.prototype.moveTo=function(t,e){var i=this.range.end-this.range.start,o=a.convert(t,"Date").valueOf(),n=o-i/2,s=o+i/2,r=e&&void 0!==e.animation?e.animation:!0;this.range.setRange(n,s,r)},o.prototype.getWindow=function(){var t=this.range.getRange();return{start:new Date(t.start),end:new Date(t.end)}},o.prototype.redraw=function(){this._redraw()},o.prototype._redraw=function(){var t=!1,e=this.options,i=this.props,o=this.dom;if(o){l.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),"top"==e.orientation?(a.addClassName(o.root,"vis-top"),a.removeClassName(o.root,"vis-bottom")):(a.removeClassName(o.root,"vis-top"),a.addClassName(o.root,"vis-bottom")),o.root.style.maxHeight=a.option.asSize(e.maxHeight,""),o.root.style.minHeight=a.option.asSize(e.minHeight,""),o.root.style.width=a.option.asSize(e.width,""),i.border.left=(o.centerContainer.offsetWidth-o.centerContainer.clientWidth)/2,i.border.right=i.border.left,i.border.top=(o.centerContainer.offsetHeight-o.centerContainer.clientHeight)/2,i.border.bottom=i.border.top;var n=o.root.offsetHeight-o.root.clientHeight,s=o.root.offsetWidth-o.root.clientWidth;0===o.centerContainer.clientHeight&&(i.border.left=i.border.top,i.border.right=i.border.left),0===o.root.clientHeight&&(s=n),i.center.height=o.center.offsetHeight,i.left.height=o.left.offsetHeight,i.right.height=o.right.offsetHeight,i.top.height=o.top.clientHeight||-i.border.top,i.bottom.height=o.bottom.clientHeight||-i.border.bottom;var r=Math.max(i.left.height,i.center.height,i.right.height),h=i.top.height+r+i.bottom.height+n+i.border.top+i.border.bottom;o.root.style.height=a.option.asSize(e.height,h+"px"),i.root.height=o.root.offsetHeight,i.background.height=i.root.height-n;var d=i.root.height-i.top.height-i.bottom.height-n;i.centerContainer.height=d,i.leftContainer.height=d,i.rightContainer.height=i.leftContainer.height,i.root.width=o.root.offsetWidth,i.background.width=i.root.width-s,i.left.width=o.leftContainer.clientWidth||-i.border.left,i.leftContainer.width=i.left.width,i.right.width=o.rightContainer.clientWidth||-i.border.right,i.rightContainer.width=i.right.width;var u=i.root.width-i.left.width-i.right.width-s;i.center.width=u,i.centerContainer.width=u,i.top.width=u,i.bottom.width=u,o.background.style.height=i.background.height+"px",o.backgroundVertical.style.height=i.background.height+"px",o.backgroundHorizontal.style.height=i.centerContainer.height+"px",o.centerContainer.style.height=i.centerContainer.height+"px",o.leftContainer.style.height=i.leftContainer.height+"px",o.rightContainer.style.height=i.rightContainer.height+"px",o.background.style.width=i.background.width+"px",o.backgroundVertical.style.width=i.centerContainer.width+"px",o.backgroundHorizontal.style.width=i.background.width+"px",o.centerContainer.style.width=i.center.width+"px",o.top.style.width=i.top.width+"px",o.bottom.style.width=i.bottom.width+"px",o.background.style.left="0",o.background.style.top="0",o.backgroundVertical.style.left=i.left.width+i.border.left+"px",o.backgroundVertical.style.top="0",o.backgroundHorizontal.style.left="0",o.backgroundHorizontal.style.top=i.top.height+"px",o.centerContainer.style.left=i.left.width+"px",o.centerContainer.style.top=i.top.height+"px",o.leftContainer.style.left="0",o.leftContainer.style.top=i.top.height+"px",o.rightContainer.style.left=i.left.width+i.center.width+"px",o.rightContainer.style.top=i.top.height+"px",o.top.style.left=i.left.width+"px",o.top.style.top="0",o.bottom.style.left=i.left.width+"px",o.bottom.style.top=i.top.height+i.centerContainer.height+"px",this._updateScrollTop();var c=this.props.scrollTop;"top"!=e.orientation.item&&(c+=Math.max(this.props.centerContainer.height-this.props.center.height-this.props.border.top-this.props.border.bottom,0)),o.center.style.left="0",o.center.style.top=c+"px",o.left.style.left="0",o.left.style.top=c+"px",o.right.style.left="0",o.right.style.top=c+"px";var p=0==this.props.scrollTop?"hidden":"",f=this.props.scrollTop==this.props.scrollTopMin?"hidden":"";if(o.shadowTop.style.visibility=p,o.shadowBottom.style.visibility=f,o.shadowTopLeft.style.visibility=p,o.shadowBottomLeft.style.visibility=f,o.shadowTopRight.style.visibility=p,o.shadowBottomRight.style.visibility=f,this.components.forEach(function(e){t=e.redraw()||t}),t){var m=3;this.redrawCount0&&(this.props.scrollTop=0),this.props.scrollTope;e++)o=this.selection[e],n=this.items[o],n&&n.unselect();for(this.selection=[],e=0,i=t.length;i>e;e++)o=t[e],n=this.items[o],n&&(this.selection.push(o),n.select())},o.prototype.getSelection=function(){return this.selection.concat([])},o.prototype.getVisibleItems=function(){var t=this.body.range.getRange(),e=this.body.util.toScreen(t.start),i=this.body.util.toScreen(t.end),o=[];for(var n in this.groups)if(this.groups.hasOwnProperty(n))for(var s=this.groups[n],r=s.visibleItems,a=0;ae&&o.push(h.id)}return o},o.prototype._deselect=function(t){for(var e=this.selection,i=0,o=e.length;o>i;i++)if(e[i]==t){e.splice(i,1);break}},o.prototype.redraw=function(){var t=this.options.margin,e=this.body.range,i=s.option.asSize,o=this.options,n=o.orientation.item,r=!1,a=this.dom.frame;this.props.top=this.body.domProps.top.height+this.body.domProps.border.top,this.props.left=this.body.domProps.left.width+this.body.domProps.border.left,a.className="vis-itemset",r=this._orderGroups()||r;var h=e.end-e.start,d=h!=this.lastVisibleInterval||this.props.width!=this.props.lastWidth;d&&(this.stackDirty=!0),this.lastVisibleInterval=h,this.props.lastWidth=this.props.width;var l=this.stackDirty,u=this._firstGroup(),c={item:t.item,axis:t.axis},p={item:t.item,axis:t.item.vertical/2},f=0,m=t.axis+t.item.vertical;return this.groups[g].redraw(e,p,l),s.forEach(this.groups,function(t){var i=t==u?c:p,o=t.redraw(e,i,l);r=o||r,f+=t.height}),f=Math.max(f,m),this.stackDirty=!1,a.style.height=i(f),this.props.width=a.offsetWidth,this.props.height=f,this.dom.axis.style.top=i("top"==n?this.body.domProps.top.height+this.body.domProps.border.top:this.body.domProps.top.height+this.body.domProps.centerContainer.height),this.dom.axis.style.left="0",r=this._isResized()||r},o.prototype._firstGroup=function(){var t="top"==this.options.orientation.item?0:this.groupIds.length-1,e=this.groupIds[t],i=this.groups[e]||this.groups[v];return i||null},o.prototype._updateUngrouped=function(){var t,e,i=this.groups[v];this.groups[g];if(this.groupsData){if(i){i.hide(),delete this.groups[v];for(e in this.items)if(this.items.hasOwnProperty(e)){t=this.items[e],t.parent&&t.parent.remove(t);var o=this._getGroupId(t.data),n=this.groups[o];n&&n.add(t)||t.hide()}}}else if(!i){var s=null,r=null;i=new l(s,r,this),this.groups[v]=i;for(e in this.items)this.items.hasOwnProperty(e)&&(t=this.items[e],i.add(t));i.show()}},o.prototype.getLabelSet=function(){return this.dom.labelSet},o.prototype.setItems=function(t){var e,i=this,o=this.itemsData;if(t){if(!(t instanceof r||t instanceof a))throw new TypeError("Data must be an instance of DataSet or DataView");this.itemsData=t}else this.itemsData=null;if(o&&(s.forEach(this.itemListeners,function(t,e){o.off(e,t)}),e=o.getIds(),this._onRemove(e)),this.itemsData){var n=this.id;s.forEach(this.itemListeners,function(t,e){i.itemsData.on(e,t,n)}),e=this.itemsData.getIds(),this._onAdd(e),this._updateUngrouped()}},o.prototype.getItems=function(){return this.itemsData},o.prototype.setGroups=function(t){var e,i=this;if(this.groupsData&&(s.forEach(this.groupListeners,function(t,e){i.groupsData.off(e,t)}),e=this.groupsData.getIds(),this.groupsData=null,this._onRemoveGroups(e)),t){if(!(t instanceof r||t instanceof a))throw new TypeError("Data must be an instance of DataSet or DataView");this.groupsData=t}else this.groupsData=null;if(this.groupsData){var o=this.id;s.forEach(this.groupListeners,function(t,e){i.groupsData.on(e,t,o)}),e=this.groupsData.getIds(),this._onAddGroups(e)}this._updateUngrouped(),this._order(),this.body.emitter.emit("change",{queue:!0})},o.prototype.getGroups=function(){return this.groupsData},o.prototype.removeItem=function(t){var e=this.itemsData.get(t),i=this.itemsData.getDataSet();e&&this.options.onRemove(e,function(e){e&&i.remove(t)})},o.prototype._getType=function(t){return t.type||this.options.type||(t.end?"range":"box")},o.prototype._getGroupId=function(t){var e=this._getType(t);return"background"==e&&void 0==t.group?g:this.groupsData?t.group:v},o.prototype._onUpdate=function(t){var e=this;t.forEach(function(t){var i,n=e.itemsData.get(t,e.itemOptions),s=e.items[t],r=e._getType(n),a=o.types[r];if(s&&(a&&s instanceof a?e._updateItem(s,n):(i=s.selected,e._removeItem(s),s=null)),!s){if(!a)throw"rangeoverflow"==r?new TypeError('Item type "rangeoverflow" is deprecated. Use css styling instead: .vis-item.vis-range .vis-item-content {overflow: visible;}'):new TypeError('Unknown item type "'+r+'"');s=new a(n,e.conversion,e.options),s.id=t,e._addItem(s),i&&(this.selection.push(t),s.select())}}.bind(this)),this._order(),this.stackDirty=!0,this.body.emitter.emit("change",{queue:!0})},o.prototype._onAdd=o.prototype._onUpdate,o.prototype._onRemove=function(t){var e=0,i=this;t.forEach(function(t){var o=i.items[t];o&&(e++,i._removeItem(o))}),e&&(this._order(),this.stackDirty=!0,this.body.emitter.emit("change",{queue:!0}))},o.prototype._order=function(){s.forEach(this.groups,function(t){t.order()})},o.prototype._onUpdateGroups=function(t){this._onAddGroups(t)},o.prototype._onAddGroups=function(t){var e=this;t.forEach(function(t){var i=e.groupsData.get(t),o=e.groups[t];if(o)o.setData(i);else{if(t==v||t==g)throw new Error("Illegal group id. "+t+" is a reserved id.");var n=Object.create(e.options);s.extend(n,{height:null}),o=new l(t,i,e),e.groups[t]=o;for(var r in e.items)if(e.items.hasOwnProperty(r)){var a=e.items[r];a.data.group==t&&o.add(a)}o.order(),o.show()}}),this.body.emitter.emit("change",{queue:!0})},o.prototype._onRemoveGroups=function(t){var e=this.groups;t.forEach(function(t){var i=e[t];i&&(i.hide(),delete e[t])}),this.markDirty(),this.body.emitter.emit("change",{queue:!0})},o.prototype._orderGroups=function(){if(this.groupsData){var t=this.groupsData.getIds({order:this.options.groupOrder}),e=!s.equalArray(t,this.groupIds);if(e){var i=this.groups;t.forEach(function(t){i[t].hide()}),t.forEach(function(t){i[t].show()}),this.groupIds=t}return e}return!1},o.prototype._addItem=function(t){this.items[t.id]=t;var e=this._getGroupId(t.data),i=this.groups[e];i&&i.add(t)},o.prototype._updateItem=function(t,e){var i=t.data.group,o=t.data.subgroup;if(t.setData(e),i!=t.data.group||o!=t.data.subgroup){var n=this.groups[i];n&&n.remove(t);var s=this._getGroupId(t.data),r=this.groups[s];r&&r.add(t)}},o.prototype._removeItem=function(t){t.hide(),delete this.items[t.id];var e=this.selection.indexOf(t.id);-1!=e&&this.selection.splice(e,1),t.parent&&t.parent.remove(t)},o.prototype._constructByEndArray=function(t){for(var e=[],i=0;in+r)return}else{var a=e.height;if(n+a-r>o)return}}if(e&&e!=this.groupTouchParams.group){var h=this.groupsData,d=h.get(e.groupId),l=h.get(this.groupTouchParams.group.groupId);l&&d&&(this.options.groupOrderSwap(l,d,this.groupsData),this.groupsData.update(l),this.groupsData.update(d));var u=this.groupsData.getIds({order:this.options.groupOrder});if(!s.equalArray(u,this.groupTouchParams.originalOrder))for(var h=this.groupsData,c=this.groupTouchParams.originalOrder,p=this.groupTouchParams.group.groupId,f=Math.min(c.length,u.length),m=0,v=0,g=0;f>m;){for(;f>m+v&&f>m+g&&u[m+v]==c[m+g];)m++;if(m+v>=f)break;if(u[m+v]!=p)if(c[m+g]!=p){var y=u.indexOf(c[m+g]),b=h.get(u[m+v]),w=h.get(c[m+g]);this.options.groupOrderSwap(b,w,h),h.update(b),h.update(w);var _=u[m+v];u[m+v]=c[m+g],u[y]=_,m++}else g=1;else v=1}}}},o.prototype._onGroupDragEnd=function(t){if(this.options.groupEditable.order&&this.groupTouchParams.group){t.stopPropagation();var e=this,i=e.groupTouchParams.group.groupId,o=e.groupsData.getDataSet(),n=s.extend({},o.get(i));e.options.onMoveGroup(n,function(t){if(t)t[o._fieldId]=i,o.update(t);else{var n=o.getIds({order:e.options.groupOrder});if(!s.equalArray(n,e.groupTouchParams.originalOrder))for(var r=e.groupTouchParams.originalOrder,a=Math.min(r.length,n.length),h=0;a>h;){for(;a>h&&n[h]==r[h];)h++;if(h>=a)break;var d=n.indexOf(r[h]),l=o.get(n[h]),u=o.get(r[h]);e.options.groupOrderSwap(l,u,o),groupsData.update(l),groupsData.update(u);var c=n[h];n[h]=r[h],n[d]=c,h++}}}),e.body.emitter.emit("groupDragged",{groupId:i})}},o.prototype._onSelectItem=function(t){if(this.options.selectable){var e=t.srcEvent&&(t.srcEvent.ctrlKey||t.srcEvent.metaKey),i=t.srcEvent&&t.srcEvent.shiftKey;if(e||i)return void this._onMultiSelectItem(t);var o=this.getSelection(),n=this.itemFromTarget(t),s=n?[n.id]:[];this.setSelection(s);var r=this.getSelection();(r.length>0||o.length>0)&&this.body.emitter.emit("select",{items:r,event:t})}},o.prototype._onAddItem=function(t){if(this.options.selectable&&this.options.editable.add){var e=this,i=this.options.snap||null,o=this.itemFromTarget(t);if(t.stopPropagation(),o){var n=e.itemsData.get(o.id);this.options.onUpdate(n,function(t){t&&e.itemsData.getDataSet().update(t)})}else{var r=s.getAbsoluteLeft(this.dom.frame),a=t.center.x-r,h=this.body.util.toTime(a),d=this.body.util.getScale(),l=this.body.util.getStep(),u={start:i?i(h,d,l):h,content:"new item"};if("range"===this.options.type){var c=this.body.util.toTime(a+this.props.width/5);u.end=i?i(c,d,l):c}u[this.itemsData._fieldId]=s.randomUUID();var p=this.groupFromTarget(t);p&&(u.group=p.groupId),u=this._cloneItemData(u),this.options.onAdd(u,function(t){t&&e.itemsData.getDataSet().add(t)})}}},o.prototype._onMultiSelectItem=function(t){if(this.options.selectable){var e=this.itemFromTarget(t);if(e){var i=this.options.multiselect?this.getSelection():[],n=t.srcEvent&&t.srcEvent.shiftKey||!1;if(n&&this.options.multiselect){i.push(e.id);var s=o._getItemRange(this.itemsData.get(i,this.itemOptions));i=[];for(var r in this.items)if(this.items.hasOwnProperty(r)){var a=this.items[r],h=a.data.start,d=void 0!==a.data.end?a.data.end:h;h>=s.min&&d<=s.max&&!(a instanceof m)&&i.push(a.id)}}else{var l=i.indexOf(e.id);-1==l?i.push(e.id):i.splice(l,1)}this.setSelection(i),this.body.emitter.emit("select",{items:this.getSelection(),event:t})}}},o._getItemRange=function(t){var e=null,i=null;return t.forEach(function(t){(null==i||t.starte)&&(e=t.end):(null==e||t.start>e)&&(e=t.start)}),{min:i,max:e}},o.prototype.itemFromTarget=function(t){for(var e=t.target;e;){if(e.hasOwnProperty("timeline-item"))return e["timeline-item"];e=e.parentNode}return null},o.prototype.groupFromTarget=function(t){for(var e=t.center?t.center.y:t.clientY,i=0;ia&&ea)return n}else if(0===i&&e 0?t.step:1,this.autoScale=!1)},o.prototype.setAutoScale=function(t){this.autoScale=t},o.prototype.setMinimumStep=function(t){if(void 0!=t){var e=31104e6,i=2592e6,o=864e5,n=36e5,s=6e4,r=1e3,a=1;1e3*e>t&&(this.scale="year",this.step=1e3),500*e>t&&(this.scale="year",this.step=500),100*e>t&&(this.scale="year",this.step=100),50*e>t&&(this.scale="year",this.step=50),10*e>t&&(this.scale="year",this.step=10),5*e>t&&(this.scale="year",this.step=5),e>t&&(this.scale="year",this.step=1),3*i>t&&(this.scale="month",this.step=3),i>t&&(this.scale="month",this.step=1),5*o>t&&(this.scale="day",this.step=5),2*o>t&&(this.scale="day",this.step=2),o>t&&(this.scale="day",this.step=1),o/2>t&&(this.scale="weekday",this.step=1),4*n>t&&(this.scale="hour",this.step=4),n>t&&(this.scale="hour",this.step=1),15*s>t&&(this.scale="minute",this.step=15),10*s>t&&(this.scale="minute",this.step=10),5*s>t&&(this.scale="minute",this.step=5),s>t&&(this.scale="minute",this.step=1),15*r>t&&(this.scale="second",this.step=15),10*r>t&&(this.scale="second",this.step=10),5*r>t&&(this.scale="second",this.step=5),r>t&&(this.scale="second",this.step=1),200*a>t&&(this.scale="millisecond",this.step=200),100*a>t&&(this.scale="millisecond",this.step=100),50*a>t&&(this.scale="millisecond",this.step=50),10*a>t&&(this.scale="millisecond",this.step=10),5*a>t&&(this.scale="millisecond",this.step=5),a>t&&(this.scale="millisecond",this.step=1)}},o.snap=function(t,e,i){var o=n(t);if("year"==e){var s=o.year()+Math.round(o.month()/12);o.year(Math.round(s/i)*i),o.month(0),o.date(0),o.hours(0),o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("month"==e)o.date()>15?(o.date(1),o.add(1,"month")):o.date(1),o.hours(0),o.minutes(0),o.seconds(0),o.milliseconds(0);else if("day"==e){switch(i){case 5:case 2:o.hours(24*Math.round(o.hours()/24));break;default:o.hours(12*Math.round(o.hours()/12))}o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("weekday"==e){switch(i){case 5:case 2:o.hours(12*Math.round(o.hours()/12));break;default:o.hours(6*Math.round(o.hours()/6))}o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("hour"==e){switch(i){case 4:o.minutes(60*Math.round(o.minutes()/60));break;default:o.minutes(30*Math.round(o.minutes()/30))}o.seconds(0),o.milliseconds(0)}else if("minute"==e){switch(i){case 15:case 10:o.minutes(5*Math.round(o.minutes()/5)),o.seconds(0);break;case 5:o.seconds(60*Math.round(o.seconds()/60));break;default:o.seconds(30*Math.round(o.seconds()/30))}o.milliseconds(0)}else if("second"==e)switch(i){case 15:case 10:o.seconds(5*Math.round(o.seconds()/5)),o.milliseconds(0);break;case 5:o.milliseconds(1e3*Math.round(o.milliseconds()/1e3));break;default:o.milliseconds(500*Math.round(o.milliseconds()/500))}else if("millisecond"==e){var r=i>5?i/2:1;o.milliseconds(Math.round(o.milliseconds()/r)*r)}return o},o.prototype.isMajor=function(){if(1==this.switchedYear)switch(this.switchedYear=!1,this.scale){case"year":case"month":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedMonth)switch(this.switchedMonth=!1,this.scale){case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedDay)switch(this.switchedDay=!1,this.scale){case"millisecond":case"second":case"minute":case"hour":return!0;default:return!1}var t=this.moment(this.current);switch(this.scale){case"millisecond":return 0==t.milliseconds();case"second":return 0==t.seconds();case"minute":return 0==t.hours()&&0==t.minutes();case"hour":return 0==t.hours();case"weekday":case"day":return 1==t.date();case"month":return 0==t.month();case"year":return!1;default:return!1}},o.prototype.getLabelMinor=function(t){void 0==t&&(t=this.current);var e=this.format.minorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""},o.prototype.getLabelMajor=function(t){void 0==t&&(t=this.current);var e=this.format.majorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""},o.prototype.getClassName=function(){function t(t){return t/h%2==0?" vis-even":" vis-odd"}function e(t){return t.isSame(new Date,"day")?" vis-today":t.isSame(s().add(1,"day"),"day")?" vis-tomorrow":t.isSame(s().add(-1,"day"),"day")?" vis-yesterday":""}function i(t){return t.isSame(new Date,"week")?" vis-current-week":""}function o(t){return t.isSame(new Date,"month")?" vis-current-month":""}function n(t){return t.isSame(new Date,"year")?" vis-current-year":""}var s=this.moment,r=this.moment(this.current),a=r.locale?r.locale("en"):r.lang("en"),h=this.step;switch(this.scale){case"millisecond":return t(a.milliseconds()).trim();case"second":return t(a.seconds()).trim();case"minute":return t(a.minutes()).trim();case"hour":var d=a.hours();return 4==this.step&&(d=d+"-h"+(d+4)),"vis-h"+d+e(a)+t(a.hours());case"weekday":return"vis-"+a.format("dddd").toLowerCase()+e(a)+i(a)+t(a.date());case"day":var l=a.date(),u=a.format("MMMM").toLowerCase();return"vis-day"+l+" vis-"+u+o(a)+t(l-1);case"month":return"vis-"+a.format("MMMM").toLowerCase()+o(a)+t(a.month());case"year":var c=a.year();return"vis-year"+c+n(a)+t(c);default:return""}},t.exports=o},function(t,e,i){function o(t,e,i){this.groupId=t,this.subgroups={},this.subgroupIndex=0,this.subgroupOrderer=e&&e.subgroupOrder,this.itemSet=i,this.dom={},this.props={label:{width:0,height:0}},this.className=null,this.items={},this.visibleItems=[],this.orderedItems={byStart:[],byEnd:[]},this.checkRangedItems=!1;var o=this;this.itemSet.body.emitter.on("checkRangedItems",function(){o.checkRangedItems=!0}),this._create(),this.setData(e)}var n=i(1),s=i(32);i(33);o.prototype._create=function(){var t=document.createElement("div");this.itemSet.options.groupEditable.order?t.className="vis-label draggable":t.className="vis-label",this.dom.label=t;var e=document.createElement("div");e.className="vis-inner",t.appendChild(e),this.dom.inner=e;var i=document.createElement("div");i.className="vis-group",i["timeline-group"]=this,this.dom.foreground=i,this.dom.background=document.createElement("div"),this.dom.background.className="vis-group",this.dom.axis=document.createElement("div"),this.dom.axis.className="vis-group",this.dom.marker=document.createElement("div"),this.dom.marker.style.visibility="hidden",this.dom.marker.innerHTML="?",this.dom.background.appendChild(this.dom.marker)},o.prototype.setData=function(t){var e;if(e=this.itemSet.options&&this.itemSet.options.groupTemplate?this.itemSet.options.groupTemplate(t):t&&t.content,e instanceof Element){for(this.dom.inner.appendChild(e);this.dom.inner.firstChild;)this.dom.inner.removeChild(this.dom.inner.firstChild);this.dom.inner.appendChild(e)}else void 0!==e&&null!==e?this.dom.inner.innerHTML=e:this.dom.inner.innerHTML=this.groupId||"";this.dom.label.title=t&&t.title||"",this.dom.inner.firstChild?n.removeClassName(this.dom.inner,"vis-hidden"):n.addClassName(this.dom.inner,"vis-hidden");var i=t&&t.className||null;i!=this.className&&(this.className&&(n.removeClassName(this.dom.label,this.className),n.removeClassName(this.dom.foreground,this.className),n.removeClassName(this.dom.background,this.className),n.removeClassName(this.dom.axis,this.className)),n.addClassName(this.dom.label,i),n.addClassName(this.dom.foreground,i),n.addClassName(this.dom.background,i),n.addClassName(this.dom.axis,i),this.className=i),this.style&&(n.removeCssText(this.dom.label,this.style),this.style=null),t&&t.style&&(n.addCssText(this.dom.label,t.style),this.style=t.style)},o.prototype.getLabelWidth=function(){return this.props.label.width},o.prototype.redraw=function(t,e,i){var o=!1,r=this.dom.marker.clientHeight;if(r!=this.lastMarkerHeight&&(this.lastMarkerHeight=r,n.forEach(this.items,function(t){t.dirty=!0,t.displayed&&t.redraw()}),i=!0),"function"==typeof this.itemSet.options.order){if(i){var a=this,h=!1;n.forEach(this.items,function(t){t.displayed||(t.redraw(),a.visibleItems.push(t)),t.repositionX(h)});var d=this.orderedItems.byStart.slice().sort(function(t,e){return a.itemSet.options.order(t.data,e.data)});s.stack(d,e,!0)}this.visibleItems=this._updateVisibleItems(this.orderedItems,this.visibleItems,t)}else this.visibleItems=this._updateVisibleItems(this.orderedItems,this.visibleItems,t),this.itemSet.options.stack?s.stack(this.visibleItems,e,i):s.nostack(this.visibleItems,e,this.subgroups);var l=this._calculateHeight(e),u=this.dom.foreground;this.top=u.offsetTop,this.left=u.offsetLeft,this.width=u.offsetWidth,o=n.updateProperty(this,"height",l)||o,o=n.updateProperty(this.props.label,"width",this.dom.inner.clientWidth)||o,o=n.updateProperty(this.props.label,"height",this.dom.inner.clientHeight)||o,this.dom.background.style.height=l+"px",this.dom.foreground.style.height=l+"px",this.dom.label.style.height=l+"px";for(var c=0,p=this.visibleItems.length;p>c;c++){var f=this.visibleItems[c];f.repositionY(e)}return o},o.prototype._calculateHeight=function(t){var e,i=this.visibleItems;this.resetSubgroups();var o=this;if(i.length>0){var s=i[0].top,r=i[0].top+i[0].height;if(n.forEach(i,function(t){s=Math.min(s,t.top),r=Math.max(r,t.top+t.height),void 0!==t.data.subgroup&&(o.subgroups[t.data.subgroup].height=Math.max(o.subgroups[t.data.subgroup].height,t.height),o.subgroups[t.data.subgroup].visible=!0)}),s>t.axis){var a=s-t.axis;r-=a,n.forEach(i,function(t){t.top-=a})}e=r+t.item.vertical/2}else e=0;return e=Math.max(e,this.props.label.height)},o.prototype.show=function(){this.dom.label.parentNode||this.itemSet.dom.labelSet.appendChild(this.dom.label),this.dom.foreground.parentNode||this.itemSet.dom.foreground.appendChild(this.dom.foreground),this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background),this.dom.axis.parentNode||this.itemSet.dom.axis.appendChild(this.dom.axis)},o.prototype.hide=function(){var t=this.dom.label;t.parentNode&&t.parentNode.removeChild(t);var e=this.dom.foreground;e.parentNode&&e.parentNode.removeChild(e);var i=this.dom.background;i.parentNode&&i.parentNode.removeChild(i);var o=this.dom.axis;o.parentNode&&o.parentNode.removeChild(o)},o.prototype.add=function(t){if(this.items[t.id]=t,t.setParent(this),void 0!==t.data.subgroup&&(void 0===this.subgroups[t.data.subgroup]&&(this.subgroups[t.data.subgroup]={height:0,visible:!1,index:this.subgroupIndex,items:[]},this.subgroupIndex++),this.subgroups[t.data.subgroup].items.push(t)),this.orderSubgroups(),-1==this.visibleItems.indexOf(t)){var e=this.itemSet.body.range;this._checkIfVisible(t,this.visibleItems,e)}},o.prototype.orderSubgroups=function(){if(void 0!==this.subgroupOrderer){var t=[];if("string"==typeof this.subgroupOrderer){for(var e in this.subgroups)t.push({subgroup:e,sortField:this.subgroups[e].items[0].data[this.subgroupOrderer]});t.sort(function(t,e){return t.sortField-e.sortField})}else if("function"==typeof this.subgroupOrderer){for(var e in this.subgroups)t.push(this.subgroups[e].items[0].data);t.sort(this.subgroupOrderer)}if(t.length>0)for(var i=0;it?-1:l>=t?0:1};if(e.length>0)for(s=0;sl}),1==this.checkRangedItems)for(this.checkRangedItems=!1,s=0;sl})}for(s=0;s=0&&(s=e[r],!n(s));r--)void 0===o[s.id]&&(o[s.id]=!0,i.push(s));for(r=t+1;rn;n++)t[n].top=null;for(n=0,s=t.length;s>n;n++){var r=t[n];if(r.stack&&null===r.top){r.top=i.axis;do{for(var a=null,h=0,d=t.length;d>h;h++){var l=t[h];if(null!==l.top&&l!==r&&l.stack&&e.collision(r,l,i.item)){a=l;break}}null!=a&&(r.top=a.top+a.height+i.item.vertical)}while(a)}}},e.nostack=function(t,e,i){var o,n,s;for(o=0,n=t.length;n>o;o++)if(void 0!==t[o].data.subgroup){s=e.axis;for(var r in i)i.hasOwnProperty(r)&&1==i[r].visible&&i[r].indexe.left&&t.top-o.vertical+ie.top}},function(t,e,i){function o(t,e,i){if(this.props={content:{width:0}},this.overflow=!1,t){if(void 0==t.start)throw new Error('Property "start" missing in item '+t.id);if(void 0==t.end)throw new Error('Property "end" missing in item '+t.id)}n.call(this,t,e,i)}var n=(i(20),i(34));o.prototype=new n(null,null,null),o.prototype.baseClassName="vis-item vis-range",o.prototype.isVisible=function(t){return this.data.startt.start},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("div"),t.frame=document.createElement("div"),t.frame.className="vis-item-overflow",t.box.appendChild(t.frame),t.content=document.createElement("div"),t.content.className="vis-item-content",t.frame.appendChild(t.content),t.box["timeline-item"]=this,this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.foreground;if(!e)throw new Error("Cannot redraw item: parent has no foreground container element");e.appendChild(t.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.box),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);var i=(this.options.editable.updateTime||this.options.editable.updateGroup||this.editable===!0)&&this.editable!==!1,o=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(i?" vis-editable":" vis-readonly");t.box.className=this.baseClassName+o,this.overflow="hidden"!==window.getComputedStyle(t.frame).overflow,this.dom.content.style.maxWidth="none",this.props.content.width=this.dom.content.offsetWidth,this.height=this.dom.box.offsetHeight,this.dom.content.style.maxWidth="",this.dirty=!1}this._repaintDeleteButton(t.box),this._repaintDragLeft(),this._repaintDragRight()},o.prototype.show=function(){this.displayed||this.redraw()},o.prototype.hide=function(){if(this.displayed){var t=this.dom.box;t.parentNode&&t.parentNode.removeChild(t),this.displayed=!1}},o.prototype.repositionX=function(t){var e,i,o=this.parent.width,n=this.conversion.toScreen(this.data.start),s=this.conversion.toScreen(this.data.end);(void 0===t||t===!0)&&(-o>n&&(n=-o),s>2*o&&(s=2*o));var r=Math.max(s-n,1);switch(this.overflow?(this.left=n,this.width=r+this.props.content.width,i=this.props.content.width):(this.left=n,this.width=r,i=Math.min(s-n,this.props.content.width)),this.dom.box.style.left=this.left+"px",this.dom.box.style.width=r+"px",this.options.align){case"left":this.dom.content.style.left="0";break;case"right":this.dom.content.style.left=Math.max(r-i,0)+"px";break;case"center":this.dom.content.style.left=Math.max((r-i)/2,0)+"px";break;default:e=this.overflow?s>0?Math.max(-n,0):-i:0>n?-n:0,this.dom.content.style.left=e+"px"}},o.prototype.repositionY=function(){var t=this.options.orientation.item,e=this.dom.box;"top"==t?e.style.top=this.top+"px":e.style.top=this.parent.height-this.top-this.height+"px"},o.prototype._repaintDragLeft=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragLeft){var t=document.createElement("div");t.className="vis-drag-left",t.dragLeftItem=this,this.dom.box.appendChild(t),this.dom.dragLeft=t}else!this.selected&&this.dom.dragLeft&&(this.dom.dragLeft.parentNode&&this.dom.dragLeft.parentNode.removeChild(this.dom.dragLeft),this.dom.dragLeft=null)},o.prototype._repaintDragRight=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragRight){var t=document.createElement("div");t.className="vis-drag-right",t.dragRightItem=this,this.dom.box.appendChild(t),this.dom.dragRight=t}else!this.selected&&this.dom.dragRight&&(this.dom.dragRight.parentNode&&this.dom.dragRight.parentNode.removeChild(this.dom.dragRight),this.dom.dragRight=null)},t.exports=o},function(t,e,i){function o(t,e,i){this.id=null,this.parent=null,this.data=t,this.dom=null,this.conversion=e||{},this.options=i||{},this.selected=!1,this.displayed=!1,this.dirty=!0,this.top=null,this.left=null,this.width=null,this.height=null,this.editable=null,this.data&&this.data.hasOwnProperty("editable")&&"boolean"==typeof this.data.editable&&(this.editable=t.editable)}var n=i(20),s=i(1);o.prototype.stack=!0,o.prototype.select=function(){this.selected=!0,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.unselect=function(){this.selected=!1,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.setData=function(t){var e=void 0!=t.group&&this.data.group!=t.group;e&&this.parent.itemSet._moveToGroup(this,t.group),t.hasOwnProperty("editable")&&"boolean"==typeof t.editable&&(this.editable=t.editable),this.data=t,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.setParent=function(t){this.displayed?(this.hide(),this.parent=t,this.parent&&this.show()):this.parent=t},o.prototype.isVisible=function(t){return!1},o.prototype.show=function(){return!1},o.prototype.hide=function(){return!1},o.prototype.redraw=function(){},o.prototype.repositionX=function(){},o.prototype.repositionY=function(){},o.prototype._repaintDeleteButton=function(t){var e=(this.options.editable.remove||this.data.editable===!0)&&this.data.editable!==!1;if(this.selected&&e&&!this.dom.deleteButton){var i=this,o=document.createElement("div");o.className="vis-delete",o.title="Delete this item",new n(o).on("tap",function(t){t.stopPropagation(),i.parent.removeFromDataSet(i)}),t.appendChild(o),this.dom.deleteButton=o}else!this.selected&&this.dom.deleteButton&&(this.dom.deleteButton.parentNode&&this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton),this.dom.deleteButton=null)},o.prototype._updateContents=function(t){var e;if(this.options.template){var i=this.parent.itemSet.itemsData.get(this.id);e=this.options.template(i)}else e=this.data.content;var o=this._contentToString(this.content)!==this._contentToString(e);if(o){if(e instanceof Element)t.innerHTML="",t.appendChild(e);else if(void 0!=e)t.innerHTML=e;else if("background"!=this.data.type||void 0!==this.data.content)throw new Error('Property "content" missing in item '+this.id);this.content=e}},o.prototype._updateTitle=function(t){null!=this.data.title?t.title=this.data.title||"":t.removeAttribute("vis-title")},o.prototype._updateDataAttributes=function(t){if(this.options.dataAttributes&&this.options.dataAttributes.length>0){var e=[];if(Array.isArray(this.options.dataAttributes))e=this.options.dataAttributes;else{if("all"!=this.options.dataAttributes)return;e=Object.keys(this.data)}for(var i=0;in;n++){var r=this.visibleItems[n];r.repositionY(e)}return o},o.prototype.show=function(){this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background)},t.exports=o},function(t,e,i){function o(t,e,i){if(this.props={dot:{width:0,height:0},line:{width:0,height:0}},t&&void 0==t.start)throw new Error('Property "start" missing in item '+t);n.call(this,t,e,i)}var n=i(34);i(1);o.prototype=new n(null,null,null),o.prototype.isVisible=function(t){var e=(t.end-t.start)/4;return this.data.start>t.start-e&&this.data.startt.start-e&&this.data.startt.start},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("div"),t.frame=document.createElement("div"),t.frame.className="vis-item-overflow",t.box.appendChild(t.frame),t.content=document.createElement("div"),t.content.className="vis-item-content",t.frame.appendChild(t.content),this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.background;if(!e)throw new Error("Cannot redraw item: parent has no background container element");e.appendChild(t.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.content),this._updateDataAttributes(this.dom.content),this._updateStyle(this.dom.box);var i=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"");t.box.className=this.baseClassName+i,this.overflow="hidden"!==window.getComputedStyle(t.content).overflow,this.props.content.width=this.dom.content.offsetWidth,this.height=0,this.dirty=!1}},o.prototype.show=r.prototype.show,o.prototype.hide=r.prototype.hide,o.prototype.repositionX=r.prototype.repositionX,o.prototype.repositionY=function(t){var e="top"===this.options.orientation.item;this.dom.content.style.top=e?"":"0",this.dom.content.style.bottom=e?"0":"";var i;if(void 0!==this.data.subgroup){var o=this.data.subgroup,n=this.parent.subgroups,r=n[o].index;if(1==e){i=this.parent.subgroups[o].height+t.item.vertical,i+=0==r?t.axis-.5*t.item.vertical:0;var a=this.parent.top;for(var h in n)n.hasOwnProperty(h)&&1==n[h].visible&&n[h].indexr&&(a+=l)}i=this.parent.subgroups[o].height+t.item.vertical,this.dom.box.style.top=this.parent.height-d+a+"px",this.dom.box.style.bottom=""}}else this.parent instanceof s?(i=Math.max(this.parent.height,this.parent.itemSet.body.domProps.center.height,this.parent.itemSet.body.domProps.centerContainer.height),this.dom.box.style.top=e?"0":"",this.dom.box.style.bottom=e?"":"0"):(i=this.parent.height,this.dom.box.style.top=this.parent.top+"px",this.dom.box.style.bottom="");this.dom.box.style.height=i+"px"},t.exports=o},function(t,e,i){function o(t,e){this.dom={
+foreground:null,lines:[],majorTexts:[],minorTexts:[],redundant:{lines:[],majorTexts:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.defaultOptions={orientation:{axis:"bottom"},showMinorLabels:!0,showMajorLabels:!0,format:r.FORMAT,moment:h,timeAxis:null},this.options=n.extend({},this.defaultOptions),this.body=t,this._create(),this.setOptions(e)}var n=i(1),s=i(26),r=i(30),a=i(27),h=i(2);o.prototype=new s,o.prototype.setOptions=function(t){t&&(n.selectiveExtend(["showMinorLabels","showMajorLabels","hiddenDates","timeAxis","moment"],this.options,t),n.selectiveDeepExtend(["format"],this.options,t),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation.axis=t.orientation:"object"==typeof t.orientation&&"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis)),"locale"in t&&("function"==typeof h.locale?h.locale(t.locale):h.lang(t.locale)))},o.prototype._create=function(){this.dom.foreground=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.foreground.className="vis-time-axis vis-foreground",this.dom.background.className="vis-time-axis vis-background"},o.prototype.destroy=function(){this.dom.foreground.parentNode&&this.dom.foreground.parentNode.removeChild(this.dom.foreground),this.dom.background.parentNode&&this.dom.background.parentNode.removeChild(this.dom.background),this.body=null},o.prototype.redraw=function(){var t=this.props,e=this.dom.foreground,i=this.dom.background,o="top"==this.options.orientation.axis?this.body.dom.top:this.body.dom.bottom,n=e.parentNode!==o;this._calculateCharSize();var s=this.options.showMinorLabels&&"none"!==this.options.orientation.axis,r=this.options.showMajorLabels&&"none"!==this.options.orientation.axis;t.minorLabelHeight=s?t.minorCharHeight:0,t.majorLabelHeight=r?t.majorCharHeight:0,t.height=t.minorLabelHeight+t.majorLabelHeight,t.width=e.offsetWidth,t.minorLineHeight=this.body.domProps.root.height-t.majorLabelHeight-("top"==this.options.orientation.axis?this.body.domProps.bottom.height:this.body.domProps.top.height),t.minorLineWidth=1,t.majorLineHeight=t.minorLineHeight+t.majorLabelHeight,t.majorLineWidth=1;var a=e.nextSibling,h=i.nextSibling;return e.parentNode&&e.parentNode.removeChild(e),i.parentNode&&i.parentNode.removeChild(i),e.style.height=this.props.height+"px",this._repaintLabels(),a?o.insertBefore(e,a):o.appendChild(e),h?this.body.dom.backgroundVertical.insertBefore(i,h):this.body.dom.backgroundVertical.appendChild(i),this._isResized()||n},o.prototype._repaintLabels=function(){var t=this.options.orientation.axis,e=n.convert(this.body.range.start,"Number"),i=n.convert(this.body.range.end,"Number"),o=this.body.util.toTime(7*(this.props.minorCharWidth||10)).valueOf(),s=o-a.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this.body.range,o);s-=this.body.util.toTime(0).valueOf();var h=new r(new Date(e),new Date(i),s,this.body.hiddenDates);h.setMoment(this.options.moment),this.options.format&&h.setFormat(this.options.format),this.options.timeAxis&&h.setScale(this.options.timeAxis),this.step=h;var d=this.dom;d.redundant.lines=d.lines,d.redundant.majorTexts=d.majorTexts,d.redundant.minorTexts=d.minorTexts,d.lines=[],d.majorTexts=[],d.minorTexts=[];var l,u,c,p,f,m,v,g,y,b=void 0,w=0;for(h.start(),u=h.getCurrent(),p=this.body.util.toScreen(u);h.hasNext()&&1e3>w;){w++,f=h.isMajor(),y=h.getClassName(),g=h.getLabelMinor(),l=u,c=p,h.next(),u=h.getCurrent(),p=this.body.util.toScreen(u),m=p-c;var _=(g.length+1)*this.props.minorCharWidth0&&(void 0==b&&(b=c),this._repaintMajorText(c,h.getLabelMajor(),t,y)),v=this._repaintMajorLine(c,m,t,y)):_?v=this._repaintMinorLine(c,m,t,y):v&&(v.style.width=parseInt(v.style.width)+m+"px")}if(this.options.showMajorLabels){var x=this.body.util.toTime(0),k=h.getLabelMajor(x),O=k.length*(this.props.majorCharWidth||10)+10;(void 0==b||b>O)&&this._repaintMajorText(0,k,t,y)}n.forEach(this.dom.redundant,function(t){for(;t.length;){var e=t.pop();e&&e.parentNode&&e.parentNode.removeChild(e)}})},o.prototype._repaintMinorText=function(t,e,i,o){var n=this.dom.redundant.minorTexts.shift();if(!n){var s=document.createTextNode("");n=document.createElement("div"),n.appendChild(s),this.dom.foreground.appendChild(n)}return this.dom.minorTexts.push(n),n.childNodes[0].nodeValue=e,n.style.top="top"==i?this.props.majorLabelHeight+"px":"0",n.style.left=t+"px",n.className="vis-text vis-minor "+o,n},o.prototype._repaintMajorText=function(t,e,i,o){var n=this.dom.redundant.majorTexts.shift();if(!n){var s=document.createTextNode(e);n=document.createElement("div"),n.appendChild(s),this.dom.foreground.appendChild(n)}return this.dom.majorTexts.push(n),n.childNodes[0].nodeValue=e,n.className="vis-text vis-major "+o,n.style.top="top"==i?"0":this.props.minorLabelHeight+"px",n.style.left=t+"px",n},o.prototype._repaintMinorLine=function(t,e,i,o){var n=this.dom.redundant.lines.shift();n||(n=document.createElement("div"),this.dom.background.appendChild(n)),this.dom.lines.push(n);var s=this.props;return"top"==i?n.style.top=s.majorLabelHeight+"px":n.style.top=this.body.domProps.top.height+"px",n.style.height=s.minorLineHeight+"px",n.style.left=t-s.minorLineWidth/2+"px",n.style.width=e+"px",n.className="vis-grid vis-vertical vis-minor "+o,n},o.prototype._repaintMajorLine=function(t,e,i,o){var n=this.dom.redundant.lines.shift();n||(n=document.createElement("div"),this.dom.background.appendChild(n)),this.dom.lines.push(n);var s=this.props;return"top"==i?n.style.top="0":n.style.top=this.body.domProps.top.height+"px",n.style.left=t-s.majorLineWidth/2+"px",n.style.height=s.majorLineHeight+"px",n.style.width=e+"px",n.className="vis-grid vis-vertical vis-major "+o,n},o.prototype._calculateCharSize=function(){this.dom.measureCharMinor||(this.dom.measureCharMinor=document.createElement("DIV"),this.dom.measureCharMinor.className="vis-text vis-minor vis-measure",this.dom.measureCharMinor.style.position="absolute",this.dom.measureCharMinor.appendChild(document.createTextNode("0")),this.dom.foreground.appendChild(this.dom.measureCharMinor)),this.props.minorCharHeight=this.dom.measureCharMinor.clientHeight,this.props.minorCharWidth=this.dom.measureCharMinor.clientWidth,this.dom.measureCharMajor||(this.dom.measureCharMajor=document.createElement("DIV"),this.dom.measureCharMajor.className="vis-text vis-major vis-measure",this.dom.measureCharMajor.style.position="absolute",this.dom.measureCharMajor.appendChild(document.createTextNode("0")),this.dom.foreground.appendChild(this.dom.measureCharMajor)),this.props.majorCharHeight=this.dom.measureCharMajor.clientHeight,this.props.majorCharWidth=this.dom.measureCharMajor.clientWidth},t.exports=o},function(t,e,i){function o(t){this.active=!1,this.dom={container:t},this.dom.overlay=document.createElement("div"),this.dom.overlay.className="vis-overlay",this.dom.container.appendChild(this.dom.overlay),this.hammer=a(this.dom.overlay),this.hammer.on("tap",this._onTapOverlay.bind(this));var e=this,i=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];i.forEach(function(t){e.hammer.on(t,function(t){t.stopPropagation()})}),document&&document.body&&(this.onClick=function(i){n(i.target,t)||e.deactivate()},document.body.addEventListener("click",this.onClick)),void 0!==this.keycharm&&this.keycharm.destroy(),this.keycharm=s(),this.escListener=this.deactivate.bind(this)}function n(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}var s=i(41),r=i(12),a=i(20),h=i(1);r(o.prototype),o.current=null,o.prototype.destroy=function(){this.deactivate(),this.dom.overlay.parentNode.removeChild(this.dom.overlay),this.onClick&&document.body.removeEventListener("click",this.onClick),this.hammer.destroy(),this.hammer=null},o.prototype.activate=function(){o.current&&o.current.deactivate(),o.current=this,this.active=!0,this.dom.overlay.style.display="none",h.addClassName(this.dom.container,"vis-active"),this.emit("change"),this.emit("activate"),this.keycharm.bind("esc",this.escListener)},o.prototype.deactivate=function(){this.active=!1,this.dom.overlay.style.display="",h.removeClassName(this.dom.container,"vis-active"),this.keycharm.unbind("esc",this.escListener),this.emit("change"),this.emit("deactivate")},o.prototype._onTapOverlay=function(t){this.activate(),t.stopPropagation()},t.exports=o},function(t,e,i){var o,n,s;!function(i,r){n=[],o=r,s="function"==typeof o?o.apply(e,n):o,!(void 0!==s&&(t.exports=s))}(this,function(){function t(t){var e,i=t&&t.preventDefault||!1,o=t&&t.container||window,n={},s={keydown:{},keyup:{}},r={};for(e=97;122>=e;e++)r[String.fromCharCode(e)]={code:65+(e-97),shift:!1};for(e=65;90>=e;e++)r[String.fromCharCode(e)]={code:e,shift:!0};for(e=0;9>=e;e++)r[""+e]={code:48+e,shift:!1};for(e=1;12>=e;e++)r["F"+e]={code:111+e,shift:!1};for(e=0;9>=e;e++)r["num"+e]={code:96+e,shift:!1};r["num*"]={code:106,shift:!1},r["num+"]={code:107,shift:!1},r["num-"]={code:109,shift:!1},r["num/"]={code:111,shift:!1},r["num."]={code:110,shift:!1},r.left={code:37,shift:!1},r.up={code:38,shift:!1},r.right={code:39,shift:!1},r.down={code:40,shift:!1},r.space={code:32,shift:!1},r.enter={code:13,shift:!1},r.shift={code:16,shift:void 0},r.esc={code:27,shift:!1},r.backspace={code:8,shift:!1},r.tab={code:9,shift:!1},r.ctrl={code:17,shift:!1},r.alt={code:18,shift:!1},r["delete"]={code:46,shift:!1},r.pageup={code:33,shift:!1},r.pagedown={code:34,shift:!1},r["="]={code:187,shift:!1},r["-"]={code:189,shift:!1},r["]"]={code:221,shift:!1},r["["]={code:219,shift:!1};var a=function(t){d(t,"keydown")},h=function(t){d(t,"keyup")},d=function(t,e){if(void 0!==s[e][t.keyCode]){for(var o=s[e][t.keyCode],n=0;no&&(o=30),o>1e3&&(o=1e3),e.redraw(),e.currentTimeTimer=setTimeout(t,o)}var e=this;t()},o.prototype.stop=function(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),delete this.currentTimeTimer)},o.prototype.setCurrentTime=function(t){var e=n.convert(t,"Date").valueOf(),i=(new Date).valueOf();this.offset=e-i,this.redraw()},o.prototype.getCurrentTime=function(){return new Date((new Date).valueOf()+this.offset)},t.exports=o},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}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 s=function(){function t(t,e){for(var i=0;i0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),i++);this.options.showButton===!0&&!function(){var e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerHTML="generate options",e.onclick=function(){t._printOptions()},e.onmouseover=function(){e.className="vis-configuration vis-config-button hover"},e.onmouseout=function(){e.className="vis-configuration vis-config-button"},t.optionsContainer=document.createElement("div"),t.optionsContainer.className="vis-configuration vis-config-option-container",t.domElements.push(t.optionsContainer),t.domElements.push(e)}(),this._push(),this.colorPicker.insertTo(this.container)}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var t=0;t1?o-1:0),s=1;o>s;s++)n[s-1]=e[s];return n.forEach(function(t){r.appendChild(t)}),i.domElements.push(r),{v:i.domElements.length}}();if("object"==typeof r)return r.v}return 0}},{key:"_makeHeader",value:function(t){var e=document.createElement("div");e.className="vis-configuration vis-config-header",e.innerHTML=t,this._makeItem([],e)}},{key:"_makeLabel",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=document.createElement("div");return o.className="vis-configuration vis-config-label vis-config-s"+e.length,i===!0?o.innerHTML=""+t+": ":o.innerHTML=t+":",o}},{key:"_makeDropdown",value:function(t,e,i){var o=document.createElement("select");o.className="vis-configuration vis-config-select";var n=0;void 0!==e&&-1!==t.indexOf(e)&&(n=t.indexOf(e));for(var s=0;se&&n>e*u?(a.min=Math.ceil(e*u),l=a.min,d="range increased"):n>e/u&&(a.min=Math.ceil(e/u),l=a.min,d="range increased"),e*u>s&&1!==s&&(a.max=Math.ceil(e*u),l=a.max,d="range increased"),a.value=e}else a.value=o;var c=document.createElement("input");c.className="vis-configuration vis-config-rangeinput",c.value=a.value;var p=this;a.onchange=function(){c.value=this.value,p._update(Number(this.value),i)},a.oninput=function(){c.value=this.value};var f=this._makeLabel(i[i.length-1],i),m=this._makeItem(i,f,a,c);""!==d&&this.popupHistory[m]!==l&&(this.popupHistory[m]=l,this._setupPopup(d,m))}},{key:"_setupPopup",value:function(t,e){var i=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCountervar options = "+JSON.stringify(t,null,2)+""}},{key:"getOptions",value:function(){for(var t={},e=0;es;s++)for(r=0;rp?p+1:p;var f=l/this.r,m=a.RGBToHSV(this.color.r,this.color.g,this.color.b);m.h=p,m.s=f;var v=a.HSVToRGB(m.h,m.s,m.v);v.a=this.color.a,this.color=v,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}}]),t}();e["default"]=h,t.exports=e["default"]},function(t,e,i){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 n=function(){function t(t,e){for(var i=0;is.distance?console.log('%cUnknown option detected: "'+e+'" in '+t.printLocation(n.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+t.printLocation(s.path,s.closestMatch,""),h):n.distance<=d?console.log('%cUnknown option detected: "'+e+'". Did you mean "'+n.closestMatch+'"?'+t.printLocation(n.path,e),h):console.log('%cUnknown option detected: "'+e+'". Did you mean one of these: '+t.print(Object.keys(i))+t.printLocation(o,e),h),r=!0}},{key:"findInOptions",value:function(e,i,o){var n=arguments.length<=3||void 0===arguments[3]?!1:arguments[3],r=1e9,a="",h=[],d=e.toLowerCase(),l=void 0;for(var u in i){var c=void 0;if(void 0!==i[u].__type__&&n===!0){var p=t.findInOptions(e,i[u],s.copyAndExtendArray(o,u));r>p.distance&&(a=p.closestMatch,h=p.path,r=p.distance,l=p.indexMatch)}else-1!==u.toLowerCase().indexOf(d)&&(l=u),c=t.levenshteinDistance(e,u),r>c&&(a=u,h=s.copyArray(o),r=c)}return{closestMatch:a,path:h,distance:r,indexMatch:l}}},{key:"printLocation",value:function(t,e){for(var i=arguments.length<=2||void 0===arguments[2]?"Problem value found at: \n":arguments[2],o="\n\n"+i+"options = {\n",n=0;ns;s++)o+=" ";o+=t[n]+": {\n"}for(var s=0;sr?r:t,e=null==e?r:r>e?r:e}return{min:null!=t?new Date(t):null,max:null!=e?new Date(e):null}},o.prototype.getEventProperties=function(t){var e=t.center?t.center.x:t.clientX,i=t.center?t.center.y:t.clientY,o=e-s.getAbsoluteLeft(this.dom.centerContainer),n=i-s.getAbsoluteTop(this.dom.centerContainer),r=this._toTime(o),a=c.customTimeFromTarget(t),h=s.getTarget(t),d=null;s.hasParent(h,this.timeAxis.dom.foreground)?d="axis":this.timeAxis2&&s.hasParent(h,this.timeAxis2.dom.foreground)?d="axis":s.hasParent(h,this.linegraph.yAxisLeft.dom.frame)?d="data-axis":s.hasParent(h,this.linegraph.yAxisRight.dom.frame)?d="data-axis":s.hasParent(h,this.linegraph.legendLeft.dom.frame)?d="legend":s.hasParent(h,this.linegraph.legendRight.dom.frame)?d="legend":null!=a?d="custom-time":s.hasParent(h,this.currentTime.bar)?d="current-time":s.hasParent(h,this.dom.center)&&(d="background");var l=[],u=this.linegraph.yAxisLeft,p=this.linegraph.yAxisRight;return u.hidden||l.push(u.screenToValue(n)),p.hidden||l.push(p.screenToValue(n)),{event:t,what:d,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:n,time:r,value:l}},o.prototype._createConfigurator=function(){return new f(this,this.dom.container,y)},t.exports=o},function(t,e,i){function o(t,e){this.id=n.randomUUID(),this.body=t,this.defaultOptions={yAxisOrientation:"left",defaultGroup:"default",sort:!0,sampling:!0,stack:!1,graphHeight:"400px",shaded:{enabled:!1,orientation:"bottom"},style:"line",barChart:{width:50,sideBySide:!1,align:"center"},interpolation:{enabled:!0,parametrization:"centripetal",alpha:.5},drawPoints:{enabled:!0,size:6,style:"square"},dataAxis:{showMinorLabels:!0,showMajorLabels:!0,icons:!1,width:"40px",visible:!0,alignZeros:!0,left:{range:{min:void 0,max:void 0},format:function(t){return t},title:{text:void 0,style:void 0}},right:{range:{min:void 0,max:void 0},format:function(t){return t},title:{text:void 0,style:void 0}}},legend:{enabled:!1,icons:!0,left:{visible:!0,position:"top-left"},right:{visible:!0,position:"top-right"}},groups:{visibility:{}}},this.options=n.extend({},this.defaultOptions),this.dom={},this.props={},this.hammer=null,this.groups={},this.abortedGraphUpdate=!1,this.updateSVGheight=!1,this.updateSVGheightOnResize=!1;var i=this;this.itemsData=null,this.groupsData=null,this.itemListeners={add:function(t,e,o){i._onAdd(e.items)},update:function(t,e,o){i._onUpdate(e.items)},remove:function(t,e,o){i._onRemove(e.items)}},this.groupListeners={add:function(t,e,o){i._onAddGroups(e.items)},update:function(t,e,o){i._onUpdateGroups(e.items)},remove:function(t,e,o){i._onRemoveGroups(e.items)}},this.items={},this.selection=[],this.lastStart=this.body.range.start,this.touchParams={},this.svgElements={},this.setOptions(e),this.groupsUsingDefaultStyles=[0],this.COUNTER=0,this.body.emitter.on("rangechanged",function(){i.lastStart=i.body.range.start,i.svg.style.left=n.option.asSize(-i.props.width),i.redraw.call(i,!0)}),this._create(),this.framework={svg:this.svg,svgElements:this.svgElements,options:this.options,groups:this.groups},this.body.emitter.emit("change")}var n=i(1),s=i(7),r=i(8),a=i(10),h=i(26),d=i(51),l=i(53),u=i(57),c=i(56),p=(i(54),"__ungrouped__");o.prototype=new h,o.prototype._create=function(){var t=document.createElement("div");t.className="vis-line-graph",this.dom.frame=t,this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.position="relative",this.svg.style.height=(""+this.options.graphHeight).replace("px","")+"px",this.svg.style.display="block",t.appendChild(this.svg),this.options.dataAxis.orientation="left",this.yAxisLeft=new d(this.body,this.options.dataAxis,this.svg,this.options.groups),this.options.dataAxis.orientation="right",this.yAxisRight=new d(this.body,this.options.dataAxis,this.svg,this.options.groups),delete this.options.dataAxis.orientation,this.legendLeft=new u(this.body,this.options.legend,"left",this.options.groups),this.legendRight=new u(this.body,this.options.legend,"right",this.options.groups),this.show()},o.prototype.setOptions=function(t){if(t){var e=["sampling","defaultGroup","stack","height","graphHeight","yAxisOrientation","style","barChart","dataAxis","sort","groups"];void 0===t.graphHeight&&void 0!==t.height&&void 0!==this.body.domProps.centerContainer.height?(this.updateSVGheight=!0,this.updateSVGheightOnResize=!0):void 0!==this.body.domProps.centerContainer.height&&void 0!==t.graphHeight&&parseInt((t.graphHeight+"").replace("px",""))0){var d=this.body.util.toGlobalTime(-this.body.domProps.root.width),l=this.body.util.toGlobalTime(2*this.body.domProps.root.width),u={};for(this._getRelevantData(a,u,d,l),this._applySampling(a,u),e=0;ep&&console.log("WARNING: there may be an infinite loop in the _updateGraph emitter cycle."),this.COUNTER=0,this.abortedGraphUpdate=!1,e=0;e0)for(r=0;ro){d.push(h);break}d.push(h)}}else for(a=0;ai&&h.x0)for(var o=0;o0){var s=1,r=n.length,a=this.body.util.toGlobalScreen(n[n.length-1].x)-this.body.util.toGlobalScreen(n[0].x),h=r/a;s=Math.min(Math.ceil(.2*r),Math.max(1,Math.round(h)));for(var d=[],l=0;r>l;l+=s)d.push(n[l]);e[t[o]]=d}}},o.prototype._getYRanges=function(t,e,i){var o,n,s,r,a=[],h=[];if(t.length>0){for(s=0;s0&&(n=this.groups[t[s]],r.stack===!0&&"bar"===r.style?"left"===r.yAxisOrientation?a=a.concat(n.getData(o)):h=h.concat(n.getData(o)):i[t[s]]=n.getYRange(o,t[s]));c.getStackedYRange(a,i,t,"__barStackLeft","left"),c.getStackedYRange(h,i,t,"__barStackRight","right")}},o.prototype._updateYAxis=function(t,e){var i,o,n=!1,s=!1,r=!1,a=1e9,h=1e9,d=-1e9,l=-1e9;if(t.length>0){for(var u=0;ui?i:a,d=o>d?o:d):(r=!0,h=h>i?i:h,l=o>l?o:l));1==s&&this.yAxisLeft.setRange(a,d),1==r&&this.yAxisRight.setRange(h,l)}n=this._toggleAxisVisiblity(s,this.yAxisLeft)||n,n=this._toggleAxisVisiblity(r,this.yAxisRight)||n,1==r&&1==s?(this.yAxisLeft.drawIcons=!0,this.yAxisRight.drawIcons=!0):(this.yAxisLeft.drawIcons=!1,this.yAxisRight.drawIcons=!1),this.yAxisRight.master=!s,0==this.yAxisRight.master?(1==r?this.yAxisLeft.lineOffset=this.yAxisRight.width:this.yAxisLeft.lineOffset=0,n=this.yAxisLeft.redraw()||n,this.yAxisRight.stepPixels=this.yAxisLeft.stepPixels,this.yAxisRight.zeroCrossing=this.yAxisLeft.zeroCrossing,this.yAxisRight.amountOfSteps=this.yAxisLeft.amountOfSteps,n=this.yAxisRight.redraw()||n):n=this.yAxisRight.redraw()||n;for(var p=["__barStackLeft","__barStackRight","__lineStackLeft","__lineStackRight"],u=0;ut?-1:1});for(var a=0;a0&&(t=0),this.range.start=t,this.range.end=e},o.prototype.redraw=function(){var t=!1,e=0;this.dom.lineContainer.style.top=this.body.domProps.scrollTop+"px";for(var i in this.groups)this.groups.hasOwnProperty(i)&&(this.groups[i].visible!==!0||void 0!==this.linegraphOptions.visibility[i]&&this.linegraphOptions.visibility[i]!==!0||e++);if(0===this.amountOfGroups||0===e)this.hide();else{this.show(),this.height=Number(this.linegraphSVG.style.height.replace("px","")),this.dom.lineContainer.style.height=this.height+"px",this.width=this.options.visible===!0?Number((""+this.options.width).replace("px","")):0;var o=this.props,n=this.dom.frame;n.className="vis-data-axis",this._calculateCharSize();var s=this.options.orientation,r=this.options.showMinorLabels,a=this.options.showMajorLabels;o.minorLabelHeight=r?o.minorCharHeight:0,o.majorLabelHeight=a?o.majorCharHeight:0,o.minorLineWidth=this.body.dom.backgroundHorizontal.offsetWidth-this.lineOffset-this.width+2*this.options.minorLinesOffset,o.minorLineHeight=1,o.majorLineWidth=this.body.dom.backgroundHorizontal.offsetWidth-this.lineOffset-this.width+2*this.options.majorLinesOffset,o.majorLineHeight=1,"left"===s?(n.style.top="0",n.style.left="0",n.style.bottom="",n.style.width=this.width+"px",n.style.height=this.height+"px",this.props.width=this.body.domProps.left.width,this.props.height=this.body.domProps.left.height):(n.style.top="",n.style.bottom="0",n.style.left="0",n.style.width=this.width+"px",n.style.height=this.height+"px",this.props.width=this.body.domProps.right.width,this.props.height=this.body.domProps.right.height),t=this._redrawLabels(),t=this._isResized()||t,this.options.icons===!0?this._redrawGroupIcons():this._cleanupIcons(),this._redrawTitle(s)}return t},o.prototype._redrawLabels=function(){var t=!1;s.prepareElements(this.DOMelements.lines),s.prepareElements(this.DOMelements.labels);var e,i=this.options.orientation;if(this.master===!1){var o,n,r,h;-1!==this.zeroCrossing&&this.options.alignZeros===!0?this.range.end>0?(o=this.range.end/this.zeroCrossing,n=this.range.end-this.amountOfSteps*o,r=this.range.end):(o=-1*this.range.start/(this.amountOfSteps-this.zeroCrossing),n=this.range.start,r=this.range.start+o*this.amountOfSteps):(n=this.range.start,r=this.range.end),h=this.stepPixels}else h=this.props.majorCharHeight,n=this.range.start,r=this.range.end;if(this.step=e=new a(n,r,h,this.dom.frame.offsetHeight,this.options[this.options.orientation].range,this.options[this.options.orientation].format,this.master===!1&&this.options.alignZeros),this.master===!0)this.stepPixels=this.dom.frame.offsetHeight/e.marginRange*e.step,this.amountOfSteps=Math.ceil(this.dom.frame.offsetHeight/this.stepPixels);else if(this.options.alignZeros===!0&&-1!==this.zeroCrossing){var d=(e.current-this.zeroCrossing*e.step)/e.step;this.step.shift(d)}this.valueAtBottom=e.marginEnd,this.maxLabelSize=0;for(var l=0,u=0,c=!1;u0&&u!==this.amountOfSteps&&((this.options.showMinorLabels&&c===!1||this.master===!1&&this.options.showMinorLabels===!0)&&this._redrawLabel(l-2,e.getCurrent(),i,"vis-y-axis vis-minor",this.props.minorCharHeight),c&&this.options.showMajorLabels&&this.master===!0||this.options.showMinorLabels===!1&&this.master===!1&&c===!0?(l>=0&&this._redrawLabel(l-2,e.getCurrent(),i,"vis-y-axis vis-major",this.props.majorCharHeight),this._redrawLine(l,i,"vis-grid vis-horizontal vis-major",this.options.majorLinesOffset,this.props.majorLineWidth)):this._redrawLine(l,i,"vis-grid vis-horizontal vis-minor",this.options.minorLinesOffset,this.props.minorLineWidth)),this.master===!0&&0===e.current&&(this.zeroCrossing=u),e.next(),u+=1;this.master===!0&&0===e.current&&(this.zeroCrossing=u),this.conversionFactor=this.stepPixels/e.step;var p=0;void 0!==this.options[i].title&&void 0!==this.options[i].title.text&&(p=this.props.titleCharHeight);var f=this.options.icons===!0?Math.max(this.options.iconWidth,p)+this.options.labelOffsetX+15:p+this.options.labelOffsetX+15;return this.maxLabelSize>this.width-f&&this.options.visible===!0?(this.width=this.maxLabelSize+f,this.options.width=this.width+"px",s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),this.redraw(),t=!0):this.maxLabelSizethis.minWidth?(this.width=Math.max(this.minWidth,this.maxLabelSize+f),this.options.width=this.width+"px",s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),this.redraw(),t=!0):(s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),t=!1),t},o.prototype.convertValue=function(t){var e=this.valueAtBottom-t,i=e*this.conversionFactor;return i},o.prototype.screenToValue=function(t){return this.valueAtBottom-t/this.conversionFactor},o.prototype._redrawLabel=function(t,e,i,o,n){var r=s.getDOMElement("div",this.DOMelements.labels,this.dom.frame);r.className=o,r.innerHTML=e,"left"===i?(r.style.left="-"+this.options.labelOffsetX+"px",r.style.textAlign="right"):(r.style.right="-"+this.options.labelOffsetX+"px",r.style.textAlign="left"),r.style.top=t-.5*n+this.options.labelOffsetY+"px",e+="";var a=Math.max(this.props.majorCharWidth,this.props.minorCharWidth);this.maxLabelSizes&&(h=s);for(var d=!1,l=h;Math.abs(l)<=Math.abs(s);l++){a=Math.pow(10,l);for(var u=0;u=n){d=!0,r=u;break}}if(d===!0)break}this.stepIndex=r,this.scale=a,this.step=a*this.minorSteps[r]},i.prototype.setFirst=function(t){void 0===t&&(t={});var e=void 0===t.min?this._start-2*this.scale*this.minorSteps[this.stepIndex]:t.min,i=void 0===t.max?this._end+this.scale*this.minorSteps[this.stepIndex]:t.max;this.marginEnd=void 0===t.max?this.roundToMinor(i):t.max,this.marginStart=void 0===t.min?this.roundToMinor(e):t.min,this.alignZeros===!0&&(this.marginEnd-this.marginStart)%this.step!=0&&(this.marginEnd+=this.marginEnd%this.step),this.deadSpace=this.roundToMinor(i)-i+this.roundToMinor(e)-e,this.marginRange=this.marginEnd-this.marginStart,this.current=this.marginEnd},i.prototype.roundToMinor=function(t){var e=t-t%(this.scale*this.minorSteps[this.stepIndex]);return t%(this.scale*this.minorSteps[this.stepIndex])>.5*(this.scale*this.minorSteps[this.stepIndex])?e+this.scale*this.minorSteps[this.stepIndex]:e},i.prototype.hasNext=function(){return this.current>=this.marginStart},i.prototype.next=function(){var t=this.current;this.current-=this.step,this.current===t&&(this.current=this._end)},i.prototype.previous=function(){this.current+=this.step,this.marginEnd+=this.step,this.marginRange=this.marginEnd-this.marginStart},i.prototype.getCurrent=function(){var t=Math.abs(this.current)t)for(var e=0;-t>e;e++)this.previous();else if(t>0)for(var e=0;t>e;e++)this.next()},t.exports=i},function(t,e,i){function o(t,e,i,o){this.id=e;var s=["sampling","style","sort","yAxisOrientation","barChart","drawPoints","shaded","interpolation"];this.options=n.selectiveBridgeObject(s,i),this.usingDefaultStyle=void 0===t.className,this.groupsUsingDefaultStyles=o,this.zeroPosition=0,this.update(t),1==this.usingDefaultStyle&&(this.groupsUsingDefaultStyles[0]+=1),this.itemsData=[],this.visible=void 0===t.visible?!0:t.visible}var n=i(1),s=i(7),r=i(54),a=i(56),h=i(55);o.prototype.setItems=function(t){if(null!=t){this.itemsData=t,1==this.options.sort&&this.itemsData.sort(function(t,e){return t.x-e.x});for(var e=0;et[o].y?t[o].y:e,i=i0){t.sort(function(t,e){return t.x===e.x?t.groupIde[s].y?e[s].y:o,n=nt[r].accumulatedNegative?t[r].accumulatedNegative:o,o=o>t[r].accumulatedPositive?t[r].accumulatedPositive:o,n=n0&&(i=Math.min(i,Math.abs(e[o-1].x-e[o].x))),0===i&&(void 0===t[e[o].x]&&(t[e[o].x]={amount:0,resolved:0,accumulatedPositive:0,accumulatedNegative:0}),t[e[o].x].amount+=1)},o.prototype.draw=function(t,e,i){if(null!=t&&t.length>0){var r,a,h=Number(i.svg.style.height.replace("px",""));if(r=n.getSVGElement("path",i.svgElements,i.svg),r.setAttributeNS(null,"class",e.className),void 0!==e.style&&r.setAttributeNS(null,"style",e.style),a=1==e.options.interpolation.enabled?o._catmullRom(t,e):o._linear(t),1==e.options.shaded.enabled){var d,l=n.getSVGElement("path",i.svgElements,i.svg);d="top"==e.options.shaded.orientation?"M"+t[0].x+",0 "+a+"L"+t[t.length-1].x+",0":"M"+t[0].x+","+h+" "+a+"L"+t[t.length-1].x+","+h,l.setAttributeNS(null,"class",e.className+" vis-fill"),void 0!==e.options.shaded.style&&l.setAttributeNS(null,"style",e.options.shaded.style),l.setAttributeNS(null,"d",d)}r.setAttributeNS(null,"d","M"+a),1==e.options.drawPoints.enabled&&s.draw(t,e,i)}},o._catmullRomUniform=function(t){for(var e,i,o,n,s,r,a=Math.round(t[0].x)+","+Math.round(t[0].y)+" ",h=1/6,d=t.length,l=0;d-1>l;l++)e=0==l?t[0]:t[l-1],i=t[l],o=t[l+1],n=d>l+2?t[l+2]:o,s={x:(-e.x+6*i.x+o.x)*h,y:(-e.y+6*i.y+o.y)*h},r={x:(i.x+6*o.x-n.x)*h,y:(i.y+6*o.y-n.y)*h},a+="C"+s.x+","+s.y+" "+r.x+","+r.y+" "+o.x+","+o.y+" ";return a},o._catmullRom=function(t,e){var i=e.options.interpolation.alpha;if(0==i||void 0===i)return this._catmullRomUniform(t);for(var o,n,s,r,a,h,d,l,u,c,p,f,m,v,g,y,b,w,_,x=Math.round(t[0].x)+","+Math.round(t[0].y)+" ",k=t.length,O=0;k-1>O;O++)o=0==O?t[0]:t[O-1],n=t[O],s=t[O+1],r=k>O+2?t[O+2]:s,d=Math.sqrt(Math.pow(o.x-n.x,2)+Math.pow(o.y-n.y,2)),l=Math.sqrt(Math.pow(n.x-s.x,2)+Math.pow(n.y-s.y,2)),u=Math.sqrt(Math.pow(s.x-r.x,2)+Math.pow(s.y-r.y,2)),v=Math.pow(u,i),y=Math.pow(u,2*i),g=Math.pow(l,i),b=Math.pow(l,2*i),_=Math.pow(d,i),w=Math.pow(d,2*i),c=2*w+3*_*g+b,p=2*y+3*v*g+b,f=3*_*(_+g),f>0&&(f=1/f),m=3*v*(v+g),m>0&&(m=1/m),a={x:(-b*o.x+c*n.x+w*s.x)*f,y:(-b*o.y+c*n.y+w*s.y)*f},h={x:(y*n.x+p*s.x-b*r.x)*m,y:(y*n.y+p*s.y-b*r.y)*m},0==a.x&&0==a.y&&(a=n),0==h.x&&0==h.y&&(h=s),x+="C"+a.x+","+a.y+" "+h.x+","+h.y+" "+s.x+","+s.y+" ";return x},o._linear=function(t){for(var e="",i=0;it[o].y?t[o].y:e,i=it[o].y?t[o].y:e,i=i0&&(r=Math.min(r,Math.abs(c[l-1].x-a))),h=o._getSafeDrawData(r,d,m);else{var g=l+(p[a].amount-p[a].resolved),y=l-(p[a].resolved+1);g0&&(r=Math.min(r,Math.abs(c[y].x-a))),h=o._getSafeDrawData(r,d,m),p[a].resolved+=1,d.options.stack===!0?c[l].y0&&(i=Math.min(i,Math.abs(e[o-1].x-e[o].x))),0===i&&(void 0===t[e[o].x]&&(t[e[o].x]={amount:0,resolved:0,accumulatedPositive:0,accumulatedNegative:0}),t[e[o].x].amount+=1)},o._getSafeDrawData=function(t,e,i){var o,n;return t0?(o=i>t?i:t,n=0,"left"===e.options.barChart.align?n-=.5*t:"right"===e.options.barChart.align&&(n+=.5*t)):(o=e.options.barChart.width,n=0,"left"===e.options.barChart.align?n-=.5*e.options.barChart.width:"right"===e.options.barChart.align&&(n+=.5*e.options.barChart.width)),{width:o,offset:n}},o.getStackedYRange=function(t,e,i,n,s){if(t.length>0){t.sort(function(t,e){return t.x===e.x?t.groupIde[s].y?e[s].y:o,n=nt[r].accumulatedNegative?t[r].accumulatedNegative:o,o=o>t[r].accumulatedPositive?t[r].accumulatedPositive:o,n=nt?-1:1});for(var i=0;i ")}this.dom.textArea.innerHTML=s,this.dom.textArea.style.lineHeight=.75*this.options.iconSize+this.options.iconSpacing+"px"}},o.prototype.drawLegendIcons=function(){if(this.dom.frame.parentNode){var t=Object.keys(this.groups);t.sort(function(t,e){return e>t?-1:1}),s.prepareElements(this.svgElements);var e=window.getComputedStyle(this.dom.frame).paddingTop,i=Number(e.replace("px","")),o=i,n=this.options.iconSize,r=.75*this.options.iconSize,a=i+.5*r+3;this.svg.style.width=n+5+i+"px";for(var h=0;h0){var i=this.groupIndex%this.groupsArray.length;this.groupIndex++,e={},e.color=this.groups[this.groupsArray[i]],this.groups[t]=e}else{var i=this.defaultIndex%this.defaultGroups.length;this.defaultIndex++,e={},e.color=this.defaultGroups[i],this.groups[t]=e}return e}},{key:"add",value:function(t,e){return this.groups[t]=e,this.groupsArray.push(t),e}}]),t}();e["default"]=r,t.exports=e["default"]},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}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 s=function(){function t(t,e){for(var i=0;it.left&&this.shape.topt.top}},{key:"isBoundingBoxOverlappingWith",value:function(t){return this.shape.boundingBox.leftt.left&&this.shape.boundingBox.topt.top}}],[{key:"parseOptions",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],n=["color","font","fixed","shadow"];if(B.selectiveNotDeepExtend(n,t,e,i),B.mergeOptions(t,e,"shadow",i,o),void 0!==e.color&&null!==e.color){var s=B.parseColor(e.color);B.fillIfDefined(t.color,s)}else i===!0&&null===e.color&&(t.color=Object.create(o.color));void 0!==e.fixed&&null!==e.fixed&&("boolean"==typeof e.fixed?(t.fixed.x=e.fixed,t.fixed.y=e.fixed):(void 0!==e.fixed.x&&"boolean"==typeof e.fixed.x&&(t.fixed.x=e.fixed.x),void 0!==e.fixed.y&&"boolean"==typeof e.fixed.y&&(t.fixed.y=e.fixed.y))),void 0!==e.font&&null!==e.font?a["default"].parseOptions(t.font,e):i===!0&&null===e.font&&(t.font=Object.create(o.font)),void 0!==e.scaling&&B.mergeOptions(t.scaling,e.scaling,"label",i,o.scaling)}}]),t}();e["default"]=R,t.exports=e["default"]},function(t,e,i){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 n=function(){function t(t,e){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function t(t,e){for(var i=0;i=this.nodeOptions.scaling.label.maxVisible&&(r=Number(this.nodeOptions.scaling.label.maxVisible)/this.body.view.scale);var h=this.size.yLine,d=this._getColor(a),l=n(d,2),u=l[0],c=l[1],p=this._setAlignment(t,i,h,s),f=n(p,2);i=f[0],h=f[1],t.font=(e&&this.nodeOptions.labelHighlightBold?"bold ":"")+r+"px "+this.fontOptions.face,t.fillStyle=u,t.textAlign="center",this.fontOptions.strokeWidth>0&&(t.lineWidth=this.fontOptions.strokeWidth,t.strokeStyle=c,t.lineJoin="round");for(var m=0;m0&&t.strokeText(this.lines[m],i,h),t.fillText(this.lines[m],i,h),h+=r}},{key:"_setAlignment",value:function(t,e,i,o){if("horizontal"!==this.fontOptions.align&&this.pointToSelf===!1){e=0,i=0;var n=2;"top"===this.fontOptions.align?(t.textBaseline="alphabetic",i-=2*n):"bottom"===this.fontOptions.align?(t.textBaseline="hanging",i+=2*n):t.textBaseline="middle"}else t.textBaseline=o;return[e,i]}},{key:"_getColor",value:function(t){var e=this.fontOptions.color||"#000000",i=this.fontOptions.strokeColor||"#ffffff";if(t<=this.nodeOptions.scaling.label.drawThreshold){var o=Math.max(0,Math.min(1,1-(this.nodeOptions.scaling.label.drawThreshold-t)));e=r.overrideOpacity(e,o),i=r.overrideOpacity(i,o)}return[e,i]}},{key:"getTextSize",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i={width:this._processLabel(t,e),height:this.fontOptions.size*this.lineCount,lineCount:this.lineCount};return i}},{key:"calculateLabelSize",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?0:arguments[2],o=arguments.length<=3||void 0===arguments[3]?0:arguments[3],n=arguments.length<=4||void 0===arguments[4]?"middle":arguments[4];this.labelDirty===!0&&(this.size.width=this._processLabel(t,e)),this.size.height=this.fontOptions.size*this.lineCount,this.size.left=i-.5*this.size.width,this.size.top=o-.5*this.size.height,this.size.yLine=o+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===n&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4),this.labelDirty=!1}},{key:"_processLabel",value:function(t,e){var i=0,o=[""],n=0;if(void 0!==this.nodeOptions.label){o=String(this.nodeOptions.label).split("\n"),n=o.length,t.font=(e&&this.nodeOptions.labelHighlightBold?"bold ":"")+this.fontOptions.size+"px "+this.fontOptions.face,i=t.measureText(o[0]).width;for(var s=1;n>s;s++){var r=t.measureText(o[s]).width;i=r>i?r:i}}return this.lines=o,this.lineCount=n,i}}],[{key:"parseOptions",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];if("string"==typeof e.font){var o=e.font.split(" ");t.size=o[0].replace("px",""),t.face=o[1],t.color=o[2]}else"object"==typeof e.font&&r.fillIfDefined(t,e.font,i);t.size=Number(t.size)}}]),t}();e["default"]=a,t.exports=e["default"]},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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&&(t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var i=0;ithis.imageObj.height?(o=this.imageObj.width/this.imageObj.height,e=2*this.options.size*o||this.imageObj.width,i=2*this.options.size||this.imageObj.height):(o=this.imageObj.width&&this.imageObj.height?this.imageObj.height/this.imageObj.width:1,e=2*this.options.size,i=2*this.options.size*o):(e=this.imageObj.width,i=this.imageObj.height),this.width=e,this.height=i,this.radius=.5*this.width}}},{key:"_drawRawCircle",value:function(t,e,i,o,n,s){var r=this.options.borderWidth,a=this.options.borderWidthSelected||2*this.options.borderWidth;t.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,t.lineWidth=o?a:r,t.lineWidth*=this.networkScaleInv,t.lineWidth=Math.min(this.width,t.lineWidth),t.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,t.circle(e,i,s),this.enableShadow(t),t.fill(),this.disableShadow(t),t.save(),this.enableBorderDashes(t),t.stroke(),this.disableBorderDashes(t),t.restore()}},{key:"_drawImageAtPosition",value:function(t){0!=this.imageObj.width&&(t.globalAlpha=1,this.enableShadow(t),t.drawImage(this.imageObj,this.left,this.top,this.width,this.height),this.disableShadow(t))}},{key:"_drawImageLabel",value:function(t,e,i,o){var n,s=0;if(void 0!==this.height){s=.5*this.height;var r=this.labelModule.getTextSize(t);r.lineCount>=1&&(s+=r.height/2)}n=i+s,this.options.label&&(this.labelOffset=s),this.labelModule.draw(t,e,n,o,"hanging")}}]),e}(d["default"]);e["default"]=l,t.exports=e["default"]},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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&&(t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var i=0;i0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+3))}}]),e}(d["default"]);e["default"]=l,t.exports=e["default"]},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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&&(t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var i=0;i0){var i=5;this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+i)}}},{key:"_icon",value:function(t,e,i,o){var n=Number(this.options.icon.size);void 0!==this.options.icon.code?(t.font=(o?"bold ":"")+n+"px "+this.options.icon.face,t.fillStyle=this.options.icon.color||"black",t.textAlign="center",t.textBaseline="middle",this.enableShadow(t),t.fillText(this.options.icon.code,e,i),this.disableShadow(t)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(d["default"]);e["default"]=l,t.exports=e["default"]},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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&&(t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var i=0;i0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(t,e){this.resize(t);var i=this.width/2,o=this.height/2,n=Math.sin(e)*i,s=Math.cos(e)*o;return i*o/Math.sqrt(n*n+s*s)}}]),e}(d["default"]);e["default"]=l,t.exports=e["default"]},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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&&(t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var i=0;ii.shape.height?(r=i.x+.5*i.shape.width,a=i.y-h):(r=i.x+h,a=i.y-.5*i.shape.height),s=this._pointOnCircle(r,a,h,.125),this.labelModule.draw(t,s.x,s.y,n)}}}},{key:"isOverlappingWith",value:function(t){if(this.connected){var e=10,i=this.from.x,o=this.from.y,n=this.to.x,s=this.to.y,r=t.left,a=t.top,h=this.edgeType.getDistanceToEdge(i,o,n,s,r,a);return e>h}return!1}},{key:"_rotateForLabelAlignment",value:function(t){var e=this.from.y-this.to.y,i=this.from.x-this.to.x,o=Math.atan2(e,i);(-1>o&&0>i||o>0&&0>i)&&(o+=Math.PI),t.rotate(o)}},{key:"_pointOnCircle",value:function(t,e,i,o){var n=2*o*Math.PI;return{x:t+i*Math.cos(n),y:e-i*Math.sin(n)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}}],[{key:"parseOptions",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],n=["id","from","hidden","hoverWidth","label","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","to","title","value","width"];if(v.selectiveDeepExtend(n,t,e,i),v.mergeOptions(t,e,"smooth",i,o),v.mergeOptions(t,e,"shadow",i,o),void 0!==e.dashes&&null!==e.dashes?t.dashes=e.dashes:i===!0&&null===e.dashes&&(t.dashes=Object.create(o.dashes)),void 0!==e.scaling&&null!==e.scaling?(void 0!==e.scaling.min&&(t.scaling.min=e.scaling.min),void 0!==e.scaling.max&&(t.scaling.max=e.scaling.max),v.mergeOptions(t.scaling,e.scaling,"label",i,o.scaling)):i===!0&&null===e.scaling&&(t.scaling=Object.create(o.scaling)),void 0!==e.arrows&&null!==e.arrows)if("string"==typeof e.arrows){var s=e.arrows.toLowerCase();-1!=s.indexOf("to")&&(t.arrows.to.enabled=!0),-1!=s.indexOf("middle")&&(t.arrows.middle.enabled=!0),-1!=s.indexOf("from")&&(t.arrows.from.enabled=!0)}else{if("object"!=typeof e.arrows)throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+JSON.stringify(e.arrows));v.mergeOptions(t.arrows,e.arrows,"to",i,o.arrows),v.mergeOptions(t.arrows,e.arrows,"middle",i,o.arrows),v.mergeOptions(t.arrows,e.arrows,"from",i,o.arrows)}else i===!0&&null===e.arrows&&(t.arrows=Object.create(o.arrows));if(void 0!==e.color&&null!==e.color)if(v.isString(e.color))t.color.color=e.color,t.color.highlight=e.color,t.color.hover=e.color,t.color.inherit=!1;else{var r=!1;void 0!==e.color.color&&(t.color.color=e.color.color,r=!0),void 0!==e.color.highlight&&(t.color.highlight=e.color.highlight,r=!0),void 0!==e.color.hover&&(t.color.hover=e.color.hover,r=!0),void 0!==e.color.inherit&&(t.color.inherit=e.color.inherit),void 0!==e.color.opacity&&(t.color.opacity=Math.min(1,Math.max(0,e.color.opacity))),void 0===e.color.inherit&&r===!0&&(t.color.inherit=!1)}else i===!0&&null===e.color&&(t.color=Object.create(o.color));void 0!==e.font&&null!==e.font?a["default"].parseOptions(t.font,e):i===!0&&null===e.font&&(t.font=Object.create(o.font))}}]),t}();e["default"]=g,t.exports=e["default"]},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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&&(t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function t(t,e){for(var i=0;iMath.abs(e)||this.options.smooth.forceDirection===!0||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(o=this.from.y,s=this.to.y,i=this.from.x-r*t,n=this.to.x+r*t):(o=this.from.y-r*e,s=this.to.y+r*e,i=this.from.x,n=this.to.x),[{x:i,y:o},{x:n,y:s}]}},{key:"_findBorderPosition",value:function(t,e){return this._findBorderPositionBezier(t,e)}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,s){var a=arguments.length<=6||void 0===arguments[6]?this._getViaCoordinates():arguments[6],h=r(a,2),d=h[0],l=h[1];return this._getDistanceToBezierEdge(t,e,i,o,n,s,d,l)}},{key:"getPoint",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?this._getViaCoordinates():arguments[1],i=r(e,2),o=i[0],n=i[1],s=t,a=[];a[0]=Math.pow(1-s,3),a[1]=3*s*Math.pow(1-s,2),a[2]=3*Math.pow(s,2)*(1-s),a[3]=Math.pow(s,3);var h=a[0]*this.from.x+a[1]*o.x+a[2]*n.x+a[3]*this.to.x,d=a[0]*this.from.y+a[1]*o.y+a[2]*n.y+a[3]*this.to.y;return{x:h,y:d}}}]),e}(l["default"]);e["default"]=u,t.exports=e["default"]},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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&&(t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var i=0;il;l++)u=.1*l,v[0]=Math.pow(1-u,3),v[1]=3*u*Math.pow(1-u,2),v[2]=3*Math.pow(u,2)*(1-u),v[3]=Math.pow(u,3),c=v[0]*t+v[1]*r.x+v[2]*a.x+v[3]*i,p=v[0]*e+v[1]*r.y+v[2]*a.y+v[3]*o,l>0&&(d=this._getDistanceToLine(f,m,c,p,n,s),h=h>d?d:h),f=c,m=p;return h}}]),e}(d["default"]);e["default"]=l,t.exports=e["default"]},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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&&(t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var i=0;i=l&&h>d;){var m=.5*(l+u);if(i=this.getPoint(m,a),o=Math.atan2(p.y-i.y,p.x-i.x),n=p.distanceToBorder(e,o),s=Math.sqrt(Math.pow(i.x-p.x,2)+Math.pow(i.y-p.y,2)),r=n-s,Math.abs(r)r?f===!1?l=m:u=m:f===!1?u=m:l=m,d++}return i.t=m,i}},{key:"_getDistanceToBezierEdge",value:function(t,e,i,o,n,s,r){var a=1e9,h=void 0,d=void 0,l=void 0,u=void 0,c=void 0,p=t,f=e;for(d=1;10>d;d++)l=.1*d,u=Math.pow(1-l,2)*t+2*l*(1-l)*r.x+Math.pow(l,2)*i,c=Math.pow(1-l,2)*e+2*l*(1-l)*r.y+Math.pow(l,2)*o,d>0&&(h=this._getDistanceToLine(p,f,u,c,n,s),a=a>h?h:a),p=u,f=c;return a}}]),e}(d["default"]);e["default"]=l,t.exports=e["default"]},function(t,e,i){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 n=function(){function t(t,e){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function t(t,e){for(var i=0;io.shape.height?(e=o.x+.5*o.shape.width,i=o.y-n):(e=o.x+n,i=o.y-.5*o.shape.height),[e,i,n]}},{key:"_pointOnCircle",value:function(t,e,i,o){var n=2*o*Math.PI;return{x:t+i*Math.cos(n),y:e-i*Math.sin(n)}}},{key:"_findBorderPositionCircle",value:function(t,e,i){for(var o=i.x,n=i.y,s=i.low,r=i.high,a=i.direction,h=10,d=0,l=this.options.selfReferenceSize,u=void 0,c=void 0,p=void 0,f=void 0,m=void 0,v=.05,g=.5*(s+r);r>=s&&h>d&&(g=.5*(s+r),u=this._pointOnCircle(o,n,l,g),c=Math.atan2(t.y-u.y,t.x-u.x),p=t.distanceToBorder(e,c),f=Math.sqrt(Math.pow(u.x-t.x,2)+Math.pow(u.y-t.y,2)),m=p-f,!(Math.abs(m)0?a>0?s=g:r=g:a>0?r=g:s=g,d++;return u.t=g,u}},{key:"getLineWidth",value:function(t,e){return t===!0?Math.max(this.selectionWidth,.3/this.body.view.scale):e===!0?Math.max(this.hoverWidth,.3/this.body.view.scale):Math.max(this.options.width,.3/this.body.view.scale)}},{key:"getColor",value:function(t,e,i){var o=this.options.color;if(o.inherit!==!1){if("both"===o.inherit&&this.from.id!==this.to.id){var n=t.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),s=void 0,a=void 0;return s=this.from.options.color.highlight.border,a=this.to.options.color.highlight.border,this.from.selected===!1&&this.to.selected===!1?(s=r.overrideOpacity(this.from.options.color.border,this.options.color.opacity),a=r.overrideOpacity(this.to.options.color.border,this.options.color.opacity)):this.from.selected===!0&&this.to.selected===!1?a=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(s=this.from.options.color.border),n.addColorStop(0,s),n.addColorStop(1,a),n}this.colorDirty===!0&&("to"===o.inherit?(this.color.highlight=this.to.options.color.highlight.border,this.color.hover=this.to.options.color.hover.border,this.color.color=r.overrideOpacity(this.to.options.color.border,o.opacity)):(this.color.highlight=this.from.options.color.highlight.border,this.color.hover=this.from.options.color.hover.border,this.color.color=r.overrideOpacity(this.from.options.color.border,o.opacity)))}else this.colorDirty===!0&&(this.color.highlight=o.highlight,this.color.hover=o.hover,this.color.color=r.overrideOpacity(o.color,o.opacity));return this.colorDirty=!1,e===!0?this.color.highlight:i===!0?this.color.hover:this.color.color}},{key:"_circle",value:function(t,e,i,o){this.enableShadow(t),t.beginPath(),t.arc(e,i,o,0,2*Math.PI,!1),t.stroke(),this.disableShadow(t)}},{key:"getDistanceToEdge",value:function(t,e,i,o,s,r,a){var h=0;if(this.from!=this.to)h=this._getDistanceToEdge(t,e,i,o,s,r,a);else{var d=this._getCircleData(),l=n(d,3),u=l[0],c=l[1],p=l[2],f=u-s,m=c-r;h=Math.abs(Math.sqrt(f*f+m*m)-p)}return this.labelModule.size.lefts&&this.labelModule.size.topr?0:h}},{key:"_getDistanceToLine",value:function(t,e,i,o,n,s){var r=i-t,a=o-e,h=r*r+a*a,d=((n-t)*r+(s-e)*a)/h;d>1?d=1:0>d&&(d=0);var l=t+d*r,u=e+d*a,c=l-n,p=u-s;return Math.sqrt(c*c+p*p)}},{key:"drawArrowHead",value:function(t,e,i,o,s){t.strokeStyle=this.getColor(t,o,s),t.fillStyle=t.strokeStyle,t.lineWidth=this.getLineWidth(o,s);var r=void 0,a=void 0,h=void 0,d=void 0,l=void 0,u=void 0,c=void 0;if("from"===e?(d=this.from,l=this.to,u=.1,c=this.options.arrows.from.scaleFactor):"to"===e?(d=this.to,l=this.from,u=-.1,c=this.options.arrows.to.scaleFactor):(d=this.to,l=this.from,c=this.options.arrows.middle.scaleFactor),d!=l){if("middle"!==e)if(this.options.smooth.enabled===!0){h=this.findBorderPosition(d,t,{via:i});var p=this.getPoint(Math.max(0,Math.min(1,h.t+u)),i);r=Math.atan2(h.y-p.y,h.x-p.x)}else r=Math.atan2(d.y-l.y,d.x-l.x),h=this.findBorderPosition(d,t);else r=Math.atan2(d.y-l.y,d.x-l.x),h=this.getPoint(.6,i);a=(10+5*this.options.width)*c,t.arrow(h.x,h.y,r,a),this.enableShadow(t),t.fill(),this.disableShadow(t),t.stroke()}else{var f=void 0,m=void 0,v=this._getCircleData(t),g=n(v,3),y=g[0],b=g[1],w=g[2];"from"===e?(m=this.findBorderPosition(this.from,t,{x:y,y:b,low:.25,high:.6,direction:-1}),f=-2*m.t*Math.PI+1.5*Math.PI+.1*Math.PI):"to"===e?(m=this.findBorderPosition(this.from,t,{x:y,y:b,low:.6,high:1,direction:1}),f=-2*m.t*Math.PI+1.5*Math.PI-1.1*Math.PI):(m=this._pointOnCircle(y,b,w,.175),f=3.9269908169872414);var _=(10+5*this.options.width)*c;t.arrow(m.x,m.y,f,_),this.enableShadow(t),t.fill(),this.disableShadow(t),t.stroke()}}},{key:"enableShadow",value:function(t){this.options.shadow.enabled===!0&&(t.shadowColor="rgba(0,0,0,0.5)",t.shadowBlur=this.options.shadow.size,t.shadowOffsetX=this.options.shadow.x,t.shadowOffsetY=this.options.shadow.y)}},{key:"disableShadow",value:function(t){this.options.shadow.enabled===!0&&(t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0)}}]),t}();e["default"]=a,t.exports=e["default"]},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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&&(t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var i=0;i=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*s,e=this.from.y-i*s):this.from.x>this.to.x&&(t=this.from.x-i*s,e=this.from.y-i*s):this.from.ythis.to.x&&(t=this.from.x-i*s,e=this.from.y+i*s)),"discrete"===o&&(t=i*s>n?this.from.x:t)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*n,e=this.from.y-i*n):this.from.x>this.to.x&&(t=this.from.x-i*n,e=this.from.y-i*n):this.from.ythis.to.x&&(t=this.from.x-i*n,e=this.from.y+i*n)),"discrete"===o&&(e=i*n>s?this.from.y:e));else if("straightCross"===o)Math.abs(this.from.x-this.to.x)<=Math.abs(this.from.y-this.to.y)?(t=this.from.x,e=this.from.yMath.abs(this.from.y-this.to.y)&&(t=this.from.x=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*s,e=this.from.y-i*s,t=this.to.xthis.to.x&&(t=this.from.x-i*s,e=this.from.y-i*s,t=this.to.x>t?this.to.x:t):this.from.ythis.to.x&&(t=this.from.x-i*s,e=this.from.y+i*s,t=this.to.x>t?this.to.x:t)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*n,e=this.from.y-i*n,e=this.to.y>e?this.to.y:e):this.from.x>this.to.x&&(t=this.from.x-i*n,e=this.from.y-i*n,e=this.to.y>e?this.to.y:e):this.from.ythis.to.x&&(t=this.from.x-i*n,e=this.from.y+i*n,e=this.to.y1||this.startedStabilization===!0)&&setTimeout(function(){t.body.emitter.emit("stabilized",{iterations:e}),t.startedStabilization=!1,t.stabilizationIterations=0},0)}},{key:"physicsTick",value:function(){if(this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0),this.stabilized===!1){if(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0){var t=1.2;this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.calculateForces(),this.moveNodes(),this.revert(),this.timestep=.5*this.timestep,this.calculateForces(),this.moveNodes(),this.calculateForces(),this.moveNodes(),this._evaluateStepQuality()===!0?this.timestep=t*this.timestep:this.timestep/ts))return!1;return!0}},{key:"moveNodes",value:function(){for(var t=this.physicsBody.physicsNodeIndices,e=this.options.maxVelocity?this.options.maxVelocity:1e9,i=0,o=0,n=5,s=0;se?s[t].x>0?e:-e:s[t].x,i.x+=s[t].x*o}else n[t].x=0,s[t].x=0;if(i.options.fixed.y===!1){var h=this.modelOptions.damping*s[t].y,d=(n[t].y-h)/i.options.mass;s[t].y+=d*o,s[t].y=Math.abs(s[t].y)>e?s[t].y>0?e:-e:s[t].y,i.y+=s[t].y*o}else n[t].y=0,s[t].y=0;var l=Math.sqrt(Math.pow(s[t].x,2)+Math.pow(s[t].y,2));return l}},{key:"calculateForces",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve()}},{key:"_freezeNodes",value:function(){var t=this.body.nodes;for(var e in t)t.hasOwnProperty(e)&&t[e].x&&t[e].y&&(this.freezeCache[e]={x:t[e].options.fixed.x,y:t[e].options.fixed.y},t[e].options.fixed.x=!0,t[e].options.fixed.y=!0)}},{key:"_restoreFrozenNodes",value:function(){var t=this.body.nodes;for(var e in t)t.hasOwnProperty(e)&&void 0!==this.freezeCache[e]&&(t[e].options.fixed.x=this.freezeCache[e].x,t[e].options.fixed.y=this.freezeCache[e].y);this.freezeCache={}}},{key:"stabilize",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]?this.options.stabilization.iterations:arguments[0];return"number"!=typeof e&&(console.log("The stabilize method needs a numeric amount of iterations. Switching to default: ",this.options.stabilization.iterations),e=this.options.stabilization.iterations),0===this.physicsBody.physicsNodeIndices.length?void(this.ready=!0):(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,void setTimeout(function(){return t._stabilizationBatch()},0))}},{key:"_stabilizationBatch",value:function(){this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0);for(var t=0;this.stabilized===!1&&t0){var t=void 0,e=this.body.nodes,i=this.physicsBody.physicsNodeIndices,o=i.length,n=this._formBarnesHutTree(e,i);this.barnesHutTree=n;for(var s=0;o>s;s++)t=e[i[s]],t.options.mass>0&&(this._getForceContribution(n.root.children.NW,t),this._getForceContribution(n.root.children.NE,t),this._getForceContribution(n.root.children.SW,t),this._getForceContribution(n.root.children.SE,t))}}},{key:"_getForceContribution",value:function(t,e){if(t.childrenCount>0){var i=void 0,o=void 0,n=void 0;i=t.centerOfMass.x-e.x,o=t.centerOfMass.y-e.y,n=Math.sqrt(i*i+o*o),n*t.calcSize>this.thetaInversed?this._calculateForces(n,i,o,e,t):4===t.childrenCount?(this._getForceContribution(t.children.NW,e),this._getForceContribution(t.children.NE,e),this._getForceContribution(t.children.SW,e),this._getForceContribution(t.children.SE,e)):t.children.data.id!=e.id&&this._calculateForces(n,i,o,e,t)}}},{key:"_calculateForces",value:function(t,e,i,o,n){0===t&&(t=.1,e=t),this.overlapAvoidanceFactor<1&&(t=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,t-o.shape.radius));var s=this.options.gravitationalConstant*n.mass*o.options.mass/Math.pow(t,3),r=e*s,a=i*s;this.physicsBody.forces[o.id].x+=r,this.physicsBody.forces[o.id].y+=a}},{key:"_formBarnesHutTree",value:function(t,e){for(var i=void 0,o=e.length,n=t[e[0]].x,s=t[e[0]].y,r=t[e[0]].x,a=t[e[0]].y,h=1;o>h;h++){var d=t[e[h]].x,l=t[e[h]].y;t[e[h]].options.mass>0&&(n>d&&(n=d),d>r&&(r=d),s>l&&(s=l),l>a&&(a=l))}var u=Math.abs(r-n)-Math.abs(a-s);u>0?(s-=.5*u,a+=.5*u):(n+=.5*u,r-=.5*u);var c=1e-5,p=Math.max(c,Math.abs(r-n)),f=.5*p,m=.5*(n+r),v=.5*(s+a),g={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:m-f,maxX:m+f,minY:v-f,maxY:v+f},size:p,calcSize:1/p,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(g.root);for(var h=0;o>h;h++)i=t[e[h]],i.options.mass>0&&this._placeInTree(g.root,i);return g}},{key:"_updateBranchMass",value:function(t,e){var i=t.mass+e.options.mass,o=1/i;t.centerOfMass.x=t.centerOfMass.x*t.mass+e.x*e.options.mass,t.centerOfMass.x*=o,t.centerOfMass.y=t.centerOfMass.y*t.mass+e.y*e.options.mass,t.centerOfMass.y*=o,t.mass=i;var n=Math.max(Math.max(e.height,e.radius),e.width);t.maxWidth=t.maxWidthe.x?t.children.NW.range.maxY>e.y?this._placeInRegion(t,e,"NW"):this._placeInRegion(t,e,"SW"):t.children.NW.range.maxY>e.y?this._placeInRegion(t,e,"NE"):this._placeInRegion(t,e,"SE")}},{key:"_placeInRegion",value:function(t,e,i){switch(t.children[i].childrenCount){case 0:t.children[i].children.data=e,t.children[i].childrenCount=1,this._updateBranchMass(t.children[i],e);break;case 1:t.children[i].children.data.x===e.x&&t.children[i].children.data.y===e.y?(e.x+=this.seededRandom(),e.y+=this.seededRandom()):(this._splitBranch(t.children[i]),this._placeInTree(t.children[i],e));break;case 4:this._placeInTree(t.children[i],e)}}},{key:"_splitBranch",value:function(t){var e=null;1===t.childrenCount&&(e=t.children.data,t.mass=0,t.centerOfMass.x=0,t.centerOfMass.y=0),t.childrenCount=4,t.children.data=null,this._insertRegion(t,"NW"),this._insertRegion(t,"NE"),this._insertRegion(t,"SW"),this._insertRegion(t,"SE"),null!=e&&this._placeInTree(t,e)}},{key:"_insertRegion",value:function(t,e){var i=void 0,o=void 0,n=void 0,s=void 0,r=.5*t.size;switch(e){case"NW":i=t.range.minX,o=t.range.minX+r,n=t.range.minY,s=t.range.minY+r;break;case"NE":i=t.range.minX+r,o=t.range.maxX,n=t.range.minY,s=t.range.minY+r;break;case"SW":i=t.range.minX,o=t.range.minX+r,n=t.range.minY+r,s=t.range.maxY;break;case"SE":i=t.range.minX+r,o=t.range.maxX,n=t.range.minY+r,s=t.range.maxY}t.children[e]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:o,minY:n,maxY:s},size:.5*t.size,calcSize:2*t.calcSize,children:{data:null},maxWidth:0,level:t.level+1,childrenCount:0}}},{key:"_debug",value:function(t,e){void 0!==this.barnesHutTree&&(t.lineWidth=1,this._drawBranch(this.barnesHutTree.root,t,e))}},{key:"_drawBranch",value:function(t,e,i){void 0===i&&(i="#FF0000"),4===t.childrenCount&&(this._drawBranch(t.children.NW,e),this._drawBranch(t.children.NE,e),this._drawBranch(t.children.SE,e),this._drawBranch(t.children.SW,e)),e.strokeStyle=i,e.beginPath(),e.moveTo(t.range.minX,t.range.minY),e.lineTo(t.range.maxX,t.range.minY),e.stroke(),e.beginPath(),e.moveTo(t.range.maxX,t.range.minY),e.lineTo(t.range.maxX,t.range.maxY),e.stroke(),e.beginPath(),e.moveTo(t.range.maxX,t.range.maxY),e.lineTo(t.range.minX,t.range.maxY),e.stroke(),e.beginPath(),e.moveTo(t.range.minX,t.range.maxY),e.lineTo(t.range.minX,t.range.minY),e.stroke()}}]),t}();e["default"]=n,t.exports=e["default"]},function(t,e){function i(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(){function t(t,e){for(var i=0;ii&&(s=.5*u>i?1:c*i+p,s/=i,o=t*s,n=e*s,l[r.id].x-=o,l[r.id].y-=n,l[a.id].x+=o,l[a.id].y+=n)}}}]),t}();e["default"]=n,t.exports=e["default"]},function(t,e){function i(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(){function t(t,e){for(var i=0;ii?-Math.pow(f*i,2)+Math.pow(f*p,2):0,0===i?i=.01:s/=i,o=t*s,n=e*s,c[r.id].x-=o,c[r.id].y-=n,c[a.id].x+=o,c[a.id].y+=n}}}]),t}();e["default"]=n,t.exports=e["default"]},function(t,e){function i(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(){function t(t,e){for(var i=0;i0){var s=n.edges.length+1,r=this.options.centralGravity*s*n.options.mass;o[n.id].x=e*r,o[n.id].y=i*r}}}]),e}(d["default"]);e["default"]=l,t.exports=e["default"]},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}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 s=function(){function t(t,e){for(var i=0;i=t&&i.push(n.id)}for(var o=0;o0&&Object.keys(c).length>0&&f===!0&&o.push({nodes:u,edges:c})}}}for(var l=0;lo?r.x:o,n=r.ys?r.y:s;return{x:.5*(i+o),y:.5*(n+s)}}},{key:"openCluster",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];if(void 0===t)throw new Error("No clusterNodeId supplied to openCluster.");if(void 0===this.body.nodes[t])throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(void 0===this.body.nodes[t].containedNodes)return void console.log("The node:"+t+" is not a cluster.");var o=this.body.nodes[t],n=o.containedNodes,s=o.containedEdges;if(void 0!==e&&void 0!==e.releaseFunction&&"function"==typeof e.releaseFunction){var r={},a={x:o.x,y:o.y};for(var d in n)if(n.hasOwnProperty(d)){var l=this.body.nodes[d];r[d]={x:l.x,y:l.y}}var u=e.releaseFunction(a,r);for(var d in n)if(n.hasOwnProperty(d)){var l=this.body.nodes[d];void 0!==u[d]&&(l.x=void 0===u[d].x?o.x:u[d].x,l.y=void 0===u[d].y?o.y:u[d].y)}}else for(var d in n)if(n.hasOwnProperty(d)){var l=this.body.nodes[d];l=n[d],l.x=o.x,l.y=o.y}for(var d in n)if(n.hasOwnProperty(d)){var l=this.body.nodes[d];l.vx=o.vx,l.vy=o.vy,l.setOptions({hidden:!1,physics:!0}),delete this.clusteredNodes[d]}for(var c=[],p=0;po;)e.push(this.clusteredNodes[t].node),t=this.clusteredNodes[t].clusterId,o++;return e.push(this.body.nodes[t]),e}},{key:"_getConnectedId",value:function(t,e){return t.toId!=e?t.toId:t.fromId!=e?t.fromId:t.fromId}},{key:"_getHubSize",value:function(){for(var t=0,e=0,i=0,o=0,n=0;no&&(o=s.edges.length),t+=s.edges.length,e+=Math.pow(s.edges.length,2),i+=1}t/=i,e/=i;var r=e-Math.pow(t,2),a=Math.sqrt(r),h=Math.floor(t+2*a);return h>o&&(h=o),h}}]),t}();e["default"]=d,t.exports=e["default"]},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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&&(t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e,i){for(var o=!0;o;){var n=t,s=e,r=i;a=d=h=void 0,o=!1,null===n&&(n=Function.prototype);var a=Object.getOwnPropertyDescriptor(n,s);if(void 0!==a){if("value"in a)return a.value;var h=a.get;return void 0===h?void 0:h.call(r)}var d=Object.getPrototypeOf(n);if(null===d)return void 0;t=d,e=s,i=r,o=!0}},a=i(62),h=o(a),d=function(t){function e(t,i,o,s,a){n(this,e),r(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,t,i,o,s,a),this.isCluster=!0,this.containedNodes={},this.containedEdges={}}return s(e,t),e}(h["default"]);e["default"]=d,t.exports=e["default"]},function(t,e,i){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 n=function(){function t(t,e){for(var i=0;i0,t.renderTimer=void 0}),this.body.emitter.on("destroy",function(){t.renderRequests=0,t.allowRedraw=!1,t.renderingActive=!1,t.requiresTimeout===!0?clearTimeout(t.renderTimer):cancelAnimationFrame(t.renderTimer),t.body.emitter.off()})}},{key:"setOptions",value:function(t){if(void 0!==t){var e=["hideEdgesOnDrag","hideNodesOnDrag"];s.selectiveDeepExtend(e,this.options,t)}}},{key:"_startRendering",value:function(){this.renderingActive===!0&&void 0===this.renderTimer&&(this.requiresTimeout===!0?this.renderTimer=window.setTimeout(this._renderStep.bind(this),this.simulationInterval):this.renderTimer=window.requestAnimationFrame(this._renderStep.bind(this)))}},{key:"_renderStep",value:function(){this.renderingActive===!0&&(this.renderTimer=void 0,this.requiresTimeout===!0&&this._startRendering(),this._redraw(),this.requiresTimeout===!1&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var t=this;this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,this.requiresTimeout===!0?window.setTimeout(function(){t._redraw(!1)},0):window.requestAnimationFrame(function(){t._redraw(!1)}))}},{key:"_redraw",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0];if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var e=this.canvas.frame.canvas.getContext("2d");(0===this.canvas.frame.canvas.width||0===this.canvas.frame.canvas.height)&&this.canvas.setSize(),this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var i=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(e.clearRect(0,0,i,o),0===this.canvas.frame.clientWidth)return;e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale),e.beginPath(),this.body.emitter.emit("beforeDrawing",e),e.closePath(),t===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&this._drawEdges(e),(this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1)&&this._drawNodes(e,t),this.controlNodesActive===!0&&this._drawControlNodes(e),e.beginPath(),this.body.emitter.emit("afterDrawing",e),e.closePath(),e.restore(),t===!0&&e.clearRect(0,0,i,o)}}},{key:"_resizeNodes",value:function(){var t=this.canvas.frame.canvas.getContext("2d");void 0===this.pixelRatio&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale);var e=this.body.nodes,i=void 0;for(var o in e)e.hasOwnProperty(o)&&(i=e[o],i.resize(t),i.updateBoundingBox(t,i.selected));t.restore()}},{key:"_drawNodes",value:function(t){for(var e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=this.body.nodes,o=this.body.nodeIndices,n=void 0,s=[],r=20,a=this.canvas.DOMtoCanvas({x:-r,y:-r}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+r,y:this.canvas.frame.canvas.clientHeight+r
+}),d={top:a.y,left:a.x,bottom:h.y,right:h.x},l=0;l0){this.body.view.scale=this.cameraState.scale*Math.min(this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight);var t=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),e={x:t.x-this.cameraState.position.x,y:t.y-this.cameraState.position.y};this.body.view.translation.x+=e.x*this.body.view.scale,this.body.view.translation.y+=e.y*this.body.view.scale}}},{key:"_prepareValue",value:function(t){if("number"==typeof t)return t+"px";if("string"==typeof t){if(-1!==t.indexOf("%")||-1!==t.indexOf("px"))return t;if(-1===t.indexOf("%"))return t+"px"}throw new Error("Could not use the value supplied for width or height:"+t)}},{key:"_create",value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=900,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext){var t=this.frame.canvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.frame.canvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:"_bindHammer",value:function(){var t=this;void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new s(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:30}),r.onTouch(this.hammer,function(e){t.body.eventListeners.onTouch(e)}),this.hammer.on("tap",function(e){t.body.eventListeners.onTap(e)}),this.hammer.on("doubletap",function(e){t.body.eventListeners.onDoubleTap(e)}),this.hammer.on("press",function(e){t.body.eventListeners.onHold(e)}),this.hammer.on("panstart",function(e){t.body.eventListeners.onDragStart(e)}),this.hammer.on("panmove",function(e){t.body.eventListeners.onDrag(e)}),this.hammer.on("panend",function(e){t.body.eventListeners.onDragEnd(e)}),this.hammer.on("pinch",function(e){t.body.eventListeners.onPinch(e)}),this.frame.canvas.addEventListener("mousewheel",function(e){t.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("DOMMouseScroll",function(e){t.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("mousemove",function(e){t.body.eventListeners.onMouseMove(e)}),this.frame.canvas.addEventListener("contextmenu",function(e){t.body.eventListeners.onContext(e)}),this.hammerFrame=new s(this.frame),r.onRelease(this.hammerFrame,function(e){t.body.eventListeners.onRelease(e)})}},{key:"setSize",value:function(){var t=arguments.length<=0||void 0===arguments[0]?this.options.width:arguments[0],e=arguments.length<=1||void 0===arguments[1]?this.options.height:arguments[1];t=this._prepareValue(t),e=this._prepareValue(e);var i=!1,o=this.frame.canvas.width,n=this.frame.canvas.height,s=this.frame.canvas.getContext("2d"),r=this.pixelRatio;return this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),t!=this.options.width||e!=this.options.height||this.frame.style.width!=t||this.frame.style.height!=e?(this._getCameraState(r),this.frame.style.width=t,this.frame.style.height=e,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=t,this.options.height=e,i=!0):((this.frame.canvas.width!=Math.round(this.frame.canvas.clientWidth*this.pixelRatio)||this.frame.canvas.height!=Math.round(this.frame.canvas.clientHeight*this.pixelRatio))&&this._getCameraState(r),this.frame.canvas.width!=Math.round(this.frame.canvas.clientWidth*this.pixelRatio)&&(this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),i=!0),this.frame.canvas.height!=Math.round(this.frame.canvas.clientHeight*this.pixelRatio)&&(this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),i=!0)),i===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(o/this.pixelRatio),oldHeight:Math.round(n/this.pixelRatio)}),this._setCameraState()),i}},{key:"_XconvertDOMtoCanvas",value:function(t){return(t-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(t){return t*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(t){return(t-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(t){return t*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(t){return{x:this._XconvertCanvasToDOM(t.x),y:this._YconvertCanvasToDOM(t.y)}}},{key:"DOMtoCanvas",value:function(t){return{x:this._XconvertDOMtoCanvas(t.x),y:this._YconvertDOMtoCanvas(t.y)}}}]),t}();e["default"]=h,t.exports=e["default"]},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}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 s=function(){function t(t,e){for(var i=0;i.5*this.body.nodeIndices.length)return void this.fit(t,!1);i=a["default"]._getRange(this.body.nodes,t.nodes);var h=this.body.nodeIndices.length;o=12.662/(h+7.4147)+.0964822;var d=Math.min(this.canvas.frame.canvas.clientWidth/600,this.canvas.frame.canvas.clientHeight/600);o*=d}else{this.body.emitter.emit("_resizeNodes"),i=a["default"]._getRange(this.body.nodes,t.nodes);var l=1.1*Math.abs(i.maxX-i.minX),u=1.1*Math.abs(i.maxY-i.minY),c=this.canvas.frame.canvas.clientWidth/l,p=this.canvas.frame.canvas.clientHeight/u;o=p>=c?c:p}o>1?o=1:0===o&&(o=1);var f=a["default"]._findCenter(i),m={position:f,scale:o,animation:t.animation};this.moveTo(m)}},{key:"focus",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(void 0!==this.body.nodes[t]){var i={x:this.body.nodes[t].x,y:this.body.nodes[t].y};e.position=i,e.lockedOnNode=t,this.moveTo(e)}else console.log("Node: "+t+" cannot be found.")}},{key:"moveTo",value:function(t){return void 0===t?void(t={}):(void 0===t.offset&&(t.offset={x:0,y:0}),void 0===t.offset.x&&(t.offset.x=0),void 0===t.offset.y&&(t.offset.y=0),void 0===t.scale&&(t.scale=this.body.view.scale),void 0===t.position&&(t.position=this.getViewPosition()),void 0===t.animation&&(t.animation={duration:0}),t.animation===!1&&(t.animation={duration:0}),t.animation===!0&&(t.animation={}),void 0===t.animation.duration&&(t.animation.duration=1e3),void 0===t.animation.easingFunction&&(t.animation.easingFunction="easeInOutQuad"),void this.animateView(t))}},{key:"animateView",value:function(t){if(void 0!==t){this.animationEasingFunction=t.animation.easingFunction,this.releaseNode(),t.locked===!0&&(this.lockedOnNodeId=t.lockedOnNode,this.lockedOnNodeOffset=t.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=t.scale,this.body.view.scale=this.targetScale;var e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:e.x-t.position.x,y:e.y-t.position.y};this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+t.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+t.offset.y},0===t.animation.duration?void 0!=this.lockedOnNodeId?(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)):(this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw")):(this.animationSpeed=1/(60*t.animation.duration*.001)||1/60,this.animationEasingFunction=t.animation.easingFunction,this.viewFunction=this._transitionRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))}}},{key:"_lockedRedraw",value:function(){var t={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:e.x-t.x,y:e.y-t.y},o=this.body.view.translation,n={x:o.x+i.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:o.y+i.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=n}},{key:"releaseNode",value:function(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=t===!0?1:this.easingTime;var e=h.easingFunctions[this.animationEasingFunction](this.easingTime);this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*e,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*e,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*e},this.easingTime>=1&&(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,void 0!=this.lockedOnNodeId&&(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)),this.body.emitter.emit("animationFinished"))}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),t}();e["default"]=d,t.exports=e["default"]},function(t,e){function i(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(){function t(t,e){for(var i=0;i0)for(var a=0;ae.shape.boundingBox.left&&(s=e.shape.boundingBox.left),re.shape.boundingBox.top&&(o=e.shape.boundingBox.top),n0)for(var a=0;ae.x&&(s=e.x),re.y&&(o=e.y),n50&&(this.drag.pointer=this.getPointer(t.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}},{key:"onTap",value:function(t){var e=this.getPointer(t.center),i=this.selectionHandler.options.multiselect&&(t.changedPointers[0].ctrlKey||t.changedPointers[0].metaKey);this.checkSelectionChanges(e,t,i),this.selectionHandler._generateClickEvent("click",t,e)}},{key:"onDoubleTap",value:function(t){var e=this.getPointer(t.center);this.selectionHandler._generateClickEvent("doubleClick",t,e)}},{key:"onHold",value:function(t){var e=this.getPointer(t.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(e,t,i),this.selectionHandler._generateClickEvent("click",t,e),this.selectionHandler._generateClickEvent("hold",t,e)}},{key:"onRelease",value:function(t){if((new Date).valueOf()-this.touchTime>10){var e=this.getPointer(t.center);this.selectionHandler._generateClickEvent("release",t,e),this.touchTime=(new Date).valueOf()}}},{key:"onContext",value:function(t){var e=this.getPointer({x:t.clientX,y:t.clientY});this.selectionHandler._generateClickEvent("oncontext",t,e)}},{key:"checkSelectionChanges",value:function(t,e){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=this.selectionHandler._getSelectedEdgeCount(),n=this.selectionHandler._getSelectedNodeCount(),s=this.selectionHandler.getSelection(),r=void 0;r=i===!0?this.selectionHandler.selectAdditionalOnPoint(t):this.selectionHandler.selectOnPoint(t);var a=this.selectionHandler._getSelectedEdgeCount(),h=this.selectionHandler._getSelectedNodeCount(),d=this.selectionHandler.getSelection(),l=this._determineIfDifferent(s,d),u=l.nodesChanges,c=l.edgesChanges,p=!1;h-n>0?(this.selectionHandler._generateClickEvent("selectNode",e,t),r=!0,p=!0):0>h-n?(this.selectionHandler._generateClickEvent("deselectNode",e,t,s),r=!0):h===n&&u===!0&&(this.selectionHandler._generateClickEvent("deselectNode",e,t,s),this.selectionHandler._generateClickEvent("selectNode",e,t),p=!0,r=!0),a-o>0&&p===!1?(this.selectionHandler._generateClickEvent("selectEdge",e,t),r=!0):0>a-o?(this.selectionHandler._generateClickEvent("deselectEdge",e,t,s),r=!0):a===o&&c===!0&&(this.selectionHandler._generateClickEvent("deselectEdge",e,t,s),this.selectionHandler._generateClickEvent("selectEdge",e,t),r=!0),r===!0&&this.selectionHandler._generateClickEvent("select",e,t)}},{key:"_determineIfDifferent",value:function(t,e){for(var i=!1,o=!1,n=0;nt&&(t=1e-5),t>10&&(t=10);var o=void 0;void 0!==this.drag&&this.drag.dragging===!0&&(o=this.canvas.DOMtoCanvas(this.drag.pointer));var n=this.body.view.translation,s=t/i,r=(1-s)*e.x+n.x*s,a=(1-s)*e.y+n.y*s;if(this.body.view.scale=t,this.body.view.translation={x:r,y:a},void 0!=o){var h=this.canvas.canvasToDOM(o);this.drag.pointer.x=h.x,this.drag.pointer.y=h.y}this.body.emitter.emit("_requestRedraw"),t>i?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale})}}},{key:"onMouseWheel",value:function(t){var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),0!==e){var i=this.body.view.scale,o=e/10;0>e&&(o/=1-o),i*=1+o;var n=this.getPointer({x:t.clientX,y:t.clientY});this.zoom(i,n)}t.preventDefault()}},{key:"onMouseMove",value:function(t){var e=this,i=this.getPointer({x:t.clientX,y:t.clientY}),o=!1;if(void 0!==this.popup&&(this.popup.hidden===!1&&this._checkHidePopup(i),this.popup.hidden===!1&&(o=!0,this.popup.setPosition(i.x+3,i.y-5),this.popup.show())),this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),o===!1&&(void 0!==this.popupTimer&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=setTimeout(function(){return e._checkShowPopup(i)},this.options.tooltipDelay))),this.options.hover===!0){var n=this.selectionHandler.getNodeAt(i);void 0===n&&(n=this.selectionHandler.getEdgeAt(i)),this.selectionHandler.hoverObject(n)}}},{key:"_checkShowPopup",value:function(t){var e=this.canvas._XconvertDOMtoCanvas(t.x),i=this.canvas._YconvertDOMtoCanvas(t.y),o={left:e,top:i,right:e,bottom:i},n=void 0===this.popupObj?void 0:this.popupObj.id,s=!1,r="node";if(void 0===this.popupObj){for(var a=this.body.nodeIndices,h=this.body.nodes,l=void 0,u=[],c=0;c0&&(this.popupObj=h[u[u.length-1]],s=!0)}if(void 0===this.popupObj&&s===!1){for(var p=this.body.edgeIndices,f=this.body.edges,m=void 0,v=[],c=0;c0&&(this.popupObj=f[v[v.length-1]],r="edge")}void 0!==this.popupObj?this.popupObj.id!==n&&(void 0===this.popup&&(this.popup=new d["default"](this.canvas.frame)),this.popup.popupTargetType=r,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(t.x+3,t.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):void 0!==this.popup&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}},{key:"_checkHidePopup",value:function(t){var e=this.selectionHandler._pointerToPositionObject(t),i=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(e),i===!0)){var o=this.selectionHandler.getNodeAt(t);i=o.id===this.popup.popupTargetId}}else void 0===this.selectionHandler.getNodeAt(t)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(e));i===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),t}();e["default"]=u,t.exports=e["default"]},function(t,e,i){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 n=function(){function t(t,e){for(var i=0;i700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=(new Date).valueOf())}},{key:"_stopMovement",value:function(){for(var t in this.boundFunctions)this.boundFunctions.hasOwnProperty(t)&&(this.body.emitter.off("initRedraw",this.boundFunctions[t]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}},{key:"_moveUp",value:function(){this.body.view.translation.y+=this.options.keyboard.speed.y}},{key:"_moveDown",value:function(){this.body.view.translation.y-=this.options.keyboard.speed.y}},{key:"_moveLeft",value:function(){this.body.view.translation.x+=this.options.keyboard.speed.x}},{key:"_moveRight",value:function(){this.body.view.translation.x-=this.options.keyboard.speed.x}},{key:"_zoomIn",value:function(){this.body.view.scale*=1+this.options.keyboard.speed.zoom,this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale})}},{key:"_zoomOut",value:function(){this.body.view.scale/=1+this.options.keyboard.speed.zoom,this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale})}},{key:"configureKeyboardBindings",value:function(){var t=this;void 0!==this.keycharm&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=a({
+container:window,preventDefault:!0}):this.keycharm=a({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0&&(this.keycharm.bind("up",function(){t.bindToRedraw("_moveUp")},"keydown"),this.keycharm.bind("down",function(){t.bindToRedraw("_moveDown")},"keydown"),this.keycharm.bind("left",function(){t.bindToRedraw("_moveLeft")},"keydown"),this.keycharm.bind("right",function(){t.bindToRedraw("_moveRight")},"keydown"),this.keycharm.bind("=",function(){t.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num+",function(){t.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num-",function(){t.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("-",function(){t.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("[",function(){t.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("]",function(){t.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pageup",function(){t.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pagedown",function(){t.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("up",function(){t.unbindFromRedraw("_moveUp")},"keyup"),this.keycharm.bind("down",function(){t.unbindFromRedraw("_moveDown")},"keyup"),this.keycharm.bind("left",function(){t.unbindFromRedraw("_moveLeft")},"keyup"),this.keycharm.bind("right",function(){t.unbindFromRedraw("_moveRight")},"keyup"),this.keycharm.bind("=",function(){t.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num+",function(){t.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num-",function(){t.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("-",function(){t.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("[",function(){t.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("]",function(){t.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pageup",function(){t.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pagedown",function(){t.unbindFromRedraw("_zoomOut")},"keyup")))}}]),t}();e["default"]=h,t.exports=e["default"]},function(t,e){function i(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(){function t(t,e){for(var i=0;io&&(s=o-e-this.padding),sn&&(r=n-i-this.padding),r0?e===!0?this.body.nodes[o[o.length-1]]:o[o.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(t,e){for(var i=this.body.edges,o=0;o0?e===!0?this.body.edges[o[o.length-1]]:o[o.length-1]:void 0}},{key:"_addToSelection",value:function(t){t instanceof s?this.selectionObj.nodes[t.id]=t:this.selectionObj.edges[t.id]=t}},{key:"_addToHover",value:function(t){t instanceof s?this.hoverObj.nodes[t.id]=t:this.hoverObj.edges[t.id]=t}},{key:"_removeFromSelection",value:function(t){t instanceof s?delete this.selectionObj.nodes[t.id]:delete this.selectionObj.edges[t.id]}},{key:"unselectAll",value:function(){for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&this.selectionObj.nodes[t].unselect();for(var e in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(e)&&this.selectionObj.edges[e].unselect();this.selectionObj={nodes:{},edges:{}}}},{key:"_getSelectedNodeCount",value:function(){var t=0;for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&(t+=1);return t}},{key:"_getSelectedNode",value:function(){for(var t in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(t))return this.selectionObj.nodes[t];return void 0}},{key:"_getSelectedEdge",value:function(){for(var t in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(t))return this.selectionObj.edges[t];return void 0}},{key:"_getSelectedEdgeCount",value:function(){var t=0;for(var e in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(e)&&(t+=1);return t}},{key:"_getSelectedObjectCount",value:function(){var t=0;for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&(t+=1);for(var i in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(i)&&(t+=1);return t}},{key:"_selectionIsEmpty",value:function(){for(var t in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(t))return!1;for(var e in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(e))return!1;return!0}},{key:"_clusterInSelection",value:function(){for(var t in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(t)&&this.selectionObj.nodes[t].clusterSize>1)return!0;return!1}},{key:"_selectConnectedEdges",value:function(t){for(var e=0;e0&&(this.options.hierarchical.levelSeparation*=-1):this.options.hierarchical.levelSeparation<0&&(this.options.hierarchical.levelSeparation*=-1),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptions(e);if(i===!0)return this.body.emitter.emit("refresh"),h.deepExtend(e,this.optionsBackup)}return e}},{key:"adaptAllOptions",value:function(t){if(this.options.hierarchical.enabled===!0){void 0===t.physics||t.physics===!0?(t.physics={solver:"hierarchicalRepulsion"},this.optionsBackup.physics={solver:"barnesHut"}):"object"==typeof t.physics?(this.optionsBackup.physics={solver:"barnesHut"},void 0!==t.physics.solver&&(this.optionsBackup.physics={solver:t.physics.solver}),t.physics.solver="hierarchicalRepulsion"):t.physics!==!1&&(this.optionsBackup.physics={solver:"barnesHut"},t.physics.solver="hierarchicalRepulsion");var e="horizontal";("RL"===this.options.hierarchical.direction||"LR"===this.options.hierarchical.direction)&&(e="vertical"),void 0===t.edges?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},t.edges={smooth:!1}):void 0===t.edges.smooth?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},t.edges.smooth=!1):"boolean"==typeof t.edges.smooth?(this.optionsBackup.edges={smooth:t.edges.smooth},t.edges.smooth={enabled:t.edges.smooth,type:e}):(void 0!==t.edges.smooth.type&&"dynamic"!==t.edges.smooth.type&&(e=t.edges.smooth.type),this.optionsBackup.edges={smooth:void 0===t.edges.smooth.enabled?!0:t.edges.smooth.enabled,type:void 0===t.edges.smooth.type?"dynamic":t.edges.smooth.type,roundness:void 0===t.edges.smooth.roundness?.5:t.edges.smooth.roundness,forceDirection:void 0===t.edges.smooth.forceDirection?!1:t.edges.smooth.forceDirection},t.edges.smooth={enabled:void 0===t.edges.smooth.enabled?!0:t.edges.smooth.enabled,type:e,roundness:void 0===t.edges.smooth.roundness?.5:t.edges.smooth.roundness,forceDirection:void 0===t.edges.smooth.forceDirection?!1:t.edges.smooth.forceDirection}),this.body.emitter.emit("_forceDisableDynamicCurves",e)}return t}},{key:"seededRandom",value:function(){var t=1e4*Math.sin(this.randomSeed++);return t-Math.floor(t)}},{key:"positionInitially",value:function(t){if(this.options.hierarchical.enabled!==!0){this.randomSeed=this.initialRandomSeed;for(var e=0;es){for(var r=this.body.nodeIndices.length;this.body.nodeIndices.length>s;){n+=1;var a=this.body.nodeIndices.length;n%3===0?this.body.modules.clustering.clusterBridges():this.body.modules.clustering.clusterOutliers();var h=this.body.nodeIndices.length;if(a==h&&n%3!==0||n>o)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*r)})}this.body.modules.kamadaKawai.solve(this.body.nodeIndices,this.body.edgeIndices,!0),this._shiftToCenter();for(var d=70,e=0;e0){var t=void 0,e=void 0,i=!1,o=!1;this.hierarchicalLevels={},this.nodeSpacing=100;for(e in this.body.nodes)this.body.nodes.hasOwnProperty(e)&&(t=this.body.nodes[e],void 0!==t.options.level?(i=!0,this.hierarchicalLevels[e]=t.options.level):o=!0);if(o===!0&&i===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");o===!0&&("hubsize"===this.options.hierarchical.sortMethod?this._determineLevelsByHubsize():("directed"===this.options.hierarchical.sortMethod,this._determineLevelsDirected()));var n=this._getDistribution();this._placeNodesByHierarchy(n)}}},{key:"_placeNodesByHierarchy",value:function(t){var e=void 0,i=void 0;this.positionedNodes={};for(var o in t)if(t.hasOwnProperty(o))for(e in t[o].nodes)t[o].nodes.hasOwnProperty(e)&&(i=t[o].nodes[e],"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?(void 0===i.x&&(i.x=t[o].distance),t[o].distance=i.x+this.nodeSpacing):(void 0===i.y&&(i.y=t[o].distance),t[o].distance=i.y+this.nodeSpacing),this.positionedNodes[e]=!0,this._placeBranchNodes(i.edges,i.id,t,o))}},{key:"_getDistribution",value:function(){var t={},e=void 0,i=void 0;for(e in this.body.nodes)if(this.body.nodes.hasOwnProperty(e)){i=this.body.nodes[e];var o=void 0===this.hierarchicalLevels[e]?0:this.hierarchicalLevels[e];"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?(i.y=this.options.hierarchical.levelSeparation*o,i.options.fixed.y=!0):(i.x=this.options.hierarchical.levelSeparation*o,i.options.fixed.x=!0),void 0===t[o]&&(t[o]={amount:0,nodes:{},distance:0}),t[o].amount+=1,t[o].nodes[e]=i}return t}},{key:"_getHubSize",value:function(){var t=0;for(var e in this.body.nodes)if(this.body.nodes.hasOwnProperty(e)){var i=this.body.nodes[e];void 0===this.hierarchicalLevels[e]&&(t=i.edges.length0&&(i=this._getHubSize(),0!==i);)for(t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&(e=this.body.nodes[t],e.edges.length===i&&this._setLevelByHubsize(0,e))}},{key:"_setLevelByHubsize",value:function(t,e){if(void 0===this.hierarchicalLevels[e.id]){var i=void 0;this.hierarchicalLevels[e.id]=t;for(var o=0;oo&&("UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?(void 0===s.x&&(s.x=Math.max(i[a].distance,r.x)),i[a].distance=s.x+this.nodeSpacing,this.positionedNodes[s.id]=!0):(void 0===s.y&&(s.y=Math.max(i[a].distance,r.y)),i[a].distance=s.y+this.nodeSpacing),this.positionedNodes[s.id]=!0,s.edges.length>1&&this._placeBranchNodes(s.edges,s.id,i,a))}}}]),t}();e["default"]=d,t.exports=e["default"]},function(t,e,i){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 n=function(){function t(t,e){for(var i=0;i0&&this.options.deleteNode!==!1?(n===!0&&this._createSeperator(4),this._createDeleteButton(o)):0===t&&this.options.deleteEdge!==!1&&(n===!0&&this._createSeperator(4),this._createDeleteButton(o))),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this)),this._temporaryBindEvent("select",this.showManipulatorToolbar.bind(this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.addDescription||this.options.locales.en.addDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindEvent("click",this._performAddNode.bind(this))}},{key:"editNode",value:function(){var t=this;this.editMode!==!0&&this.enableEditMode(),this._clean();var e=this.selectionHandler._getSelectedNode();if(void 0!==e){if(this.inMode="editNode","function"!=typeof this.options.editNode)throw new Error("No function has been configured to handle the editing of nodes.");if(e.isCluster!==!0){var i=s.deepExtend({},e.options,!0);if(i.x=e.x,i.y=e.y,2!==this.options.editNode.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editNode(i,function(e){null!==e&&void 0!==e&&"editNode"===t.inMode&&t.body.data.nodes.getDataSet().update(e),t.showManipulatorToolbar()})}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.edgeDescription||this.options.locales.en.edgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindUI("onTouch",this._handleConnect.bind(this)),this._temporaryBindUI("onDragEnd",this._finishConnect.bind(this)),this._temporaryBindUI("onDrag",this._dragControlNode.bind(this)),this._temporaryBindUI("onRelease",this._finishConnect.bind(this)),this._temporaryBindUI("onDragStart",function(){}),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){var t=this;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",this.guiEnabled===!0){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId?!function(){var e=t.body.edges[t.edgeBeingEditedId],i=t._getNewTargetNode(e.from.x,e.from.y),o=t._getNewTargetNode(e.to.x,e.to.y);t.temporaryIds.nodes.push(i.id),t.temporaryIds.nodes.push(o.id),t.body.nodes[i.id]=i,t.body.nodeIndices.push(i.id),t.body.nodes[o.id]=o,t.body.nodeIndices.push(o.id),t._temporaryBindUI("onTouch",t._controlNodeTouch.bind(t)),t._temporaryBindUI("onTap",function(){}),t._temporaryBindUI("onHold",function(){}),t._temporaryBindUI("onDragStart",t._controlNodeDragStart.bind(t)),t._temporaryBindUI("onDrag",t._controlNodeDrag.bind(t)),t._temporaryBindUI("onDragEnd",t._controlNodeDragEnd.bind(t)),t._temporaryBindUI("onMouseMove",function(){}),t._temporaryBindEvent("beforeDrawing",function(t){var n=e.edgeType.findBorderPositions(t);i.selected===!1&&(i.x=n.from.x,i.y=n.from.y),o.selected===!1&&(o.x=n.to.x,o.y=n.to.y)}),t.body.emitter.emit("_redraw")}():this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var t=this;this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";var e=this.selectionHandler.getSelectedNodes(),i=this.selectionHandler.getSelectedEdges(),o=void 0;if(e.length>0){for(var n=0;n0&&"function"==typeof this.options.deleteEdge&&(o=this.options.deleteEdge);if("function"==typeof o){var s={nodes:e,edges:i};if(2!==o.length)throw new Error("The function for delete does not support two arguments (data, callback)");o(s,function(e){null!==e&&void 0!==e&&"delete"===t.inMode?(t.body.data.edges.getDataSet().remove(e.edges),t.body.data.nodes.getDataSet().remove(e.nodes),t.body.emitter.emit("startSimulation"),t.showManipulatorToolbar()):(t.body.emitter.emit("startSimulation"),t.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().remove(i),this.body.data.nodes.getDataSet().remove(e),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv&&(this.closeDiv=document.createElement("div"),this.closeDiv.className="vis-close",this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}},{key:"_getNewTargetNode",value:function(t,e){var i=s.deepExtend({},this.options.controlNodeStyle);return i.id="targetNode"+s.randomUUID(),i.hidden=!1,i.physics=!1,i.x=t,i.y=e,this.body.functions.createNode(i)}},{key:"_createEditButton",value:function(){this._clean(),this.manipulationDOM={},s.recursiveDOMDelete(this.editModeDiv);var t=this.options.locales[this.options.locale],e=this._createButton("editMode","vis-button vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(e),this._bindHammerToDiv(e,this.toggleEditMode.bind(this))}},{key:"_clean",value:function(){this.inMode=!1,this.guiEnabled===!0&&(s.recursiveDOMDelete(this.editModeDiv),s.recursiveDOMDelete(this.manipulationDiv),this._cleanManipulatorHammers()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanManipulatorHammers",
+value:function(){if(0!=this.manipulationHammers.length){for(var t=0;t=0;r--)if(n[r]!==this.selectedControlNode.id){s=this.body.nodes[n[r]];break}if(void 0!==s&&void 0!==this.selectedControlNode)if(s.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var a=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===a.id?this._performEditEdge(s.id,o.to.id):this._performEditEdge(o.from.id,s.id)}else o.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(t){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(t.center),this.lastTouch.translation=s.extend({},this.body.view.translation);var e=this.lastTouch,i=this.selectionHandler.getNodeAt(e);if(void 0!==i)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var o=this._getNewTargetNode(i.x,i.y);this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id);var n=this.body.functions.createEdge({id:"connectionEdge"+s.randomUUID(),from:i.id,to:o.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[n.id]=n,this.body.edgeIndices.push(n.id),this.temporaryIds.nodes.push(o.id),this.temporaryIds.edges.push(n.id)}this.touchTime=(new Date).valueOf()}}},{key:"_dragControlNode",value:function(t){var e=this.body.functions.getPointer(t.center);if(void 0!==this.temporaryIds.nodes[0]){var i=this.body.nodes[this.temporaryIds.nodes[0]];i.x=this.canvas._XconvertDOMtoCanvas(e.x),i.y=this.canvas._YconvertDOMtoCanvas(e.y),this.body.emitter.emit("_redraw")}else{var o=e.x-this.lastTouch.x,n=e.y-this.lastTouch.y;this.body.view.translation={x:this.lastTouch.translation.x+o,y:this.lastTouch.translation.y+n}}}},{key:"_finishConnect",value:function(t){var e=this.body.functions.getPointer(t.center),i=this.selectionHandler._pointerToPositionObject(e),o=void 0;void 0!==this.temporaryIds.edges[0]&&(o=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var n=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,r=n.length-1;r>=0;r--)if(-1===this.temporaryIds.nodes.indexOf(n[r])){s=this.body.nodes[n[r]];break}this._cleanupTemporaryNodesAndEdges(),void 0!==s&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[o]&&void 0!==this.body.nodes[s.id]&&this._performAddEdge(o,s.id)),this.body.emitter.emit("_redraw")}},{key:"_performAddNode",value:function(t){var e=this,i={id:s.randomUUID(),x:t.pointer.canvas.x,y:t.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(i,function(t){null!==t&&void 0!==t&&"addNode"===e.inMode&&(e.body.data.nodes.getDataSet().add(t),e.showManipulatorToolbar())})}else this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(t,e){var i=this,o={from:t,to:e};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(o,function(t){null!==t&&void 0!==t&&"addEdge"===i.inMode&&(i.body.data.edges.getDataSet().add(t),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().add(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(t,e){var i=this,o={id:this.edgeBeingEditedId,from:t,to:e};if("function"==typeof this.options.editEdge){if(2!==this.options.editEdge.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editEdge(o,function(t){null===t||void 0===t||"editEdge"!==i.inMode?(i.body.edges[o.id].updateEdgeType(),i.body.emitter.emit("_redraw")):(i.body.data.edges.getDataSet().update(t),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().update(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),t}();e["default"]=h,t.exports=e["default"]},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i="string",o="boolean",n="number",s="array",r="object",a="dom",h="any",d={configure:{enabled:{"boolean":o},filter:{"boolean":o,string:i,array:s,"function":"function"},container:{dom:a},showButton:{"boolean":o},__type__:{object:r,"boolean":o,string:i,array:s,"function":"function"}},edges:{arrows:{to:{enabled:{"boolean":o},scaleFactor:{number:n},__type__:{object:r,"boolean":o}},middle:{enabled:{"boolean":o},scaleFactor:{number:n},__type__:{object:r,"boolean":o}},from:{enabled:{"boolean":o},scaleFactor:{number:n},__type__:{object:r,"boolean":o}},__type__:{string:["from","to","middle"],object:r}},color:{color:{string:i},highlight:{string:i},hover:{string:i},inherit:{string:["from","to","both"],"boolean":o},opacity:{number:n},__type__:{object:r,string:i}},dashes:{"boolean":o,array:s},font:{color:{string:i},size:{number:n},face:{string:i},background:{string:i},strokeWidth:{number:n},strokeColor:{string:i},align:{string:["horizontal","top","middle","bottom"]},__type__:{object:r,string:i}},hidden:{"boolean":o},hoverWidth:{"function":"function",number:n},label:{string:i,undefined:"undefined"},labelHighlightBold:{"boolean":o},length:{number:n,undefined:"undefined"},physics:{"boolean":o},scaling:{min:{number:n},max:{number:n},label:{enabled:{"boolean":o},min:{number:n},max:{number:n},maxVisible:{number:n},drawThreshold:{number:n},__type__:{object:r,"boolean":o}},customScalingFunction:{"function":"function"},__type__:{object:r}},selectionWidth:{"function":"function",number:n},selfReferenceSize:{number:n},shadow:{enabled:{"boolean":o},size:{number:n},x:{number:n},y:{number:n},__type__:{object:r,"boolean":o}},smooth:{enabled:{"boolean":o},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:n},forceDirection:{string:["horizontal","vertical","none"],"boolean":o},__type__:{object:r,"boolean":o}},title:{string:i,undefined:"undefined"},width:{number:n},value:{number:n,undefined:"undefined"},__type__:{object:r}},groups:{useDefaultGroups:{"boolean":o},__any__:"get from nodes, will be overwritten below",__type__:{object:r}},interaction:{dragNodes:{"boolean":o},dragView:{"boolean":o},hideEdgesOnDrag:{"boolean":o},hideNodesOnDrag:{"boolean":o},hover:{"boolean":o},keyboard:{enabled:{"boolean":o},speed:{x:{number:n},y:{number:n},zoom:{number:n},__type__:{object:r}},bindToWindow:{"boolean":o},__type__:{object:r,"boolean":o}},multiselect:{"boolean":o},navigationButtons:{"boolean":o},selectable:{"boolean":o},selectConnectedEdges:{"boolean":o},hoverConnectedEdges:{"boolean":o},tooltipDelay:{number:n},zoomView:{"boolean":o},__type__:{object:r}},layout:{randomSeed:{undefined:"undefined",number:n},improvedLayout:{"boolean":o},hierarchical:{enabled:{"boolean":o},levelSeparation:{number:n},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},__type__:{object:r,"boolean":o}},__type__:{object:r}},manipulation:{enabled:{"boolean":o},initiallyActive:{"boolean":o},addNode:{"boolean":o,"function":"function"},addEdge:{"boolean":o,"function":"function"},editNode:{"function":"function"},editEdge:{"boolean":o,"function":"function"},deleteNode:{"boolean":o,"function":"function"},deleteEdge:{"boolean":o,"function":"function"},controlNodeStyle:"get from nodes, will be overwritten below",__type__:{object:r,"boolean":o}},nodes:{borderWidth:{number:n},borderWidthSelected:{number:n,undefined:"undefined"},brokenImage:{string:i,undefined:"undefined"},color:{border:{string:i},background:{string:i},highlight:{border:{string:i},background:{string:i},__type__:{object:r,string:i}},hover:{border:{string:i},background:{string:i},__type__:{object:r,string:i}},__type__:{object:r,string:i}},fixed:{x:{"boolean":o},y:{"boolean":o},__type__:{object:r,"boolean":o}},font:{color:{string:i},size:{number:n},face:{string:i},background:{string:i},strokeWidth:{number:n},strokeColor:{string:i},__type__:{object:r,string:i}},group:{string:i,number:n,undefined:"undefined"},hidden:{"boolean":o},icon:{face:{string:i},code:{string:i},size:{number:n},color:{string:i},__type__:{object:r}},id:{string:i,number:n},image:{string:i,undefined:"undefined"},label:{string:i,undefined:"undefined"},labelHighlightBold:{"boolean":o},level:{number:n,undefined:"undefined"},mass:{number:n},physics:{"boolean":o},scaling:{min:{number:n},max:{number:n},label:{enabled:{"boolean":o},min:{number:n},max:{number:n},maxVisible:{number:n},drawThreshold:{number:n},__type__:{object:r,"boolean":o}},customScalingFunction:{"function":"function"},__type__:{object:r}},shadow:{enabled:{"boolean":o},size:{number:n},x:{number:n},y:{number:n},__type__:{object:r,"boolean":o}},shape:{string:["ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon"]},shapeProperties:{borderDashes:{"boolean":o,array:s},borderRadius:{number:n},useImageSize:{"boolean":o},useBorderWithImage:{"boolean":o},__type__:{object:r}},size:{number:n},title:{string:i,undefined:"undefined"},value:{number:n,undefined:"undefined"},x:{number:n},y:{number:n},__type__:{object:r}},physics:{enabled:{"boolean":o},barnesHut:{gravitationalConstant:{number:n},centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},damping:{number:n},avoidOverlap:{number:n},__type__:{object:r}},forceAtlas2Based:{gravitationalConstant:{number:n},centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},damping:{number:n},avoidOverlap:{number:n},__type__:{object:r}},repulsion:{centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},nodeDistance:{number:n},damping:{number:n},__type__:{object:r}},hierarchicalRepulsion:{centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},nodeDistance:{number:n},damping:{number:n},__type__:{object:r}},maxVelocity:{number:n},minVelocity:{number:n},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{"boolean":o},iterations:{number:n},updateInterval:{number:n},onlyDynamicEdges:{"boolean":o},fit:{"boolean":o},__type__:{object:r,"boolean":o}},timestep:{number:n},adaptiveTimestep:{"boolean":o},__type__:{object:r,"boolean":o}},autoResize:{"boolean":o},clickToUse:{"boolean":o},locale:{string:i},locales:{__any__:{any:h},__type__:{object:r}},height:{string:i},width:{string:i},__type__:{object:r}};d.groups.__any__=d.nodes,d.manipulation.controlNodeStyle=d.nodes;var l={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05]},middle:{enabled:!1,scaleFactor:[1,0,3,.05]},from:{enabled:!1,scaleFactor:[1,0,3,.05]}},color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],shadow:{enabled:!1,size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01]},global:{locale:["en","nl"]}};e.allOptions=d,e.configureOptions=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{"default":t}}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 s=function(){function t(t,e){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=function(){function t(t,e){for(var i=0;in&&h>a;){a+=1;var v=this._getHighestEnergyNode(i),g=s(v,4);for(u=g[0],l=g[1],c=g[2],p=g[3],f=l,m=0;f>r&&d>m;){m+=1,this._moveNode(u,c,p);var y=this._getEnergy(u),b=s(y,3);f=b[0],c=b[1],p=b[2]}}}},{key:"_getHighestEnergyNode",value:function(t){for(var e=this.body.nodeIndices,i=this.body.nodes,o=0,n=e[0],r=0,a=0,h=0;ho&&(o=c,n=d,r=p,a=f)}}return[n,o,r,a]}},{key:"_getEnergy",value:function(t){for(var e=this.body.nodeIndices,i=this.body.nodes,o=i[t].x,n=i[t].y,s=0,r=0,a=0;ad;d++)for(var s=0;h-1>s;s++)for(var r=s+1;h>r;r++)o[e[s]][e[r]]=Math.min(o[e[s]][e[r]],o[e[s]][e[d]]+o[e[d]][e[r]]),o[e[r]][e[s]]=o[e[s]][e[r]];return o}}]),t}();e["default"]=n,t.exports=e["default"]},function(t,e){"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.circle=function(t,e,i){this.beginPath(),this.arc(t,e,i,0,2*Math.PI,!1),this.closePath()},CanvasRenderingContext2D.prototype.square=function(t,e,i){this.beginPath(),this.rect(t-i,e-i,2*i,2*i),this.closePath()},CanvasRenderingContext2D.prototype.triangle=function(t,e,i){this.beginPath(),i*=1.15,e+=.275*i;var o=2*i,n=o/2,s=Math.sqrt(3)/6*o,r=Math.sqrt(o*o-n*n);this.moveTo(t,e-(r-s)),this.lineTo(t+n,e+s),this.lineTo(t-n,e+s),this.lineTo(t,e-(r-s)),this.closePath()},CanvasRenderingContext2D.prototype.triangleDown=function(t,e,i){this.beginPath(),i*=1.15,e-=.275*i;var o=2*i,n=o/2,s=Math.sqrt(3)/6*o,r=Math.sqrt(o*o-n*n);this.moveTo(t,e+(r-s)),this.lineTo(t+n,e-s),this.lineTo(t-n,e-s),this.lineTo(t,e+(r-s)),this.closePath()},CanvasRenderingContext2D.prototype.star=function(t,e,i){this.beginPath(),i*=.82,e+=.1*i;for(var o=0;10>o;o++){var n=o%2===0?1.3*i:.5*i;this.lineTo(t+n*Math.sin(2*o*Math.PI/10),e-n*Math.cos(2*o*Math.PI/10))}this.closePath()},CanvasRenderingContext2D.prototype.diamond=function(t,e,i){this.beginPath(),this.lineTo(t,e+i),this.lineTo(t+i,e),this.lineTo(t,e-i),this.lineTo(t-i,e),this.closePath()},CanvasRenderingContext2D.prototype.roundRect=function(t,e,i,o,n){var s=Math.PI/180;0>i-2*n&&(n=i/2),0>o-2*n&&(n=o/2),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-n,e),this.arc(t+i-n,e+n,n,270*s,360*s,!1),this.lineTo(t+i,e+o-n),this.arc(t+i-n,e+o-n,n,0,90*s,!1),this.lineTo(t+n,e+o),this.arc(t+n,e+o-n,n,90*s,180*s,!1),this.lineTo(t,e+n),this.arc(t+n,e+n,n,180*s,270*s,!1),this.closePath()},CanvasRenderingContext2D.prototype.ellipse=function(t,e,i,o){var n=.5522848,s=i/2*n,r=o/2*n,a=t+i,h=e+o,d=t+i/2,l=e+o/2;this.beginPath(),this.moveTo(t,l),this.bezierCurveTo(t,l-r,d-s,e,d,e),this.bezierCurveTo(d+s,e,a,l-r,a,l),this.bezierCurveTo(a,l+r,d+s,h,d,h),this.bezierCurveTo(d-s,h,t,l+r,t,l),this.closePath()},CanvasRenderingContext2D.prototype.database=function(t,e,i,o){var n=1/3,s=i,r=o*n,a=.5522848,h=s/2*a,d=r/2*a,l=t+s,u=e+r,c=t+s/2,p=e+r/2,f=e+(o-r/2),m=e+o;this.beginPath(),this.moveTo(l,p),this.bezierCurveTo(l,p+d,c+h,u,c,u),this.bezierCurveTo(c-h,u,t,p+d,t,p),this.bezierCurveTo(t,p-d,c-h,e,c,e),this.bezierCurveTo(c+h,e,l,p-d,l,p),this.lineTo(l,f),this.bezierCurveTo(l,f+d,c+h,m,c,m),this.bezierCurveTo(c-h,m,t,f+d,t,f),this.lineTo(t,p)},CanvasRenderingContext2D.prototype.arrow=function(t,e,i,o){var n=t-o*Math.cos(i),s=e-o*Math.sin(i),r=t-.9*o*Math.cos(i),a=e-.9*o*Math.sin(i),h=n+o/3*Math.cos(i+.5*Math.PI),d=s+o/3*Math.sin(i+.5*Math.PI),l=n+o/3*Math.cos(i-.5*Math.PI),u=s+o/3*Math.sin(i-.5*Math.PI);this.beginPath(),this.moveTo(t,e),this.lineTo(h,d),this.lineTo(r,a),this.lineTo(l,u),this.closePath()},CanvasRenderingContext2D.prototype.dashedLine=function(t,e,i,o,n){this.beginPath(),this.moveTo(t,e);for(var s=n.length,r=i-t,a=o-e,h=a/r,d=Math.sqrt(r*r+a*a),l=0,u=!0,c=0,p=n[0];d>=.1;)p=n[l++%s],p>d&&(p=d),c=Math.sqrt(p*p/(1+h*h)),c=0>r?-c:c,t+=c,e+=h*c,u===!0?this.lineTo(t,e):this.moveTo(t,e),d-=p,u=!u})},function(t,e){function i(t){return P=t,p()}function o(){I=0,z=P.charAt(0)}function n(){I++,z=P.charAt(I)}function s(){return P.charAt(I+1)}function r(t){return A.test(t)}function a(t,e){if(t||(t={}),e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function h(t,e,i){for(var o=e.split("."),n=t;o.length;){var s=o.shift();o.length?(n[s]||(n[s]={}),n=n[s]):n[s]=i}}function d(t,e){for(var i,o,n=null,s=[t],r=t;r.parent;)s.push(r.parent),r=r.parent;if(r.nodes)for(i=0,o=r.nodes.length;o>i;i++)if(e.id===r.nodes[i].id){n=r.nodes[i];break}for(n||(n={id:e.id},t.node&&(n.attr=a(n.attr,t.node))),i=s.length-1;i>=0;i--){var h=s[i];h.nodes||(h.nodes=[]),-1===h.nodes.indexOf(n)&&h.nodes.push(n)}e.attr&&(n.attr=a(n.attr,e.attr))}function l(t,e){if(t.edges||(t.edges=[]),t.edges.push(e),t.edge){var i=a({},t.edge);e.attr=a(i,e.attr)}}function u(t,e,i,o,n){var s={from:e,to:i,type:o};return t.edge&&(s.attr=a({},t.edge)),s.attr=a(s.attr||{},n),s}function c(){for(L=E.NULL,N="";" "===z||" "===z||"\n"===z||"\r"===z;)n();do{var t=!1;if("#"===z){for(var e=I-1;" "===P.charAt(e)||" "===P.charAt(e);)e--;if("\n"===P.charAt(e)||""===P.charAt(e)){for(;""!=z&&"\n"!=z;)n();t=!0}}if("/"===z&&"/"===s()){for(;""!=z&&"\n"!=z;)n();t=!0}if("/"===z&&"*"===s()){for(;""!=z;){if("*"===z&&"/"===s()){n(),n();break}n()}t=!0}for(;" "===z||" "===z||"\n"===z||"\r"===z;)n()}while(t);if(""===z)return void(L=E.DELIMITER);var i=z+s();if(S[i])return L=E.DELIMITER,N=i,n(),void n();if(S[z])return L=E.DELIMITER,N=z,void n();if(r(z)||"-"===z){for(N+=z,n();r(z);)N+=z,n();return"false"===N?N=!1:"true"===N?N=!0:isNaN(Number(N))||(N=Number(N)),void(L=E.IDENTIFIER)}if('"'===z){for(n();""!=z&&('"'!=z||'"'===z&&'"'===s());)N+=z,'"'===z&&n(),n();if('"'!=z)throw _('End of string " expected');return n(),void(L=E.IDENTIFIER)}for(L=E.UNKNOWN;""!=z;)N+=z,n();throw new SyntaxError('Syntax error in part "'+x(N,30)+'"')}function p(){var t={};if(o(),c(),"strict"===N&&(t.strict=!0,c()),("graph"===N||"digraph"===N)&&(t.type=N,c()),L===E.IDENTIFIER&&(t.id=N,c()),"{"!=N)throw _("Angle bracket { expected");if(c(),f(t),"}"!=N)throw _("Angle bracket } expected");if(c(),""!==N)throw _("End of file expected");return c(),delete t.node,delete t.edge,delete t.graph,t}function f(t){for(;""!==N&&"}"!=N;)m(t),";"===N&&c()}function m(t){var e=v(t);if(e)return void b(t,e);var i=g(t);if(!i){if(L!=E.IDENTIFIER)throw _("Identifier expected");var o=N;if(c(),"="===N){if(c(),L!=E.IDENTIFIER)throw _("Identifier expected");t[o]=N,c()}else y(t,o)}}function v(t){var e=null;if("subgraph"===N&&(e={},e.type="subgraph",c(),L===E.IDENTIFIER&&(e.id=N,c())),"{"===N){if(c(),e||(e={}),e.parent=t,e.node=t.node,e.edge=t.edge,e.graph=t.graph,f(e),"}"!=N)throw _("Angle bracket } expected");c(),delete e.node,delete e.edge,delete e.graph,delete e.parent,t.subgraphs||(t.subgraphs=[]),t.subgraphs.push(e)}return e}function g(t){return"node"===N?(c(),t.node=w(),"node"):"edge"===N?(c(),t.edge=w(),"edge"):"graph"===N?(c(),t.graph=w(),"graph"):null}function y(t,e){var i={id:e},o=w();o&&(i.attr=o),d(t,i),b(t,e)}function b(t,e){for(;"->"===N||"--"===N;){var i,o=N;c();var n=v(t);if(n)i=n;else{if(L!=E.IDENTIFIER)throw _("Identifier or subgraph expected");i=N,d(t,{id:i}),c()}var s=w(),r=u(t,e,i,o,s);l(t,r),e=i}}function w(){for(var t=null;"["===N;){for(c(),t={};""!==N&&"]"!=N;){if(L!=E.IDENTIFIER)throw _("Attribute name expected");var e=N;if(c(),"="!=N)throw _("Equal sign = expected");if(c(),L!=E.IDENTIFIER)throw _("Attribute value expected");var i=N;h(t,e,i),c(),","==N&&c()}if("]"!=N)throw _("Bracket ] expected");c()}return t}function _(t){return new SyntaxError(t+', got "'+x(N,30)+'" (char '+I+")")}function x(t,e){return t.length<=e?t:t.substr(0,27)+"..."}function k(t,e,i){Array.isArray(t)?t.forEach(function(t){Array.isArray(e)?e.forEach(function(e){i(t,e)}):i(t,e)}):Array.isArray(e)?e.forEach(function(e){i(t,e)}):i(t,e)}function O(t,e,i){for(var o=e.split("."),n=o.pop(),s=t,r=0;r"===t.type?"to":void 0,e};e.edges.forEach(function(t){var e,i;e=t.from instanceof Object?t.from.nodes:{id:t.from},i=t.to instanceof Object?t.to.nodes:{id:t.to},t.from instanceof Object&&t.from.edges&&t.from.edges.forEach(function(t){var e=n(t);o.edges.push(e)}),k(e,i,function(e,i){var s=u(o,e.id,i.id,t.type,t.attr),r=n(s);o.edges.push(r)}),t.to instanceof Object&&t.to.edges&&t.to.edges.forEach(function(t){var e=n(t);o.edges.push(e)})})}return e.attr&&(o.options=e.attr),o}var C={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},T=Object.create(C);T.color="color.color";var E={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},S={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},P="",I=0,z="",N="",L=E.NULL,A=/[a-zA-Z_0-9.:#]/;e.parseDOT=i,e.DOTToGraph=M},function(t,e){function i(t,e){var i=[],o=[],n={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};void 0!==e&&(void 0!==e.fixed&&(n.nodes.fixed=e.fixed),void 0!==e.parseColor&&(n.nodes.parseColor=e.parseColor),void 0!==e.inheritColor&&(n.edges.inheritColor=e.inheritColor));for(var s=t.edges,r=t.nodes,a=0;a
{% regroup shifts_in_place.list by facility as shifts_by_facility %}
+ {# TODO: Include template partials/compact_facility.html #}
{% for shifts_in_facility in shifts_by_facility %}
{% with shifts_in_facility.grouper as facility %}
@@ -62,7 +63,7 @@
{{ facility.name }}
{% if facility.address %}
-
@@ -82,7 +87,7 @@
{% regroup shifts_in_facility.list by starting_time.date as shifts_by_time %}
{% for shift_time in shifts_by_time %}
{% with shift_time.grouper as shift_date %}
-
+
{{ shift_date|date }}
diff --git a/scheduler/templates/helpdesk.html b/scheduler/templates/helpdesk.html
index f639656b..d8da4939 100644
--- a/scheduler/templates/helpdesk.html
+++ b/scheduler/templates/helpdesk.html
@@ -66,7 +66,7 @@
→ Google Maps
-
+
{% endverbatim %}{% trans "Show details" %}{% verbatim %}
{% endverbatim %}{% trans "News" %}{% verbatim %}
diff --git a/scheduler/templates/helpdesk_single.html b/scheduler/templates/helpdesk_single.html
index 8a9c8ab6..8b4e4d74 100644
--- a/scheduler/templates/helpdesk_single.html
+++ b/scheduler/templates/helpdesk_single.html
@@ -1,6 +1,6 @@
{% extends "helpdesk_base.html" %}
-{% load i18n vpfilters %}
+{% load i18n vpfilters staticfiles memberships %}
{% block title %}
{% blocktrans trimmed context "title with facility" with facility_name=facility.name %}
@@ -8,11 +8,160 @@
{% endblocktrans %}
{% endblock %}
+{% if facility.timeline_enabled > facility.TimelineViewMode.DISABLED %}
+
+ {% block additional_js %}
+
+ {{ block.super }}
+
+
+ {% endblock %}
+{% endif %}
+
+{% block additional_css %}
+ {{ block.super }}
+ {% if facility.timeline_enabled > facility.TimelineViewMode.DISABLED %}
+
+ {% endif %}
+
+
+{% endblock %}
+
{% block helpdesk_content %}
- {% include "partials/alert_messages.html" %}
+
+
+ {% include "partials/alert_messages.html" %}
@@ -23,9 +172,26 @@
{% blocktrans trimmed context "title with date" with schedule_date=schedule_date|date %}
Schedule for {{ schedule_date }}
{% endblocktrans %}
+
-
+ {% if facility.timeline_enabled > facility.TimelineViewMode.DISABLED %}
+
+ {% trans "Toggle Schedule" %}
+
+
+ {% if facility.timeline_enabled > facility.TimelineViewMode.DISABLED %}
+
+
+
+ {% endif %}
+ {% endif %}
+