Tutor LMS – eLearning and online course solution - Version 1.2.0

Version Description

  • 19 April, 2019 =

  • Added: Earning calculation, report, statements at front dashboard

  • Added: multiple withdraw method with development support, withdraw confirmation, approved, reject from admin

  • Added: database table , {$wpdb->prefix}tutor_earnings, {$wpdb->prefix}tutor_withdraws

  • Added: RTL CSS support

  • Added: Footer text only on Tutor LMS pages in admin dashboard

  • Added: a default parameter of $instructor_id

Download this release

Release Info

Developer themeum
Plugin Icon wp plugin Tutor LMS – eLearning and online course solution
Version 1.2.0
Comparing to
See all releases

Code changes from version 1.1.1 to 1.2.0

Files changed (78) hide show
  1. assets/css/tutor-admin.css +113 -16
  2. assets/css/tutor-front.css +787 -101
  3. assets/js/Chart.bundle.min.js +10 -0
  4. assets/js/gutenberg_blocks.js +1 -1
  5. assets/js/mce-button.js +1 -1
  6. assets/js/tutor-admin.js +18 -2
  7. assets/js/tutor-front.js +108 -0
  8. classes/Admin.php +42 -4
  9. classes/Assets.php +10 -1
  10. classes/Gutenberg.php +3 -3
  11. classes/Instructors_List.php +2 -4
  12. classes/Options.php +128 -9
  13. classes/Rewrite_Rules.php +6 -1
  14. classes/Shortcode.php +6 -6
  15. classes/Template.php +38 -3
  16. classes/{init.php → Tutor.php} +151 -47
  17. classes/Utils.php +345 -19
  18. classes/Withdraw.php +273 -0
  19. classes/Withdraw_Requests_List.php +213 -0
  20. classes/WooCommerce.php +123 -7
  21. includes/theme-compatibility/storefront/assets/css/style.css +1 -1
  22. includes/tutor-general-functions.php +17 -0
  23. includes/tutor-template-functions.php +9 -2
  24. readme.txt +57 -19
  25. templates/dashboard.php +126 -0
  26. templates/dashboard/{student/dashboard.php → dashboard.php} +0 -0
  27. templates/dashboard/earning.php +168 -0
  28. templates/dashboard/earning/chart-body.php +114 -0
  29. templates/dashboard/earning/earning-report-top-menu.php +63 -0
  30. templates/dashboard/earning/report-date_range.php +106 -0
  31. templates/dashboard/earning/report-last_month.php +105 -0
  32. templates/dashboard/earning/report-last_week.php +110 -0
  33. templates/dashboard/earning/report-last_year.php +94 -0
  34. templates/dashboard/earning/report-this_month.php +104 -0
  35. templates/dashboard/earning/report-this_week.php +106 -0
  36. templates/dashboard/earning/report-this_year.php +96 -0
  37. templates/dashboard/earning/report.php +41 -0
  38. templates/dashboard/earning/statements.php +193 -0
  39. templates/dashboard/enrolled-courses.php +77 -0
  40. templates/dashboard/{student → enrolled-courses}/active-courses.php +14 -2
  41. templates/dashboard/{student → enrolled-courses}/completed-courses.php +11 -1
  42. templates/dashboard/{student/index.php → index.php} +3 -3
  43. templates/dashboard/{student/logged-in.php → logged-in.php} +0 -0
  44. templates/dashboard/my-courses.php +86 -0
  45. templates/dashboard/my-profile.php +116 -0
  46. templates/dashboard/my-reviews.php +52 -0
  47. templates/dashboard/quiz-attempts.php +91 -0
  48. templates/dashboard/{student/registration.php → registration.php} +0 -0
  49. templates/dashboard/student/my-courses.php +0 -53
  50. templates/dashboard/{student/wishlist.php → wishlist.php} +1 -1
  51. templates/dashboard/withdraw-method-fields/number.php +2 -0
  52. templates/dashboard/withdraw-method-fields/text.php +2 -0
  53. templates/dashboard/withdraw-method-fields/textarea.php +2 -0
  54. templates/dashboard/withdraw.php +271 -0
  55. templates/loop/course-price-edd.php +2 -2
  56. templates/loop/course-price-woocommerce.php +2 -2
  57. templates/loop/course-price.php +2 -2
  58. templates/loop/rating.php +7 -0
  59. templates/single-quiz.php +8 -10
  60. templates/single/course/course-topics.php +1 -1
  61. templates/single/course/enrolled/announcements.php +0 -1
  62. templates/single/course/login.php +0 -1
  63. templates/single/course/wc-price-html.php +3 -3
  64. templates/single/lesson/content.php +8 -9
  65. templates/single/lesson/sidebar_question_and_answer.php +1 -1
  66. templates/single/quiz/single_quiz_contents.php +28 -8
  67. tutor.php +19 -5
  68. views/metabox/instructors-metabox.php +2 -2
  69. views/modal/add_quiz.php +8 -0
  70. views/modal/edit_quiz.php +11 -5
  71. views/options/field-types/group_fields.php +1 -0
  72. views/options/field-types/groups/checkbox.php +5 -0
  73. views/options/field-types/groups/number.php +7 -0
  74. views/options/field-types/groups/text.php +6 -1
  75. views/options/options_generator.php +13 -6
  76. views/options/withdraw/textarea.php +3 -0
  77. views/options/withdraw/withdraw_admin_options_generator.php +88 -0
  78. views/pages/withdraw_requests.php +16 -0
assets/css/tutor-admin.css CHANGED
@@ -72,6 +72,26 @@ TUTOR CSS
72
  box-shadow: none;
73
  }
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  /**
76
  Option Field
77
  */
@@ -101,7 +121,7 @@ Option Field
101
  .tutor-option-field {
102
  display: block;
103
  margin: 0 0 0 200px;
104
- max-width: 800px
105
  }
106
  .tutor-option-field-label {
107
  display: block;
@@ -133,6 +153,9 @@ Option Field
133
  padding: 5px;
134
  border: 1px solid #CCCCCC;
135
  }
 
 
 
136
  /**
137
  Group Field Option
138
  */
@@ -488,7 +511,6 @@ table.tutor_status_table td mark.yes, table.tutor_status_table th mark.yes {
488
  background-color: transparent;
489
  }
490
 
491
-
492
  /*
493
 
494
  .tutor-help-tip {
@@ -870,9 +892,11 @@ Quiz Modal
870
  background-color: rgba(0, 0, 0, 0.5);
871
  }
872
  .tutor-modal-wrap.show {
873
- display: block;
874
  opacity: 1;
875
  z-index: 99999;
 
 
876
  }
877
  .tutor-modal-wrap.loading .tutor-modal-content:before {
878
  position: absolute;
@@ -889,11 +913,12 @@ Quiz Modal
889
  overflow-y: scroll;
890
  overflow-x: hidden;
891
  background-color: #fff;
892
- max-width: 800px;
893
- margin: 50px auto;
894
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
895
  position: relative;
896
  transition: all 200ms ease-out;
 
897
  }
898
  .tutor-modal-wrap .modal-footer {
899
  padding: 20px;
@@ -960,23 +985,30 @@ Quiz Modal
960
  #tutor-quiz-modal-tab-items-wrap {
961
  background-color: #fff;
962
  font-size: 0;
 
963
  }
964
  #tutor-quiz-builder-modal-tabs-container{
965
  padding: 20px;
966
  }
967
- #tutor-quiz-builder-modal-tabs-container .quiz-builder-tab-body{
968
- min-height: 300px;
969
- }
970
  #tutor-quiz-modal-tab-items-wrap .tutor-quiz-modal-tab-item{
971
  padding: 15px 25px;
972
  display: inline-block;
973
  color: #393C40;
974
  border-left: 1px solid #F1F1F1;
975
- font-size: 13px;
 
 
 
976
  }
977
  #tutor-quiz-modal-tab-items-wrap .tutor-quiz-modal-tab-item.active{
978
  background-color: #F1F1F1;
979
  }
 
 
 
 
 
 
980
  #tutor-quiz-modal-tab-items-wrap .tutor-quiz-modal-tab-item.active i{
981
  color: #3057D5;
982
  }
@@ -1020,6 +1052,7 @@ Quiz Modal
1020
  margin: 0;
1021
  padding: 10px;
1022
  box-shadow: none;
 
1023
  }
1024
  .tutor-quiz-builder-form-row input[type="text"], .tutor-quiz-builder-form-row input[type="number"]{
1025
  height: 42px;
@@ -1028,7 +1061,16 @@ Quiz Modal
1028
  #quiz-builder-tab-quiz-info input[type="text"], #quiz-builder-tab-quiz-info textarea{
1029
  width: 100%;
1030
  }
1031
-
 
 
 
 
 
 
 
 
 
1032
 
1033
  .tutor-quiz-builder-modal-control-btn-group{
1034
  display: flex;
@@ -1039,6 +1081,9 @@ Quiz Modal
1039
  .tutor-quiz-builder-modal-control-btn-group .quiz-modal-tab-navigation-btn{
1040
  display: inline-block;
1041
  }
 
 
 
1042
  .modal-container .tutor-quiz-add-question-btn{
1043
  border: 1px solid #C6C9CF;
1044
  padding: 10px 15px;
@@ -1060,7 +1105,6 @@ Quiz Modal
1060
  margin-bottom: 20px;
1061
  }
1062
  .quiz-form-field-col{
1063
- padding-right: 20px;
1064
  margin-right: 20px;
1065
  }
1066
  .quiz-form-field-col.result-fail{
@@ -1130,10 +1174,15 @@ Quiz Modal
1130
  position: absolute;
1131
  }
1132
  i.tutor-icon-block {
1133
- padding: 5px;
1134
  color: #fff;
1135
  border-radius: 3px;
1136
  margin-right: 2px;
 
 
 
 
 
1137
  }
1138
  i.tutor-icon-block.tutor-icon-short-ans{
1139
  background-color: #f37512;
@@ -1221,7 +1270,7 @@ a.back-to-quiz-questions-btn {
1221
  }
1222
  .quiz-builder-question-wrap {
1223
  display: flex;
1224
- margin-bottom: 5px;
1225
  }
1226
  .quiz-builder-question {
1227
  flex: 1;
@@ -1229,21 +1278,32 @@ a.back-to-quiz-questions-btn {
1229
  background: #fff;
1230
  padding: 10px;
1231
  border: 1px solid #E2E2E2;
 
1232
  }
1233
  .quiz-builder-question .question-sorting {
1234
  margin-right: 10px;
 
 
 
 
1235
  }
1236
  .quiz-builder-question .question-title {
1237
  flex: 1;
 
 
 
 
 
1238
  }
1239
  .quiz-builder-question .question-icon {
1240
- flex: 0 0 170px;
1241
  }
1242
  .quiz-builder-qustion-trash a{
1243
  display: block;
1244
- padding: 10px;
1245
  font-size: 20px;
1246
- color: #393C40;
 
1247
  }
1248
  .tutor-quiz-builder-modal-wrap select {
1249
  border: 1px solid #ccc;
@@ -1668,4 +1728,41 @@ Lesson Edit Modal
1668
  border-color: #faebcc;
1669
  padding: 20px;
1670
  margin-bottom: 10px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1671
  }
72
  box-shadow: none;
73
  }
74
 
75
+ /**
76
+ Withdraw Methods Nav
77
+ */
78
+
79
+ .withdraw-method-nav{
80
+ margin-bottom: 20px;
81
+ }
82
+ .withdraw-method-nav li{
83
+ position: relative;
84
+ display: inline-block;
85
+ }
86
+ .withdraw-method-nav li a{
87
+ display: block;
88
+ text-decoration: none;
89
+ padding: 5px 10px;
90
+ border-right: 1px solid #cccccc;
91
+ }
92
+ .withdraw-method-nav li:last-child a {
93
+ border-right: none;
94
+ }
95
  /**
96
  Option Field
97
  */
121
  .tutor-option-field {
122
  display: block;
123
  margin: 0 0 0 200px;
124
+ max-width: 800px;
125
  }
126
  .tutor-option-field-label {
127
  display: block;
153
  padding: 5px;
154
  border: 1px solid #CCCCCC;
155
  }
156
+ .select2-container {
157
+ min-width: 250px !important;
158
+ }
159
  /**
160
  Group Field Option
161
  */
511
  background-color: transparent;
512
  }
513
 
 
514
  /*
515
 
516
  .tutor-help-tip {
892
  background-color: rgba(0, 0, 0, 0.5);
893
  }
894
  .tutor-modal-wrap.show {
895
+ display: flex;
896
  opacity: 1;
897
  z-index: 99999;
898
+ align-items: center;
899
+ justify-content: center;
900
  }
901
  .tutor-modal-wrap.loading .tutor-modal-content:before {
902
  position: absolute;
913
  overflow-y: scroll;
914
  overflow-x: hidden;
915
  background-color: #fff;
916
+ max-width: 730px;
917
+ margin: 0;
918
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
919
  position: relative;
920
  transition: all 200ms ease-out;
921
+ width: 90%;
922
  }
923
  .tutor-modal-wrap .modal-footer {
924
  padding: 20px;
985
  #tutor-quiz-modal-tab-items-wrap {
986
  background-color: #fff;
987
  font-size: 0;
988
+ overflow: hidden;
989
  }
990
  #tutor-quiz-builder-modal-tabs-container{
991
  padding: 20px;
992
  }
 
 
 
993
  #tutor-quiz-modal-tab-items-wrap .tutor-quiz-modal-tab-item{
994
  padding: 15px 25px;
995
  display: inline-block;
996
  color: #393C40;
997
  border-left: 1px solid #F1F1F1;
998
+ font-size: 14px;
999
+ overflow: hidden;
1000
+ line-height: 17px;
1001
+ vertical-align: middle;
1002
  }
1003
  #tutor-quiz-modal-tab-items-wrap .tutor-quiz-modal-tab-item.active{
1004
  background-color: #F1F1F1;
1005
  }
1006
+ #tutor-quiz-modal-tab-items-wrap .tutor-quiz-modal-tab-item i{
1007
+ float: left;
1008
+ font-size: 17px;
1009
+ line-height: 1;
1010
+ margin-right: 5px;
1011
+ }
1012
  #tutor-quiz-modal-tab-items-wrap .tutor-quiz-modal-tab-item.active i{
1013
  color: #3057D5;
1014
  }
1052
  margin: 0;
1053
  padding: 10px;
1054
  box-shadow: none;
1055
+ border-radius: 3px;
1056
  }
1057
  .tutor-quiz-builder-form-row input[type="text"], .tutor-quiz-builder-form-row input[type="number"]{
1058
  height: 42px;
1061
  #quiz-builder-tab-quiz-info input[type="text"], #quiz-builder-tab-quiz-info textarea{
1062
  width: 100%;
1063
  }
1064
+ .tutor-quiz-builder-modal-tabs-notice{
1065
+ background: #D8D8D8;
1066
+ line-height: 20px;
1067
+ padding: 10px 30px;
1068
+ color: #A4A4A4;
1069
+ }
1070
+ #tutor-course-topics .tutor-quiz-builder-modal-tabs-notice a{
1071
+ color: #A4A4A4;
1072
+ text-decoration: underline;
1073
+ }
1074
 
1075
  .tutor-quiz-builder-modal-control-btn-group{
1076
  display: flex;
1081
  .tutor-quiz-builder-modal-control-btn-group .quiz-modal-tab-navigation-btn{
1082
  display: inline-block;
1083
  }
1084
+ .tutor-quiz-builder-modal-control-btn-group .quiz-modal-tab-navigation-btn:not(:last-child){
1085
+ margin-right: 6px;
1086
+ }
1087
  .modal-container .tutor-quiz-add-question-btn{
1088
  border: 1px solid #C6C9CF;
1089
  padding: 10px 15px;
1105
  margin-bottom: 20px;
1106
  }
1107
  .quiz-form-field-col{
 
1108
  margin-right: 20px;
1109
  }
1110
  .quiz-form-field-col.result-fail{
1174
  position: absolute;
1175
  }
1176
  i.tutor-icon-block {
1177
+ padding: 0;
1178
  color: #fff;
1179
  border-radius: 3px;
1180
  margin-right: 2px;
1181
+ display: inline-block;
1182
+ width: 22px;
1183
+ height: 22px;
1184
+ text-align: center;
1185
+ line-height: 22px;
1186
  }
1187
  i.tutor-icon-block.tutor-icon-short-ans{
1188
  background-color: #f37512;
1270
  }
1271
  .quiz-builder-question-wrap {
1272
  display: flex;
1273
+ margin-bottom: 15px;
1274
  }
1275
  .quiz-builder-question {
1276
  flex: 1;
1278
  background: #fff;
1279
  padding: 10px;
1280
  border: 1px solid #E2E2E2;
1281
+ border-radius: 3px;
1282
  }
1283
  .quiz-builder-question .question-sorting {
1284
  margin-right: 10px;
1285
+ line-height: 22px;
1286
+ }
1287
+ .quiz-builder-question .question-edit-icon{
1288
+ line-height: 22px;
1289
  }
1290
  .quiz-builder-question .question-title {
1291
  flex: 1;
1292
+ line-height: 22px;
1293
+ text-overflow: ellipsis;
1294
+ overflow: hidden;
1295
+ white-space: nowrap;
1296
+ margin-right: 10px;
1297
  }
1298
  .quiz-builder-question .question-icon {
1299
+ flex: 0 0 155px;
1300
  }
1301
  .quiz-builder-qustion-trash a{
1302
  display: block;
1303
+ padding: 0 10px;
1304
  font-size: 20px;
1305
+ color: rgba(57, 60, 64, 0.4);
1306
+ line-height: 44px;
1307
  }
1308
  .tutor-quiz-builder-modal-wrap select {
1309
  border: 1px solid #ccc;
1728
  border-color: #faebcc;
1729
  padding: 20px;
1730
  margin-bottom: 10px;
1731
+ }
1732
+
1733
+ /**
1734
+ Withdraw table
1735
+ */
1736
+ .withdraw-method-data-row {
1737
+ display: flex;
1738
+ }
1739
+ span.withdraw-method-label {
1740
+ width: 140px;
1741
+ }
1742
+ .withdraw-method-value{
1743
+ margin-left: 3px;
1744
+ }
1745
+ .withdraw-status.withdraw-status-approved {
1746
+ background: #00d63d;
1747
+ color: #fff;
1748
+ padding: 5px 10px;
1749
+ }
1750
+ .withdraw-status.withdraw-status-pending {
1751
+ background: #f0efef;
1752
+ color: #666666;
1753
+ padding: 5px 10px;
1754
+ }
1755
+ .withdraw-status.withdraw-status-rejected {
1756
+ background: #ff3842;
1757
+ color: #fff;
1758
+ padding: 5px 10px;
1759
+ }
1760
+ .withdraw-list-row-actions{
1761
+ font-weight: bold;
1762
+ }
1763
+ .withdraw-list-row-actions .approved a{
1764
+ color: #00d63d;
1765
+ }
1766
+ .withdraw-list-row-actions .rejected a{
1767
+ color: #ff3842;
1768
  }
assets/css/tutor-front.css CHANGED
@@ -5,6 +5,7 @@
5
  --tutor-primary-hover-color: #1b52a9;
6
  --tutor-text-color: #4B5981;
7
  --tutor-light-color: #B1B8C9;
 
8
  }
9
 
10
  body {
@@ -25,6 +26,7 @@ Most Important CSS
25
  max-width: 1170px;
26
  margin-right: auto;
27
  margin-left: auto;
 
28
  }
29
  .tutor-row{
30
  display: -ms-flexbox;
@@ -249,8 +251,11 @@ Most Important CSS
249
  margin-right: 40px;
250
  margin-top: 5px;
251
  margin-bottom: 5px;
 
 
 
 
252
  }
253
-
254
  .tutor-single-course-meta .tutor-single-course-avatar img{
255
  height: 21px;
256
  width: 21px;
@@ -335,7 +340,16 @@ Most Important CSS
335
  -webkit-box-pack: justify;
336
  -ms-flex-pack: justify;
337
  justify-content: space-between;
 
 
 
 
 
 
 
 
338
  }
 
339
  .tutor-single-course-meta.tutor-lead-meta ul li span{
340
  display: block;
341
  margin-bottom: 5px;
@@ -422,9 +436,7 @@ Most Important CSS
422
  .tutor-course-lesson{
423
  border-top: 1px solid #DCE4E6;
424
  }
425
- .tutor-course-topics-contents .tutor-course-topic .tutor-course-lessons{
426
- display: none;
427
- }
428
  .tutor-course-lesson h5{
429
  line-height: 22px;
430
  font-size: 14px;
@@ -447,16 +459,25 @@ Most Important CSS
447
  vertical-align: text-top;
448
  margin-right: 10px;
449
  color: var(--tutor-light-color);
 
 
 
 
 
450
  }
451
 
452
  .tutor-course-lesson h5 .tutor-lesson-duration{
453
  margin-left: auto;
454
  padding-left: 5px;
 
455
  }
456
  .tutor-course-lesson .lesson-preview-title {
457
  -webkit-box-flex: 1;
458
  -ms-flex: 1 0 0;
459
  flex: 1 0 0;
 
 
 
460
  }
461
 
462
  /********************/
@@ -469,6 +490,7 @@ Icon Css
469
  div[class*="tutor-course-col"] {
470
  padding-left: 15px;
471
  padding-right: 15px;
 
472
  }
473
  .tutor-course-loop{
474
  background: #fff;
@@ -477,11 +499,14 @@ div[class*="tutor-course-col"] {
477
  overflow: hidden;
478
  position: relative;
479
  vertical-align: top;
480
- margin-bottom: 30px;
481
  border-radius: 4px;
482
  -webkit-transition: 300ms;
483
  transition: 300ms;
484
  border: 1px solid #DCDFE5;
 
 
 
 
485
  }
486
  .tutor-course-header{
487
  position: relative;
@@ -503,12 +528,22 @@ div[class*="tutor-course-col"] {
503
  font-size: 19px;
504
  padding: 5px 5px;
505
  border-radius: 3px;
 
506
  }
507
 
508
  .tutor-course-loop-header-meta .tutor-course-wishlist a{
509
  display: block;
510
  color: var(--tutor-primary-color);
 
 
 
 
 
 
 
 
511
  }
 
512
  .tutor-course-loop-header-meta .tutor-course-wishlist a:focus{
513
  outline: none;
514
  }
@@ -550,6 +585,14 @@ div[class*="tutor-course-col"] {
550
  margin-bottom: 2px;
551
  font-size: 16px;
552
  }
 
 
 
 
 
 
 
 
553
  .tutor-loop-rating-wrap i:before{
554
  margin-right: 4px;
555
  margin-left: 0;
@@ -753,6 +796,9 @@ div[class*="tutor-course-col"] {
753
  clear: both;
754
  margin-bottom: 20px;
755
  }
 
 
 
756
  .tutor-course-archive-results-wrap{
757
  float: left;
758
  width: 45%;
@@ -773,6 +819,12 @@ div[class*="tutor-course-col"] {
773
  margin-right: -15px;
774
  padding: 0;
775
  }
 
 
 
 
 
 
776
  .clearfix:before, .clearfix:after{
777
  display: block;
778
  clear: both;
@@ -846,12 +898,45 @@ Topicstutor-course-title
846
  padding: 20px;
847
  border: 1px solid #b7d6b7;
848
  }
 
 
 
 
 
849
  .tutor-notice-warning{
850
  background-color: #fcf8e3;
851
  border-color: #faebcc;
852
  padding: 20px;
853
  margin-bottom: 10px;
854
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
855
  .single_add_to_cart_button,
856
  a.tutor-button,
857
  .tutor-button,
@@ -872,12 +957,9 @@ a.tutor-button:hover,
872
  .tutor-button:hover,
873
  a.tutor-btn:hover,
874
  .tutor-btn:hover {
875
- background-color: var(--tutor-primary-color);
876
- border-color: var(--tutor-primary-color);
877
  color: #fff;
878
- filter: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg"><filter id="filter"><feComponentTransfer color-interpolation-filters="sRGB"><feFuncR type="linear" slope="0.9" /><feFuncG type="linear" slope="0.9" /><feFuncB type="linear" slope="0.9" /></feComponentTransfer></filter></svg>#filter');
879
- -webkit-filter: brightness(.9);
880
- filter: brightness(.9);
881
  }
882
 
883
  .tutor-button.tutor-danger{
@@ -885,8 +967,8 @@ a.tutor-btn:hover,
885
  border-color: #E53935;
886
  }
887
  .tutor-button.tutor-success{
888
- background: #86B223;
889
- border-color: #86B223;
890
  }
891
 
892
  .course-enrolled-nav-wrap{
@@ -896,6 +978,7 @@ a.tutor-btn:hover,
896
  .tutor-wrap nav.course-enrolled-nav ul{
897
  list-style: none;
898
  margin: 0 0 -1px;
 
899
  }
900
  .tutor-wrap nav.course-enrolled-nav ul li{
901
  display: inline-block;
@@ -916,32 +999,89 @@ a.tutor-btn:hover,
916
  color: var(--tutor-text-color);
917
  }
918
  /* *********************** */
919
- /* Tutor Student Dashboard */
920
  /* *********************** */
921
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
922
  .tutor-dashboard-avater img{
923
  width: 70px;
924
  height: 70px;
925
  display: block;
926
  border-radius: 50%;
927
  }
928
-
929
  .tutor-dashboard-student-info h4{
930
  font-size: 18px;
931
  color: var(--tutor-light-color);
932
  margin-bottom: 0;
933
  }
934
-
935
-
936
  .tutor-dashboard-student-info h4 a{
937
  color: var(--tutor-text-color);
938
  }
939
-
940
  .tutor-dashboard-user-role{
941
  font-size: 14px;
942
  font-weight: 400;
943
  }
944
-
945
  .tutor-dashboard-student-meta ul{
946
  list-style: none;
947
  margin: 20px 0 40px;
@@ -950,13 +1090,34 @@ a.tutor-btn:hover,
950
  border-bottom: 1px solid #DCDFE5;
951
  font-size: 14px;
952
  }
953
-
954
  .tutor-dashboard-student-meta ul li{
955
  display: inline-block;
956
  color: var(--tutor-text-color);
957
  margin-left: 60px;
958
  }
959
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
960
  .tutor-dashboard-student-meta ul li:first-child{
961
  margin-left: 0;
962
  }
@@ -981,18 +1142,21 @@ a.tutor-btn:hover,
981
  color: var(--tutor-light-color);
982
  font-weight: 400;
983
  }
984
-
985
-
986
  .tutor-dashboard-permalinks{
987
  list-style: none;
988
- margin: 0 0 20px;
989
- border: 1px solid #E8EFF1;
990
- border-radius: 4px;
991
  font-size: 14px;
992
  padding: 0;
993
  }
994
  .tutor-dashboard-permalinks li:not(:last-child){
995
- border-bottom: 1px solid #E8EFF1;
 
 
 
 
 
 
 
996
  }
997
 
998
  @media (max-width: 991px) {
@@ -1013,8 +1177,6 @@ a.tutor-btn:hover,
1013
  }
1014
  }
1015
 
1016
-
1017
-
1018
  .tutor-dashboard-permalinks li a{
1019
  display: block;
1020
  color: var(--tutor-text-color);
@@ -1029,33 +1191,343 @@ a.tutor-btn:hover,
1029
  margin-bottom: 17px;
1030
  }
1031
 
1032
- /*.tutor-dashboard-content-inner:not(:empty){}*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1033
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1034
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1035
  .tutor-dashboard-content-inner .tutor-mycourse-wrap{
1036
- padding: 20px;
1037
  border: 1px solid #DCDFE5;
1038
  border-radius: 4px;
1039
  margin-bottom: 30px;
 
 
 
 
 
 
 
 
 
 
 
1040
  }
1041
-
1042
  .tutor-mycourse-rating{
1043
  color: #F8C51C;
1044
  font-size: 12px;
1045
  }
1046
-
1047
  .tutor-mycourse-rating i{
1048
  margin-right: 4px;
1049
  }
1050
-
1051
  .tutor-dashboard-content-inner{
1052
  font-size: 14px;
1053
  }
1054
-
1055
  .tutor-dashboard-content-inner .tutor-mycourse-wrap p:last-child{
1056
  margin-bottom: 0;
1057
  }
1058
-
 
 
 
 
 
 
 
 
1059
  .tutor-dashboard-content-inner h3 a{
1060
  color: var(--tutor-text-color);
1061
  font-size: 22px;
@@ -1067,13 +1539,13 @@ a.tutor-btn:hover,
1067
  .tutor-dashboard-content-inner .tutor-course-metadata ul{
1068
  display: block;
1069
  list-style: none;
1070
- margin: 0 0 25px;
1071
  padding: 0;
1072
  font-size: 14px;
1073
  }
1074
 
1075
  .tutor-dashboard-content-inner .tutor-progress-bar-wrap{
1076
- margin-bottom: 20px;
1077
  }
1078
  .tutor-dashboard-content-inner .tutor-course-metadata li{
1079
  display: inline-block;
@@ -1184,7 +1656,38 @@ Instructor
1184
  .single-instructor-wrap .single-instructor-bottom .ratings .rating-generated{
1185
  color: #f8c51c;
1186
  }
1187
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1188
  /* *********************** */
1189
  /* Single Lesson */
1190
  /************************ */
@@ -1307,8 +1810,8 @@ Instructor
1307
  }
1308
  .tutor-lessons-under-topic .tutor-single-lesson-items.active .tutor-lesson-right-icons .tutor-lesson-complete.tutor-done,
1309
  .tutor-lessons-under-topic .tutor-lesson-right-icons .tutor-lesson-complete.tutor-done{
1310
- background: #86B223;
1311
- border-color: #86B223;
1312
  color: #fff;
1313
  }
1314
  .tutor-lessons-under-topic .tutor-lesson-right-icons i{
@@ -1326,10 +1829,34 @@ Instructor
1326
  align-items: center;
1327
  justify-content: space-between;
1328
  }
 
 
 
 
 
1329
  .tutor-single-page-top-bar a{
1330
  color: #ffffff;
1331
  }
1332
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1333
  .tutor-single-page-top-bar a:hover{
1334
  color: #ffffff;
1335
  }
@@ -1346,15 +1873,11 @@ Instructor
1346
  line-height: 1;
1347
  margin-right: 3px;
1348
  }
1349
- .tutor-single-page-top-bar .tutor-topbar-back-to-curse-wrap{
1350
- text-align: right;
1351
- margin-right: 30px;
1352
- }
1353
  .tutor-lesson-content-area, .tutor-quiz-single-wrap {
1354
  margin: 0 100px;
1355
  }
1356
  .tutor-lesson-sidebar-hide-bar{
1357
- background-color: #1645B7;
1358
  color: #ffffff;
1359
  padding: 0 18px;
1360
  display: inline-block;
@@ -1510,9 +2033,9 @@ Instructor
1510
  .tutor-progress-bar .tutor-progress-filled:after{
1511
  content: '';
1512
  position: absolute;
1513
- height: 20px;
1514
- width: 20px;
1515
- border: 5px solid var(--tutor-primary-color);
1516
  border-radius: 50%;
1517
  background: #fff;
1518
  left: var(--tutor-progress-left);
@@ -1765,7 +2288,7 @@ ul.tutor-required-fields{
1765
  text-align: left;
1766
  }
1767
  .tutor-star-rating-group i{
1768
- cursor: pointer;
1769
  margin-right: 4px;
1770
  }
1771
  .tutor-queston-and-answer-wrap{
@@ -1817,9 +2340,8 @@ ul.tutor-required-fields{
1817
  animation: spin 2s infinite linear;
1818
  display: inline-block;
1819
  }
1820
- .loading-lesson:before{
1821
  font-family: 'tutor';
1822
- margin-right: 5px;
1823
  content: "\e91d";
1824
  -webkit-animation: spin 2s infinite linear;
1825
  animation: spin 2s infinite linear;
@@ -1827,17 +2349,25 @@ ul.tutor-required-fields{
1827
  z-index: 9;
1828
  position: absolute;
1829
  left: 50%;
1830
- top: 150px;
1831
  font-size: 50px;
 
 
1832
  }
1833
- .loading-lesson:after {
1834
  position: absolute;
1835
  content: "";
1836
  top: 0;
 
1837
  background: rgba(255,255,255, 0.8);
1838
  width: 100%;
1839
- height: 99%;
 
 
 
 
1840
  }
 
1841
  /**
1842
  Course question and answer
1843
  */
@@ -2104,18 +2634,10 @@ Course question and answer
2104
  margin-bottom: 80px;
2105
  }
2106
  .fill-in-the-blank-field {
2107
- display: -webkit-box;
2108
- display: -ms-flexbox;
2109
- display: flex;
2110
- vertical-align: bottom;
2111
- -webkit-box-align: end;
2112
- -ms-flex-align: end;
2113
- align-items: flex-end;
2114
  }
2115
  .fill-in-the-blank-field .fill-in-the-blank-text-input {
2116
- -webkit-box-flex: 0;
2117
- -ms-flex: 0 0 200px;
2118
- flex: 0 0 200px;
2119
  border-top: none;
2120
  border-left: none;
2121
  border-right: none;
@@ -2142,7 +2664,7 @@ Course question and answer
2142
  height: 175px;
2143
  border-radius: 5px;
2144
  box-shadow: none;
2145
- max-width: 740px;
2146
  margin-bottom: 5px;
2147
  }
2148
  .tutor-quiz-answers-wrap textarea:focus{
@@ -2153,7 +2675,7 @@ Course question and answer
2153
 
2154
  .tutor-quiz-answers-wrap p{
2155
  margin: 0;
2156
- line-height: 20px;
2157
  }
2158
  .quiz-answer-input-body .quiz-answer-image-wrap {
2159
  margin-top: 10px;
@@ -2267,6 +2789,7 @@ Course question and answer
2267
  padding-right: 0;
2268
  width: 25%;
2269
  padding: 0 10px;
 
2270
  }
2271
 
2272
 
@@ -2289,7 +2812,7 @@ Course question and answer
2289
  border: 1px solid #D4DADB;
2290
  margin-right: 10px;
2291
  margin-bottom: 10px;
2292
- max-width: 215px;
2293
  background-color: #fff;
2294
  display: -webkit-inline-box;
2295
  display: -ms-inline-flexbox;
@@ -2389,7 +2912,7 @@ Course question and answer
2389
  .quiz-image-answering-answer {
2390
  margin-right: 10px;
2391
  margin-left: 10px;
2392
- width: 25%;
2393
  }
2394
  .quiz-image-answering-image-wrap {
2395
  margin-bottom: 20px;
@@ -2401,6 +2924,7 @@ Course question and answer
2401
  box-shadow: none;
2402
  background: transparent;
2403
  border-radius: 2px;
 
2404
  }
2405
 
2406
  .tutor-quiz-answers-wrap .quiz-image-answering-input-field-wrap input:focus{
@@ -2501,8 +3025,8 @@ Course question and answer
2501
  }
2502
  .tutor-login-form-wrap input[type="submit"]{
2503
  color: #fff;
2504
- background-color: #86B223;
2505
- border-color: #86B223;
2506
  display: inline-block;
2507
  padding: 15px 30px;
2508
  border-radius: 4px;
@@ -2648,8 +3172,8 @@ Course question and answer
2648
  }
2649
 
2650
  .tutor-form-group.tutor-reg-form-btn-wrap .tutor-button{
2651
- background: #86B223;
2652
- border-color: #86B223;
2653
  }
2654
 
2655
  /* ********************* */
@@ -2845,7 +3369,7 @@ Course question and answer
2845
  height: 5px;
2846
  }
2847
  .rating-meter-col.rating-text-col{
2848
- flex: 0 0 100px;
2849
  }
2850
 
2851
  /* ********************* */
@@ -2895,40 +3419,93 @@ Course question and answer
2895
  margin-top: 20px;
2896
  }
2897
 
2898
- /**
2899
- Addon Support
2900
- Course Prerequisites
2901
- */
2902
- .course-prerequisites-warning {
2903
- background: #fff3dc;
2904
- padding: 15px;
2905
- margin-bottom: 20px;
2906
- color: #5f5b49;
2907
  }
2908
- ul.prerequisites-course-lists{
 
 
2909
  list-style: none;
2910
  }
2911
- a.prerequisites-course-item {
2912
- background-color: #f0f0f0;
2913
- display: -webkit-box;
2914
- display: -ms-flexbox;
2915
- display: flex;
2916
- margin-bottom: 2px;
2917
- padding: 10px;
2918
- position: relative;
 
 
2919
  }
2920
- a.prerequisites-course-item span.prerequisites-course-feature-image{
2921
- max-width: 60px;
2922
- margin-right: 10px;
 
 
 
 
 
 
 
 
2923
  }
2924
- .is-complete-prerequisites-course {
 
2925
  position: absolute;
2926
- background: #51d849;
2927
- color: #fff;
2928
- padding: 0 5px;
2929
- font-size: 12px;
2930
  }
2931
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2932
 
2933
  /*
2934
  social share
@@ -2951,5 +3528,114 @@ social share
2951
  }
2952
 
2953
  .tutor-single-course-meta ul li.tutor-social-share button:hover{
2954
- color: #0e62ff;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2955
  }
5
  --tutor-primary-hover-color: #1b52a9;
6
  --tutor-text-color: #4B5981;
7
  --tutor-light-color: #B1B8C9;
8
+ --tutor-success-button-color: #86B223;
9
  }
10
 
11
  body {
26
  max-width: 1170px;
27
  margin-right: auto;
28
  margin-left: auto;
29
+ width: 100%;
30
  }
31
  .tutor-row{
32
  display: -ms-flexbox;
251
  margin-right: 40px;
252
  margin-top: 5px;
253
  margin-bottom: 5px;
254
+ min-width: 95px;
255
+ }
256
+ .tutor-single-course-meta ul li:last-child{
257
+ margin-right: 0;
258
  }
 
259
  .tutor-single-course-meta .tutor-single-course-avatar img{
260
  height: 21px;
261
  width: 21px;
340
  -webkit-box-pack: justify;
341
  -ms-flex-pack: justify;
342
  justify-content: space-between;
343
+
344
+ }
345
+
346
+ @media (max-width: 991px) {
347
+ .tutor-single-course-meta.tutor-lead-meta ul{
348
+ flex-wrap: wrap;
349
+ justify-content: flex-start;
350
+ }
351
  }
352
+
353
  .tutor-single-course-meta.tutor-lead-meta ul li span{
354
  display: block;
355
  margin-bottom: 5px;
436
  .tutor-course-lesson{
437
  border-top: 1px solid #DCE4E6;
438
  }
439
+
 
 
440
  .tutor-course-lesson h5{
441
  line-height: 22px;
442
  font-size: 14px;
459
  vertical-align: text-top;
460
  margin-right: 10px;
461
  color: var(--tutor-light-color);
462
+ display: block;
463
+ }
464
+ .tutor-course-lesson h5 .lesson-preview-icon i{
465
+ margin-right: 0;
466
+ margin-left: 10px;
467
  }
468
 
469
  .tutor-course-lesson h5 .tutor-lesson-duration{
470
  margin-left: auto;
471
  padding-left: 5px;
472
+ align-self: flex-start;
473
  }
474
  .tutor-course-lesson .lesson-preview-title {
475
  -webkit-box-flex: 1;
476
  -ms-flex: 1 0 0;
477
  flex: 1 0 0;
478
+ flex-direction: row;
479
+ display: flex;
480
+ align-items: flex-start;
481
  }
482
 
483
  /********************/
490
  div[class*="tutor-course-col"] {
491
  padding-left: 15px;
492
  padding-right: 15px;
493
+ margin-bottom: 30px;
494
  }
495
  .tutor-course-loop{
496
  background: #fff;
499
  overflow: hidden;
500
  position: relative;
501
  vertical-align: top;
 
502
  border-radius: 4px;
503
  -webkit-transition: 300ms;
504
  transition: 300ms;
505
  border: 1px solid #DCDFE5;
506
+ height: 100%;
507
+ display: flex;
508
+ flex-direction: column;
509
+ justify-content: space-between;
510
  }
511
  .tutor-course-header{
512
  position: relative;
528
  font-size: 19px;
529
  padding: 5px 5px;
530
  border-radius: 3px;
531
+ transition: 300ms;
532
  }
533
 
534
  .tutor-course-loop-header-meta .tutor-course-wishlist a{
535
  display: block;
536
  color: var(--tutor-primary-color);
537
+ transition: 300ms;
538
+ }
539
+
540
+ .tutor-course-loop-header-meta .tutor-course-wishlist:hover{
541
+ background: var(--tutor-primary-color);
542
+ }
543
+ .tutor-course-loop-header-meta .tutor-course-wishlist:hover a{
544
+ color: #fff;
545
  }
546
+
547
  .tutor-course-loop-header-meta .tutor-course-wishlist a:focus{
548
  outline: none;
549
  }
585
  margin-bottom: 2px;
586
  font-size: 16px;
587
  }
588
+ .tutor-rating-count{
589
+ color: var(--tutor-text-color);
590
+ }
591
+ .tutor-rating-count i{
592
+ font-style: normal;
593
+ display: inline-block;
594
+ margin-left: 5px;
595
+ }
596
  .tutor-loop-rating-wrap i:before{
597
  margin-right: 4px;
598
  margin-left: 0;
796
  clear: both;
797
  margin-bottom: 20px;
798
  }
799
+ .tutor-course-filter-form{
800
+ display: inline-block;
801
+ }
802
  .tutor-course-archive-results-wrap{
803
  float: left;
804
  width: 45%;
819
  margin-right: -15px;
820
  padding: 0;
821
  }
822
+ .tutor-loop-course-bottom {
823
+ display: flex;
824
+ flex-direction: column;
825
+ justify-content: space-between;
826
+ height: 100%;
827
+ }
828
  .clearfix:before, .clearfix:after{
829
  display: block;
830
  clear: both;
898
  padding: 20px;
899
  border: 1px solid #b7d6b7;
900
  }
901
+
902
+ /**
903
+ Notice and others message
904
+ Alert Box Css
905
+ */
906
  .tutor-notice-warning{
907
  background-color: #fcf8e3;
908
  border-color: #faebcc;
909
  padding: 20px;
910
  margin-bottom: 10px;
911
  }
912
+ .tutor-info-msg,
913
+ .tutor-success-msg,
914
+ .tutor-warning-msg,
915
+ .tutor-error-msg {
916
+ margin: 10px 0;
917
+ padding: 10px;
918
+ border-radius: 3px 3px 3px 3px;
919
+ }
920
+ .tutor-info-msg {
921
+ color: #059;
922
+ background-color: #BEF;
923
+ }
924
+ .tutor-success-msg {
925
+ color: #270;
926
+ background-color: #DFF2BF;
927
+ }
928
+ .tutor-warning-msg {
929
+ color: #9F6000;
930
+ background-color: #FEEFB3;
931
+ }
932
+ .tutor-error-msg {
933
+ color: #D8000C;
934
+ background-color: #FFBABA;
935
+ }
936
+ /**
937
+ End Alert box css
938
+ */
939
+
940
  .single_add_to_cart_button,
941
  a.tutor-button,
942
  .tutor-button,
957
  .tutor-button:hover,
958
  a.tutor-btn:hover,
959
  .tutor-btn:hover {
960
+ background-color: var(--tutor-primary-hover-color);
961
+ border-color: var(--tutor-primary-hover-color);
962
  color: #fff;
 
 
 
963
  }
964
 
965
  .tutor-button.tutor-danger{
967
  border-color: #E53935;
968
  }
969
  .tutor-button.tutor-success{
970
+ background: var(--tutor-success-button-color);
971
+ border-color: var(--tutor-success-button-color);
972
  }
973
 
974
  .course-enrolled-nav-wrap{
978
  .tutor-wrap nav.course-enrolled-nav ul{
979
  list-style: none;
980
  margin: 0 0 -1px;
981
+ padding: 0;
982
  }
983
  .tutor-wrap nav.course-enrolled-nav ul li{
984
  display: inline-block;
999
  color: var(--tutor-text-color);
1000
  }
1001
  /* *********************** */
1002
+ /* Tutor Dashboard */
1003
  /* *********************** */
1004
+ .tutor-dashboard-header-wrap{
1005
+ background-color: #272F3C;
1006
+ min-height: 200px;
1007
+ }
1008
+ .tutor-dashboard-header {
1009
+ padding: 50px 20px;
1010
+ display: flex;
1011
+ color: #ffffff;
1012
+ }
1013
+ .tutor-dashboard-header h4{
1014
+ color: #ffffff;
1015
+ margin: 0;
1016
+ }
1017
+ .tutor-dashboard-header-avatar{
1018
+ margin-right: 20px;
1019
+ }
1020
+ .tutor-dashboard-header-info {
1021
+ flex: 1;
1022
+ padding-top: 15px;
1023
+ }
1024
+ .tutor-dashboard-header-display-name {
1025
+ margin-bottom: 10px;
1026
+ }
1027
+ .tutor-dashboard-header-stats {
1028
+ display: flex;
1029
+ }
1030
+ .tutor-dashboard-header-social-wrap {
1031
+ flex: 1;
1032
+ }
1033
+ .tutor-dashboard-header-ratings, .tutor-dashboard-header-notifications {
1034
+ margin-left: 20px;
1035
+ }
1036
+ .tutor-dashboard-header-social-wrap a{
1037
+ color: #90949E;
1038
+ }
1039
+ .tutor-dashboard-header-social-wrap a:hover {
1040
+ color: #ffffff;
1041
+ }
1042
+ .tutor-notification-text {
1043
+ position: relative;
1044
+ padding-right: 15px;
1045
+ margin: 0;
1046
+ }
1047
+ .tutor-dashboard-left-menu{
1048
+ border-right: 1px solid #DCDFE5;
1049
+ padding-right: 0;
1050
+ }
1051
+ .tutor-notification-text span{
1052
+ position: absolute;
1053
+ background-color: #ff0000;
1054
+ color: #ffffff;
1055
+ border-radius: 50%;
1056
+ padding: 0 5px;
1057
+ font-size: 12px;
1058
+ top: -5px;
1059
+ right: 0;
1060
+ }
1061
+ .tutor-dashboard-header-avatar img{
1062
+ height: 100px;
1063
+ width: 100px;
1064
+ border-radius: 50%;
1065
+ border: 3px solid #ffffff;
1066
+ }
1067
  .tutor-dashboard-avater img{
1068
  width: 70px;
1069
  height: 70px;
1070
  display: block;
1071
  border-radius: 50%;
1072
  }
 
1073
  .tutor-dashboard-student-info h4{
1074
  font-size: 18px;
1075
  color: var(--tutor-light-color);
1076
  margin-bottom: 0;
1077
  }
 
 
1078
  .tutor-dashboard-student-info h4 a{
1079
  color: var(--tutor-text-color);
1080
  }
 
1081
  .tutor-dashboard-user-role{
1082
  font-size: 14px;
1083
  font-weight: 400;
1084
  }
 
1085
  .tutor-dashboard-student-meta ul{
1086
  list-style: none;
1087
  margin: 20px 0 40px;
1090
  border-bottom: 1px solid #DCDFE5;
1091
  font-size: 14px;
1092
  }
 
1093
  .tutor-dashboard-student-meta ul li{
1094
  display: inline-block;
1095
  color: var(--tutor-text-color);
1096
  margin-left: 60px;
1097
  }
1098
+ .tutor-dashboard-inline-links{
1099
+ margin-bottom: 20px;
1100
+ }
1101
+ .tutor-dashboard-inline-links ul{
1102
+ margin: 0;
1103
+ padding: 0;
1104
+ border-bottom: 1px solid #DFE1E5;
1105
+ }
1106
+ .tutor-dashboard-inline-links ul li{
1107
+ display: inline-block;
1108
+ }
1109
+ .tutor-dashboard-inline-links ul li a{
1110
+ display: block;
1111
+ padding: 5px 10px;
1112
+ color: #4B5981;
1113
+ margin-bottom: -1px;
1114
+ line-height: 40px;
1115
+ }
1116
+ .tutor-dashboard-inline-links ul li a:hover, .tutor-dashboard-inline-links ul li.active a {
1117
+ color: #3057D5;
1118
+ border-bottom: 1px solid #3057D5;
1119
+ padding-bottom: 4px;
1120
+ }
1121
  .tutor-dashboard-student-meta ul li:first-child{
1122
  margin-left: 0;
1123
  }
1142
  color: var(--tutor-light-color);
1143
  font-weight: 400;
1144
  }
 
 
1145
  .tutor-dashboard-permalinks{
1146
  list-style: none;
1147
+ margin: 30px 0 20px;
 
 
1148
  font-size: 14px;
1149
  padding: 0;
1150
  }
1151
  .tutor-dashboard-permalinks li:not(:last-child){
1152
+
1153
+ }
1154
+ .tutor-dashboard-permalinks li a:hover{
1155
+ background-color: #EDF0F9;
1156
+ }
1157
+ .tutor-dashboard-permalinks li.active a{
1158
+ background-color: #3057D5;
1159
+ color: #ffffff;
1160
  }
1161
 
1162
  @media (max-width: 991px) {
1177
  }
1178
  }
1179
 
 
 
1180
  .tutor-dashboard-permalinks li a{
1181
  display: block;
1182
  color: var(--tutor-text-color);
1191
  margin-bottom: 17px;
1192
  }
1193
 
1194
+ /** Earning */
1195
+ .tutor-dashboard-earning-info-row {
1196
+ display: flex;
1197
+ flex-wrap: wrap;
1198
+ }
1199
+ .tutor-dashboard-earning-sum{
1200
+ flex: 0 0 150px;
1201
+ background-color: #f4f4f4;
1202
+ margin: 10px;
1203
+ padding: 10px;
1204
+ border: 1px solid #dddddd;
1205
+ }
1206
+ .tutor-dashboard-earning-sum p{
1207
+ margin: 0;
1208
+ }
1209
+ .tutor-dashboard-earning-sum p.text-small{
1210
+ font-size: 12px;
1211
+ color: #666666;
1212
+ }
1213
+
1214
+ /** Earning Report */
1215
+ .tutor-date-range-filter-wrap{
1216
+ display: flex;
1217
+ margin: 15px 0;
1218
+ font-size: 12px;
1219
+ }
1220
+ .report-top-sub-menu{
1221
+ margin: 0;
1222
+ flex: 1;
1223
+ }
1224
+ .report-top-sub-menu a{
1225
+ text-decoration: none;
1226
+ padding: 5px 8px;
1227
+ border: 1px solid #D7DADF;
1228
+ color: #AAAEB3;
1229
+ display: inline-block;
1230
+ }
1231
+ .report-top-sub-menu a.active {
1232
+ background-color: #3057D5;
1233
+ color: #ffffff;
1234
+ border: 1px solid #3057D5;
1235
+ }
1236
 
1237
+ .report-date-range-form{
1238
+ display: flex;
1239
+ }
1240
+ .date-range-input{
1241
+ position: relative;
1242
+ margin-right: 0;
1243
+ }
1244
+ .date-range-input:last-child{
1245
+ margin-right: 0;
1246
+ }
1247
+ .date-range-input input, .date-range-input input[type=text]{
1248
+ border: 1px solid #D7DADF;
1249
+ box-shadow: none;
1250
+ line-height: 29px;
1251
+ margin: 0;
1252
+ padding-right: 30px;
1253
+ padding-top: 0;
1254
+ padding-bottom: 0;
1255
+ }
1256
+ .date-range-input i.tutor-icon-calendar{
1257
+ position: absolute;
1258
+ right: 10px;
1259
+ top: 7px;
1260
+ }
1261
+ .date-range-input button{
1262
+ background-color: #3057D5;
1263
+ color: #ffffff;
1264
+ border: none;
1265
+ line-height: 30px;
1266
+ padding: 0 15px;
1267
+ }
1268
+ .report-download-csv-icon{
1269
+ float: right;
1270
+ }
1271
+ .report-download-csv-icon a{
1272
+ text-decoration: none;
1273
+ }
1274
+ table.tutor-dashboard-statement-table p{
1275
+ margin: 0;
1276
+ padding: 0;
1277
+ }
1278
+ table.tutor-dashboard-statement-table p.small-text {
1279
+ font-size: 12px;
1280
+ color: #666666;
1281
+ }
1282
+ /** ENd earning report **/
1283
 
1284
+ /**
1285
+ Withdraw Method
1286
+ */
1287
+ .withdraw-method-select-wrap{
1288
+ display: flex;
1289
+ flex-wrap: wrap;
1290
+ }
1291
+ .withdraw-method-select{
1292
+ margin-right: 10px;
1293
+ }
1294
+ .withdraw-method-select-wrap label {
1295
+ background: #f4f4f4;
1296
+ padding: 30px 50px;
1297
+ display: block;
1298
+ border: 1px solid #dddddd;
1299
+ cursor: pointer;
1300
+ font-size: 20px;
1301
+ text-align: center;
1302
+ }
1303
+ .withdraw-method-select-wrap label p{
1304
+ margin-bottom: 10px;
1305
+ }
1306
+ .withdraw-method-select-wrap input:checked + label{
1307
+ background-color: #03b423;
1308
+ border: 1px solid #039623;
1309
+ color: #ffffff;
1310
+ }
1311
+ .withdraw-method-forms-wrap{
1312
+ margin: 20px 0;
1313
+ }
1314
+ .withdraw-method-forms-wrap label{
1315
+ display: block;
1316
+ margin: 5px 0;
1317
+ }
1318
+ .withdraw-method-form{
1319
+ display: flex;
1320
+ flex-wrap: wrap;
1321
+ }
1322
+ .withdraw-method-field-wrap{
1323
+ width: 50%;
1324
+ }
1325
+ .withdraw-method-field-wrap input{
1326
+ width: 90%;
1327
+ }
1328
+ .withdraw-account-save-btn-wrap{
1329
+ width: 100%;
1330
+ margin: 20px 0;
1331
+ }
1332
+ .withdraw-account-save-btn-wrap button:focus{
1333
+ outline: none;
1334
+ }
1335
+
1336
+ .withdraw-page-current-balance {
1337
+ padding: 10px 20px;
1338
+ border: 1px solid #eee;
1339
+ margin-bottom: 20px;
1340
+ }
1341
+ .withdraw-balance-row{
1342
+ display: flex;
1343
+ border-bottom: 1px solid #eee;
1344
+ margin-bottom: 15px;
1345
+ }
1346
+ .withdraw-balance-col{
1347
+ flex: 1;
1348
+ }
1349
+ .open-withdraw-form-btn{
1350
+ display: block;
1351
+ background-color: #3057D5;
1352
+ color: #ffffff;
1353
+ padding: 5px 10px;
1354
+ }
1355
+ .open-withdraw-form-btn:hover {
1356
+ background-color: #2b4eac;
1357
+ }
1358
+ .tutor-earning-withdraw-form-wrap{
1359
+ padding: 10px 20px;
1360
+ border: 1px solid #eee;
1361
+ margin-bottom: 20px;
1362
+ }
1363
+ .withdraw-form-field-row {
1364
+ display: flex;
1365
+ }
1366
+ .withdraw-form-field-amount {
1367
+ width: 200px;
1368
+ margin-right: 10px;
1369
+ }
1370
+ .withdraw-form-field-amount input{
1371
+ width: 100%;
1372
+ }
1373
+ .withdraw-history-table-wrap{
1374
+ padding: 10px 20px;
1375
+ border: 1px solid #eee;
1376
+ margin-bottom: 20px;
1377
+ }
1378
+ .withdraw-history-table-title{
1379
+ border-bottom: 1px solid #eee;
1380
+ margin-bottom: 20px;
1381
+ }
1382
+ /** END Withdraw */
1383
+
1384
+ /**
1385
+ DatePicker
1386
+ */
1387
+ .ui-datepicker {
1388
+ background-color: #fff;
1389
+ border: 1px solid #EEEEEE;
1390
+ display: none;
1391
+ margin-top: 4px;
1392
+ padding: 5px;
1393
+ width: 180px;
1394
+ }
1395
+ .ui-datepicker a,
1396
+ .ui-datepicker a:hover {
1397
+ text-decoration: none;
1398
+ }
1399
+ .ui-datepicker a:hover,
1400
+ .ui-datepicker td:hover a {
1401
+ color: #2A6496;
1402
+ -webkit-transition: color 0.1s ease-in-out;
1403
+ -moz-transition: color 0.1s ease-in-out;
1404
+ -o-transition: color 0.1s ease-in-out;
1405
+ transition: color 0.1s ease-in-out;
1406
+ }
1407
+ .ui-datepicker .ui-datepicker-header {
1408
+ margin-bottom: 4px;
1409
+ text-align: center;
1410
+ }
1411
+ .ui-datepicker .ui-datepicker-title {
1412
+ font-weight: 700;
1413
+ }
1414
+ .ui-datepicker .ui-datepicker-prev,
1415
+ .ui-datepicker .ui-datepicker-next {
1416
+ cursor: default;
1417
+ font-family: 'tutor';
1418
+ -webkit-font-smoothing: antialiased;
1419
+ font-style: normal;
1420
+ font-weight: normal;
1421
+ height: 20px;
1422
+ line-height: 1;
1423
+ margin-top: 2px;
1424
+ width: 30px;
1425
+ }
1426
+ .ui-datepicker .ui-datepicker-prev {
1427
+ float: left;
1428
+ text-align: left;
1429
+ }
1430
+ .ui-datepicker .ui-datepicker-next {
1431
+ float: right;
1432
+ text-align: right;
1433
+ }
1434
+ .ui-datepicker .ui-datepicker-prev:before {
1435
+ content: "\e921";
1436
+ }
1437
+ .ui-datepicker .ui-datepicker-next:before {
1438
+ content: "\e903";
1439
+ }
1440
+ .ui-datepicker .ui-icon {
1441
+ display: none;
1442
+ }
1443
+ .ui-datepicker .ui-datepicker-calendar {
1444
+ table-layout: fixed;
1445
+ width: 100%;
1446
+ }
1447
+ .ui-datepicker .ui-datepicker-calendar th,
1448
+ .ui-datepicker .ui-datepicker-calendar td {
1449
+ text-align: center;
1450
+ padding: 0;
1451
+ }
1452
+ .ui-datepicker .ui-datepicker-calendar td {
1453
+ border-radius: 4px;
1454
+ -webkit-transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out;
1455
+ -moz-transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out;
1456
+ -o-transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out;
1457
+ transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out;
1458
+ }
1459
+ .ui-datepicker .ui-datepicker-calendar td:hover {
1460
+ background-color: #eee;
1461
+ cursor: pointer;
1462
+ }
1463
+ .ui-datepicker .ui-datepicker-calendar td a {
1464
+ text-decoration: none;
1465
+ }
1466
+ .ui-datepicker .ui-datepicker-current-day {
1467
+ background-color: #4289cc;
1468
+ }
1469
+ .ui-datepicker .ui-datepicker-current-day a {
1470
+ color: #fff
1471
+ }
1472
+ .ui-datepicker .ui-datepicker-calendar .ui-datepicker-unselectable:hover {
1473
+ background-color: #fff;
1474
+ cursor: default;
1475
+ }
1476
+
1477
+ .ui-datepicker-calendar .ui-state-default {
1478
+ border: none;
1479
+ background: none;
1480
+ }
1481
+ .ui-datepicker-calendar .ui-state-default.ui-state-highlight {
1482
+ background: #EEEEEE;
1483
+ padding: 3px;
1484
+ display: block;
1485
+ }
1486
+
1487
+ /** End DatePicker **/
1488
+
1489
+ /*.tutor-dashboard-content-inner:not(:empty){}*/
1490
+ .tutor-dashboard-content{
1491
+ margin-top: 20px;
1492
+ }
1493
  .tutor-dashboard-content-inner .tutor-mycourse-wrap{
 
1494
  border: 1px solid #DCDFE5;
1495
  border-radius: 4px;
1496
  margin-bottom: 30px;
1497
+ display: flex;
1498
+ }
1499
+ .tutor-mycourse-thumbnail {
1500
+ flex: 0 0 250px;
1501
+ }
1502
+ .tutor-mycourse-content {
1503
+ padding: 20px;
1504
+ flex: 1;
1505
+ }
1506
+ .tutor-mycourse-content h3{
1507
+ margin: 0;
1508
  }
 
1509
  .tutor-mycourse-rating{
1510
  color: #F8C51C;
1511
  font-size: 12px;
1512
  }
 
1513
  .tutor-mycourse-rating i{
1514
  margin-right: 4px;
1515
  }
 
1516
  .tutor-dashboard-content-inner{
1517
  font-size: 14px;
1518
  }
 
1519
  .tutor-dashboard-content-inner .tutor-mycourse-wrap p:last-child{
1520
  margin-bottom: 0;
1521
  }
1522
+ .tutor-mycourse-content .mycourse-footer {
1523
+ display: flex;
1524
+ }
1525
+ .tutor-mycourse-content .mycourse-footer .tutor-mycourses-stats{
1526
+ flex: 1;
1527
+ }
1528
+ .tutor-mycourse-status{
1529
+ margin-right: 15px;
1530
+ }
1531
  .tutor-dashboard-content-inner h3 a{
1532
  color: var(--tutor-text-color);
1533
  font-size: 22px;
1539
  .tutor-dashboard-content-inner .tutor-course-metadata ul{
1540
  display: block;
1541
  list-style: none;
1542
+ margin: 0 0 10px;
1543
  padding: 0;
1544
  font-size: 14px;
1545
  }
1546
 
1547
  .tutor-dashboard-content-inner .tutor-progress-bar-wrap{
1548
+ margin-bottom: 0;
1549
  }
1550
  .tutor-dashboard-content-inner .tutor-course-metadata li{
1551
  display: inline-block;
1656
  .single-instructor-wrap .single-instructor-bottom .ratings .rating-generated{
1657
  color: #f8c51c;
1658
  }
1659
+ .tutor-pagination{
1660
+ margin: 20px 0;
1661
+ }
1662
+ .tutor-pagination .page-numbers {
1663
+ display: inline-block;
1664
+ padding: 5px 10px;
1665
+ margin: 0 2px 0 0;
1666
+ border: 1px solid #eee;
1667
+ line-height: 1;
1668
+ text-decoration: none;
1669
+ border-radius: 2px;
1670
+ }
1671
+ .tutor-pagination .page-numbers.current,
1672
+ a.page-numbers:hover {
1673
+ background: #3057D5;
1674
+ border: 1px solid #2544D5;
1675
+ color: #ffffff;
1676
+ }
1677
+ .tutor-dashboard-pagination-results-stats{
1678
+ margin: 10px 0 30px;
1679
+ }
1680
+ .statement-address {
1681
+ margin: 10px 0;
1682
+ font-size: 14px;
1683
+ color: #555;
1684
+ }
1685
+ .statement-order-completed {
1686
+ background: #0eb91b;
1687
+ color: #fff;
1688
+ padding: 2px 5px;
1689
+ border: none;
1690
+ }
1691
  /* *********************** */
1692
  /* Single Lesson */
1693
  /************************ */
1810
  }
1811
  .tutor-lessons-under-topic .tutor-single-lesson-items.active .tutor-lesson-right-icons .tutor-lesson-complete.tutor-done,
1812
  .tutor-lessons-under-topic .tutor-lesson-right-icons .tutor-lesson-complete.tutor-done{
1813
+ background: var(--tutor-success-button-color);
1814
+ border-color: var(--tutor-success-button-color);
1815
  color: #fff;
1816
  }
1817
  .tutor-lessons-under-topic .tutor-lesson-right-icons i{
1829
  align-items: center;
1830
  justify-content: space-between;
1831
  }
1832
+
1833
+ .tutor-single-page-top-bar .tutor-single-lesson-segment{
1834
+ margin-bottom: 0;
1835
+ }
1836
+
1837
  .tutor-single-page-top-bar a{
1838
  color: #ffffff;
1839
  }
1840
 
1841
+ .tutor-topbar-home-btn{
1842
+ margin-left: 20px;
1843
+ }
1844
+
1845
+ .tutor-single-page-top-bar .tutor-single-lesson-segment button.course-complete-button{
1846
+ background: #fff;
1847
+ color: var(--tutor-primary-color);
1848
+ margin-right: 15px;
1849
+ padding-top: 13px;
1850
+ padding-bottom: 13px;
1851
+ cursor: pointer;
1852
+ }
1853
+
1854
+ .tutor-single-page-top-bar .tutor-single-lesson-segment button.course-complete-button:hover{
1855
+ color: #fff;
1856
+ background: var(--tutor-primary-hover-color);
1857
+ border-color: var(--tutor-primary-hover-color);
1858
+ }
1859
+
1860
  .tutor-single-page-top-bar a:hover{
1861
  color: #ffffff;
1862
  }
1873
  line-height: 1;
1874
  margin-right: 3px;
1875
  }
 
 
 
 
1876
  .tutor-lesson-content-area, .tutor-quiz-single-wrap {
1877
  margin: 0 100px;
1878
  }
1879
  .tutor-lesson-sidebar-hide-bar{
1880
+ background-color: var(--tutor-primary-hover-color);
1881
  color: #ffffff;
1882
  padding: 0 18px;
1883
  display: inline-block;
2033
  .tutor-progress-bar .tutor-progress-filled:after{
2034
  content: '';
2035
  position: absolute;
2036
+ height: 15px;
2037
+ width: 15px;
2038
+ border: 7.5px solid var(--tutor-primary-color);
2039
  border-radius: 50%;
2040
  background: #fff;
2041
  left: var(--tutor-progress-left);
2288
  text-align: left;
2289
  }
2290
  .tutor-star-rating-group i{
2291
+ /*cursor: pointer;*/
2292
  margin-right: 4px;
2293
  }
2294
  .tutor-queston-and-answer-wrap{
2340
  animation: spin 2s infinite linear;
2341
  display: inline-block;
2342
  }
2343
+ .loading-lesson .tutor-lesson-video-wrap:before{
2344
  font-family: 'tutor';
 
2345
  content: "\e91d";
2346
  -webkit-animation: spin 2s infinite linear;
2347
  animation: spin 2s infinite linear;
2349
  z-index: 9;
2350
  position: absolute;
2351
  left: 50%;
2352
+ top: 50%;
2353
  font-size: 50px;
2354
+ margin-left: -25px;
2355
+ margin-top: -12px;
2356
  }
2357
+ .loading-lesson .tutor-lesson-video-wrap:after {
2358
  position: absolute;
2359
  content: "";
2360
  top: 0;
2361
+ left: 0;
2362
  background: rgba(255,255,255, 0.8);
2363
  width: 100%;
2364
+ height: 100%;
2365
+ }
2366
+
2367
+ .tutor-lesson-video-wrap{
2368
+ position: relative;
2369
  }
2370
+
2371
  /**
2372
  Course question and answer
2373
  */
2634
  margin-bottom: 80px;
2635
  }
2636
  .fill-in-the-blank-field {
2637
+
 
 
 
 
 
 
2638
  }
2639
  .fill-in-the-blank-field .fill-in-the-blank-text-input {
2640
+ display: inline;
 
 
2641
  border-top: none;
2642
  border-left: none;
2643
  border-right: none;
2664
  height: 175px;
2665
  border-radius: 5px;
2666
  box-shadow: none;
2667
+ min-width: 740px;
2668
  margin-bottom: 5px;
2669
  }
2670
  .tutor-quiz-answers-wrap textarea:focus{
2675
 
2676
  .tutor-quiz-answers-wrap p{
2677
  margin: 0;
2678
+ line-height: 26px;
2679
  }
2680
  .quiz-answer-input-body .quiz-answer-image-wrap {
2681
  margin-top: 10px;
2789
  padding-right: 0;
2790
  width: 25%;
2791
  padding: 0 10px;
2792
+ vertical-align: top;
2793
  }
2794
 
2795
 
2812
  border: 1px solid #D4DADB;
2813
  margin-right: 10px;
2814
  margin-bottom: 10px;
2815
+ /*max-width: 215px;*/
2816
  background-color: #fff;
2817
  display: -webkit-inline-box;
2818
  display: -ms-inline-flexbox;
2912
  .quiz-image-answering-answer {
2913
  margin-right: 10px;
2914
  margin-left: 10px;
2915
+ width: 15%;
2916
  }
2917
  .quiz-image-answering-image-wrap {
2918
  margin-bottom: 20px;
2924
  box-shadow: none;
2925
  background: transparent;
2926
  border-radius: 2px;
2927
+ height: 42px;
2928
  }
2929
 
2930
  .tutor-quiz-answers-wrap .quiz-image-answering-input-field-wrap input:focus{
3025
  }
3026
  .tutor-login-form-wrap input[type="submit"]{
3027
  color: #fff;
3028
+ background-color: var(--tutor-success-button-color);
3029
+ border-color: var(--tutor-success-button-color);
3030
  display: inline-block;
3031
  padding: 15px 30px;
3032
  border-radius: 4px;
3172
  }
3173
 
3174
  .tutor-form-group.tutor-reg-form-btn-wrap .tutor-button{
3175
+ background: var(--tutor-success-button-color);
3176
+ border-color: var(--tutor-success-button-color);
3177
  }
3178
 
3179
  /* ********************* */
3369
  height: 5px;
3370
  }
3371
  .rating-meter-col.rating-text-col{
3372
+ flex: 0 0 auto;
3373
  }
3374
 
3375
  /* ********************* */
3419
  margin-top: 20px;
3420
  }
3421
 
3422
+
3423
+ /* ********************************** */
3424
+ /* Addon Support Course Prerequisites */
3425
+ /* ********************************** */
3426
+
3427
+ #tutor-single-entry-content .tutor-course-prerequisites{
3428
+ padding: 60px;
 
 
3429
  }
3430
+
3431
+ .prerequisites-course-lists{
3432
+ padding: 0;
3433
  list-style: none;
3434
  }
3435
+
3436
+
3437
+ .prerequisites-course-lists li a{
3438
+ padding: 13px 15px;
3439
+ border: 1px solid #DCDFE5;
3440
+ margin-bottom: 20px;
3441
+ border-radius: 4px;
3442
+ font-weight: 500;
3443
+ color: #4B5981;
3444
+ font-size: 16px;
3445
  }
3446
+
3447
+ .prerequisites-course-lists li:first-child{
3448
+ padding: 13px 40px 13px 60px;
3449
+ border: 1px solid #f7e5b9;
3450
+ margin-bottom: 20px;
3451
+ border-radius: 4px;
3452
+ font-weight: 500;
3453
+ font-size: 14px;
3454
+ background: #fffff5;
3455
+ color: #b39f70;
3456
+ position: relative;
3457
  }
3458
+
3459
+ .prerequisites-course-lists li:first-child > span{
3460
  position: absolute;
3461
+ left: 20px;
3462
+ top: 13px;
 
 
3463
  }
3464
 
3465
+ .prerequisites-course-lists li .prerequisites-course-item{
3466
+ display: flex;
3467
+ align-items: center;
3468
+ }
3469
+
3470
+ .prerequisites-course-feature-image{
3471
+ width: 70px;
3472
+ overflow: hidden;
3473
+ border-radius: 2px;
3474
+ }
3475
+
3476
+ .prerequisites-course-lists li .prerequisites-course-title{
3477
+ flex-grow: 1;
3478
+ padding-left: 15px;
3479
+ transition: 300ms;
3480
+ }
3481
+
3482
+ .prerequisites-course-lists li a:hover .prerequisites-course-title{
3483
+ color: var(--tutor-primary-color);
3484
+ }
3485
+
3486
+
3487
+ .prerequisites-course-checkmark{
3488
+ line-height: 24px;
3489
+ height: 24px;
3490
+ text-transform: uppercase;
3491
+ font-size: 12px;
3492
+ font-weight: 700;
3493
+ min-width: 107px;
3494
+ }
3495
+ .prerequisites-course-checkmark i{
3496
+ height: 24px;
3497
+ width: 24px;
3498
+ background: #DBDDDD;
3499
+ color: #DBDDDD;
3500
+ display: inline-block;
3501
+ text-align: center;
3502
+ border-radius: 2px;
3503
+ margin-right: 3px;
3504
+ }
3505
+ .prerequisites-course-checkmark.is-complete i{
3506
+ background: #86B223;
3507
+ color: #fff;
3508
+ }
3509
 
3510
  /*
3511
  social share
3528
  }
3529
 
3530
  .tutor-single-course-meta ul li.tutor-social-share button:hover{
3531
+ color: var(--tutor-primary-color);
3532
+ }
3533
+
3534
+
3535
+ /* ************************* */
3536
+ /* ******** RTL CSS ******** */
3537
+ /* ************************* */
3538
+
3539
+ .rtl .tutor-single-course-meta ul li.tutor-social-share{
3540
+ float: left;
3541
+ }
3542
+
3543
+ .rtl .tutor-single-course-meta ul li,
3544
+ .rtl .tutor-loop-author > div{
3545
+ float: right;
3546
+ }
3547
+
3548
+
3549
+ .rtl .tutor-single-course-meta ul li{
3550
+ margin-right: 0;
3551
+ margin-left: 40px;
3552
+ }
3553
+
3554
+ .rtl .tutor-wrap nav.course-enrolled-nav ul li a{
3555
+ margin-right: 0;
3556
+ margin-left: 20px;
3557
+ }
3558
+
3559
+ .rtl .tutor-progress-bar .tutor-progress-filled:after{
3560
+ left: auto;
3561
+ right: var(--tutor-progress-left);
3562
+ transform: translateY(-50%) translateX(50%);
3563
+ }
3564
+
3565
+ .rtl .tutor-progress-percent{
3566
+ padding-left: 0;
3567
+ padding-right: 20px;
3568
+ }
3569
+
3570
+ .rtl .tutor-course-lesson h5 i{
3571
+ margin-right: 0;
3572
+ margin-left: 10px;
3573
+ }
3574
+ .rtl .tutor-course-lesson h5 .lesson-preview-icon i {
3575
+ margin-right: 10px;
3576
+ margin-left: 0;
3577
+ }
3578
+
3579
+ .rtl .tutor-course-lesson h5 .tutor-lesson-duration{
3580
+ flex-grow: 1;
3581
+ text-align: left;
3582
+ }
3583
+
3584
+ .rtl .tutor-custom-list-style li {
3585
+ padding-right: 25px;
3586
+ padding-left: 0px;
3587
+ }
3588
+
3589
+ .rtl .tutor-custom-list-style li:before{
3590
+ left: auto;
3591
+ right: 0;
3592
+ }
3593
+
3594
+ .rtl .single-instructor-wrap .instructor-name,
3595
+ .rtl .single-instructor-wrap .instructor-avatar,
3596
+ .rtl .single-instructor-wrap .tutor-instructor-left{
3597
+ float: right;
3598
+ }
3599
+
3600
+ .rtl .single-instructor-wrap .instructor-name{
3601
+ padding-left: 0;
3602
+ padding-right: 20px;
3603
+ }
3604
+
3605
+ .rtl .single-instructor-wrap .instructor-bio{
3606
+ padding-left: 0;
3607
+ padding-right: 260px;
3608
+ }
3609
+
3610
+ .rtl .tutor-single-page-top-bar .tutor-topbar-back-to-curse-wrap{
3611
+ margin-left: 30px;
3612
+ margin-right: 0;
3613
+ }
3614
+
3615
+ .rtl .tutor-single-lesson-button-group .tutor-single-lesson-button a,
3616
+ .rtl .tutor-topics-in-single-lesson .tutor-single-lesson-items a{
3617
+ padding: 14px 17px 14px 100px;
3618
+ }
3619
+
3620
+ .rtl .tutor-lessons-under-topic .tutor-lesson-right-icons{
3621
+ right: auto;
3622
+ left: 15px;
3623
+ }
3624
+
3625
+ .rtl .tutor-lessons-under-topic .tutor-lesson-right-icons .tutor-lesson-complete{
3626
+ margin-left: 0;
3627
+ margin-right: 8px;
3628
+ }
3629
+ .rtl .tutor-single-lesson-button-group .tutor-single-lesson-button a > i:first-child,
3630
+ .rtl .tutor-topics-in-single-lesson .tutor-single-lesson-items a > i:first-child{
3631
+ margin-right: 0;
3632
+ margin-left: 10px;
3633
+ }
3634
+ .rtl .tutor-topbar-home-btn{
3635
+ margin-left: 0;
3636
+ margin-right: 20px;
3637
+ }
3638
+ .rtl .tutor-single-page-top-bar .tutor-single-lesson-segment button.course-complete-button{
3639
+ margin-left: 15px;
3640
+ margin-right: 0;
3641
  }
assets/js/Chart.bundle.min.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Chart.js
3
+ * http://chartjs.org/
4
+ * Version: 2.7.3
5
+ *
6
+ * Copyright 2018 Chart.js Contributors
7
+ * Released under the MIT license
8
+ * https://github.com/chartjs/Chart.js/blob/master/LICENSE.md
9
+ */
10
+ !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Chart=t()}}(function(){return function r(o,s,l){function u(e,t){if(!s[e]){if(!o[e]){var n="function"==typeof require&&require;if(!t&&n)return n(e,!0);if(d)return d(e,!0);var i=new Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}var a=s[e]={exports:{}};o[e][0].call(a.exports,function(t){return u(o[e][1][t]||t)},a,a.exports,r,o,s,l)}return s[e].exports}for(var d="function"==typeof require&&require,t=0;t<l.length;t++)u(l[t]);return u}({1:[function(t,e,n){var r=t(5);function i(t){if(t){var e=[0,0,0],n=1,i=t.match(/^#([a-fA-F0-9]{3})$/i);if(i){i=i[1];for(var a=0;a<e.length;a++)e[a]=parseInt(i[a]+i[a],16)}else if(i=t.match(/^#([a-fA-F0-9]{6})$/i)){i=i[1];for(a=0;a<e.length;a++)e[a]=parseInt(i.slice(2*a,2*a+2),16)}else if(i=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(a=0;a<e.length;a++)e[a]=parseInt(i[a+1]);n=parseFloat(i[4])}else if(i=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(a=0;a<e.length;a++)e[a]=Math.round(2.55*parseFloat(i[a+1]));n=parseFloat(i[4])}else if(i=t.match(/(\w+)/)){if("transparent"==i[1])return[0,0,0,0];if(!(e=r[i[1]]))return}for(a=0;a<e.length;a++)e[a]=d(e[a],0,255);return n=n||0==n?d(n,0,1):1,e[3]=n,e}}function a(t){if(t){var e=t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[d(parseInt(e[1]),0,360),d(parseFloat(e[2]),0,100),d(parseFloat(e[3]),0,100),d(isNaN(n)?1:n,0,1)]}}}function o(t){if(t){var e=t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[d(parseInt(e[1]),0,360),d(parseFloat(e[2]),0,100),d(parseFloat(e[3]),0,100),d(isNaN(n)?1:n,0,1)]}}}function s(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function l(t,e){return"rgba("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%, "+(e||t[3]||1)+")"}function u(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function d(t,e,n){return Math.min(Math.max(e,t),n)}function h(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}e.exports={getRgba:i,getHsla:a,getRgb:function(t){var e=i(t);return e&&e.slice(0,3)},getHsl:function(t){var e=a(t);return e&&e.slice(0,3)},getHwb:o,getAlpha:function(t){var e=i(t);{if(e)return e[3];if(e=a(t))return e[3];if(e=o(t))return e[3]}},hexString:function(t){return"#"+h(t[0])+h(t[1])+h(t[2])},rgbString:function(t,e){if(e<1||t[3]&&t[3]<1)return s(t,e);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:s,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return l(t,e);var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+n+"%, "+i+"%, "+a+"%)"},percentaString:l,hslString:function(t,e){if(e<1||t[3]&&t[3]<1)return u(t,e);return"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:u,hwbString:function(t,e){void 0===e&&(e=void 0!==t[3]?t[3]:1);return"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return c[t.slice(0,3)]}};var c={};for(var f in r)c[r[f]]=f},{5:5}],2:[function(t,e,n){var d=t(4),i=t(1),o=function(t){return t instanceof o?t:this instanceof o?(this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},void("string"==typeof t?(e=i.getRgba(t))?this.setValues("rgb",e):(e=i.getHsla(t))?this.setValues("hsl",e):(e=i.getHwb(t))&&this.setValues("hwb",e):"object"==typeof t&&(void 0!==(e=t).r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e)))):new o(t);var e};o.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t=(t%=360)<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return i.hexString(this.values.rgb)},rgbString:function(){return i.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return i.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return i.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return i.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return i.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return i.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return i.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],n=0;n<t.length;n++){var i=t[n]/255;e[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return n<e?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return 7.1<=e?"AAA":4.5<=e?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=this,i=t,a=void 0===e?.5:e,r=2*a-1,o=n.alpha()-i.alpha(),s=((r*o==-1?r:(r+o)/(1+r*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*i.red(),s*n.green()+l*i.green(),s*n.blue()+l*i.blue()).alpha(n.alpha()*a+i.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new o,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&(t=i[r],"[object Array]"===(e={}.toString.call(t))?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return n}},o.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},o.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},o.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i<t.length;i++)n[t.charAt(i)]=e[t][i];return 1!==e.alpha&&(n.a=e.alpha),n},o.prototype.setValues=function(t,e){var n,i,a=this.values,r=this.spaces,o=this.maxes,s=1;if(this.valid=!0,"alpha"===t)s=e;else if(e.length)a[t]=e.slice(0,t.length),s=e[t.length];else if(void 0!==e[t.charAt(0)]){for(n=0;n<t.length;n++)a[t][n]=e[t.charAt(n)];s=e.a}else if(void 0!==e[r[t][0]]){var l=r[t];for(n=0;n<t.length;n++)a[t][n]=e[l[n]];s=e.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===s?a.alpha:s)),"alpha"===t)return!1;for(n=0;n<t.length;n++)i=Math.max(0,Math.min(o[t][n],a[t][n])),a[t][n]=Math.round(i);for(var u in r)u!==t&&(a[u]=d[t][u](a[t]));return!0},o.prototype.setSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n),this)},o.prototype.setChannel=function(t,e,n){var i=this.values[t];return void 0===n?i[e]:(n===i[e]||(i[e]=n,this.setValues(t,i)),this)},"undefined"!=typeof window&&(window.Color=o),e.exports=o},{1:1,4:4}],3:[function(t,e,n){function a(t){var e,n,i=t[0]/255,a=t[1]/255,r=t[2]/255,o=Math.min(i,a,r),s=Math.max(i,a,r),l=s-o;return s==o?e=0:i==s?e=(a-r)/l:a==s?e=2+(r-i)/l:r==s&&(e=4+(i-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(o+s)/2,[e,100*(s==o?0:n<=.5?l/(s+o):l/(2-s-o)),100*n]}function i(t){var e,n,i=t[0],a=t[1],r=t[2],o=Math.min(i,a,r),s=Math.max(i,a,r),l=s-o;return n=0==s?0:l/s*1e3/10,s==o?e=0:i==s?e=(a-r)/l:a==s?e=2+(r-i)/l:r==s&&(e=4+(i-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),[e,n,s/255*1e3/10]}function o(t){var e=t[0],n=t[1],i=t[2];return[a(t)[0],100*(1/255*Math.min(e,Math.min(n,i))),100*(i=1-1/255*Math.max(e,Math.max(n,i)))]}function s(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-i,1-a)))/(1-e)||0),100*((1-i-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]}function l(t){return S[JSON.stringify(t)]}function u(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255;return[100*(.4124*(e=.04045<e?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=.04045<n?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=.04045<i?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]}function d(t){var e=u(t),n=e[0],i=e[1],a=e[2];return i/=100,a/=108.883,n=.008856<(n/=95.047)?Math.pow(n,1/3):7.787*n+16/116,[116*(i=.008856<i?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(a=.008856<a?Math.pow(a,1/3):7.787*a+16/116))]}function h(t){var e,n,i,a,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return[r=255*l,r,r];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(i=o+1/3*-(u-1))<0&&i++,1<i&&i--,r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*r;return a}function c(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r));i*=255;switch(a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}}function f(t){var e,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,u=s+l;switch(1<u&&(s/=u,l/=u),i=6*o-(e=Math.floor(6*o)),0!=(1&e)&&(i=1-i),a=s+i*((n=1-l)-s),e){default:case 6:case 0:r=n,g=a,b=s;break;case 1:r=a,g=n,b=s;break;case 2:r=s,g=n,b=a;break;case 3:r=s,g=a,b=n;break;case 4:r=a,g=s,b=n;break;case 5:r=n,g=s,b=a}return[255*r,255*g,255*b]}function m(t){var e=t[0]/100,n=t[1]/100,i=t[2]/100,a=t[3]/100;return[255*(1-Math.min(1,e*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a)),255*(1-Math.min(1,i*(1-a)+a))]}function p(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return n=-.9689*a+1.8758*r+.0415*o,i=.0557*a+-.204*r+1.057*o,e=.0031308<(e=3.2406*a+-1.5372*r+-.4986*o)?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,n=.0031308<n?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,i=.0031308<i?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]}function v(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=.008856<(e/=95.047)?Math.pow(e,1/3):7.787*e+16/116,[116*(n=.008856<n?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=.008856<i?Math.pow(i,1/3):7.787*i+16/116))]}function y(t){var e,n,i,a,r=t[0],o=t[1],s=t[2];return a=r<=8?(n=100*r/903.3)/100*7.787+16/116:(n=100*Math.pow((r+16)/116,3),Math.pow(n/100,1/3)),[e=e/95.047<=.008856?e=95.047*(o/500+a-16/116)/7.787:95.047*Math.pow(o/500+a,3),n,i=i/108.883<=.008859?i=108.883*(a-s/200-16/116)/7.787:108.883*Math.pow(a-s/200,3)]}function x(t){var e,n=t[0],i=t[1],a=t[2];return(e=360*Math.atan2(a,i)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(i*i+a*a),e]}function _(t){return p(y(t))}function k(t){var e,n=t[0],i=t[1];return e=t[2]/360*2*Math.PI,[n,i*Math.cos(e),i*Math.sin(e)]}function w(t){return M[t]}e.exports={rgb2hsl:a,rgb2hsv:i,rgb2hwb:o,rgb2cmyk:s,rgb2keyword:l,rgb2xyz:u,rgb2lab:d,rgb2lch:function(t){return x(d(t))},hsl2rgb:h,hsl2hsv:function(t){var e=t[0],n=t[1]/100,i=t[2]/100;return 0!==i?[e,100*(2*(n*=(i*=2)<=1?i:2-i)/(i+n)),100*((i+n)/2)]:[0,0,0]},hsl2hwb:function(t){return o(h(t))},hsl2cmyk:function(t){return s(h(t))},hsl2keyword:function(t){return l(h(t))},hsv2rgb:c,hsv2hsl:function(t){var e,n,i=t[0],a=t[1]/100,r=t[2]/100;return e=a*r,[i,100*(e=(e/=(n=(2-a)*r)<=1?n:2-n)||0),100*(n/=2)]},hsv2hwb:function(t){return o(c(t))},hsv2cmyk:function(t){return s(c(t))},hsv2keyword:function(t){return l(c(t))},hwb2rgb:f,hwb2hsl:function(t){return a(f(t))},hwb2hsv:function(t){return i(f(t))},hwb2cmyk:function(t){return s(f(t))},hwb2keyword:function(t){return l(f(t))},cmyk2rgb:m,cmyk2hsl:function(t){return a(m(t))},cmyk2hsv:function(t){return i(m(t))},cmyk2hwb:function(t){return o(m(t))},cmyk2keyword:function(t){return l(m(t))},keyword2rgb:w,keyword2hsl:function(t){return a(w(t))},keyword2hsv:function(t){return i(w(t))},keyword2hwb:function(t){return o(w(t))},keyword2cmyk:function(t){return s(w(t))},keyword2lab:function(t){return d(w(t))},keyword2xyz:function(t){return u(w(t))},xyz2rgb:p,xyz2lab:v,xyz2lch:function(t){return x(v(t))},lab2xyz:y,lab2rgb:_,lab2lch:x,lch2lab:k,lch2xyz:function(t){return y(k(t))},lch2rgb:function(t){return _(k(t))}};var M={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},S={};for(var D in M)S[JSON.stringify(M[D])]=D},{}],4:[function(t,e,n){var a=t(3),r=function(){return new u};for(var i in a){r[i+"Raw"]=function(e){return function(t){return"number"==typeof t&&(t=Array.prototype.slice.call(arguments)),a[e](t)}}(i);var o=/(\w+)2(\w+)/.exec(i),s=o[1],l=o[2];(r[s]=r[s]||{})[l]=r[i]=function(i){return function(t){"number"==typeof t&&(t=Array.prototype.slice.call(arguments));var e=a[i](t);if("string"==typeof e||void 0===e)return e;for(var n=0;n<e.length;n++)e[n]=Math.round(e[n]);return e}}(i)}var u=function(){this.convs={}};u.prototype.routeSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n))},u.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},u.prototype.getValues=function(t){var e=this.convs[t];if(!e){var n=this.space,i=this.convs[n];e=r[n][t](i),this.convs[t]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(e){u.prototype[e]=function(t){return this.routeSpace(e,arguments)}}),e.exports=r},{3:3}],5:[function(t,e,n){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],6:[function(En,jn,t){var e,n;e=this,n=function(){"use strict";var t,a;function c(){return t.apply(null,arguments)}function s(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function l(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function u(t){return void 0===t}function d(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function h(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function f(t,e){var n,i=[];for(n=0;n<t.length;++n)i.push(e(t[n],n));return i}function g(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function m(t,e){for(var n in e)g(e,n)&&(t[n]=e[n]);return g(e,"toString")&&(t.toString=e.toString),g(e,"valueOf")&&(t.valueOf=e.valueOf),t}function p(t,e,n,i){return De(t,e,n,i,!0).utc()}function v(t){return null==t._pf&&(t._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),t._pf}function b(t){if(null==t._isValid){var e=v(t),n=a.call(e.parsedDateParts,function(t){return null!=t}),i=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n);if(t._strict&&(i=i&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return i;t._isValid=i}return t._isValid}function y(t){var e=p(NaN);return null!=t?m(v(e),t):v(e).userInvalidated=!0,e}a=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),n=e.length>>>0,i=0;i<n;i++)if(i in e&&t.call(this,e[i],i,e))return!0;return!1};var r=c.momentProperties=[];function x(t,e){var n,i,a;if(u(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),u(e._i)||(t._i=e._i),u(e._f)||(t._f=e._f),u(e._l)||(t._l=e._l),u(e._strict)||(t._strict=e._strict),u(e._tzm)||(t._tzm=e._tzm),u(e._isUTC)||(t._isUTC=e._isUTC),u(e._offset)||(t._offset=e._offset),u(e._pf)||(t._pf=v(e)),u(e._locale)||(t._locale=e._locale),0<r.length)for(n=0;n<r.length;n++)u(a=e[i=r[n]])||(t[i]=a);return t}var e=!1;function _(t){x(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===e&&(e=!0,c.updateOffset(this),e=!1)}function k(t){return t instanceof _||null!=t&&null!=t._isAMomentObject}function w(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function M(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=w(e)),n}function o(t,e,n){var i,a=Math.min(t.length,e.length),r=Math.abs(t.length-e.length),o=0;for(i=0;i<a;i++)(n&&t[i]!==e[i]||!n&&M(t[i])!==M(e[i]))&&o++;return o+r}function S(t){!1===c.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function n(a,r){var o=!0;return m(function(){if(null!=c.deprecationHandler&&c.deprecationHandler(null,a),o){for(var t,e=[],n=0;n<arguments.length;n++){if(t="","object"==typeof arguments[n]){for(var i in t+="\n["+n+"] ",arguments[0])t+=i+": "+arguments[0][i]+", ";t=t.slice(0,-2)}else t=arguments[n];e.push(t)}S(a+"\nArguments: "+Array.prototype.slice.call(e).join("")+"\n"+(new Error).stack),o=!1}return r.apply(this,arguments)},r)}var i,D={};function C(t,e){null!=c.deprecationHandler&&c.deprecationHandler(t,e),D[t]||(S(e),D[t]=!0)}function P(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function T(t,e){var n,i=m({},t);for(n in e)g(e,n)&&(l(t[n])&&l(e[n])?(i[n]={},m(i[n],t[n]),m(i[n],e[n])):null!=e[n]?i[n]=e[n]:delete i[n]);for(n in t)g(t,n)&&!g(e,n)&&l(t[n])&&(i[n]=m({},i[n]));return i}function O(t){null!=t&&this.set(t)}c.suppressDeprecationWarnings=!1,c.deprecationHandler=null,i=Object.keys?Object.keys:function(t){var e,n=[];for(e in t)g(t,e)&&n.push(e);return n};var I={};function A(t,e){var n=t.toLowerCase();I[n]=I[n+"s"]=I[e]=t}function F(t){return"string"==typeof t?I[t]||I[t.toLowerCase()]:void 0}function R(t){var e,n,i={};for(n in t)g(t,n)&&(e=F(n))&&(i[e]=t[n]);return i}var L={};function Y(t,e){L[t]=e}function W(t,e,n){var i=""+Math.abs(t),a=e-i.length;return(0<=t?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+i}var N=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,z=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,V={},H={};function B(t,e,n,i){var a=i;"string"==typeof i&&(a=function(){return this[i]()}),t&&(H[t]=a),e&&(H[e[0]]=function(){return W(a.apply(this,arguments),e[1],e[2])}),n&&(H[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function E(t,e){return t.isValid()?(e=j(e,t.localeData()),V[e]=V[e]||function(i){var t,a,e,r=i.match(N);for(t=0,a=r.length;t<a;t++)H[r[t]]?r[t]=H[r[t]]:r[t]=(e=r[t]).match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"");return function(t){var e,n="";for(e=0;e<a;e++)n+=P(r[e])?r[e].call(t,i):r[e];return n}}(e),V[e](t)):t.localeData().invalidDate()}function j(t,e){var n=5;function i(t){return e.longDateFormat(t)||t}for(z.lastIndex=0;0<=n&&z.test(t);)t=t.replace(z,i),z.lastIndex=0,n-=1;return t}var U=/\d/,G=/\d\d/,q=/\d{3}/,Z=/\d{4}/,X=/[+-]?\d{6}/,J=/\d\d?/,$=/\d\d\d\d?/,K=/\d\d\d\d\d\d?/,Q=/\d{1,3}/,tt=/\d{1,4}/,et=/[+-]?\d{1,6}/,nt=/\d+/,it=/[+-]?\d+/,at=/Z|[+-]\d\d:?\d\d/gi,rt=/Z|[+-]\d\d(?::?\d\d)?/gi,ot=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,st={};function lt(t,n,i){st[t]=P(n)?n:function(t,e){return t&&i?i:n}}function ut(t,e){return g(st,t)?st[t](e._strict,e._locale):new RegExp(dt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,a){return e||n||i||a})))}function dt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var ht={};function ct(t,n){var e,i=n;for("string"==typeof t&&(t=[t]),d(n)&&(i=function(t,e){e[n]=M(t)}),e=0;e<t.length;e++)ht[t[e]]=i}function ft(t,a){ct(t,function(t,e,n,i){n._w=n._w||{},a(t,n._w,n,i)})}var gt=0,mt=1,pt=2,vt=3,bt=4,yt=5,xt=6,_t=7,kt=8;function wt(t){return Mt(t)?366:365}function Mt(t){return t%4==0&&t%100!=0||t%400==0}B("Y",0,0,function(){var t=this.year();return t<=9999?""+t:"+"+t}),B(0,["YY",2],0,function(){return this.year()%100}),B(0,["YYYY",4],0,"year"),B(0,["YYYYY",5],0,"year"),B(0,["YYYYYY",6,!0],0,"year"),A("year","y"),Y("year",1),lt("Y",it),lt("YY",J,G),lt("YYYY",tt,Z),lt("YYYYY",et,X),lt("YYYYYY",et,X),ct(["YYYYY","YYYYYY"],gt),ct("YYYY",function(t,e){e[gt]=2===t.length?c.parseTwoDigitYear(t):M(t)}),ct("YY",function(t,e){e[gt]=c.parseTwoDigitYear(t)}),ct("Y",function(t,e){e[gt]=parseInt(t,10)}),c.parseTwoDigitYear=function(t){return M(t)+(68<M(t)?1900:2e3)};var St,Dt=Ct("FullYear",!0);function Ct(e,n){return function(t){return null!=t?(Tt(this,e,t),c.updateOffset(this,n),this):Pt(this,e)}}function Pt(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function Tt(t,e,n){t.isValid()&&!isNaN(n)&&("FullYear"===e&&Mt(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),Ot(n,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function Ot(t,e){if(isNaN(t)||isNaN(e))return NaN;var n,i=(e%(n=12)+n)%n;return t+=(e-i)/12,1===i?Mt(t)?29:28:31-i%7%2}St=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1},B("M",["MM",2],"Mo",function(){return this.month()+1}),B("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),B("MMMM",0,0,function(t){return this.localeData().months(this,t)}),A("month","M"),Y("month",8),lt("M",J),lt("MM",J,G),lt("MMM",function(t,e){return e.monthsShortRegex(t)}),lt("MMMM",function(t,e){return e.monthsRegex(t)}),ct(["M","MM"],function(t,e){e[mt]=M(t)-1}),ct(["MMM","MMMM"],function(t,e,n,i){var a=n._locale.monthsParse(t,i,n._strict);null!=a?e[mt]=a:v(n).invalidMonth=t});var It=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,At="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var Ft="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Rt(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=M(e);else if(!d(e=t.localeData().monthsParse(e)))return t;return n=Math.min(t.date(),Ot(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function Lt(t){return null!=t?(Rt(this,t),c.updateOffset(this,!0),this):Pt(this,"Month")}var Yt=ot;var Wt=ot;function Nt(){function t(t,e){return e.length-t.length}var e,n,i=[],a=[],r=[];for(e=0;e<12;e++)n=p([2e3,e]),i.push(this.monthsShort(n,"")),a.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(i.sort(t),a.sort(t),r.sort(t),e=0;e<12;e++)i[e]=dt(i[e]),a[e]=dt(a[e]);for(e=0;e<24;e++)r[e]=dt(r[e]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function zt(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&0<=t&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function Vt(t,e,n){var i=7+e-n;return-((7+zt(t,0,i).getUTCDay()-e)%7)+i-1}function Ht(t,e,n,i,a){var r,o,s=1+7*(e-1)+(7+n-i)%7+Vt(t,i,a);return o=s<=0?wt(r=t-1)+s:s>wt(t)?(r=t+1,s-wt(t)):(r=t,s),{year:r,dayOfYear:o}}function Bt(t,e,n){var i,a,r=Vt(t.year(),e,n),o=Math.floor((t.dayOfYear()-r-1)/7)+1;return o<1?i=o+Et(a=t.year()-1,e,n):o>Et(t.year(),e,n)?(i=o-Et(t.year(),e,n),a=t.year()+1):(a=t.year(),i=o),{week:i,year:a}}function Et(t,e,n){var i=Vt(t,e,n),a=Vt(t+1,e,n);return(wt(t)-i+a)/7}B("w",["ww",2],"wo","week"),B("W",["WW",2],"Wo","isoWeek"),A("week","w"),A("isoWeek","W"),Y("week",5),Y("isoWeek",5),lt("w",J),lt("ww",J,G),lt("W",J),lt("WW",J,G),ft(["w","ww","W","WW"],function(t,e,n,i){e[i.substr(0,1)]=M(t)});B("d",0,"do","day"),B("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),B("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),B("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),B("e",0,0,"weekday"),B("E",0,0,"isoWeekday"),A("day","d"),A("weekday","e"),A("isoWeekday","E"),Y("day",11),Y("weekday",11),Y("isoWeekday",11),lt("d",J),lt("e",J),lt("E",J),lt("dd",function(t,e){return e.weekdaysMinRegex(t)}),lt("ddd",function(t,e){return e.weekdaysShortRegex(t)}),lt("dddd",function(t,e){return e.weekdaysRegex(t)}),ft(["dd","ddd","dddd"],function(t,e,n,i){var a=n._locale.weekdaysParse(t,i,n._strict);null!=a?e.d=a:v(n).invalidWeekday=t}),ft(["d","e","E"],function(t,e,n,i){e[i]=M(t)});var jt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Ut="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var Gt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var qt=ot;var Zt=ot;var Xt=ot;function Jt(){function t(t,e){return e.length-t.length}var e,n,i,a,r,o=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=p([2e3,1]).day(e),i=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),r=this.weekdays(n,""),o.push(i),s.push(a),l.push(r),u.push(i),u.push(a),u.push(r);for(o.sort(t),s.sort(t),l.sort(t),u.sort(t),e=0;e<7;e++)s[e]=dt(s[e]),l[e]=dt(l[e]),u[e]=dt(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function $t(){return this.hours()%12||12}function Kt(t,e){B(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Qt(t,e){return e._meridiemParse}B("H",["HH",2],0,"hour"),B("h",["hh",2],0,$t),B("k",["kk",2],0,function(){return this.hours()||24}),B("hmm",0,0,function(){return""+$t.apply(this)+W(this.minutes(),2)}),B("hmmss",0,0,function(){return""+$t.apply(this)+W(this.minutes(),2)+W(this.seconds(),2)}),B("Hmm",0,0,function(){return""+this.hours()+W(this.minutes(),2)}),B("Hmmss",0,0,function(){return""+this.hours()+W(this.minutes(),2)+W(this.seconds(),2)}),Kt("a",!0),Kt("A",!1),A("hour","h"),Y("hour",13),lt("a",Qt),lt("A",Qt),lt("H",J),lt("h",J),lt("k",J),lt("HH",J,G),lt("hh",J,G),lt("kk",J,G),lt("hmm",$),lt("hmmss",K),lt("Hmm",$),lt("Hmmss",K),ct(["H","HH"],vt),ct(["k","kk"],function(t,e,n){var i=M(t);e[vt]=24===i?0:i}),ct(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),ct(["h","hh"],function(t,e,n){e[vt]=M(t),v(n).bigHour=!0}),ct("hmm",function(t,e,n){var i=t.length-2;e[vt]=M(t.substr(0,i)),e[bt]=M(t.substr(i)),v(n).bigHour=!0}),ct("hmmss",function(t,e,n){var i=t.length-4,a=t.length-2;e[vt]=M(t.substr(0,i)),e[bt]=M(t.substr(i,2)),e[yt]=M(t.substr(a)),v(n).bigHour=!0}),ct("Hmm",function(t,e,n){var i=t.length-2;e[vt]=M(t.substr(0,i)),e[bt]=M(t.substr(i))}),ct("Hmmss",function(t,e,n){var i=t.length-4,a=t.length-2;e[vt]=M(t.substr(0,i)),e[bt]=M(t.substr(i,2)),e[yt]=M(t.substr(a))});var te,ee=Ct("Hours",!0),ne={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{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"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d 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"},months:At,monthsShort:Ft,week:{dow:0,doy:6},weekdays:jt,weekdaysMin:Gt,weekdaysShort:Ut,meridiemParse:/[ap]\.?m?\.?/i},ie={},ae={};function re(t){return t?t.toLowerCase().replace("_","-"):t}function oe(t){var e=null;if(!ie[t]&&void 0!==jn&&jn&&jn.exports)try{e=te._abbr,En("./locale/"+t),se(e)}catch(t){}return ie[t]}function se(t,e){var n;return t&&((n=u(e)?ue(t):le(t,e))?te=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),te._abbr}function le(t,e){if(null===e)return delete ie[t],null;var n,i=ne;if(e.abbr=t,null!=ie[t])C("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=ie[t]._config;else if(null!=e.parentLocale)if(null!=ie[e.parentLocale])i=ie[e.parentLocale]._config;else{if(null==(n=oe(e.parentLocale)))return ae[e.parentLocale]||(ae[e.parentLocale]=[]),ae[e.parentLocale].push({name:t,config:e}),null;i=n._config}return ie[t]=new O(T(i,e)),ae[t]&&ae[t].forEach(function(t){le(t.name,t.config)}),se(t),ie[t]}function ue(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return te;if(!s(t)){if(e=oe(t))return e;t=[t]}return function(t){for(var e,n,i,a,r=0;r<t.length;){for(e=(a=re(t[r]).split("-")).length,n=(n=re(t[r+1]))?n.split("-"):null;0<e;){if(i=oe(a.slice(0,e).join("-")))return i;if(n&&n.length>=e&&o(a,n,!0)>=e-1)break;e--}r++}return te}(t)}function de(t){var e,n=t._a;return n&&-2===v(t).overflow&&(e=n[mt]<0||11<n[mt]?mt:n[pt]<1||n[pt]>Ot(n[gt],n[mt])?pt:n[vt]<0||24<n[vt]||24===n[vt]&&(0!==n[bt]||0!==n[yt]||0!==n[xt])?vt:n[bt]<0||59<n[bt]?bt:n[yt]<0||59<n[yt]?yt:n[xt]<0||999<n[xt]?xt:-1,v(t)._overflowDayOfYear&&(e<gt||pt<e)&&(e=pt),v(t)._overflowWeeks&&-1===e&&(e=_t),v(t)._overflowWeekday&&-1===e&&(e=kt),v(t).overflow=e),t}function he(t,e,n){return null!=t?t:null!=e?e:n}function ce(t){var e,n,i,a,r,o=[];if(!t._d){var s,l;for(s=t,l=new Date(c.now()),i=s._useUTC?[l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()]:[l.getFullYear(),l.getMonth(),l.getDate()],t._w&&null==t._a[pt]&&null==t._a[mt]&&function(t){var e,n,i,a,r,o,s,l;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)r=1,o=4,n=he(e.GG,t._a[gt],Bt(Ce(),1,4).year),i=he(e.W,1),((a=he(e.E,1))<1||7<a)&&(l=!0);else{r=t._locale._week.dow,o=t._locale._week.doy;var u=Bt(Ce(),r,o);n=he(e.gg,t._a[gt],u.year),i=he(e.w,u.week),null!=e.d?((a=e.d)<0||6<a)&&(l=!0):null!=e.e?(a=e.e+r,(e.e<0||6<e.e)&&(l=!0)):a=r}i<1||i>Et(n,r,o)?v(t)._overflowWeeks=!0:null!=l?v(t)._overflowWeekday=!0:(s=Ht(n,i,a,r,o),t._a[gt]=s.year,t._dayOfYear=s.dayOfYear)}(t),null!=t._dayOfYear&&(r=he(t._a[gt],i[gt]),(t._dayOfYear>wt(r)||0===t._dayOfYear)&&(v(t)._overflowDayOfYear=!0),n=zt(r,0,t._dayOfYear),t._a[mt]=n.getUTCMonth(),t._a[pt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=o[e]=i[e];for(;e<7;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[vt]&&0===t._a[bt]&&0===t._a[yt]&&0===t._a[xt]&&(t._nextDay=!0,t._a[vt]=0),t._d=(t._useUTC?zt:function(t,e,n,i,a,r,o){var s=new Date(t,e,n,i,a,r,o);return t<100&&0<=t&&isFinite(s.getFullYear())&&s.setFullYear(t),s}).apply(null,o),a=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[vt]=24),t._w&&void 0!==t._w.d&&t._w.d!==a&&(v(t).weekdayMismatch=!0)}}var fe=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ge=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,me=/Z|[+-]\d\d(?::?\d\d)?/,pe=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],ve=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],be=/^\/?Date\((\-?\d+)/i;function ye(t){var e,n,i,a,r,o,s=t._i,l=fe.exec(s)||ge.exec(s);if(l){for(v(t).iso=!0,e=0,n=pe.length;e<n;e++)if(pe[e][1].exec(l[1])){a=pe[e][0],i=!1!==pe[e][2];break}if(null==a)return void(t._isValid=!1);if(l[3]){for(e=0,n=ve.length;e<n;e++)if(ve[e][1].exec(l[3])){r=(l[2]||" ")+ve[e][0];break}if(null==r)return void(t._isValid=!1)}if(!i&&null!=r)return void(t._isValid=!1);if(l[4]){if(!me.exec(l[4]))return void(t._isValid=!1);o="Z"}t._f=a+(r||"")+(o||""),Me(t)}else t._isValid=!1}var xe=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function _e(t,e,n,i,a,r){var o=[function(t){var e=parseInt(t,10);{if(e<=49)return 2e3+e;if(e<=999)return 1900+e}return e}(t),Ft.indexOf(e),parseInt(n,10),parseInt(i,10),parseInt(a,10)];return r&&o.push(parseInt(r,10)),o}var ke={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function we(t){var e,n,i,a=xe.exec(t._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(a){var r=_e(a[4],a[3],a[2],a[5],a[6],a[7]);if(e=a[1],n=r,i=t,e&&Ut.indexOf(e)!==new Date(n[0],n[1],n[2]).getDay()&&(v(i).weekdayMismatch=!0,!(i._isValid=!1)))return;t._a=r,t._tzm=function(t,e,n){if(t)return ke[t];if(e)return 0;var i=parseInt(n,10),a=i%100;return(i-a)/100*60+a}(a[8],a[9],a[10]),t._d=zt.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),v(t).rfc2822=!0}else t._isValid=!1}function Me(t){if(t._f!==c.ISO_8601)if(t._f!==c.RFC_2822){t._a=[],v(t).empty=!0;var e,n,i,a,r,o,s,l,u=""+t._i,d=u.length,h=0;for(i=j(t._f,t._locale).match(N)||[],e=0;e<i.length;e++)a=i[e],(n=(u.match(ut(a,t))||[])[0])&&(0<(r=u.substr(0,u.indexOf(n))).length&&v(t).unusedInput.push(r),u=u.slice(u.indexOf(n)+n.length),h+=n.length),H[a]?(n?v(t).empty=!1:v(t).unusedTokens.push(a),o=a,l=t,null!=(s=n)&&g(ht,o)&&ht[o](s,l._a,l,o)):t._strict&&!n&&v(t).unusedTokens.push(a);v(t).charsLeftOver=d-h,0<u.length&&v(t).unusedInput.push(u),t._a[vt]<=12&&!0===v(t).bigHour&&0<t._a[vt]&&(v(t).bigHour=void 0),v(t).parsedDateParts=t._a.slice(0),v(t).meridiem=t._meridiem,t._a[vt]=function(t,e,n){var i;if(null==n)return e;return null!=t.meridiemHour?t.meridiemHour(e,n):(null!=t.isPM&&((i=t.isPM(n))&&e<12&&(e+=12),i||12!==e||(e=0)),e)}(t._locale,t._a[vt],t._meridiem),ce(t),de(t)}else we(t);else ye(t)}function Se(t){var e,n,i,a,r=t._i,o=t._f;return t._locale=t._locale||ue(t._l),null===r||void 0===o&&""===r?y({nullInput:!0}):("string"==typeof r&&(t._i=r=t._locale.preparse(r)),k(r)?new _(de(r)):(h(r)?t._d=r:s(o)?function(t){var e,n,i,a,r;if(0===t._f.length)return v(t).invalidFormat=!0,t._d=new Date(NaN);for(a=0;a<t._f.length;a++)r=0,e=x({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[a],Me(e),b(e)&&(r+=v(e).charsLeftOver,r+=10*v(e).unusedTokens.length,v(e).score=r,(null==i||r<i)&&(i=r,n=e));m(t,n||e)}(t):o?Me(t):u(n=(e=t)._i)?e._d=new Date(c.now()):h(n)?e._d=new Date(n.valueOf()):"string"==typeof n?(i=e,null===(a=be.exec(i._i))?(ye(i),!1===i._isValid&&(delete i._isValid,we(i),!1===i._isValid&&(delete i._isValid,c.createFromInputFallback(i)))):i._d=new Date(+a[1])):s(n)?(e._a=f(n.slice(0),function(t){return parseInt(t,10)}),ce(e)):l(n)?function(t){if(!t._d){var e=R(t._i);t._a=f([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),ce(t)}}(e):d(n)?e._d=new Date(n):c.createFromInputFallback(e),b(t)||(t._d=null),t))}function De(t,e,n,i,a){var r,o={};return!0!==n&&!1!==n||(i=n,n=void 0),(l(t)&&function(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(t.hasOwnProperty(e))return!1;return!0}(t)||s(t)&&0===t.length)&&(t=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=a,o._l=n,o._i=t,o._f=e,o._strict=i,(r=new _(de(Se(o))))._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function Ce(t,e,n,i){return De(t,e,n,i,!1)}c.createFromInputFallback=n("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),c.ISO_8601=function(){},c.RFC_2822=function(){};var Pe=n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Ce.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:y()}),Te=n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Ce.apply(null,arguments);return this.isValid()&&t.isValid()?this<t?this:t:y()});function Oe(t,e){var n,i;if(1===e.length&&s(e[0])&&(e=e[0]),!e.length)return Ce();for(n=e[0],i=1;i<e.length;++i)e[i].isValid()&&!e[i][t](n)||(n=e[i]);return n}var Ie=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ae(t){var e=R(t),n=e.year||0,i=e.quarter||0,a=e.month||0,r=e.week||0,o=e.day||0,s=e.hour||0,l=e.minute||0,u=e.second||0,d=e.millisecond||0;this._isValid=function(t){for(var e in t)if(-1===St.call(Ie,e)||null!=t[e]&&isNaN(t[e]))return!1;for(var n=!1,i=0;i<Ie.length;++i)if(t[Ie[i]]){if(n)return!1;parseFloat(t[Ie[i]])!==M(t[Ie[i]])&&(n=!0)}return!0}(e),this._milliseconds=+d+1e3*u+6e4*l+1e3*s*60*60,this._days=+o+7*r,this._months=+a+3*i+12*n,this._data={},this._locale=ue(),this._bubble()}function Fe(t){return t instanceof Ae}function Re(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function Le(t,n){B(t,0,0,function(){var t=this.utcOffset(),e="+";return t<0&&(t=-t,e="-"),e+W(~~(t/60),2)+n+W(~~t%60,2)})}Le("Z",":"),Le("ZZ",""),lt("Z",rt),lt("ZZ",rt),ct(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=We(rt,t)});var Ye=/([\+\-]|\d\d)/gi;function We(t,e){var n=(e||"").match(t);if(null===n)return null;var i=((n[n.length-1]||[])+"").match(Ye)||["-",0,0],a=60*i[1]+M(i[2]);return 0===a?0:"+"===i[0]?a:-a}function Ne(t,e){var n,i;return e._isUTC?(n=e.clone(),i=(k(t)||h(t)?t.valueOf():Ce(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+i),c.updateOffset(n,!1),n):Ce(t).local()}function ze(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Ve(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}c.updateOffset=function(){};var He=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Be=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ee(t,e){var n,i,a,r=t,o=null;return Fe(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:d(t)?(r={},e?r[e]=t:r.milliseconds=t):(o=He.exec(t))?(n="-"===o[1]?-1:1,r={y:0,d:M(o[pt])*n,h:M(o[vt])*n,m:M(o[bt])*n,s:M(o[yt])*n,ms:M(Re(1e3*o[xt]))*n}):(o=Be.exec(t))?(n="-"===o[1]?-1:(o[1],1),r={y:je(o[2],n),M:je(o[3],n),w:je(o[4],n),d:je(o[5],n),h:je(o[6],n),m:je(o[7],n),s:je(o[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(a=function(t,e){var n;if(!t.isValid()||!e.isValid())return{milliseconds:0,months:0};e=Ne(e,t),t.isBefore(e)?n=Ue(t,e):((n=Ue(e,t)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(Ce(r.from),Ce(r.to)),(r={}).ms=a.milliseconds,r.M=a.months),i=new Ae(r),Fe(t)&&g(t,"_locale")&&(i._locale=t._locale),i}function je(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Ue(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function Ge(i,a){return function(t,e){var n;return null===e||isNaN(+e)||(C(a,"moment()."+a+"(period, number) is deprecated. Please use moment()."+a+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=t,t=e,e=n),qe(this,Ee(t="string"==typeof t?+t:t,e),i),this}}function qe(t,e,n,i){var a=e._milliseconds,r=Re(e._days),o=Re(e._months);t.isValid()&&(i=null==i||i,o&&Rt(t,Pt(t,"Month")+o*n),r&&Tt(t,"Date",Pt(t,"Date")+r*n),a&&t._d.setTime(t._d.valueOf()+a*n),i&&c.updateOffset(t,r||o))}Ee.fn=Ae.prototype,Ee.invalid=function(){return Ee(NaN)};var Ze=Ge(1,"add"),Xe=Ge(-1,"subtract");function Je(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),i=t.clone().add(n,"months");return-(n+(e-i<0?(e-i)/(i-t.clone().add(n-1,"months")):(e-i)/(t.clone().add(n+1,"months")-i)))||0}function $e(t){var e;return void 0===t?this._locale._abbr:(null!=(e=ue(t))&&(this._locale=e),this)}c.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",c.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Ke=n("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)});function Qe(){return this._locale}function tn(t,e){B(0,[t,t.length],0,e)}function en(t,e,n,i,a){var r;return null==t?Bt(this,i,a).year:((r=Et(t,i,a))<e&&(e=r),function(t,e,n,i,a){var r=Ht(t,e,n,i,a),o=zt(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}.call(this,t,e,n,i,a))}B(0,["gg",2],0,function(){return this.weekYear()%100}),B(0,["GG",2],0,function(){return this.isoWeekYear()%100}),tn("gggg","weekYear"),tn("ggggg","weekYear"),tn("GGGG","isoWeekYear"),tn("GGGGG","isoWeekYear"),A("weekYear","gg"),A("isoWeekYear","GG"),Y("weekYear",1),Y("isoWeekYear",1),lt("G",it),lt("g",it),lt("GG",J,G),lt("gg",J,G),lt("GGGG",tt,Z),lt("gggg",tt,Z),lt("GGGGG",et,X),lt("ggggg",et,X),ft(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,i){e[i.substr(0,2)]=M(t)}),ft(["gg","GG"],function(t,e,n,i){e[i]=c.parseTwoDigitYear(t)}),B("Q",0,"Qo","quarter"),A("quarter","Q"),Y("quarter",7),lt("Q",U),ct("Q",function(t,e){e[mt]=3*(M(t)-1)}),B("D",["DD",2],"Do","date"),A("date","D"),Y("date",9),lt("D",J),lt("DD",J,G),lt("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),ct(["D","DD"],pt),ct("Do",function(t,e){e[pt]=M(t.match(J)[0])});var nn=Ct("Date",!0);B("DDD",["DDDD",3],"DDDo","dayOfYear"),A("dayOfYear","DDD"),Y("dayOfYear",4),lt("DDD",Q),lt("DDDD",q),ct(["DDD","DDDD"],function(t,e,n){n._dayOfYear=M(t)}),B("m",["mm",2],0,"minute"),A("minute","m"),Y("minute",14),lt("m",J),lt("mm",J,G),ct(["m","mm"],bt);var an=Ct("Minutes",!1);B("s",["ss",2],0,"second"),A("second","s"),Y("second",15),lt("s",J),lt("ss",J,G),ct(["s","ss"],yt);var rn,on=Ct("Seconds",!1);for(B("S",0,0,function(){return~~(this.millisecond()/100)}),B(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),B(0,["SSS",3],0,"millisecond"),B(0,["SSSS",4],0,function(){return 10*this.millisecond()}),B(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),B(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),B(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),B(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),B(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),A("millisecond","ms"),Y("millisecond",16),lt("S",Q,U),lt("SS",Q,G),lt("SSS",Q,q),rn="SSSS";rn.length<=9;rn+="S")lt(rn,nt);function sn(t,e){e[xt]=M(1e3*("0."+t))}for(rn="S";rn.length<=9;rn+="S")ct(rn,sn);var ln=Ct("Milliseconds",!1);B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");var un=_.prototype;function dn(t){return t}un.add=Ze,un.calendar=function(t,e){var n=t||Ce(),i=Ne(n,this).startOf("day"),a=c.calendarFormat(this,i)||"sameElse",r=e&&(P(e[a])?e[a].call(this,n):e[a]);return this.format(r||this.localeData().calendar(a,this,Ce(n)))},un.clone=function(){return new _(this)},un.diff=function(t,e,n){var i,a,r;if(!this.isValid())return NaN;if(!(i=Ne(t,this)).isValid())return NaN;switch(a=6e4*(i.utcOffset()-this.utcOffset()),e=F(e)){case"year":r=Je(this,i)/12;break;case"month":r=Je(this,i);break;case"quarter":r=Je(this,i)/3;break;case"second":r=(this-i)/1e3;break;case"minute":r=(this-i)/6e4;break;case"hour":r=(this-i)/36e5;break;case"day":r=(this-i-a)/864e5;break;case"week":r=(this-i-a)/6048e5;break;default:r=this-i}return n?r:w(r)},un.endOf=function(t){return void 0===(t=F(t))||"millisecond"===t?this:("date"===t&&(t="day"),this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms"))},un.format=function(t){t||(t=this.isUtc()?c.defaultFormatUtc:c.defaultFormat);var e=E(this,t);return this.localeData().postformat(e)},un.from=function(t,e){return this.isValid()&&(k(t)&&t.isValid()||Ce(t).isValid())?Ee({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},un.fromNow=function(t){return this.from(Ce(),t)},un.to=function(t,e){return this.isValid()&&(k(t)&&t.isValid()||Ce(t).isValid())?Ee({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},un.toNow=function(t){return this.to(Ce(),t)},un.get=function(t){return P(this[t=F(t)])?this[t]():this},un.invalidAt=function(){return v(this).overflow},un.isAfter=function(t,e){var n=k(t)?t:Ce(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=F(u(e)?"millisecond":e))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf())},un.isBefore=function(t,e){var n=k(t)?t:Ce(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=F(u(e)?"millisecond":e))?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf())},un.isBetween=function(t,e,n,i){return("("===(i=i||"()")[0]?this.isAfter(t,n):!this.isBefore(t,n))&&(")"===i[1]?this.isBefore(e,n):!this.isAfter(e,n))},un.isSame=function(t,e){var n,i=k(t)?t:Ce(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=F(e||"millisecond"))?this.valueOf()===i.valueOf():(n=i.valueOf(),this.clone().startOf(e).valueOf()<=n&&n<=this.clone().endOf(e).valueOf()))},un.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)},un.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)},un.isValid=function(){return b(this)},un.lang=Ke,un.locale=$e,un.localeData=Qe,un.max=Te,un.min=Pe,un.parsingFlags=function(){return m({},v(this))},un.set=function(t,e){if("object"==typeof t)for(var n=function(t){var e=[];for(var n in t)e.push({unit:n,priority:L[n]});return e.sort(function(t,e){return t.priority-e.priority}),e}(t=R(t)),i=0;i<n.length;i++)this[n[i].unit](t[n[i].unit]);else if(P(this[t=F(t)]))return this[t](e);return this},un.startOf=function(t){switch(t=F(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this},un.subtract=Xe,un.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},un.toObject=function(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}},un.toDate=function(){return new Date(this.valueOf())},un.toISOString=function(t){if(!this.isValid())return null;var e=!0!==t,n=e?this.clone().utc():this;return n.year()<0||9999<n.year()?E(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):P(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",E(n,"Z")):E(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},un.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a=e+'[")]';return this.format(n+i+"-MM-DD[T]HH:mm:ss.SSS"+a)},un.toJSON=function(){return this.isValid()?this.toISOString():null},un.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},un.unix=function(){return Math.floor(this.valueOf()/1e3)},un.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},un.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},un.year=Dt,un.isLeapYear=function(){return Mt(this.year())},un.weekYear=function(t){return en.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},un.isoWeekYear=function(t){return en.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},un.quarter=un.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},un.month=Lt,un.daysInMonth=function(){return Ot(this.year(),this.month())},un.week=un.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},un.isoWeek=un.isoWeeks=function(t){var e=Bt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},un.weeksInYear=function(){var t=this.localeData()._week;return Et(this.year(),t.dow,t.doy)},un.isoWeeksInYear=function(){return Et(this.year(),1,4)},un.date=nn,un.day=un.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e,n,i=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(e=t,n=this.localeData(),t="string"!=typeof e?e:isNaN(e)?"number"==typeof(e=n.weekdaysParse(e))?e:null:parseInt(e,10),this.add(t-i,"d")):i},un.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},un.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null==t)return this.day()||7;var e,n,i=(e=t,n=this.localeData(),"string"==typeof e?n.weekdaysParse(e)%7||7:isNaN(e)?null:e);return this.day(this.day()%7?i:i-7)},un.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},un.hour=un.hours=ee,un.minute=un.minutes=an,un.second=un.seconds=on,un.millisecond=un.milliseconds=ln,un.utcOffset=function(t,e,n){var i,a=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null==t)return this._isUTC?a:ze(this);if("string"==typeof t){if(null===(t=We(rt,t)))return this}else Math.abs(t)<16&&!n&&(t*=60);return!this._isUTC&&e&&(i=ze(this)),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),a!==t&&(!e||this._changeInProgress?qe(this,Ee(t-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,c.updateOffset(this,!0),this._changeInProgress=null)),this},un.utc=function(t){return this.utcOffset(0,t)},un.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(ze(this),"m")),this},un.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=We(at,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},un.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Ce(t).utcOffset():0,(this.utcOffset()-t)%60==0)},un.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},un.isLocal=function(){return!!this.isValid()&&!this._isUTC},un.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},un.isUtc=Ve,un.isUTC=Ve,un.zoneAbbr=function(){return this._isUTC?"UTC":""},un.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},un.dates=n("dates accessor is deprecated. Use date instead.",nn),un.months=n("months accessor is deprecated. Use month instead",Lt),un.years=n("years accessor is deprecated. Use year instead",Dt),un.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}),un.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!u(this._isDSTShifted))return this._isDSTShifted;var t={};if(x(t,this),(t=Se(t))._a){var e=t._isUTC?p(t._a):Ce(t._a);this._isDSTShifted=this.isValid()&&0<o(t._a,e.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted});var hn=O.prototype;function cn(t,e,n,i){var a=ue(),r=p().set(i,e);return a[n](r,t)}function fn(t,e,n){if(d(t)&&(e=t,t=void 0),t=t||"",null!=e)return cn(t,e,n,"month");var i,a=[];for(i=0;i<12;i++)a[i]=cn(t,i,n,"month");return a}function gn(t,e,n,i){e=("boolean"==typeof t?d(e)&&(n=e,e=void 0):(e=t,t=!1,d(n=e)&&(n=e,e=void 0)),e||"");var a,r=ue(),o=t?r._week.dow:0;if(null!=n)return cn(e,(n+o)%7,i,"day");var s=[];for(a=0;a<7;a++)s[a]=cn(e,(a+o)%7,i,"day");return s}hn.calendar=function(t,e,n){var i=this._calendar[t]||this._calendar.sameElse;return P(i)?i.call(e,n):i},hn.longDateFormat=function(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])},hn.invalidDate=function(){return this._invalidDate},hn.ordinal=function(t){return this._ordinal.replace("%d",t)},hn.preparse=dn,hn.postformat=dn,hn.relativeTime=function(t,e,n,i){var a=this._relativeTime[n];return P(a)?a(t,e,n,i):a.replace(/%d/i,t)},hn.pastFuture=function(t,e){var n=this._relativeTime[0<t?"future":"past"];return P(n)?n(e):n.replace(/%s/i,e)},hn.set=function(t){var e,n;for(n in t)P(e=t[n])?this[n]=e:this["_"+n]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},hn.months=function(t,e){return t?s(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||It).test(e)?"format":"standalone"][t.month()]:s(this._months)?this._months:this._months.standalone},hn.monthsShort=function(t,e){return t?s(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[It.test(e)?"format":"standalone"][t.month()]:s(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},hn.monthsParse=function(t,e,n){var i,a,r;if(this._monthsParseExact)return function(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)r=p([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===e?-1!==(a=St.call(this._shortMonthsParse,o))?a:null:-1!==(a=St.call(this._longMonthsParse,o))?a:null:"MMM"===e?-1!==(a=St.call(this._shortMonthsParse,o))?a:-1!==(a=St.call(this._longMonthsParse,o))?a:null:-1!==(a=St.call(this._longMonthsParse,o))?a:-1!==(a=St.call(this._shortMonthsParse,o))?a:null}.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(a=p([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(r="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[i]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}},hn.monthsRegex=function(t){return this._monthsParseExact?(g(this,"_monthsRegex")||Nt.call(this),t?this._monthsStrictRegex:this._monthsRegex):(g(this,"_monthsRegex")||(this._monthsRegex=Wt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},hn.monthsShortRegex=function(t){return this._monthsParseExact?(g(this,"_monthsRegex")||Nt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(g(this,"_monthsShortRegex")||(this._monthsShortRegex=Yt),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},hn.week=function(t){return Bt(t,this._week.dow,this._week.doy).week},hn.firstDayOfYear=function(){return this._week.doy},hn.firstDayOfWeek=function(){return this._week.dow},hn.weekdays=function(t,e){return t?s(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:s(this._weekdays)?this._weekdays:this._weekdays.standalone},hn.weekdaysMin=function(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin},hn.weekdaysShort=function(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort},hn.weekdaysParse=function(t,e,n){var i,a,r;if(this._weekdaysParseExact)return function(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)r=p([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(a=St.call(this._weekdaysParse,o))?a:null:"ddd"===e?-1!==(a=St.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=St.call(this._minWeekdaysParse,o))?a:null:"dddd"===e?-1!==(a=St.call(this._weekdaysParse,o))?a:-1!==(a=St.call(this._shortWeekdaysParse,o))?a:-1!==(a=St.call(this._minWeekdaysParse,o))?a:null:"ddd"===e?-1!==(a=St.call(this._shortWeekdaysParse,o))?a:-1!==(a=St.call(this._weekdaysParse,o))?a:-1!==(a=St.call(this._minWeekdaysParse,o))?a:null:-1!==(a=St.call(this._minWeekdaysParse,o))?a:-1!==(a=St.call(this._weekdaysParse,o))?a:-1!==(a=St.call(this._shortWeekdaysParse,o))?a:null}.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(a=p([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(r="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[i]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}},hn.weekdaysRegex=function(t){return this._weekdaysParseExact?(g(this,"_weekdaysRegex")||Jt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(g(this,"_weekdaysRegex")||(this._weekdaysRegex=qt),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},hn.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(g(this,"_weekdaysRegex")||Jt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(g(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Zt),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},hn.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(g(this,"_weekdaysRegex")||Jt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(g(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Xt),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},hn.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},hn.meridiem=function(t,e,n){return 11<t?n?"pm":"PM":n?"am":"AM"},se("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===M(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),c.lang=n("moment.lang is deprecated. Use moment.locale instead.",se),c.langData=n("moment.langData is deprecated. Use moment.localeData instead.",ue);var mn=Math.abs;function pn(t,e,n,i){var a=Ee(e,n);return t._milliseconds+=i*a._milliseconds,t._days+=i*a._days,t._months+=i*a._months,t._bubble()}function vn(t){return t<0?Math.floor(t):Math.ceil(t)}function bn(t){return 4800*t/146097}function yn(t){return 146097*t/4800}function xn(t){return function(){return this.as(t)}}var _n=xn("ms"),kn=xn("s"),wn=xn("m"),Mn=xn("h"),Sn=xn("d"),Dn=xn("w"),Cn=xn("M"),Pn=xn("y");function Tn(t){return function(){return this.isValid()?this._data[t]:NaN}}var On=Tn("milliseconds"),In=Tn("seconds"),An=Tn("minutes"),Fn=Tn("hours"),Rn=Tn("days"),Ln=Tn("months"),Yn=Tn("years");var Wn=Math.round,Nn={ss:44,s:45,m:45,h:22,d:26,M:11};var zn=Math.abs;function Vn(t){return(0<t)-(t<0)||+t}function Hn(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n=zn(this._milliseconds)/1e3,i=zn(this._days),a=zn(this._months);e=w((t=w(n/60))/60),n%=60,t%=60;var r=w(a/12),o=a%=12,s=i,l=e,u=t,d=n?n.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var c=h<0?"-":"",f=Vn(this._months)!==Vn(h)?"-":"",g=Vn(this._days)!==Vn(h)?"-":"",m=Vn(this._milliseconds)!==Vn(h)?"-":"";return c+"P"+(r?f+r+"Y":"")+(o?f+o+"M":"")+(s?g+s+"D":"")+(l||u||d?"T":"")+(l?m+l+"H":"")+(u?m+u+"M":"")+(d?m+d+"S":"")}var Bn=Ae.prototype;return Bn.isValid=function(){return this._isValid},Bn.abs=function(){var t=this._data;return this._milliseconds=mn(this._milliseconds),this._days=mn(this._days),this._months=mn(this._months),t.milliseconds=mn(t.milliseconds),t.seconds=mn(t.seconds),t.minutes=mn(t.minutes),t.hours=mn(t.hours),t.months=mn(t.months),t.years=mn(t.years),this},Bn.add=function(t,e){return pn(this,t,e,1)},Bn.subtract=function(t,e){return pn(this,t,e,-1)},Bn.as=function(t){if(!this.isValid())return NaN;var e,n,i=this._milliseconds;if("month"===(t=F(t))||"year"===t)return e=this._days+i/864e5,n=this._months+bn(e),"month"===t?n:n/12;switch(e=this._days+Math.round(yn(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}},Bn.asMilliseconds=_n,Bn.asSeconds=kn,Bn.asMinutes=wn,Bn.asHours=Mn,Bn.asDays=Sn,Bn.asWeeks=Dn,Bn.asMonths=Cn,Bn.asYears=Pn,Bn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*M(this._months/12):NaN},Bn._bubble=function(){var t,e,n,i,a,r=this._milliseconds,o=this._days,s=this._months,l=this._data;return 0<=r&&0<=o&&0<=s||r<=0&&o<=0&&s<=0||(r+=864e5*vn(yn(s)+o),s=o=0),l.milliseconds=r%1e3,t=w(r/1e3),l.seconds=t%60,e=w(t/60),l.minutes=e%60,n=w(e/60),l.hours=n%24,s+=a=w(bn(o+=w(n/24))),o-=vn(yn(a)),i=w(s/12),s%=12,l.days=o,l.months=s,l.years=i,this},Bn.clone=function(){return Ee(this)},Bn.get=function(t){return t=F(t),this.isValid()?this[t+"s"]():NaN},Bn.milliseconds=On,Bn.seconds=In,Bn.minutes=An,Bn.hours=Fn,Bn.days=Rn,Bn.weeks=function(){return w(this.days()/7)},Bn.months=Ln,Bn.years=Yn,Bn.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e,n,i,a,r,o,s,l,u,d,h,c=this.localeData(),f=(n=!t,i=c,a=Ee(e=this).abs(),r=Wn(a.as("s")),o=Wn(a.as("m")),s=Wn(a.as("h")),l=Wn(a.as("d")),u=Wn(a.as("M")),d=Wn(a.as("y")),(h=r<=Nn.ss&&["s",r]||r<Nn.s&&["ss",r]||o<=1&&["m"]||o<Nn.m&&["mm",o]||s<=1&&["h"]||s<Nn.h&&["hh",s]||l<=1&&["d"]||l<Nn.d&&["dd",l]||u<=1&&["M"]||u<Nn.M&&["MM",u]||d<=1&&["y"]||["yy",d])[2]=n,h[3]=0<+e,h[4]=i,function(t,e,n,i,a){return a.relativeTime(e||1,!!n,t,i)}.apply(null,h));return t&&(f=c.pastFuture(+this,f)),c.postformat(f)},Bn.toISOString=Hn,Bn.toString=Hn,Bn.toJSON=Hn,Bn.locale=$e,Bn.localeData=Qe,Bn.toIsoString=n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Hn),Bn.lang=Ke,B("X",0,0,"unix"),B("x",0,0,"valueOf"),lt("x",it),lt("X",/[+-]?\d+(\.\d{1,3})?/),ct("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),ct("x",function(t,e,n){n._d=new Date(M(t))}),c.version="2.22.2",t=Ce,c.fn=un,c.min=function(){return Oe("isBefore",[].slice.call(arguments,0))},c.max=function(){return Oe("isAfter",[].slice.call(arguments,0))},c.now=function(){return Date.now?Date.now():+new Date},c.utc=p,c.unix=function(t){return Ce(1e3*t)},c.months=function(t,e){return fn(t,e,"months")},c.isDate=h,c.locale=se,c.invalid=y,c.duration=Ee,c.isMoment=k,c.weekdays=function(t,e,n){return gn(t,e,n,"weekdays")},c.parseZone=function(){return Ce.apply(null,arguments).parseZone()},c.localeData=ue,c.isDuration=Fe,c.monthsShort=function(t,e){return fn(t,e,"monthsShort")},c.weekdaysMin=function(t,e,n){return gn(t,e,n,"weekdaysMin")},c.defineLocale=le,c.updateLocale=function(t,e){if(null!=e){var n,i,a=ne;null!=(i=oe(t))&&(a=i._config),(n=new O(e=T(a,e))).parentLocale=ie[t],ie[t]=n,se(t)}else null!=ie[t]&&(null!=ie[t].parentLocale?ie[t]=ie[t].parentLocale:null!=ie[t]&&delete ie[t]);return ie[t]},c.locales=function(){return i(ie)},c.weekdaysShort=function(t,e,n){return gn(t,e,n,"weekdaysShort")},c.normalizeUnits=F,c.relativeTimeRounding=function(t){return void 0===t?Wn:"function"==typeof t&&(Wn=t,!0)},c.relativeTimeThreshold=function(t,e){return void 0!==Nn[t]&&(void 0===e?Nn[t]:(Nn[t]=e,"s"===t&&(Nn.ss=e-1),!0))},c.calendarFormat=function(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},c.prototype=un,c.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"YYYY-[W]WW",MONTH:"YYYY-MM"},c},"object"==typeof t&&void 0!==jn?jn.exports=n():e.moment=n()},{}],7:[function(t,e,n){var i=t(30)();i.helpers=t(46),t(28)(i),i.Animation=t(22),i.animationService=t(23),i.defaults=t(26),i.Element=t(27),i.elements=t(41),i.Interaction=t(29),i.layouts=t(31),i.platform=t(49),i.plugins=t(32),i.Scale=t(33),i.scaleService=t(34),i.Ticks=t(35),i.Tooltip=t(36),t(24)(i),t(25)(i),t(56)(i),t(54)(i),t(55)(i),t(57)(i),t(58)(i),t(59)(i),t(15)(i),t(16)(i),t(17)(i),t(18)(i),t(19)(i),t(20)(i),t(21)(i),t(8)(i),t(9)(i),t(10)(i),t(11)(i),t(12)(i),t(13)(i),t(14)(i);var a=t(50);for(var r in a)a.hasOwnProperty(r)&&i.plugins.register(a[r]);i.platform.initialize(),e.exports=i,"undefined"!=typeof window&&(window.Chart=i),i.Legend=a.legend._element,i.Title=a.title._element,i.pluginService=i.plugins,i.PluginBase=i.Element.extend({}),i.canvasHelpers=i.helpers.canvas,i.layoutService=i.layouts},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,34:34,35:35,36:36,41:41,46:46,49:49,50:50,54:54,55:55,56:56,57:57,58:58,59:59,8:8,9:9}],8:[function(t,e,n){"use strict";e.exports=function(n){n.Bar=function(t,e){return e.type="bar",new n(t,e)}}},{}],9:[function(t,e,n){"use strict";e.exports=function(n){n.Bubble=function(t,e){return e.type="bubble",new n(t,e)}}},{}],10:[function(t,e,n){"use strict";e.exports=function(n){n.Doughnut=function(t,e){return e.type="doughnut",new n(t,e)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(n){n.Line=function(t,e){return e.type="line",new n(t,e)}}},{}],12:[function(t,e,n){"use strict";e.exports=function(n){n.PolarArea=function(t,e){return e.type="polarArea",new n(t,e)}}},{}],13:[function(t,e,n){"use strict";e.exports=function(n){n.Radar=function(t,e){return e.type="radar",new n(t,e)}}},{}],14:[function(t,e,n){"use strict";e.exports=function(n){n.Scatter=function(t,e){return e.type="scatter",new n(t,e)}}},{}],15:[function(t,e,n){"use strict";var i=t(26),a=t(41),S=t(46);i._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),i._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{position:"left",type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{callbacks:{title:function(t,e){var n="";return 0<t.length&&(t[0].yLabel?n=t[0].yLabel:0<e.labels.length&&t[0].index<e.labels.length&&(n=e.labels[t[0].index])),n},label:function(t,e){return(e.datasets[t.datasetIndex].label||"")+": "+t.xLabel}},mode:"index",axis:"y"}}),e.exports=function(e){e.controllers.bar=e.DatasetController.extend({dataElementType:a.Rectangle,initialize:function(){var t;e.DatasetController.prototype.initialize.apply(this,arguments),(t=this.getMeta()).stack=this.getDataset().stack,t.bar=!0},update:function(t){var e,n,i=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,n=i.length;e<n;++e)this.updateElement(i[e],e,t)},updateElement:function(t,e,n){var i=this,a=i.chart,r=i.getMeta(),o=i.getDataset(),s=t.custom||{},l=a.options.elements.rectangle;t._xScale=i.getScaleForId(r.xAxisID),t._yScale=i.getScaleForId(r.yAxisID),t._datasetIndex=i.index,t._index=e,t._model={datasetLabel:o.label,label:a.data.labels[e],borderSkipped:s.borderSkipped?s.borderSkipped:l.borderSkipped,backgroundColor:s.backgroundColor?s.backgroundColor:S.valueAtIndexOrDefault(o.backgroundColor,e,l.backgroundColor),borderColor:s.borderColor?s.borderColor:S.valueAtIndexOrDefault(o.borderColor,e,l.borderColor),borderWidth:s.borderWidth?s.borderWidth:S.valueAtIndexOrDefault(o.borderWidth,e,l.borderWidth)},i.updateElementGeometry(t,e,n),t.pivot()},updateElementGeometry:function(t,e,n){var i=this,a=t._model,r=i.getValueScale(),o=r.getBasePixel(),s=r.isHorizontal(),l=i._ruler||i.getRuler(),u=i.calculateBarValuePixels(i.index,e),d=i.calculateBarIndexPixels(i.index,e,l);a.horizontal=s,a.base=n?o:u.base,a.x=s?n?o:u.head:d.center,a.y=s?d.center:n?o:u.head,a.height=s?d.size:void 0,a.width=s?void 0:d.size},getValueScaleId:function(){return this.getMeta().yAxisID},getIndexScaleId:function(){return this.getMeta().xAxisID},getValueScale:function(){return this.getScaleForId(this.getValueScaleId())},getIndexScale:function(){return this.getScaleForId(this.getIndexScaleId())},_getStacks:function(t){var e,n,i=this.chart,a=this.getIndexScale().options.stacked,r=void 0===t?i.data.datasets.length:t+1,o=[];for(e=0;e<r;++e)(n=i.getDatasetMeta(e)).bar&&i.isDatasetVisible(e)&&(!1===a||!0===a&&-1===o.indexOf(n.stack)||void 0===a&&(void 0===n.stack||-1===o.indexOf(n.stack)))&&o.push(n.stack);return o},getStackCount:function(){return this._getStacks().length},getStackIndex:function(t,e){var n=this._getStacks(t),i=void 0!==e?n.indexOf(e):-1;return-1===i?n.length-1:i},getRuler:function(){var t,e,n=this.getIndexScale(),i=this.getStackCount(),a=this.index,r=n.isHorizontal(),o=r?n.left:n.top,s=o+(r?n.width:n.height),l=[];for(t=0,e=this.getMeta().data.length;t<e;++t)l.push(n.getPixelForValue(null,t,a));return{min:S.isNullOrUndef(n.options.barThickness)?function(t,e){var n,i,a,r,o=t.isHorizontal()?t.width:t.height,s=t.getTicks();for(a=1,r=e.length;a<r;++a)o=Math.min(o,e[a]-e[a-1]);for(a=0,r=s.length;a<r;++a)i=t.getPixelForTick(a),o=0<a?Math.min(o,i-n):o,n=i;return o}(n,l):-1,pixels:l,start:o,end:s,stackCount:i,scale:n}},calculateBarValuePixels:function(t,e){var n,i,a,r,o,s,l=this.chart,u=this.getMeta(),d=this.getValueScale(),h=l.data.datasets,c=d.getRightValue(h[t].data[e]),f=d.options.stacked,g=u.stack,m=0;if(f||void 0===f&&void 0!==g)for(n=0;n<t;++n)(i=l.getDatasetMeta(n)).bar&&i.stack===g&&i.controller.getValueScaleId()===d.id&&l.isDatasetVisible(n)&&(a=d.getRightValue(h[n].data[e]),(c<0&&a<0||0<=c&&0<a)&&(m+=a));return r=d.getPixelForValue(m),{size:s=((o=d.getPixelForValue(m+c))-r)/2,base:r,head:o,center:o+s/2}},calculateBarIndexPixels:function(t,e,n){var i,a,r,o,s,l,u,d,h,c,f,g,m,p,v,b,y,x=n.scale.options,_="flex"===x.barThickness?(h=e,f=x,m=(c=n).pixels,p=m[h],v=0<h?m[h-1]:null,b=h<m.length-1?m[h+1]:null,y=f.categoryPercentage,null===v&&(v=p-(null===b?c.end-p:b-p)),null===b&&(b=p+p-v),g=p-(p-v)/2*y,{chunk:(b-v)/2*y/c.stackCount,ratio:f.barPercentage,start:g}):(i=e,a=n,l=(r=x).barThickness,u=a.stackCount,d=a.pixels[i],s=S.isNullOrUndef(l)?(o=a.min*r.categoryPercentage,r.barPercentage):(o=l*u,1),{chunk:o/u,ratio:s,start:d-o/2}),k=this.getStackIndex(t,this.getMeta().stack),w=_.start+_.chunk*k+_.chunk/2,M=Math.min(S.valueOrDefault(x.maxBarThickness,1/0),_.chunk*_.ratio);return{base:w-M/2,head:w+M/2,center:w,size:M}},draw:function(){var t=this.chart,e=this.getValueScale(),n=this.getMeta().data,i=this.getDataset(),a=n.length,r=0;for(S.canvas.clipArea(t.ctx,t.chartArea);r<a;++r)isNaN(e.getRightValue(i.data[r]))||n[r].draw();S.canvas.unclipArea(t.ctx)}}),e.controllers.horizontalBar=e.controllers.bar.extend({getValueScaleId:function(){return this.getMeta().xAxisID},getIndexScaleId:function(){return this.getMeta().yAxisID}})}},{26:26,41:41,46:46}],16:[function(t,e,n){"use strict";var i=t(26),a=t(41),g=t(46);i._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.datasets[t.datasetIndex].label||"",i=e.datasets[t.datasetIndex].data[t.index];return n+": ("+t.xLabel+", "+t.yLabel+", "+i.r+")"}}}}),e.exports=function(t){t.controllers.bubble=t.DatasetController.extend({dataElementType:a.Point,update:function(n){var i=this,t=i.getMeta().data;g.each(t,function(t,e){i.updateElement(t,e,n)})},updateElement:function(t,e,n){var i=this,a=i.getMeta(),r=t.custom||{},o=i.getScaleForId(a.xAxisID),s=i.getScaleForId(a.yAxisID),l=i._resolveElementOptions(t,e),u=i.getDataset().data[e],d=i.index,h=n?o.getPixelForDecimal(.5):o.getPixelForValue("object"==typeof u?u:NaN,e,d),c=n?s.getBasePixel():s.getPixelForValue(u,e,d);t._xScale=o,t._yScale=s,t._options=l,t._datasetIndex=d,t._index=e,t._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,rotation:l.rotation,radius:n?0:l.radius,skip:r.skip||isNaN(h)||isNaN(c),x:h,y:c},t.pivot()},setHoverStyle:function(t){var e=t._model,n=t._options;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=g.valueOrDefault(n.hoverBackgroundColor,g.getHoverColor(n.backgroundColor)),e.borderColor=g.valueOrDefault(n.hoverBorderColor,g.getHoverColor(n.borderColor)),e.borderWidth=g.valueOrDefault(n.hoverBorderWidth,n.borderWidth),e.radius=n.radius+n.hoverRadius},_resolveElementOptions:function(t,e){var n,i,a,r=this.chart,o=r.data.datasets[this.index],s=t.custom||{},l=r.options.elements.point,u=g.options.resolve,d=o.data[e],h={},c={chart:r,dataIndex:e,dataset:o,datasetIndex:this.index},f=["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"];for(n=0,i=f.length;n<i;++n)h[a=f[n]]=u([s[a],o[a],l[a]],c,e);return h.radius=u([s.radius,d?d.r:void 0,o.radius,l.radius],c,e),h}})}},{26:26,41:41,46:46}],17:[function(t,e,n){"use strict";var i=t(26),a=t(41),O=t(46);i._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var n=t.data,i=n.datasets,a=n.labels;if(i.length)for(var r=0;r<i[0].data.length;++r)e.push('<li><span style="background-color:'+i[0].backgroundColor[r]+'"></span>'),a[r]&&e.push(a[r]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(l){var u=l.data;return u.labels.length&&u.datasets.length?u.labels.map(function(t,e){var n=l.getDatasetMeta(0),i=u.datasets[0],a=n.data[e],r=a&&a.custom||{},o=O.valueAtIndexOrDefault,s=l.options.elements.arc;return{text:t,fillStyle:r.backgroundColor?r.backgroundColor:o(i.backgroundColor,e,s.backgroundColor),strokeStyle:r.borderColor?r.borderColor:o(i.borderColor,e,s.borderColor),lineWidth:r.borderWidth?r.borderWidth:o(i.borderWidth,e,s.borderWidth),hidden:isNaN(i.data[e])||n.data[e].hidden,index:e}}):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(a=o.getDatasetMeta(n)).data[r]&&(a.data[r].hidden=!a.data[r].hidden);o.update()}},cutoutPercentage:50,rotation:-.5*Math.PI,circumference:2*Math.PI,tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.labels[t.index],i=": "+e.datasets[t.datasetIndex].data[t.index];return O.isArray(n)?(n=n.slice())[0]+=i:n+=i,n}}}}),i._set("pie",O.clone(i.doughnut)),i._set("pie",{cutoutPercentage:0}),e.exports=function(t){t.controllers.doughnut=t.controllers.pie=t.DatasetController.extend({dataElementType:a.Arc,linkScales:O.noop,getRingIndex:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&++e;return e},update:function(n){var i=this,t=i.chart,e=t.chartArea,a=t.options,r=a.elements.arc,o=e.right-e.left-r.borderWidth,s=e.bottom-e.top-r.borderWidth,l=Math.min(o,s),u={x:0,y:0},d=i.getMeta(),h=a.cutoutPercentage,c=a.circumference;if(c<2*Math.PI){var f=a.rotation%(2*Math.PI),g=(f+=2*Math.PI*(f>=Math.PI?-1:f<-Math.PI?1:0))+c,m=Math.cos(f),p=Math.sin(f),v=Math.cos(g),b=Math.sin(g),y=f<=0&&0<=g||f<=2*Math.PI&&2*Math.PI<=g,x=f<=.5*Math.PI&&.5*Math.PI<=g||f<=2.5*Math.PI&&2.5*Math.PI<=g,_=f<=-Math.PI&&-Math.PI<=g||f<=Math.PI&&Math.PI<=g,k=f<=.5*-Math.PI&&.5*-Math.PI<=g||f<=1.5*Math.PI&&1.5*Math.PI<=g,w=h/100,M=_?-1:Math.min(m*(m<0?1:w),v*(v<0?1:w)),S=k?-1:Math.min(p*(p<0?1:w),b*(b<0?1:w)),D=y?1:Math.max(m*(0<m?1:w),v*(0<v?1:w)),C=x?1:Math.max(p*(0<p?1:w),b*(0<b?1:w)),P=.5*(D-M),T=.5*(C-S);l=Math.min(o/P,s/T),u={x:-.5*(D+M),y:-.5*(C+S)}}t.borderWidth=i.getMaxBorderWidth(d.data),t.outerRadius=Math.max((l-t.borderWidth)/2,0),t.innerRadius=Math.max(h?t.outerRadius/100*h:0,0),t.radiusLength=(t.outerRadius-t.innerRadius)/t.getVisibleDatasetCount(),t.offsetX=u.x*t.outerRadius,t.offsetY=u.y*t.outerRadius,d.total=i.calculateTotal(),i.outerRadius=t.outerRadius-t.radiusLength*i.getRingIndex(i.index),i.innerRadius=Math.max(i.outerRadius-t.radiusLength,0),O.each(d.data,function(t,e){i.updateElement(t,e,n)})},updateElement:function(t,e,n){var i=this,a=i.chart,r=a.chartArea,o=a.options,s=o.animation,l=(r.left+r.right)/2,u=(r.top+r.bottom)/2,d=o.rotation,h=o.rotation,c=i.getDataset(),f=n&&s.animateRotate?0:t.hidden?0:i.calculateCircumference(c.data[e])*(o.circumference/(2*Math.PI)),g=n&&s.animateScale?0:i.innerRadius,m=n&&s.animateScale?0:i.outerRadius,p=O.valueAtIndexOrDefault;O.extend(t,{_datasetIndex:i.index,_index:e,_model:{x:l+a.offsetX,y:u+a.offsetY,startAngle:d,endAngle:h,circumference:f,outerRadius:m,innerRadius:g,label:p(c.label,e,a.data.labels[e])}});var v=t._model,b=t.custom||{},y=O.valueAtIndexOrDefault,x=this.chart.options.elements.arc;v.backgroundColor=b.backgroundColor?b.backgroundColor:y(c.backgroundColor,e,x.backgroundColor),v.borderColor=b.borderColor?b.borderColor:y(c.borderColor,e,x.borderColor),v.borderWidth=b.borderWidth?b.borderWidth:y(c.borderWidth,e,x.borderWidth),n&&s.animateRotate||(v.startAngle=0===e?o.rotation:i.getMeta().data[e-1]._model.endAngle,v.endAngle=v.startAngle+v.circumference),t.pivot()},calculateTotal:function(){var n,i=this.getDataset(),t=this.getMeta(),a=0;return O.each(t.data,function(t,e){n=i.data[e],isNaN(n)||t.hidden||(a+=Math.abs(n))}),a},calculateCircumference:function(t){var e=this.getMeta().total;return 0<e&&!isNaN(t)?2*Math.PI*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){for(var e,n,i=0,a=this.index,r=t.length,o=0;o<r;o++)i=(i=i<(e=t[o]._model?t[o]._model.borderWidth:0)?e:i)<(n=t[o]._chart?t[o]._chart.config.data.datasets[a].hoverBorderWidth:0)?n:i;return i}})}},{26:26,41:41,46:46}],18:[function(t,e,n){"use strict";var i=t(26),a=t(41),g=t(46);i._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}}),e.exports=function(t){function f(t,e){return g.valueOrDefault(t.showLine,e.showLines)}t.controllers.line=t.DatasetController.extend({datasetElementType:a.Line,dataElementType:a.Point,update:function(t){var e,n,i,a=this,r=a.getMeta(),o=r.dataset,s=r.data||[],l=a.chart.options,u=l.elements.line,d=a.getScaleForId(r.yAxisID),h=a.getDataset(),c=f(h,l);for(c&&(i=o.custom||{},void 0!==h.tension&&void 0===h.lineTension&&(h.lineTension=h.tension),o._scale=d,o._datasetIndex=a.index,o._children=s,o._model={spanGaps:h.spanGaps?h.spanGaps:l.spanGaps,tension:i.tension?i.tension:g.valueOrDefault(h.lineTension,u.tension),backgroundColor:i.backgroundColor?i.backgroundColor:h.backgroundColor||u.backgroundColor,borderWidth:i.borderWidth?i.borderWidth:h.borderWidth||u.borderWidth,borderColor:i.borderColor?i.borderColor:h.borderColor||u.borderColor,borderCapStyle:i.borderCapStyle?i.borderCapStyle:h.borderCapStyle||u.borderCapStyle,borderDash:i.borderDash?i.borderDash:h.borderDash||u.borderDash,borderDashOffset:i.borderDashOffset?i.borderDashOffset:h.borderDashOffset||u.borderDashOffset,borderJoinStyle:i.borderJoinStyle?i.borderJoinStyle:h.borderJoinStyle||u.borderJoinStyle,fill:i.fill?i.fill:void 0!==h.fill?h.fill:u.fill,steppedLine:i.steppedLine?i.steppedLine:g.valueOrDefault(h.steppedLine,u.stepped),cubicInterpolationMode:i.cubicInterpolationMode?i.cubicInterpolationMode:g.valueOrDefault(h.cubicInterpolationMode,u.cubicInterpolationMode)},o.pivot()),e=0,n=s.length;e<n;++e)a.updateElement(s[e],e,t);for(c&&0!==o._model.tension&&a.updateBezierControlPoints(),e=0,n=s.length;e<n;++e)s[e].pivot()},getPointBackgroundColor:function(t,e){var n=this.chart.options.elements.point.backgroundColor,i=this.getDataset(),a=t.custom||{};return a.backgroundColor?n=a.backgroundColor:i.pointBackgroundColor?n=g.valueAtIndexOrDefault(i.pointBackgroundColor,e,n):i.backgroundColor&&(n=i.backgroundColor),n},getPointBorderColor:function(t,e){var n=this.chart.options.elements.point.borderColor,i=this.getDataset(),a=t.custom||{};return a.borderColor?n=a.borderColor:i.pointBorderColor?n=g.valueAtIndexOrDefault(i.pointBorderColor,e,n):i.borderColor&&(n=i.borderColor),n},getPointBorderWidth:function(t,e){var n=this.chart.options.elements.point.borderWidth,i=this.getDataset(),a=t.custom||{};return isNaN(a.borderWidth)?!isNaN(i.pointBorderWidth)||g.isArray(i.pointBorderWidth)?n=g.valueAtIndexOrDefault(i.pointBorderWidth,e,n):isNaN(i.borderWidth)||(n=i.borderWidth):n=a.borderWidth,n},getPointRotation:function(t,e){var n=this.chart.options.elements.point.rotation,i=this.getDataset(),a=t.custom||{};return isNaN(a.rotation)?isNaN(i.pointRotation)&&!g.isArray(i.pointRotation)||(n=g.valueAtIndexOrDefault(i.pointRotation,e,n)):n=a.rotation,n},updateElement:function(t,e,n){var i,a,r=this,o=r.getMeta(),s=t.custom||{},l=r.getDataset(),u=r.index,d=l.data[e],h=r.getScaleForId(o.yAxisID),c=r.getScaleForId(o.xAxisID),f=r.chart.options.elements.point;void 0!==l.radius&&void 0===l.pointRadius&&(l.pointRadius=l.radius),void 0!==l.hitRadius&&void 0===l.pointHitRadius&&(l.pointHitRadius=l.hitRadius),i=c.getPixelForValue("object"==typeof d?d:NaN,e,u),a=n?h.getBasePixel():r.calculatePointY(d,e,u),t._xScale=c,t._yScale=h,t._datasetIndex=u,t._index=e,t._model={x:i,y:a,skip:s.skip||isNaN(i)||isNaN(a),radius:s.radius||g.valueAtIndexOrDefault(l.pointRadius,e,f.radius),pointStyle:s.pointStyle||g.valueAtIndexOrDefault(l.pointStyle,e,f.pointStyle),rotation:r.getPointRotation(t,e),backgroundColor:r.getPointBackgroundColor(t,e),borderColor:r.getPointBorderColor(t,e),borderWidth:r.getPointBorderWidth(t,e),tension:o.dataset._model?o.dataset._model.tension:0,steppedLine:!!o.dataset._model&&o.dataset._model.steppedLine,hitRadius:s.hitRadius||g.valueAtIndexOrDefault(l.pointHitRadius,e,f.hitRadius)}},calculatePointY:function(t,e,n){var i,a,r,o=this.chart,s=this.getMeta(),l=this.getScaleForId(s.yAxisID),u=0,d=0;if(l.options.stacked){for(i=0;i<n;i++)if(a=o.data.datasets[i],"line"===(r=o.getDatasetMeta(i)).type&&r.yAxisID===l.id&&o.isDatasetVisible(i)){var h=Number(l.getRightValue(a.data[e]));h<0?d+=h||0:u+=h||0}var c=Number(l.getRightValue(t));return c<0?l.getPixelForValue(d+c):l.getPixelForValue(u+c)}return l.getPixelForValue(t)},updateBezierControlPoints:function(){var t,e,n,i,a=this.getMeta(),r=this.chart.chartArea,o=a.data||[];function s(t,e,n){return Math.max(Math.min(t,n),e)}if(a.dataset._model.spanGaps&&(o=o.filter(function(t){return!t._model.skip})),"monotone"===a.dataset._model.cubicInterpolationMode)g.splineCurveMonotone(o);else for(t=0,e=o.length;t<e;++t)n=o[t]._model,i=g.splineCurve(g.previousItem(o,t)._model,n,g.nextItem(o,t)._model,a.dataset._model.tension),n.controlPointPreviousX=i.previous.x,n.controlPointPreviousY=i.previous.y,n.controlPointNextX=i.next.x,n.controlPointNextY=i.next.y;if(this.chart.options.elements.line.capBezierPoints)for(t=0,e=o.length;t<e;++t)(n=o[t]._model).controlPointPreviousX=s(n.controlPointPreviousX,r.left,r.right),n.controlPointPreviousY=s(n.controlPointPreviousY,r.top,r.bottom),n.controlPointNextX=s(n.controlPointNextX,r.left,r.right),n.controlPointNextY=s(n.controlPointNextY,r.top,r.bottom)},draw:function(){var t,e=this.chart,n=this.getMeta(),i=n.data||[],a=e.chartArea,r=i.length,o=0;for(f(this.getDataset(),e.options)&&(t=(n.dataset._model.borderWidth||0)/2,g.canvas.clipArea(e.ctx,{left:a.left,right:a.right,top:a.top-t,bottom:a.bottom+t}),n.dataset.draw(),g.canvas.unclipArea(e.ctx));o<r;++o)i[o].draw(a)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model;t.$previousStyle={backgroundColor:a.backgroundColor,borderColor:a.borderColor,borderWidth:a.borderWidth,radius:a.radius},a.backgroundColor=i.hoverBackgroundColor||g.valueAtIndexOrDefault(e.pointHoverBackgroundColor,n,g.getHoverColor(a.backgroundColor)),a.borderColor=i.hoverBorderColor||g.valueAtIndexOrDefault(e.pointHoverBorderColor,n,g.getHoverColor(a.borderColor)),a.borderWidth=i.hoverBorderWidth||g.valueAtIndexOrDefault(e.pointHoverBorderWidth,n,a.borderWidth),a.radius=i.hoverRadius||g.valueAtIndexOrDefault(e.pointHoverRadius,n,this.chart.options.elements.point.hoverRadius)}})}},{26:26,41:41,46:46}],19:[function(t,e,n){"use strict";var i=t(26),a=t(41),_=t(46);i._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var n=t.data,i=n.datasets,a=n.labels;if(i.length)for(var r=0;r<i[0].data.length;++r)e.push('<li><span style="background-color:'+i[0].backgroundColor[r]+'"></span>'),a[r]&&e.push(a[r]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(s){var l=s.data;return l.labels.length&&l.datasets.length?l.labels.map(function(t,e){var n=s.getDatasetMeta(0),i=l.datasets[0],a=n.data[e].custom||{},r=_.valueAtIndexOrDefault,o=s.options.elements.arc;return{text:t,fillStyle:a.backgroundColor?a.backgroundColor:r(i.backgroundColor,e,o.backgroundColor),strokeStyle:a.borderColor?a.borderColor:r(i.borderColor,e,o.borderColor),lineWidth:a.borderWidth?a.borderWidth:r(i.borderWidth,e,o.borderWidth),hidden:isNaN(i.data[e])||n.data[e].hidden,index:e}}):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(a=o.getDatasetMeta(n)).data[r].hidden=!a.data[r].hidden;o.update()}},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+t.yLabel}}}}),e.exports=function(t){t.controllers.polarArea=t.DatasetController.extend({dataElementType:a.Arc,linkScales:_.noop,update:function(n){var t,e,i,a=this,r=a.getDataset(),o=a.getMeta(),s=a.chart.options.startAngle||0,l=a._starts=[],u=a._angles=[];for(a._updateRadius(),o.count=a.countVisibleElements(),t=0,e=r.data.length;t<e;t++)l[t]=s,i=a._computeAngle(t),s+=u[t]=i;_.each(o.data,function(t,e){a.updateElement(t,e,n)})},_updateRadius:function(){var t=this,e=t.chart,n=e.chartArea,i=e.options,a=i.elements.arc,r=Math.min(n.right-n.left,n.bottom-n.top);e.outerRadius=Math.max((r-a.borderWidth/2)/2,0),e.innerRadius=Math.max(i.cutoutPercentage?e.outerRadius/100*i.cutoutPercentage:1,0),e.radiusLength=(e.outerRadius-e.innerRadius)/e.getVisibleDatasetCount(),t.outerRadius=e.outerRadius-e.radiusLength*t.index,t.innerRadius=t.outerRadius-e.radiusLength},updateElement:function(t,e,n){var i=this,a=i.chart,r=i.getDataset(),o=a.options,s=o.animation,l=a.scale,u=a.data.labels,d=l.xCenter,h=l.yCenter,c=o.startAngle,f=t.hidden?0:l.getDistanceFromCenterForValue(r.data[e]),g=i._starts[e],m=g+(t.hidden?0:i._angles[e]),p=s.animateScale?0:l.getDistanceFromCenterForValue(r.data[e]);_.extend(t,{_datasetIndex:i.index,_index:e,_scale:l,_model:{x:d,y:h,innerRadius:0,outerRadius:n?p:f,startAngle:n&&s.animateRotate?c:g,endAngle:n&&s.animateRotate?c:m,label:_.valueAtIndexOrDefault(u,e,u[e])}});var v=this.chart.options.elements.arc,b=t.custom||{},y=_.valueAtIndexOrDefault,x=t._model;x.backgroundColor=b.backgroundColor?b.backgroundColor:y(r.backgroundColor,e,v.backgroundColor),x.borderColor=b.borderColor?b.borderColor:y(r.borderColor,e,v.borderColor),x.borderWidth=b.borderWidth?b.borderWidth:y(r.borderWidth,e,v.borderWidth),t.pivot()},countVisibleElements:function(){var n=this.getDataset(),t=this.getMeta(),i=0;return _.each(t.data,function(t,e){isNaN(n.data[e])||t.hidden||i++}),i},_computeAngle:function(t){var e=this,n=this.getMeta().count,i=e.getDataset(),a=e.getMeta();if(isNaN(i.data[t])||a.data[t].hidden)return 0;var r={chart:e.chart,dataIndex:t,dataset:i,datasetIndex:e.index};return _.options.resolve([e.chart.options.elements.arc.angle,2*Math.PI/n],r,t)}})}},{26:26,41:41,46:46}],20:[function(t,e,n){"use strict";var i=t(26),a=t(41),u=t(46);i._set("radar",{scale:{type:"radialLinear"},elements:{line:{tension:0}}}),e.exports=function(t){t.controllers.radar=t.DatasetController.extend({datasetElementType:a.Line,dataElementType:a.Point,linkScales:u.noop,update:function(n){var i=this,t=i.getMeta(),e=t.dataset,a=t.data,r=e.custom||{},o=i.getDataset(),s=i.chart.options.elements.line,l=i.chart.scale;void 0!==o.tension&&void 0===o.lineTension&&(o.lineTension=o.tension),u.extend(t.dataset,{_datasetIndex:i.index,_scale:l,_children:a,_loop:!0,_model:{tension:r.tension?r.tension:u.valueOrDefault(o.lineTension,s.tension),backgroundColor:r.backgroundColor?r.backgroundColor:o.backgroundColor||s.backgroundColor,borderWidth:r.borderWidth?r.borderWidth:o.borderWidth||s.borderWidth,borderColor:r.borderColor?r.borderColor:o.borderColor||s.borderColor,fill:r.fill?r.fill:void 0!==o.fill?o.fill:s.fill,borderCapStyle:r.borderCapStyle?r.borderCapStyle:o.borderCapStyle||s.borderCapStyle,borderDash:r.borderDash?r.borderDash:o.borderDash||s.borderDash,borderDashOffset:r.borderDashOffset?r.borderDashOffset:o.borderDashOffset||s.borderDashOffset,borderJoinStyle:r.borderJoinStyle?r.borderJoinStyle:o.borderJoinStyle||s.borderJoinStyle}}),t.dataset.pivot(),u.each(a,function(t,e){i.updateElement(t,e,n)},i),i.updateBezierControlPoints()},updateElement:function(t,e,n){var i=this,a=t.custom||{},r=i.getDataset(),o=i.chart.scale,s=i.chart.options.elements.point,l=o.getPointPositionForValue(e,r.data[e]);void 0!==r.radius&&void 0===r.pointRadius&&(r.pointRadius=r.radius),void 0!==r.hitRadius&&void 0===r.pointHitRadius&&(r.pointHitRadius=r.hitRadius),u.extend(t,{_datasetIndex:i.index,_index:e,_scale:o,_model:{x:n?o.xCenter:l.x,y:n?o.yCenter:l.y,tension:a.tension?a.tension:u.valueOrDefault(r.lineTension,i.chart.options.elements.line.tension),radius:a.radius?a.radius:u.valueAtIndexOrDefault(r.pointRadius,e,s.radius),backgroundColor:a.backgroundColor?a.backgroundColor:u.valueAtIndexOrDefault(r.pointBackgroundColor,e,s.backgroundColor),borderColor:a.borderColor?a.borderColor:u.valueAtIndexOrDefault(r.pointBorderColor,e,s.borderColor),borderWidth:a.borderWidth?a.borderWidth:u.valueAtIndexOrDefault(r.pointBorderWidth,e,s.borderWidth),pointStyle:a.pointStyle?a.pointStyle:u.valueAtIndexOrDefault(r.pointStyle,e,s.pointStyle),rotation:a.rotation?a.rotation:u.valueAtIndexOrDefault(r.pointRotation,e,s.rotation),hitRadius:a.hitRadius?a.hitRadius:u.valueAtIndexOrDefault(r.pointHitRadius,e,s.hitRadius)}}),t._model.skip=a.skip?a.skip:isNaN(t._model.x)||isNaN(t._model.y)},updateBezierControlPoints:function(){var a=this.chart.chartArea,r=this.getMeta();u.each(r.data,function(t,e){var n=t._model,i=u.splineCurve(u.previousItem(r.data,e,!0)._model,n,u.nextItem(r.data,e,!0)._model,n.tension);n.controlPointPreviousX=Math.max(Math.min(i.previous.x,a.right),a.left),n.controlPointPreviousY=Math.max(Math.min(i.previous.y,a.bottom),a.top),n.controlPointNextX=Math.max(Math.min(i.next.x,a.right),a.left),n.controlPointNextY=Math.max(Math.min(i.next.y,a.bottom),a.top),t.pivot()})},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t.custom||{},i=t._index,a=t._model;t.$previousStyle={backgroundColor:a.backgroundColor,borderColor:a.borderColor,borderWidth:a.borderWidth,radius:a.radius},a.radius=n.hoverRadius?n.hoverRadius:u.valueAtIndexOrDefault(e.pointHoverRadius,i,this.chart.options.elements.point.hoverRadius),a.backgroundColor=n.hoverBackgroundColor?n.hoverBackgroundColor:u.valueAtIndexOrDefault(e.pointHoverBackgroundColor,i,u.getHoverColor(a.backgroundColor)),a.borderColor=n.hoverBorderColor?n.hoverBorderColor:u.valueAtIndexOrDefault(e.pointHoverBorderColor,i,u.getHoverColor(a.borderColor)),a.borderWidth=n.hoverBorderWidth?n.hoverBorderWidth:u.valueAtIndexOrDefault(e.pointHoverBorderWidth,i,a.borderWidth)}})}},{26:26,41:41,46:46}],21:[function(t,e,n){"use strict";t(26)._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},showLines:!1,tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),e.exports=function(t){t.controllers.scatter=t.controllers.line}},{26:26}],22:[function(t,e,n){"use strict";var i=t(27);n=e.exports=i.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null});Object.defineProperty(n.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(n.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}})},{27:27}],23:[function(t,e,n){"use strict";var i=t(26),r=t(46);i._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:r.noop,onComplete:r.noop}}),e.exports={frameDuration:17,animations:[],dropFrames:0,request:null,addAnimation:function(t,e,n,i){var a,r,o=this.animations;for(e.chart=t,i||(t.animating=!0),a=0,r=o.length;a<r;++a)if(o[a].chart===t)return void(o[a]=e);o.push(e),1===o.length&&this.requestAnimationFrame()},cancelAnimation:function(e){var t=r.findIndex(this.animations,function(t){return t.chart===e});-1!==t&&(this.animations.splice(t,1),e.animating=!1)},requestAnimationFrame:function(){var t=this;null===t.request&&(t.request=r.requestAnimFrame.call(window,function(){t.request=null,t.startDigest()}))},startDigest:function(){var t=this,e=Date.now(),n=0;1<t.dropFrames&&(n=Math.floor(t.dropFrames),t.dropFrames=t.dropFrames%1),t.advance(1+n);var i=Date.now();t.dropFrames+=(i-e)/t.frameDuration,0<t.animations.length&&t.requestAnimationFrame()},advance:function(t){for(var e,n,i=this.animations,a=0;a<i.length;)n=(e=i[a]).chart,e.currentStep=(e.currentStep||0)+t,e.currentStep=Math.min(e.currentStep,e.numSteps),r.callback(e.render,[n,e],n),r.callback(e.onAnimationProgress,[e],n),e.currentStep>=e.numSteps?(r.callback(e.onAnimationComplete,[e],n),n.animating=!1,i.splice(a,1)):++a}}},{26:26,46:46}],24:[function(t,e,n){"use strict";var s=t(22),l=t(23),h=t(26),c=t(46),a=t(29),r=t(31),f=t(49),g=t(32),m=t(34),i=t(36);e.exports=function(u){function d(t){return"top"===t||"bottom"===t}u.types={},u.instances={},u.controllers={},c.extend(u.prototype,{construct:function(t,e){var n,i,a=this;(i=(n=(n=e)||{}).data=n.data||{}).datasets=i.datasets||[],i.labels=i.labels||[],n.options=c.configMerge(h.global,h[n.type],n.options||{}),e=n;var r=f.acquireContext(t,e),o=r&&r.canvas,s=o&&o.height,l=o&&o.width;a.id=c.uid(),a.ctx=r,a.canvas=o,a.config=e,a.width=l,a.height=s,a.aspectRatio=s?l/s:null,a.options=e.options,a._bufferedRender=!1,(a.chart=a).controller=a,u.instances[a.id]=a,Object.defineProperty(a,"data",{get:function(){return a.config.data},set:function(t){a.config.data=t}}),r&&o?(a.initialize(),a.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return g.notify(t,"beforeInit"),c.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.initToolTip(),g.notify(t,"afterInit"),t},clear:function(){return c.canvas.clear(this),this},stop:function(){return l.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,a=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(c.getMaximumWidth(i))),o=Math.max(0,Math.floor(a?r/a:c.getMaximumHeight(i)));if((e.width!==r||e.height!==o)&&(i.width=e.width=r,i.height=e.height=o,i.style.width=r+"px",i.style.height=o+"px",c.retinaScale(e,n.devicePixelRatio),!t)){var s={width:r,height:o};g.notify(e,"resize",[s]),e.options.onResize&&e.options.onResize(e,s),e.stop(),e.update({duration:e.options.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;c.each(e.xAxes,function(t,e){t.id=t.id||"x-axis-"+e}),c.each(e.yAxes,function(t,e){t.id=t.id||"y-axis-"+e}),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var o=this,t=o.options,s=o.scales||{},e=[],l=Object.keys(s).reduce(function(t,e){return t[e]=!1,t},{});t.scales&&(e=e.concat((t.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(t.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),t.scale&&e.push({options:t.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),c.each(e,function(t){var e=t.options,n=e.id,i=c.valueOrDefault(e.type,t.dtype);d(e.position)!==d(t.dposition)&&(e.position=t.dposition),l[n]=!0;var a=null;if(n in s&&s[n].type===i)(a=s[n]).options=e,a.ctx=o.ctx,a.chart=o;else{var r=m.getScaleConstructor(i);if(!r)return;a=new r({id:n,type:i,options:e,ctx:o.ctx,chart:o}),s[a.id]=a}a.mergeTicksOptions(),t.isDefault&&(o.scale=a)}),c.each(l,function(t,e){t||delete s[e]}),o.scales=s,m.addScalesToLayout(this)},buildOrUpdateControllers:function(){var r=this,o=[],s=[];return c.each(r.data.datasets,function(t,e){var n=r.getDatasetMeta(e),i=t.type||r.config.type;if(n.type&&n.type!==i&&(r.destroyDatasetMeta(e),n=r.getDatasetMeta(e)),n.type=i,o.push(n.type),n.controller)n.controller.updateIndex(e),n.controller.linkScales();else{var a=u.controllers[n.type];if(void 0===a)throw new Error('"'+n.type+'" is not a chart type.');n.controller=new a(r,e),s.push(n.controller)}},r),s},resetElements:function(){var n=this;c.each(n.data.datasets,function(t,e){n.getDatasetMeta(e).controller.reset()},n)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e,n,i=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),n=(e=i).options,c.each(e.scales,function(t){r.removeBox(e,t)}),n=c.configMerge(u.defaults.global,u.defaults[e.config.type],n),e.options=e.config.options=n,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=n.tooltips,e.tooltip.initialize(),g._invalidate(i),!1!==g.notify(i,"beforeUpdate")){i.tooltip._data=i.data;var a=i.buildOrUpdateControllers();c.each(i.data.datasets,function(t,e){i.getDatasetMeta(e).controller.buildOrUpdateElements()},i),i.updateLayout(),i.options.animation&&i.options.animation.duration&&c.each(a,function(t){t.reset()}),i.updateDatasets(),i.tooltip.initialize(),i.lastActive=[],g.notify(i,"afterUpdate"),i._bufferedRender?i._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:i.render(t)}},updateLayout:function(){!1!==g.notify(this,"beforeLayout")&&(r.update(this,this.width,this.height),g.notify(this,"afterScaleUpdate"),g.notify(this,"afterLayout"))},updateDatasets:function(){if(!1!==g.notify(this,"beforeDatasetsUpdate")){for(var t=0,e=this.data.datasets.length;t<e;++t)this.updateDataset(t);g.notify(this,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this.getDatasetMeta(t),n={meta:e,index:t};!1!==g.notify(this,"beforeDatasetUpdate",[n])&&(e.controller.update(),g.notify(this,"afterDatasetUpdate",[n]))},render:function(t){var e=this;t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]});var n=t.duration,i=t.lazy;if(!1!==g.notify(e,"beforeRender")){var a=e.options.animation,r=function(t){g.notify(e,"afterRender"),c.callback(a&&a.onComplete,[t],e)};if(a&&(void 0!==n&&0!==n||void 0===n&&0!==a.duration)){var o=new s({numSteps:(n||a.duration)/16.66,easing:t.easing||a.easing,render:function(t,e){var n=c.easing.effects[e.easing],i=e.currentStep,a=i/e.numSteps;t.draw(n(a),a,i)},onAnimationProgress:a.onProgress,onAnimationComplete:r});l.addAnimation(e,o,n,i)}else e.draw(),r(new s({numSteps:0,chart:e}));return e}},draw:function(t){var e=this;e.clear(),c.isNullOrUndef(t)&&(t=1),e.transition(t),e.width<=0||e.height<=0||!1!==g.notify(e,"beforeDraw",[t])&&(c.each(e.boxes,function(t){t.draw(e.chartArea)},e),e.scale&&e.scale.draw(),e.drawDatasets(t),e._drawTooltip(t),g.notify(e,"afterDraw",[t]))},transition:function(t){for(var e=0,n=(this.data.datasets||[]).length;e<n;++e)this.isDatasetVisible(e)&&this.getDatasetMeta(e).controller.transition(t);this.tooltip.transition(t)},drawDatasets:function(t){var e=this;if(!1!==g.notify(e,"beforeDatasetsDraw",[t])){for(var n=(e.data.datasets||[]).length-1;0<=n;--n)e.isDatasetVisible(n)&&e.drawDataset(n,t);g.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n=this.getDatasetMeta(t),i={meta:n,index:t,easingValue:e};!1!==g.notify(this,"beforeDatasetDraw",[i])&&(n.controller.draw(e),g.notify(this,"afterDatasetDraw",[i]))},_drawTooltip:function(t){var e=this.tooltip,n={tooltip:e,easingValue:t};!1!==g.notify(this,"beforeTooltipDraw",[n])&&(e.draw(),g.notify(this,"afterTooltipDraw",[n]))},getElementAtEvent:function(t){return a.modes.single(this,t)},getElementsAtEvent:function(t){return a.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return a.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=a.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return a.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this.data.datasets[t];e._meta||(e._meta={});var n=e._meta[this.id];return n||(n=e._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e<n;++e)this.isDatasetVisible(e)&&t++;return t},isDatasetVisible:function(t){var e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!this.data.datasets[t].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(t){var e=this.id,n=this.data.datasets[t],i=n._meta&&n._meta[e];i&&(i.controller.destroy(),delete n._meta[e])},destroy:function(){var t,e,n=this,i=n.canvas;for(n.stop(),t=0,e=n.data.datasets.length;t<e;++t)n.destroyDatasetMeta(t);i&&(n.unbindEvents(),c.canvas.clear(n),f.releaseContext(n.ctx),n.canvas=null,n.ctx=null),g.notify(n,"destroy"),delete u.instances[n.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var t=this;t.tooltip=new i({_chart:t,_chartInstance:t,_data:t.data,_options:t.options.tooltips},t)},bindEvents:function(){var e=this,n=e._listeners={},i=function(){e.eventHandler.apply(e,arguments)};c.each(e.options.events,function(t){f.addEventListener(e,t,i),n[t]=i}),e.options.responsive&&(i=function(){e.resize()},f.addEventListener(e,"resize",i),n.resize=i)},unbindEvents:function(){var n=this,t=n._listeners;t&&(delete n._listeners,c.each(t,function(t,e){f.removeEventListener(n,e,t)}))},updateHoverStyle:function(t,e,n){var i,a,r,o=n?"setHoverStyle":"removeHoverStyle";for(a=0,r=t.length;a<r;++a)(i=t[a])&&this.getDatasetMeta(i._datasetIndex).controller[o](i)},eventHandler:function(t){var e=this,n=e.tooltip;if(!1!==g.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var i=e.handleEvent(t);n&&(i=n._start?n.handleEvent(t):i|n.handleEvent(t)),g.notify(e,"afterEvent",[t]);var a=e._bufferedRequest;return a?e.render(a):i&&!e.animating&&(e.stop(),e.render({duration:e.options.hover.animationDuration,lazy:!0})),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e,n=this,i=n.options||{},a=i.hover;return n.lastActive=n.lastActive||[],"mouseout"===t.type?n.active=[]:n.active=n.getElementsAtEventForMode(t,a.mode,a),c.callback(i.onHover||i.hover.onHover,[t.native,n.active],n),"mouseup"!==t.type&&"click"!==t.type||i.onClick&&i.onClick.call(n,t.native,n.active),n.lastActive.length&&n.updateHoverStyle(n.lastActive,a.mode,!1),n.active.length&&a.mode&&n.updateHoverStyle(n.active,a.mode,!0),e=!c.arrayEquals(n.active,n.lastActive),n.lastActive=n.active,e}}),u.Controller=u}},{22:22,23:23,26:26,29:29,31:31,32:32,34:34,36:36,46:46,49:49}],25:[function(t,e,n){"use strict";var s=t(46);e.exports=function(t){var r=["push","pop","shift","splice","unshift"];function o(e,t){var n=e._chartjs;if(n){var i=n.listeners,a=i.indexOf(t);-1!==a&&i.splice(a,1),0<i.length||(r.forEach(function(t){delete e[t]}),delete e._chartjs)}}t.DatasetController=function(t,e){this.initialize(t,e)},s.extend(t.DatasetController.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.getDataset();null!==e.xAxisID&&e.xAxisID in t.chart.scales||(e.xAxisID=n.xAxisID||t.chart.options.scales.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in t.chart.scales||(e.yAxisID=n.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},reset:function(){this.update(!0)},destroy:function(){this._data&&o(this._data,this)},createMetaDataset:function(){var t=this.datasetElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(t){var e=this.dataElementType;return e&&new e({_chart:this.chart,_datasetIndex:this.index,_index:t})},addElements:function(){var t,e,n=this.getMeta(),i=this.getDataset().data||[],a=n.data;for(t=0,e=i.length;t<e;++t)a[t]=a[t]||this.createMetaData(t);n.dataset=n.dataset||this.createMetaDataset()},addElementAndReset:function(t){var e=this.createMetaData(t);this.getMeta().data.splice(t,0,e),this.updateElement(e,t,!0)},buildOrUpdateElements:function(){var a,t,e=this,n=e.getDataset(),i=n.data||(n.data=[]);e._data!==i&&(e._data&&o(e._data,e),t=e,(a=i)._chartjs?a._chartjs.listeners.push(t):(Object.defineProperty(a,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),r.forEach(function(t){var n="onData"+t.charAt(0).toUpperCase()+t.slice(1),i=a[t];Object.defineProperty(a,t,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),t=i.apply(this,e);return s.each(a._chartjs.listeners,function(t){"function"==typeof t[n]&&t[n].apply(t,e)}),t}})})),e._data=i),e.resyncElements()},update:s.noop,transition:function(t){for(var e=this.getMeta(),n=e.data||[],i=n.length,a=0;a<i;++a)n[a].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],n=e.length,i=0;for(t.dataset&&t.dataset.draw();i<n;++i)e[i].draw()},removeHoverStyle:function(t){s.merge(t._model,t.$previousStyle||{}),delete t.$previousStyle},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=s.valueAtIndexOrDefault,r=s.getHoverColor,o=t._model;t.$previousStyle={backgroundColor:o.backgroundColor,borderColor:o.borderColor,borderWidth:o.borderWidth},o.backgroundColor=i.hoverBackgroundColor?i.hoverBackgroundColor:a(e.hoverBackgroundColor,n,r(o.backgroundColor)),o.borderColor=i.hoverBorderColor?i.hoverBorderColor:a(e.hoverBorderColor,n,r(o.borderColor)),o.borderWidth=i.hoverBorderWidth?i.hoverBorderWidth:a(e.hoverBorderWidth,n,o.borderWidth)},resyncElements:function(){var t=this.getMeta(),e=this.getDataset().data,n=t.data.length,i=e.length;i<n?t.data.splice(i,n-i):n<i&&this.insertElements(n,i-n)},insertElements:function(t,e){for(var n=0;n<e;++n)this.addElementAndReset(t+n)},onDataPush:function(){this.insertElements(this.getDataset().data.length-1,arguments.length)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(t,e){this.getMeta().data.splice(t,e),this.insertElements(t,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),t.DatasetController.extend=s.inherits}},{46:46}],26:[function(t,e,n){"use strict";var i=t(46);e.exports={_set:function(t,e){return i.merge(this[t]||(this[t]={}),e)}}},{46:46}],27:[function(t,e,n){"use strict";var g=t(2),i=t(46);var a=function(t){i.extend(this,t),this.initialize.apply(this,arguments)};i.extend(a.prototype,{initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=i.clone(t._model)),t._start={},t},transition:function(t){var e=this,n=e._model,i=e._start,a=e._view;return n&&1!==t?(a||(a=e._view={}),i||(i=e._start={}),function(t,e,n,i){var a,r,o,s,l,u,d,h,c,f=Object.keys(n);for(a=0,r=f.length;a<r;++a)if(u=n[o=f[a]],e.hasOwnProperty(o)||(e[o]=u),(s=e[o])!==u&&"_"!==o[0]){if(t.hasOwnProperty(o)||(t[o]=s),(d=typeof u)==typeof(l=t[o]))if("string"===d){if((h=g(l)).valid&&(c=g(u)).valid){e[o]=c.mix(h,i).rgbString();continue}}else if("number"===d&&isFinite(l)&&isFinite(u)){e[o]=l+(u-l)*i;continue}e[o]=u}}(i,a,n,t)):(e._view=n,e._start=null),e},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return i.isNumber(this._model.x)&&i.isNumber(this._model.y)}}),a.extend=i.inherits,e.exports=a},{2:2,46:46}],28:[function(t,e,n){"use strict";var i=t(2),a=t(26),g=t(46),l=t(34);e.exports=function(){function d(t,e,n){var i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}function h(t){return null!=t&&"none"!==t}function e(t,e,n){var i=document.defaultView,a=g._getParentNode(t),r=i.getComputedStyle(t)[e],o=i.getComputedStyle(a)[e],s=h(r),l=h(o),u=Number.POSITIVE_INFINITY;return s||l?Math.min(s?d(r,t,n):u,l?d(o,a,n):u):"none"}g.configMerge=function(){return g.merge(g.clone(arguments[0]),[].slice.call(arguments,1),{merger:function(t,e,n,i){var a=e[t]||{},r=n[t];"scales"===t?e[t]=g.scaleMerge(a,r):"scale"===t?e[t]=g.merge(a,[l.getScaleDefaults(r.type),r]):g._merger(t,e,n,i)}})},g.scaleMerge=function(){return g.merge(g.clone(arguments[0]),[].slice.call(arguments,1),{merger:function(t,e,n,i){if("xAxes"===t||"yAxes"===t){var a,r,o,s=n[t].length;for(e[t]||(e[t]=[]),a=0;a<s;++a)o=n[t][a],r=g.valueOrDefault(o.type,"xAxes"===t?"category":"linear"),a>=e[t].length&&e[t].push({}),!e[t][a].type||o.type&&o.type!==e[t][a].type?g.merge(e[t][a],[l.getScaleDefaults(r),o]):g.merge(e[t][a],o)}else g._merger(t,e,n,i)}})},g.where=function(t,e){if(g.isArray(t)&&Array.prototype.filter)return t.filter(e);var n=[];return g.each(t,function(t){e(t)&&n.push(t)}),n},g.findIndex=Array.prototype.findIndex?function(t,e,n){return t.findIndex(e,n)}:function(t,e,n){n=void 0===n?t:n;for(var i=0,a=t.length;i<a;++i)if(e.call(n,t[i],i,t))return i;return-1},g.findNextWhere=function(t,e,n){g.isNullOrUndef(n)&&(n=-1);for(var i=n+1;i<t.length;i++){var a=t[i];if(e(a))return a}},g.findPreviousWhere=function(t,e,n){g.isNullOrUndef(n)&&(n=t.length);for(var i=n-1;0<=i;i--){var a=t[i];if(e(a))return a}},g.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},g.almostEquals=function(t,e,n){return Math.abs(t-e)<n},g.almostWhole=function(t,e){var n=Math.round(t);return n-e<t&&t<n+e},g.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},g.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},g.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0===(t=+t)||isNaN(t)?t:0<t?1:-1},g.log10=Math.log10?function(t){return Math.log10(t)}:function(t){var e=Math.log(t)*Math.LOG10E,n=Math.round(e);return t===Math.pow(10,n)?n:e},g.toRadians=function(t){return t*(Math.PI/180)},g.toDegrees=function(t){return t*(180/Math.PI)},g.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},g.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},g.aliasPixel=function(t){return t%2==0?0:.5},g.splineCurve=function(t,e,n,i){var a=t.skip?e:t,r=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),u=s/(s+l),d=l/(s+l),h=i*(u=isNaN(u)?0:u),c=i*(d=isNaN(d)?0:d);return{previous:{x:r.x-h*(o.x-a.x),y:r.y-h*(o.y-a.y)},next:{x:r.x+c*(o.x-a.x),y:r.y+c*(o.y-a.y)}}},g.EPSILON=Number.EPSILON||1e-14,g.splineCurveMonotone=function(t){var e,n,i,a,r,o,s,l,u,d=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),h=d.length;for(e=0;e<h;++e)if(!(i=d[e]).model.skip){if(n=0<e?d[e-1]:null,(a=e<h-1?d[e+1]:null)&&!a.model.skip){var c=a.model.x-i.model.x;i.deltaK=0!==c?(a.model.y-i.model.y)/c:0}!n||n.model.skip?i.mK=i.deltaK:!a||a.model.skip?i.mK=n.deltaK:this.sign(n.deltaK)!==this.sign(i.deltaK)?i.mK=0:i.mK=(n.deltaK+i.deltaK)/2}for(e=0;e<h-1;++e)i=d[e],a=d[e+1],i.model.skip||a.model.skip||(g.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=a.mK=0:(r=i.mK/i.deltaK,o=a.mK/i.deltaK,(l=Math.pow(r,2)+Math.pow(o,2))<=9||(s=3/Math.sqrt(l),i.mK=r*s*i.deltaK,a.mK=o*s*i.deltaK)));for(e=0;e<h;++e)(i=d[e]).model.skip||(n=0<e?d[e-1]:null,a=e<h-1?d[e+1]:null,n&&!n.model.skip&&(u=(i.model.x-n.model.x)/3,i.model.controlPointPreviousX=i.model.x-u,i.model.controlPointPreviousY=i.model.y-u*i.mK),a&&!a.model.skip&&(u=(a.model.x-i.model.x)/3,i.model.controlPointNextX=i.model.x+u,i.model.controlPointNextY=i.model.y+u*i.mK))},g.nextItem=function(t,e,n){return n?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},g.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},g.niceNum=function(t,e){var n=Math.floor(g.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},g.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},g.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.target||t.srcElement,o=r.getBoundingClientRect(),s=a.touches;i=s&&0<s.length?(n=s[0].clientX,s[0].clientY):(n=a.clientX,a.clientY);var l=parseFloat(g.getStyle(r,"padding-left")),u=parseFloat(g.getStyle(r,"padding-top")),d=parseFloat(g.getStyle(r,"padding-right")),h=parseFloat(g.getStyle(r,"padding-bottom")),c=o.right-o.left-l-d,f=o.bottom-o.top-u-h;return{x:n=Math.round((n-o.left-l)/c*r.width/e.currentDevicePixelRatio),y:i=Math.round((i-o.top-u)/f*r.height/e.currentDevicePixelRatio)}},g.getConstraintWidth=function(t){return e(t,"max-width","clientWidth")},g.getConstraintHeight=function(t){return e(t,"max-height","clientHeight")},g._calculatePadding=function(t,e,n){return-1<(e=g.getStyle(t,e)).indexOf("%")?n/parseInt(e,10):parseInt(e,10)},g._getParentNode=function(t){var e=t.parentNode;return e&&e.host&&(e=e.host),e},g.getMaximumWidth=function(t){var e=g._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,i=n-g._calculatePadding(e,"padding-left",n)-g._calculatePadding(e,"padding-right",n),a=g.getConstraintWidth(t);return isNaN(a)?i:Math.min(i,a)},g.getMaximumHeight=function(t){var e=g._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,i=n-g._calculatePadding(e,"padding-top",n)-g._calculatePadding(e,"padding-bottom",n),a=g.getConstraintHeight(t);return isNaN(a)?i:Math.min(i,a)},g.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},g.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,r=t.width;i.height=a*n,i.width=r*n,t.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=a+"px",i.style.width=r+"px")}},g.fontString=function(t,e,n){return e+" "+t+"px "+n},g.longestText=function(e,t,n,i){var a=(i=i||{}).data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(a=i.data={},r=i.garbageCollect=[],i.font=t),e.font=t;var o=0;g.each(n,function(t){null!=t&&!0!==g.isArray(t)?o=g.measureText(e,a,r,o,t):g.isArray(t)&&g.each(t,function(t){null==t||g.isArray(t)||(o=g.measureText(e,a,r,o,t))})});var s=r.length/2;if(s>n.length){for(var l=0;l<s;l++)delete a[r[l]];r.splice(0,s)}return o},g.measureText=function(t,e,n,i,a){var r=e[a];return r||(r=e[a]=t.measureText(a).width,n.push(a)),i<r&&(i=r),i},g.numberOfLabelLines=function(t){var e=1;return g.each(t,function(t){g.isArray(t)&&t.length>e&&(e=t.length)}),e},g.color=i?function(t){return t instanceof CanvasGradient&&(t=a.global.defaultColor),i(t)}:function(t){return console.error("Color.js not found!"),t},g.getHoverColor=function(t){return t instanceof CanvasPattern?t:g.color(t).saturate(.5).darken(.1).rgbString()}}},{2:2,26:26,34:34,46:46}],29:[function(t,e,n){"use strict";var i=t(46);function s(t,e){return t.native?{x:t.x,y:t.y}:i.getRelativePosition(t,e)}function l(t,e){var n,i,a,r,o;for(i=0,r=t.data.datasets.length;i<r;++i)if(t.isDatasetVisible(i))for(a=0,o=(n=t.getDatasetMeta(i)).data.length;a<o;++a){var s=n.data[a];s._view.skip||e(s)}}function u(t,e){var n=[];return l(t,function(t){t.inRange(e.x,e.y)&&n.push(t)}),n}function d(t,i,a,r){var o=Number.POSITIVE_INFINITY,s=[];return l(t,function(t){if(!a||t.inRange(i.x,i.y)){var e=t.getCenterPoint(),n=r(i,e);n<o?(s=[t],o=n):n===o&&s.push(t)}}),s}function h(t){var a=-1!==t.indexOf("x"),r=-1!==t.indexOf("y");return function(t,e){var n=a?Math.abs(t.x-e.x):0,i=r?Math.abs(t.y-e.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(i,2))}}function a(i,t,e){var n=s(t,i);e.axis=e.axis||"x";var a=h(e.axis),r=e.intersect?u(i,n):d(i,n,!1,a),o=[];return r.length?(i.data.datasets.forEach(function(t,e){if(i.isDatasetVisible(e)){var n=i.getDatasetMeta(e).data[r[0]._index];n&&!n._view.skip&&o.push(n)}}),o):[]}e.exports={modes:{single:function(t,e){var n=s(e,t),i=[];return l(t,function(t){if(t.inRange(n.x,n.y))return i.push(t),i}),i.slice(0,1)},label:a,index:a,dataset:function(t,e,n){var i=s(e,t);n.axis=n.axis||"xy";var a=h(n.axis),r=n.intersect?u(t,i):d(t,i,!1,a);return 0<r.length&&(r=t.getDatasetMeta(r[0]._datasetIndex).data),r},"x-axis":function(t,e){return a(t,e,{intersect:!1})},point:function(t,e){return u(t,s(e,t))},nearest:function(t,e,n){var i=s(e,t);n.axis=n.axis||"xy";var a=h(n.axis),r=d(t,i,n.intersect,a);return 1<r.length&&r.sort(function(t,e){var n=t.getArea()-e.getArea();return 0===n&&(n=t._datasetIndex-e._datasetIndex),n}),r.slice(0,1)},x:function(t,e,n){var i=s(e,t),a=[],r=!1;return l(t,function(t){t.inXRange(i.x)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)}),n.intersect&&!r&&(a=[]),a},y:function(t,e,n){var i=s(e,t),a=[],r=!1;return l(t,function(t){t.inYRange(i.y)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)}),n.intersect&&!r&&(a=[]),a}}}},{46:46}],30:[function(t,e,n){"use strict";t(26)._set("global",{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",showLines:!0,elements:{},layout:{padding:{top:0,right:0,bottom:0,left:0}}}),e.exports=function(){var t=function(t,e){return this.construct(t,e),this};return t.Chart=t}},{26:26}],31:[function(t,e,n){"use strict";var N=t(46);function z(t,e){return N.where(t,function(t){return t.position===e})}function V(t,a){t.forEach(function(t,e){return t._tmpIndex_=e,t}),t.sort(function(t,e){var n=a?e:t,i=a?t:e;return n.weight===i.weight?n._tmpIndex_-i._tmpIndex_:n.weight-i.weight}),t.forEach(function(t){delete t._tmpIndex_})}e.exports={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,t.boxes.push(e)},removeBox:function(t,e){var n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure:function(t,e,n){for(var i,a=["fullWidth","position","weight"],r=a.length,o=0;o<r;++o)i=a[o],n.hasOwnProperty(i)&&(e[i]=n[i])},update:function(e,n,t){if(e){var i=e.options.layout||{},a=N.options.toPadding(i.padding),r=a.left,o=a.right,s=a.top,l=a.bottom,u=z(e.boxes,"left"),d=z(e.boxes,"right"),h=z(e.boxes,"top"),c=z(e.boxes,"bottom"),f=z(e.boxes,"chartArea");V(u,!0),V(d,!1),V(h,!0),V(c,!1);var g=n-r-o,m=t-s-l,p=m/2,v=(n-g/2)/(u.length+d.length),b=(t-p)/(h.length+c.length),y=g,x=m,_=[];N.each(u.concat(d,h,c),function(t){var e,n=t.isHorizontal();n?(e=t.update(t.fullWidth?g:y,b),x-=e.height):(e=t.update(v,x),y-=e.width),_.push({horizontal:n,minSize:e,box:t})});var k=0,w=0,M=0,S=0;N.each(h.concat(c),function(t){if(t.getPadding){var e=t.getPadding();k=Math.max(k,e.left),w=Math.max(w,e.right)}}),N.each(u.concat(d),function(t){if(t.getPadding){var e=t.getPadding();M=Math.max(M,e.top),S=Math.max(S,e.bottom)}});var D=r,C=o,P=s,T=l;N.each(u.concat(d),Y),N.each(u,function(t){D+=t.width}),N.each(d,function(t){C+=t.width}),N.each(h.concat(c),Y),N.each(h,function(t){P+=t.height}),N.each(c,function(t){T+=t.height}),N.each(u.concat(d),function(e){var t=N.findNextWhere(_,function(t){return t.box===e}),n={left:0,right:0,top:P,bottom:T};t&&e.update(t.minSize.width,x,n)}),D=r,C=o,P=s,T=l,N.each(u,function(t){D+=t.width}),N.each(d,function(t){C+=t.width}),N.each(h,function(t){P+=t.height}),N.each(c,function(t){T+=t.height});var O=Math.max(k-D,0);D+=O,C+=Math.max(w-C,0);var I=Math.max(M-P,0);P+=I,T+=Math.max(S-T,0);var A=t-P-T,F=n-D-C;F===y&&A===x||(N.each(u,function(t){t.height=A}),N.each(d,function(t){t.height=A}),N.each(h,function(t){t.fullWidth||(t.width=F)}),N.each(c,function(t){t.fullWidth||(t.width=F)}),x=A,y=F);var R=r+O,L=s+I;N.each(u.concat(h),W),R+=y,L+=x,N.each(d,W),N.each(c,W),e.chartArea={left:D,top:P,right:D+y,bottom:P+x},N.each(f,function(t){t.left=e.chartArea.left,t.top=e.chartArea.top,t.right=e.chartArea.right,t.bottom=e.chartArea.bottom,t.update(y,x)})}function Y(e){var t=N.findNextWhere(_,function(t){return t.box===e});if(t)if(e.isHorizontal()){var n={left:Math.max(D,k),right:Math.max(C,w),top:0,bottom:0};e.update(e.fullWidth?g:y,m/2,n)}else e.update(t.minSize.width,x)}function W(t){t.isHorizontal()?(t.left=t.fullWidth?r:D,t.right=t.fullWidth?n-o:D+y,t.top=L,t.bottom=L+t.height,L=t.bottom):(t.left=R,t.right=R+t.width,t.top=P,t.bottom=P+x,R=t.right)}}}},{46:46}],32:[function(t,e,n){"use strict";var o=t(26),s=t(46);o._set("global",{plugins:{}}),e.exports={_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach(function(t){-1===e.indexOf(t)&&e.push(t)}),this._cacheId++},unregister:function(t){var n=this._plugins;[].concat(t).forEach(function(t){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,n){var i,a,r,o,s,l=this.descriptors(t),u=l.length;for(i=0;i<u;++i)if("function"==typeof(s=(r=(a=l[i]).plugin)[e])&&((o=[t].concat(n||[])).push(a.options),!1===s.apply(r,o)))return!1;return!0},descriptors:function(t){var e=t.$plugins||(t.$plugins={});if(e.id===this._cacheId)return e.descriptors;var i=[],a=[],n=t&&t.config||{},r=n.options&&n.options.plugins||{};return this._plugins.concat(n.plugins||[]).forEach(function(t){if(-1===i.indexOf(t)){var e=t.id,n=r[e];!1!==n&&(!0===n&&(n=s.clone(o.global.plugins[e])),i.push(t),a.push({plugin:t,options:n||{}}))}}),e.descriptors=a,e.id=this._cacheId,a},_invalidate:function(t){delete t.$plugins}}},{26:26,46:46}],33:[function(t,e,n){"use strict";var x=t(26),i=t(27),B=t(46),a=t(35);function _(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(t[e].label);return i}function E(t,e,n){var i=t.getPixelForTick(e);return n&&(i-=0===e?(t.getPixelForTick(1)-i)/2:(i-t.getPixelForTick(e-1))/2),i}function k(t,e,n){return B.isArray(e)?B.longestText(t,n,e):t.measureText(e).width}function w(t){var e=B.valueOrDefault,n=x.global,i=e(t.fontSize,n.defaultFontSize),a=e(t.fontStyle,n.defaultFontStyle),r=e(t.fontFamily,n.defaultFontFamily);return{size:i,style:a,family:r,font:B.fontString(i,a,r)}}function M(t){return B.options.toLineHeight(B.valueOrDefault(t.lineHeight,1.2),B.valueOrDefault(t.fontSize,x.global.defaultFontSize))}x._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",lineHeight:1.2,padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:a.formatters.values,minor:{},major:{}}}),e.exports=i.extend({getPadding:function(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}},getTicks:function(){return this._ticks},mergeTicksOptions:function(){var t=this.options.ticks;for(var e in!1===t.minor&&(t.minor={display:!1}),!1===t.major&&(t.major={display:!1}),t)"major"!==e&&"minor"!==e&&(void 0===t.minor[e]&&(t.minor[e]=t[e]),void 0===t.major[e]&&(t.major[e]=t[e]))},beforeUpdate:function(){B.callback(this.options.beforeUpdate,[this])},update:function(t,e,n){var i,a,r,o,s,l,u=this;for(u.beforeUpdate(),u.maxWidth=t,u.maxHeight=e,u.margins=B.extend({left:0,right:0,top:0,bottom:0},n),u.longestTextCache=u.longestTextCache||{},u.beforeSetDimensions(),u.setDimensions(),u.afterSetDimensions(),u.beforeDataLimits(),u.determineDataLimits(),u.afterDataLimits(),u.beforeBuildTicks(),s=u.buildTicks()||[],u.afterBuildTicks(),u.beforeTickToLabelConversion(),r=u.convertTicksToLabels(s)||u.ticks,u.afterTickToLabelConversion(),i=0,a=(u.ticks=r).length;i<a;++i)o=r[i],(l=s[i])?l.label=o:s.push(l={label:o,major:!1});return u._ticks=s,u.beforeCalculateTickRotation(),u.calculateTickRotation(),u.afterCalculateTickRotation(),u.beforeFit(),u.fit(),u.afterFit(),u.afterUpdate(),u.minSize},afterUpdate:function(){B.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){B.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0},afterSetDimensions:function(){B.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){B.callback(this.options.beforeDataLimits,[this])},determineDataLimits:B.noop,afterDataLimits:function(){B.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){B.callback(this.options.beforeBuildTicks,[this])},buildTicks:B.noop,afterBuildTicks:function(){B.callback(this.options.afterBuildTicks,[this])},beforeTickToLabelConversion:function(){B.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this.options.ticks;this.ticks=this.ticks.map(t.userCallback||t.callback,this)},afterTickToLabelConversion:function(){B.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){B.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t=this,e=t.ctx,n=t.options.ticks,i=_(t._ticks),a=w(n);e.font=a.font;var r=n.minRotation||0;if(i.length&&t.options.display&&t.isHorizontal())for(var o,s=B.longestText(e,a.font,i,t.longestTextCache),l=s,u=t.getPixelForTick(1)-t.getPixelForTick(0)-6;u<l&&r<n.maxRotation;){var d=B.toRadians(r);if(o=Math.cos(d),Math.sin(d)*s>t.maxHeight){r--;break}r++,l=o*s}t.labelRotation=r},afterCalculateTickRotation:function(){B.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){B.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=_(t._ticks),i=t.options,a=i.ticks,r=i.scaleLabel,o=i.gridLines,s=i.display,l=t.isHorizontal(),u=w(a),d=i.gridLines.tickMarkLength;if(e.width=l?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:s&&o.drawTicks?d:0,e.height=l?s&&o.drawTicks?d:0:t.maxHeight,r.display&&s){var h=M(r)+B.options.toPadding(r.padding).height;l?e.height+=h:e.width+=h}if(a.display&&s){var c=B.longestText(t.ctx,u.font,n,t.longestTextCache),f=B.numberOfLabelLines(n),g=.5*u.size,m=t.options.ticks.padding;if(l){t.longestLabelWidth=c;var p=B.toRadians(t.labelRotation),v=Math.cos(p),b=Math.sin(p)*c+u.size*f+g*(f-1)+g;e.height=Math.min(t.maxHeight,e.height+b+m),t.ctx.font=u.font;var y=k(t.ctx,n[0],u.font),x=k(t.ctx,n[n.length-1],u.font);0!==t.labelRotation?(t.paddingLeft="bottom"===i.position?v*y+3:v*g+3,t.paddingRight="bottom"===i.position?v*g+3:v*x+3):(t.paddingLeft=y/2+3,t.paddingRight=x/2+3)}else a.mirror?c=0:c+=m+g,e.width=Math.min(t.maxWidth,e.width+c),t.paddingTop=u.size/2,t.paddingBottom=u.size/2}t.handleMargins(),t.width=e.width,t.height=e.height},handleMargins:function(){var t=this;t.margins&&(t.paddingLeft=Math.max(t.paddingLeft-t.margins.left,0),t.paddingTop=Math.max(t.paddingTop-t.margins.top,0),t.paddingRight=Math.max(t.paddingRight-t.margins.right,0),t.paddingBottom=Math.max(t.paddingBottom-t.margins.bottom,0))},afterFit:function(){B.callback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(B.isNullOrUndef(t))return NaN;if("number"==typeof t&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},getLabelForIndex:B.noop,getPixelForValue:B.noop,getValueForPixel:B.noop,getPixelForTick:function(t){var e=this,n=e.options.offset;if(e.isHorizontal()){var i=(e.width-(e.paddingLeft+e.paddingRight))/Math.max(e._ticks.length-(n?0:1),1),a=i*t+e.paddingLeft;n&&(a+=i/2);var r=e.left+Math.round(a);return r+=e.isFullWidth()?e.margins.left:0}var o=e.height-(e.paddingTop+e.paddingBottom);return e.top+t*(o/(e._ticks.length-1))},getPixelForDecimal:function(t){var e=this;if(e.isHorizontal()){var n=(e.width-(e.paddingLeft+e.paddingRight))*t+e.paddingLeft,i=e.left+Math.round(n);return i+=e.isFullWidth()?e.margins.left:0}return e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this.min,e=this.max;return this.beginAtZero?0:t<0&&e<0?e:0<t&&0<e?t:0},_autoSkip:function(t){var e,n,i,a,r=this,o=r.isHorizontal(),s=r.options.ticks.minor,l=t.length,u=B.toRadians(r.labelRotation),d=Math.cos(u),h=r.longestLabelWidth*d,c=[];for(s.maxTicksLimit&&(a=s.maxTicksLimit),o&&(e=!1,(h+s.autoSkipPadding)*l>r.width-(r.paddingLeft+r.paddingRight)&&(e=1+Math.floor((h+s.autoSkipPadding)*l/(r.width-(r.paddingLeft+r.paddingRight)))),a&&a<l&&(e=Math.max(e,Math.floor(l/a)))),n=0;n<l;n++)i=t[n],(1<e&&0<n%e||n%e==0&&l<=n+e)&&n!==l-1&&delete i.label,c.push(i);return c},draw:function(S){var D=this,C=D.options;if(C.display){var o=D.ctx,P=x.global,T=C.ticks.minor,t=C.ticks.major||T,O=C.gridLines,e=C.scaleLabel,I=0!==D.labelRotation,A=D.isHorizontal(),F=T.autoSkip?D._autoSkip(D.getTicks()):D.getTicks(),s=B.valueOrDefault(T.fontColor,P.defaultFontColor),l=w(T),u=B.valueOrDefault(t.fontColor,P.defaultFontColor),d=w(t),R=O.drawTicks?O.tickMarkLength:0,n=B.valueOrDefault(e.fontColor,P.defaultFontColor),i=w(e),a=B.options.toPadding(e.padding),L=B.toRadians(D.labelRotation),Y=[],W=D.options.gridLines.lineWidth,N="right"===C.position?D.left:D.right-W-R,z="right"===C.position?D.left+R:D.right,V="bottom"===C.position?D.top+W:D.bottom-R-W,H="bottom"===C.position?D.top+W+R:D.bottom+W;if(B.each(F,function(t,e){if(!B.isNullOrUndef(t.label)){var n,i,a,r,o,s,l,u,d,h,c,f,g,m,p=t.label;r=e===D.zeroLineIndex&&C.offset===O.offsetGridLines?(n=O.zeroLineWidth,i=O.zeroLineColor,a=O.zeroLineBorderDash,O.zeroLineBorderDashOffset):(n=B.valueAtIndexOrDefault(O.lineWidth,e),i=B.valueAtIndexOrDefault(O.color,e),a=B.valueOrDefault(O.borderDash,P.borderDash),B.valueOrDefault(O.borderDashOffset,P.borderDashOffset));var v="middle",b="middle",y=T.padding;if(A){var x=R+y;m="bottom"===C.position?(b=I?"middle":"top",v=I?"right":"center",D.top+x):(b=I?"middle":"bottom",v=I?"left":"center",D.bottom-x);var _=E(D,e,O.offsetGridLines&&1<F.length);_<D.left&&(i="rgba(0,0,0,0)"),_+=B.aliasPixel(n),g=D.getPixelForTick(e)+T.labelOffset,o=l=d=c=_,s=V,u=H,h=S.top,f=S.bottom+W}else{var k,w="left"===C.position;k=T.mirror?(v=w?"left":"right",y):(v=w?"right":"left",R+y),g=w?D.right-k:D.left+k;var M=E(D,e,O.offsetGridLines&&1<F.length);M<D.top&&(i="rgba(0,0,0,0)"),M+=B.aliasPixel(n),m=D.getPixelForTick(e)+T.labelOffset,o=N,l=z,d=S.left,c=S.right+W,s=u=h=f=M}Y.push({tx1:o,ty1:s,tx2:l,ty2:u,x1:d,y1:h,x2:c,y2:f,labelX:g,labelY:m,glWidth:n,glColor:i,glBorderDash:a,glBorderDashOffset:r,rotation:-1*L,label:p,major:t.major,textBaseline:b,textAlign:v})}}),B.each(Y,function(t){if(O.display&&(o.save(),o.lineWidth=t.glWidth,o.strokeStyle=t.glColor,o.setLineDash&&(o.setLineDash(t.glBorderDash),o.lineDashOffset=t.glBorderDashOffset),o.beginPath(),O.drawTicks&&(o.moveTo(t.tx1,t.ty1),o.lineTo(t.tx2,t.ty2)),O.drawOnChartArea&&(o.moveTo(t.x1,t.y1),o.lineTo(t.x2,t.y2)),o.stroke(),o.restore()),T.display){o.save(),o.translate(t.labelX,t.labelY),o.rotate(t.rotation),o.font=t.major?d.font:l.font,o.fillStyle=t.major?u:s,o.textBaseline=t.textBaseline,o.textAlign=t.textAlign;var e=t.label;if(B.isArray(e))for(var n=e.length,i=1.5*l.size,a=D.isHorizontal()?0:-i*(n-1)/2,r=0;r<n;++r)o.fillText(""+e[r],0,a),a+=i;else o.fillText(e,0,0);o.restore()}}),e.display){var r,h,c=0,f=M(e)/2;if(A)r=D.left+(D.right-D.left)/2,h="bottom"===C.position?D.bottom-f-a.bottom:D.top+f+a.top;else{var g="left"===C.position;r=g?D.left+f+a.top:D.right-f-a.top,h=D.top+(D.bottom-D.top)/2,c=g?-.5*Math.PI:.5*Math.PI}o.save(),o.translate(r,h),o.rotate(c),o.textAlign="center",o.textBaseline="middle",o.fillStyle=n,o.font=i.font,o.fillText(e.labelString,0,0),o.restore()}if(O.drawBorder){o.lineWidth=B.valueAtIndexOrDefault(O.lineWidth,0),o.strokeStyle=B.valueAtIndexOrDefault(O.color,0);var m=D.left,p=D.right+W,v=D.top,b=D.bottom+W,y=B.aliasPixel(o.lineWidth);A?(v=b="top"===C.position?D.bottom:D.top,v+=y,b+=y):(m=p="left"===C.position?D.right:D.left,m+=y,p+=y),o.beginPath(),o.moveTo(m,v),o.lineTo(p,b),o.stroke()}}}})},{26:26,27:27,35:35,46:46}],34:[function(t,e,n){"use strict";var i=t(26),a=t(46),r=t(31);e.exports={constructors:{},defaults:{},registerScaleType:function(t,e,n){this.constructors[t]=e,this.defaults[t]=a.clone(n)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?a.merge({},[i.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){this.defaults.hasOwnProperty(t)&&(this.defaults[t]=a.extend(this.defaults[t],e))},addScalesToLayout:function(e){a.each(e.scales,function(t){t.fullWidth=t.options.fullWidth,t.position=t.options.position,t.weight=t.options.weight,r.addBox(e,t)})}}},{26:26,31:31,46:46}],35:[function(t,e,n){"use strict";var l=t(46);e.exports={formatters:{values:function(t){return l.isArray(t)?t:""+t},linear:function(t,e,n){var i=3<n.length?n[2]-n[1]:n[1]-n[0];1<Math.abs(i)&&t!==Math.floor(t)&&(i=t-Math.floor(t));var a=l.log10(Math.abs(i)),r="";if(0!==t)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=l.log10(Math.abs(t));r=t.toExponential(Math.floor(o)-Math.floor(a))}else{var s=-1*Math.floor(a);s=Math.max(Math.min(s,20),0),r=t.toFixed(s)}else r="0";return r},logarithmic:function(t,e,n){var i=t/Math.pow(10,Math.floor(l.log10(t)));return 0===t?"0":1===i||2===i||5===i||0===e||e===n.length-1?t.toExponential():""}}}},{46:46}],36:[function(t,e,n){"use strict";var i=t(26),a=t(27),R=t(46);i._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:R.noop,title:function(t,e){var n="",i=e.labels,a=i?i.length:0;if(0<t.length){var r=t[0];r.xLabel?n=r.xLabel:0<a&&r.index<a&&(n=i[r.index])}return n},afterTitle:R.noop,beforeBody:R.noop,beforeLabel:R.noop,label:function(t,e){var n=e.datasets[t.datasetIndex].label||"";return n&&(n+=": "),n+=t.yLabel},labelColor:function(t,e){var n=e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return{borderColor:n.borderColor,backgroundColor:n.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:R.noop,afterBody:R.noop,beforeFooter:R.noop,footer:R.noop,afterFooter:R.noop}}});var L={average:function(t){if(!t.length)return!1;var e,n,i=0,a=0,r=0;for(e=0,n=t.length;e<n;++e){var o=t[e];if(o&&o.hasValue()){var s=o.tooltipPosition();i+=s.x,a+=s.y,++r}}return{x:Math.round(i/r),y:Math.round(a/r)}},nearest:function(t,e){var n,i,a,r=e.x,o=e.y,s=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){var l=t[n];if(l&&l.hasValue()){var u=l.getCenterPoint(),d=R.distanceBetweenPoints(e,u);d<s&&(s=d,a=l)}}if(a){var h=a.tooltipPosition();r=h.x,o=h.y}return{x:r,y:o}}};function c(t,e){var n=R.color(t);return n.alpha(e*n.alpha()).rgbaString()}function o(t,e){return e&&(R.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function s(t){return("string"==typeof t||t instanceof String)&&-1<t.indexOf("\n")?t.split("\n"):t}function Y(t){var e=i.global,n=R.valueOrDefault;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,bodyFontColor:t.bodyFontColor,_bodyFontFamily:n(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:n(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:n(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:n(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:n(t.titleFontStyle,e.defaultFontStyle),titleFontSize:n(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:n(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:n(t.footerFontStyle,e.defaultFontStyle),footerFontSize:n(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function r(t){return o([],s(t))}(e.exports=a.extend({initialize:function(){this._model=Y(this._options),this._lastActive=[]},getTitle:function(){var t=this._options.callbacks,e=t.beforeTitle.apply(this,arguments),n=t.title.apply(this,arguments),i=t.afterTitle.apply(this,arguments),a=[];return a=o(a=o(a=o(a,s(e)),s(n)),s(i))},getBeforeBody:function(){return r(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,n){var i=this,a=i._options.callbacks,r=[];return R.each(t,function(t){var e={before:[],lines:[],after:[]};o(e.before,s(a.beforeLabel.call(i,t,n))),o(e.lines,a.label.call(i,t,n)),o(e.after,s(a.afterLabel.call(i,t,n))),r.push(e)}),r},getAfterBody:function(){return r(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this._options.callbacks,e=t.beforeFooter.apply(this,arguments),n=t.footer.apply(this,arguments),i=t.afterFooter.apply(this,arguments),a=[];return a=o(a=o(a=o(a,s(e)),s(n)),s(i))},update:function(t){var e,n,i,a,r,o,s,l,u,d,h,c,f,g,m,p,v,b,y,x,_=this,k=_._options,w=_._model,M=_._model=Y(k),S=_._active,D=_._data,C={xAlign:w.xAlign,yAlign:w.yAlign},P={x:w.x,y:w.y},T={width:w.width,height:w.height},O={x:w.caretX,y:w.caretY};if(S.length){M.opacity=1;var I=[],A=[];O=L[k.position].call(_,S,_._eventPosition);var F=[];for(e=0,n=S.length;e<n;++e)F.push((p=S[e],b=v=void 0,v=p._xScale,b=p._yScale||p._scale,y=p._index,x=p._datasetIndex,{xLabel:v?v.getLabelForIndex(y,x):"",yLabel:b?b.getLabelForIndex(y,x):"",index:y,datasetIndex:x,x:p._model.x,y:p._model.y}));k.filter&&(F=F.filter(function(t){return k.filter(t,D)})),k.itemSort&&(F=F.sort(function(t,e){return k.itemSort(t,e,D)})),R.each(F,function(t){I.push(k.callbacks.labelColor.call(_,t,_._chart)),A.push(k.callbacks.labelTextColor.call(_,t,_._chart))}),M.title=_.getTitle(F,D),M.beforeBody=_.getBeforeBody(F,D),M.body=_.getBody(F,D),M.afterBody=_.getAfterBody(F,D),M.footer=_.getFooter(F,D),M.x=Math.round(O.x),M.y=Math.round(O.y),M.caretPadding=k.caretPadding,M.labelColors=I,M.labelTextColors=A,M.dataPoints=F,C=function(t,e){var n,i,a,r,o,s=t._model,l=t._chart,u=t._chart.chartArea,d="center",h="center";s.y<e.height?h="top":s.y>l.height-e.height&&(h="bottom");var c=(u.left+u.right)/2,f=(u.top+u.bottom)/2;i="center"===h?(n=function(t){return t<=c},function(t){return c<t}):(n=function(t){return t<=e.width/2},function(t){return t>=l.width-e.width/2}),a=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},r=function(t){return t-e.width-s.caretSize-s.caretPadding<0},o=function(t){return t<=f?"top":"bottom"},n(s.x)?(d="left",a(s.x)&&(d="center",h=o(s.y))):i(s.x)&&(d="right",r(s.x)&&(d="center",h=o(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:d,yAlign:g.yAlign?g.yAlign:h}}(this,T=function(t,e){var n=t._chart.ctx,i=2*e.yPadding,a=0,r=e.body,o=r.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);o+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,l=e.footer.length,u=e.titleFontSize,d=e.bodyFontSize,h=e.footerFontSize;i+=s*u,i+=s?(s-1)*e.titleSpacing:0,i+=s?e.titleMarginBottom:0,i+=o*d,i+=o?(o-1)*e.bodySpacing:0,i+=l?e.footerMarginTop:0,i+=l*h,i+=l?(l-1)*e.footerSpacing:0;var c=0,f=function(t){a=Math.max(a,n.measureText(t).width+c)};return n.font=R.fontString(u,e._titleFontStyle,e._titleFontFamily),R.each(e.title,f),n.font=R.fontString(d,e._bodyFontStyle,e._bodyFontFamily),R.each(e.beforeBody.concat(e.afterBody),f),c=e.displayColors?d+2:0,R.each(r,function(t){R.each(t.before,f),R.each(t.lines,f),R.each(t.after,f)}),c=0,n.font=R.fontString(h,e._footerFontStyle,e._footerFontFamily),R.each(e.footer,f),{width:a+=2*e.xPadding,height:i}}(this,M)),i=M,a=T,r=C,o=_._chart,s=i.x,l=i.y,u=i.caretSize,d=i.caretPadding,h=i.cornerRadius,c=r.xAlign,f=r.yAlign,g=u+d,m=h+d,"right"===c?s-=a.width:"center"===c&&((s-=a.width/2)+a.width>o.width&&(s=o.width-a.width),s<0&&(s=0)),"top"===f?l+=g:l-="bottom"===f?a.height+g:a.height/2,"center"===f?"left"===c?s+=g:"right"===c&&(s-=g):"left"===c?s-=m:"right"===c&&(s+=m),P={x:s,y:l}}else M.opacity=0;return M.xAlign=C.xAlign,M.yAlign=C.yAlign,M.x=P.x,M.y=P.y,M.width=T.width,M.height=T.height,M.caretX=O.x,M.caretY=O.y,_._model=M,t&&k.custom&&k.custom.call(_,M),_},drawCaret:function(t,e){var n=this._chart.ctx,i=this._view,a=this.getCaretPosition(t,e,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,n){var i,a,r,o,s,l,u=n.caretSize,d=n.cornerRadius,h=n.xAlign,c=n.yAlign,f=t.x,g=t.y,m=e.width,p=e.height;if("center"===c)s=g+p/2,l="left"===h?(a=(i=f)-u,r=i,o=s+u,s-u):(a=(i=f+m)+u,r=i,o=s-u,s+u);else if(r=(i="left"===h?(a=f+d+u)-u:"right"===h?(a=f+m-d-u)-u:(a=n.caretX)-u,a+u),"top"===c)s=(o=g)-u,l=o;else{s=(o=g+p)+u,l=o;var v=r;r=i,i=v}return{x1:i,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,e,n,i){var a=e.title;if(a.length){n.textAlign=e._titleAlign,n.textBaseline="top";var r,o,s=e.titleFontSize,l=e.titleSpacing;for(n.fillStyle=c(e.titleFontColor,i),n.font=R.fontString(s,e._titleFontStyle,e._titleFontFamily),r=0,o=a.length;r<o;++r)n.fillText(a[r],t.x,t.y),t.y+=s+l,r+1===a.length&&(t.y+=e.titleMarginBottom-l)}},drawBody:function(i,a,r,o){var s=a.bodyFontSize,e=a.bodySpacing,t=a.body;r.textAlign=a._bodyAlign,r.textBaseline="top",r.font=R.fontString(s,a._bodyFontStyle,a._bodyFontFamily);var n=0,l=function(t){r.fillText(t,i.x+n,i.y),i.y+=s+e};r.fillStyle=c(a.bodyFontColor,o),R.each(a.beforeBody,l);var u=a.displayColors;n=u?s+2:0,R.each(t,function(t,e){var n=c(a.labelTextColors[e],o);r.fillStyle=n,R.each(t.before,l),R.each(t.lines,function(t){u&&(r.fillStyle=c(a.legendColorBackground,o),r.fillRect(i.x,i.y,s,s),r.lineWidth=1,r.strokeStyle=c(a.labelColors[e].borderColor,o),r.strokeRect(i.x,i.y,s,s),r.fillStyle=c(a.labelColors[e].backgroundColor,o),r.fillRect(i.x+1,i.y+1,s-2,s-2),r.fillStyle=n),l(t)}),R.each(t.after,l)}),n=0,R.each(a.afterBody,l),i.y-=e},drawFooter:function(e,n,i,t){var a=n.footer;a.length&&(e.y+=n.footerMarginTop,i.textAlign=n._footerAlign,i.textBaseline="top",i.fillStyle=c(n.footerFontColor,t),i.font=R.fontString(n.footerFontSize,n._footerFontStyle,n._footerFontFamily),R.each(a,function(t){i.fillText(t,e.x,e.y),e.y+=n.footerFontSize+n.footerSpacing}))},drawBackground:function(t,e,n,i,a){n.fillStyle=c(e.backgroundColor,a),n.strokeStyle=c(e.borderColor,a),n.lineWidth=e.borderWidth;var r=e.xAlign,o=e.yAlign,s=t.x,l=t.y,u=i.width,d=i.height,h=e.cornerRadius;n.beginPath(),n.moveTo(s+h,l),"top"===o&&this.drawCaret(t,i),n.lineTo(s+u-h,l),n.quadraticCurveTo(s+u,l,s+u,l+h),"center"===o&&"right"===r&&this.drawCaret(t,i),n.lineTo(s+u,l+d-h),n.quadraticCurveTo(s+u,l+d,s+u-h,l+d),"bottom"===o&&this.drawCaret(t,i),n.lineTo(s+h,l+d),n.quadraticCurveTo(s,l+d,s,l+d-h),"center"===o&&"left"===r&&this.drawCaret(t,i),n.lineTo(s,l+h),n.quadraticCurveTo(s,l,s+h,l),n.closePath(),n.fill(),0<e.borderWidth&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},a=Math.abs(e.opacity<.001)?0:e.opacity,r=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&r&&(this.drawBackground(i,e,t,n,a),i.x+=e.xPadding,i.y+=e.yPadding,this.drawTitle(i,e,t,a),this.drawBody(i,e,t,a),this.drawFooter(i,e,t,a))}},handleEvent:function(t){var e,n=this,i=n._options;return n._lastActive=n._lastActive||[],"mouseout"===t.type?n._active=[]:n._active=n._chart.getElementsAtEventForMode(t,i.mode,i),(e=!R.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(i.enabled||i.custom)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0),n.pivot())),e}})).positioners=L},{26:26,27:27,46:46}],37:[function(t,e,n){"use strict";var i=t(26),a=t(27),d=t(46);i._set("global",{elements:{arc:{backgroundColor:i.global.defaultColor,borderColor:"#fff",borderWidth:2}}}),e.exports=a.extend({inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2)},inRange:function(t,e){var n=this._view;if(n){for(var i=d.getAngleFromPoint(n,{x:t,y:e}),a=i.angle,r=i.distance,o=n.startAngle,s=n.endAngle;s<o;)s+=2*Math.PI;for(;s<a;)a-=2*Math.PI;for(;a<o;)a+=2*Math.PI;var l=o<=a&&a<=s,u=r>=n.innerRadius&&r<=n.outerRadius;return l&&u}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t=this._chart.ctx,e=this._view,n=e.startAngle,i=e.endAngle;t.beginPath(),t.arc(e.x,e.y,e.outerRadius,n,i),t.arc(e.x,e.y,e.innerRadius,i,n,!0),t.closePath(),t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.fillStyle=e.backgroundColor,t.fill(),t.lineJoin="bevel",e.borderWidth&&t.stroke()}})},{26:26,27:27,46:46}],38:[function(t,e,n){"use strict";var i=t(26),a=t(27),d=t(46),h=i.global;i._set("global",{elements:{line:{tension:.4,backgroundColor:h.defaultColor,borderWidth:3,borderColor:h.defaultColor,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}}),e.exports=a.extend({draw:function(){var t,e,n,i,a=this._view,r=this._chart.ctx,o=a.spanGaps,s=this._children.slice(),l=h.elements.line,u=-1;for(this._loop&&s.length&&s.push(s[0]),r.save(),r.lineCap=a.borderCapStyle||l.borderCapStyle,r.setLineDash&&r.setLineDash(a.borderDash||l.borderDash),r.lineDashOffset=a.borderDashOffset||l.borderDashOffset,r.lineJoin=a.borderJoinStyle||l.borderJoinStyle,r.lineWidth=a.borderWidth||l.borderWidth,r.strokeStyle=a.borderColor||h.defaultColor,r.beginPath(),u=-1,t=0;t<s.length;++t)e=s[t],n=d.previousItem(s,t),i=e._view,0===t?i.skip||(r.moveTo(i.x,i.y),u=t):(n=-1===u?n:s[u],i.skip||(u!==t-1&&!o||-1===u?r.moveTo(i.x,i.y):d.canvas.lineTo(r,n._view,e._view),u=t));r.stroke(),r.restore()}})},{26:26,27:27,46:46}],39:[function(t,e,n){"use strict";var u=t(26),i=t(27),d=t(46),h=u.global.defaultColor;function a(t){var e=this._view;return!!e&&Math.abs(t-e.x)<e.radius+e.hitRadius}u._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:h,borderColor:h,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}}),e.exports=i.extend({inRange:function(t,e){var n=this._view;return!!n&&Math.pow(t-n.x,2)+Math.pow(e-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:a,inXRange:a,inYRange:function(t){var e=this._view;return!!e&&Math.abs(t-e.y)<e.radius+e.hitRadius},getCenterPoint:function(){var t=this._view;return{x:t.x,y:t.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y,padding:t.radius+t.borderWidth}},draw:function(t){var e=this._view,n=this._model,i=this._chart.ctx,a=e.pointStyle,r=e.rotation,o=e.radius,s=e.x,l=e.y;e.skip||(void 0===t||n.x>=t.left&&1.01*t.right>=n.x&&n.y>=t.top&&1.01*t.bottom>=n.y)&&(i.strokeStyle=e.borderColor||h,i.lineWidth=d.valueOrDefault(e.borderWidth,u.global.elements.point.borderWidth),i.fillStyle=e.backgroundColor||h,d.canvas.drawPoint(i,a,o,s,l,r))}})},{26:26,27:27,46:46}],40:[function(t,e,n){"use strict";var i=t(26),a=t(27);function l(t){return void 0!==t._view.width}function r(t){var e,n,i,a,r=t._view;if(l(t)){var o=r.width/2;e=r.x-o,n=r.x+o,i=Math.min(r.y,r.base),a=Math.max(r.y,r.base)}else{var s=r.height/2;e=Math.min(r.x,r.base),n=Math.max(r.x,r.base),i=r.y-s,a=r.y+s}return{left:e,top:i,right:n,bottom:a}}i._set("global",{elements:{rectangle:{backgroundColor:i.global.defaultColor,borderColor:i.global.defaultColor,borderSkipped:"bottom",borderWidth:0}}}),e.exports=a.extend({draw:function(){var t,e,n,i,a,r,o,s=this._chart.ctx,l=this._view,u=l.borderWidth;if(o=l.horizontal?(t=l.base,e=l.x,n=l.y-l.height/2,i=l.y+l.height/2,a=t<e?1:-1,r=1,l.borderSkipped||"left"):(t=l.x-l.width/2,e=l.x+l.width/2,a=1,r=(n=l.y)<(i=l.base)?1:-1,l.borderSkipped||"bottom"),u){var d=Math.min(Math.abs(t-e),Math.abs(n-i)),h=(u=d<u?d:u)/2,c=t+("left"!==o?h*a:0),f=e+("right"!==o?-h*a:0),g=n+("top"!==o?h*r:0),m=i+("bottom"!==o?-h*r:0);c!==f&&(n=g,i=m),g!==m&&(t=c,e=f)}s.beginPath(),s.fillStyle=l.backgroundColor,s.strokeStyle=l.borderColor,s.lineWidth=u;var p=[[t,i],[t,n],[e,n],[e,i]],v=["bottom","left","top","right"].indexOf(o,0);function b(t){return p[(v+t)%4]}-1===v&&(v=0);var y=b(0);s.moveTo(y[0],y[1]);for(var x=1;x<4;x++)y=b(x),s.lineTo(y[0],y[1]);s.fill(),u&&s.stroke()},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){var n=!1;if(this._view){var i=r(this);n=t>=i.left&&t<=i.right&&e>=i.top&&e<=i.bottom}return n},inLabelRange:function(t,e){if(!this._view)return!1;var n=r(this);return l(this)?t>=n.left&&t<=n.right:e>=n.top&&e<=n.bottom},inXRange:function(t){var e=r(this);return t>=e.left&&t<=e.right},inYRange:function(t){var e=r(this);return t>=e.top&&t<=e.bottom},getCenterPoint:function(){var t,e,n=this._view;return e=l(this)?(t=n.x,(n.y+n.base)/2):(t=(n.x+n.base)/2,n.y),{x:t,y:e}},getArea:function(){var t=this._view;return t.width*Math.abs(t.y-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}})},{26:26,27:27}],41:[function(t,e,n){"use strict";e.exports={},e.exports.Arc=t(37),e.exports.Line=t(38),e.exports.Point=t(39),e.exports.Rectangle=t(40)},{37:37,38:38,39:39,40:40}],42:[function(t,e,n){"use strict";var i=t(43);n=e.exports={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,a,r){if(r){var o=Math.min(r,a/2-1e-7,i/2-1e-7);t.moveTo(e+o,n),t.lineTo(e+i-o,n),t.arcTo(e+i,n,e+i,n+o,o),t.lineTo(e+i,n+a-o),t.arcTo(e+i,n+a,e+i-o,n+a,o),t.lineTo(e+o,n+a),t.arcTo(e,n+a,e,n+a-o,o),t.lineTo(e,n+o),t.arcTo(e,n,e+o,n,o),t.closePath(),t.moveTo(e,n)}else t.rect(e,n,i,a)},drawPoint:function(t,e,n,i,a,r){var o,s,l,u,d,h;if(r=r||0,!e||"object"!=typeof e||"[object HTMLImageElement]"!==(o=e.toString())&&"[object HTMLCanvasElement]"!==o){if(!(isNaN(n)||n<=0)){switch(t.save(),t.translate(i,a),t.rotate(r*Math.PI/180),t.beginPath(),e){default:t.arc(0,0,n,0,2*Math.PI),t.closePath();break;case"triangle":d=(s=3*n/Math.sqrt(3))*Math.sqrt(3)/2,t.moveTo(-s/2,d/3),t.lineTo(s/2,d/3),t.lineTo(0,-2*d/3),t.closePath();break;case"rect":h=1/Math.SQRT2*n,t.rect(-h,-h,2*h,2*h);break;case"rectRounded":var c=n/Math.SQRT2,f=-c,g=-c,m=Math.SQRT2*n;this.roundedRect(t,f,g,m,m,.425*n);break;case"rectRot":h=1/Math.SQRT2*n,t.moveTo(-h,0),t.lineTo(0,h),t.lineTo(h,0),t.lineTo(0,-h),t.closePath();break;case"cross":t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-n,0),t.lineTo(n,0);break;case"crossRot":l=Math.cos(Math.PI/4)*n,u=Math.sin(Math.PI/4)*n,t.moveTo(-l,-u),t.lineTo(l,u),t.moveTo(-l,u),t.lineTo(l,-u);break;case"star":t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-n,0),t.lineTo(n,0),l=Math.cos(Math.PI/4)*n,u=Math.sin(Math.PI/4)*n,t.moveTo(-l,-u),t.lineTo(l,u),t.moveTo(-l,u),t.lineTo(l,-u);break;case"line":t.moveTo(-n,0),t.lineTo(n,0);break;case"dash":t.moveTo(0,0),t.lineTo(n,0)}t.fill(),t.stroke(),t.restore()}}else t.drawImage(e,i-e.width/2,a-e.height/2,e.width,e.height)},clipArea:function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},unclipArea:function(t){t.restore()},lineTo:function(t,e,n,i){if(n.steppedLine)return"after"===n.steppedLine&&!i||"after"!==n.steppedLine&&i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y),void t.lineTo(n.x,n.y);n.tension?t.bezierCurveTo(i?e.controlPointPreviousX:e.controlPointNextX,i?e.controlPointPreviousY:e.controlPointNextY,i?n.controlPointNextX:n.controlPointPreviousX,i?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):t.lineTo(n.x,n.y)}};i.clear=n.clear,i.drawRoundedRectangle=function(t){t.beginPath(),n.roundedRect.apply(n,arguments)}},{43:43}],43:[function(t,e,n){"use strict";var i,d={noop:function(){},uid:(i=0,function(){return i++}),isNullOrUndef:function(t){return null==t},isArray:Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,n){return d.valueOrDefault(d.isArray(t)?t[e]:t,n)},callback:function(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)},each:function(t,e,n,i){var a,r,o;if(d.isArray(t))if(r=t.length,i)for(a=r-1;0<=a;a--)e.call(n,t[a],a);else for(a=0;a<r;a++)e.call(n,t[a],a);else if(d.isObject(t))for(r=(o=Object.keys(t)).length,a=0;a<r;a++)e.call(n,t[o[a]],o[a])},arrayEquals:function(t,e){var n,i,a,r;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(a=t[n],r=e[n],a instanceof Array&&r instanceof Array){if(!d.arrayEquals(a,r))return!1}else if(a!==r)return!1;return!0},clone:function(t){if(d.isArray(t))return t.map(d.clone);if(d.isObject(t)){for(var e={},n=Object.keys(t),i=n.length,a=0;a<i;++a)e[n[a]]=d.clone(t[n[a]]);return e}return t},_merger:function(t,e,n,i){var a=e[t],r=n[t];d.isObject(a)&&d.isObject(r)?d.merge(a,r,i):e[t]=d.clone(r)},_mergerIf:function(t,e,n){var i=e[t],a=n[t];d.isObject(i)&&d.isObject(a)?d.mergeIf(i,a):e.hasOwnProperty(t)||(e[t]=d.clone(a))},merge:function(t,e,n){var i,a,r,o,s,l=d.isArray(e)?e:[e],u=l.length;if(!d.isObject(t))return t;for(i=(n=n||{}).merger||d._merger,a=0;a<u;++a)if(e=l[a],d.isObject(e))for(s=0,o=(r=Object.keys(e)).length;s<o;++s)i(r[s],t,e,n);return t},mergeIf:function(t,e){return d.merge(t,e,{merger:d._mergerIf})},extend:function(n){for(var t=function(t,e){n[e]=t},e=1,i=arguments.length;e<i;++e)d.each(arguments[e],t);return n},inherits:function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=e.prototype,n.prototype=new i,n.extend=d.inherits,t&&d.extend(n.prototype,t),n.__super__=e.prototype,n}};(e.exports=d).callCallback=d.callback,d.indexOf=function(t,e,n){return Array.prototype.indexOf.call(t,e,n)},d.getValueOrDefault=d.valueOrDefault,d.getValueAtIndexOrDefault=d.valueAtIndexOrDefault},{}],44:[function(t,e,n){"use strict";var i=t(43),a={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t-=1)*t*t+1},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t-=1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t-=1)*t*t*t*t+1},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return 1-Math.cos(t*(Math.PI/2))},easeOutSine:function(t){return Math.sin(t*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},easeInExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1===t?1:1-Math.pow(2,-10*t)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},easeInCirc:function(t){return 1<=t?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),e=i<1?(i=1,n/4):n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),e=i<1?(i=1,n/4):n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),e=i<1?(i=1,n/4):n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){return t*t*(2.70158*t-1.70158)},easeOutBack:function(t){return(t-=1)*t*(2.70158*t+1.70158)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-a.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*a.easeInBounce(2*t):.5*a.easeOutBounce(2*t-1)+.5}};e.exports={effects:a},i.easingEffects=a},{43:43}],45:[function(t,e,n){"use strict";var o=t(43);e.exports={toLineHeight:function(t,e){var n=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,n,i,a;return o.isObject(t)?(e=+t.top||0,n=+t.right||0,i=+t.bottom||0,a=+t.left||0):e=n=i=a=+t||0,{top:e,right:n,bottom:i,left:a,height:e+i,width:a+n}},resolve:function(t,e,n){var i,a,r;for(i=0,a=t.length;i<a;++i)if(void 0!==(r=t[i])&&(void 0!==e&&"function"==typeof r&&(r=r(e)),void 0!==n&&o.isArray(r)&&(r=r[n]),void 0!==r))return r}}},{43:43}],46:[function(t,e,n){"use strict";e.exports=t(43),e.exports.easing=t(44),e.exports.canvas=t(42),e.exports.options=t(45)},{42:42,43:43,44:44,45:45}],47:[function(t,e,n){e.exports={acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}}},{}],48:[function(t,e,n){"use strict";var f=t(46),g="$chartjs",m="chartjs-",p=m+"render-monitor",v=m+"render-animation",b=["animationstart","webkitAnimationStart"],s={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function l(t,e){var n=f.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}var i=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function y(t,e,n){t.addEventListener(e,n,i)}function o(t,e,n){t.removeEventListener(e,n,i)}function x(t,e,n,i,a){return{type:t,chart:e,native:a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function a(e,t,n){var i,a,r,o,s,l,u,d,h=e[g]||(e[g]={}),c=h.resizer=function(t){var e=document.createElement("div"),n=m+"size-monitor",i="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;";e.style.cssText=i,e.className=n,e.innerHTML='<div class="'+n+'-expand" style="'+i+'"><div style="position:absolute;width:1000000px;height:1000000px;left:0;top:0"></div></div><div class="'+n+'-shrink" style="'+i+'"><div style="position:absolute;width:200%;height:200%;left:0; top:0"></div></div>';var a=e.childNodes[0],r=e.childNodes[1];e._reset=function(){a.scrollLeft=1e6,a.scrollTop=1e6,r.scrollLeft=1e6,r.scrollTop=1e6};var o=function(){e._reset(),t()};return y(a,"scroll",o.bind(a,"expand")),y(r,"scroll",o.bind(r,"shrink")),e}((r=!(i=function(){if(h.resizer)return t(x("resize",n))}),o=[],function(){o=Array.prototype.slice.call(arguments),a=a||this,r||(r=!0,f.requestAnimFrame.call(window,function(){r=!1,i.apply(a,o)}))}));l=function(){if(h.resizer){var t=e.parentNode;t&&t!==c.parentNode&&t.insertBefore(c,t.firstChild),c._reset()}},u=(s=e)[g]||(s[g]={}),d=u.renderProxy=function(t){t.animationName===v&&l()},f.each(b,function(t){y(s,t,d)}),u.reflow=!!s.offsetParent,s.classList.add(p)}function r(t){var e,n,i,a=t[g]||{},r=a.resizer;delete a.resizer,n=(e=t)[g]||{},(i=n.renderProxy)&&(f.each(b,function(t){o(e,t,i)}),delete n.renderProxy),e.classList.remove(p),r&&r.parentNode&&r.parentNode.removeChild(r)}e.exports={_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,initialize:function(){var t,e,n,i="from{opacity:0.99}to{opacity:1}";e="@-webkit-keyframes "+v+"{"+i+"}@keyframes "+v+"{"+i+"}."+p+"{-webkit-animation:"+v+" 0.001s;animation:"+v+" 0.001s;}",n=(t=this)._style||document.createElement("style"),t._style||(e="/* Chart.js */\n"+e,(t._style=n).setAttribute("type","text/css"),document.getElementsByTagName("head")[0].appendChild(n)),n.appendChild(document.createTextNode(e))},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){var n=t.style,i=t.getAttribute("height"),a=t.getAttribute("width");if(t[g]={initial:{height:i,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===a||""===a){var r=l(t,"width");void 0!==r&&(t.width=r)}if(null===i||""===i)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var o=l(t,"height");void 0!==r&&(t.height=o)}}(t,e),n):null},releaseContext:function(t){var n=t.canvas;if(n[g]){var i=n[g].initial;["height","width"].forEach(function(t){var e=i[t];f.isNullOrUndef(e)?n.removeAttribute(t):n.setAttribute(t,e)}),f.each(i.style||{},function(t,e){n.style[e]=t}),n.width=n.width,delete n[g]}},addEventListener:function(r,t,o){var e=r.canvas;if("resize"!==t){var n=o[g]||(o[g]={});y(e,t,(n.proxies||(n.proxies={}))[r.id+"_"+t]=function(t){var e,n,i,a;o((n=r,i=s[(e=t).type]||e.type,a=f.getRelativePosition(e,n),x(i,n,a.x,a.y,e)))})}else a(e,o,r)},removeEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=((n[g]||{}).proxies||{})[t.id+"_"+e];a&&o(i,e,a)}else r(i)}},f.addEvent=y,f.removeEvent=o},{46:46}],49:[function(t,e,n){"use strict";var i=t(46),a=t(47),r=t(48),o=r._enabled?r:a;e.exports=i.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},o)},{46:46,47:47,48:48}],50:[function(t,e,n){"use strict";e.exports={},e.exports.filler=t(51),e.exports.legend=t(52),e.exports.title=t(53)},{51:51,52:52,53:53}],51:[function(t,e,n){"use strict";var u=t(26),c=t(41),d=t(46);u._set("global",{plugins:{filler:{propagate:!0}}});var f={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),a=i&&n.isDatasetVisible(e)&&i.dataset._children||[],r=a.length||0;return r?function(t,e){return e<r&&a[e]._view||null}:null},boundary:function(t){var e=t.boundary,n=e?e.x:null,i=e?e.y:null;return function(t){return{x:null===n?t.x:n,y:null===i?t.y:i}}}};function g(t,e,n){var i,a=t._model||{},r=a.fill;if(void 0===r&&(r=!!a.backgroundColor),!1===r||null===r)return!1;if(!0===r)return"origin";if(i=parseFloat(r,10),isFinite(i)&&Math.floor(i)===i)return"-"!==r[0]&&"+"!==r[0]||(i=e+i),!(i===e||i<0||n<=i)&&i;switch(r){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return r;default:return!1}}function m(t){var e,n=t.el._model||{},i=t.el._scale||{},a=t.fill,r=null;if(isFinite(a))return null;if("start"===a?r=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===a?r=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?r=n.scaleZero:i.getBasePosition?r=i.getBasePosition():i.getBasePixel&&(r=i.getBasePixel()),null!=r){if(void 0!==r.x&&void 0!==r.y)return r;if("number"==typeof r&&isFinite(r))return{x:(e=i.isHorizontal())?r:null,y:e?null:r}}return null}function p(t,e,n){var i,a=t[e].fill,r=[e];if(!n)return a;for(;!1!==a&&-1===r.indexOf(a);){if(!isFinite(a))return a;if(!(i=t[a]))return!1;if(i.visible)return a;r.push(a),a=i.fill}return!1}function y(t){return t&&!t.skip}function x(t,e,n,i,a){var r;if(i&&a){for(t.moveTo(e[0].x,e[0].y),r=1;r<i;++r)d.canvas.lineTo(t,e[r-1],e[r]);for(t.lineTo(n[a-1].x,n[a-1].y),r=a-1;0<r;--r)d.canvas.lineTo(t,n[r],n[r-1],!0)}}e.exports={id:"filler",afterDatasetsUpdate:function(t,e){var n,i,a,r,o,s,l,u=(t.data.datasets||[]).length,d=e.propagate,h=[];for(i=0;i<u;++i)r=null,(a=(n=t.getDatasetMeta(i)).dataset)&&a._model&&a instanceof c.Line&&(r={visible:t.isDatasetVisible(i),fill:g(a,i,u),chart:t,el:a}),n.$filler=r,h.push(r);for(i=0;i<u;++i)(r=h[i])&&(r.fill=p(h,i,d),r.boundary=m(r),r.mapper=(l=void 0,s=(o=r).fill,!(l="dataset")===s?null:(isFinite(s)||(l="boundary"),f[l](o))))},beforeDatasetDraw:function(t,e){var n=e.meta.$filler;if(n){var i=t.ctx,a=n.el,r=a._view,o=a._children||[],s=n.mapper,l=r.backgroundColor||u.global.defaultColor;s&&l&&o.length&&(d.canvas.clipArea(i,t.chartArea),function(t,e,n,i,a,r){var o,s,l,u,d,h,c,f=e.length,g=i.spanGaps,m=[],p=[],v=0,b=0;for(t.beginPath(),o=0,s=f+!!r;o<s;++o)d=n(u=e[l=o%f]._view,l,i),h=y(u),c=y(d),h&&c?(v=m.push(u),b=p.push(d)):v&&b&&(g?(h&&m.push(u),c&&p.push(d)):(x(t,m,p,v,b),v=b=0,m=[],p=[]));x(t,m,p,v,b),t.closePath(),t.fillStyle=a,t.fill()}(i,o,s,r,l,a._loop),d.canvas.unclipArea(i))}}}},{26:26,41:41,46:46}],52:[function(t,e,n){"use strict";var D=t(26),i=t(27),C=t(46),a=t(31),r=C.noop;function P(t,e){return t.usePointStyle?e*Math.SQRT2:t.boxWidth}D._set("global",{legend:{display:!0,position:"top",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=null===a.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,labels:{boxWidth:40,padding:10,generateLabels:function(n){var t=n.data;return C.isArray(t.datasets)?t.datasets.map(function(t,e){return{text:t.label,fillStyle:C.isArray(t.backgroundColor)?t.backgroundColor[0]:t.backgroundColor,hidden:!n.isDatasetVisible(e),lineCap:t.borderCapStyle,lineDash:t.borderDash,lineDashOffset:t.borderDashOffset,lineJoin:t.borderJoinStyle,lineWidth:t.borderWidth,strokeStyle:t.borderColor,pointStyle:t.pointStyle,datasetIndex:e}},this):[]}}},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');for(var n=0;n<t.data.datasets.length;n++)e.push('<li><span style="background-color:'+t.data.datasets[n].backgroundColor+'"></span>'),t.data.datasets[n].label&&e.push(t.data.datasets[n].label),e.push("</li>");return e.push("</ul>"),e.join("")}});var o=i.extend({initialize:function(t){C.extend(this,t),this.legendHitBoxes=[],this.doughnutMode=!1},beforeUpdate:r,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:r,beforeSetDimensions:r,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:r,beforeBuildLabels:r,buildLabels:function(){var e=this,n=e.options.labels||{},t=C.callback(n.generateLabels,[e.chart],e)||[];n.filter&&(t=t.filter(function(t){return n.filter(t,e.chart.data)})),e.options.reverse&&t.reverse(),e.legendItems=t},afterBuildLabels:r,beforeFit:r,fit:function(){var i=this,t=i.options,a=t.labels,e=t.display,r=i.ctx,n=D.global,o=C.valueOrDefault,s=o(a.fontSize,n.defaultFontSize),l=o(a.fontStyle,n.defaultFontStyle),u=o(a.fontFamily,n.defaultFontFamily),d=C.fontString(s,l,u),h=i.legendHitBoxes=[],c=i.minSize,f=i.isHorizontal();if(c.height=f?(c.width=i.maxWidth,e?10:0):(c.width=e?10:0,i.maxHeight),e)if(r.font=d,f){var g=i.lineWidths=[0],m=i.legendItems.length?s+a.padding:0;r.textAlign="left",r.textBaseline="top",C.each(i.legendItems,function(t,e){var n=P(a,s)+s/2+r.measureText(t.text).width;g[g.length-1]+n+a.padding>=i.width&&(m+=s+a.padding,g[g.length]=i.left),h[e]={left:0,top:0,width:n,height:s},g[g.length-1]+=n+a.padding}),c.height+=m}else{var p=a.padding,v=i.columnWidths=[],b=a.padding,y=0,x=0,_=s+p;C.each(i.legendItems,function(t,e){var n=P(a,s)+s/2+r.measureText(t.text).width;x+_>c.height&&(b+=y+a.padding,v.push(y),x=y=0),y=Math.max(y,n),x+=_,h[e]={left:0,top:0,width:n,height:s}}),b+=y,v.push(y),c.width+=b}i.width=c.width,i.height=c.height},afterFit:r,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var h=this,c=h.options,f=c.labels,g=D.global,m=g.elements.line,p=h.width,v=h.lineWidths;if(c.display){var b,y=h.ctx,x=C.valueOrDefault,t=x(f.fontColor,g.defaultFontColor),_=x(f.fontSize,g.defaultFontSize),e=x(f.fontStyle,g.defaultFontStyle),n=x(f.fontFamily,g.defaultFontFamily),i=C.fontString(_,e,n);y.textAlign="left",y.textBaseline="middle",y.lineWidth=.5,y.strokeStyle=t,y.fillStyle=t,y.font=i;var k=P(f,_),w=h.legendHitBoxes,M=h.isHorizontal();b=M?{x:h.left+(p-v[0])/2,y:h.top+f.padding,line:0}:{x:h.left+f.padding,y:h.top+f.padding,line:0};var S=_+f.padding;C.each(h.legendItems,function(t,e){var n,i,a,r,o,s=y.measureText(t.text).width,l=k+_/2+s,u=b.x,d=b.y;M?p<=u+l&&(d=b.y+=S,b.line++,u=b.x=h.left+(p-v[b.line])/2):d+S>h.bottom&&(u=b.x=u+h.columnWidths[b.line]+f.padding,d=b.y=h.top+f.padding,b.line++),function(t,e,n){if(!(isNaN(k)||k<=0)){y.save(),y.fillStyle=x(n.fillStyle,g.defaultColor),y.lineCap=x(n.lineCap,m.borderCapStyle),y.lineDashOffset=x(n.lineDashOffset,m.borderDashOffset),y.lineJoin=x(n.lineJoin,m.borderJoinStyle),y.lineWidth=x(n.lineWidth,m.borderWidth),y.strokeStyle=x(n.strokeStyle,g.defaultColor);var i=0===x(n.lineWidth,m.borderWidth);if(y.setLineDash&&y.setLineDash(x(n.lineDash,m.borderDash)),c.labels&&c.labels.usePointStyle){var a=_*Math.SQRT2/2,r=a/Math.SQRT2,o=t+r,s=e+r;C.canvas.drawPoint(y,n.pointStyle,a,o,s)}else i||y.strokeRect(t,e,k,_),y.fillRect(t,e,k,_);y.restore()}}(u,d,t),w[e].left=u,w[e].top=d,n=t,i=s,r=k+(a=_/2)+u,o=d+a,y.fillText(n.text,r,o),n.hidden&&(y.beginPath(),y.lineWidth=2,y.moveTo(r,o),y.lineTo(r+i,o),y.stroke()),M?b.x+=l+f.padding:b.y+=S})}},handleEvent:function(t){var e=this,n=e.options,i="mouseup"===t.type?"click":t.type,a=!1;if("mousemove"===i){if(!n.onHover)return}else{if("click"!==i)return;if(!n.onClick)return}var r=t.x,o=t.y;if(r>=e.left&&r<=e.right&&o>=e.top&&o<=e.bottom)for(var s=e.legendHitBoxes,l=0;l<s.length;++l){var u=s[l];if(r>=u.left&&r<=u.left+u.width&&o>=u.top&&o<=u.top+u.height){if("click"===i){n.onClick.call(e,t.native,e.legendItems[l]),a=!0;break}if("mousemove"===i){n.onHover.call(e,t.native,e.legendItems[l]),a=!0;break}}}return a}});function s(t,e){var n=new o({ctx:t.ctx,options:e,chart:t});a.configure(t,n,e),a.addBox(t,n),t.legend=n}e.exports={id:"legend",_element:o,beforeInit:function(t){var e=t.options.legend;e&&s(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(C.mergeIf(e,D.global.legend),n?(a.configure(t,n,e),n.options=e):s(t,e)):n&&(a.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}}},{26:26,27:27,31:31,46:46}],53:[function(t,e,n){"use strict";var _=t(26),i=t(27),k=t(46),a=t(31),r=k.noop;_._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,lineHeight:1.2,padding:10,position:"top",text:"",weight:2e3}});var o=i.extend({initialize:function(t){k.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:r,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:r,beforeSetDimensions:r,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:r,beforeBuildLabels:r,buildLabels:r,afterBuildLabels:r,beforeFit:r,fit:function(){var t=k.valueOrDefault,e=this.options,n=e.display,i=t(e.fontSize,_.global.defaultFontSize),a=this.minSize,r=k.isArray(e.text)?e.text.length:1,o=k.options.toLineHeight(e.lineHeight,i),s=n?r*o+2*e.padding:0;this.isHorizontal()?(a.width=this.maxWidth,a.height=s):(a.width=s,a.height=this.maxHeight),this.width=a.width,this.height=a.height},afterFit:r,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this.ctx,e=k.valueOrDefault,n=this.options,i=_.global;if(n.display){var a,r,o,s=e(n.fontSize,i.defaultFontSize),l=e(n.fontStyle,i.defaultFontStyle),u=e(n.fontFamily,i.defaultFontFamily),d=k.fontString(s,l,u),h=k.options.toLineHeight(n.lineHeight,s),c=h/2+n.padding,f=0,g=this.top,m=this.left,p=this.bottom,v=this.right;t.fillStyle=e(n.fontColor,i.defaultFontColor),t.font=d,this.isHorizontal()?(r=m+(v-m)/2,o=g+c,a=v-m):(r="left"===n.position?m+c:v-c,o=g+(p-g)/2,a=p-g,f=Math.PI*("left"===n.position?-.5:.5)),t.save(),t.translate(r,o),t.rotate(f),t.textAlign="center",t.textBaseline="middle";var b=n.text;if(k.isArray(b))for(var y=0,x=0;x<b.length;++x)t.fillText(b[x],0,y,a),y+=h;else t.fillText(b,0,0,a);t.restore()}}});function s(t,e){var n=new o({ctx:t.ctx,options:e,chart:t});a.configure(t,n,e),a.addBox(t,n),t.titleBlock=n}e.exports={id:"title",_element:o,beforeInit:function(t){var e=t.options.title;e&&s(t,e)},beforeUpdate:function(t){var e=t.options.title,n=t.titleBlock;e?(k.mergeIf(e,_.global.title),n?(a.configure(t,n,e),n.options=e):s(t,e)):n&&(a.removeBox(t,n),delete t.titleBlock)}}},{26:26,27:27,31:31,46:46}],54:[function(t,e,n){"use strict";var i=t(33),a=t(34);e.exports=function(){var t=i.extend({getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels},determineDataLimits:function(){var t,e=this,n=e.getLabels();e.minIndex=0,e.maxIndex=n.length-1,void 0!==e.options.ticks.min&&(t=n.indexOf(e.options.ticks.min),e.minIndex=-1!==t?t:e.minIndex),void 0!==e.options.ticks.max&&(t=n.indexOf(e.options.ticks.max),e.maxIndex=-1!==t?t:e.maxIndex),e.min=n[e.minIndex],e.max=n[e.maxIndex]},buildTicks:function(){var t=this.getLabels();this.ticks=0===this.minIndex&&this.maxIndex===t.length-1?t:t.slice(this.minIndex,this.maxIndex+1)},getLabelForIndex:function(t,e){var n=this.chart.data,i=this.isHorizontal();return n.yLabels&&!i?this.getRightValue(n.datasets[e].data[t]):this.ticks[t-this.minIndex]},getPixelForValue:function(t,e){var n,i=this,a=i.options.offset,r=Math.max(i.maxIndex+1-i.minIndex-(a?0:1),1);if(null!=t&&(n=i.isHorizontal()?t.x:t.y),void 0!==n||void 0!==t&&isNaN(e)){t=n||t;var o=i.getLabels().indexOf(t);e=-1!==o?o:e}if(i.isHorizontal()){var s=i.width/r,l=s*(e-i.minIndex);return a&&(l+=s/2),i.left+Math.round(l)}var u=i.height/r,d=u*(e-i.minIndex);return a&&(d+=u/2),i.top+Math.round(d)},getPixelForTick:function(t){return this.getPixelForValue(this.ticks[t],t+this.minIndex,null)},getValueForPixel:function(t){var e=this.options.offset,n=Math.max(this._ticks.length-(e?0:1),1),i=this.isHorizontal(),a=(i?this.width:this.height)/n;return t-=i?this.left:this.top,e&&(t-=a/2),(t<=0?0:Math.round(t/a))+this.minIndex},getBasePixel:function(){return this.bottom}});a.registerScaleType("category",t,{position:"bottom"})}},{33:33,34:34}],55:[function(t,e,n){"use strict";var i=t(26),h=t(46),a=t(34),r=t(35);e.exports=function(t){var e={position:"left",ticks:{callback:r.formatters.linear}},n=t.LinearScaleBase.extend({determineDataLimits:function(){var o=this,s=o.options,l=o.chart,t=l.data.datasets,e=o.isHorizontal();function u(t){return e?t.xAxisID===o.id:t.yAxisID===o.id}o.min=null,o.max=null;var i=s.stacked;if(void 0===i&&h.each(t,function(t,e){if(!i){var n=l.getDatasetMeta(e);l.isDatasetVisible(e)&&u(n)&&void 0!==n.stack&&(i=!0)}}),s.stacked||i){var d={};h.each(t,function(t,e){var i=l.getDatasetMeta(e),n=[i.type,void 0===s.stacked&&void 0===i.stack?e:"",i.stack].join(".");void 0===d[n]&&(d[n]={positiveValues:[],negativeValues:[]});var a=d[n].positiveValues,r=d[n].negativeValues;l.isDatasetVisible(e)&&u(i)&&h.each(t.data,function(t,e){var n=+o.getRightValue(t);isNaN(n)||i.data[e].hidden||(a[e]=a[e]||0,r[e]=r[e]||0,s.relativePoints?a[e]=100:n<0?r[e]+=n:a[e]+=n)})}),h.each(d,function(t){var e=t.positiveValues.concat(t.negativeValues),n=h.min(e),i=h.max(e);o.min=null===o.min?n:Math.min(o.min,n),o.max=null===o.max?i:Math.max(o.max,i)})}else h.each(t,function(t,e){var i=l.getDatasetMeta(e);l.isDatasetVisible(e)&&u(i)&&h.each(t.data,function(t,e){var n=+o.getRightValue(t);isNaN(n)||i.data[e].hidden||(null===o.min?o.min=n:n<o.min&&(o.min=n),null===o.max?o.max=n:n>o.max&&(o.max=n))})});o.min=isFinite(o.min)&&!isNaN(o.min)?o.min:0,o.max=isFinite(o.max)&&!isNaN(o.max)?o.max:1,this.handleTickRangeOptions()},getTickLimit:function(){var t,e=this.options.ticks;if(this.isHorizontal())t=Math.min(e.maxTicksLimit?e.maxTicksLimit:11,Math.ceil(this.width/50));else{var n=h.valueOrDefault(e.fontSize,i.global.defaultFontSize);t=Math.min(e.maxTicksLimit?e.maxTicksLimit:11,Math.ceil(this.height/(2*n)))}return t},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e=this.start,n=+this.getRightValue(t),i=this.end-e;return this.isHorizontal()?this.left+this.width/i*(n-e):this.bottom-this.height/i*(n-e)},getValueForPixel:function(t){var e=this.isHorizontal(),n=e?this.width:this.height,i=(e?t-this.left:this.bottom-t)/n;return this.start+(this.end-this.start)*i},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}});a.registerScaleType("linear",n,e)}},{26:26,34:34,35:35,46:46}],56:[function(t,e,n){"use strict";var h=t(46),i=t(33);e.exports=function(t){var e=h.noop;t.LinearScaleBase=i.extend({getRightValue:function(t){return"string"==typeof t?+t:i.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=h.sign(t.min),i=h.sign(t.max);n<0&&i<0?t.max=0:0<n&&0<i&&(t.min=0)}var a=void 0!==e.min||void 0!==e.suggestedMin,r=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),a!==r&&t.min>=t.max&&(a?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:e,handleDirectionalChanges:e,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,precision:e.precision,stepSize:h.valueOrDefault(e.fixedStepSize,e.stepSize)},a=t.ticks=function(t,e){var n,i,a,r=[];if(t.stepSize&&0<t.stepSize)a=t.stepSize;else{var o=h.niceNum(e.max-e.min,!1);a=h.niceNum(o/(t.maxTicks-1),!0),void 0!==(i=t.precision)&&(n=Math.pow(10,i),a=Math.ceil(a*n)/n)}var s=Math.floor(e.min/a)*a,l=Math.ceil(e.max/a)*a;h.isNullOrUndef(t.min)||h.isNullOrUndef(t.max)||!t.stepSize||h.almostWhole((t.max-t.min)/t.stepSize,a/1e3)&&(s=t.min,l=t.max);var u=(l-s)/a;u=h.almostEquals(u,Math.round(u),a/1e3)?Math.round(u):Math.ceil(u),a<(i=1)&&(i=Math.pow(10,1-Math.floor(h.log10(a))),s=Math.round(s*i)/i,l=Math.round(l*i)/i),r.push(void 0!==t.min?t.min:s);for(var d=1;d<u;++d)r.push(Math.round((s+d*a)*i)/i);return r.push(void 0!==t.max?t.max:l),r}(i,t);t.handleDirectionalChanges(),t.max=h.max(a),t.min=h.min(a),e.reverse?(a.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){this.ticksAsNumbers=this.ticks.slice(),this.zeroLineIndex=this.ticks.indexOf(0),i.prototype.convertTicksToLabels.call(this)}})}},{33:33,46:46}],57:[function(t,e,n){"use strict";var c=t(46),i=t(33),a=t(34),r=t(35);e.exports=function(h){var t={position:"left",ticks:{callback:r.formatters.logarithmic}},e=i.extend({determineDataLimits:function(){var o=this,n=o.options,s=o.chart,t=s.data.datasets,e=o.isHorizontal();function l(t){return e?t.xAxisID===o.id:t.yAxisID===o.id}o.min=null,o.max=null,o.minNotZero=null;var i=n.stacked;if(void 0===i&&c.each(t,function(t,e){if(!i){var n=s.getDatasetMeta(e);s.isDatasetVisible(e)&&l(n)&&void 0!==n.stack&&(i=!0)}}),n.stacked||i){var u={};c.each(t,function(t,e){var a=s.getDatasetMeta(e),r=[a.type,void 0===n.stacked&&void 0===a.stack?e:"",a.stack].join(".");s.isDatasetVisible(e)&&l(a)&&(void 0===u[r]&&(u[r]=[]),c.each(t.data,function(t,e){var n=u[r],i=+o.getRightValue(t);isNaN(i)||a.data[e].hidden||i<0||(n[e]=n[e]||0,n[e]+=i)}))}),c.each(u,function(t){if(0<t.length){var e=c.min(t),n=c.max(t);o.min=null===o.min?e:Math.min(o.min,e),o.max=null===o.max?n:Math.max(o.max,n)}})}else c.each(t,function(t,e){var i=s.getDatasetMeta(e);s.isDatasetVisible(e)&&l(i)&&c.each(t.data,function(t,e){var n=+o.getRightValue(t);isNaN(n)||i.data[e].hidden||n<0||(null===o.min?o.min=n:n<o.min&&(o.min=n),null===o.max?o.max=n:n>o.max&&(o.max=n),0!==n&&(null===o.minNotZero||n<o.minNotZero)&&(o.minNotZero=n))})});this.handleTickRangeOptions()},handleTickRangeOptions:function(){var t=this,e=t.options.ticks,n=c.valueOrDefault;t.min=n(e.min,t.min),t.max=n(e.max,t.max),t.min===t.max&&(0!==t.min&&null!==t.min?(t.min=Math.pow(10,Math.floor(c.log10(t.min))-1),t.max=Math.pow(10,Math.floor(c.log10(t.max))+1)):(t.min=1,t.max=10)),null===t.min&&(t.min=Math.pow(10,Math.floor(c.log10(t.max))-1)),null===t.max&&(t.max=0!==t.min?Math.pow(10,Math.floor(c.log10(t.min))+1):10),null===t.minNotZero&&(0<t.min?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(c.log10(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),i={min:e.min,max:e.max},a=t.ticks=function(t,e){var n,i,a=[],r=c.valueOrDefault,o=r(t.min,Math.pow(10,Math.floor(c.log10(e.min)))),s=Math.floor(c.log10(e.max)),l=Math.ceil(e.max/Math.pow(10,s));0===o?(n=Math.floor(c.log10(e.minNotZero)),i=Math.floor(e.minNotZero/Math.pow(10,n)),a.push(o),o=i*Math.pow(10,n)):(n=Math.floor(c.log10(o)),i=Math.floor(o/Math.pow(10,n)));for(var u=n<0?Math.pow(10,Math.abs(n)):1;a.push(o),10==++i&&(i=1,u=0<=++n?1:u),o=Math.round(i*Math.pow(10,n)*u)/u,n<s||n===s&&i<l;);var d=r(t.max,o);return a.push(d),a}(i,t);t.max=c.max(a),t.min=c.min(a),e.reverse?(n=!n,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n&&a.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),i.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){return this.getPixelForValue(this.tickValues[t])},_getFirstTickValue:function(t){var e=Math.floor(c.log10(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},getPixelForValue:function(t){var e,n,i,a,r,o=this,s=o.options.ticks.reverse,l=c.log10,u=o._getFirstTickValue(o.minNotZero),d=0;return t=+o.getRightValue(t),r=s?(i=o.end,a=o.start,-1):(i=o.start,a=o.end,1),n=o.isHorizontal()?(e=o.width,s?o.right:o.left):(e=o.height,r*=-1,s?o.top:o.bottom),t!==i&&(0===i&&(e-=d=c.getValueOrDefault(o.options.ticks.fontSize,h.defaults.global.defaultFontSize),i=u),0!==t&&(d+=e/(l(a)-l(i))*(l(t)-l(i))),n+=r*d),n},getValueForPixel:function(t){var e,n,i,a,r=this,o=r.options.ticks.reverse,s=c.log10,l=r._getFirstTickValue(r.minNotZero);if(i=o?(n=r.end,r.start):(n=r.start,r.end),(a=r.isHorizontal()?(e=r.width,o?r.right-t:t-r.left):(e=r.height,o?t-r.top:r.bottom-t))!==n){if(0===n){var u=c.getValueOrDefault(r.options.ticks.fontSize,h.defaults.global.defaultFontSize);a-=u,e-=u,n=l}a*=s(i)-s(n),a/=e,a=Math.pow(10,s(n)+a)}return a}});a.registerScaleType("logarithmic",e,t)}},{33:33,34:34,35:35,46:46}],58:[function(t,e,n){"use strict";var i=t(26),_=t(46),a=t(34),r=t(35);e.exports=function(t){var v=i.global,e={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:r.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function b(t){var e=t.options;return e.angleLines.display||e.pointLabels.display?t.chart.data.labels.length:0}function y(t){var e=t.options.pointLabels,n=_.valueOrDefault(e.fontSize,v.defaultFontSize),i=_.valueOrDefault(e.fontStyle,v.defaultFontStyle),a=_.valueOrDefault(e.fontFamily,v.defaultFontFamily);return{size:n,style:i,family:a,font:_.fontString(n,i,a)}}function p(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:t<i||a<t?{start:e-n-5,end:e}:{start:e,end:e+n+5}}function x(t,e,n,i){if(_.isArray(e))for(var a=n.y,r=1.5*i,o=0;o<e.length;++o)t.fillText(e[o],n.x,a),a+=r;else t.fillText(e,n.x,n.y)}function s(t){return _.isNumber(t)?t:0}var n=t.LinearScaleBase.extend({setDimensions:function(){var t=this,e=t.options,n=e.ticks;t.width=t.maxWidth,t.height=t.maxHeight,t.xCenter=Math.round(t.width/2),t.yCenter=Math.round(t.height/2);var i=_.min([t.height,t.width]),a=_.valueOrDefault(n.fontSize,v.defaultFontSize);t.drawingArea=e.display?i/2-(a/2+n.backdropPaddingY):i/2},determineDataLimits:function(){var a=this,n=a.chart,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;_.each(n.data.datasets,function(t,e){if(n.isDatasetVisible(e)){var i=n.getDatasetMeta(e);_.each(t.data,function(t,e){var n=+a.getRightValue(t);isNaN(n)||i.data[e].hidden||(r=Math.min(n,r),o=Math.max(n,o))})}}),a.min=r===Number.POSITIVE_INFINITY?0:r,a.max=o===Number.NEGATIVE_INFINITY?0:o,a.handleTickRangeOptions()},getTickLimit:function(){var t=this.options.ticks,e=_.valueOrDefault(t.fontSize,v.defaultFontSize);return Math.min(t.maxTicksLimit?t.maxTicksLimit:11,Math.ceil(this.drawingArea/(1.5*e)))},convertTicksToLabels:function(){t.LinearScaleBase.prototype.convertTicksToLabels.call(this),this.pointLabels=this.chart.data.labels.map(this.options.pointLabels.callback,this)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t,e;this.options.pointLabels.display?function(t){var e,n,i,a=y(t),r=Math.min(t.height/2,t.width/2),o={r:t.width,l:0,t:t.height,b:0},s={};t.ctx.font=a.font,t._pointLabelSizes=[];var l,u,d,h=b(t);for(e=0;e<h;e++){i=t.getPointPosition(e,r),l=t.ctx,u=a.size,d=t.pointLabels[e]||"",n=_.isArray(d)?{w:_.longestText(l,l.font,d),h:d.length*u+1.5*(d.length-1)*u}:{w:l.measureText(d).width,h:u},t._pointLabelSizes[e]=n;var c=t.getIndexAngle(e),f=_.toDegrees(c)%360,g=p(f,i.x,n.w,0,180),m=p(f,i.y,n.h,90,270);g.start<o.l&&(o.l=g.start,s.l=c),g.end>o.r&&(o.r=g.end,s.r=c),m.start<o.t&&(o.t=m.start,s.t=c),m.end>o.b&&(o.b=m.end,s.b=c)}t.setReductions(r,o,s)}(this):(t=this,e=Math.min(t.height/2,t.width/2),t.drawingArea=Math.round(e),t.setCenterPoint(0,0,0,0))},setReductions:function(t,e,n){var i=e.l/Math.sin(n.l),a=Math.max(e.r-this.width,0)/Math.sin(n.r),r=-e.t/Math.cos(n.t),o=-Math.max(e.b-this.height,0)/Math.cos(n.b);i=s(i),a=s(a),r=s(r),o=s(o),this.drawingArea=Math.min(Math.round(t-(i+a)/2),Math.round(t-(r+o)/2)),this.setCenterPoint(i,a,r,o)},setCenterPoint:function(t,e,n,i){var a=this,r=a.width-e-a.drawingArea,o=t+a.drawingArea,s=n+a.drawingArea,l=a.height-i-a.drawingArea;a.xCenter=Math.round((o+r)/2+a.left),a.yCenter=Math.round((s+l)/2+a.top)},getIndexAngle:function(t){return t*(2*Math.PI/b(this))+(this.chart.options&&this.chart.options.startAngle?this.chart.options.startAngle:0)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){if(null===t)return 0;var e=this.drawingArea/(this.max-this.min);return this.options.ticks.reverse?(this.max-t)*e:(t-this.min)*e},getPointPosition:function(t,e){var n=this.getIndexAngle(t)-Math.PI/2;return{x:Math.round(Math.cos(n)*e)+this.xCenter,y:Math.round(Math.sin(n)*e)+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(){var t=this.min,e=this.max;return this.getPointPositionForValue(0,this.beginAtZero?0:t<0&&e<0?e:0<t&&0<e?t:0)},draw:function(){var r=this,t=r.options,o=t.gridLines,s=t.ticks,l=_.valueOrDefault;if(t.display){var u=r.ctx,d=this.getIndexAngle(0),h=l(s.fontSize,v.defaultFontSize),e=l(s.fontStyle,v.defaultFontStyle),n=l(s.fontFamily,v.defaultFontFamily),c=_.fontString(h,e,n);_.each(r.ticks,function(t,e){if(0<e||s.reverse){var n=r.getDistanceFromCenterForValue(r.ticksAsNumbers[e]);if(o.display&&0!==e&&function(t,e,n,i){var a=t.ctx;if(a.strokeStyle=_.valueAtIndexOrDefault(e.color,i-1),a.lineWidth=_.valueAtIndexOrDefault(e.lineWidth,i-1),t.options.gridLines.circular)a.beginPath(),a.arc(t.xCenter,t.yCenter,n,0,2*Math.PI),a.closePath(),a.stroke();else{var r=b(t);if(0===r)return;a.beginPath();var o=t.getPointPosition(0,n);a.moveTo(o.x,o.y);for(var s=1;s<r;s++)o=t.getPointPosition(s,n),a.lineTo(o.x,o.y);a.closePath(),a.stroke()}}(r,o,n,e),s.display){var i=l(s.fontColor,v.defaultFontColor);if(u.font=c,u.save(),u.translate(r.xCenter,r.yCenter),u.rotate(d),s.showLabelBackdrop){var a=u.measureText(t).width;u.fillStyle=s.backdropColor,u.fillRect(-a/2-s.backdropPaddingX,-n-h/2-s.backdropPaddingY,a+2*s.backdropPaddingX,h+2*s.backdropPaddingY)}u.textAlign="center",u.textBaseline="middle",u.fillStyle=i,u.fillText(t,0,-n),u.restore()}}}),(t.angleLines.display||t.pointLabels.display)&&function(t){var e=t.ctx,n=t.options,i=n.angleLines,a=n.pointLabels;e.lineWidth=i.lineWidth,e.strokeStyle=i.color;var r,o,s,l,u=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),d=y(t);e.textBaseline="top";for(var h=b(t)-1;0<=h;h--){if(i.display){var c=t.getPointPosition(h,u);e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(c.x,c.y),e.stroke(),e.closePath()}if(a.display){var f=t.getPointPosition(h,u+5),g=_.valueAtIndexOrDefault(a.fontColor,h,v.defaultFontColor);e.font=d.font,e.fillStyle=g;var m=t.getIndexAngle(h),p=_.toDegrees(m);e.textAlign=0===(l=p)||180===l?"center":l<180?"left":"right",r=p,o=t._pointLabelSizes[h],s=f,90===r||270===r?s.y-=o.h/2:(270<r||r<90)&&(s.y-=o.h),x(e,t.pointLabels[h]||"",f,d.size)}}}(r)}}});a.registerScaleType("radialLinear",n,e)}},{26:26,34:34,35:35,46:46}],59:[function(t,e,n){"use strict";var y=t(6);y="function"==typeof y?y:window.moment;var o=t(26),p=t(46),i=t(33),a=t(34),m=Number.MIN_SAFE_INTEGER||-9007199254740991,v=Number.MAX_SAFE_INTEGER||9007199254740991,x={millisecond:{common:!0,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{common:!0,size:1e3,steps:[1,2,5,10,15,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,15,30]},hour:{common:!0,size:36e5,steps:[1,2,3,6,12]},day:{common:!0,size:864e5,steps:[1,2,5]},week:{common:!1,size:6048e5,steps:[1,2,3,4]},month:{common:!0,size:2628e6,steps:[1,2,3]},quarter:{common:!1,size:7884e6,steps:[1,2,3,4]},year:{common:!0,size:3154e7}},_=Object.keys(x);function b(t,e){return t-e}function k(t){var e,n,i,a={},r=[];for(e=0,n=t.length;e<n;++e)a[i=t[e]]||(a[i]=!0,r.push(i));return r}function w(t,e,n,i){var a=function(t,e,n){for(var i,a,r,o=0,s=t.length-1;0<=o&&o<=s;){if(a=t[(i=o+s>>1)-1]||null,r=t[i],!a)return{lo:null,hi:r};if(r[e]<n)o=i+1;else{if(!(a[e]>n))return{lo:a,hi:r};s=i-1}}return{lo:r,hi:null}}(t,e,n),r=a.lo?a.hi?a.lo:t[t.length-2]:t[0],o=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=o[e]-r[e],l=s?(n-r[e])/s:0,u=(o[i]-r[i])*l;return r[i]+u}function M(t,e){var n=e.parser,i=e.parser||e.format;return"function"==typeof n?n(t):"string"==typeof t&&"string"==typeof i?y(t,i):(t instanceof y||(t=y(t)),t.isValid()?t:"function"==typeof i?i(t):t)}function S(t,e){if(p.isNullOrUndef(t))return null;var n=e.options.time,i=M(e.getRightValue(t),n);return i.isValid()?(n.round&&i.startOf(n.round),i.valueOf()):null}function D(t){for(var e=_.indexOf(t)+1,n=_.length;e<n;++e)if(x[_[e]].common)return _[e]}function C(t,e,n,i){var a,r=i.time,o=r.unit||function(t,e,n,i){var a,r,o,s=_.length;for(a=_.indexOf(t);a<s-1;++a)if(o=(r=x[_[a]]).steps?r.steps[r.steps.length-1]:v,r.common&&Math.ceil((n-e)/(o*r.size))<=i)return _[a];return _[s-1]}(r.minUnit,t,e,n),s=D(o),l=p.valueOrDefault(r.stepSize,r.unitStepSize),u="week"===o&&r.isoWeekday,d=i.ticks.major.enabled,h=x[o],c=y(t),f=y(e),g=[];for(l||(l=function(t,e,n,i){var a,r,o,s=e-t,l=x[n],u=l.size,d=l.steps;if(!d)return Math.ceil(s/(i*u));for(a=0,r=d.length;a<r&&(o=d[a],!(Math.ceil(s/(u*o))<=i));++a);return o}(t,e,o,n)),u&&(c=c.isoWeekday(u),f=f.isoWeekday(u)),c=c.startOf(u?"day":o),(f=f.startOf(u?"day":o))<e&&f.add(1,o),a=y(c),d&&s&&!u&&!r.round&&(a.startOf(s),a.add(~~((c-a)/(h.size*l))*l,o));a<f;a.add(l,o))g.push(+a);return g.push(+a),g}e.exports=function(){var t=i.extend({initialize:function(){if(!y)throw new Error("Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at https://momentjs.com");this.mergeTicksOptions(),i.prototype.initialize.call(this)},update:function(){var t=this.options;return t.time&&t.time.format&&console.warn("options.time.format is deprecated and replaced by options.time.parser."),i.prototype.update.apply(this,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),i.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,n,i,a,r,o=this,s=o.chart,l=o.options.time,u=l.unit||"day",d=v,h=m,c=[],f=[],g=[];for(t=0,n=s.data.labels.length;t<n;++t)g.push(S(s.data.labels[t],o));for(t=0,n=(s.data.datasets||[]).length;t<n;++t)if(s.isDatasetVisible(t))if(a=s.data.datasets[t].data,p.isObject(a[0]))for(f[t]=[],e=0,i=a.length;e<i;++e)r=S(a[e],o),c.push(r),f[t][e]=r;else c.push.apply(c,g),f[t]=g.slice(0);else f[t]=[];g.length&&(g=k(g).sort(b),d=Math.min(d,g[0]),h=Math.max(h,g[g.length-1])),c.length&&(c=k(c).sort(b),d=Math.min(d,c[0]),h=Math.max(h,c[c.length-1])),d=S(l.min,o)||d,h=S(l.max,o)||h,d=d===v?+y().startOf(u):d,h=h===m?+y().endOf(u)+1:h,o.min=Math.min(d,h),o.max=Math.max(d+1,h),o._horizontal=o.isHorizontal(),o._table=[],o._timestamps={data:c,datasets:f,labels:g}},buildTicks:function(){var t,e,n,i,a,r,o,s,l,u,d,h,c=this,f=c.min,g=c.max,m=c.options,p=m.time,v=[],b=[];switch(m.ticks.source){case"data":v=c._timestamps.data;break;case"labels":v=c._timestamps.labels;break;case"auto":default:v=C(f,g,c.getLabelCapacity(f),m)}for("ticks"===m.bounds&&v.length&&(f=v[0],g=v[v.length-1]),f=S(p.min,c)||f,g=S(p.max,c)||g,t=0,e=v.length;t<e;++t)f<=(n=v[t])&&n<=g&&b.push(n);return c.min=f,c.max=g,c._unit=p.unit||function(t,e,n,i){var a,r,o=y.duration(y(i).diff(y(n)));for(a=_.length-1;a>=_.indexOf(e);a--)if(r=_[a],x[r].common&&o.as(r)>=t.length)return r;return _[e?_.indexOf(e):0]}(b,p.minUnit,c.min,c.max),c._majorUnit=D(c._unit),c._table=function(t,e,n,i){if("linear"===i||!t.length)return[{time:e,pos:0},{time:n,pos:1}];var a,r,o,s,l,u=[],d=[e];for(a=0,r=t.length;a<r;++a)e<(s=t[a])&&s<n&&d.push(s);for(d.push(n),a=0,r=d.length;a<r;++a)l=d[a+1],o=d[a-1],s=d[a],void 0!==o&&void 0!==l&&Math.round((l+o)/2)===s||u.push({time:s,pos:a/(r-1)});return u}(c._timestamps.data,f,g,m.distribution),c._offsets=(i=c._table,a=b,r=f,o=g,h=d=0,(s=m).offset&&a.length&&(s.time.min||(l=1<a.length?a[1]:o,u=a[0],d=(w(i,"time",l,"pos")-w(i,"time",u,"pos"))/2),s.time.max||(l=a[a.length-1],u=1<a.length?a[a.length-2]:r,h=(w(i,"time",l,"pos")-w(i,"time",u,"pos"))/2)),{left:d,right:h}),c._labelFormat=function(t,e){var n,i,a,r=t.length;for(n=0;n<r;n++){if(0!==(i=M(t[n],e)).millisecond())return"MMM D, YYYY h:mm:ss.SSS a";0===i.second()&&0===i.minute()&&0===i.hour()||(a=!0)}return a?"MMM D, YYYY h:mm:ss a":"MMM D, YYYY"}(c._timestamps.data,p),function(t,e){var n,i,a,r,o=[];for(n=0,i=t.length;n<i;++n)a=t[n],r=!!e&&a===+y(a).startOf(e),o.push({value:a,major:r});return o}(b,c._majorUnit)},getLabelForIndex:function(t,e){var n=this.chart.data,i=this.options.time,a=n.labels&&t<n.labels.length?n.labels[t]:"",r=n.datasets[e].data[t];return p.isObject(r)&&(a=this.getRightValue(r)),i.tooltipFormat?M(a,i).format(i.tooltipFormat):"string"==typeof a?a:M(a,i).format(this._labelFormat)},tickFormatFunction:function(t,e,n,i){var a=this.options,r=t.valueOf(),o=a.time.displayFormats,s=o[this._unit],l=this._majorUnit,u=o[l],d=t.clone().startOf(l).valueOf(),h=a.ticks.major,c=h.enabled&&l&&u&&r===d,f=t.format(i||(c?u:s)),g=c?h:a.ticks.minor,m=p.valueOrDefault(g.callback,g.userCallback);return m?m(f,e,n):f},convertTicksToLabels:function(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(this.tickFormatFunction(y(t[e].value),e,t));return i},getPixelForOffset:function(t){var e=this,n=e._horizontal?e.width:e.height,i=e._horizontal?e.left:e.top,a=w(e._table,"time",t,"pos");return i+n*(e._offsets.left+a)/(e._offsets.left+1+e._offsets.right)},getPixelForValue:function(t,e,n){var i=null;if(void 0!==e&&void 0!==n&&(i=this._timestamps.datasets[n][e]),null===i&&(i=S(t,this)),null!==i)return this.getPixelForOffset(i)},getPixelForTick:function(t){var e=this.getTicks();return 0<=t&&t<e.length?this.getPixelForOffset(e[t].value):null},getValueForPixel:function(t){var e=this,n=e._horizontal?e.width:e.height,i=e._horizontal?e.left:e.top,a=(n?(t-i)/n:0)*(e._offsets.left+1+e._offsets.left)-e._offsets.right,r=w(e._table,"pos",a,"time");return y(r)},getLabelWidth:function(t){var e=this.options.ticks,n=this.ctx.measureText(t).width,i=p.toRadians(e.maxRotation),a=Math.cos(i),r=Math.sin(i);return n*a+p.valueOrDefault(e.fontSize,o.global.defaultFontSize)*r},getLabelCapacity:function(t){var e=this.options.time.displayFormats.millisecond,n=this.tickFormatFunction(y(t),0,[],e),i=this.getLabelWidth(n),a=this.isHorizontal()?this.width:this.height,r=Math.floor(a/i);return 0<r?r:1}});a.registerScaleType("time",t,{position:"bottom",distribution:"linear",bounds:"data",time:{parser:!1,format:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}})}},{26:26,33:33,34:34,46:46,6:6}]},{},[7])(7)});
assets/js/gutenberg_blocks.js CHANGED
@@ -48,7 +48,7 @@ registerBlockType( 'tutor-gutenberg/student-dashboard', {
48
  url : ajaxurl,
49
  type : 'POST',
50
  async: false,
51
- data : {shortcode: 'tutor_student_dashboard', action : 'render_block_tutor'},
52
  success: function (response) {
53
  dataHtml = response.data;
54
  },
48
  url : ajaxurl,
49
  type : 'POST',
50
  async: false,
51
+ data : {shortcode: 'tutor_dashboard', action : 'render_block_tutor'},
52
  success: function (response) {
53
  dataHtml = response.data;
54
  },
assets/js/mce-button.js CHANGED
@@ -20,7 +20,7 @@ jQuery(document).ready(function($){
20
  {
21
  text: 'Student Dashboard',
22
  onclick: function() {
23
- editor.insertContent('[tutor_student_dashboard]');
24
  }
25
  },{
26
  text: 'Instructor Registration Form',
20
  {
21
  text: 'Student Dashboard',
22
  onclick: function() {
23
+ editor.insertContent('[tutor_dashboard]');
24
  }
25
  },{
26
  text: 'Instructor Registration Form',
assets/js/tutor-admin.js CHANGED
@@ -35,15 +35,31 @@ jQuery(document).ready(function($){
35
  $form.find('.button').addClass('tutor-updating-message');
36
  },
37
  success: function (data) {
38
- //
 
 
39
  },
40
  complete: function () {
41
  $form.find('.button').removeClass('tutor-updating-message');
42
- window.location.reload();
43
  }
44
  });
45
  });
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  function tutor_slider_init(){
48
  $('.tutor-field-slider').each(function(){
49
  var $slider = $(this);
35
  $form.find('.button').addClass('tutor-updating-message');
36
  },
37
  success: function (data) {
38
+ if (data.success) {
39
+ window.location.reload();
40
+ }
41
  },
42
  complete: function () {
43
  $form.find('.button').removeClass('tutor-updating-message');
 
44
  }
45
  });
46
  });
47
 
48
+ /**
49
+ * Withdraw nav tabs
50
+ * @since v.1.1.2
51
+ */
52
+ $(document).on('click', '.withdraw-method-nav li a', function(e){
53
+ e.preventDefault();
54
+ var tab_page_id = $(this).attr('data-target-id');
55
+ $('.withdraw-method-form-wrap').hide();
56
+ $('#'+tab_page_id).show();
57
+ });
58
+
59
+ /**
60
+ * End Withdraw nav tabs
61
+ */
62
+
63
  function tutor_slider_init(){
64
  $('.tutor-field-slider').each(function(){
65
  var $slider = $(this);
assets/js/tutor-front.js CHANGED
@@ -566,4 +566,112 @@ jQuery(document).ready(function($){
566
  }
567
  }
568
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
569
  });
566
  }
567
  }
568
 
569
+ /**
570
+ * Datepicker initiate
571
+ *
572
+ * @since v.1.1.2
573
+ */
574
+ if (jQuery.datepicker){
575
+ $( ".tutor_report_datepicker" ).datepicker({"dateFormat" : 'yy-mm-dd'});
576
+ }
577
+
578
+ $(document).on('click', '.withdraw-method-select-input', function(e){
579
+ var $that = $(this);
580
+ var method_id = $that.closest('.withdraw-method-select').attr('data-withdraw-method');
581
+
582
+ $('.withdraw-method-form').hide();
583
+ $('#withdraw-method-form-'+method_id).show();
584
+ });
585
+
586
+ /**
587
+ * Setting account for withdraw earning
588
+ *
589
+ * @since v.1.2.0
590
+ */
591
+ $(document).on('submit', '#tutor-withdraw-account-set-form', function(e){
592
+ e.preventDefault();
593
+
594
+ var $form = $(this);
595
+ var $btn = $form.find('.tutor_set_withdraw_account_btn');
596
+ var data = $form.serialize();
597
+
598
+ $.ajax({
599
+ url: _tutorobject.ajaxurl,
600
+ type: 'POST',
601
+ data: data,
602
+ beforeSend: function () {
603
+ $form.find('.tutor-success-msg').remove();
604
+ $btn.addClass('updating-icon');
605
+ },
606
+ success: function (data) {
607
+ if (data.success){
608
+ var successMsg = '<div class="tutor-success-msg" style="display: none;"><i class="tutor-icon-mark"></i> '+data.data.msg+' </div>';
609
+ $btn.closest('.withdraw-account-save-btn-wrap').append(successMsg);
610
+ if ($form.find('.tutor-success-msg').length) {
611
+ $form.find('.tutor-success-msg').slideDown();
612
+ }
613
+ setTimeout(function () {
614
+ $form.find('.tutor-success-msg').slideUp();
615
+ }, 5000)
616
+ }
617
+ },
618
+ complete: function () {
619
+ $btn.removeClass('updating-icon');
620
+ }
621
+ });
622
+ });
623
+
624
+ /**
625
+ * Make Withdraw Form
626
+ *
627
+ * @since v.1.2.0
628
+ */
629
+
630
+ $(document).on('click', 'a.open-withdraw-form-btn', function(e){
631
+ e.preventDefault();
632
+ $('.tutor-earning-withdraw-form-wrap').slideToggle();
633
+ });
634
+
635
+ $(document).on('submit', '#tutor-earning-withdraw-form', function(e){
636
+ e.preventDefault();
637
+
638
+ var $form = $(this);
639
+ var $btn = $('#tutor-earning-withdraw-btn');
640
+ var $responseDiv = $('#tutor-withdraw-form-response');
641
+ var data = $form.serialize();
642
+
643
+ $.ajax({
644
+ url: _tutorobject.ajaxurl,
645
+ type: 'POST',
646
+ data: data,
647
+ beforeSend: function () {
648
+ $form.find('.tutor-success-msg').remove();
649
+ $btn.addClass('updating-icon');
650
+ },
651
+ success: function (data) {
652
+ var Msg;
653
+ if (data.success){
654
+
655
+ if (data.data.available_balance !== 'undefined') {
656
+ $('.withdraw-balance-col .available_balance').html(data.data.available_balance);
657
+ }
658
+ Msg = '<div class="tutor-success-msg"><i class="tutor-icon-mark"></i> '+data.data.msg+' </div>';
659
+
660
+ }else{
661
+ Msg = '<div class="tutor-error-msg"><i class="tutor-icon-line-cross"></i> '+data.data.msg+' </div>';
662
+ }
663
+
664
+ $responseDiv.html(Msg);
665
+ setTimeout(function () {
666
+ $responseDiv.html('');
667
+ }, 5000)
668
+ },
669
+ complete: function () {
670
+ $btn.removeClass('updating-icon');
671
+ }
672
+ });
673
+ });
674
+
675
+
676
+
677
  });
classes/Admin.php CHANGED
@@ -26,6 +26,9 @@ class Admin{
26
 
27
  //Plugin Row Meta
28
  add_filter('plugin_row_meta', array($this, 'plugin_row_meta'), 10, 2);
 
 
 
29
  }
30
 
31
  public function register_menu(){
@@ -52,6 +55,7 @@ class Admin{
52
  add_submenu_page('tutor', __('Q & A', 'tutor'), __('Q & A '.$unanswered_bubble, 'tutor'), 'manage_tutor_instructor', 'question_answer', array($this, 'question_answer') );
53
 
54
  add_submenu_page('tutor', __('Quiz Attempts', 'tutor'), __('Quiz Attempts', 'tutor'), 'manage_tutor_instructor', 'tutor_quiz_attempts',array($this, 'quiz_attempts') );
 
55
 
56
  //add_submenu_page('tutor', __('Add-ons', 'tutor'), __('Add-ons', 'tutor'), 'manage_tutor', 'tutor-addons', array(new Addons(),'addons_page') );
57
 
@@ -94,6 +98,15 @@ class Admin{
94
  include tutor()->path.'views/pages/quiz_attempts.php';
95
  }
96
 
 
 
 
 
 
 
 
 
 
97
  public function enable_disable_addons(){
98
  include tutor()->path.'views/pages/enable_disable_addons.php';
99
  }
@@ -163,7 +176,7 @@ class Admin{
163
  }
164
 
165
  /**
166
- * Prevent unauthorised post edit page by direct URL
167
  *
168
  * @since v.1.0.0
169
  */
@@ -175,9 +188,11 @@ class Admin{
175
  if (! empty($_GET['post']) ) {
176
  $get_post_id = (int) sanitize_text_field($_GET['post']);
177
  $get_post = get_post($get_post_id);
 
 
178
  $current_user = get_current_user_id();
179
 
180
- if ($get_post->post_author != $current_user){
181
  global $wpdb;
182
 
183
  $get_assigned_courses_ids = (int) $wpdb->get_var("SELECT user_id from {$wpdb->usermeta} WHERE user_id = {$current_user} AND meta_key = '_tutor_instructor_course_id' AND meta_value = {$get_post_id} ");
@@ -366,7 +381,7 @@ class Admin{
366
 
367
  //Deleting Table
368
  $prefix = $wpdb->prefix;
369
- /**D*/ $wpdb->query("DROP TABLE IF EXISTS {$prefix}tutor_quiz_attempts, {$prefix}tutor_quiz_attempt_answers, {$prefix}tutor_quiz_questions, {$prefix}tutor_quiz_question_answers ");
370
 
371
  deactivate_plugins($plugin_file);
372
  }
@@ -400,7 +415,6 @@ class Admin{
400
 
401
  public function plugin_row_meta($plugin_meta, $plugin_file){
402
 
403
-
404
  if ($plugin_file === tutor()->basename) {
405
  $plugin_meta[] = sprintf( '<a href="%s">%s</a>',
406
  esc_url( 'https://www.themeum.com/docs/tutor-introduction/?utm_source=tutor&utm_medium=plugins_installation_list&utm_campaign=plugin_docs_link' ),
@@ -415,6 +429,30 @@ class Admin{
415
  return $plugin_meta;
416
  }
417
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
418
 
419
 
420
  }
26
 
27
  //Plugin Row Meta
28
  add_filter('plugin_row_meta', array($this, 'plugin_row_meta'), 10, 2);
29
+
30
+ //Admin Footer Text
31
+ add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
32
  }
33
 
34
  public function register_menu(){
55
  add_submenu_page('tutor', __('Q & A', 'tutor'), __('Q & A '.$unanswered_bubble, 'tutor'), 'manage_tutor_instructor', 'question_answer', array($this, 'question_answer') );
56
 
57
  add_submenu_page('tutor', __('Quiz Attempts', 'tutor'), __('Quiz Attempts', 'tutor'), 'manage_tutor_instructor', 'tutor_quiz_attempts',array($this, 'quiz_attempts') );
58
+ add_submenu_page('tutor', __('Withdraw Requests', 'tutor'), __('Withdraw Requests', 'tutor'), 'manage_tutor_instructor', 'tutor_withdraw_requests', array($this, 'withdraw_requests') );
59
 
60
  //add_submenu_page('tutor', __('Add-ons', 'tutor'), __('Add-ons', 'tutor'), 'manage_tutor', 'tutor-addons', array(new Addons(),'addons_page') );
61
 
98
  include tutor()->path.'views/pages/quiz_attempts.php';
99
  }
100
 
101
+ /**
102
+ * Show the withdraw requests table
103
+ *
104
+ * @since v.1.2.0
105
+ */
106
+ public function withdraw_requests(){
107
+ include tutor()->path.'views/pages/withdraw_requests.php';
108
+ }
109
+
110
  public function enable_disable_addons(){
111
  include tutor()->path.'views/pages/enable_disable_addons.php';
112
  }
176
  }
177
 
178
  /**
179
+ * Prevent unauthorised course/lesson edit page by direct URL
180
  *
181
  * @since v.1.0.0
182
  */
188
  if (! empty($_GET['post']) ) {
189
  $get_post_id = (int) sanitize_text_field($_GET['post']);
190
  $get_post = get_post($get_post_id);
191
+ $tutor_post_types = array(tutor()->course_post_type, tutor()->lesson_post_type);
192
+
193
  $current_user = get_current_user_id();
194
 
195
+ if (in_array($get_post->post_type, $tutor_post_types) && $get_post->post_author != $current_user){
196
  global $wpdb;
197
 
198
  $get_assigned_courses_ids = (int) $wpdb->get_var("SELECT user_id from {$wpdb->usermeta} WHERE user_id = {$current_user} AND meta_key = '_tutor_instructor_course_id' AND meta_value = {$get_post_id} ");
381
 
382
  //Deleting Table
383
  $prefix = $wpdb->prefix;
384
+ /**D*/ $wpdb->query("DROP TABLE IF EXISTS {$prefix}tutor_quiz_attempts, {$prefix}tutor_quiz_attempt_answers, {$prefix}tutor_quiz_questions, {$prefix}tutor_quiz_question_answers, {$prefix}tutor_earnings, {$prefix}tutor_withdraws ");
385
 
386
  deactivate_plugins($plugin_file);
387
  }
415
 
416
  public function plugin_row_meta($plugin_meta, $plugin_file){
417
 
 
418
  if ($plugin_file === tutor()->basename) {
419
  $plugin_meta[] = sprintf( '<a href="%s">%s</a>',
420
  esc_url( 'https://www.themeum.com/docs/tutor-introduction/?utm_source=tutor&utm_medium=plugins_installation_list&utm_campaign=plugin_docs_link' ),
429
  return $plugin_meta;
430
  }
431
 
432
+ /**
433
+ * @param $footer_text
434
+ *
435
+ * @return string
436
+ *
437
+ * Add footer text only on tutor pages
438
+ */
439
+ public function admin_footer_text( $footer_text ) {
440
+ $current_screen = get_current_screen();
441
+ $tutor_pages = tutor_utils()->tutor_get_screen_ids();
442
+
443
+ /**
444
+ * We are making sure that this message will be only on Tutor Admin page
445
+ */
446
+ if ( isset( $current_screen->id ) && apply_filters( 'tutor_display_admin_footer_text', in_array( $current_screen->id, $tutor_pages ) ) ) {
447
+ $footer_text = sprintf(
448
+ __( 'If you like %1$s please leave us a %2$s rating. A huge thanks in advance!', 'tutor' ),
449
+ sprintf( '<strong>%s</strong>', esc_html__( 'Tutor LMS', 'tutor' ) ),
450
+ '<a href="https://wordpress.org/support/plugin/tutor/reviews?rate=5#new-post" target="_blank" class="tutor-rating-link">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
451
+ );
452
+ }
453
+
454
+ return $footer_text;
455
+ }
456
 
457
 
458
  }
classes/Assets.php CHANGED
@@ -38,7 +38,7 @@ class Assets{
38
  * Load frontend scripts
39
  */
40
  public function frontend_scripts(){
41
- global $post;
42
 
43
  wp_enqueue_editor();
44
 
@@ -79,6 +79,15 @@ class Assets{
79
  }
80
  }
81
 
 
 
 
 
 
 
 
 
 
82
  $localize_data = apply_filters('tutor_localize_data', $localize_data);
83
 
84
  if (tutor_utils()->get_option('load_tutor_css')){
38
  * Load frontend scripts
39
  */
40
  public function frontend_scripts(){
41
+ global $post, $wp_query;
42
 
43
  wp_enqueue_editor();
44
 
79
  }
80
  }
81
 
82
+ /**
83
+ * Chart Data
84
+ */
85
+ if ( ! empty($wp_query->query_vars['tutor_dashboard_page']) && $wp_query->query_vars['tutor_dashboard_page'] === 'earning') {
86
+ wp_enqueue_script( 'tutor-front-chart-js', tutor()->url . 'assets/js/Chart.bundle.min.js', array(), tutor()->version );
87
+ wp_enqueue_script( 'jquery-ui-datepicker' );
88
+ }
89
+ //End: chart data
90
+
91
  $localize_data = apply_filters('tutor_localize_data', $localize_data);
92
 
93
  if (tutor_utils()->get_option('load_tutor_css')){
classes/Gutenberg.php CHANGED
@@ -39,7 +39,7 @@ class Gutenberg {
39
  ) );
40
  register_block_type( 'tutor-gutenberg/student-dashboard', array(
41
  'editor_script' => 'tutor-student-registration-block',
42
- 'render_callback' => array($this, 'render_block_tutor_student_dashboard'),
43
  ) );
44
  register_block_type( 'tutor-gutenberg/instructor-registration', array(
45
  'editor_script' => 'tutor-student-registration-block',
@@ -62,8 +62,8 @@ class Gutenberg {
62
  public function render_block_student_registration($args){
63
  return do_shortcode("[tutor_student_registration_form]");
64
  }
65
- public function render_block_tutor_student_dashboard($args){
66
- return do_shortcode("[tutor_student_dashboard]");
67
  }
68
  public function render_block_tutor_instructor_registration_form($args){
69
  return do_shortcode("[tutor_instructor_registration_form]");
39
  ) );
40
  register_block_type( 'tutor-gutenberg/student-dashboard', array(
41
  'editor_script' => 'tutor-student-registration-block',
42
+ 'render_callback' => array($this, 'render_block_tutor_dashboard'),
43
  ) );
44
  register_block_type( 'tutor-gutenberg/instructor-registration', array(
45
  'editor_script' => 'tutor-student-registration-block',
62
  public function render_block_student_registration($args){
63
  return do_shortcode("[tutor_student_registration_form]");
64
  }
65
+ public function render_block_tutor_dashboard($args){
66
+ return do_shortcode("[tutor_dashboard]");
67
  }
68
  public function render_block_tutor_instructor_registration_form($args){
69
  return do_shortcode("[tutor_instructor_registration_form]");
classes/Instructors_List.php CHANGED
@@ -18,6 +18,8 @@ class Instructors_List extends \Tutor_List_Table {
18
  'plural' => 'instructors', //plural name of the listed records
19
  'ajax' => false //does this table support ajax?
20
  ) );
 
 
21
  }
22
 
23
  function column_default($item, $column_name){
@@ -125,8 +127,6 @@ class Instructors_List extends \Tutor_List_Table {
125
 
126
  //TODO: send E-Mail to this user about instructor approval, should via hook
127
  do_action('tutor_after_approved_instructor', $instructor_id);
128
-
129
- wp_redirect(wp_get_referer());
130
  }
131
 
132
  if( 'blocked' === $this->current_action() ) {
@@ -140,7 +140,6 @@ class Instructors_List extends \Tutor_List_Table {
140
  do_action('tutor_after_blocked_instructor', $instructor_id);
141
 
142
  //TODO: send E-Mail to this user about instructor blocked, should via hook
143
- wp_redirect(wp_get_referer());
144
  }
145
 
146
  //Detect when a bulk action is being triggered...
@@ -162,7 +161,6 @@ class Instructors_List extends \Tutor_List_Table {
162
  $sortable = $this->get_sortable_columns();
163
 
164
  $this->_column_headers = array($columns, $hidden, $sortable);
165
- $this->process_bulk_action();
166
 
167
  $current_page = $this->get_pagenum();
168
 
18
  'plural' => 'instructors', //plural name of the listed records
19
  'ajax' => false //does this table support ajax?
20
  ) );
21
+
22
+ $this->process_bulk_action();
23
  }
24
 
25
  function column_default($item, $column_name){
127
 
128
  //TODO: send E-Mail to this user about instructor approval, should via hook
129
  do_action('tutor_after_approved_instructor', $instructor_id);
 
 
130
  }
131
 
132
  if( 'blocked' === $this->current_action() ) {
140
  do_action('tutor_after_blocked_instructor', $instructor_id);
141
 
142
  //TODO: send E-Mail to this user about instructor blocked, should via hook
 
143
  }
144
 
145
  //Detect when a bulk action is being triggered...
161
  $sortable = $this->get_sortable_columns();
162
 
163
  $this->_column_headers = array($columns, $hidden, $sortable);
 
164
 
165
  $current_page = $this->get_pagenum();
166
 
classes/Options.php CHANGED
@@ -50,12 +50,16 @@ class Options {
50
  exit();
51
  }
52
 
 
 
53
  $option = (array) isset($_POST['tutor_option']) ? $_POST['tutor_option'] : array();
54
  $option = apply_filters('tutor_option_input', $option);
55
  update_option('tutor_option', $option);
56
 
 
 
57
  //re-sync settings
58
- init::tutor_activate();
59
 
60
  wp_send_json_success( array('msg' => __('Option Updated', 'tutor') ) );
61
  }
@@ -80,6 +84,13 @@ class Options {
80
  'label' => __('General', 'tutor'),
81
  'desc' => __('General Settings', 'tutor'),
82
  'fields' => array(
 
 
 
 
 
 
 
83
  'enable_public_profile' => array(
84
  'type' => 'checkbox',
85
  'label' => __('Enable Public Profile', 'tutor'),
@@ -288,14 +299,6 @@ class Options {
288
  'options' => $pages,
289
  'desc' => __('Choose the page for student registration page', 'tutor'),
290
  ),
291
- 'student_dashboard' => array(
292
- 'type' => 'select',
293
- 'label' => __('Student Dashboard', 'tutor'),
294
- 'default' => '0',
295
- 'options' => $pages,
296
- 'desc' => __('This page will show students related stuff, like my courses, order, etc', 'tutor'),
297
- ),
298
-
299
  'students_own_review_show_at_profile' => array(
300
  'type' => 'checkbox',
301
  'label' => __('Show reviews on profile', 'tutor'),
@@ -315,6 +318,122 @@ class Options {
315
  ),
316
  ),
317
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
318
 
319
  );
320
 
50
  exit();
51
  }
52
 
53
+ do_action('tutor_option_save_before');
54
+
55
  $option = (array) isset($_POST['tutor_option']) ? $_POST['tutor_option'] : array();
56
  $option = apply_filters('tutor_option_input', $option);
57
  update_option('tutor_option', $option);
58
 
59
+ do_action('tutor_option_save_after');
60
+
61
  //re-sync settings
62
+ //init::tutor_activate();
63
 
64
  wp_send_json_success( array('msg' => __('Option Updated', 'tutor') ) );
65
  }
84
  'label' => __('General', 'tutor'),
85
  'desc' => __('General Settings', 'tutor'),
86
  'fields' => array(
87
+ 'tutor_dashboard_page_id' => array(
88
+ 'type' => 'select',
89
+ 'label' => __('Tutor Dashboard', 'tutor'),
90
+ 'default' => '0',
91
+ 'options' => $pages,
92
+ 'desc' => __('This page will show dashboard related stuff, like my courses, order, earnings, logout etc', 'tutor'),
93
+ ),
94
  'enable_public_profile' => array(
95
  'type' => 'checkbox',
96
  'label' => __('Enable Public Profile', 'tutor'),
299
  'options' => $pages,
300
  'desc' => __('Choose the page for student registration page', 'tutor'),
301
  ),
 
 
 
 
 
 
 
 
302
  'students_own_review_show_at_profile' => array(
303
  'type' => 'checkbox',
304
  'label' => __('Show reviews on profile', 'tutor'),
318
  ),
319
  ),
320
 
321
+ 'tutor_earning' => array(
322
+ 'label' => __('Earning', 'tutor'),
323
+ 'sections' => array(
324
+ 'general' => array(
325
+ 'label' => __('Earning and commission allocation', 'tutor'),
326
+ 'desc' => __('Enable Disable Option to on/off notification on various event', 'tutor'),
327
+ 'fields' => array(
328
+
329
+ 'enable_tutor_earning' => array(
330
+ 'type' => 'checkbox',
331
+ 'label' => __('Enable/Disable', 'tutor'),
332
+ 'label_title' => __('Enable Instructor Earning and commission allocation', 'tutor'),
333
+ 'default' => '0',
334
+ 'desc' => __('You can set commission and generate earning for instructor who interested sell their course with this platform by enabling this feature', 'tutor'),
335
+ ),
336
+
337
+ 'earning_admin_commission' => array(
338
+ 'type' => 'number',
339
+ 'label' => __('Admin / Platform Owner Commission', 'tutor'),
340
+ 'default' => '20',
341
+ 'desc' => __('Define the sales commission for admin from every course sell.', 'tutor'),
342
+ ),
343
+ 'earning_instructor_commission' => array(
344
+ 'type' => 'number',
345
+ 'label' => __('Instructor Commission', 'tutor'),
346
+ 'default' => '80',
347
+ 'desc' => __('Define the sales commission for instructor from every course sell.', 'tutor'),
348
+ ),
349
+
350
+ 'tutor_earning_fees' => array(
351
+ 'type' => 'group_fields',
352
+ 'label' => __('Others Fees', 'tutor'),
353
+ 'desc' => __('Deduct the more fees from the instructor, the deducting process will be, first deduct this fees from total course payment, then commission will be allocation on rest amount.', 'tutor'),
354
+ 'group_fields' => array(
355
+
356
+ 'enable_fees_deducting' => array(
357
+ 'type' => 'checkbox',
358
+ 'label' => __('Enable Deduct Fees', 'tutor'),
359
+ 'default' => '0',
360
+ ),
361
+ 'fees_name' => array(
362
+ 'type' => 'text',
363
+ 'label' => __('Fees Name', 'tutor'),
364
+ 'default' => '',
365
+ ),
366
+ 'fees_amount' => array(
367
+ 'type' => 'number',
368
+ 'label' => __('Fees Amount', 'tutor'),
369
+ 'default' => '',
370
+ ),
371
+ 'fees_type' => array(
372
+ 'type' => 'select',
373
+ 'default' => 'minutes',
374
+ 'select_options' => false,
375
+ 'options' => array(
376
+ '' => __('Select Fees Type', 'tutor'),
377
+ 'percent' => __('Percent', 'tutor'),
378
+ 'fixed' => __('Fixed', 'tutor'),
379
+ ),
380
+ ),
381
+ ),
382
+ ),
383
+ 'statement_show_per_page' => array(
384
+ 'type' => 'number',
385
+ 'label' => __('Show Statement Per Page', 'tutor'),
386
+ 'default' => '20',
387
+ 'desc' => __('Define the number of statement should show.', 'tutor'),
388
+ ),
389
+
390
+ ),
391
+ ),
392
+
393
+
394
+ ),
395
+ ),
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+
404
+ 'tutor_withdraw' => array(
405
+ 'label' => __('Withdraw', 'tutor'),
406
+ 'sections' => array(
407
+ 'general' => array(
408
+ 'label' => __('Earning and commission allocation', 'tutor'),
409
+ 'fields' => array(
410
+
411
+ 'min_withdraw_amount' => array(
412
+ 'type' => 'number',
413
+ 'label' => __('Minimum Withdraw Amount', 'tutor'),
414
+ 'default' => '80',
415
+ 'desc' => __('Define the withdraw amount, anyone can make withdraw request if their earning above or equal this amount.', 'tutor'),
416
+ ),
417
+
418
+ ),
419
+ ),
420
+
421
+ 'withdraw_methods' => array(
422
+ 'label' => __('Withdraw Methods', 'tutor'),
423
+ 'desc' => __('Set withdraw settings', 'tutor'),
424
+ ),
425
+
426
+ ),
427
+ ),
428
+
429
+
430
+
431
+
432
+
433
+
434
+
435
+
436
+
437
 
438
  );
439
 
classes/Rewrite_Rules.php CHANGED
@@ -21,6 +21,7 @@ class Rewrite_Rules extends Tutor_Base {
21
  $vars[] = 'course_subpage';
22
  $vars[] = 'lesson_video';
23
  $vars[] = 'tutor_dashboard_page';
 
24
 
25
  $enable_public_profile = tutor_utils()->get_option('enable_public_profile');
26
  if ($enable_public_profile){
@@ -55,9 +56,13 @@ class Rewrite_Rules extends Tutor_Base {
55
  }
56
 
57
  //Student Dashboard URL
58
- $dashboard_pages = tutor_utils()->tutor_student_dashboard_pages();
59
  foreach ($dashboard_pages as $dashboard_key => $dashboard_page){
60
  $new_rules["(.+?)/{$dashboard_key}/?$"] ='index.php?pagename='.$wp_rewrite->preg_index(1).'&tutor_dashboard_page=' .$dashboard_key;
 
 
 
 
61
  }
62
 
63
  $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
21
  $vars[] = 'course_subpage';
22
  $vars[] = 'lesson_video';
23
  $vars[] = 'tutor_dashboard_page';
24
+ $vars[] = 'tutor_dashboard_sub_page';
25
 
26
  $enable_public_profile = tutor_utils()->get_option('enable_public_profile');
27
  if ($enable_public_profile){
56
  }
57
 
58
  //Student Dashboard URL
59
+ $dashboard_pages = tutor_utils()->tutor_dashboard_pages();
60
  foreach ($dashboard_pages as $dashboard_key => $dashboard_page){
61
  $new_rules["(.+?)/{$dashboard_key}/?$"] ='index.php?pagename='.$wp_rewrite->preg_index(1).'&tutor_dashboard_page=' .$dashboard_key;
62
+
63
+ //Sub Page of dashboard sub page
64
+ $new_rules["(.+?)/{$dashboard_key}/([^/]*)/?$"] ='index.php?pagename='.$wp_rewrite->preg_index(1).'&tutor_dashboard_page='
65
+ .$dashboard_key.'&tutor_dashboard_sub_page='.$wp_rewrite->preg_index(2);
66
  }
67
 
68
  $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
classes/Shortcode.php CHANGED
@@ -15,7 +15,7 @@ class Shortcode {
15
 
16
  public function __construct() {
17
  add_shortcode('tutor_student_registration_form', array($this, 'student_registration_form'));
18
- add_shortcode('tutor_student_dashboard', array($this, 'tutor_student_dashboard'));
19
  add_shortcode('tutor_instructor_registration_form', array($this, 'instructor_registration_form'));
20
  }
21
 
@@ -29,9 +29,9 @@ class Shortcode {
29
  public function student_registration_form(){
30
  ob_start();
31
  if (is_user_logged_in()){
32
- tutor_load_template( 'dashboard.student.logged-in' );
33
  }else{
34
- tutor_load_template( 'dashboard.student.registration' );
35
  }
36
  return apply_filters( 'tutor/student/register', ob_get_clean() );
37
  }
@@ -43,14 +43,14 @@ class Shortcode {
43
  *
44
  * @since v.1.0.0
45
  */
46
- public function tutor_student_dashboard(){
47
  ob_start();
48
  if (is_user_logged_in()){
49
- tutor_load_template( 'dashboard.student.index' );
50
  }else{
51
  tutor_load_template( 'global.login' );
52
  }
53
- return apply_filters( 'tutor_dashboard/student/index', ob_get_clean() );
54
  }
55
 
56
  /**
15
 
16
  public function __construct() {
17
  add_shortcode('tutor_student_registration_form', array($this, 'student_registration_form'));
18
+ add_shortcode('tutor_dashboard', array($this, 'tutor_dashboard'));
19
  add_shortcode('tutor_instructor_registration_form', array($this, 'instructor_registration_form'));
20
  }
21
 
29
  public function student_registration_form(){
30
  ob_start();
31
  if (is_user_logged_in()){
32
+ tutor_load_template( 'dashboard.logged-in' );
33
  }else{
34
+ tutor_load_template( 'dashboard.registration' );
35
  }
36
  return apply_filters( 'tutor/student/register', ob_get_clean() );
37
  }
43
  *
44
  * @since v.1.0.0
45
  */
46
+ public function tutor_dashboard(){
47
  ob_start();
48
  if (is_user_logged_in()){
49
+ tutor_load_template( 'dashboard.index' );
50
  }else{
51
  tutor_load_template( 'global.login' );
52
  }
53
+ return apply_filters( 'tutor_dashboard/index', ob_get_clean() );
54
  }
55
 
56
  /**
classes/Template.php CHANGED
@@ -25,6 +25,7 @@ class Template extends Tutor_Base {
25
  add_filter( 'template_include', array($this, 'load_quiz_template'), 99 );
26
 
27
  add_filter( 'template_include', array($this, 'student_public_profile'), 99 );
 
28
  add_filter( 'pre_get_document_title', array($this, 'student_public_profile_title') );
29
 
30
  add_filter('the_content', array($this, 'convert_static_page_to_template'));
@@ -229,16 +230,16 @@ class Template extends Tutor_Base {
229
  *
230
  * @return mixed
231
  *
232
- * Tutor Dashboard Page, Responsible to show student dashboard
233
  *
234
  * @since v.1.0.0
235
  */
236
  public function convert_static_page_to_template($content){
237
  //Student Registration Page
238
- $student_dashboard_page_id = (int) tutor_utils()->get_option('student_dashboard');
239
  if ($student_dashboard_page_id === get_the_ID()){
240
  $shortcode = new Shortcode();
241
- return $shortcode->tutor_student_dashboard();
242
  }
243
 
244
  //Instructor Registration Page
@@ -256,6 +257,40 @@ class Template extends Tutor_Base {
256
 
257
  return $content;
258
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
 
260
  /**
261
  * @param $template
25
  add_filter( 'template_include', array($this, 'load_quiz_template'), 99 );
26
 
27
  add_filter( 'template_include', array($this, 'student_public_profile'), 99 );
28
+ add_filter( 'template_include', array($this, 'tutor_dashboard'), 99 );
29
  add_filter( 'pre_get_document_title', array($this, 'student_public_profile_title') );
30
 
31
  add_filter('the_content', array($this, 'convert_static_page_to_template'));
230
  *
231
  * @return mixed
232
  *
233
+ * Tutor Dashboard Page, Responsible to show dashboard stuffs
234
  *
235
  * @since v.1.0.0
236
  */
237
  public function convert_static_page_to_template($content){
238
  //Student Registration Page
239
+ $student_dashboard_page_id = (int) tutor_utils()->get_option('tutor_dashboard_page_id');
240
  if ($student_dashboard_page_id === get_the_ID()){
241
  $shortcode = new Shortcode();
242
+ return $shortcode->tutor_dashboard();
243
  }
244
 
245
  //Instructor Registration Page
257
 
258
  return $content;
259
  }
260
+
261
+ public function tutor_dashboard($template){
262
+ global $wp_query;
263
+
264
+ if ($wp_query->is_page) {
265
+ $student_dashboard_page_id = (int) tutor_utils()->get_option('tutor_dashboard_page_id');
266
+ if ($student_dashboard_page_id === get_the_ID()) {
267
+ /**
268
+ * Handle if logout URL
269
+ * @since v.1.1.2
270
+ */
271
+ if ( ! empty($wp_query->query_vars['tutor_dashboard_page']) && $wp_query->query_vars['tutor_dashboard_page'] === 'logout'){
272
+ $redirect = get_permalink($student_dashboard_page_id);
273
+ wp_logout();
274
+ wp_redirect($redirect);
275
+ die();
276
+ }
277
+
278
+ /**
279
+ * Load view page based on dashboard Endpoint
280
+ */
281
+ if (is_user_logged_in()) {
282
+ $template = tutor_get_template( 'dashboard' );
283
+ }else{
284
+ $template = tutor_get_template( 'login' );
285
+ }
286
+
287
+
288
+
289
+ }
290
+ }
291
+
292
+ return $template;
293
+ }
294
 
295
  /**
296
  * @param $template
classes/{init.php → Tutor.php} RENAMED
@@ -4,12 +4,19 @@ namespace TUTOR;
4
  if ( ! defined( 'ABSPATH' ) )
5
  exit;
6
 
7
- class init{
8
  public $version = TUTOR_VERSION;
9
  public $path;
10
  public $url;
11
  public $basename;
12
 
 
 
 
 
 
 
 
13
  //Components
14
  public $utils;
15
  public $admin;
@@ -35,6 +42,21 @@ class init{
35
 
36
  private $woocommerce;
37
  private $edd;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
  function __construct() {
40
 
@@ -45,12 +67,16 @@ class init{
45
  /**
46
  * Include Files
47
  */
48
- add_action( 'after_setup_theme', array( $this, 'include_template_functions' ), 11 );
 
49
 
50
  /**
51
  * Loading Autoloader
52
  */
53
 
 
 
 
54
  spl_autoload_register(array($this, 'loader'));
55
 
56
  do_action('tutor_before_load');
@@ -76,6 +102,13 @@ class init{
76
  $this->gutenberg = new Gutenberg();
77
  $this->woocommerce = new WooCommerce();
78
  $this->edd = new TutorEDD();
 
 
 
 
 
 
 
79
 
80
  do_action('tutor_loaded');
81
  }
@@ -92,7 +125,7 @@ class init{
92
  $className
93
  );
94
 
95
- $className = str_replace('TUTOR/', 'classes/', $className);
96
  $file_name = $this->path.$className.'.php';
97
 
98
  if (file_exists($file_name) ) {
@@ -101,7 +134,8 @@ class init{
101
  }
102
  }
103
 
104
- public function include_template_functions(){
 
105
  include tutor()->path.'includes/tutor-template-functions.php';
106
  include tutor()->path.'includes/tutor-template-hook.php';
107
  }
@@ -110,7 +144,7 @@ class init{
110
  public function run(){
111
  do_action('tutor_before_run');
112
 
113
- register_activation_hook( TUTOR_FILE, array( $this, 'tutor_activate' ) );
114
  register_deactivation_hook(TUTOR_FILE, array($this, 'tutor_deactivation'));
115
 
116
  do_action('tutor_after_run');
@@ -143,22 +177,17 @@ class init{
143
  }
144
 
145
  /**
146
- * backward / Alpha version compatibility
147
- * todo: should remove in version 1.1.0
148
  */
149
- if (version_compare(get_option('TUTOR_VERSION'), '1.0.0', '<')){
150
- //Create Database
151
- $this->create_database();
152
- update_option('tutor_version', '1.0.0');
153
- }
154
- /**
155
- * backward / v.1.0.0 compatibility
156
- * todo: should remove in version 1.1.0
157
- */
158
- if (get_option('TUTOR_VERSION') == '1.0.0' && version_compare(get_option('TUTOR_VERSION'), '1.0.1', '<')){
159
- //Adding column course_id in prefix_tutor_quiz_attempts
160
- $this->upgrading_db_1_0_1();
161
- update_option('tutor_version', '1.0.1');
162
  }
163
 
164
  }
@@ -180,6 +209,8 @@ class init{
180
  * {$wpdb->prefix}tutor_quiz_attempt_answers
181
  * {$wpdb->prefix}tutor_quiz_questions
182
  * {$wpdb->prefix}tutor_quiz_question_answers
 
 
183
  *
184
  * @since v.1.0.0
185
  */
@@ -242,34 +273,45 @@ class init{
242
  PRIMARY KEY (answer_id)
243
  ) $charset_collate;";
244
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
246
  dbDelta( $quiz_attempts_sql );
247
  dbDelta( $quiz_attempt_answers );
248
  dbDelta( $tutor_quiz_questions );
249
  dbDelta( $tutor_quiz_question_answers );
250
- }
251
-
252
- /**
253
- * upgrading quiz_attempts_database adding course_id
254
- * @since v.1.0.1
255
- */
256
- public function upgrading_db_1_0_1(){
257
- global $wpdb;
258
- /**
259
- * Adding course_id column in tutor_quiz_attempts table
260
- */
261
- $sql = "ALTER TABLE {$wpdb->prefix}tutor_quiz_attempts ADD course_id INT NULL DEFAULT NULL AFTER attempt_id;";
262
- $wpdb->query($sql);
263
- /**
264
- * Setting Course_id column data;
265
- */
266
- $attempts = $wpdb->get_results("SELECT * from {$wpdb->prefix}tutor_quiz_attempts;");
267
- if (is_array($attempts) && count($attempts)){
268
- foreach ($attempts as $attempt){
269
- $course = tutor_utils()->get_course_by_quiz($attempt->quiz_id);
270
- $wpdb->update($wpdb->prefix."tutor_quiz_attempts", array('course_id' => $course->ID), array('attempt_id' => $attempt->attempt_id));
271
- }
272
- }
273
  }
274
 
275
  public static function manage_tutor_roles_and_permissions(){
@@ -365,13 +407,13 @@ class init{
365
  */
366
  public static function save_data(){
367
  $student_dashboard_args = array(
368
- 'post_title' => __('Student Dashboard', 'tutor'),
369
- 'post_content' => '[tutor_student_dashboard]',
370
  'post_type' => 'page',
371
  'post_status' => 'publish',
372
  );
373
  $student_dashboard_page_id = wp_insert_post( $student_dashboard_args );
374
- tutor_utils()->update_option('student_dashboard', $student_dashboard_page_id);
375
 
376
  $student_registration_args = array(
377
  'post_title' => __('Student Registration', 'tutor'),
@@ -426,10 +468,72 @@ class init{
426
  'email_from_name' => get_option('blogname'),
427
  'email_from_address' => get_option('admin_email'),
428
  'email_footer_text' => '',
429
- 'enable_course_sell_by_woocommerce' => '1',
430
  );
431
  return $options;
432
  }
433
 
434
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
435
  }
4
  if ( ! defined( 'ABSPATH' ) )
5
  exit;
6
 
7
+ final class Tutor{
8
  public $version = TUTOR_VERSION;
9
  public $path;
10
  public $url;
11
  public $basename;
12
 
13
+ /**
14
+ * The single instance of the class.
15
+ *
16
+ * @since v.1.2.0
17
+ */
18
+ protected static $_instance = null;
19
+
20
  //Components
21
  public $utils;
22
  public $admin;
42
 
43
  private $woocommerce;
44
  private $edd;
45
+ private $withdraw;
46
+
47
+ /**
48
+ * @return null|Tutor
49
+ *
50
+ * Run the TUTOR
51
+ *
52
+ * @since 1.2.0
53
+ */
54
+ public static function instance() {
55
+ if ( is_null( self::$_instance ) ) {
56
+ self::$_instance = new self();
57
+ }
58
+ return self::$_instance;
59
+ }
60
 
61
  function __construct() {
62
 
67
  /**
68
  * Include Files
69
  */
70
+ //add_action( 'init', array( $this, 'includes' ), 11 );
71
+ $this->includes();
72
 
73
  /**
74
  * Loading Autoloader
75
  */
76
 
77
+ if ( function_exists( '__autoload' ) ) {
78
+ spl_autoload_register( '__autoload' );
79
+ }
80
  spl_autoload_register(array($this, 'loader'));
81
 
82
  do_action('tutor_before_load');
102
  $this->gutenberg = new Gutenberg();
103
  $this->woocommerce = new WooCommerce();
104
  $this->edd = new TutorEDD();
105
+ $this->withdraw = new Withdraw();
106
+
107
+ /**
108
+ * Run Method
109
+ * @since v.1.2.0
110
+ */
111
+ $this->run();
112
 
113
  do_action('tutor_loaded');
114
  }
125
  $className
126
  );
127
 
128
+ $className = str_replace('TUTOR'.DIRECTORY_SEPARATOR, 'classes'.DIRECTORY_SEPARATOR, $className);
129
  $file_name = $this->path.$className.'.php';
130
 
131
  if (file_exists($file_name) ) {
134
  }
135
  }
136
 
137
+ public function includes(){
138
+ include tutor()->path.'includes/tutor-general-functions.php';
139
  include tutor()->path.'includes/tutor-template-functions.php';
140
  include tutor()->path.'includes/tutor-template-hook.php';
141
  }
144
  public function run(){
145
  do_action('tutor_before_run');
146
 
147
+ register_activation_hook( TUTOR_FILE, array($this, 'tutor_activate' ) );
148
  register_deactivation_hook(TUTOR_FILE, array($this, 'tutor_deactivation'));
149
 
150
  do_action('tutor_after_run');
177
  }
178
 
179
  /**
180
+ * Backward Compatibility for version < 1.2.0
 
181
  */
182
+ if (version_compare(get_option('TUTOR_VERSION'), '1.2.0', '<')){
183
+ /**
184
+ * Creating New Database
185
+ */
186
+ $this->create_withdraw_database();
187
+ //Update the tutor version
188
+ update_option('tutor_version', '1.2.0');
189
+ //Rewrite Flush
190
+ update_option('required_rewrite_flush', time());
 
 
 
 
191
  }
192
 
193
  }
209
  * {$wpdb->prefix}tutor_quiz_attempt_answers
210
  * {$wpdb->prefix}tutor_quiz_questions
211
  * {$wpdb->prefix}tutor_quiz_question_answers
212
+ * {$wpdb->prefix}tutor_earnings
213
+ * {$wpdb->prefix}tutor_withdraws
214
  *
215
  * @since v.1.0.0
216
  */
273
  PRIMARY KEY (answer_id)
274
  ) $charset_collate;";
275
 
276
+ $earning_table = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}tutor_earnings (
277
+ earning_id int(11) NOT NULL AUTO_INCREMENT,
278
+ user_id int(11) DEFAULT NULL,
279
+ course_id int(11) DEFAULT NULL,
280
+ order_id int(11) DEFAULT NULL,
281
+ order_status varchar(50) DEFAULT NULL,
282
+ course_price_total decimal(16,2) DEFAULT NULL,
283
+ course_price_grand_total decimal(16,2) DEFAULT NULL,
284
+ instructor_amount decimal(16,2) DEFAULT NULL,
285
+ instructor_rate decimal(16,2) DEFAULT NULL,
286
+ admin_amount decimal(16,2) DEFAULT NULL,
287
+ admin_rate decimal(16,2) DEFAULT NULL,
288
+ commission_type varchar(20) DEFAULT NULL,
289
+ deduct_fees_amount decimal(16,2) DEFAULT NULL,
290
+ deduct_fees_name varchar(250) DEFAULT NULL,
291
+ deduct_fees_type varchar(20) DEFAULT NULL,
292
+ process_by varchar(20) DEFAULT NULL,
293
+ created_at datetime DEFAULT NULL,
294
+ PRIMARY KEY (earning_id)
295
+ ) $charset_collate;";
296
+
297
+ $withdraw_table = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}tutor_withdraws (
298
+ withdraw_id int(11) NOT NULL AUTO_INCREMENT,
299
+ user_id int(11) DEFAULT NULL,
300
+ amount decimal(16,2) DEFAULT NULL,
301
+ method_data text DEFAULT NULL,
302
+ status varchar(50) DEFAULT NULL,
303
+ updated_at datetime DEFAULT NULL,
304
+ created_at datetime DEFAULT NULL,
305
+ PRIMARY KEY (withdraw_id)
306
+ ) $charset_collate;";
307
+
308
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
309
  dbDelta( $quiz_attempts_sql );
310
  dbDelta( $quiz_attempt_answers );
311
  dbDelta( $tutor_quiz_questions );
312
  dbDelta( $tutor_quiz_question_answers );
313
+ dbDelta( $earning_table );
314
+ dbDelta( $withdraw_table );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  }
316
 
317
  public static function manage_tutor_roles_and_permissions(){
407
  */
408
  public static function save_data(){
409
  $student_dashboard_args = array(
410
+ 'post_title' => __('Dashboard', 'tutor'),
411
+ 'post_content' => '',
412
  'post_type' => 'page',
413
  'post_status' => 'publish',
414
  );
415
  $student_dashboard_page_id = wp_insert_post( $student_dashboard_args );
416
+ tutor_utils()->update_option('tutor_dashboard_page_id', $student_dashboard_page_id);
417
 
418
  $student_registration_args = array(
419
  'post_title' => __('Student Registration', 'tutor'),
468
  'email_from_name' => get_option('blogname'),
469
  'email_from_address' => get_option('admin_email'),
470
  'email_footer_text' => '',
 
471
  );
472
  return $options;
473
  }
474
 
475
 
476
+ /**
477
+ * Create withdraw database
478
+ *
479
+ * @since v.1.2.0
480
+ */
481
+ public function create_withdraw_database(){
482
+ global $wpdb;
483
+
484
+ $charset_collate = $wpdb->get_charset_collate();
485
+
486
+ /**
487
+ * Table SQL
488
+ *
489
+ * {$wpdb->prefix}tutor_earnings
490
+ * {$wpdb->prefix}tutor_withdraws
491
+ *
492
+ * @since v.1.2.0
493
+ */
494
+
495
+ $earning_table = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}tutor_earnings (
496
+ earning_id int(11) NOT NULL AUTO_INCREMENT,
497
+ user_id int(11) DEFAULT NULL,
498
+ course_id int(11) DEFAULT NULL,
499
+ order_id int(11) DEFAULT NULL,
500
+ order_status varchar(50) DEFAULT NULL,
501
+ course_price_total decimal(16,2) DEFAULT NULL,
502
+ course_price_grand_total decimal(16,2) DEFAULT NULL,
503
+ instructor_amount decimal(16,2) DEFAULT NULL,
504
+ instructor_rate decimal(16,2) DEFAULT NULL,
505
+ admin_amount decimal(16,2) DEFAULT NULL,
506
+ admin_rate decimal(16,2) DEFAULT NULL,
507
+ commission_type varchar(20) DEFAULT NULL,
508
+ deduct_fees_amount decimal(16,2) DEFAULT NULL,
509
+ deduct_fees_name varchar(250) DEFAULT NULL,
510
+ deduct_fees_type varchar(20) DEFAULT NULL,
511
+ process_by varchar(20) DEFAULT NULL,
512
+ created_at datetime DEFAULT NULL,
513
+ PRIMARY KEY (earning_id)
514
+ ) $charset_collate;";
515
+
516
+ $withdraw_table = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}tutor_withdraws (
517
+ withdraw_id int(11) NOT NULL AUTO_INCREMENT,
518
+ user_id int(11) DEFAULT NULL,
519
+ amount decimal(16,2) DEFAULT NULL,
520
+ method_data text DEFAULT NULL,
521
+ status varchar(50) DEFAULT NULL,
522
+ updated_at datetime DEFAULT NULL,
523
+ created_at datetime DEFAULT NULL,
524
+ PRIMARY KEY (withdraw_id)
525
+ ) $charset_collate;";
526
+
527
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
528
+ dbDelta( $earning_table );
529
+ dbDelta( $withdraw_table );
530
+
531
+ /**
532
+ * Setting previous dashboard to new dashboard
533
+ */
534
+ $previous_dashboard_page_id = (int) tutor_utils()->get_option('student_dashboard');
535
+ tutor_utils()->update_option('tutor_dashboard_page_id', $previous_dashboard_page_id);
536
+ }
537
+
538
+
539
  }
classes/Utils.php CHANGED
@@ -448,18 +448,23 @@ class Utils {
448
  *
449
  * @since v.1.0.0
450
  */
451
- public function get_courses_by_instructor($instructor_id){
452
  global $wpdb;
453
 
 
454
  $course_post_type = tutor()->course_post_type;
455
 
 
 
 
 
 
456
  $querystr = "
457
  SELECT $wpdb->posts.*
458
  FROM $wpdb->posts
459
  INNER JOIN {$wpdb->usermeta} ON $wpdb->usermeta.user_id = {$instructor_id} AND $wpdb->usermeta.meta_key = '_tutor_instructor_course_id' AND $wpdb->usermeta.meta_value = $wpdb->posts.ID
460
 
461
-
462
- WHERE $wpdb->posts.post_status = 'publish'
463
  AND $wpdb->posts.post_type = '{$course_post_type}'
464
  AND $wpdb->posts.post_date < NOW()
465
  ORDER BY $wpdb->posts.post_date DESC";
@@ -1792,7 +1797,7 @@ class Utils {
1792
  foreach ($courses_ids as $courses_id){
1793
  $course_id = str_replace('_tutor_order_for_course_id_', '',$courses_id->meta_key);
1794
  //array(order_id => array('course_id' => $course_id, 'enrolled_id' => enrolled_id))
1795
- $course_enrolled_by_order[$courses_id->post_id] = array('course_id' => $course_id, 'enrolled_id' => $courses_id->meta_value);
1796
  }
1797
  return $course_enrolled_by_order;
1798
  }
@@ -1867,14 +1872,17 @@ class Utils {
1867
  */
1868
 
1869
  public function get_enrolled_statuses(){
1870
- return array (
1871
- 'pending',
1872
- 'processing',
1873
- 'on-hold',
1874
- 'completed',
1875
- 'cancelled',
1876
- 'refunded',
1877
- 'failed',
 
 
 
1878
  );
1879
  }
1880
 
@@ -1891,6 +1899,16 @@ class Utils {
1891
  return get_post_meta($order_id, '_is_tutor_order_for_course', true);
1892
  }
1893
 
 
 
 
 
 
 
 
 
 
 
1894
  /**
1895
  * @return mixed
1896
  *
@@ -1899,13 +1917,22 @@ class Utils {
1899
  * @since v.1.0.0
1900
  */
1901
 
1902
- public function tutor_student_dashboard_pages(){
1903
  $nav_items = array(
1904
- 'index' => __('Home', 'tutor'),
1905
- 'my-courses' => __('My Courses', 'tutor'),
1906
- 'active-courses' => __('Active Courses', 'tutor'),
1907
- 'completed-courses' => __('Completed Courses', 'tutor'),
1908
- 'wishlist' => __('WishList', 'tutor'),
 
 
 
 
 
 
 
 
 
1909
  );
1910
 
1911
  return apply_filters('tutor_dashboard/student/pages', $nav_items);
@@ -3289,6 +3316,21 @@ class Utils {
3289
  return false;
3290
  }
3291
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3292
  /**
3293
  * @param string $search_term
3294
  *
@@ -3539,7 +3581,7 @@ class Utils {
3539
  * Get frontend dashboard URL
3540
  */
3541
  public function tutor_dashboard_url(){
3542
- $page_id = (int) tutor_utils()->get_option('student_dashboard');
3543
  $page_id = apply_filters('tutor_dashboard_url', $page_id);
3544
  return get_the_permalink($page_id);
3545
  }
@@ -3726,4 +3768,288 @@ class Utils {
3726
  return is_array($array) && count($array);
3727
  }
3728
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3729
  }
448
  *
449
  * @since v.1.0.0
450
  */
451
+ public function get_courses_by_instructor($instructor_id = 0, $post_status = 'publish'){
452
  global $wpdb;
453
 
454
+ $instructor_id = $this->get_user_id($instructor_id);
455
  $course_post_type = tutor()->course_post_type;
456
 
457
+ $where_post_status = "AND $wpdb->posts.post_status = 'publish' ";
458
+ if ($post_status === 'any'){
459
+ $where_post_status = "";
460
+ }
461
+
462
  $querystr = "
463
  SELECT $wpdb->posts.*
464
  FROM $wpdb->posts
465
  INNER JOIN {$wpdb->usermeta} ON $wpdb->usermeta.user_id = {$instructor_id} AND $wpdb->usermeta.meta_key = '_tutor_instructor_course_id' AND $wpdb->usermeta.meta_value = $wpdb->posts.ID
466
 
467
+ WHERE 1 = 1 {$where_post_status}
 
468
  AND $wpdb->posts.post_type = '{$course_post_type}'
469
  AND $wpdb->posts.post_date < NOW()
470
  ORDER BY $wpdb->posts.post_date DESC";
1797
  foreach ($courses_ids as $courses_id){
1798
  $course_id = str_replace('_tutor_order_for_course_id_', '',$courses_id->meta_key);
1799
  //array(order_id => array('course_id' => $course_id, 'enrolled_id' => enrolled_id))
1800
+ $course_enrolled_by_order[] = array('course_id' => $course_id, 'enrolled_id' => $courses_id->meta_value, 'order_id' => $courses_id->post_id );
1801
  }
1802
  return $course_enrolled_by_order;
1803
  }
1872
  */
1873
 
1874
  public function get_enrolled_statuses(){
1875
+ return apply_filters(
1876
+ 'tutor_get_enrolled_statuses',
1877
+ array (
1878
+ 'pending',
1879
+ 'processing',
1880
+ 'on-hold',
1881
+ 'completed',
1882
+ 'cancelled',
1883
+ 'refunded',
1884
+ 'failed',
1885
+ )
1886
  );
1887
  }
1888
 
1899
  return get_post_meta($order_id, '_is_tutor_order_for_course', true);
1900
  }
1901
 
1902
+ /**
1903
+ * @return mixed
1904
+ *
1905
+ * @deprecated
1906
+ */
1907
+ public function tutor_student_dashboard_pages(){
1908
+ _deprecated_function(__METHOD__, '1.1.2', 'tutor_dashboard_pages');
1909
+ return $this->tutor_dashboard_pages();
1910
+ }
1911
+
1912
  /**
1913
  * @return mixed
1914
  *
1917
  * @since v.1.0.0
1918
  */
1919
 
1920
+ public function tutor_dashboard_pages(){
1921
  $nav_items = array(
1922
+
1923
+ 'index' => __('Dashboard', 'tutor'),
1924
+ 'my-profile' => __('My Profile', 'tutor'),
1925
+ 'enrolled-courses' => __('Enrolled Courses', 'tutor'),
1926
+ 'my-courses' => __('My Courses', 'tutor'),
1927
+ 'wishlist' => __('Wishlist', 'tutor'),
1928
+ 'my-reviews' => __('My Reviews', 'tutor'),
1929
+ 'quiz-attempts' => __('Quiz Attempts', 'tutor'),
1930
+ 'earning' => __('Earning', 'tutor'),
1931
+ 'withdraw' => __('Withdraw', 'tutor'),
1932
+ //'purchase-history' => __('Purchase History', 'tutor'),
1933
+ //'messages' => __('Messages', 'tutor'),
1934
+ //'settings' => __('Settings', 'tutor'),
1935
+ 'logout' => __('Logout', 'tutor'),
1936
  );
1937
 
1938
  return apply_filters('tutor_dashboard/student/pages', $nav_items);
3316
  return false;
3317
  }
3318
 
3319
+
3320
+ public function get_all_quiz_attempts_by_user($user_id = 0){
3321
+ global $wpdb;
3322
+
3323
+ $user_id = $this->get_user_id($user_id);
3324
+
3325
+ $attempts = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}tutor_quiz_attempts WHERE user_id = {$user_id} ");
3326
+
3327
+ if (is_array($attempts) && count($attempts)){
3328
+ return $attempts;
3329
+ }
3330
+
3331
+ return false;
3332
+ }
3333
+
3334
  /**
3335
  * @param string $search_term
3336
  *
3581
  * Get frontend dashboard URL
3582
  */
3583
  public function tutor_dashboard_url(){
3584
+ $page_id = (int) tutor_utils()->get_option('tutor_dashboard_page_id');
3585
  $page_id = apply_filters('tutor_dashboard_url', $page_id);
3586
  return get_the_permalink($page_id);
3587
  }
3768
  return is_array($array) && count($array);
3769
  }
3770
 
3771
+ /**
3772
+ * @return array
3773
+ *
3774
+ * get all screen ids
3775
+ *
3776
+ * @since v.1.1.2
3777
+ */
3778
+ public function tutor_get_screen_ids(){
3779
+ $screen_ids = array(
3780
+ "edit-course",
3781
+ "course",
3782
+ "edit-course-category",
3783
+ "edit-course-tag",
3784
+ "tutor-lms_page_tutor-students",
3785
+ "tutor-lms_page_tutor-instructors",
3786
+ "tutor-lms_page_question_answer",
3787
+ "tutor-lms_page_tutor_quiz_attempts",
3788
+ "tutor-lms_page_tutor-addons",
3789
+ "tutor-lms_page_tutor-status",
3790
+ "tutor-lms_page_tutor_report",
3791
+ "tutor-lms_page_tutor_settings",
3792
+ "tutor-lms_page_tutor_emails",
3793
+ );
3794
+
3795
+ return apply_filters('tutor_get_screen_ids', $screen_ids);
3796
+ }
3797
+
3798
+
3799
+ /**
3800
+ * @return mixed
3801
+ *
3802
+ * get earning transaction completed status
3803
+ *
3804
+ * @since v.1.1.2
3805
+ */
3806
+ public function get_earnings_completed_statuses(){
3807
+ return apply_filters(
3808
+ 'tutor_get_earnings_completed_statuses',
3809
+ array (
3810
+ 'wc-completed',
3811
+ 'completed',
3812
+ 'complete',
3813
+ )
3814
+ );
3815
+ }
3816
+
3817
+ /**
3818
+ * @param int $user_id
3819
+ * @param array $date_filter
3820
+ *
3821
+ * @return array|null|object
3822
+ *
3823
+ * Get all time earning sum for an instructor with all commission
3824
+ *
3825
+ * @since v.1.1.2
3826
+ */
3827
+
3828
+ public function get_earning_sum($user_id = 0, $date_filter = array()){
3829
+ global $wpdb;
3830
+
3831
+ $user_id = $this->get_user_id($user_id);
3832
+ $date_query = '';
3833
+ if ($this->count($date_filter)){
3834
+ extract($date_filter);
3835
+
3836
+ if ( ! empty($dataFor)){
3837
+ if ($dataFor === 'yearly'){
3838
+ if (empty($year)){
3839
+ $year = date('Y');
3840
+ }
3841
+ $date_query = "AND YEAR(created_at) = {$year} ";
3842
+ }
3843
+ }else{
3844
+ $date_query = " AND (created_at BETWEEN '{$start_date}' AND '{$end_date}') ";
3845
+ }
3846
+ }
3847
+
3848
+ $complete_status = tutor_utils()->get_earnings_completed_statuses();
3849
+ $complete_status = "'".implode("','", $complete_status)."'";
3850
+
3851
+ $earning_sum = $wpdb->get_row("SELECT SUM(course_price_total) as course_price_total,
3852
+ SUM(course_price_grand_total) as course_price_grand_total,
3853
+ SUM(instructor_amount) as instructor_amount,
3854
+ (SELECT SUM(amount) FROM {$wpdb->prefix}tutor_withdraws WHERE user_id = {$user_id} AND status != 'rejected' ) as
3855
+ withdraws_amount,
3856
+ (SUM(instructor_amount) - (SELECT withdraws_amount) ) as balance,
3857
+ SUM(admin_amount) as admin_amount,
3858
+ SUM(deduct_fees_amount) as deduct_fees_amount
3859
+ FROM {$wpdb->prefix}tutor_earnings
3860
+ WHERE user_id = {$user_id} AND order_status IN({$complete_status}) {$date_query} ");
3861
+
3862
+ if ( ! $earning_sum->course_price_total){
3863
+ $earning_sum = (object) array(
3864
+ 'course_price_total' => 0,
3865
+ 'course_price_grand_total' => 0,
3866
+ 'instructor_amount' => 0,
3867
+ 'withdraws_amount' => 0,
3868
+ 'balance' => 0,
3869
+ 'admin_amount' => 0,
3870
+ 'deduct_fees_amount' => 0,
3871
+ );
3872
+ }
3873
+
3874
+ return $earning_sum;
3875
+ }
3876
+
3877
+ /**
3878
+ * @param int $user_id
3879
+ * @param array $date_filter
3880
+ *
3881
+ * @return array|null|object
3882
+ *
3883
+ * Get earning statements
3884
+ *
3885
+ * @since v.1.1.2
3886
+ */
3887
+ public function get_earning_statements($user_id = 0, $filter_data = array()){
3888
+ global $wpdb;
3889
+
3890
+ $user_sql = "";
3891
+ if ($user_id){
3892
+ $user_sql = " AND user_id='{$user_id}' ";
3893
+ }
3894
+
3895
+ $date_query = '';
3896
+ $query_by_status = '';
3897
+ $pagination_query = '';
3898
+
3899
+ /**
3900
+ * Query by Date Filter
3901
+ */
3902
+ if ($this->count($filter_data)){
3903
+ extract($filter_data);
3904
+
3905
+ if ( ! empty($dataFor)){
3906
+ if ($dataFor === 'yearly'){
3907
+ if (empty($year)){
3908
+ $year = date('Y');
3909
+ }
3910
+ $date_query = "AND YEAR(created_at) = {$year} ";
3911
+ }
3912
+ }else{
3913
+ $date_query = " AND (created_at BETWEEN '{$start_date}' AND '{$end_date}') ";
3914
+ }
3915
+
3916
+ /**
3917
+ * Query by order status related to this earning transaction
3918
+ */
3919
+ if ( ! empty($statuses)) {
3920
+ if ( $this->count( $statuses ) ) {
3921
+ $status = "'" . implode( "','", $statuses ) . "'";
3922
+ $query_by_status = "AND order_status IN({$status})";
3923
+ } elseif ( $statuses === 'completed' ) {
3924
+
3925
+ $get_earnings_completed_statuses = $this->get_earnings_completed_statuses();
3926
+ if ( $this->count( $get_earnings_completed_statuses ) ) {
3927
+ $status = "'" . implode( "','", $get_earnings_completed_statuses ) . "'";
3928
+ $query_by_status = "AND order_status IN({$status})";
3929
+ }
3930
+ }
3931
+ }
3932
+
3933
+ if ( ! empty($per_page)){
3934
+ $offset = (int) ! empty($offset) ? $offset : 0;
3935
+
3936
+ $pagination_query = " LIMIT {$offset}, {$per_page} ";
3937
+
3938
+ }
3939
+
3940
+
3941
+ }
3942
+
3943
+ $query = $wpdb->get_results("SELECT earning_tbl.*, course.post_title as course_title
3944
+ FROM {$wpdb->prefix}tutor_earnings earning_tbl
3945
+ LEFT JOIN {$wpdb->posts} course ON earning_tbl.course_id = course.ID
3946
+ WHERE 1=1 {$user_sql} {$date_query} {$query_by_status} ORDER BY created_at DESC {$pagination_query} ");
3947
+
3948
+
3949
+ $query_count = (int) $wpdb->get_var("SELECT COUNT(earning_tbl.earning_id)
3950
+ FROM {$wpdb->prefix}tutor_earnings earning_tbl
3951
+ WHERE 1=1 {$user_sql} {$date_query} {$query_by_status} ORDER BY created_at DESC ");
3952
+
3953
+ return (object) array(
3954
+ 'count' => $query_count,
3955
+ 'results' => $query,
3956
+ );
3957
+ }
3958
+
3959
+ /**
3960
+ * @param int $price
3961
+ *
3962
+ * @return int|string
3963
+ *
3964
+ * Get the price format
3965
+ *
3966
+ * @since v.1.1.2
3967
+ */
3968
+
3969
+ public function tutor_price($price = 0){
3970
+ if (function_exists('wc_price')){
3971
+ return wc_price($price);
3972
+ }elseif (function_exists('edd_currency_filter')){
3973
+ return edd_currency_filter(edd_format_amount($price));
3974
+ }else{
3975
+ return number_format_i18n($price);
3976
+ }
3977
+ }
3978
+
3979
+ /**
3980
+ * @param int $user_id
3981
+ *
3982
+ * @return bool|mixed
3983
+ *
3984
+ * Get withdraw method for a specific
3985
+ */
3986
+ public function get_user_withdraw_method($user_id = 0){
3987
+ $user_id = $this->get_user_id($user_id);
3988
+
3989
+ $account = get_user_meta($user_id, '_tutor_withdraw_method_data', true);
3990
+ if ($account){
3991
+ return maybe_unserialize($account);
3992
+ }
3993
+
3994
+ return false;
3995
+ }
3996
+
3997
+
3998
+ public function get_withdrawals_history($user_id = 0, $filter = array()){
3999
+ global $wpdb;
4000
+
4001
+ $filter = (array) $filter;
4002
+ extract($filter);
4003
+
4004
+ $query_by_status_sql = "";
4005
+ $query_by_user_sql = "";
4006
+ $query_by_pagination = "";
4007
+
4008
+ if ( ! empty($status)){
4009
+ $status = (array) $status;
4010
+ $status = "'".implode("','", $status)."'";
4011
+
4012
+ $query_by_status_sql = " AND status IN({$status}) ";
4013
+ }
4014
+
4015
+ if ( ! empty($per_page)){
4016
+ if ( empty($start))
4017
+ $start = 0;
4018
+
4019
+ $query_by_pagination = " LIMIT {$start}, {$per_page} ";
4020
+ }
4021
+
4022
+ if ($user_id){
4023
+ $query_by_user_sql = " AND user_id = {$user_id} ";
4024
+ }
4025
+
4026
+
4027
+ $count = (int) $wpdb->get_var("SELECT COUNT(withdraw_id) FROM {$wpdb->prefix}tutor_withdraws WHERE 1=1 {$query_by_user_sql} {$query_by_status_sql} ");
4028
+
4029
+ $results = $wpdb->get_results("SELECT withdraw_tbl.*,
4030
+ user_tbl.display_name as user_name,
4031
+ user_tbl.user_email
4032
+ FROM {$wpdb->prefix}tutor_withdraws withdraw_tbl
4033
+ INNER JOIN {$wpdb->users} user_tbl ON withdraw_tbl.user_id = user_tbl.ID
4034
+ WHERE 1=1
4035
+ {$query_by_user_sql}
4036
+ {$query_by_status_sql} ORDER BY
4037
+ created_at DESC {$query_by_pagination} ");
4038
+
4039
+ $withdraw_history = array(
4040
+ 'count' => 0,
4041
+ 'results' => null,
4042
+ );
4043
+
4044
+ if ($count){
4045
+ $withdraw_history['count'] = $count;
4046
+ }
4047
+
4048
+ if (tutor_utils()->count($results)){
4049
+ $withdraw_history['results'] = $results;
4050
+ }
4051
+ return (object) $withdraw_history;
4052
+
4053
+ }
4054
+
4055
  }
classes/Withdraw.php ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Withdraw class
4
+ *
5
+ * @author: themeum
6
+ * @author_uri: https://themeum.com
7
+ * @package Tutor
8
+ * @since v.1.0.0
9
+ */
10
+
11
+ namespace TUTOR;
12
+
13
+
14
+ if ( ! defined( 'ABSPATH' ) )
15
+ exit;
16
+
17
+ class Withdraw {
18
+
19
+ public $available_withdraw_methods;
20
+ public $get_options;
21
+ protected $withdraw_methods;
22
+
23
+ public function __construct() {
24
+
25
+ $this->get_options = $this->get_options();
26
+ $this->withdraw_methods = $this->withdraw_methods();
27
+ $this->available_withdraw_methods = $this->available_withdraw_methods();
28
+
29
+ add_action('tutor_options_tutor_withdraw_withdraw_methods_before', array($this, 'withdraw_admin_options'));
30
+ add_action('tutor_option_save_after', array($this, 'withdraw_option_save'));
31
+
32
+
33
+ add_action('wp_ajax_tutor_save_withdraw_account', array($this, 'tutor_save_withdraw_account'));
34
+ add_action('wp_ajax_tutor_make_an_withdraw', array($this, 'tutor_make_an_withdraw'));
35
+
36
+
37
+ }
38
+
39
+
40
+
41
+ public function withdraw_methods(){
42
+
43
+ $methods = array(
44
+ 'bank_transfer_withdraw' => array(
45
+ 'method_name' => __('Bank Transfer', 'tutor'),
46
+ 'desc' => __('Get your payment directly into your bank account', 'tutor'),
47
+
48
+ 'admin_form_fields' => array(
49
+ 'instruction' => array(
50
+ 'type' => 'textarea',
51
+ 'label' => __('Instruction', 'tutor'),
52
+ 'desc' => __('Write instruction for the instructor to fill bank information', 'tutor'),
53
+ ),
54
+ ),
55
+
56
+ 'form_fields' => array(
57
+ 'account_name' => array(
58
+ 'type' => 'text',
59
+ 'label' => __('Account Name', 'tutor'),
60
+ ),
61
+
62
+ 'account_number' => array(
63
+ 'type' => 'text',
64
+ 'label' => __('Account Number', 'tutor'),
65
+ ),
66
+
67
+ 'bank_name' => array(
68
+ 'type' => 'text',
69
+ 'label' => __('Bank Name', 'tutor'),
70
+ ),
71
+ 'iban' => array(
72
+ 'type' => 'text',
73
+ 'label' => __('IBAN', 'tutor'),
74
+ ),
75
+ 'swift' => array(
76
+ 'type' => 'text',
77
+ 'label' => __('BIC / SWIFT', 'tutor'),
78
+ ),
79
+
80
+ ),
81
+ ),
82
+
83
+ 'echeck_withdraw' => array(
84
+ 'method_name' => __('ECHECK', 'tutor'),
85
+
86
+ 'form_fields' => array(
87
+ 'bank_name' => array(
88
+ 'type' => 'textarea',
89
+ 'label' => __('Your Physical Address', 'tutor'),
90
+ 'desc' => __('We will send you an ECHECK to this address directly.', 'tutor'),
91
+ ),
92
+
93
+ ),
94
+ ),
95
+
96
+ 'paypal_withdraw' => array(
97
+ 'method_name' => __('PayPal Payment', 'tutor'),
98
+
99
+ 'form_fields' => array(
100
+ 'bank_name' => array(
101
+ 'type' => 'email',
102
+ 'label' => __('PayPal E-Mail Address', 'tutor'),
103
+ 'desc' => __('Write your paypal email address to get payout directly to your paypal account', 'tutor'),
104
+ ),
105
+
106
+ ),
107
+ ),
108
+
109
+ );
110
+
111
+ $withdraw_methods = apply_filters('tutor_withdraw_methods', $methods);
112
+
113
+ return $withdraw_methods;
114
+ }
115
+
116
+ /**
117
+ * @return mixed|array
118
+ *
119
+ * Return only enabled methods
120
+ */
121
+ public function available_withdraw_methods(){
122
+ $withdraw_options = $this->get_options();
123
+ $methods = $this->withdraw_methods();
124
+
125
+ foreach ($methods as $method_id => $method){
126
+ $is_enable = (bool) tutor_utils()->avalue_dot($method_id.".enabled", $withdraw_options);
127
+
128
+ if ( ! $is_enable){
129
+ unset($methods[$method_id]);
130
+ }
131
+ }
132
+
133
+ return $methods;
134
+ }
135
+
136
+ public function get_options(){
137
+ return (array) maybe_unserialize(get_option('tutor_withdraw_options'));
138
+ }
139
+
140
+ public function withdraw_admin_options(){
141
+ include tutor()->path.'views/options/withdraw/withdraw_admin_options_generator.php';
142
+ }
143
+
144
+
145
+ /**
146
+ * Save Withdraw method
147
+ *
148
+ * @since v.1.2.0
149
+ */
150
+ public function withdraw_option_save(){
151
+
152
+ do_action('tutor_withdraw_options_save_before');
153
+
154
+ $option = (array) isset($_POST['tutor_withdraw_options']) ? $_POST['tutor_withdraw_options'] : array();
155
+ $option = apply_filters('tutor_withdraw_options_input', $option);
156
+ update_option('tutor_withdraw_options', $option);
157
+
158
+ do_action('tutor_withdraw_options_save_after');
159
+
160
+
161
+ }
162
+
163
+ /**
164
+ * Save Withdraw Method Data
165
+ *
166
+ * @since v.1.2.0
167
+ */
168
+
169
+ public function tutor_save_withdraw_account(){
170
+ //Checking nonce
171
+ tutor_utils()->checking_nonce();
172
+
173
+ $user_id = get_current_user_id();
174
+ $post = $_POST;
175
+
176
+ $method = tutor_utils()->avalue_dot('tutor_selected_withdraw_method', $post);
177
+ if ( ! $method){
178
+ wp_send_json_error();
179
+ }
180
+
181
+ $method_data = tutor_utils()->avalue_dot("withdraw_method_field.".$method, $post);
182
+ $available_withdraw_method = tutor_withdrawal_methods();
183
+
184
+ if (tutor_utils()->count($method_data)){
185
+ $saved_data = array();
186
+ $saved_data['withdraw_method_key'] = $method;
187
+ $saved_data['withdraw_method_name'] = tutor_utils()->avalue_dot($method.".method_name", $available_withdraw_method);
188
+
189
+ foreach ($method_data as $input_name => $value){
190
+ $saved_data[$input_name]['value'] = sanitize_text_field($value);
191
+ $saved_data[$input_name]['label'] = tutor_utils()->avalue_dot($method.".form_fields.{$input_name}.label", $available_withdraw_method);
192
+ }
193
+
194
+ update_user_meta($user_id, '_tutor_withdraw_method_data', $saved_data);
195
+ }
196
+
197
+ $msg = apply_filters('tutor_withdraw_method_set_success_msg', __('Withdraw account has been set successfully', 'tutor'));
198
+ wp_send_json_success(array('msg' => $msg ));
199
+ }
200
+
201
+ public function tutor_make_an_withdraw(){
202
+ global $wpdb;
203
+
204
+ //Checking nonce
205
+ tutor_utils()->checking_nonce();
206
+
207
+ do_action('tutor_withdraw_before');
208
+
209
+
210
+ $user_id = get_current_user_id();
211
+ $post = $_POST;
212
+
213
+ $withdraw_amount = sanitize_text_field(tutor_utils()->avalue_dot('tutor_withdraw_amount', $post));
214
+
215
+ $earning_sum = tutor_utils()->get_earning_sum();
216
+ $min_withdraw = tutor_utils()->get_option('min_withdraw_amount');
217
+
218
+ $saved_withdraw_account = tutor_utils()->get_user_withdraw_method();
219
+ $formatted_balance = tutor_utils()->tutor_price($earning_sum->balance);
220
+ $formatted_min_withdraw_amount = tutor_utils()->tutor_price($min_withdraw);
221
+
222
+
223
+ if ( ! tutor_utils()->count($saved_withdraw_account)){
224
+ $no_withdraw_method = apply_filters('tutor_no_withdraw_method_msg', __('Please save withdraw method ', 'tutor') );
225
+ wp_send_json_error(array('msg' => $no_withdraw_method ));
226
+ }
227
+
228
+ if ($withdraw_amount < $min_withdraw){
229
+ $required_min_withdraw = apply_filters('tutor_required_min_amount_msg', sprintf(__('Minimum withdraw amount is %s %s %s ', 'tutor') , '<strong>', $formatted_min_withdraw_amount, '</strong>' ) );
230
+ wp_send_json_error(array('msg' => $required_min_withdraw ));
231
+ }
232
+
233
+ if ($earning_sum->balance < $withdraw_amount){
234
+ $insufficient_balence = apply_filters('tutor_withdraw_insufficient_balance_msg', sprintf(__('Insufficient balance to withdraw, your balance is %s %s %s ', 'tutor'),'<strong>', $formatted_balance, '</strong>' ) );
235
+
236
+ wp_send_json_error(array('msg' => $insufficient_balence ));
237
+ }
238
+
239
+
240
+ $date = date("Y-m-d H:i:s");
241
+
242
+ $withdraw_data = apply_filters('tutor_pre_withdraw_data', array(
243
+ 'user_id' => $user_id,
244
+ 'amount' => $withdraw_amount,
245
+ 'method_data' => maybe_serialize($saved_withdraw_account),
246
+ 'status' => 'pending',
247
+ 'created_at' => $date,
248
+ ));
249
+
250
+ do_action('tutor_insert_withdraw_before', $withdraw_data);
251
+
252
+ $wpdb->insert($wpdb->prefix."tutor_withdraws", $withdraw_data);
253
+ $withdraw_id = $wpdb->insert_id;
254
+
255
+ do_action('tutor_insert_withdraw_after', $withdraw_id, $withdraw_data);
256
+
257
+
258
+ /**
259
+ * Getting earning and balance data again
260
+ */
261
+ $earning = tutor_utils()->get_earning_sum();
262
+ $new_available_balance = tutor_utils()->tutor_price($earning->balance);
263
+
264
+
265
+ do_action('tutor_withdraw_after');
266
+
267
+ $withdraw_successfull_msg = apply_filters('tutor_withdraw_successful_msg', __('Withdraw has been successful', 'tutor'));
268
+ wp_send_json_success(array('msg' => $withdraw_successfull_msg, 'available_balance' => $new_available_balance ));
269
+ }
270
+
271
+
272
+
273
+ }
classes/Withdraw_Requests_List.php ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace TUTOR;
3
+
4
+ if ( ! defined( 'ABSPATH' ) )
5
+ exit;
6
+
7
+ if (! class_exists('Tutor_List_Table')){
8
+ include_once tutor()->path.'classes/Tutor_List_Table.php';
9
+ }
10
+
11
+ class Withdraw_Requests_List extends \Tutor_List_Table {
12
+
13
+ function __construct(){
14
+ global $status, $page;
15
+
16
+ //Set parent defaults
17
+ parent::__construct( array(
18
+ 'singular' => 'withdraw', //singular name of the listed records
19
+ 'plural' => 'withdraw', //plural name of the listed records
20
+ 'ajax' => false //does this table support ajax?
21
+ ) );
22
+
23
+ $this->process_bulk_action();
24
+ }
25
+
26
+ function column_default($item, $column_name){
27
+ switch($column_name){
28
+ case 'testing_col':
29
+ return $item->$column_name;
30
+ default:
31
+ return print_r($item,true); //Show the whole array for troubleshooting purposes
32
+ }
33
+ }
34
+
35
+ function column_cb($item){
36
+ return sprintf(
37
+ '<input type="checkbox" name="%1$s[]" value="%2$s" />',
38
+ /*$1%s*/ $this->_args['singular'], //Let's simply repurpose the table's singular label ("student")
39
+ /*$2%s*/ $item->withdraw_id //The value of the checkbox should be the record's id
40
+ );
41
+ }
42
+
43
+ function column_requested_user($item){
44
+ echo "<p>{$item->user_name}</p><p>{$item->user_email}</p>";
45
+
46
+ $actions = array();
47
+ switch ($item->status){
48
+ case 'pending':
49
+ $actions['approved'] = sprintf('<a href="?page=%s&action=%s&withdraw_id=%s">Approve</a>',$_REQUEST['page'],'approved',
50
+ $item->withdraw_id);
51
+ $actions['rejected'] = sprintf('<a href="?page=%s&action=%s&withdraw_id=%s">Rejected</a>',$_REQUEST['page'],'rejected',$item->withdraw_id);
52
+ break;
53
+ case 'approved':
54
+ $actions['rejected'] = sprintf('<a href="?page=%s&action=%s&withdraw_id=%s">Rejected</a>',$_REQUEST['page'],'rejected',$item->withdraw_id);
55
+ break;
56
+ case 'rejected':
57
+ $actions['approved'] = sprintf('<a href="?page=%s&action=%s&withdraw_id=%s">Approve</a>',$_REQUEST['page'],'approved',$item->withdraw_id);
58
+ break;
59
+ }
60
+
61
+ $actions['delete'] = sprintf('<a href="?page=%s&action=%s&withdraw_id=%s" onclick="return confirm(\'Are you Sure? It can not be undone\')">Delete</a>',$_REQUEST['page'],'delete',
62
+ $item->withdraw_id);
63
+
64
+ return "<div class='withdraw-list-row-actions'>". $this->row_actions($actions)."</div>";
65
+ }
66
+ function column_withdraw_method($item){
67
+ if ($item->method_data){
68
+ $data = maybe_unserialize($item->method_data);
69
+
70
+ $method_name = tutor_utils()->avalue_dot('withdraw_method_name', $data);
71
+
72
+ if ($method_name){
73
+ echo "<p><strong>{$method_name}</strong></p>";
74
+ }
75
+
76
+ unset($data['withdraw_method_key'], $data['withdraw_method_name']);
77
+
78
+ if (tutor_utils()->count($data)){
79
+ foreach ($data as $method_field){
80
+ $label = tutor_utils()->avalue_dot('label', $method_field);
81
+ $value = tutor_utils()->avalue_dot('value', $method_field);
82
+ echo "<p class='withdraw-method-data-row'> <span class='withdraw-method-label'>{$label}</span> : <span class='withdraw-method-value'>{$value}</span> </p>";
83
+ }
84
+ }
85
+
86
+ }
87
+ return '';
88
+ }
89
+
90
+ function column_requested_at($item){
91
+ echo "<p>".date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime($item->created_at))."</p>";
92
+ }
93
+
94
+ function column_amount($item){
95
+ echo "<p>".tutor_utils()->tutor_price($item->amount)."</p>";
96
+ echo "<p><span class='withdraw-status withdraw-status-{$item->status}'>{$item->status}</span></p>";
97
+ }
98
+
99
+ function get_columns(){
100
+ $columns = array(
101
+ 'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
102
+ 'requested_user' => __('Requested User', 'tutor'),
103
+ 'amount' => __('Amount', 'tutor'),
104
+ 'withdraw_method' => __('Withdraw Method', 'tutor'),
105
+ 'requested_at' => __('Requested At', 'tutor'),
106
+ );
107
+ return $columns;
108
+ }
109
+
110
+ function get_bulk_actions() {
111
+ $actions = array(
112
+ //'delete' => 'Delete'
113
+ );
114
+ return $actions;
115
+ }
116
+
117
+ function process_bulk_action() {
118
+ global $wpdb;
119
+
120
+ $withdraw_page_url = admin_url('admin.php?page=tutor_withdraw_requests');
121
+ $date = date("Y-m-d H:i:s");
122
+ $redirect = false;
123
+
124
+ //Detect when a bulk action is being triggered...
125
+ if( 'delete'===$this->current_action() ) {
126
+ $should_withdraw_delete = apply_filters('tutor_should_withdraw_delete', true);
127
+
128
+ if ($should_withdraw_delete){
129
+ $withdraw_id = (int) sanitize_text_field($_GET['withdraw_id']);
130
+
131
+ do_action('tutor_before_delete_withdraw', $withdraw_id);
132
+
133
+ $wpdb->delete($wpdb->prefix."tutor_withdraws",array('withdraw_id' =>$withdraw_id));
134
+
135
+ do_action('tutor_after_delete_withdraw', $withdraw_id);
136
+
137
+ $redirect = true;
138
+ }else{
139
+ wp_die('Items deleted (or they would be if we had items to delete)!');
140
+ }
141
+ }
142
+
143
+
144
+ /**
145
+ * Reject Withdraw
146
+ */
147
+ if( 'approved' === $this->current_action() ) {
148
+ $withdraw_id = (int) sanitize_text_field($_GET['withdraw_id']);
149
+ $withdraw = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}tutor_withdraws WHERE withdraw_id = {$withdraw_id} ");
150
+ if ( ! $withdraw || $withdraw->status === 'approved'){
151
+ return;
152
+ }
153
+
154
+ do_action('tutor_before_approved_withdraw', $withdraw_id);
155
+
156
+ $wpdb->update($wpdb->prefix."tutor_withdraws", array('status' => 'approved', 'updated_at' => $date ), array('withdraw_id' =>$withdraw_id));
157
+
158
+ do_action('tutor_after_approved_withdraw', $withdraw_id);
159
+
160
+ $redirect = true;
161
+ }
162
+
163
+ /**
164
+ * Rejected
165
+ */
166
+ if( 'rejected' === $this->current_action() ) {
167
+ $withdraw_id = (int) sanitize_text_field($_GET['withdraw_id']);
168
+ $withdraw = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}tutor_withdraws WHERE withdraw_id = {$withdraw_id} ");
169
+ if ( ! $withdraw || $withdraw->status === 'rejected'){
170
+ return;
171
+ }
172
+
173
+ do_action('tutor_before_rejected_withdraw', $withdraw_id);
174
+
175
+ $wpdb->update($wpdb->prefix."tutor_withdraws", array('status' => 'rejected', 'updated_at' => $date ), array('withdraw_id' =>$withdraw_id));
176
+
177
+ do_action('tutor_after_rejected_withdraw', $withdraw_id);
178
+
179
+ $redirect = true;
180
+ }
181
+
182
+
183
+ if ($redirect){
184
+ die("<script>location.href='{$withdraw_page_url}';</script>");
185
+ }
186
+ }
187
+
188
+ function prepare_items() {
189
+ $per_page = 20;
190
+
191
+ $search_term = '';
192
+ if (isset($_REQUEST['s'])){
193
+ $search_term = sanitize_text_field($_REQUEST['s']);
194
+ }
195
+
196
+ $columns = $this->get_columns();
197
+ $hidden = array();
198
+
199
+ $this->_column_headers = array($columns, $hidden);
200
+ $current_page = $this->get_pagenum();
201
+
202
+ $start = ($current_page-1)*$per_page;
203
+ $withdraw_requests = tutor_utils()->get_withdrawals_history(null, compact('start', 'per_page', 'search_term') );
204
+ $this->items = $withdraw_requests->results;
205
+ $count_result = $withdraw_requests->count;
206
+
207
+ $this->set_pagination_args( array(
208
+ 'total_items' => $count_result,
209
+ 'per_page' => $per_page,
210
+ 'total_pages' => ceil($count_result/$per_page)
211
+ ) );
212
+ }
213
+ }
classes/WooCommerce.php CHANGED
@@ -37,10 +37,8 @@ class WooCommerce extends Tutor_Base {
37
  add_action('save_post_product', array($this, 'save_wc_product_meta'));
38
 
39
  add_action('tutor_course/single/before/enroll', 'wc_print_notices');
40
-
41
  add_action('woocommerce_new_order_item', array($this, 'course_placing_order'), 10, 3);
42
 
43
-
44
  /**
45
  * Order Status Hook
46
  *
@@ -48,6 +46,12 @@ class WooCommerce extends Tutor_Base {
48
  */
49
  add_action( 'woocommerce_order_status_changed', array( $this, 'enrolled_courses_status_change' ), 10, 3 );
50
 
 
 
 
 
 
 
51
  }
52
 
53
  public function notice_before_option(){
@@ -96,9 +100,9 @@ class WooCommerce extends Tutor_Base {
96
  if ($product) {
97
  ob_start();
98
  ?>
99
- <p class="price">
100
  <?php echo $product->get_price_html(); ?>
101
- </p>
102
  <?php
103
  return ob_get_clean();
104
  }
@@ -158,7 +162,6 @@ class WooCommerce extends Tutor_Base {
158
  /**
159
  * Do something after course order place
160
  */
161
-
162
  public function course_placing_order( $item_id, $item, $order_id){
163
  $item = new \WC_Order_Item_Product($item);
164
 
@@ -211,8 +214,8 @@ class WooCommerce extends Tutor_Base {
211
  $course_enrolled_by_order = array();
212
  foreach ($courses_ids as $courses_id){
213
  $course_id = str_replace('_tutor_order_for_course_id_', '',$courses_id->meta_key);
214
- //array(order_id => array('course_id' => $course_id, 'enrolled_id' => enrolled_id))
215
- $course_enrolled_by_order[$courses_id->post_id] = array('course_id' => $course_id, 'enrolled_id' => $courses_id->meta_value);
216
  }
217
  return $course_enrolled_by_order;
218
  }
@@ -263,5 +266,118 @@ class WooCommerce extends Tutor_Base {
263
  return $attr;
264
  }
265
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
 
267
  }
37
  add_action('save_post_product', array($this, 'save_wc_product_meta'));
38
 
39
  add_action('tutor_course/single/before/enroll', 'wc_print_notices');
 
40
  add_action('woocommerce_new_order_item', array($this, 'course_placing_order'), 10, 3);
41
 
 
42
  /**
43
  * Order Status Hook
44
  *
46
  */
47
  add_action( 'woocommerce_order_status_changed', array( $this, 'enrolled_courses_status_change' ), 10, 3 );
48
 
49
+ /**
50
+ * Add Earning Data
51
+ */
52
+ add_action('woocommerce_new_order_item', array($this, 'add_earning_data'), 10, 3);
53
+ add_action( 'woocommerce_order_status_changed', array( $this, 'add_earning_data_status_change' ), 10, 3 );
54
+
55
  }
56
 
57
  public function notice_before_option(){
100
  if ($product) {
101
  ob_start();
102
  ?>
103
+ <div class="price">
104
  <?php echo $product->get_price_html(); ?>
105
+ </div>
106
  <?php
107
  return ob_get_clean();
108
  }
162
  /**
163
  * Do something after course order place
164
  */
 
165
  public function course_placing_order( $item_id, $item, $order_id){
166
  $item = new \WC_Order_Item_Product($item);
167
 
214
  $course_enrolled_by_order = array();
215
  foreach ($courses_ids as $courses_id){
216
  $course_id = str_replace('_tutor_order_for_course_id_', '',$courses_id->meta_key);
217
+ //array(order_id => array('course_id' => $course_id, 'enrolled_id' => enrolled_id, 'order_id' => $courses_id->post_id))
218
+ $course_enrolled_by_order[] = array('course_id' => $course_id, 'enrolled_id' => $courses_id->meta_value, 'order_id' => $courses_id->post_id );
219
  }
220
  return $course_enrolled_by_order;
221
  }
266
  return $attr;
267
  }
268
 
269
+ /**
270
+ * @param $item_id
271
+ * @param $item
272
+ * @param $order_id
273
+ *
274
+ * Adding Earning Data processing WooCommerce
275
+ *
276
+ * @since v.1.1.2
277
+ */
278
+ public function add_earning_data( $item_id, $item, $order_id){
279
+ global $wpdb;
280
+ $item = new \WC_Order_Item_Product($item);
281
+
282
+ $product_id = $item->get_product_id();
283
+ $if_has_course = tutor_utils()->product_belongs_with_course($product_id);
284
+
285
+ if ($if_has_course){
286
+
287
+ $enable_tutor_earning = tutor_utils()->get_option('enable_tutor_earning');
288
+ if ( ! $enable_tutor_earning){
289
+ return;
290
+ }
291
+
292
+ $course_id = $if_has_course->post_id;
293
+ $user_id = $wpdb->get_var("SELECT post_author FROM {$wpdb->posts} WHERE ID = {$course_id} ");
294
+ $order_status = $wpdb->get_var("SELECT post_status from {$wpdb->posts} where ID = {$order_id} ");
295
+
296
+ $total_price = $item->get_total();
297
+
298
+ $fees_deduct_data = array();
299
+ $tutor_earning_fees = tutor_utils()->get_option('tutor_earning_fees');
300
+ $enable_fees_deducting = tutor_utils()->avalue_dot('enable_fees_deducting', $tutor_earning_fees);
301
+
302
+ $course_price_grand_total = $total_price;
303
+
304
+ if ($enable_fees_deducting){
305
+ $fees_name = tutor_utils()->avalue_dot('fees_name', $tutor_earning_fees);
306
+ $fees_amount = tutor_utils()->avalue_dot('fees_amount', $tutor_earning_fees);
307
+ $fees_type = tutor_utils()->avalue_dot('fees_type', $tutor_earning_fees);
308
+
309
+ if ($fees_amount > 0) {
310
+ if ( $fees_type === 'percent' ) {
311
+ $course_price_grand_total = ( $total_price * $fees_amount ) / 100;
312
+ }
313
+ if ( $fees_type === 'fixed' ) {
314
+ $course_price_grand_total = $total_price - $fees_amount;
315
+ }
316
+ }
317
+
318
+ $fees_deduct_data = array(
319
+ 'deduct_fees_amount' => $fees_amount,
320
+ 'deduct_fees_name' => $fees_name,
321
+ 'deduct_fees_type' => $fees_type,
322
+ );
323
+ }
324
+
325
+ $instructor_rate = tutor_utils()->get_option('earning_instructor_commission');
326
+ $admin_rate = tutor_utils()->get_option('earning_admin_commission');
327
+
328
+ $instructor_amount = 0;
329
+ if ($instructor_rate > 0){
330
+ $instructor_amount = ($course_price_grand_total * $instructor_rate) / 100;
331
+ }
332
+
333
+ $admin_amount = 0;
334
+ if ($admin_rate > 0){
335
+ $admin_amount = ($course_price_grand_total * $admin_rate) / 100;
336
+ }
337
+
338
+ $earning_data = array(
339
+ 'user_id' => $user_id,
340
+ 'course_id' => $course_id,
341
+ 'order_id' => $order_id,
342
+ 'order_status' => $order_status,
343
+ 'course_price_total' => $total_price,
344
+ 'course_price_grand_total' => $course_price_grand_total,
345
+
346
+ 'instructor_amount' => $instructor_amount,
347
+ 'instructor_rate' => $instructor_rate,
348
+ 'admin_amount' => $admin_amount,
349
+ 'admin_rate' => $admin_rate,
350
+
351
+ 'commission_type' => 'percent',
352
+ 'process_by' => 'woocommerce',
353
+ 'created_at' => date( 'Y-m-d H:i:s'),
354
+ );
355
+ $earning_data = apply_filters('tutor_new_earning_data', array_merge($earning_data, $fees_deduct_data));
356
+
357
+ $wpdb->insert($wpdb->prefix.'tutor_earnings', $earning_data);
358
+ }
359
+ }
360
+
361
+
362
+ /**
363
+ * @param $order_id
364
+ * @param $status_from
365
+ * @param $status_to
366
+ *
367
+ * Change Earning data status
368
+ *
369
+ * @since v.1.1.2
370
+ */
371
+ public function add_earning_data_status_change($order_id, $status_from, $status_to){
372
+ if ( ! tutor_utils()->is_tutor_order($order_id)){
373
+ return;
374
+ }
375
+ global $wpdb;
376
+
377
+ $is_earning_data = (int) $wpdb->get_var("SELECT COUNT(earning_id) FROM {$wpdb->prefix}tutor_earnings WHERE order_id = {$order_id} ");
378
+ if ($is_earning_data){
379
+ $wpdb->update( $wpdb->prefix.'tutor_earnings', array( 'order_status' => $status_to ), array( 'order_id' => $order_id ) );
380
+ }
381
+ }
382
 
383
  }
includes/theme-compatibility/storefront/assets/css/style.css CHANGED
@@ -1,4 +1,4 @@
1
- #content .col-full{
2
  width: 100%;
3
  max-width: 100%;
4
  padding: 0;
1
+ body.single-lesson #content .col-full{
2
  width: 100%;
3
  max-width: 100%;
4
  padding: 0;
includes/tutor-general-functions.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) )
4
+ exit;
5
+
6
+ /**
7
+ * Tutor general Functions
8
+ */
9
+
10
+
11
+ if ( ! function_exists('tutor_withdrawal_methods')){
12
+ function tutor_withdrawal_methods(){
13
+ $withdraw = new \TUTOR\Withdraw();
14
+
15
+ return $withdraw->available_withdraw_methods;
16
+ }
17
+ }
includes/tutor-template-functions.php CHANGED
@@ -37,13 +37,20 @@ if ( ! function_exists('tutor_get_template')) {
37
  /**
38
  * @param null $template
39
  *
 
 
40
  * Load template for TUTOR
41
  *
42
  * @since v.1.0.0
 
 
43
  */
44
 
45
  if ( ! function_exists('tutor_load_template')) {
46
- function tutor_load_template( $template = null ) {
 
 
 
47
  include tutor_get_template( $template );
48
  }
49
  }
@@ -264,7 +271,7 @@ if ( ! function_exists('get_tutor_course_thumbnail')) {
264
  if ($url){
265
  return $placeHolderUrl;
266
  }
267
- $html = '<img src="' . $placeHolderUrl . '" />';
268
  }
269
 
270
  echo $html;
37
  /**
38
  * @param null $template
39
  *
40
+ * @param array $variables
41
+ *
42
  * Load template for TUTOR
43
  *
44
  * @since v.1.0.0
45
+ *
46
+ * @updated v.1.1.2
47
  */
48
 
49
  if ( ! function_exists('tutor_load_template')) {
50
+ function tutor_load_template( $template = null, $variables = array() ) {
51
+ $variables = (array) $variables;
52
+ extract($variables);
53
+
54
  include tutor_get_template( $template );
55
  }
56
  }
271
  if ($url){
272
  return $placeHolderUrl;
273
  }
274
+ $html = sprintf('<img alt="%s" src="' . $placeHolderUrl . '" />', __('Placeholder', 'tutor'));
275
  }
276
 
277
  echo $html;
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
- === Tutor - Ultimate WordPress LMS plugin ===
2
  Contributors: themeum
3
  Donate link: https://www.themeum.com
4
- Tags: lms, education, wp-lms, education management system
5
  Requires at least: 4.5
6
  Tested up to: 5.1
7
  Requires PHP: 5.4.0
8
- Stable tag: 1.1.1
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -19,10 +19,12 @@ Tutor LMS is a completely free plugin with premium high quality addons that you
19
 
20
  Get Tutor, the most advanced and powerful WordPress online course plugin.
21
 
22
- [youtube https://www.youtube.com/watch?v=yo47fDYIGQo]
23
 
24
  Create, customize, manage, and sell online courses by building a functional e-learning website with this free LMS plugin for WordPress.
25
 
 
 
26
  = Features =
27
 
28
  Here are the most notable features of Tutor LMS plugin. If you need any further information, please feel free to contact us. Below are the best offerings of Tutor LMS.
@@ -49,6 +51,18 @@ Here are the most notable features of Tutor LMS plugin. If you need any further
49
  * Gutenberg compatible
50
  * Content Security
51
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  = Intuitive Course Builder =
53
  Create courses with their details like videos, attachments, excerpt, additional data, benefit of the course, requirement, topic, summary, announcement, and video banners. Have lessons under course and attach video and other attachments to each lesson. Tutor, the advanced WordPress LMS plugin lets you present courses on an intuitive user interface with all required options to offer a top-notch learning system.
54
 
@@ -73,15 +87,20 @@ Engage your students by uploading multimedia lessons in versatile video sources
73
  = Question Patterns =
74
  With this free LMS plugin for WordPress, you create questions that are supposed to be added to the Quizzes. Create questions by defining question type (True/False, Multiple Choice, Single Choice), marks for each question (if answered right), answer type, descriptions and answer hints for the students to attempt the right answer.
75
 
76
- = Student forum =
77
 
78
  Students can submit questions about courses before enrolling from their respective profiles. This useful feature in the WordPress LMS plugin encourages student interactions and helps boost conversion rates.
79
 
80
  = Email Notifications =
81
  Sending emails to students and teachers has been made automated in Tutor. You can send course enrollment, course completion, and quiz completion email to both students and teachers automatically.
82
 
83
- = WooCommerce Integration to Sell Course =
84
- Being integrated with WooCommerce, Tutor, the WordPress LMS plugin offers eCommerce functionalities and enables you to sell courses on your website.
 
 
 
 
 
85
 
86
  = Gutenberg Compatible =
87
 
@@ -91,7 +110,7 @@ Create online courses with the new Gutenberg editor without facing any issues wh
91
 
92
  Have the most secured learning management system when creating your online courses. Third parties cannot view the videos with the URL. It ensures that only enrolled students can have access to course videos.
93
 
94
- == UPCOMING PREMIUM FEATURE FOR TUTOR ==
95
 
96
  - **Tutor Report:** Get powerful stats for a complete analysis of which courses are performing great with students and judge individual course popularity. Monitor reviews with this WordPress LMS plugin and manually change quiz grades right from the panel.
97
 
@@ -101,15 +120,19 @@ Have the most secured learning management system when creating your online cours
101
 
102
  - **Tutor Course Preview:** Unlock a few courses for students to try out before they enroll in a lesson. This boosts conversion rates and allows target students to get the feel of the lessons.
103
 
104
- - **Tutor EDD:** Sell courses with this popular shopping cart addon with Tutor WordPress LMS plugin.
105
-
106
  - **Tutor Course Attachment:** Include all the class materials in pdf, doc, etc. format for students to download. Attach lesson files, course outlines and every other information as an attachment with Tutor.
107
 
108
  - **Tutor Multi Instructors:** Add as many instructors as you want to individual courses. Enhance course experience of students by having the option to have a great lineup of teachers.
109
 
110
  - **Tutor Prerequisites:** Define a certain set of courses that students need to complete before enrolling for a new course.
111
 
112
- - **Tutor WooCommerce:** Integrate your learning management system with the renowned WooCommerce addon. Sell your courses seamlessly with multiple payment gateways supported by WooCommerce.
 
 
 
 
 
 
113
 
114
  Looking for the best LMS for WordPress? Get Tutor and start your e-learning website immediately.
115
 
@@ -142,10 +165,18 @@ Yes. Tutor can be used with your existing theme or any theme you wish to use it
142
 
143
  For a detailed guideline on how to build a Learning Management system, refer to our user documentation on the Themeum site.
144
 
 
 
 
 
145
  = Is this plugin free? =
146
 
147
  This WordPress course plugin has two versions. One is free and another is paid. The paid version has more advanced features which are not accessible in this free version. Click here to get the paid version.
148
 
 
 
 
 
149
  = Is Tutor LMS device friendly? =
150
 
151
  If you’re using a responsive theme, then Tutor LMS will look great across all devices.
@@ -154,14 +185,6 @@ If you’re using a responsive theme, then Tutor LMS will look great across all
154
 
155
  Tutor enables you to use any third party plugins without facing any compatibility issues. You can integrate Tutor easily in your existing site without any trouble.
156
 
157
- = Where can I get support? =
158
-
159
- You can get support by posting your issues on the support section of this plugin on WordPress plugins directory or directly place your question to Themeum Forums.
160
-
161
- = Where can I report a bug? =
162
-
163
- This is an alpha version of Tutor, as bugs and issues expected, if you found any bugs or issues, please let us know by posting on the support section of this plugin on WordPress plugin directory or directly on our support forums: https://www.themeum.com/support/ 🙂
164
-
165
  == Screenshots ==
166
 
167
  1. Course list
@@ -183,6 +206,21 @@ This is an alpha version of Tutor, as bugs and issues expected, if you found any
183
 
184
  == Changelog ==
185
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  = 1.1.1 - 29 March, 2019 =
187
 
188
  * Fixed: quiz builder init sortable question types on load quiz via $.ajax();
1
+ === Tutor LMS - eLearning and online course solution ===
2
  Contributors: themeum
3
  Donate link: https://www.themeum.com
4
+ Tags: lms, course, elearning, education, quiz, training, sell courses, courses, e-Learning, learning, learning management system, WordPress LMS
5
  Requires at least: 4.5
6
  Tested up to: 5.1
7
  Requires PHP: 5.4.0
8
+ Stable tag: 1.2.0
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
19
 
20
  Get Tutor, the most advanced and powerful WordPress online course plugin.
21
 
22
+ [youtube https://www.youtube.com/watch?v=yGDwk4z9EEg]
23
 
24
  Create, customize, manage, and sell online courses by building a functional e-learning website with this free LMS plugin for WordPress.
25
 
26
+ [Live Demo](https://demo.themeum.com/plugins/tutor/) || [Documentation](https://www.themeum.com/docs/tutor-introduction/) || [Tutor LMS Pro](https://www.themeum.com/product/tutor-lms/)
27
+
28
  = Features =
29
 
30
  Here are the most notable features of Tutor LMS plugin. If you need any further information, please feel free to contact us. Below are the best offerings of Tutor LMS.
51
  * Gutenberg compatible
52
  * Content Security
53
 
54
+ = Tutor LMS applications =
55
+
56
+ Tutor LMS can be used by anyone looking to create a full-fledged learning management system. Some of the great applications of Tutor LMS include the following.
57
+
58
+ * Blended learning
59
+ * Community education
60
+ * Online classroom
61
+ * Training courses
62
+ * Professional continuing education
63
+
64
+ These are just a few possibilities that Tutor LMS opens up for its users. There’s a whole new world of intuitive learning that’s yet to discover using this online course plugin.
65
+
66
  = Intuitive Course Builder =
67
  Create courses with their details like videos, attachments, excerpt, additional data, benefit of the course, requirement, topic, summary, announcement, and video banners. Have lessons under course and attach video and other attachments to each lesson. Tutor, the advanced WordPress LMS plugin lets you present courses on an intuitive user interface with all required options to offer a top-notch learning system.
68
 
87
  = Question Patterns =
88
  With this free LMS plugin for WordPress, you create questions that are supposed to be added to the Quizzes. Create questions by defining question type (True/False, Multiple Choice, Single Choice), marks for each question (if answered right), answer type, descriptions and answer hints for the students to attempt the right answer.
89
 
90
+ = Student Question and Answers =
91
 
92
  Students can submit questions about courses before enrolling from their respective profiles. This useful feature in the WordPress LMS plugin encourages student interactions and helps boost conversion rates.
93
 
94
  = Email Notifications =
95
  Sending emails to students and teachers has been made automated in Tutor. You can send course enrollment, course completion, and quiz completion email to both students and teachers automatically.
96
 
97
+
98
+ = POWER OF WOOCOMMERCE =
99
+ Being integrated with WooCommerce, Tutor, the WordPress LMS plugin offers eCommerce functionalities and enables you to sell courses on your website. You can see sales data, completed and pending orders for your courses from WooCommerce reports. If you want to issue discount coupons or PDF invoice, that too is possible. You can use any WooCommerce addon to monitor and improve your sales and marketing.
100
+
101
+ = Easy Digital Downloads Integration to monetize courses =
102
+
103
+ Integrate your learning management system with the renowned EDD plugin. Sell your courses seamlessly with multiple payment gateways supported by EDD.
104
 
105
  = Gutenberg Compatible =
106
 
110
 
111
  Have the most secured learning management system when creating your online courses. Third parties cannot view the videos with the URL. It ensures that only enrolled students can have access to course videos.
112
 
113
+ == PREMIUM FEATURE FOR TUTOR ==
114
 
115
  - **Tutor Report:** Get powerful stats for a complete analysis of which courses are performing great with students and judge individual course popularity. Monitor reviews with this WordPress LMS plugin and manually change quiz grades right from the panel.
116
 
120
 
121
  - **Tutor Course Preview:** Unlock a few courses for students to try out before they enroll in a lesson. This boosts conversion rates and allows target students to get the feel of the lessons.
122
 
 
 
123
  - **Tutor Course Attachment:** Include all the class materials in pdf, doc, etc. format for students to download. Attach lesson files, course outlines and every other information as an attachment with Tutor.
124
 
125
  - **Tutor Multi Instructors:** Add as many instructors as you want to individual courses. Enhance course experience of students by having the option to have a great lineup of teachers.
126
 
127
  - **Tutor Prerequisites:** Define a certain set of courses that students need to complete before enrolling for a new course.
128
 
129
+ - **5 Pro Question Patterns:**
130
+
131
+ * Short Answer
132
+ * Matching
133
+ * Image Matching
134
+ * Image Answering
135
+ * Ordering
136
 
137
  Looking for the best LMS for WordPress? Get Tutor and start your e-learning website immediately.
138
 
165
 
166
  For a detailed guideline on how to build a Learning Management system, refer to our user documentation on the Themeum site.
167
 
168
+ = Where can I report a bug? =
169
+
170
+ This is an alpha version of Tutor, as bugs and issues expected, if you found any bugs or issues, please let us know by posting on the support section of this plugin on WordPress plugin directory or directly on our support forums: https://www.themeum.com/support/ 🙂
171
+
172
  = Is this plugin free? =
173
 
174
  This WordPress course plugin has two versions. One is free and another is paid. The paid version has more advanced features which are not accessible in this free version. Click here to get the paid version.
175
 
176
+ = Where can I get support? =
177
+
178
+ You can get support by posting your issues on the support section of this plugin on WordPress plugins directory or directly place your question to Themeum Forums.
179
+
180
  = Is Tutor LMS device friendly? =
181
 
182
  If you’re using a responsive theme, then Tutor LMS will look great across all devices.
185
 
186
  Tutor enables you to use any third party plugins without facing any compatibility issues. You can integrate Tutor easily in your existing site without any trouble.
187
 
 
 
 
 
 
 
 
 
188
  == Screenshots ==
189
 
190
  1. Course list
206
 
207
  == Changelog ==
208
 
209
+ = 1.2.0 - 19 April, 2019 =
210
+
211
+ * Added: Earning calculation, report, statements at front dashboard
212
+ * Added: multiple withdraw method with development support, withdraw confirmation, approved, reject from admin
213
+ * Added: database table , `{$wpdb->prefix}tutor_earnings`, `{$wpdb->prefix}tutor_withdraws`
214
+ * Added: RTL CSS support
215
+ * Added: Footer text only on Tutor LMS pages in admin dashboard
216
+ * Added: a default parameter of $instructor_id = 0 on `tutor_utils()->get_courses_by_instructor()`
217
+ * Added: second parameter `$post_status = 'publish'` on `tutor_utils()->get_courses_by_instructor()`, `$post_status = 'any'` will be return any type of course belongs with current or given user id
218
+ * Fixed: Storefront theme compatibility container width
219
+ * Fixed: Available Instructors Display on the Course edit page
220
+ * Fixed: muiltiple course order issue by WooCommerce
221
+ * Fixed: Another author post edit prevented by Tutor
222
+ * Changed: Student dashboard to Tutor Dashboard, shortcode, templates, url
223
+
224
  = 1.1.1 - 29 March, 2019 =
225
 
226
  * Fixed: quiz builder init sortable question types on load quiz via $.ajax();
templates/dashboard.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for displaying student Public Profile
4
+ *
5
+ * @since v.1.0.0
6
+ *
7
+ * @author Themeum
8
+ * @url https://themeum.com
9
+ */
10
+
11
+ get_header();
12
+
13
+
14
+ global $wp_query;
15
+
16
+ $dashboard_page_slug = '';
17
+ $dashboard_page_name = '';
18
+ if (isset($wp_query->query_vars['tutor_dashboard_page']) && $wp_query->query_vars['tutor_dashboard_page']) {
19
+ $dashboard_page_slug = $wp_query->query_vars['tutor_dashboard_page'];
20
+ $dashboard_page_name = $wp_query->query_vars['tutor_dashboard_page'];
21
+ }
22
+ /**
23
+ * Getting dashboard sum pages
24
+ */
25
+ if (isset($wp_query->query_vars['tutor_dashboard_sub_page']) && $wp_query->query_vars['tutor_dashboard_sub_page']) {
26
+ $dashboard_page_name = $wp_query->query_vars['tutor_dashboard_sub_page'];
27
+ if ($dashboard_page_slug){
28
+ $dashboard_page_name = $dashboard_page_slug.'/'.$dashboard_page_name;
29
+ }
30
+ }
31
+
32
+ $user_id = get_current_user_id();
33
+ $user = get_user_by('ID', $user_id);
34
+
35
+ do_action('tutor_dashboard/before/wrap'); ?>
36
+
37
+ <div class="tutor-wrap tutor-dashboard tutor-dashboard-student">
38
+ <div class="tutor-container">
39
+
40
+
41
+ <div class="tutor-row">
42
+ <div class="tutor-col-12">
43
+ <div class="tutor-dashboard-header-wrap">
44
+ <div class="tutor-wrap tutor-dashboard-header">
45
+
46
+ <div class="tutor-dashboard-header-avatar">
47
+ <a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink(); ?>">
48
+ <img src="<?php echo get_avatar_url($user_id); ?>" />
49
+ </a>
50
+ </div>
51
+
52
+ <div class="tutor-dashboard-header-info">
53
+
54
+ <div class="tutor-dashboard-header-display-name">
55
+ <h4><?php _e('Howdy,', 'tutor'); ?> <strong><?php echo $user->display_name; ?></strong> </h4>
56
+ </div>
57
+
58
+ <!--
59
+ <div class="tutor-dashboard-header-stats">
60
+ <div class="tutor-dashboard-header-social-wrap">
61
+ <a href=""><i class="tutor-icon-facebook"></i> </a>
62
+ <a href=""><i class="tutor-icon-twitter"></i> </a>
63
+ <a href=""><i class="tutor-icon-youtube"></i> </a>
64
+ </div>
65
+ <div class="tutor-dashboard-header-ratings">
66
+ <?php
67
+ /* tutor_utils()->star_rating_generator('4.6');
68
+ */?>
69
+ <span>4.6</span>
70
+ <span> (<?php /*_e(sprintf('%d Ratings', 172), 'tutor') */?>) </span>
71
+ </div>
72
+ <div class="tutor-dashboard-header-notifications">
73
+ <p class="tutor-notification-text"><?php /*_e('Notification'); */?> <span>9</span> </p>
74
+ </div>
75
+ </div>-->
76
+
77
+ </div>
78
+
79
+ </div>
80
+
81
+ </div>
82
+
83
+ </div>
84
+ </div>
85
+
86
+
87
+ <div class="tutor-row">
88
+ <div class="tutor-col-3 tutor-dashboard-left-menu">
89
+ <ul class="tutor-dashboard-permalinks">
90
+ <?php
91
+ $dashboard_pages = tutor_utils()->tutor_dashboard_pages();
92
+ foreach ($dashboard_pages as $dashboard_key => $dashboard_page){
93
+ $li_class = "tutor-dashboard-menu-{$dashboard_key}";
94
+ if ($dashboard_key === 'index')
95
+ $dashboard_key = '';
96
+ $active_class = $dashboard_key == $dashboard_page_slug ? 'active' : '';
97
+ echo "<li class='{$li_class} {$active_class}'><a href='".tutor_utils()->get_tutor_dashboard_page_permalink($dashboard_key)."'> {$dashboard_page} </a> </li>";
98
+ }
99
+ ?>
100
+ </ul>
101
+ </div>
102
+
103
+ <div class="tutor-col-9">
104
+ <div class="tutor-dashboard-content">
105
+ <?php
106
+ if ($dashboard_page_name){
107
+ tutor_load_template("dashboard.".$dashboard_page_name);
108
+ }else{
109
+ tutor_load_template("dashboard.dashboard");
110
+ }
111
+ ?>
112
+ </div>
113
+ </div>
114
+ </div>
115
+ </div>
116
+
117
+ </div>
118
+
119
+
120
+
121
+
122
+
123
+ <?php do_action('tutor_dashboard/after/wrap'); ?>
124
+
125
+ <?php
126
+ get_footer();
templates/dashboard/{student/dashboard.php → dashboard.php} RENAMED
File without changes
templates/dashboard/earning.php ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for displaying instructors earnings
4
+ *
5
+ * @since v.1.1.2
6
+ *
7
+ * @author Themeum
8
+ * @url https://themeum.com
9
+ */
10
+
11
+ global $wpdb;
12
+
13
+ $instructor_id = get_current_user_id();
14
+
15
+ $earning_sum = tutor_utils()->get_earning_sum();
16
+ if ( ! $earning_sum){
17
+ echo '<p>'.__('No Earning info available', 'tutor' ).'</p>';
18
+ return;
19
+ }
20
+
21
+ $user_id = get_current_user_id();
22
+ $complete_status = tutor_utils()->get_earnings_completed_statuses();
23
+ $complete_status = "'".implode("','", $complete_status)."'";
24
+
25
+ /**
26
+ * Getting the last week
27
+ */
28
+ $start_date = date("Y-m-01");
29
+ $end_date = date("Y-m-t");
30
+
31
+ /**
32
+ * Format Date Name
33
+ */
34
+ $begin = new DateTime($start_date);
35
+ $end = new DateTime($end_date.' + 1 day');
36
+ $interval = DateInterval::createFromDateString('1 day');
37
+ $period = new DatePeriod($begin, $interval, $end);
38
+
39
+ $datesPeriod = array();
40
+ foreach ($period as $dt) {
41
+ $datesPeriod[$dt->format("Y-m-d")] = 0;
42
+ }
43
+
44
+ /**
45
+ * Query This Month
46
+ */
47
+
48
+ $salesQuery = $wpdb->get_results( "
49
+ SELECT SUM(instructor_amount) as total_earning,
50
+ DATE(created_at) as date_format
51
+ from {$wpdb->prefix}tutor_earnings
52
+ WHERE user_id = {$user_id} AND order_status IN({$complete_status})
53
+ AND (created_at BETWEEN '{$start_date}' AND '{$end_date}')
54
+ GROUP BY date_format
55
+ ORDER BY created_at ASC ;");
56
+
57
+ $total_earning = wp_list_pluck($salesQuery, 'total_earning');
58
+ $queried_date = wp_list_pluck($salesQuery, 'date_format');
59
+ $dateWiseSales = array_combine($queried_date, $total_earning);
60
+
61
+ $chartData = array_merge($datesPeriod, $dateWiseSales);
62
+ foreach ($chartData as $key => $salesCount){
63
+ unset($chartData[$key]);
64
+ $formatDate = date('d M', strtotime($key));
65
+ $chartData[$formatDate] = $salesCount;
66
+ }
67
+
68
+ ?>
69
+
70
+
71
+ <div class="tutor-dashboard-content-inner">
72
+
73
+ <div class="tutor-dashboard-inline-links">
74
+ <ul>
75
+ <li class="active"><a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('earning'); ?>"> <?php _e('Earning'); ?></a>
76
+ </li>
77
+ <li><a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('earning/report'); ?>"> <?php _e('Report'); ?> </a>
78
+ </li>
79
+ <li><a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('earning/statements'); ?>">
80
+ <?php _e('Statements'); ?> </a> </li>
81
+ </ul>
82
+ </div>
83
+
84
+
85
+ <div class="tutor-dashboard-earning-info-row">
86
+
87
+ <div class="tutor-dashboard-earning-sum">
88
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->balance); ?></h3>
89
+ <p><?php _e('My Balance', 'tutor'); ?></p>
90
+ </div>
91
+
92
+ <div class="tutor-dashboard-earning-sum">
93
+
94
+
95
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->instructor_amount); ?></h3>
96
+ <p><?php _e('My Earning', 'tutor'); ?></p>
97
+ <p class="text-small"><?php _e('All time', 'tutor'); ?></p>
98
+ </div>
99
+
100
+ <div class="tutor-dashboard-earning-sum">
101
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->course_price_total); ?></h3>
102
+ <p><?php _e('All time sales.', 'tutor'); ?></p>
103
+ <p class="text-small"><?php _e('Based on course price.', 'tutor'); ?></p>
104
+ </div>
105
+
106
+ <div class="tutor-dashboard-earning-sum">
107
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->withdraws_amount); ?></h3>
108
+ <p><?php _e('All time withdraws.', 'tutor'); ?></p>
109
+ <p class="text-small"><?php _e('All of withdraw type excluding rejected.', 'tutor'); ?></p>
110
+ </div>
111
+
112
+ <div class="tutor-dashboard-earning-sum">
113
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->admin_amount); ?></h3>
114
+ <p><?php _e('Deducted Commissions', 'tutor'); ?></p>
115
+ </div>
116
+
117
+ <?php
118
+ if ($earning_sum->deduct_fees_amount > 0){
119
+ ?>
120
+ <div class="tutor-dashboard-earning-sum">
121
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->deduct_fees_amount); ?></h3>
122
+ <p><?php _e('Deducted Fees', 'tutor'); ?></p>
123
+ </div>
124
+ <?php } ?>
125
+ </div>
126
+
127
+ </div>
128
+
129
+ <h4>Earning Chart for this month (<?php echo date("F") ?>)</h4>
130
+
131
+ <canvas id="tutorChart" style="width: 100%; height: 400px;"></canvas>
132
+ <script>
133
+ var ctx = document.getElementById("tutorChart").getContext('2d');
134
+ var tutorChart = new Chart(ctx, {
135
+ type: 'line',
136
+ data: {
137
+ labels: <?php echo json_encode(array_keys($chartData)); ?>,
138
+ datasets: [{
139
+ label: 'Earning',
140
+ backgroundColor: '#3057D5',
141
+ borderColor: '#3057D5',
142
+ data: <?php echo json_encode(array_values($chartData)); ?>,
143
+ borderWidth: 2,
144
+ fill: false,
145
+ lineTension: 0,
146
+ }]
147
+ },
148
+ options: {
149
+ scales: {
150
+ yAxes: [{
151
+ ticks: {
152
+ min: 0, // it is for ignoring negative step.
153
+ beginAtZero: true,
154
+ callback: function(value, index, values) {
155
+ if (Math.floor(value) === value) {
156
+ return value;
157
+ }
158
+ }
159
+ }
160
+ }]
161
+ },
162
+
163
+ legend: {
164
+ display: false
165
+ }
166
+ }
167
+ });
168
+ </script>
templates/dashboard/earning/chart-body.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <canvas id="tutorChart" style="width: 100%; height: 400px;"></canvas>
3
+ <script>
4
+ var ctx = document.getElementById("tutorChart").getContext('2d');
5
+ var tutorChart = new Chart(ctx, {
6
+ type: 'line',
7
+ data: {
8
+ labels: <?php echo json_encode(array_keys($chartData)); ?>,
9
+ datasets: [{
10
+ label: 'Earning',
11
+ backgroundColor: '#3057D5',
12
+ borderColor: '#3057D5',
13
+ data: <?php echo json_encode(array_values($chartData)); ?>,
14
+ borderWidth: 2,
15
+ fill: false,
16
+ lineTension: 0,
17
+ }]
18
+ },
19
+ options: {
20
+ scales: {
21
+ yAxes: [{
22
+ ticks: {
23
+ min: 0, // it is for ignoring negative step.
24
+ beginAtZero: true,
25
+ callback: function(value, index, values) {
26
+ if (Math.floor(value) === value) {
27
+ return value;
28
+ }
29
+ }
30
+ }
31
+ }]
32
+ },
33
+
34
+ legend: {
35
+ display: false
36
+ }
37
+ }
38
+ });
39
+ </script>
40
+
41
+
42
+ <h3>Sales statements for this period</h3>
43
+
44
+
45
+ <?php
46
+
47
+ if ($statements->count) {
48
+ ?>
49
+
50
+ <table class="tutor-dashboard-statement-table">
51
+ <tr>
52
+ <th><?php _e('Course', 'tutor'); ?></th>
53
+ <th><?php _e('Earning', 'tutor'); ?></th>
54
+ <th><?php _e('Deduct', 'tutor'); ?></th>
55
+ </tr>
56
+
57
+ <?php
58
+ foreach ($statements->results as $statement){
59
+ ?>
60
+ <tr>
61
+ <td>
62
+ <p>
63
+ <a href="<?php echo get_the_permalink($statement->course_id); ?>" target="_blank">
64
+ <?php echo $statement->course_title; ?>
65
+ </a>
66
+ </p>
67
+
68
+ <p>
69
+ <?php _e('Price', 'tutor'); ?>
70
+ <?php echo tutor_utils()->tutor_price($statement->course_price_total); ?>
71
+ </p>
72
+
73
+ <p class="small-text">
74
+ <span class="statement-order-<?php echo $statement->order_status; ?>"><?php echo $statement->order_status; ?></span> <?php
75
+ _e('Order ID'); ?> #<?php echo $statement->order_id; ?>,
76
+
77
+ <strong><?php _e('Date:', 'tutor') ?></strong>
78
+ <i><?php echo date(get_option('date_format', strtotime($statement->created_at))).' '.date(get_option('time_format', strtotime($statement->created_at))) ?></i>
79
+ </p>
80
+
81
+ <?php
82
+ $order = new WC_Order($statement->order_id);
83
+ echo '<div class="statement-address"> <strong>Purchaser</strong> <address>'.$order->get_formatted_billing_address().'</address></div>';
84
+ ?>
85
+ </td>
86
+ <td>
87
+ <p><?php echo tutor_utils()->tutor_price($statement->instructor_amount); ?></p>
88
+ <p class="small-text"> <?php _e('As per'); ?> <?php echo $statement->instructor_rate ?> (<?php echo $statement->commission_type ?>) </p>
89
+ </td>
90
+
91
+ <td>
92
+ <p><?php _e('Commission', 'tutor'); ?> : <?php echo tutor_utils()->tutor_price($statement->admin_amount); ?> </p>
93
+ <p class="small-text"><?php _e('Rate', 'tutor'); ?> : <?php echo $statement->admin_rate; ?> </p>
94
+ <p class="small-text"><?php _e('Type', 'tutor'); ?> : <?php echo $statement->commission_type; ?> </p>
95
+
96
+ <p><?php _e('Deducted', 'tutor'); ?> : <?php echo $statement->deduct_fees_name; ?> <?php echo tutor_utils()->tutor_price
97
+ ($statement->deduct_fees_amount); ?>
98
+ </p>
99
+ <p class="small-text"><?php _e('Type', 'tutor'); ?> : <?php echo $statement->deduct_fees_type; ?> </p>
100
+ </td>
101
+ </tr>
102
+ <?php
103
+ }
104
+ ?>
105
+ </table>
106
+
107
+ <?php
108
+ }
109
+
110
+ //echo '<pre>';
111
+ //die(print_r($statements));
112
+
113
+
114
+ ?>
templates/dashboard/earning/earning-report-top-menu.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="tutor-date-range-filter-wrap">
2
+ <?php
3
+ $time_periods = array(
4
+ 'last_year' => __('Last Year', 'tutor-report'),
5
+ 'this_year' => __('This Year', 'tutor-report'),
6
+ 'last_month' => __('Last Month', 'tutor-report'),
7
+ 'this_month' => __('This Month', 'tutor-report'),
8
+ 'last_week' => __('Last Week', 'tutor-report'),
9
+ 'this_week' => __('This Week', 'tutor-report'),
10
+ );
11
+ ?>
12
+ <div class="report-top-sub-menu">
13
+ <?php
14
+ foreach ($time_periods as $period => $period_name){
15
+ $activeClass = ( $sub_page === $period ) ? 'active' : '' ;
16
+
17
+ $timePeriodPageURL = add_query_arg(array('time_period' => $period));
18
+ $timePeriodPageURL = remove_query_arg(array('date_range_from', 'date_range_to', 'tutor_report_action'), $timePeriodPageURL);
19
+
20
+ echo '<a href="'.$timePeriodPageURL.'" class="'.$activeClass.'">'.$period_name.'</a> ';
21
+ }
22
+ ?>
23
+ </div>
24
+ <div class="tutor-date-range-wrap">
25
+ <form action="" class="report-date-range-form" method="get">
26
+ <?php
27
+ $query_arg = $_GET;
28
+ if ( ! empty($query_arg) && is_array($query_arg)){
29
+ if (isset($query_arg['time_period'])){
30
+ unset($query_arg['time_period']);
31
+ }
32
+
33
+ foreach ($query_arg as $name => $value){
34
+ echo "<input type='hidden' name='{$name}' value='{$value}' />";
35
+ }
36
+ }
37
+
38
+ $date_range_from = '';
39
+ if (isset($query_arg['date_range_from'])) {
40
+ $date_range_from = sanitize_text_field($query_arg['date_range_from']);
41
+ }
42
+ $date_range_to = '';
43
+ if (isset($query_arg['date_range_to'])) {
44
+ $date_range_to = sanitize_text_field($query_arg['date_range_to']);
45
+ }
46
+ ?>
47
+
48
+ <div class="date-range-input">
49
+ <input type="text" name="date_range_from" class="tutor_report_datepicker" value="<?php echo $date_range_from; ?>" autocomplete="off" placeholder="<?php echo date("Y-m-d", strtotime("last sunday midnight")); ?>" />
50
+ <i class="tutor-icon-calendar"></i>
51
+ </div>
52
+
53
+ <div class="date-range-input">
54
+ <input type="text" name="date_range_to" class="tutor_report_datepicker" value="<?php echo $date_range_to; ?>" autocomplete="off" placeholder="<?php echo date("Y-m-d"); ?>" />
55
+ <i class="tutor-icon-calendar"></i>
56
+ </div>
57
+
58
+ <div class="date-range-input">
59
+ <button type="submit"><i class="tutor-icon-magnifying-glass-1"></i> </button>
60
+ </div>
61
+ </form>
62
+ </div>
63
+ </div>
templates/dashboard/earning/report-date_range.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for displaying instructors earnings
4
+ *
5
+ * @since v.1.1.2
6
+ *
7
+ * @author Themeum
8
+ * @url https://themeum.com
9
+ */
10
+
11
+ global $wpdb;
12
+
13
+ $user_id = get_current_user_id();
14
+
15
+ /**
16
+ * Getting the This Week
17
+ */
18
+
19
+ $start_date = sanitize_text_field(tutor_utils()->avalue_dot('date_range_from', $_GET));
20
+ $end_date = sanitize_text_field(tutor_utils()->avalue_dot('date_range_to', $_GET));
21
+
22
+ $earning_sum = tutor_utils()->get_earning_sum($user_id, compact('start_date', 'end_date'));
23
+ if ( ! $earning_sum){
24
+ echo '<p>'.__('No Earning info available', 'tutor' ).'</p>';
25
+ return;
26
+ }
27
+
28
+ $complete_status = tutor_utils()->get_earnings_completed_statuses();
29
+ $statuses = $complete_status;
30
+ $complete_status = "'".implode("','", $complete_status)."'";
31
+
32
+ /**
33
+ * Format Date Name
34
+ */
35
+ $begin = new DateTime($start_date);
36
+ $end = new DateTime($end_date.' + 1 day');
37
+ $interval = DateInterval::createFromDateString('1 day');
38
+ $period = new DatePeriod($begin, $interval, $end);
39
+
40
+ $datesPeriod = array();
41
+ foreach ($period as $dt) {
42
+ $datesPeriod[$dt->format("Y-m-d")] = 0;
43
+ }
44
+
45
+ /**
46
+ * Query This Month
47
+ */
48
+
49
+ $salesQuery = $wpdb->get_results( "
50
+ SELECT SUM(instructor_amount) as total_earning,
51
+ DATE(created_at) as date_format
52
+ from {$wpdb->prefix}tutor_earnings
53
+ WHERE user_id = {$user_id} AND order_status IN({$complete_status})
54
+ AND (created_at BETWEEN '{$start_date}' AND '{$end_date}')
55
+ GROUP BY date_format
56
+ ORDER BY created_at ASC ;");
57
+
58
+ $total_earning = wp_list_pluck($salesQuery, 'total_earning');
59
+ $queried_date = wp_list_pluck($salesQuery, 'date_format');
60
+ $dateWiseSales = array_combine($queried_date, $total_earning);
61
+
62
+ $chartData = array_merge($datesPeriod, $dateWiseSales);
63
+ foreach ($chartData as $key => $salesCount){
64
+ unset($chartData[$key]);
65
+ $formatDate = date('d M', strtotime($key));
66
+ $chartData[$formatDate] = $salesCount;
67
+ }
68
+
69
+ $statements = tutor_utils()->get_earning_statements($user_id, compact('start_date', 'end_date', 'statuses'));
70
+
71
+ ?>
72
+
73
+ <div class="tutor-dashboard-earning-info-row">
74
+
75
+ <div class="tutor-dashboard-earning-sum">
76
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->instructor_amount); ?></h3>
77
+ <p><?php _e('My Earning', 'tutor'); ?></p>
78
+ <p class="text-small"><?php _e('All time', 'tutor'); ?></p>
79
+ </div>
80
+
81
+ <div class="tutor-dashboard-earning-sum">
82
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->course_price_total); ?></h3>
83
+ <p><?php _e('All time sales.', 'tutor'); ?></p>
84
+ <p class="text-small"><?php _e('Based on course price.', 'tutor'); ?></p>
85
+ </div>
86
+
87
+ <div class="tutor-dashboard-earning-sum">
88
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->admin_amount); ?></h3>
89
+ <p><?php _e('Deducted Commissions', 'tutor'); ?></p>
90
+ </div>
91
+
92
+ <?php
93
+ if ($earning_sum->deduct_fees_amount > 0){
94
+ ?>
95
+ <div class="tutor-dashboard-earning-sum">
96
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->deduct_fees_amount); ?></h3>
97
+ <p><?php _e('Deducted Fees', 'tutor'); ?></p>
98
+ </div>
99
+ <?php } ?>
100
+ </div>
101
+
102
+
103
+
104
+ <h4><?php echo sprintf(__("Showing Result from %s to %s", 'tutor-report'), $begin->format('d F, Y'), $end->format('d F, Y')); ?></h4>
105
+
106
+ <?php tutor_load_template('dashboard.earning.chart-body', compact('chartData', 'statements')); ?>
templates/dashboard/earning/report-last_month.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for displaying instructors earnings
4
+ *
5
+ * @since v.1.1.2
6
+ *
7
+ * @author Themeum
8
+ * @url https://themeum.com
9
+ */
10
+
11
+ global $wpdb;
12
+
13
+ $user_id = get_current_user_id();
14
+
15
+ /**
16
+ * Getting the Last Month
17
+ */
18
+ $start_date = date("Y-m", strtotime('-1 month'));
19
+ $start_date = $start_date.'-1';
20
+ $end_date = date("Y-m-t", strtotime($start_date));
21
+
22
+
23
+ $earning_sum = tutor_utils()->get_earning_sum($user_id, compact('start_date', 'end_date'));
24
+ if ( ! $earning_sum){
25
+ echo '<p>'.__('No Earning info available', 'tutor' ).'</p>';
26
+ return;
27
+ }
28
+
29
+ $complete_status = tutor_utils()->get_earnings_completed_statuses();
30
+ $statuses = $complete_status;
31
+ $complete_status = "'".implode("','", $complete_status)."'";
32
+
33
+ /**
34
+ * Format Date Name
35
+ */
36
+ $begin = new DateTime($start_date);
37
+ $end = new DateTime($end_date.' + 1 day');
38
+ $interval = DateInterval::createFromDateString('1 day');
39
+ $period = new DatePeriod($begin, $interval, $end);
40
+
41
+ $datesPeriod = array();
42
+ foreach ($period as $dt) {
43
+ $datesPeriod[$dt->format("Y-m-d")] = 0;
44
+ }
45
+
46
+ /**
47
+ * Query This Month
48
+ */
49
+
50
+ $salesQuery = $wpdb->get_results( "
51
+ SELECT SUM(instructor_amount) as total_earning,
52
+ DATE(created_at) as date_format
53
+ from {$wpdb->prefix}tutor_earnings
54
+ WHERE user_id = {$user_id} AND order_status IN({$complete_status})
55
+ AND (created_at BETWEEN '{$start_date}' AND '{$end_date}')
56
+ GROUP BY date_format
57
+ ORDER BY created_at ASC ;");
58
+
59
+ $total_earning = wp_list_pluck($salesQuery, 'total_earning');
60
+ $queried_date = wp_list_pluck($salesQuery, 'date_format');
61
+ $dateWiseSales = array_combine($queried_date, $total_earning);
62
+
63
+ $chartData = array_merge($datesPeriod, $dateWiseSales);
64
+ foreach ($chartData as $key => $salesCount){
65
+ unset($chartData[$key]);
66
+ $formatDate = date('d M', strtotime($key));
67
+ $chartData[$formatDate] = $salesCount;
68
+ }
69
+
70
+ $statements = tutor_utils()->get_earning_statements($user_id, compact('start_date', 'end_date', 'statuses'));
71
+
72
+ ?>
73
+
74
+ <div class="tutor-dashboard-earning-info-row">
75
+
76
+ <div class="tutor-dashboard-earning-sum">
77
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->instructor_amount); ?></h3>
78
+ <p><?php _e('My Earning', 'tutor'); ?></p>
79
+ <p class="text-small"><?php _e('All time', 'tutor'); ?></p>
80
+ </div>
81
+
82
+ <div class="tutor-dashboard-earning-sum">
83
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->course_price_total); ?></h3>
84
+ <p><?php _e('All time sales.', 'tutor'); ?></p>
85
+ <p class="text-small"><?php _e('Based on course price.', 'tutor'); ?></p>
86
+ </div>
87
+
88
+ <div class="tutor-dashboard-earning-sum">
89
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->admin_amount); ?></h3>
90
+ <p><?php _e('Deducted Commissions', 'tutor'); ?></p>
91
+ </div>
92
+
93
+ <?php
94
+ if ($earning_sum->deduct_fees_amount > 0){
95
+ ?>
96
+ <div class="tutor-dashboard-earning-sum">
97
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->deduct_fees_amount); ?></h3>
98
+ <p><?php _e('Deducted Fees', 'tutor'); ?></p>
99
+ </div>
100
+ <?php } ?>
101
+ </div>
102
+
103
+ <h4><?php echo sprintf(__("Earning Data for the month of %s", 'tutor-report'), date("F, Y", strtotime($start_date)));?></h4>
104
+
105
+ <?php tutor_load_template('dashboard.earning.chart-body', compact('chartData', 'statements')); ?>
templates/dashboard/earning/report-last_week.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for displaying instructors earnings
4
+ *
5
+ * @since v.1.1.2
6
+ *
7
+ * @author Themeum
8
+ * @url https://themeum.com
9
+ */
10
+
11
+ global $wpdb;
12
+
13
+ $user_id = get_current_user_id();
14
+
15
+ /**
16
+ * Getting the Last Week
17
+ */
18
+
19
+ $previous_week = strtotime("-1 week +1 day");
20
+ $start_date = strtotime("last sunday midnight",$previous_week);
21
+ $end_date = strtotime("next saturday",$start_date);
22
+ $start_date = date("Y-m-d",$start_date);
23
+ $end_date = date("Y-m-d",$end_date);
24
+
25
+
26
+ $earning_sum = tutor_utils()->get_earning_sum($user_id, compact('start_date', 'end_date'));
27
+ if ( ! $earning_sum){
28
+ echo '<p>'.__('No Earning info available', 'tutor' ).'</p>';
29
+ return;
30
+ }
31
+
32
+ $complete_status = tutor_utils()->get_earnings_completed_statuses();
33
+ $statuses = $complete_status;
34
+ $complete_status = "'".implode("','", $complete_status)."'";
35
+
36
+ /**
37
+ * Format Date Name
38
+ */
39
+ $begin = new DateTime($start_date);
40
+ $end = new DateTime($end_date.' + 1 day');
41
+ $interval = DateInterval::createFromDateString('1 day');
42
+ $period = new DatePeriod($begin, $interval, $end);
43
+
44
+ $datesPeriod = array();
45
+ foreach ($period as $dt) {
46
+ $datesPeriod[$dt->format("Y-m-d")] = 0;
47
+ }
48
+
49
+ /**
50
+ * Query This Month
51
+ */
52
+
53
+ $salesQuery = $wpdb->get_results( "
54
+ SELECT SUM(instructor_amount) as total_earning,
55
+ DATE(created_at) as date_format
56
+ from {$wpdb->prefix}tutor_earnings
57
+ WHERE user_id = {$user_id} AND order_status IN({$complete_status})
58
+ AND (created_at BETWEEN '{$start_date}' AND '{$end_date}')
59
+ GROUP BY date_format
60
+ ORDER BY created_at ASC ;");
61
+
62
+ $total_earning = wp_list_pluck($salesQuery, 'total_earning');
63
+ $queried_date = wp_list_pluck($salesQuery, 'date_format');
64
+ $dateWiseSales = array_combine($queried_date, $total_earning);
65
+
66
+ $chartData = array_merge($datesPeriod, $dateWiseSales);
67
+ foreach ($chartData as $key => $salesCount){
68
+ unset($chartData[$key]);
69
+ $formatDate = date('d M', strtotime($key));
70
+ $chartData[$formatDate] = $salesCount;
71
+ }
72
+
73
+ $statements = tutor_utils()->get_earning_statements($user_id, compact('start_date', 'end_date', 'statuses'));
74
+
75
+ ?>
76
+
77
+ <div class="tutor-dashboard-earning-info-row">
78
+
79
+ <div class="tutor-dashboard-earning-sum">
80
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->instructor_amount); ?></h3>
81
+ <p><?php _e('My Earning', 'tutor'); ?></p>
82
+ <p class="text-small"><?php _e('All time', 'tutor'); ?></p>
83
+ </div>
84
+
85
+ <div class="tutor-dashboard-earning-sum">
86
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->course_price_total); ?></h3>
87
+ <p><?php _e('All time sales.', 'tutor'); ?></p>
88
+ <p class="text-small"><?php _e('Based on course price.', 'tutor'); ?></p>
89
+ </div>
90
+
91
+ <div class="tutor-dashboard-earning-sum">
92
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->admin_amount); ?></h3>
93
+ <p><?php _e('Deducted Commissions', 'tutor'); ?></p>
94
+ </div>
95
+
96
+ <?php
97
+ if ($earning_sum->deduct_fees_amount > 0){
98
+ ?>
99
+ <div class="tutor-dashboard-earning-sum">
100
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->deduct_fees_amount); ?></h3>
101
+ <p><?php _e('Deducted Fees', 'tutor'); ?></p>
102
+ </div>
103
+ <?php } ?>
104
+ </div>
105
+
106
+
107
+
108
+ <h4><?php echo sprintf(__("Showing Result from %s to %s", 'tutor-report'), $begin->format('d F, Y'), $end->format('d F, Y')); ?></h4>
109
+
110
+ <?php tutor_load_template('dashboard.earning.chart-body', compact('chartData', 'statements')); ?>
templates/dashboard/earning/report-last_year.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for displaying instructors earnings
4
+ *
5
+ * @since v.1.1.2
6
+ *
7
+ * @author Themeum
8
+ * @url https://themeum.com
9
+ */
10
+
11
+ global $wpdb;
12
+
13
+ $user_id = get_current_user_id();
14
+
15
+ /**
16
+ * Getting the Last Month
17
+ */
18
+ $year = date('Y', strtotime('-1 year'));
19
+ $dataFor = 'yearly';
20
+
21
+ $earning_sum = tutor_utils()->get_earning_sum($user_id, compact('year', 'dataFor'));
22
+
23
+ if ( ! $earning_sum){
24
+ echo '<p>'.__('No Earning info available', 'tutor' ).'</p>';
25
+ return;
26
+ }
27
+
28
+ $complete_status = tutor_utils()->get_earnings_completed_statuses();
29
+ $statuses = $complete_status;
30
+ $complete_status = "'".implode("','", $complete_status)."'";
31
+
32
+
33
+ /**
34
+ * Query This Month
35
+ */
36
+
37
+ $salesQuery = $wpdb->get_results( "
38
+ SELECT SUM(instructor_amount) as total_earning,
39
+ MONTHNAME(created_at) as month_name
40
+ from {$wpdb->prefix}tutor_earnings
41
+ WHERE user_id = {$user_id} AND order_status IN({$complete_status})
42
+ AND YEAR(created_at) = {$year}
43
+ GROUP BY MONTH (created_at)
44
+ ORDER BY MONTH(created_at) ASC ;");
45
+
46
+ $total_earning = wp_list_pluck($salesQuery, 'total_earning');
47
+ $months = wp_list_pluck($salesQuery, 'month_name');
48
+ $monthWiseSales = array_combine($months, $total_earning);
49
+
50
+ /**
51
+ * Format yearly
52
+ */
53
+ $emptyMonths = array();
54
+ for ($m=1; $m<=12; $m++) {
55
+ $emptyMonths[date('F', mktime(0,0,0,$m, 1, date('Y')))] = 0;
56
+ }
57
+ $chartData = array_merge($emptyMonths, $monthWiseSales);
58
+
59
+ $statements = tutor_utils()->get_earning_statements($user_id, compact('year', 'dataFor', 'statuses'));
60
+
61
+ ?>
62
+
63
+ <div class="tutor-dashboard-earning-info-row">
64
+
65
+ <div class="tutor-dashboard-earning-sum">
66
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->instructor_amount); ?></h3>
67
+ <p><?php _e('My Earning', 'tutor'); ?></p>
68
+ <p class="text-small"><?php _e('All time', 'tutor'); ?></p>
69
+ </div>
70
+
71
+ <div class="tutor-dashboard-earning-sum">
72
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->course_price_total); ?></h3>
73
+ <p><?php _e('All time sales.', 'tutor'); ?></p>
74
+ <p class="text-small"><?php _e('Based on course price.', 'tutor'); ?></p>
75
+ </div>
76
+
77
+ <div class="tutor-dashboard-earning-sum">
78
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->admin_amount); ?></h3>
79
+ <p><?php _e('Deducted Commissions', 'tutor'); ?></p>
80
+ </div>
81
+
82
+ <?php
83
+ if ($earning_sum->deduct_fees_amount > 0){
84
+ ?>
85
+ <div class="tutor-dashboard-earning-sum">
86
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->deduct_fees_amount); ?></h3>
87
+ <p><?php _e('Deducted Fees', 'tutor'); ?></p>
88
+ </div>
89
+ <?php } ?>
90
+ </div>
91
+
92
+ <h4><?php echo sprintf(__("Earning Data for the year of %s", 'tutor-report'), $year);?></h4>
93
+
94
+ <?php tutor_load_template('dashboard.earning.chart-body', compact('chartData', 'statements')); ?>
templates/dashboard/earning/report-this_month.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for displaying instructors earnings
4
+ *
5
+ * @since v.1.1.2
6
+ *
7
+ * @author Themeum
8
+ * @url https://themeum.com
9
+ */
10
+
11
+ global $wpdb;
12
+
13
+ $user_id = get_current_user_id();
14
+
15
+ /**
16
+ * Getting the This Month
17
+ */
18
+ $start_date = date("Y-m-01");
19
+ $end_date = date("Y-m-t");
20
+
21
+
22
+ $earning_sum = tutor_utils()->get_earning_sum($user_id, compact('start_date', 'end_date'));
23
+ if ( ! $earning_sum){
24
+ echo '<p>'.__('No Earning info available', 'tutor' ).'</p>';
25
+ return;
26
+ }
27
+
28
+ $complete_status = tutor_utils()->get_earnings_completed_statuses();
29
+ $statuses = $complete_status;
30
+ $complete_status = "'".implode("','", $complete_status)."'";
31
+
32
+ /**
33
+ * Format Date Name
34
+ */
35
+ $begin = new DateTime($start_date);
36
+ $end = new DateTime($end_date.' + 1 day');
37
+ $interval = DateInterval::createFromDateString('1 day');
38
+ $period = new DatePeriod($begin, $interval, $end);
39
+
40
+ $datesPeriod = array();
41
+ foreach ($period as $dt) {
42
+ $datesPeriod[$dt->format("Y-m-d")] = 0;
43
+ }
44
+
45
+ /**
46
+ * Query This Month
47
+ */
48
+
49
+ $salesQuery = $wpdb->get_results( "
50
+ SELECT SUM(instructor_amount) as total_earning,
51
+ DATE(created_at) as date_format
52
+ from {$wpdb->prefix}tutor_earnings
53
+ WHERE user_id = {$user_id} AND order_status IN({$complete_status})
54
+ AND (created_at BETWEEN '{$start_date}' AND '{$end_date}')
55
+ GROUP BY date_format
56
+ ORDER BY created_at ASC ;");
57
+
58
+ $total_earning = wp_list_pluck($salesQuery, 'total_earning');
59
+ $queried_date = wp_list_pluck($salesQuery, 'date_format');
60
+ $dateWiseSales = array_combine($queried_date, $total_earning);
61
+
62
+ $chartData = array_merge($datesPeriod, $dateWiseSales);
63
+ foreach ($chartData as $key => $salesCount){
64
+ unset($chartData[$key]);
65
+ $formatDate = date('d M', strtotime($key));
66
+ $chartData[$formatDate] = $salesCount;
67
+ }
68
+
69
+ $statements = tutor_utils()->get_earning_statements($user_id, compact('start_date', 'end_date', 'statuses'));
70
+
71
+ ?>
72
+
73
+ <div class="tutor-dashboard-earning-info-row">
74
+
75
+ <div class="tutor-dashboard-earning-sum">
76
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->instructor_amount); ?></h3>
77
+ <p><?php _e('My Earning', 'tutor'); ?></p>
78
+ <p class="text-small"><?php _e('All time', 'tutor'); ?></p>
79
+ </div>
80
+
81
+ <div class="tutor-dashboard-earning-sum">
82
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->course_price_total); ?></h3>
83
+ <p><?php _e('All time sales.', 'tutor'); ?></p>
84
+ <p class="text-small"><?php _e('Based on course price.', 'tutor'); ?></p>
85
+ </div>
86
+
87
+ <div class="tutor-dashboard-earning-sum">
88
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->admin_amount); ?></h3>
89
+ <p><?php _e('Deducted Commissions', 'tutor'); ?></p>
90
+ </div>
91
+
92
+ <?php
93
+ if ($earning_sum->deduct_fees_amount > 0){
94
+ ?>
95
+ <div class="tutor-dashboard-earning-sum">
96
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->deduct_fees_amount); ?></h3>
97
+ <p><?php _e('Deducted Fees', 'tutor'); ?></p>
98
+ </div>
99
+ <?php } ?>
100
+ </div>
101
+
102
+ <h4><?php echo sprintf(__("Earning Data for the month of %s", 'tutor-report'), date("F, Y", strtotime($start_date)));?></h4>
103
+
104
+ <?php tutor_load_template('dashboard.earning.chart-body', compact('chartData', 'statements')); ?>
templates/dashboard/earning/report-this_week.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for displaying instructors earnings
4
+ *
5
+ * @since v.1.1.2
6
+ *
7
+ * @author Themeum
8
+ * @url https://themeum.com
9
+ */
10
+
11
+ global $wpdb;
12
+
13
+ $user_id = get_current_user_id();
14
+
15
+ /**
16
+ * Getting the This Week
17
+ */
18
+
19
+ $start_date = date("Y-m-d", strtotime("last sunday midnight"));
20
+ $end_date = date("Y-m-d", strtotime("next saturday"));
21
+
22
+
23
+ $earning_sum = tutor_utils()->get_earning_sum($user_id, compact('start_date', 'end_date'));
24
+ if ( ! $earning_sum){
25
+ echo '<p>'.__('No Earning info available', 'tutor' ).'</p>';
26
+ return;
27
+ }
28
+
29
+ $complete_status = tutor_utils()->get_earnings_completed_statuses();
30
+ $statuses = $complete_status;
31
+ $complete_status = "'".implode("','", $complete_status)."'";
32
+
33
+ /**
34
+ * Format Date Name
35
+ */
36
+ $begin = new DateTime($start_date);
37
+ $end = new DateTime($end_date.' + 1 day');
38
+ $interval = DateInterval::createFromDateString('1 day');
39
+ $period = new DatePeriod($begin, $interval, $end);
40
+
41
+ $datesPeriod = array();
42
+ foreach ($period as $dt) {
43
+ $datesPeriod[$dt->format("Y-m-d")] = 0;
44
+ }
45
+
46
+ /**
47
+ * Query This Month
48
+ */
49
+
50
+ $salesQuery = $wpdb->get_results( "
51
+ SELECT SUM(instructor_amount) as total_earning,
52
+ DATE(created_at) as date_format
53
+ from {$wpdb->prefix}tutor_earnings
54
+ WHERE user_id = {$user_id} AND order_status IN({$complete_status})
55
+ AND (created_at BETWEEN '{$start_date}' AND '{$end_date}')
56
+ GROUP BY date_format
57
+ ORDER BY created_at ASC ;");
58
+
59
+ $total_earning = wp_list_pluck($salesQuery, 'total_earning');
60
+ $queried_date = wp_list_pluck($salesQuery, 'date_format');
61
+ $dateWiseSales = array_combine($queried_date, $total_earning);
62
+
63
+ $chartData = array_merge($datesPeriod, $dateWiseSales);
64
+ foreach ($chartData as $key => $salesCount){
65
+ unset($chartData[$key]);
66
+ $formatDate = date('d M', strtotime($key));
67
+ $chartData[$formatDate] = $salesCount;
68
+ }
69
+
70
+ $statements = tutor_utils()->get_earning_statements($user_id, compact('start_date', 'end_date', 'statuses'));
71
+ ?>
72
+
73
+ <div class="tutor-dashboard-earning-info-row">
74
+
75
+ <div class="tutor-dashboard-earning-sum">
76
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->instructor_amount); ?></h3>
77
+ <p><?php _e('My Earning', 'tutor'); ?></p>
78
+ <p class="text-small"><?php _e('All time', 'tutor'); ?></p>
79
+ </div>
80
+
81
+ <div class="tutor-dashboard-earning-sum">
82
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->course_price_total); ?></h3>
83
+ <p><?php _e('All time sales.', 'tutor'); ?></p>
84
+ <p class="text-small"><?php _e('Based on course price.', 'tutor'); ?></p>
85
+ </div>
86
+
87
+ <div class="tutor-dashboard-earning-sum">
88
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->admin_amount); ?></h3>
89
+ <p><?php _e('Deducted Commissions', 'tutor'); ?></p>
90
+ </div>
91
+
92
+ <?php
93
+ if ($earning_sum->deduct_fees_amount > 0){
94
+ ?>
95
+ <div class="tutor-dashboard-earning-sum">
96
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->deduct_fees_amount); ?></h3>
97
+ <p><?php _e('Deducted Fees', 'tutor'); ?></p>
98
+ </div>
99
+ <?php } ?>
100
+ </div>
101
+
102
+
103
+
104
+ <h4><?php echo sprintf(__("Showing Result from %s to %s", 'tutor-report'), $begin->format('d F, Y'), $end->format('d F, Y')); ?></h4>
105
+
106
+ <?php tutor_load_template('dashboard.earning.chart-body', compact('chartData', 'statements')); ?>
templates/dashboard/earning/report-this_year.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for displaying instructors earnings
4
+ *
5
+ * @since v.1.1.2
6
+ *
7
+ * @author Themeum
8
+ * @url https://themeum.com
9
+ */
10
+
11
+ global $wpdb;
12
+
13
+ $user_id = get_current_user_id();
14
+
15
+ /**
16
+ * Getting the Last Month
17
+ */
18
+ $year = date('Y');
19
+ $dataFor = 'yearly';
20
+
21
+ $earning_sum = tutor_utils()->get_earning_sum($user_id, compact('year', 'dataFor'));
22
+
23
+
24
+ if ( ! $earning_sum){
25
+ echo '<p>'.__('No Earning info available', 'tutor' ).'</p>';
26
+ return;
27
+ }
28
+
29
+ $complete_status = tutor_utils()->get_earnings_completed_statuses();
30
+ $statuses = $complete_status;
31
+ $complete_status = "'".implode("','", $complete_status)."'";
32
+
33
+
34
+ /**
35
+ * Query This Month
36
+ */
37
+
38
+ $salesQuery = $wpdb->get_results( "
39
+ SELECT SUM(instructor_amount) as total_earning,
40
+ MONTHNAME(created_at) as month_name
41
+ from {$wpdb->prefix}tutor_earnings
42
+ WHERE user_id = {$user_id} AND order_status IN({$complete_status})
43
+ AND YEAR(created_at) = {$year}
44
+ GROUP BY MONTH (created_at)
45
+ ORDER BY MONTH(created_at) ASC ;");
46
+
47
+ $total_earning = wp_list_pluck($salesQuery, 'total_earning');
48
+ $months = wp_list_pluck($salesQuery, 'month_name');
49
+ $monthWiseSales = array_combine($months, $total_earning);
50
+
51
+ /**
52
+ * Format yearly
53
+ */
54
+ $emptyMonths = array();
55
+ for ($m=1; $m<=12; $m++) {
56
+ $emptyMonths[date('F', mktime(0,0,0,$m, 1, date('Y')))] = 0;
57
+ }
58
+ $chartData = array_merge($emptyMonths, $monthWiseSales);
59
+
60
+ $statements = tutor_utils()->get_earning_statements($user_id, compact('year', 'dataFor', 'statuses'));
61
+
62
+
63
+ ?>
64
+
65
+ <div class="tutor-dashboard-earning-info-row">
66
+
67
+ <div class="tutor-dashboard-earning-sum">
68
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->instructor_amount); ?></h3>
69
+ <p><?php _e('My Earning', 'tutor'); ?></p>
70
+ <p class="text-small"><?php _e('All time', 'tutor'); ?></p>
71
+ </div>
72
+
73
+ <div class="tutor-dashboard-earning-sum">
74
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->course_price_total); ?></h3>
75
+ <p><?php _e('All time sales.', 'tutor'); ?></p>
76
+ <p class="text-small"><?php _e('Based on course price.', 'tutor'); ?></p>
77
+ </div>
78
+
79
+ <div class="tutor-dashboard-earning-sum">
80
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->admin_amount); ?></h3>
81
+ <p><?php _e('Deducted Commissions', 'tutor'); ?></p>
82
+ </div>
83
+
84
+ <?php
85
+ if ($earning_sum->deduct_fees_amount > 0){
86
+ ?>
87
+ <div class="tutor-dashboard-earning-sum">
88
+ <h3><?php echo tutor_utils()->tutor_price($earning_sum->deduct_fees_amount); ?></h3>
89
+ <p><?php _e('Deducted Fees', 'tutor'); ?></p>
90
+ </div>
91
+ <?php } ?>
92
+ </div>
93
+
94
+ <h4><?php echo sprintf(__("Earning Data for the year of %s", 'tutor-report'), $year);?></h4>
95
+
96
+ <?php tutor_load_template('dashboard.earning.chart-body', compact('chartData', 'statements')); ?>
templates/dashboard/earning/report.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for displaying Instructor Earning Report
4
+ *
5
+ * @since v.1.1.2
6
+ *
7
+ * @author Themeum
8
+ * @url https://themeum.com
9
+ */
10
+
11
+
12
+ if ( ! defined( 'ABSPATH' ) )
13
+ exit;
14
+
15
+ $sub_page = 'this_month';
16
+ if ( ! empty($_GET['time_period'])){
17
+ $sub_page = sanitize_text_field($_GET['time_period']);
18
+ }
19
+ if ( ! empty($_GET['date_range_from']) && ! empty($_GET['date_range_to'])){
20
+ $sub_page = 'date_range';
21
+ }
22
+ ?>
23
+ <div class="tutor-dashboard-inline-links">
24
+ <ul>
25
+ <li><a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('earning'); ?>"> <?php _e('Earning'); ?></a>
26
+ </li>
27
+ <li class="active"><a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('earning/report'); ?>"> <?php _e('Report'); ?> </a>
28
+ </li>
29
+ <li>
30
+ <a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('earning/statements'); ?>">
31
+ <?php _e('Statements'); ?> </a>
32
+ </li>
33
+ </ul>
34
+ </div>
35
+
36
+ <h3><?php _e('Earning Report', 'tutor'); ?></h3>
37
+
38
+ <?php
39
+ tutor_load_template('dashboard.earning.earning-report-top-menu', compact('sub_page'));
40
+ tutor_load_template('dashboard.earning.report-'.$sub_page);
41
+ ?>
templates/dashboard/earning/statements.php ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for displaying Instructor Statements
4
+ *
5
+ * @since v.1.1.2
6
+ *
7
+ * @author Themeum
8
+ * @url https://themeum.com
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) )
12
+ exit;
13
+
14
+ $sub_page = 'this_month';
15
+ if ( ! empty($_GET['time_period'])){
16
+ $sub_page = sanitize_text_field($_GET['time_period']);
17
+ }
18
+ if ( ! empty($_GET['date_range_from']) && ! empty($_GET['date_range_to'])){
19
+ $sub_page = 'date_range';
20
+ }
21
+ ?>
22
+ <div class="tutor-dashboard-inline-links">
23
+ <ul>
24
+ <li><a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('earning'); ?>"> <?php _e('Earning'); ?></a>
25
+ </li>
26
+ <li><a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('earning/report'); ?>"> <?php _e('Report'); ?> </a></li>
27
+ <li class="active">
28
+ <a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('earning/statements'); ?>">
29
+ <?php _e('Statements'); ?> </a>
30
+ </li>
31
+ </ul>
32
+ </div>
33
+
34
+ <h3><?php _e('Statements', 'tutor'); ?></h3>
35
+
36
+ <?php
37
+ tutor_load_template('dashboard.earning.earning-report-top-menu', compact('sub_page'));
38
+
39
+ $user_id = get_current_user_id();
40
+
41
+ $complete_status = tutor_utils()->get_earnings_completed_statuses();
42
+ $statuses = $complete_status;
43
+ $complete_status = "'".implode("','", $complete_status)."'";
44
+
45
+ $statements = false;
46
+
47
+ //Pagination Variable
48
+ $per_page = tutor_utils()->get_option('statement_show_per_page', 20);
49
+ $current_page = max( 1, tutor_utils()->avalue_dot('current_page', $_GET) );
50
+ $offset = ($current_page-1)*$per_page;
51
+
52
+
53
+ switch ($sub_page){
54
+
55
+ case 'last_year':
56
+ $year = date('Y', strtotime('-1 year'));
57
+ $dataFor = 'yearly';
58
+
59
+ $statements = tutor_utils()->get_earning_statements($user_id, compact('year', 'dataFor', 'per_page', 'offset'));
60
+ break;
61
+
62
+ case 'this_year':
63
+ $year = date('Y');
64
+ $dataFor = 'yearly';
65
+
66
+ $statements = tutor_utils()->get_earning_statements($user_id, compact('year', 'dataFor', 'per_page', 'offset'));
67
+ break;
68
+
69
+ case 'last_month':
70
+ $start_date = date("Y-m", strtotime('-1 month'));
71
+ $start_date = $start_date.'-1';
72
+ $end_date = date("Y-m-t", strtotime($start_date));
73
+
74
+ $statements = tutor_utils()->get_earning_statements($user_id, compact('start_date', 'end_date', 'per_page', 'offset'));
75
+ break;
76
+
77
+ case 'this_month':
78
+
79
+ $start_date = date("Y-m-01");
80
+ $end_date = date("Y-m-t");
81
+
82
+ $statements = tutor_utils()->get_earning_statements($user_id, compact('start_date', 'end_date', 'per_page', 'offset'));
83
+ break;
84
+
85
+ case 'last_week':
86
+
87
+ $previous_week = strtotime("-1 week +1 day");
88
+ $start_date = strtotime("last sunday midnight",$previous_week);
89
+ $end_date = strtotime("next saturday",$start_date);
90
+ $start_date = date("Y-m-d",$start_date);
91
+ $end_date = date("Y-m-d",$end_date);
92
+
93
+ $statements = tutor_utils()->get_earning_statements($user_id, compact('start_date', 'end_date', 'per_page', 'offset'));
94
+ break;
95
+
96
+
97
+ case 'this_week':
98
+ $start_date = date("Y-m-d", strtotime("last sunday midnight"));
99
+ $end_date = date("Y-m-d", strtotime("next saturday"));
100
+
101
+ $statements = tutor_utils()->get_earning_statements($user_id, compact('start_date', 'end_date', 'per_page', 'offset'));
102
+ break;
103
+
104
+ case 'date_range':
105
+
106
+ $start_date = sanitize_text_field(tutor_utils()->avalue_dot('date_range_from', $_GET));
107
+ $end_date = sanitize_text_field(tutor_utils()->avalue_dot('date_range_to', $_GET));
108
+
109
+ $statements = tutor_utils()->get_earning_statements($user_id, compact('start_date', 'end_date', 'per_page', 'offset'));
110
+ break;
111
+ }
112
+
113
+ if ($statements->count) {
114
+ ?>
115
+
116
+ <p class="tutor-dashboard-pagination-results-stats">
117
+
118
+ <?php
119
+ echo sprintf(__('Showing results %d to %d of %d', 'tutor'), $offset +1, min($statements->count, $offset +1+tutor_utils()->count($statements->results)), $statements->count) ;
120
+ ?>
121
+ </p>
122
+
123
+ <table class="tutor-dashboard-statement-table">
124
+ <tr>
125
+ <th><?php _e('Course', 'tutor'); ?></th>
126
+ <th><?php _e('Earning', 'tutor'); ?></th>
127
+ <th><?php _e('Deduct', 'tutor'); ?></th>
128
+ </tr>
129
+
130
+ <?php
131
+ foreach ($statements->results as $statement){
132
+ ?>
133
+ <tr>
134
+ <td>
135
+ <p>
136
+ <a href="<?php echo get_the_permalink($statement->course_id); ?>" target="_blank">
137
+ <?php echo $statement->course_title; ?>
138
+ </a>
139
+ </p>
140
+
141
+ <p>
142
+ <?php _e('Price', 'tutor'); ?>
143
+ <?php echo tutor_utils()->tutor_price($statement->course_price_total); ?>
144
+ </p>
145
+
146
+ <p class="small-text">
147
+ <span class="statement-order-<?php echo $statement->order_status; ?>"><?php echo $statement->order_status; ?></span> <?php
148
+ _e('Order ID'); ?> #<?php echo $statement->order_id; ?>,
149
+
150
+ <strong><?php _e('Date:', 'tutor') ?></strong>
151
+ <i><?php echo date(get_option('date_format', strtotime($statement->created_at))).' '.date(get_option('time_format', strtotime($statement->created_at))) ?></i>
152
+ </p>
153
+
154
+ <?php
155
+ $order = new WC_Order($statement->order_id);
156
+ echo '<div class="statement-address"> <strong>Purchaser</strong> <address>'.$order->get_formatted_billing_address().'</address></div>';
157
+ ?>
158
+ </td>
159
+ <td>
160
+ <p><?php echo tutor_utils()->tutor_price($statement->instructor_amount); ?></p>
161
+ <p class="small-text"> <?php _e('As per'); ?> <?php echo $statement->instructor_rate ?> (<?php echo $statement->commission_type ?>) </p>
162
+ </td>
163
+
164
+ <td>
165
+ <p><?php _e('Commission', 'tutor'); ?> : <?php echo tutor_utils()->tutor_price($statement->admin_amount); ?> </p>
166
+ <p class="small-text"><?php _e('Rate', 'tutor'); ?> : <?php echo $statement->admin_rate; ?> </p>
167
+ <p class="small-text"><?php _e('Type', 'tutor'); ?> : <?php echo $statement->commission_type; ?> </p>
168
+
169
+ <p><?php _e('Deducted', 'tutor'); ?> : <?php echo $statement->deduct_fees_name; ?> <?php echo tutor_utils()->tutor_price
170
+ ($statement->deduct_fees_amount); ?>
171
+ </p>
172
+ <p class="small-text"><?php _e('Type', 'tutor'); ?> : <?php echo $statement->deduct_fees_type; ?> </p>
173
+ </td>
174
+ </tr>
175
+ <?php
176
+ }
177
+ ?>
178
+ </table>
179
+
180
+ <div class="tutor-pagination">
181
+
182
+ <?php
183
+ echo paginate_links( array(
184
+ 'format' => '?current_page=%#%',
185
+ 'current' => $current_page,
186
+ 'total' => ceil($statements->count/$per_page)
187
+ ) );
188
+ ?>
189
+
190
+ </div>
191
+
192
+ <?php
193
+ }
templates/dashboard/enrolled-courses.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h3><?php _e('Enrolled Courses', 'tutor'); ?></h3>
2
+
3
+ <div class="tutor-dashboard-content-inner">
4
+
5
+
6
+ <div class="tutor-dashboard-inline-links">
7
+ <ul>
8
+ <li class="active"><a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('enrolled-courses'); ?>"> <?php _e('All Courses'); ?></a> </li>
9
+ <li><a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('enrolled-courses/active-courses'); ?>"> <?php _e('Active Courses'); ?> </a> </li>
10
+ <li><a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('enrolled-courses/completed-courses'); ?>">
11
+ <?php _e('Completed Courses'); ?> </a> </li>
12
+ </ul>
13
+ </div>
14
+
15
+
16
+ <?php
17
+ $my_courses = tutor_utils()->get_enrolled_courses_by_user();
18
+
19
+ if ($my_courses && $my_courses->have_posts()):
20
+ while ($my_courses->have_posts()):
21
+ $my_courses->the_post();
22
+ $avg_rating = tutor_utils()->get_course_rating()->rating_avg;
23
+ ?>
24
+ <div class="tutor-mycourse-wrap tutor-mycourse-<?php the_ID(); ?>">
25
+
26
+ <div class="tutor-mycourse-thumbnail">
27
+ <?php
28
+
29
+ tutor_course_loop_thumbnail();
30
+
31
+ ?>
32
+ </div>
33
+
34
+ <div class="tutor-mycourse-content">
35
+
36
+ <div class="tutor-mycourse-rating">
37
+ <?php
38
+ tutor_utils()->star_rating_generator($avg_rating);
39
+ ?>
40
+ </div>
41
+ <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </h3>
42
+ <div class="tutor-meta tutor-course-metadata">
43
+ <?php
44
+ $total_lessons = tutor_utils()->get_lesson_count_by_course();
45
+ $completed_lessons = tutor_utils()->get_completed_lesson_count_by_course();
46
+ ?>
47
+ <ul>
48
+ <li>
49
+ <?php
50
+ _e('Total Lessons:', 'tutor');
51
+ echo "<span>$total_lessons</span>";
52
+ ?>
53
+ </li>
54
+ <li>
55
+ <?php
56
+ _e('Completed Lessons:', 'tutor');
57
+ echo "<span>$completed_lessons / $total_lessons</span>";
58
+ ?>
59
+ </li>
60
+ </ul>
61
+ </div>
62
+ <?php tutor_course_completing_progress_bar(); ?>
63
+ </div>
64
+
65
+ </div>
66
+
67
+ <?php
68
+ endwhile;
69
+
70
+ wp_reset_postdata();
71
+ else:
72
+ echo "<div class='tutor-mycourse-wrap'>You didn't purchased any course</div>";
73
+ endif;
74
+
75
+ ?>
76
+
77
+ </div>
templates/dashboard/{student → enrolled-courses}/active-courses.php RENAMED
@@ -1,6 +1,18 @@
1
- <h1><?php _e('Active Course', 'tutor'); ?></h1>
 
2
  <div class="tutor-dashboard-content-inner">
3
- <?php
 
 
 
 
 
 
 
 
 
 
 
4
  $active_courses = tutor_utils()->get_active_courses_by_user();
5
 
6
  if ($active_courses && $active_courses->have_posts()):
1
+ <h3><?php _e('Active Course', 'tutor'); ?></h3>
2
+
3
  <div class="tutor-dashboard-content-inner">
4
+
5
+ <div class="tutor-dashboard-inline-links">
6
+ <ul>
7
+ <li><a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('enrolled-courses'); ?>"> <?php _e('All Courses'); ?></a> </li>
8
+ <li class="active"><a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('enrolled-courses/active-courses'); ?>"> <?php _e('Active Courses'); ?> </a> </li>
9
+ <li><a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('enrolled-courses/completed-courses'); ?>">
10
+ <?php _e('Completed Courses'); ?> </a> </li>
11
+ </ul>
12
+ </div>
13
+
14
+
15
+ <?php
16
  $active_courses = tutor_utils()->get_active_courses_by_user();
17
 
18
  if ($active_courses && $active_courses->have_posts()):
templates/dashboard/{student → enrolled-courses}/completed-courses.php RENAMED
@@ -1,6 +1,16 @@
1
- <h1><?php _e('Completed Course', 'tutor'); ?></h1>
 
2
  <div class="tutor-dashboard-content-inner">
3
 
 
 
 
 
 
 
 
 
 
4
  <?php
5
  $completed_courses = tutor_utils()->get_courses_by_user();
6
 
1
+ <h3><?php _e('Completed Course', 'tutor'); ?></h3>
2
+
3
  <div class="tutor-dashboard-content-inner">
4
 
5
+ <div class="tutor-dashboard-inline-links">
6
+ <ul>
7
+ <li><a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('enrolled-courses'); ?>"> <?php _e('All Courses'); ?></a> </li>
8
+ <li><a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('enrolled-courses/active-courses'); ?>"> <?php _e('Active Courses'); ?> </a> </li>
9
+ <li class="active"><a href="<?php echo tutor_utils()->get_tutor_dashboard_page_permalink('enrolled-courses/completed-courses'); ?>">
10
+ <?php _e('Completed Courses'); ?> </a> </li>
11
+ </ul>
12
+ </div>
13
+
14
  <?php
15
  $completed_courses = tutor_utils()->get_courses_by_user();
16
 
templates/dashboard/{student/index.php → index.php} RENAMED
@@ -22,7 +22,7 @@ if (isset($wp_query->query_vars['tutor_dashboard_page']) && $wp_query->query_var
22
  <div class="tutor-col-3">
23
  <ul class="tutor-dashboard-permalinks">
24
  <?php
25
- $dashboard_pages = tutor_utils()->tutor_student_dashboard_pages();
26
  foreach ($dashboard_pages as $dashboard_key => $dashboard_page){
27
  if ($dashboard_key === 'index')
28
  $dashboard_key = '';
@@ -36,9 +36,9 @@ if (isset($wp_query->query_vars['tutor_dashboard_page']) && $wp_query->query_var
36
  <div class="tutor-dashboard-content">
37
  <?php
38
  if ($dashboard_page_slug){
39
- tutor_load_template("dashboard.student.".$wp_query->query_vars['tutor_dashboard_page']);
40
  }else{
41
- tutor_load_template("dashboard.student.dashboard");
42
  }
43
  ?>
44
  </div>
22
  <div class="tutor-col-3">
23
  <ul class="tutor-dashboard-permalinks">
24
  <?php
25
+ $dashboard_pages = tutor_utils()->tutor_dashboard_pages();
26
  foreach ($dashboard_pages as $dashboard_key => $dashboard_page){
27
  if ($dashboard_key === 'index')
28
  $dashboard_key = '';
36
  <div class="tutor-dashboard-content">
37
  <?php
38
  if ($dashboard_page_slug){
39
+ tutor_load_template("dashboard.".$wp_query->query_vars['tutor_dashboard_page']);
40
  }else{
41
+ tutor_load_template("dashboard.dashboard");
42
  }
43
  ?>
44
  </div>
templates/dashboard/{student/logged-in.php → logged-in.php} RENAMED
File without changes
templates/dashboard/my-courses.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h3><?php _e('My Courses', 'tutor'); ?></h3>
2
+
3
+ <div class="tutor-dashboard-content-inner">
4
+
5
+ <?php
6
+ $my_courses = tutor_utils()->get_courses_by_instructor(null, 'any');
7
+
8
+ if (is_array($my_courses) && count($my_courses)):
9
+ global $post;
10
+ foreach ($my_courses as $post):
11
+ setup_postdata($post);
12
+
13
+ $avg_rating = tutor_utils()->get_course_rating()->rating_avg;
14
+ ?>
15
+
16
+ <div class="tutor-mycourse-wrap tutor-mycourse-<?php the_ID(); ?>">
17
+
18
+ <div class="tutor-mycourse-thumbnail">
19
+ <?php
20
+ tutor_course_loop_thumbnail();
21
+ ?>
22
+ </div>
23
+
24
+ <div class="tutor-mycourse-content">
25
+
26
+ <div class="tutor-mycourse-rating">
27
+ <?php
28
+ tutor_utils()->star_rating_generator($avg_rating);
29
+ ?>
30
+ </div>
31
+ <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </h3>
32
+ <div class="tutor-meta tutor-course-metadata">
33
+ <?php
34
+ $total_lessons = tutor_utils()->get_lesson_count_by_course();
35
+ $completed_lessons = tutor_utils()->get_completed_lesson_count_by_course();
36
+ ?>
37
+ <ul>
38
+ <li>
39
+ <?php
40
+ _e('Total Lessons:', 'tutor');
41
+ echo "<span>$total_lessons</span>";
42
+ ?>
43
+ </li>
44
+ <li>
45
+ <?php
46
+ _e('Completed Lessons:', 'tutor');
47
+ echo "<span>$completed_lessons / $total_lessons</span>";
48
+ ?>
49
+ </li>
50
+ </ul>
51
+ </div>
52
+
53
+ <div class="mycourse-footer">
54
+ <div class="tutor-mycourse-status">
55
+ <?php echo ucwords($post->post_status); ?>
56
+ </div>
57
+
58
+ <div class="tutor-mycourses-stats">
59
+ <?php
60
+ $course_duration = get_tutor_course_duration_context();
61
+ $course_students = tutor_utils()->count_enrolled_users_by_course();
62
+
63
+ if(!empty($course_duration)) echo "<i class='tutor-icon-clock'></i> <span>$course_duration</span>";
64
+ echo "<i class='tutor-icon-user'></i> <span>$course_students</span>";
65
+ ?>
66
+ </div>
67
+
68
+ <div class="tutor-mycourses-price">
69
+ <?php echo tutor_utils()->get_course_price(); ?>
70
+ </div>
71
+ </div>
72
+ </div>
73
+
74
+ </div>
75
+ <?php
76
+ endforeach;
77
+ else : ?>
78
+ <div>
79
+ <h2><?php _e("Not Found" , 'tutor'); ?></h2>
80
+ <p><?php _e("Sorry, but you are looking for something that isn't here." , 'tutor'); ?></p>
81
+ </div>
82
+ <?php endif; ?>
83
+
84
+
85
+
86
+ </div>
templates/dashboard/my-profile.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ <div class="dashboard-page-title">
4
+ <h3><?php _e('Withdrawal Preference'); ?></h3>
5
+ </div>
6
+
7
+ <div class="tutor-dashboard-content-inner">
8
+ <h4><?php _e('Select a withdraw method', 'tutor'); ?></h4>
9
+
10
+ <form id="tutor-withdraw-account-set-form" action="" method="post">
11
+
12
+ <?php
13
+ $tutor_withdrawal_methods = tutor_withdrawal_methods();
14
+ if (tutor_utils()->count($tutor_withdrawal_methods)){
15
+ $saved_account = tutor_utils()->get_user_withdraw_method();
16
+ $old_method_key = tutor_utils()->avalue_dot('withdraw_method_key', $saved_account);
17
+
18
+ $min_withdraw_amount = tutor_utils()->get_option('min_withdraw_amount');
19
+ ?>
20
+ <div class="withdraw-method-select-wrap">
21
+ <?php
22
+ foreach ($tutor_withdrawal_methods as $method_id => $method){
23
+ ?>
24
+ <div class="withdraw-method-select withdraw-method-<?php echo $method_id; ?>" data-withdraw-method="<?php echo $method_id; ?>">
25
+ <input type="radio" id="withdraw_method_select_<?php echo $method_id; ?>" class="withdraw-method-select-input"
26
+ name="tutor_selected_withdraw_method" value="<?php echo $method_id; ?>" style="display: none;" <?php checked
27
+ ($method_id, $old_method_key) ?> >
28
+
29
+ <label for="withdraw_method_select_<?php echo $method_id; ?>">
30
+ <p><?php echo tutor_utils()->avalue_dot('method_name', $method); ?></p>
31
+
32
+
33
+ <small><?php _e('Min withdraw', 'tutor'); ?> <?php echo tutor_utils()->tutor_price($min_withdraw_amount);
34
+ ?></small>
35
+ </label>
36
+ </div>
37
+ <?php
38
+ }
39
+ ?>
40
+ </div>
41
+
42
+
43
+ <div class="withdraw-method-forms-wrap">
44
+
45
+ <?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?>
46
+ <input type="hidden" value="tutor_save_withdraw_account" name="action"/>
47
+
48
+ <?php do_action('tutor_withdraw_set_account_form_before'); ?>
49
+
50
+ <?php
51
+ foreach ($tutor_withdrawal_methods as $method_id => $method){
52
+ $form_fields = tutor_utils()->avalue_dot('form_fields', $method);
53
+ ?>
54
+
55
+ <div id="withdraw-method-form-<?php echo $method_id; ?>" class="withdraw-method-form withdraw-method-form-<?php echo $method_id;
56
+ ?>" style="display: none;">
57
+
58
+
59
+ <?php do_action("tutor_withdraw_set_account_{$method_id}_before"); ?>
60
+
61
+ <?php
62
+ if (tutor_utils()->count($form_fields)){
63
+ foreach ($form_fields as $field_name => $field){
64
+ ?>
65
+ <div class="withdraw-method-field-wrap withdraw-method-field-<?php echo $field_name; ?>">
66
+ <?php
67
+ if (! empty($field['label'])){
68
+ echo "<label for='field_{$method_id}_$field_name'>{$field['label']}</label>";
69
+ }
70
+
71
+ $passing_data = apply_filters('tutor_withdraw_account_field_type_data', array(
72
+ 'method_id' => $method_id,
73
+ 'method' => $method,
74
+ 'field_name' => $field_name,
75
+ 'field' => $field,
76
+ 'old_value' => null,
77
+ ));
78
+ $old_value = tutor_utils()->avalue_dot($field_name.".value", $saved_account);
79
+ if ($old_value){
80
+ $passing_data['old_value'] = $old_value;
81
+ }
82
+
83
+ tutor_load_template("dashboard.withdraw-method-fields.{$field['type']}", $passing_data);
84
+
85
+ if ( ! empty($field['desc'])){
86
+ echo "<p class='withdraw-field-desc'>{$field['desc']}</p>";
87
+ }
88
+ ?>
89
+ </div>
90
+ <?php
91
+ }
92
+ }
93
+ ?>
94
+
95
+ <?php do_action("tutor_withdraw_set_account_{$method_id}_after"); ?>
96
+
97
+ <div class="withdraw-account-save-btn-wrap">
98
+ <button type="submit" class="tutor_set_withdraw_account_btn" name="withdraw_btn_submit"><?php _e('Save Withdraw Account', 'tutor'); ?></button>
99
+ </div>
100
+
101
+ </div>
102
+
103
+ <?php
104
+ }
105
+ ?>
106
+
107
+ <?php do_action('tutor_withdraw_set_account_form_after'); ?>
108
+
109
+ </div>
110
+
111
+ <?php
112
+ }
113
+ ?>
114
+ </form>
115
+
116
+ </div>
templates/dashboard/my-reviews.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * My Own reviews
4
+ *
5
+ * @since v.1.1.2
6
+ *
7
+ * @author Themeum
8
+ * @url https://themeum.com
9
+ * @package Tutor
10
+ */
11
+
12
+ $reviews = tutor_utils()->get_reviews_by_user();
13
+
14
+ if ( ! is_array($reviews) || ! count($reviews)){ ?>
15
+ <div>
16
+ <h2><?php _e("Not Found" , 'tutor'); ?></h2>
17
+ <p><?php _e("Sorry, but you are looking for something that isn't here." , 'tutor'); ?></p>
18
+ </div>
19
+ <?php
20
+ return;
21
+ }
22
+ ?>
23
+
24
+ <div class=" tutor-course-reviews-wrap">
25
+ <div class="course-target-reviews-title">
26
+ <h4><?php _e(sprintf("My Reviews"), 'tutor'); ?></h4>
27
+ </div>
28
+
29
+ <div class="tutor-reviews-list">
30
+ <?php
31
+ foreach ($reviews as $review){
32
+ $profile_url = tutor_utils()->profile_url($review->user_id);
33
+ ?>
34
+ <div class="tutor-review-individual-item tutor-review-<?php echo $review->comment_ID; ?>">
35
+
36
+ <div class="individual-review-course-name">
37
+ <?php _e('On', 'tutor'); ?>
38
+ <a href="<?php echo get_the_permalink($review->comment_post_ID); ?>"><?php echo get_the_title($review->comment_post_ID); ?></a>
39
+ <p class="review-meta"><?php _e(sprintf('%s ago', human_time_diff(strtotime($review->comment_date))), 'tutor'); ?></p>
40
+ </div>
41
+
42
+ <div class="individual-review-rating-wrap">
43
+ <?php tutor_utils()->star_rating_generator($review->rating); ?>
44
+ </div>
45
+ <?php echo wpautop($review->comment_content); ?>
46
+
47
+ </div>
48
+ <?php
49
+ }
50
+ ?>
51
+ </div>
52
+ </div>
templates/dashboard/quiz-attempts.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Quiz Attempts, I attempted to courses
4
+ *
5
+ * @since v.1.1.2
6
+ *
7
+ * @author Themeum
8
+ * @url https://themeum.com
9
+ * @package Tutor
10
+ */
11
+
12
+ $previous_attempts = tutor_utils()->get_all_quiz_attempts_by_user();
13
+ $attempted_count = is_array($previous_attempts) ? count($previous_attempts) : 0;
14
+ ?>
15
+ <div class="tutor-dashboard-page-title">
16
+ <h2><?php _e('My Quiz Attempts', 'tutor'); ?></h2>
17
+ </div>
18
+ <?php
19
+ if ($attempted_count){
20
+ ?>
21
+ <div class="tutor-quiz-attempt-history">
22
+ <table>
23
+ <tr>
24
+ <th><?php _e('Course Title', 'tutor'); ?></th>
25
+ <th><?php _e('Time', 'tutor'); ?></th>
26
+ <th><?php _e('Questions', 'tutor'); ?></th>
27
+ <th><?php _e('Total Marks', 'tutor'); ?></th>
28
+ <th><?php _e('Earned Marks', 'tutor'); ?></th>
29
+ <th><?php _e('Pass Mark', 'tutor'); ?></th>
30
+ <th><?php _e('Result', 'tutor'); ?></th>
31
+ </tr>
32
+ <?php
33
+ foreach ( $previous_attempts as $attempt){
34
+ $passing_grade = tutor_utils()->get_quiz_option($attempt->course_id, 'passing_grade', 0);
35
+ ?>
36
+ <tr>
37
+ <td><a href="<?php echo get_the_permalink($attempt->course_id); ?>" target="_blank"><?php echo get_the_title($attempt->course_id); ?></a>
38
+ </td>
39
+ <td>
40
+ <?php
41
+ echo date_i18n(get_option('date_format'), strtotime($attempt->attempt_started_at)).' '.date_i18n(get_option('time_format'), strtotime($attempt->attempt_started_at));
42
+
43
+ if ($attempt->is_manually_reviewed){
44
+ ?>
45
+ <p class="attempt-reviewed-text">
46
+ <?php
47
+ echo __('Manually reviewed at', 'tutor').' <br /> '.date_i18n(get_option('date_format', strtotime($attempt->manually_reviewed_at))).' '.date_i18n(get_option('time_format', strtotime($attempt->manually_reviewed_at)));
48
+ ?>
49
+ </p>
50
+ <?php
51
+ }
52
+ ?>
53
+ </td>
54
+ <td><?php echo $attempt->total_questions; ?> </td>
55
+ <td> <?php echo $attempt->total_marks; ?> </td>
56
+
57
+ <td>
58
+ <?php
59
+ $earned_percentage = $attempt->earned_marks > 0 ? ( number_format(($attempt->earned_marks * 100) / $attempt->total_marks)) : 0;
60
+ echo $attempt->earned_marks."({$earned_percentage}%)";
61
+ ?>
62
+ </td>
63
+
64
+ <td>
65
+ <?php
66
+ $pass_marks = ($attempt->total_marks * $passing_grade) / 100;
67
+ if ($pass_marks > 0){
68
+ echo number_format_i18n($pass_marks, 2);
69
+ }
70
+ echo "({$passing_grade}%)";
71
+ ?>
72
+ </td>
73
+
74
+ <td>
75
+ <?php
76
+ if ($earned_percentage >= $passing_grade){
77
+ echo '<span class="result-pass">'.__('Pass', 'tutor').'</span>';
78
+ }else{
79
+ echo '<span class="result-fail">'.__('Fail', 'tutor').'</span>';
80
+ }
81
+ ?>
82
+ </td>
83
+ </tr>
84
+ <?php
85
+ }
86
+ ?>
87
+
88
+ </table>
89
+ </div>
90
+
91
+ <?php } ?>
templates/dashboard/{student/registration.php → registration.php} RENAMED
File without changes
templates/dashboard/student/my-courses.php DELETED
@@ -1,53 +0,0 @@
1
- <h1><?php _e('My Courses', 'tutor'); ?></h1>
2
-
3
- <div class="tutor-dashboard-content-inner">
4
- <?php
5
- $my_courses = tutor_utils()->get_enrolled_courses_by_user();
6
-
7
- if ($my_courses && $my_courses->have_posts()):
8
- while ($my_courses->have_posts()):
9
- $my_courses->the_post();
10
- $avg_rating = tutor_utils()->get_course_rating()->rating_avg;
11
- ?>
12
- <div class="tutor-mycourse-wrap tutor-mycourse-<?php the_ID(); ?>">
13
- <div class="tutor-mycourse-rating">
14
- <?php
15
- tutor_utils()->star_rating_generator($avg_rating);
16
- ?>
17
- </div>
18
- <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </h3>
19
- <div class="tutor-meta tutor-course-metadata">
20
- <?php
21
- $total_lessons = tutor_utils()->get_lesson_count_by_course();
22
- $completed_lessons = tutor_utils()->get_completed_lesson_count_by_course();
23
- ?>
24
- <ul>
25
- <li>
26
- <?php
27
- _e('Total Lessons:', 'tutor');
28
- echo "<span>$total_lessons</span>";
29
- ?>
30
- </li>
31
- <li>
32
- <?php
33
- _e('Completed Lessons:', 'tutor');
34
- echo "<span>$completed_lessons / $total_lessons</span>";
35
- ?>
36
- </li>
37
- </ul>
38
- </div>
39
- <?php tutor_course_completing_progress_bar(); ?>
40
- <?php the_excerpt(); ?>
41
- </div>
42
-
43
- <?php
44
- endwhile;
45
-
46
- wp_reset_postdata();
47
- else:
48
- echo "<div class='tutor-mycourse-wrap'>You didn't purchased any course</div>";
49
- endif;
50
-
51
- ?>
52
-
53
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/dashboard/{student/wishlist.php → wishlist.php} RENAMED
@@ -1,7 +1,7 @@
1
  <?php global $post; ?>
2
 
3
 
4
- <h1><?php _e('WishList', 'tutor'); ?></h1>
5
  <div class="tutor-dashboard-content-inner">
6
 
7
  <?php
1
  <?php global $post; ?>
2
 
3
 
4
+ <h1><?php _e('Wishlist', 'tutor'); ?></h1>
5
  <div class="tutor-dashboard-content-inner">
6
 
7
  <?php
templates/dashboard/withdraw-method-fields/number.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+
2
+ <input type="number" name="withdraw_method_field[<?php echo $method_id ?>][<?php echo $field_name ?>]" value="<?php echo $old_value; ?>">
templates/dashboard/withdraw-method-fields/text.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+
2
+ <input type="text" name="withdraw_method_field[<?php echo $method_id ?>][<?php echo $field_name ?>]" value="<?php echo $old_value; ?>" >
templates/dashboard/withdraw-method-fields/textarea.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+
2
+ <textarea name="withdraw_method_field[<?php echo $method_id ?>][<?php echo $field_name ?>]"><?php echo $old_value; ?></textarea>
templates/dashboard/withdraw.php ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $earning_sum = tutor_utils()->get_earning_sum();
3
+ $min_withdraw = tutor_utils()->get_option('min_withdraw_amount');
4
+
5
+ $saved_account = tutor_utils()->get_user_withdraw_method();
6
+ $withdraw_method_name = tutor_utils()->avalue_dot('withdraw_method_name', $saved_account);
7
+
8
+ $user_id = get_current_user_id();
9
+ ?>
10
+
11
+ <div class="tutor-dashboard-content-inner">
12
+
13
+ <div class="withdraw-page-current-balance">
14
+ <h4><?php _e('Current Balance', 'tutor'); ?></h4>
15
+
16
+ <div class="withdraw-balance-row">
17
+
18
+ <?php
19
+ $balance_formatted = tutor_utils()->tutor_price($earning_sum->balance);
20
+ if ($earning_sum->balance >= $min_withdraw){
21
+ ?>
22
+ <p class="withdraw-balance-col">
23
+ <?php echo sprintf( __('You currently have %s %s %s ready to withdraw', 'tutor'), "<strong class='available_balance'>", $balance_formatted, '</strong>' ); ?>
24
+ </p>
25
+
26
+ <?php if ($withdraw_method_name) { ?>
27
+ <p><a class="open-withdraw-form-btn" href="javascript:;"><?php _e( 'Make a withdraw', 'tutor' ); ?></a></p>
28
+ <?php
29
+ }
30
+ }else{
31
+ ?>
32
+
33
+ <p class="withdraw-balance-col"> <?php echo sprintf( __('You currently have %s %s %s and this is insufficient balance to withdraw',
34
+ 'tutor'), "<strong class='available_balance'>", $balance_formatted, '</strong>' ); ?>
35
+ </p>
36
+
37
+ <?php
38
+ }
39
+ ?>
40
+
41
+ </div>
42
+
43
+ <div class="current-withdraw-account-wrap">
44
+ <?php
45
+ if ($withdraw_method_name){
46
+ ?>
47
+ <p>
48
+ <?php _e('You will get paid by', 'tutor'); ?> <strong><?php echo $withdraw_method_name; ?></strong>
49
+ </p>
50
+ <p>
51
+ <?php
52
+ $my_profile_url = tutor_utils()->get_tutor_dashboard_page_permalink('my-profile');
53
+ echo sprintf(__( 'You can change your %s withdraw preference %s ' , 'tutor'), "<a href='{$my_profile_url}'>", '</a>' );
54
+ ?>
55
+ </p>
56
+ <?php
57
+ }else{
58
+ ?>
59
+ <p>
60
+ <?php
61
+ $my_profile_url = tutor_utils()->get_tutor_dashboard_page_permalink('my-profile');
62
+ echo sprintf(__( 'Please add your %s withdraw preference %s to make withdraw' , 'tutor'), "<a href='{$my_profile_url}'>", '</a>' );
63
+ ?>
64
+ </p>
65
+ <?php
66
+ }
67
+ ?>
68
+ </div>
69
+
70
+ </div>
71
+
72
+ <?php
73
+ if ($earning_sum->balance >= $min_withdraw && $withdraw_method_name){
74
+ ?>
75
+
76
+ <div class="tutor-earning-withdraw-form-wrap" style="display: none;">
77
+
78
+ <form id="tutor-earning-withdraw-form" action="" method="post">
79
+ <?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?>
80
+ <input type="hidden" value="tutor_make_an_withdraw" name="action"/>
81
+
82
+ <p><?php _e('Enter withdraw amount and click withdraw button', 'tutor'); ?></p>
83
+
84
+ <?php do_action('tutor_withdraw_form_before'); ?>
85
+
86
+ <div class="withdraw-form-field-row">
87
+ <div class="withdraw-form-field-amount">
88
+ <input type="text" name="tutor_withdraw_amount">
89
+ </div>
90
+ <div class="withdraw-form-field-button">
91
+ <button type="submit" id="tutor-earning-withdraw-btn" name="withdraw-form-submit"><?php _e('Withdraw', 'tutor'); ?></button>
92
+ </div>
93
+ </div>
94
+
95
+ <div id="tutor-withdraw-form-response"></div>
96
+
97
+ <?php do_action('tutor_withdraw_form_after'); ?>
98
+ </form>
99
+
100
+ </div>
101
+
102
+ <?php
103
+ }
104
+ ?>
105
+
106
+
107
+ <?php
108
+ $withdraw_pending_histories = tutor_utils()->get_withdrawals_history(null, array('status' => array('pending')));
109
+ $withdraw_completed_histories = tutor_utils()->get_withdrawals_history(null, array('status' => array('approved')));
110
+ $withdraw_rejected_histories = tutor_utils()->get_withdrawals_history(null, array('status' => array('rejected')));
111
+ ?>
112
+
113
+ <div class="withdraw-history-table-wrap">
114
+ <div class="withdraw-history-table-title">
115
+ <h4> <?php _e('Pending Withdrawals', 'tutor'); ?></h4>
116
+ </div>
117
+
118
+ <?php
119
+ if (tutor_utils()->count($withdraw_pending_histories->results)){
120
+ ?>
121
+ <table class="withdrawals-history">
122
+ <thead>
123
+ <tr>
124
+ <th><?php _e('Amount', 'tutor') ?></th>
125
+ <th><?php _e('Withdraw Method', 'tutor') ?></th>
126
+ <th><?php _e('Date', 'tutor') ?></th>
127
+ </tr>
128
+ </thead>
129
+ <?php
130
+ foreach ($withdraw_pending_histories->results as $withdraw_history){
131
+ ?>
132
+ <tr>
133
+ <td><?php echo tutor_utils()->tutor_price($withdraw_history->amount); ?></td>
134
+ <td>
135
+ <?php
136
+ $method_data = maybe_unserialize($withdraw_history->method_data);
137
+ echo tutor_utils()->avalue_dot('withdraw_method_name', $method_data)
138
+ ?>
139
+ </td>
140
+ <td>
141
+ <?php
142
+ echo date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime($withdraw_history->created_at));
143
+ ?>
144
+ </td>
145
+ </tr>
146
+ <?php
147
+ }
148
+ ?>
149
+ </table>
150
+ <?php
151
+ }else{
152
+ ?>
153
+ <p><?php _e('No withdrawals pending yet', 'tutor'); ?></p>
154
+ <?php
155
+ }
156
+ ?>
157
+ </div>
158
+
159
+ <div class="withdraw-history-table-wrap">
160
+ <div class="withdraw-history-table-title">
161
+ <h4> <?php _e('Completed Withdrawals', 'tutor'); ?></h4>
162
+ </div>
163
+
164
+ <?php
165
+ if (tutor_utils()->count($withdraw_completed_histories->results)){
166
+ ?>
167
+ <table class="withdrawals-history">
168
+ <thead>
169
+ <tr>
170
+ <th><?php _e('Amount', 'tutor') ?></th>
171
+ <th><?php _e('Withdraw Method', 'tutor') ?></th>
172
+ <th><?php _e('Requested At', 'tutor') ?></th>
173
+ <th><?php _e('Approved At', 'tutor') ?></th>
174
+ </tr>
175
+ </thead>
176
+ <?php
177
+ foreach ($withdraw_completed_histories->results as $withdraw_history){
178
+ ?>
179
+ <tr>
180
+ <td><?php echo tutor_utils()->tutor_price($withdraw_history->amount); ?></td>
181
+ <td>
182
+ <?php
183
+ $method_data = maybe_unserialize($withdraw_history->method_data);
184
+ echo tutor_utils()->avalue_dot('withdraw_method_name', $method_data)
185
+ ?>
186
+ </td>
187
+ <td>
188
+ <?php
189
+ echo date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime($withdraw_history->created_at));
190
+ ?>
191
+ </td>
192
+
193
+ <td>
194
+ <?php
195
+ if ($withdraw_history->updated_at){
196
+ echo date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime($withdraw_history->updated_at));
197
+ }
198
+ ?>
199
+ </td>
200
+ </tr>
201
+ <?php
202
+ }
203
+ ?>
204
+ </table>
205
+ <?php
206
+ }else{
207
+ ?>
208
+ <p><?php _e('No withdrawals completed yet', 'tutor'); ?></p>
209
+ <?php
210
+ }
211
+ ?>
212
+ </div>
213
+
214
+
215
+ <div class="withdraw-history-table-wrap">
216
+ <div class="withdraw-history-table-title">
217
+ <h4> <?php _e('Rejected Withdrawals', 'tutor'); ?></h4>
218
+ </div>
219
+
220
+ <?php
221
+ if (tutor_utils()->count($withdraw_rejected_histories->results)){
222
+ ?>
223
+ <table class="withdrawals-history">
224
+ <thead>
225
+ <tr>
226
+ <th><?php _e('Amount', 'tutor') ?></th>
227
+ <th><?php _e('Withdraw Method', 'tutor') ?></th>
228
+ <th><?php _e('Requested At', 'tutor') ?></th>
229
+ <th><?php _e('Rejected At', 'tutor') ?></th>
230
+ </tr>
231
+ </thead>
232
+ <?php
233
+ foreach ($withdraw_rejected_histories->results as $withdraw_history){
234
+ ?>
235
+ <tr>
236
+ <td><?php echo tutor_utils()->tutor_price($withdraw_history->amount); ?></td>
237
+ <td>
238
+ <?php
239
+ $method_data = maybe_unserialize($withdraw_history->method_data);
240
+ echo tutor_utils()->avalue_dot('withdraw_method_name', $method_data)
241
+ ?>
242
+ </td>
243
+ <td>
244
+ <?php
245
+ echo date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime($withdraw_history->created_at));
246
+ ?>
247
+ </td>
248
+
249
+ <td>
250
+ <?php
251
+ if ($withdraw_history->updated_at){
252
+ echo date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime($withdraw_history->updated_at));
253
+ }
254
+ ?>
255
+ </td>
256
+ </tr>
257
+ <?php
258
+ }
259
+ ?>
260
+ </table>
261
+ <?php
262
+ }else{
263
+ ?>
264
+ <p><?php _e('No withdrawals rejected yet', 'tutor'); ?></p>
265
+ <?php
266
+ }
267
+ ?>
268
+ </div>
269
+
270
+
271
+ </div>
templates/loop/course-price-edd.php CHANGED
@@ -13,12 +13,12 @@
13
  <?php
14
  $course_id = get_the_ID();
15
  $enroll_btn = '<div class="tutor-loop-cart-btn-wrap"><a href="'. get_the_permalink(). '">'.__('Get Enrolled', 'tutor'). '</a></div>';
16
- $price_html = '<p class="price"> '.__('Free', 'tutor').$enroll_btn. '</p>';
17
  if (tutor_utils()->is_course_purchasable()) {
18
  $enroll_btn = tutor_course_loop_add_to_cart(false);
19
 
20
  $product_id = tutor_utils()->get_course_product_id($course_id);
21
- $price_html = '<p class="price"> '.$enroll_btn.' </p>';
22
  }
23
 
24
  echo $price_html;
13
  <?php
14
  $course_id = get_the_ID();
15
  $enroll_btn = '<div class="tutor-loop-cart-btn-wrap"><a href="'. get_the_permalink(). '">'.__('Get Enrolled', 'tutor'). '</a></div>';
16
+ $price_html = '<div class="price"> '.__('Free', 'tutor').$enroll_btn. '</div>';
17
  if (tutor_utils()->is_course_purchasable()) {
18
  $enroll_btn = tutor_course_loop_add_to_cart(false);
19
 
20
  $product_id = tutor_utils()->get_course_product_id($course_id);
21
+ $price_html = '<div class="price"> '.$enroll_btn.' </div>';
22
  }
23
 
24
  echo $price_html;
templates/loop/course-price-woocommerce.php CHANGED
@@ -13,7 +13,7 @@
13
  <?php
14
  $course_id = get_the_ID();
15
  $enroll_btn = '<div class="tutor-loop-cart-btn-wrap"><a href="'. get_the_permalink(). '">'.__('Get Enrolled', 'tutor'). '</a></div>';
16
- $price_html = '<p class="price"> '.__('Free', 'tutor').$enroll_btn. '</p>';
17
  if (tutor_utils()->is_course_purchasable()) {
18
  $enroll_btn = tutor_course_loop_add_to_cart(false);
19
 
@@ -21,7 +21,7 @@
21
  $product = wc_get_product( $product_id );
22
 
23
  if ( $product ) {
24
- $price_html = '<p class="price"> '.$product->get_price_html().$enroll_btn.' </p>';
25
  }
26
  }
27
 
13
  <?php
14
  $course_id = get_the_ID();
15
  $enroll_btn = '<div class="tutor-loop-cart-btn-wrap"><a href="'. get_the_permalink(). '">'.__('Get Enrolled', 'tutor'). '</a></div>';
16
+ $price_html = '<div class="price"> '.__('Free', 'tutor').$enroll_btn. '</div>';
17
  if (tutor_utils()->is_course_purchasable()) {
18
  $enroll_btn = tutor_course_loop_add_to_cart(false);
19
 
21
  $product = wc_get_product( $product_id );
22
 
23
  if ( $product ) {
24
+ $price_html = '<div class="price"> '.$product->get_price_html().$enroll_btn.' </div>';
25
  }
26
  }
27
 
templates/loop/course-price.php CHANGED
@@ -13,7 +13,7 @@
13
  <?php
14
  $course_id = get_the_ID();
15
  $enroll_btn = '<div class="tutor-loop-cart-btn-wrap"><a href="'. get_the_permalink(). '">'.__('Get Enrolled', 'tutor'). '</a></div>';
16
- $price_html = '<p class="price"> '.__('Free', 'tutor').$enroll_btn. '</p>';
17
  if (tutor_utils()->is_course_purchasable()) {
18
  $enroll_btn = tutor_course_loop_add_to_cart(false);
19
 
@@ -21,7 +21,7 @@
21
  $product = wc_get_product( $product_id );
22
 
23
  if ( $product ) {
24
- $price_html = '<p class="price"> '.$product->get_price_html().$enroll_btn.' </p>';
25
  }
26
  }
27
  echo $price_html;
13
  <?php
14
  $course_id = get_the_ID();
15
  $enroll_btn = '<div class="tutor-loop-cart-btn-wrap"><a href="'. get_the_permalink(). '">'.__('Get Enrolled', 'tutor'). '</a></div>';
16
+ $price_html = '<div class="price"> '.__('Free', 'tutor').$enroll_btn. '</div>';
17
  if (tutor_utils()->is_course_purchasable()) {
18
  $enroll_btn = tutor_course_loop_add_to_cart(false);
19
 
21
  $product = wc_get_product( $product_id );
22
 
23
  if ( $product ) {
24
+ $price_html = '<div class="price"> '.$product->get_price_html().$enroll_btn.' </div>';
25
  }
26
  }
27
  echo $price_html;
templates/loop/rating.php CHANGED
@@ -18,4 +18,11 @@ if ( ! defined( 'ABSPATH' ) ) {
18
  $course_rating = tutor_utils()->get_course_rating();
19
  tutor_utils()->star_rating_generator($course_rating->rating_avg);
20
  ?>
 
 
 
 
 
 
21
  </div>
 
18
  $course_rating = tutor_utils()->get_course_rating();
19
  tutor_utils()->star_rating_generator($course_rating->rating_avg);
20
  ?>
21
+ <span class="tutor-rating-count">
22
+ <?php
23
+ echo $course_rating->rating_avg;
24
+ echo '<i>('.$course_rating->rating_count.')</i>';
25
+ ?>
26
+ </span>
27
  </div>
28
+
templates/single-quiz.php CHANGED
@@ -23,25 +23,23 @@ $course = tutor_utils()->get_course_by_quiz(get_the_ID());
23
  </div>
24
 
25
 
26
- <div id="tutor-single-entry-content" class="tutor-quiz-single-entry-wrap tutor-single-entry-content tutor-container">
27
  <input type="hidden" name="tutor_quiz_id" id="tutor_quiz_id" value="<?php the_ID(); ?>">
28
 
29
-
30
  <div class="tutor-single-page-top-bar">
31
  <div class="tutor-topbar-item tutor-hide-sidebar-bar">
32
  <a href="javascript:;" class="tutor-lesson-sidebar-hide-bar"><i class="tutor-icon-menu-2"></i> </a>
33
- </div>
34
- <div class="tutor-topbar-item tutor-topbar-content-title-wrap">
35
- <?php
36
- tutor_utils()->get_lesson_type_icon(get_the_ID(), true, true);
37
- the_title(); ?>
38
- </div>
39
-
40
- <div class="tutor-topbar-item tutor-topbar-back-to-curse-wrap">
41
  <a href="<?php echo get_the_permalink($course->ID); ?>">
42
  <i class="tutor-icon-next-2"></i> <?php echo sprintf(__('Go to %s Course Home %s', 'tutor'), '<strong>', '</strong>') ; ?>
43
  </a>
44
  </div>
 
 
 
 
 
 
 
45
  </div>
46
 
47
 
23
  </div>
24
 
25
 
26
+ <div id="tutor-single-entry-content" class="tutor-quiz-single-entry-wrap tutor-single-entry-content">
27
  <input type="hidden" name="tutor_quiz_id" id="tutor_quiz_id" value="<?php the_ID(); ?>">
28
 
 
29
  <div class="tutor-single-page-top-bar">
30
  <div class="tutor-topbar-item tutor-hide-sidebar-bar">
31
  <a href="javascript:;" class="tutor-lesson-sidebar-hide-bar"><i class="tutor-icon-menu-2"></i> </a>
 
 
 
 
 
 
 
 
32
  <a href="<?php echo get_the_permalink($course->ID); ?>">
33
  <i class="tutor-icon-next-2"></i> <?php echo sprintf(__('Go to %s Course Home %s', 'tutor'), '<strong>', '</strong>') ; ?>
34
  </a>
35
  </div>
36
+ <div class="tutor-topbar-item tutor-topbar-content-title-wrap">
37
+ <?php
38
+ tutor_utils()->get_lesson_type_icon(get_the_ID(), true, true);
39
+ the_title(); ?>
40
+ </div>
41
+
42
+ <div class="tutor-topbar-item tutor-topbar-mark-to-done" style="width: 150px;"></div>
43
  </div>
44
 
45
 
templates/single/course/course-topics.php CHANGED
@@ -57,7 +57,7 @@ $course_id = get_the_ID();
57
  </div>
58
 
59
 
60
- <div class="tutor-course-lessons">
61
 
62
  <?php
63
  $lessons = tutor_utils()->get_course_contents_by_topic(get_the_ID());
57
  </div>
58
 
59
 
60
+ <div class="tutor-course-lessons" style="<?php echo $index > 1 ? 'display: none' : ''; ?>">
61
 
62
  <?php
63
  $lessons = tutor_utils()->get_course_contents_by_topic(get_the_ID());
templates/single/course/enrolled/announcements.php CHANGED
@@ -7,7 +7,6 @@
7
  * @url https://themeum.com
8
  */
9
 
10
-
11
  $announcements = tutor_utils()->get_announcements(get_the_ID());
12
  ?>
13
 
7
  * @url https://themeum.com
8
  */
9
 
 
10
  $announcements = tutor_utils()->get_announcements(get_the_ID());
11
  ?>
12
 
templates/single/course/login.php CHANGED
@@ -15,7 +15,6 @@ if ( ! defined( 'ABSPATH' ) )
15
  <div class="tutor-single-course-segment tutor-course-login-wrap">
16
  <div class="course-login-title">
17
  <h4><?php _e('Login', 'tutor'); ?></h4>
18
- <p>Access to the most powerful tool in the entire design and web industry.</p>
19
  </div>
20
 
21
  <div class="tutor-single-course-login-form">
15
  <div class="tutor-single-course-segment tutor-course-login-wrap">
16
  <div class="course-login-title">
17
  <h4><?php _e('Login', 'tutor'); ?></h4>
 
18
  </div>
19
 
20
  <div class="tutor-single-course-login-form">
templates/single/course/wc-price-html.php CHANGED
@@ -14,12 +14,12 @@ $is_purchasable = tutor_utils()->is_course_purchasable();
14
  $price = apply_filters('get_tutor_course_price', null, get_the_ID());
15
 
16
  if ($is_purchasable && $price){
17
- echo '<p class="price">'.$price.'</p>';
18
  }else{
19
  ?>
20
- <p class="price">
21
  <?php _e('Free', 'tutor'); ?>
22
- </p>
23
  <?php
24
  }
25
  ?>
14
  $price = apply_filters('get_tutor_course_price', null, get_the_ID());
15
 
16
  if ($is_purchasable && $price){
17
+ echo '<div class="price">'.$price.'</div>';
18
  }else{
19
  ?>
20
+ <div class="price">
21
  <?php _e('Free', 'tutor'); ?>
22
+ </div>
23
  <?php
24
  }
25
  ?>
templates/single/lesson/content.php CHANGED
@@ -28,6 +28,10 @@ if ($best_watch_time > 0){
28
  <div class="tutor-single-page-top-bar">
29
  <div class="tutor-topbar-item tutor-hide-sidebar-bar">
30
  <a href="javascript:;" class="tutor-lesson-sidebar-hide-bar"><i class="tutor-icon-menu-2"></i> </a>
 
 
 
 
31
  </div>
32
  <div class="tutor-topbar-item tutor-topbar-content-title-wrap">
33
  <?php
@@ -35,14 +39,11 @@ if ($best_watch_time > 0){
35
  the_title(); ?>
36
  </div>
37
 
38
- <div class="tutor-topbar-item tutor-topbar-back-to-curse-wrap">
39
- <?php
40
- $course_id = get_post_meta(get_the_ID(), '_tutor_course_id_for_lesson', true);
41
- ?>
42
- <a href="<?php echo get_the_permalink($course_id); ?>">
43
- <i class="tutor-icon-next-2"></i> <?php echo sprintf(__('Go to %s Course Home %s', 'tutor'), '<strong>', '</strong>') ; ?>
44
- </a>
45
  </div>
 
 
46
  </div>
47
 
48
 
@@ -52,8 +53,6 @@ if ($best_watch_time > 0){
52
  <?php tutor_lesson_video(); ?>
53
  <?php the_content(); ?>
54
  <?php get_tutor_posts_attachments(); ?>
55
- <?php tutor_lesson_mark_complete_html(); ?>
56
-
57
  </div>
58
 
59
  <?php
28
  <div class="tutor-single-page-top-bar">
29
  <div class="tutor-topbar-item tutor-hide-sidebar-bar">
30
  <a href="javascript:;" class="tutor-lesson-sidebar-hide-bar"><i class="tutor-icon-menu-2"></i> </a>
31
+ <?php $course_id = get_post_meta(get_the_ID(), '_tutor_course_id_for_lesson', true); ?>
32
+ <a href="<?php echo get_the_permalink($course_id); ?>" class="tutor-topbar-home-btn">
33
+ <i class="tutor-icon-next-2"></i> <?php echo __('Go to Course Home', 'tutor') ; ?>
34
+ </a>
35
  </div>
36
  <div class="tutor-topbar-item tutor-topbar-content-title-wrap">
37
  <?php
39
  the_title(); ?>
40
  </div>
41
 
42
+ <div class="tutor-topbar-item tutor-topbar-mark-to-done">
43
+ <?php tutor_lesson_mark_complete_html(); ?>
 
 
 
 
 
44
  </div>
45
+
46
+
47
  </div>
48
 
49
 
53
  <?php tutor_lesson_video(); ?>
54
  <?php the_content(); ?>
55
  <?php get_tutor_posts_attachments(); ?>
 
 
56
  </div>
57
 
58
  <?php
templates/single/lesson/sidebar_question_and_answer.php CHANGED
@@ -156,7 +156,7 @@ $course_id = get_post_meta($post->ID, '_tutor_course_id_for_lesson', true);
156
  </div>
157
 
158
  <div class="tutor-form-group">
159
- <button type="submit" class="tutor_ask_question_btn" name="tutor_question_search_btn"><?php _e('Submit My Question', 'tutor'); ?></button>
160
  </div>
161
  </form>
162
  </div>
156
  </div>
157
 
158
  <div class="tutor-form-group">
159
+ <button type="submit" class="tutor_ask_question_btn tutor-button tutor-success" name="tutor_question_search_btn"><?php _e('Submit My Question', 'tutor'); ?></button>
160
  </div>
161
  </form>
162
  </div>
templates/single/quiz/single_quiz_contents.php CHANGED
@@ -4,24 +4,44 @@ $course = tutor_utils()->get_course_by_quiz(get_the_ID());
4
  ?>
5
 
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  <div class="tutor-single-page-top-bar">
9
  <div class="tutor-topbar-item tutor-hide-sidebar-bar">
10
  <a href="javascript:;" class="tutor-lesson-sidebar-hide-bar"><i class="tutor-icon-menu-2"></i> </a>
11
- </div>
12
- <div class="tutor-topbar-item tutor-topbar-content-title-wrap">
13
- <?php
14
- tutor_utils()->get_lesson_type_icon(get_the_ID(), true, true);
15
- the_title(); ?>
16
- </div>
17
-
18
- <div class="tutor-topbar-item tutor-topbar-back-to-curse-wrap">
19
  <a href="<?php echo get_the_permalink($course->ID); ?>">
20
  <i class="tutor-icon-next-2"></i> <?php echo sprintf(__('Go to %s Course Home %s', 'tutor'), '<strong>', '</strong>') ; ?>
21
  </a>
22
  </div>
 
 
 
 
 
 
 
23
  </div>
24
 
 
25
  <div class="tutor-quiz-single-wrap ">
26
  <input type="hidden" name="tutor_quiz_id" id="tutor_quiz_id" value="<?php the_ID(); ?>">
27
 
4
  ?>
5
 
6
 
7
+ <!---->
8
+ <!--<div class="tutor-single-page-top-bar">-->
9
+ <!-- <div class="tutor-topbar-item tutor-hide-sidebar-bar">-->
10
+ <!-- <a href="javascript:;" class="tutor-lesson-sidebar-hide-bar"><i class="tutor-icon-menu-2"></i> </a>-->
11
+ <!-- </div>-->
12
+ <!---->
13
+ <!-- -->
14
+ <!---->
15
+ <!-- <div class="tutor-topbar-item tutor-topbar-content-title-wrap">-->
16
+ <!-- --><?php
17
+ // tutor_utils()->get_lesson_type_icon(get_the_ID(), true, true);
18
+ // the_title(); ?>
19
+ <!-- </div>-->
20
+ <!---->
21
+ <!-- <div class="tutor-topbar-item tutor-topbar-back-to-curse-wrap">-->
22
+ <!-- <a href="--><?php //echo get_the_permalink($course->ID); ?><!--">-->
23
+ <!-- <i class="tutor-icon-next-2"></i> --><?php //echo sprintf(__('Go to %s Course Home %s', 'tutor'), '<strong>', '</strong>') ; ?>
24
+ <!-- </a>-->
25
+ <!-- </div>-->
26
+ <!--</div>-->
27
 
28
  <div class="tutor-single-page-top-bar">
29
  <div class="tutor-topbar-item tutor-hide-sidebar-bar">
30
  <a href="javascript:;" class="tutor-lesson-sidebar-hide-bar"><i class="tutor-icon-menu-2"></i> </a>
 
 
 
 
 
 
 
 
31
  <a href="<?php echo get_the_permalink($course->ID); ?>">
32
  <i class="tutor-icon-next-2"></i> <?php echo sprintf(__('Go to %s Course Home %s', 'tutor'), '<strong>', '</strong>') ; ?>
33
  </a>
34
  </div>
35
+ <div class="tutor-topbar-item tutor-topbar-content-title-wrap">
36
+ <?php
37
+ tutor_utils()->get_lesson_type_icon(get_the_ID(), true, true);
38
+ the_title(); ?>
39
+ </div>
40
+
41
+ <div class="tutor-topbar-item tutor-topbar-mark-to-done" style="width: 150px;"></div>
42
  </div>
43
 
44
+
45
  <div class="tutor-quiz-single-wrap ">
46
  <input type="hidden" name="tutor_quiz_id" id="tutor_quiz_id" value="<?php the_ID(); ?>">
47
 
tutor.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Tutor LMS
4
  Plugin URI: http://https://themeum.com/tutor
5
  Description: Tutor is a complete solution for creating a Learning Management System in WordPress way. It can help you to create small to large scale online education site very conveniently. Power features like report, certificate, course preview, private file sharing make Tutor a robust plugin for any educational institutes.
6
  Author: Themeum
7
- Version: 1.1.1
8
  Author URI: http://themeum.com
9
  Requires at least: 4.5
10
  Tested up to: 5.1
@@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) )
17
  /**
18
  * Defined the tutor main file
19
  */
20
- define('TUTOR_VERSION', '1.1.1');
21
  define('TUTOR_FILE', __FILE__);
22
 
23
 
@@ -58,11 +58,25 @@ if ( ! function_exists('tutor')) {
58
  return (object) $info;
59
  }
60
  }
61
- include 'classes/init.php';
 
 
 
62
 
63
  function tutor_utils(){
64
  return new \TUTOR\Utils();
65
  }
66
 
67
- $tutor = new \TUTOR\init();
68
- $tutor->run(); //Boom
 
 
 
 
 
 
 
 
 
 
 
4
  Plugin URI: http://https://themeum.com/tutor
5
  Description: Tutor is a complete solution for creating a Learning Management System in WordPress way. It can help you to create small to large scale online education site very conveniently. Power features like report, certificate, course preview, private file sharing make Tutor a robust plugin for any educational institutes.
6
  Author: Themeum
7
+ Version: 1.2.0
8
  Author URI: http://themeum.com
9
  Requires at least: 4.5
10
  Tested up to: 5.1
17
  /**
18
  * Defined the tutor main file
19
  */
20
+ define('TUTOR_VERSION', '1.2.0');
21
  define('TUTOR_FILE', __FILE__);
22
 
23
 
58
  return (object) $info;
59
  }
60
  }
61
+
62
+ if ( ! class_exists('Tutor')){
63
+ include_once 'classes/Tutor.php';
64
+ }
65
 
66
  function tutor_utils(){
67
  return new \TUTOR\Utils();
68
  }
69
 
70
+ //$tutor = new \TUTOR\init();
71
+ //$tutor->run(); //Boom
72
+
73
+ /**
74
+ * @return null|\TUTOR\Tutor
75
+ *
76
+ * @since v.1.2.0
77
+ */
78
+
79
+ function tutor_lms(){
80
+ return \TUTOR\Tutor::instance();
81
+ }
82
+ $GLOBALS['tutor'] = tutor_lms();
views/metabox/instructors-metabox.php CHANGED
@@ -16,10 +16,10 @@
16
  </div>';
17
  echo $currentInstructorHtml;
18
 
19
- if ($instructors){
20
  foreach ($instructors as $instructor){
21
  if ($t->ID == $instructor->ID){
22
- break;
23
  }
24
  ?>
25
  <div id="added-instructor-id-<?php echo $instructor->ID; ?>" class="added-instructor-item added-instructor-item-<?php echo $instructor->ID; ?>" data-instructor-id="<?php echo $instructor->ID; ?>">
16
  </div>';
17
  echo $currentInstructorHtml;
18
 
19
+ if (is_array($instructors) && count($instructors)){
20
  foreach ($instructors as $instructor){
21
  if ($t->ID == $instructor->ID){
22
+ continue;
23
  }
24
  ?>
25
  <div id="added-instructor-id-<?php echo $instructor->ID; ?>" class="added-instructor-item added-instructor-item-<?php echo $instructor->ID; ?>" data-instructor-id="<?php echo $instructor->ID; ?>">
views/modal/add_quiz.php CHANGED
@@ -113,5 +113,13 @@ if ( ! empty($_POST['tutor_quiz_builder_quiz_id'])){
113
 
114
 
115
  </div>
 
 
 
 
 
 
 
 
116
 
117
  </div>
113
 
114
 
115
  </div>
116
+ <div class="tutor-quiz-builder-modal-tabs-notice">
117
+ <?php
118
+ // TODO: These links are must be updated
119
+ $knowledge_base_link = sprintf("<a href='%s' target='_blank'>%s</a>", "https://www.themeum.com/docs/tutor-introduction/", __("Knowledge Base", "tutor"));
120
+ $documentation_link = sprintf("<a href='%s' target='_blank'>%s</a>", "https://www.themeum.com/docs/tutor-introduction/", __("Documentation", "tutor"));
121
+ printf(__("Need any Help? Please visit our %s and %s.", "tutor"), $knowledge_base_link, $documentation_link);
122
+ ?>
123
+ </div>
124
 
125
  </div>
views/modal/edit_quiz.php CHANGED
@@ -137,15 +137,15 @@ if ( ! $quiz){
137
  <div class="quiz-builder-modal-settins">
138
 
139
  <div class="tutor-quiz-builder-form-row">
 
 
 
140
  <div class="tutor-quiz-builder-form-cols-row">
141
  <div class="quiz-form-field-col">
142
- <label><?php _e('Time Limit', 'tutor'); ?></label>
143
  <input type="text" name="quiz_option[time_limit][time_value]" value="<?php echo tutor_utils()->get_quiz_option($quiz_id, 'time_limit.time_value', 0) ?>">
144
  </div>
145
 
146
  <div class="quiz-form-field-col">
147
- <label>&nbsp;</label>
148
-
149
  <?php $limit_time_type = tutor_utils()->get_quiz_option($quiz_id, 'time_limit.time_type', 'minutes') ?>
150
 
151
  <select name="quiz_option[time_limit][time_type]">
@@ -158,8 +158,6 @@ if ( ! $quiz){
158
  </div>
159
 
160
  <div class="quiz-form-field-col">
161
- <label>&nbsp;</label>
162
-
163
  <div class="quiz-form-field-col">
164
  <label class="btn-switch">
165
  <input type="checkbox" value="1" name="quiz_option[hide_quiz_time_display]" <?php checked('1', tutor_utils()->get_quiz_option($quiz_id, 'hide_quiz_time_display')); ?> />
@@ -317,5 +315,13 @@ if ( ! $quiz){
317
 
318
 
319
  </div>
 
 
 
 
 
 
 
 
320
 
321
  </div>
137
  <div class="quiz-builder-modal-settins">
138
 
139
  <div class="tutor-quiz-builder-form-row">
140
+ <div class="tutor-quiz-builder-form-cols-row">
141
+ <label><?php _e('Time Limit', 'tutor'); ?></label>
142
+ </div>
143
  <div class="tutor-quiz-builder-form-cols-row">
144
  <div class="quiz-form-field-col">
 
145
  <input type="text" name="quiz_option[time_limit][time_value]" value="<?php echo tutor_utils()->get_quiz_option($quiz_id, 'time_limit.time_value', 0) ?>">
146
  </div>
147
 
148
  <div class="quiz-form-field-col">
 
 
149
  <?php $limit_time_type = tutor_utils()->get_quiz_option($quiz_id, 'time_limit.time_type', 'minutes') ?>
150
 
151
  <select name="quiz_option[time_limit][time_type]">
158
  </div>
159
 
160
  <div class="quiz-form-field-col">
 
 
161
  <div class="quiz-form-field-col">
162
  <label class="btn-switch">
163
  <input type="checkbox" value="1" name="quiz_option[hide_quiz_time_display]" <?php checked('1', tutor_utils()->get_quiz_option($quiz_id, 'hide_quiz_time_display')); ?> />
315
 
316
 
317
  </div>
318
+ <div class="tutor-quiz-builder-modal-tabs-notice">
319
+ <?php
320
+ // TODO: These links are must be updated
321
+ $knowledge_base_link = sprintf("<a href='%s' target='_blank'>%s</a>", "#", __("Knowledge Base", "tutor"));
322
+ $documentation_link = sprintf("<a href='%s' target='_blank'>%s</a>", "#", __("Documentation", "tutor"));
323
+ printf(__("Need any Help? Please visit our %s and %s.", "tutor"), $knowledge_base_link, $documentation_link);
324
+ ?>
325
+ </div>
326
 
327
  </div>
views/options/field-types/group_fields.php CHANGED
@@ -9,6 +9,7 @@ if ( ! isset($field['group_fields']) || ! is_array($field['group_fields']) || !
9
  $input_name = "tutor_option[{$field['field_key']}][{$groupFieldKey}]";
10
  $default_value = isset($group_field['default']) ? $group_field['default'] : false;
11
  $input_value = $this->get($field['field_key'].'.'.$groupFieldKey, $default_value);
 
12
  ?>
13
  <div class="tutor-option-group-field">
14
  <?php include tutor()->path."views/options/field-types/groups/{$group_field['type']}.php"; ?>
9
  $input_name = "tutor_option[{$field['field_key']}][{$groupFieldKey}]";
10
  $default_value = isset($group_field['default']) ? $group_field['default'] : false;
11
  $input_value = $this->get($field['field_key'].'.'.$groupFieldKey, $default_value);
12
+ $label = tutor_utils()->avalue_dot('label', $group_field);
13
  ?>
14
  <div class="tutor-option-group-field">
15
  <?php include tutor()->path."views/options/field-types/groups/{$group_field['type']}.php"; ?>
views/options/field-types/groups/checkbox.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+
2
+ <label>
3
+ <input type="checkbox" name="<?php echo $input_name; ?>" value="1" <?php checked($input_value, '1'); ?> >
4
+ <?php echo $label; ?>
5
+ </label>
views/options/field-types/groups/number.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+
2
+ <input type="number" name="<?php echo $input_name; ?>" value="<?php echo $input_value; ?>" >
3
+ <?php
4
+ if ($label){
5
+ echo "<p>{$label}</p>";
6
+ }
7
+ ?>
views/options/field-types/groups/text.php CHANGED
@@ -1,2 +1,7 @@
1
 
2
- <input type="text" name="<?php echo $input_name; ?>" value="<?php echo $input_value; ?>" >
 
 
 
 
 
1
 
2
+ <input type="text" name="<?php echo $input_name; ?>" value="<?php echo $input_value; ?>" >
3
+ <?php
4
+ if ($label){
5
+ echo "<p>{$label}</p>";
6
+ }
7
+ ?>
views/options/options_generator.php CHANGED
@@ -42,6 +42,8 @@
42
  <!--<h3><?php /*echo $option_group['label']; */?></h3>-->
43
 
44
  <?php
 
 
45
  if (!empty($option_group['sections'])){
46
  foreach ($option_group['sections'] as $fgKey => $field_group){
47
  ?>
@@ -51,14 +53,19 @@
51
  </div>
52
 
53
  <?php
54
- do_action('tutor_options_before_'.$key);
55
- foreach ($field_group['fields'] as $field_key => $field){
56
- $field['field_key'] = $field_key;
57
- echo $this->generate_field($field);
58
- }
59
- do_action('tutor_options_after_'.$key);
 
 
60
  }
61
  }
 
 
 
62
  ?>
63
  </div>
64
  <?php
42
  <!--<h3><?php /*echo $option_group['label']; */?></h3>-->
43
 
44
  <?php
45
+ do_action('tutor_options_before_'.$key);
46
+
47
  if (!empty($option_group['sections'])){
48
  foreach ($option_group['sections'] as $fgKey => $field_group){
49
  ?>
53
  </div>
54
 
55
  <?php
56
+ do_action("tutor_options_{$key}_{$fgKey}_before");
57
+ if ( ! empty($field_group['fields']) && tutor_utils()->count($field_group['fields'])) {
58
+ foreach ( $field_group['fields'] as $field_key => $field ) {
59
+ $field['field_key'] = $field_key;
60
+ echo $this->generate_field( $field );
61
+ }
62
+ }
63
+ do_action("tutor_options_{$key}_{$fgKey}_after");
64
  }
65
  }
66
+
67
+ do_action('tutor_options_after_'.$key);
68
+
69
  ?>
70
  </div>
71
  <?php
views/options/withdraw/textarea.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+
2
+
3
+ <textarea name="tutor_withdraw_options[<?php echo $method_id; ?>][<?php echo $field_name; ?>]"><?php echo $saved_value; ?></textarea>
views/options/withdraw/withdraw_admin_options_generator.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for generate withdraw options
4
+ */
5
+
6
+
7
+ $withdraw_methods = $this->withdraw_methods;
8
+
9
+
10
+ ?>
11
+
12
+ <div class="withdraw-admin-options-wrap">
13
+
14
+ <ul class="withdraw-method-nav">
15
+ <?php
16
+ foreach ($withdraw_methods as $method_id => $method) {
17
+ ?>
18
+ <li><a href="javascript:;" data-target-id="withdraw-method-<?php echo $method_id; ?>-form"> <?php echo $method['method_name'] ?> </a> </li>
19
+ <?php
20
+ }
21
+ ?>
22
+ </ul>
23
+
24
+
25
+ <?php
26
+ $method_i = 0;
27
+
28
+ foreach ($withdraw_methods as $method_id => $method){
29
+ $method_i++;
30
+
31
+ $is_enable = tutor_utils()->avalue_dot($method_id.".enabled", $this->get_options);
32
+ ?>
33
+
34
+ <div id="withdraw-method-<?php echo $method_id; ?>-form" class="withdraw-method-form-wrap" style="display: <?php echo $method_i ==1? 'block' : 'none'; ?>;">
35
+
36
+ <div class="tutor-option-field-row">
37
+ <div class="tutor-option-field-label">
38
+ <label for=""><?php _e('Enable/Disable', 'tutor'); ?></label>
39
+ </div>
40
+ <div class="tutor-option-field">
41
+ <label>
42
+ <input type="checkbox" name="tutor_withdraw_options[<?php echo $method_id; ?>][enabled]" value="1" <?php checked('1', $is_enable) ?> >
43
+ <?php _e('Enable ', 'tutor'); ?> <?php echo $method['method_name'] ?>
44
+ </label>
45
+ </div>
46
+ </div>
47
+
48
+ <?php
49
+
50
+ if ( ! empty($method['admin_form_fields']) && tutor_utils()->count($method['admin_form_fields'])){
51
+ $form_fields = $method['admin_form_fields'];
52
+
53
+ foreach ($form_fields as $field_name => $field){
54
+ $saved_value = tutor_utils()->avalue_dot($method_id.".".$field_name, $this->get_options);
55
+ ?>
56
+ <div class="tutor-option-field-row">
57
+ <?php
58
+ if (isset($field['label'])){
59
+ ?>
60
+ <div class="tutor-option-field-label">
61
+ <label for=""><?php echo $field['label']; ?></label>
62
+ </div>
63
+ <?php
64
+ }
65
+ ?>
66
+ <div class="tutor-option-field">
67
+ <?php
68
+ include tutor()->path."views/options/withdraw/{$field['type']}.php";
69
+
70
+ if (isset($field['desc'])){
71
+ echo "<p class='desc'>{$field['desc']}</p>";
72
+ }
73
+ ?>
74
+ </div>
75
+ </div>
76
+ <?php
77
+ }
78
+ }
79
+ ?>
80
+
81
+
82
+ </div>
83
+
84
+ <?php
85
+ }
86
+ ?>
87
+
88
+ </div>
views/pages/withdraw_requests.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $withdrawList = new \TUTOR\Withdraw_Requests_List();
3
+ $withdrawList->prepare_items();
4
+ ?>
5
+
6
+
7
+ <div class="wrap">
8
+ <h2><?php _e('Withdraw Requests', 'tutor'); ?></h2>
9
+
10
+ <form id="withdrawals-filter" method="get">
11
+ <input type="hidden" name="page" value="<?php echo $_REQUEST['page'] ?>" />
12
+ <?php
13
+ $withdrawList->search_box(__('Search', 'tutor'), 'withdrawals');
14
+ $withdrawList->display(); ?>
15
+ </form>
16
+ </div>