diff --git a/app/Course.php b/app/Course.php index 53e08c26..7ad56fe2 100644 --- a/app/Course.php +++ b/app/Course.php @@ -42,4 +42,80 @@ class Course extends Model { return $this->name == "" && $this->ocom == ""; } + + public function lessonPlan() + { + return $this->hasOne('App\LessonPlan'); + } + + public static function allFuture() + { + $courses = Course::all(); + foreach ($courses as $key => $course) + { + if (date('c',strtotime($course->event->date_begin)) <= date('c')) + { + $courses->forget($key); + } + } + return $courses; + } + + public static function allThisYear() + { + $courses = Course::all(); + foreach ($courses as $key => $course) + { + if (date('c',strtotime($course->event->date_begin)) <= date('c',strtotime(\App\Config::getData('instruction_year_begin')))) + { + $courses->forget($key); + } + if (date('c',strtotime($course->event->date_begin)) >= date('c',strtotime(\App\Config::getData('instruction_year_end')))) + { + $courses->forget($key); + } + } + return $courses; + } + + public static function allForUser($user_id) + { + $courses = Course::all(); + foreach ($courses as $key => $course) + { + if ($course->user_id != $user_id) + { + $courses->forget($key); + } + } + return $courses; + } + + public static function allForAuthUser() + { + return self::allForUser(\Auth::user()->id); + } + + public static function allFutureForUser($user_id) + { + $courses = Course::all(); + foreach ($courses as $key => $course) + { + if (date('c',strtotime($course->event->date_begin)) <= date('c')) + { + $courses->forget($key); + } + if ($course->user_id != $user_id) + { + $courses->forget($key); + } + } + return $courses; + } + + public static function allFutureForAuthUser() + { + return self::allFutureForUser(\Auth::user()->id); + } + } diff --git a/app/Event.php b/app/Event.php index 37952ed7..b95d21af 100644 --- a/app/Event.php +++ b/app/Event.php @@ -60,6 +60,23 @@ class Event extends Model return $events; } + public static function allThisYear() + { + $events = Event::all(); + foreach ($events as $key => $event) + { + if (date('c',strtotime($event->date_begin)) <= date('c',strtotime(\App\Config::getData('instruction_year_begin')))) + { + $events->forget($key); + } + if (date('c',strtotime($event->date_begin)) >= date('c',strtotime(\App\Config::getData('instruction_year_end')))) + { + $events->forget($key); + } + } + return $events; + } + public static function checkForError() { $events = Event::all(); diff --git a/app/GoogleDriveFile.php b/app/GoogleDriveFile.php index dde0e2a4..230fb95a 100644 --- a/app/GoogleDriveFile.php +++ b/app/GoogleDriveFile.php @@ -327,4 +327,63 @@ class GoogleDriveFile extends Model $contents = collect(Storage::cloud()->listContents('/', true)); return json_encode($contents->where('type', '=', 'dir')); } + + public static function getSidebarFile() + { + $user = \Auth::user(); + $sidebarArray = []; + $dirList = \App\GoogleDriveFile::all(); + if ($dirList->where('path','=','.Privé/.Cadet')->first()->canAuthUser()) + { + $sidebarArray['Cadet'] = [ + 'route' => 'admin.files.cadet', + 'icon' => 'fas fa-folder-open', + 'perm' => null, + 'child' => null + ]; + } + if ($dirList->where('path','=','.Privé/.Staff')->first()->canAuthUser()) + { + $sidebarArray['Staff'] = [ + 'route' => 'admin.files.staff', + 'icon' => 'fas fa-folder-open', + 'perm' => null, + 'child' => null + ]; + } + if ($dirList->where('path','=','.Privé/.ETAMAS')->first()->canAuthUser()) + { + $sidebarArray['ETAMAS'] = [ + 'route' => 'admin.files.etamas', + 'icon' => 'fas fa-folder-open', + 'perm' => null, + 'child' => null + ]; + } + if ($dirList->where('path','=','.Privé/.Officier')->first()->canAuthUser()) + { + $sidebarArray['Officier'] = [ + 'route' => 'admin.files.officier', + 'icon' => 'fas fa-folder-open', + 'perm' => null, + 'child' => null + ]; + } + $sidebarArray['Publique'] = [ + 'route' => 'admin.files.publique', + 'icon' => 'fas fa-folder-open', + 'perm' => null, + 'child' => null + ]; + if (\Auth::user()->p('drive_see') == 1) + { + $sidebarArray['Google Drive'] = [ + 'route' => 'admin.drive', + 'icon' => 'fab fa-google-drive', + 'perm' => null, + 'child' => null + ]; + } + return $sidebarArray; + } } diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index ce20ae4a..e7ad000f 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -26,7 +26,7 @@ class AdminController extends Controller { clog('navigate','success','consulte le tableau de bord'); - return view('admin.dashboard',['futureEvent' => \App\Event::future()->take(3),'userClasse' => \Auth::User()->getClasse()->forPage(1,6)]); + return view('admin.dashboard',['futureEvent' => \App\Event::future()->take(3),'userClasse' => \Auth::user()->futureCourses()->forPage(1,6)]); } public function update() @@ -42,4 +42,9 @@ class AdminController extends Controller return view('admin.status.index',['alerts' => $alerts]); } + public function instruction() + { + + } + } diff --git a/app/Http/Controllers/CourseController.php b/app/Http/Controllers/CourseController.php index 6e495f85..3be9ccb5 100644 --- a/app/Http/Controllers/CourseController.php +++ b/app/Http/Controllers/CourseController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers; use App\Course; +use App\GoogleDriveFile; use Illuminate\Http\Request; class CourseController extends Controller @@ -14,7 +15,17 @@ class CourseController extends Controller */ public function index() { - // + $mode = 'future'; + if (\request('all')) + { + $courses = Course::all(); + $mode = 'all'; + } + else + { + $courses = Course::allFuture(); + } + return view('admin.course.index',['courses' => $courses,'mode' => $mode]); } /** @@ -41,18 +52,25 @@ class CourseController extends Controller /** * Display the specified resource. * - * @param \App\Course $course - * @return \Illuminate\Http\Response + * @param $id + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ - public function show(Course $course) + public function show($id) { - // + $course = Course::find($id); + $user = \App\User::find($course->user_id); + $name = $course->user_id; + if ($user != null) + { + $name = $user->fullname(); + } + return view('admin.course.show',['course' => $course,'username' => $name,'lessonPlanDir' => \App\GoogleDriveFile::findByPath('.Systeme/.Fichier/.PlanDeCours')->id]); } /** * Show the form for editing the specified resource. * - * @param \App\Course $course + * @param Course $course * @return \Illuminate\Http\Response */ public function edit(Course $course) @@ -64,7 +82,7 @@ class CourseController extends Controller * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request - * @param \App\Course $course + * @param Course $course * @return \Illuminate\Http\Response */ public function update(Request $request, Course $course) @@ -72,14 +90,105 @@ class CourseController extends Controller // } + public function updateCommentOfficer(Request $request, $id) + { + $course = Course::findOrFail($id); + + $course->comment_officer = $request->comment_officer; + $course->save(); + return redirect()->back()->with('success','Modification enregisté avec succès'); + } + + public function updateComment(Request $request, $id) + { + $course = Course::findOrFail($id); + + $course->comment = $request->comment; + $course->save(); + return redirect()->back()->with('success','Modification enregisté avec succès'); + } + + public function updateCommentOfficerPlan(Request $request, $id) + { + $course = Course::findOrFail($id); + + $course->lessonPlan->comment = $request->comment_officer; + $course->lessonPlan->save(); + return redirect()->back()->with('success','Modification enregisté avec succès'); + } + + public function updateCommentPlan(Request $request, $id) + { + $course = Course::findOrFail($id); + + $course->lessonPlan->desc = $request->comment; + $course->lessonPlan->save(); + return redirect()->back()->with('success','Modification enregisté avec succès'); + } + + public function updateLessonPlan(Request $request, $id) + { + $course = Course::findOrFail($id); + $name = $course->ocom.'_'.$course->instructor().'_'.$course->event->date_begin.'_'.'v'.date('c').'.'.\request()->file('file')->getClientOriginalExtension(); + $name = urlencode($name); + $dirID = \App\GoogleDriveFile::findByPath('.Systeme/.Fichier/.PlanDeCours')->id; + + if ($course->lessonPlan != null) + { + $lessonPlan = $course->lessonPlan; + $contents = collect(\Storage::cloud()->listContents($dirID, false)); + + $file = $contents + ->where('type', '=', 'file') + ->where('filename', '=', pathinfo($course->lessonPlan->file, PATHINFO_FILENAME)) + ->where('extension', '=', pathinfo($course->lessonPlan->file, PATHINFO_EXTENSION)) + ->first(); // there can be duplicate file names! + \Storage::cloud()->delete($file['path']); + } + else + { + $lessonPlan = new \App\LessonPlan(); + } + \Storage::cloud()->putFileAs($dirID,\request()->file('file'),$name); + $metadata = \Storage::cloud()->getMetadata($dirID.'/'.$name); + + $lessonPlan->user_id = \Auth::user()->id; + $lessonPlan->file = $metadata['name']; + $lessonPlan->course_id = $course->id; + $lessonPlan->desc = ""; + $lessonPlan->comment = ""; + $lessonPlan->save(); + + return redirect()->back(); + } + /** * Remove the specified resource from storage. * - * @param \App\Course $course + * @param Course $course * @return \Illuminate\Http\Response */ public function destroy(Course $course) { // } + + public function validatePlan($id) + { + $course = Course::findOrFail($id); + if ($course->lessonPlan) + { + if ($course->lessonPlan->approved) + { + $course->lessonPlan->approved = false; + } + else + { + $course->lessonPlan->approved = true; + } + $course->lessonPlan->save(); + return strval($course->lessonPlan->approved); + } + return abort(500); + } } diff --git a/app/Http/Controllers/EventTypeController.php b/app/Http/Controllers/EventTypeController.php index 231cb37e..55f99d88 100644 --- a/app/Http/Controllers/EventTypeController.php +++ b/app/Http/Controllers/EventTypeController.php @@ -44,9 +44,10 @@ class EventTypeController extends Controller * @param \App\EventType $eventType * @return \Illuminate\Http\Response */ - public function show(EventType $eventType) + public function show($id) { - // + $event_type = EventType::findOrFail($id); + return view('admin.event_type.show',['event_type' => $event_type]); } /** diff --git a/app/Http/Controllers/FilesController.php b/app/Http/Controllers/FilesController.php index 135234ae..e87fae2d 100644 --- a/app/Http/Controllers/FilesController.php +++ b/app/Http/Controllers/FilesController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\GoogleDriveFile; use Illuminate\Http\Request; class FilesController extends Controller @@ -84,6 +85,38 @@ class FilesController extends Controller public function guide() { - return view('admin.files.guide'); + $dirID = \App\GoogleDriveFile::findByPath('.Privé/.Staff/.Guide'); + $dir = collect(\Storage::cloud()->listContents($dirID->id,false))->sortBy('name'); + return view('admin.files.guide',['dir' => $dir]); + } + + public function instruction() + { + return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.Staff/.Instruction')->first()->id, 'mode' => 'folder']); + } + + public function cadet() + { + return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.Cadet')->first()->id, 'mode' => 'folder']); + } + + public function staff() + { + return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.Staff')->first()->id, 'mode' => 'folder']); + } + + public function etamas() + { + return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.ETAMAS')->first()->id, 'mode' => 'folder']); + } + + public function officier() + { + return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Privé/.Officier')->first()->id, 'mode' => 'folder']); + } + + public function publique() + { + return view('admin.files.Google Drive.index',['folder' => \App\GoogleDriveFile::where('path','=','.Publique')->first()->id, 'mode' => 'folder']); } } diff --git a/app/Http/Controllers/GoogleDriveController.php b/app/Http/Controllers/GoogleDriveController.php index 0a4431d1..facff370 100644 --- a/app/Http/Controllers/GoogleDriveController.php +++ b/app/Http/Controllers/GoogleDriveController.php @@ -22,6 +22,11 @@ class GoogleDriveController extends Controller return view('admin.files.Google Drive.index',['folder' => $folder]); } + public function indexFolder($folder = '') + { + return view('admin.files.Google Drive.index',['folder' => $folder,'mode' => 'folder']); + } + /** * Show the form for creating a new file. * @@ -172,6 +177,14 @@ class GoogleDriveController extends Controller ->where('type', '=', 'file') ->where('filename', '=', pathinfo($filename, PATHINFO_FILENAME)) ->first(); // there can be duplicate file names! + if ($file == null) + { + $filename = \request('f'); + $file = $contents + ->where('type', '=', 'file') + ->where('filename', '=', pathinfo($filename, PATHINFO_FILENAME)) + ->first(); // there can be duplicate file names! + } $rawData = Storage::cloud()->get($file['path']); $filename = urlencode($filename); @@ -335,76 +348,71 @@ class GoogleDriveController extends Controller public function getFileStructure() { return collect([ - '🔒.Privé' => [ + '.Systeme' => [ 'rank' => [1 => 'rwp'], 'job' => [], 'user' => [] ], - '🔒.Privé/🔒.Cadet' => [ + '.Systeme/.Fichier' => [ 'rank' => [1 => 'rwp'], 'job' => [], 'user' => [] ], - '🔒.Privé/🔒.ETAMAS' => [ + '.Systeme/.Fichier/.PlanDeCours' => [ 'rank' => [1 => 'rwp'], 'job' => [], 'user' => [] ], - '🔒.Privé/🔒.Officier' => [ + '.Privé' => [ 'rank' => [1 => 'rwp'], 'job' => [], 'user' => [] ], - '🔒.Privé/🔒.Staff' => [ + '.Privé/.Cadet' => [ 'rank' => [1 => 'rwp'], 'job' => [], 'user' => [] ], - '🔒.Privé/🔒.Staff/🔒.Guide' => [ + '.Privé/.ETAMAS' => [ 'rank' => [1 => 'rwp'], 'job' => [], 'user' => [] ], - '🔒.Publique' => [ + '.Privé/.Officier' => [ + 'rank' => [1 => 'rwp'], + 'job' => [], + 'user' => [] + ], + '.Privé/.Staff' => [ + 'rank' => [1 => 'rwp'], + 'job' => [], + 'user' => [] + ], + '.Privé/.Staff/.Guide' => [ + 'rank' => [1 => 'rwp'], + 'job' => [], + 'user' => [] + ], + '.Privé/.Staff/.Instruction' => [ + 'rank' => [1 => 'rwp'], + 'job' => [], + 'user' => [] + ], + '.Publique' => [ 'rank' => [1 => 'rwp',0 => 'r'], 'job' => [], 'user' => [] ], - '🔒.Publique/🔒.Fichier' => [ + '.Publique/.Fichier' => [ 'rank' => [1 => 'rwp',0 => 'r'], 'job' => [], 'user' => [] ], - '🔒.Publique/🔒.Image' => [ + '.Publique/.Image' => [ 'rank' => [1 => 'rwp',0 => 'r'], 'job' => [], 'user' => [] ], - '🔒.Système' => [ - 'rank' => [1 => 'rwp'], - 'job' => [], - 'user' => [] - ], - '🔒.Système/🔒.Fichier' => [ - 'rank' => [1 => 'rwp'], - 'job' => [], - 'user' => [] - ], - '🔒.Système/🔒.Image' => [ - 'rank' => [1 => 'rwp'], - 'job' => [], - 'user' => [] - ], - '🔒.Système/🔒.Image/🔒.Nouvelle' => [ - 'rank' => [1 => 'rwp'], - 'job' => [], - 'user' => [] - ], - '🔒.Système/🔒.Image/🔒.Profil' => [ - 'rank' => [1 => 'rwp'], - 'job' => [], - 'user' => [] - ], ]); } @@ -412,7 +420,7 @@ class GoogleDriveController extends Controller { $contents = collect(\Storage::cloud()->listContents($d, false)); $dir = $contents->where('type', '=', 'dir'); - $dir = $dir->where('filename','=','🔒'); + $dir = $dir->where('filename','=',''); return $dir; } @@ -481,6 +489,142 @@ class GoogleDriveController extends Controller return view('admin.files.Google Drive.permission.edit',['folder' => $dir,'subject' => $foo,'perm' => $perm,'s' => $subject]); } + public function addPermissionModal($folder,$subject) + { + $dir = GoogleDriveFile::find($folder); + $list = null; + if ($subject == 'rank') + { + $list = \App\Rank::all(); + } + elseif ($subject == 'job') + { + $list = \App\Job::all(); + } + else + { + $list = \App\User::all(); + } + return view('admin.files.Google Drive.permission.add',['folder' => $dir,'list' => $list,'s' => $subject]); + } + public function patchPermission(Request $request,$folder,$subject,$id) + { + $f = GoogleDriveFile::find($folder); + $permstring = ''; + if (isset($request->read)) + { + if ($request->read == 'on') + { + $permstring = $permstring.'r'; + } + } + if (isset($request->write)) + { + if ($request->write == 'on') + { + $permstring = $permstring.'w'; + } + } + if (isset($request->perm)) + { + if ($request->perm == 'on') + { + $permstring = $permstring.'p'; + } + } + if ($subject == 'rank') + { + $temp = $f->rank_permission; + $temp[$id] = $permstring; + $f->rank_permission = $temp; + } + if ($subject == 'job') + { + $temp = $f->job_permission; + $temp[$id] = $permstring; + $f->job_permission = $temp; + } + if ($subject == 'user') + { + $temp = $f->user_permission; + $temp[$id] = $permstring; + $f->user_permission = $temp; + } + $f->save(); + return redirect()->back()->with('success','Modification enregistré avec succès'); + } + + public function addPermission(Request $request,$folder,$subject) + { + $f = GoogleDriveFile::find($folder); + $permstring = ''; + if (isset($request->read)) + { + if ($request->read == 'on') + { + $permstring = $permstring.'r'; + } + } + if (isset($request->write)) + { + if ($request->write == 'on') + { + $permstring = $permstring.'w'; + } + } + if (isset($request->perm)) + { + if ($request->perm == 'on') + { + $permstring = $permstring.'p'; + } + } + if ($subject == 'rank') + { + $temp = $f->rank_permission; + $temp[$request->id] = $permstring; + $f->rank_permission = $temp; + } + if ($subject == 'job') + { + $temp = $f->job_permission; + $temp[$request->id] = $permstring; + $f->job_permission = $temp; + } + if ($subject == 'user') + { + $temp = $f->user_permission; + $temp[$request->id] = $permstring; + $f->user_permission = $temp; + } + $f->save(); + return redirect()->back()->with('success','Modification enregistré avec succès'); + } + + public function deletePermission($folder,$subject,$id) + { + $f = GoogleDriveFile::find($folder); + if ($subject == 'rank') + { + $temp = $f->rank_permission; + unset($temp[$id]); + $f->rank_permission = $temp; + } + if ($subject == 'job') + { + $temp = $f->job_permission; + unset($temp[$id]); + $f->job_permission = $temp; + } + if ($subject == 'user') + { + $temp = $f->user_permission; + unset($temp[$id]); + $f->user_permission = $temp; + } + $f->save(); + return redirect()->back()->with('success','Modification enregistré avec succès'); + } } diff --git a/app/Http/Controllers/LessonPlanController.php b/app/Http/Controllers/LessonPlanController.php new file mode 100644 index 00000000..32cfa438 --- /dev/null +++ b/app/Http/Controllers/LessonPlanController.php @@ -0,0 +1,85 @@ + $courses,'mode' => $mode]); + } +} diff --git a/app/Http/Controllers/ScheduleController.php b/app/Http/Controllers/ScheduleController.php index e4a2c70c..73cb6e0e 100644 --- a/app/Http/Controllers/ScheduleController.php +++ b/app/Http/Controllers/ScheduleController.php @@ -11,49 +11,21 @@ class ScheduleController extends Controller { public function index() { - return view('admin.configs.schedule',['configs' => \App\Config::all()]); + return view('admin.configs.schedule',['configs' => \App\Config::all(),'events_type' => \App\EventType::all()]); } - public function update() + public function update(Request $request) { - $configs = ['admin_periode_nb']; + $instruction_year_begin = \App\Config::find('instruction_year_begin'); + $instruction_year_end = \App\Config::find('instruction_year_end'); - foreach ($configs as $config) { - $c = \App\Config::all()->where('name',$config)->first(); - $c->data = [request($config)]; - $c->save(); - } + $instruction_year_begin->data = [date('Y-m-d',strtotime($request->instruction_year_begin))]; + $instruction_year_end->data = [date('Y-m-d',strtotime($request->instruction_year_end))]; - $new_admin_periode_begin = []; - $new_admin_periode_end = []; - for ($i=1; $i <= request('admin_periode_nb'); $i++) { - if(request('admin_periode_begin_'.$i)) - { - $new_admin_periode_begin[$i] = request('admin_periode_begin_'.$i); - } - else - { - $new_admin_periode_begin[$i] = "00:00"; - } - if(request('admin_periode_end_'.$i)) - { - $new_admin_periode_end[$i] = request('admin_periode_end_'.$i); - } - else - { - $new_admin_periode_end[$i] = "00:00"; - } - } + $instruction_year_begin->save(); + $instruction_year_end->save(); - $temp = \App\Config::all()->where('name','admin_periode_begin')->first(); - $temp->data = $new_admin_periode_begin; - $temp->save(); - - $temp = \App\Config::all()->where('name','admin_periode_end')->first(); - $temp->data = $new_admin_periode_end; - $temp->save(); - - return redirect('/admin/config/schedule')->with('success','Modification sauvegarder avec succès !'); + return redirect('/admin/config/instruction')->with('success','Modification sauvegarder avec succès !'); } public function apiIndex() diff --git a/app/Http/Controllers/StatsController.php b/app/Http/Controllers/StatsController.php new file mode 100644 index 00000000..328f0381 --- /dev/null +++ b/app/Http/Controllers/StatsController.php @@ -0,0 +1,81 @@ +lessonPlan) + { + if ($course->lessonPlan->approved) + { + $nbCoursePlanDoneAndCheckTY++; + } + else + { + $nbCoursePlanDoneTY++; + } + } + } + + $coursesUTTD = $coursesTY; + $nbCoursePlanDoneUTDP = 0; + $nbCoursePlanDoneAndCheckUTDP = 0; + + foreach ($coursesUTTD as $key => $course) + { + if (date('c',strtotime($course->event->date_begin)) >= date('c')) + { + $coursesUTTD->forget($key); + } + else + { + $instructorUTTD->push($course->instructor()); + if ($course->lessonPlan) + { + if ($course->lessonPlan->approved) + { + $nbCoursePlanDoneAndCheckUTDP++; + } + else + { + $nbCoursePlanDoneUTDP++; + } + } + } + } + $instructorUTTD = $instructorUTTD->unique(); + + $eventTY = \App\Event::allThisYear(); + $eventUTTD = $eventTY; + foreach ($eventUTTD as $key => $event) + { + if (date('c',strtotime($event->date_begin)) >= date('c')) + { + $eventUTTD->forget($key); + } + } + return view('admin.stats.instruction',[ + 'nbCourseThisYear' => count($coursesTY), + 'nbInstructorUpToThisDay' => count($instructorUTTD), + 'nbEventThisYear' => count($eventTY), + 'nbEventUpToThisDay' => count($eventUTTD), + 'nbCourseUpToThisDay' => count($coursesUTTD), + 'nbCoursePlanDoneUTDP' => $nbCoursePlanDoneUTDP, + 'nbCoursePlanDoneTY' => $nbCoursePlanDoneTY, + 'nbCoursePlanDoneAndCheckUTDP' => $nbCoursePlanDoneAndCheckUTDP, + 'nbCoursePlanDoneAndCheckTY' => $nbCoursePlanDoneAndCheckTY, + 'nbCourseInDB' => count(\App\OCOM::all()), + ]); + } +} diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index b1e66459..9f6c8f32 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -262,4 +262,14 @@ class UserController extends Controller return json_encode($name); } + + public function showCourses($id) + { + return view('admin.user.courses',['courses' => User::find($id)->courses]); + } + + public function showCourse($id,$course_id) + { + return view('admin.user.course',['courses' => User::find($id)->courses]); + } } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 75cf88dd..27361b03 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -63,5 +63,6 @@ class Kernel extends HttpKernel 'admin' => \App\Http\Middleware\AccesAdmin::class, 'perm' => \App\Http\Middleware\CheckPerm::class, 'fileperm' => \App\Http\Middleware\CheckFilePerm::class, + 'courseperm' => \App\Http\Middleware\CheckCoursePerm::class, ]; } diff --git a/app/Http/Middleware/CheckCoursePerm.php b/app/Http/Middleware/CheckCoursePerm.php new file mode 100644 index 00000000..24e0ccee --- /dev/null +++ b/app/Http/Middleware/CheckCoursePerm.php @@ -0,0 +1,43 @@ +id); + + if (\Auth::user()->id == $course->user_id) + { + if ($perm == 'see' || $perm == 'edit') + { + return $next($request); + } + } + + if (\Auth::user()->p('course_'.$perm.'_all') == 1) + { + return $next($request); + } + if (\Auth::user()->p('course_'.$perm) == 1) + { + return $next($request); + } + if ($perm == 'validate_plan') + { + abort(401); + } + clog('navigate','danger','L\'utilisateur n\'est pas autorisé à effectuer cette action',\Auth::user()->id); + return redirect('/admin')->with('error','Vous n\'êtes pas autorisé à effectuer cette action'); + } +} diff --git a/app/LessonPlan.php b/app/LessonPlan.php new file mode 100644 index 00000000..6c05c0f3 --- /dev/null +++ b/app/LessonPlan.php @@ -0,0 +1,13 @@ +belongsTo('App\Course'); + } +} diff --git a/app/Permission.php b/app/Permission.php index 32f14a5c..6f2d4330 100644 --- a/app/Permission.php +++ b/app/Permission.php @@ -38,36 +38,6 @@ class Permission extends Model 'valeur' => 0 ] ], - 'message' => [ - 'msg_see' => [ - 'ckey' => 'msg_see', - 'communName' => 'Voir les messages', - 'desc' => 'L\'utilisateur peut-il consulter les messages de la semaine', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'msg_add' => [ - 'ckey' => 'msg_add', - 'communName' => 'Ajouter un message', - 'desc' => 'L\'utilisateur peut-il ajouter un message de la semaine', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'msg_edit' => [ - 'ckey' => 'msg_edit', - 'communName' => 'Modifier un message', - 'desc' => 'L\'utilisateur peut-il modifier les messages de la semaine', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'msg_delete' => [ - 'ckey' => 'msg_delete', - 'communName' => 'Supprimer un message', - 'desc' => 'L\'utilisateur peut-il supprimer un message de la semaine', - 'icon' => 'fa-eye', - 'valeur' => 0 - ] - ], 'inventory' => [ 'inventory_see' => [ 'ckey' => 'inventory_see', @@ -98,36 +68,6 @@ class Permission extends Model 'valeur' => 0 ], ], - 'booking' => [ - 'booking_see' => [ - 'ckey' => 'booking_see', - 'communName' => 'Voir les réservations', - 'desc' => 'L\'utilisateur peut-il consulter la liste des réservations', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'booking_add' => [ - 'ckey' => 'booking_add', - 'communName' => 'Ajouter une réservation', - 'desc' => 'L\'utilisateur peut-il ajouter une réservation', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'booking_edit' => [ - 'ckey' => 'booking_edit', - 'communName' => 'Modifier une réservation', - 'desc' => 'L\'utilisateur peut-il modifier une réservation', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'booking_delete' => [ - 'ckey' => 'booking_delete', - 'communName' => 'Supprimer une réservation', - 'desc' => 'L\'utilisateur peut-il supprimer une réservation', - 'icon' => 'fa-eye', - 'valeur' => 0 - ] - ], 'user' => [ 'user_see' => [ 'ckey' => 'user_see', @@ -183,7 +123,72 @@ class Permission extends Model 'valeur' => 0 ] ], - 'schedule' => [ + 'Instruction' => [ + 'instruction_guide_see' => [ + 'ckey' => 'instruction_guide_see', + 'communName' => 'Voir les guides pédagogiques et normes de qualifications', + 'desc' => 'L\'utilisateur peut-il consulter les guides pédagogiques et normes de qualifications', + 'icon' => 'fa-eye', + 'valeur' => 0 + ], + 'instruction_db_ocom_see' => [ + 'ckey' => 'instruction_db_ocom_see', + 'communName' => 'Voir la base de donnée de cours', + 'desc' => 'L\'utilisateur peut-il consulter la base de donnée des cours', + 'icon' => 'fa-eye', + 'valeur' => 0 + ], + 'instruction_db_ocom_add' => [ + 'ckey' => 'instruction_db_ocom_add', + 'communName' => 'Ajouter à la base de donnée de cours', + 'desc' => 'L\'utilisateur peut-il ajouter à la base de donnée des cours', + 'icon' => 'fa-eye', + 'valeur' => 0 + ], + 'instruction_db_ocom_edit' => [ + 'ckey' => 'instruction_db_ocom_edit', + 'communName' => 'Modifier la base de donnée de cours', + 'desc' => 'L\'utilisateur peut-il modifier la base de donnée des cours', + 'icon' => 'fa-eye', + 'valeur' => 0 + ], + 'instruction_db_ocom_delete' => [ + 'ckey' => 'instruction_db_ocom_delete', + 'communName' => 'Supprimer de la base de donnée de cours', + 'desc' => 'L\'utilisateur peut-il supprimer de la base de donnée des cours', + 'icon' => 'fa-eye', + 'valeur' => 0 + ], + 'course_see_all' => [ + 'ckey' => 'course_see_all', + 'communName' => 'Voir les cours de tous les utilisateurs', + 'desc' => 'L\'utilisateur peut-il voir les cours de tous les utilisateurs', + 'icon' => 'fa-eye', + 'valeur' => 0 + ], + 'course_comment_officer' => [ + 'ckey' => 'course_comment_officer', + 'communName' => 'Ajouter un commentaire sur n\'importe quel cours', + 'desc' => 'L\'utilisateur peut-il ajouter un commentaire sur n\'importe quel cours', + 'icon' => 'fa-eye', + 'valeur' => 0 + ], + 'course_validate_plan' => [ + 'ckey' => 'course_validate_plan', + 'communName' => 'Valider n\'importe quel plan de cours', + 'desc' => 'L\'utilisateur peut-il valider n\'importe quel plan de cours', + 'icon' => 'fa-eye', + 'valeur' => 0 + ], + 'course_comment_plan_officer' => [ + 'ckey' => 'course_comment_plan_officer', + 'communName' => 'Ajouter un commentaire sur n\'importe quel plan de cours', + 'desc' => 'L\'utilisateur peut-il ajouter un commentaire sur n\'importe quel plan de cours', + 'icon' => 'fa-eye', + 'valeur' => 0 + ], + ], + 'Horaire' => [ 'schedule_see' => [ 'ckey' => 'schedule_see', 'communName' => 'Voir l\'horaire', @@ -274,146 +279,20 @@ class Permission extends Model ], ], 'file' => [ - 'file_see_public' => [ - 'ckey' => 'file_see_public', + 'file_see' => [ + 'ckey' => 'file_see', 'communName' => 'Voir les fichiers publiques', 'desc' => 'L\'utilisateur peut-il consulter les fichiers publiques', 'icon' => 'fa-eye', 'valeur' => 0 ], - 'file_add_public' => [ - 'ckey' => 'file_add_public', - 'communName' => 'Ajouter un fichier publiques', - 'desc' => 'L\'utilisateur peut-il ajouter un fichier disponible publiques', + 'drive_see' => [ + 'ckey' => 'drive_see', + 'communName' => 'Voir l\'explorateur de fichier', + 'desc' => 'L\'utilisateur peut-il consulter l\'explorateur de fichier', 'icon' => 'fa-eye', 'valeur' => 0 ], - 'file_edit_public' => [ - 'ckey' => 'file_edit_public', - 'communName' => 'Modifier un fichier publiques', - 'desc' => 'L\'utilisateur peut-il modifier un fichier publiques', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_delete_public' => [ - 'ckey' => 'file_delete_public', - 'communName' => 'Supprimer un fichier publiques', - 'desc' => 'L\'utilisateur peut-il supprimer un fichier publiques', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_see_cadet' => [ - 'ckey' => 'file_see_cadet', - 'communName' => 'Voir les fichiers des cadets', - 'desc' => 'L\'utilisateur peut-il consulter les fichiers des cadets', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_add_cadet' => [ - 'ckey' => 'file_add_cadet', - 'communName' => 'Ajouter un fichier disponible aux cadets', - 'desc' => 'L\'utilisateur peut-il ajouter un fichier disponible aux cadets', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_edit_cadet' => [ - 'ckey' => 'file_edit_cadet', - 'communName' => 'Modifier un fichier des cadets', - 'desc' => 'L\'utilisateur peut-il modifier un fichier des cadets', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_delete_cadet' => [ - 'ckey' => 'file_delete', - 'communName' => 'Supprimer un fichier des cadets', - 'desc' => 'L\'utilisateur peut-il supprimer un fichier des cadets', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_see_staff' => [ - 'ckey' => 'file_see_staff', - 'communName' => 'Voir les fichiers des staffs', - 'desc' => 'L\'utilisateur peut-il consulter les fichiers des staffs', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_add_staff' => [ - 'ckey' => 'file_add_staff', - 'communName' => 'Ajouter un fichier disponible aux staffs', - 'desc' => 'L\'utilisateur peut-il ajouter un fichier disponible aux staffs\'', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_edit_staff' => [ - 'ckey' => 'file_edit_staff', - 'communName' => 'Modifier un fichier des staffs', - 'desc' => 'L\'utilisateur peut-il modifier un fichier des staffs', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_delete_staff' => [ - 'ckey' => 'file_delete_staff', - 'communName' => 'Supprimer un fichier des staffs', - 'desc' => 'L\'utilisateur peut-il supprimer un fichier des staffs', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_see_etamas' => [ - 'ckey' => 'file_see_etamas', - 'communName' => 'Voir les fichiers de l\'ETAMAS', - 'desc' => 'L\'utilisateur peut-il consulter les fichiers de l\'ETAMAS', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_add_etamas' => [ - 'ckey' => 'file_add_etamas', - 'communName' => 'Ajouter un fichier disponible a l\'ETAMAS', - 'desc' => 'L\'utilisateur peut-il ajouter un fichier disponible a l\'ETAMAS', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_edit_etamas' => [ - 'ckey' => 'file_edit_etamas', - 'communName' => 'Modifier un fichier de l\'ETAMAS', - 'desc' => 'L\'utilisateur peut-il modifier un fichier de l\'ETAMAS', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_delete_etmas' => [ - 'ckey' => 'file_delete_staff', - 'communName' => 'Supprimer un fichier de l\'ETAMAS', - 'desc' => 'L\'utilisateur peut-il supprimer un fichier de l\'ETAMAS', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_see_officier' => [ - 'ckey' => 'file_see_officier', - 'communName' => 'Voir les fichiers des officiers', - 'desc' => 'L\'utilisateur peut-il consulter les fichiers des officiers', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_add_officier' => [ - 'ckey' => 'file_add_officier', - 'communName' => 'Ajouter un fichier disponible aux officiers', - 'desc' => 'L\'utilisateur peut-il ajouter un fichier disponible aux officiers', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_edit_officier' => [ - 'ckey' => 'file_edit_officier', - 'communName' => 'Modifier un fichier des officiers', - 'desc' => 'L\'utilisateur peut-il modifier un fichier des officiers', - 'icon' => 'fa-eye', - 'valeur' => 0 - ], - 'file_delete_officier' => [ - 'ckey' => 'file_delete_staff', - 'communName' => 'Supprimer un fichier des officiers', - 'desc' => 'L\'utilisateur peut-il supprimer un fichier des officiers', - 'icon' => 'fa-eye', - 'valeur' => 0 - ] ] ]; diff --git a/app/User.php b/app/User.php index 987a3620..425717ad 100644 --- a/app/User.php +++ b/app/User.php @@ -77,18 +77,7 @@ class User extends Authenticatable public function futureCourses() { - $filterCourse = collect(); - foreach (\Auth::user()->courses as $course) - { - if($course->event) - { - if(date('U',strtotime($course->event->date_begin)) >= date('U')) - { - $filterCourse->push($course); - } - } - } - return $filterCourse; + return \App\Course::allFutureForUser($this->id); } public function routeNotificationForNexmo($notification) diff --git a/database/migrations/2019_08_17_102836_create_courses_table.php b/database/migrations/2019_08_17_102836_create_courses_table.php index 3782007b..0e795d18 100644 --- a/database/migrations/2019_08_17_102836_create_courses_table.php +++ b/database/migrations/2019_08_17_102836_create_courses_table.php @@ -21,6 +21,7 @@ class CreateCoursesTable extends Migration $table->integer('level'); $table->string('location'); $table->text('comment'); + $table->text('comment_officer'); $table->integer('event_id'); $table->string('user_id'); $table->timestamps(); diff --git a/database/migrations/2020_04_06_142322_create_lesson_plans_table.php b/database/migrations/2020_04_06_142322_create_lesson_plans_table.php new file mode 100644 index 00000000..69b95ba6 --- /dev/null +++ b/database/migrations/2020_04_06_142322_create_lesson_plans_table.php @@ -0,0 +1,37 @@ +bigIncrements('id'); + $table->integer('user_id'); + $table->string('file'); + $table->integer('course_id')->nullable(); + $table->text('desc')->nullable(); + $table->text('comment')->nullable(); + $table->boolean('approved')->default(false); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('lesson_plans'); + } +} diff --git a/public/css/Chart.min.css b/public/css/Chart.min.css new file mode 100644 index 00000000..9dc5ac2e --- /dev/null +++ b/public/css/Chart.min.css @@ -0,0 +1 @@ +@keyframes chartjs-render-animation{from{opacity:.99}to{opacity:1}}.chartjs-render-monitor{animation:chartjs-render-animation 1ms}.chartjs-size-monitor,.chartjs-size-monitor-expand,.chartjs-size-monitor-shrink{position:absolute;direction:ltr;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1}.chartjs-size-monitor-expand>div{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0} \ No newline at end of file diff --git a/public/css/custom.css b/public/css/custom.css index 4ca0c16e..1eb79b1c 100644 --- a/public/css/custom.css +++ b/public/css/custom.css @@ -1836,4 +1836,8 @@ h2 { .no-hover:hover { background-color: initial; +} + +tfoot > tr { + width: 100%; } \ No newline at end of file diff --git a/public/images/fall-art-red-autumn-leaves-orange-fall-trees-baslee-troutman-baslee-troutman-art-gallery-collections.jpg b/public/images/fall-art-red-autumn-leaves-orange-fall-trees-baslee-troutman-baslee-troutman-art-gallery-collections.jpg new file mode 100644 index 00000000..9147ea2c Binary files /dev/null and b/public/images/fall-art-red-autumn-leaves-orange-fall-trees-baslee-troutman-baslee-troutman-art-gallery-collections.jpg differ diff --git a/public/images/sidebar.png b/public/images/sidebar.png new file mode 100644 index 00000000..046f8771 Binary files /dev/null and b/public/images/sidebar.png differ diff --git a/public/js/app.js b/public/js/app.js index c041062a..f98ed062 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1,4 +1,16 @@ +extendSidebar(); + function navigate(url) { window.location.href = window.location+'/'+url; +} + +function extendSidebar() +{ + let foo = $('.nav-item.active'); + if (foo.attr('parent')) + { + $('#'+foo.attr('parent')).collapse('show'); + $('#link-'+foo.attr('parent')).addClass('active'); + } } \ No newline at end of file diff --git a/public/js/plugins/Chart.min.js b/public/js/plugins/Chart.min.js new file mode 100644 index 00000000..7c16b0d1 --- /dev/null +++ b/public/js/plugins/Chart.min.js @@ -0,0 +1,7 @@ +/*! + * Chart.js v2.9.3 + * https://www.chartjs.org + * (c) 2019 Chart.js Contributors + * Released under the MIT License + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(function(){try{return require("moment")}catch(t){}}()):"function"==typeof define&&define.amd?define(["require"],(function(t){return e(function(){try{return t("moment")}catch(t){}}())})):(t=t||self).Chart=e(t.moment)}(this,(function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e={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]},n=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[e[i]]=i);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var r in a)if(a.hasOwnProperty(r)){if(!("channels"in a[r]))throw new Error("missing channels property: "+r);if(!("labels"in a[r]))throw new Error("missing channel labels property: "+r);if(a[r].labels.length!==a[r].channels)throw new Error("channel and label counts mismatch: "+r);var o=a[r].channels,s=a[r].labels;delete a[r].channels,delete a[r].labels,Object.defineProperty(a[r],"channels",{value:o}),Object.defineProperty(a[r],"labels",{value:s})}a.rgb.hsl=function(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]},a.rgb.hsv=function(t){var e,n,i,a,r,o=t[0]/255,s=t[1]/255,l=t[2]/255,u=Math.max(o,s,l),d=u-Math.min(o,s,l),h=function(t){return(u-t)/6/d+.5};return 0===d?a=r=0:(r=d/u,e=h(o),n=h(s),i=h(l),o===u?a=i-n:s===u?a=1/3+e-i:l===u&&(a=2/3+n-e),a<0?a+=1:a>1&&(a-=1)),[360*a,100*r,100*u]},a.rgb.hwb=function(t){var e=t[0],n=t[1],i=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,i))),100*(i=1-1/255*Math.max(e,Math.max(n,i)))]},a.rgb.cmyk=function(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]},a.rgb.keyword=function(t){var i=n[t];if(i)return i;var a,r,o,s=1/0;for(var l in e)if(e.hasOwnProperty(l)){var u=e[l],d=(r=t,o=u,Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)+Math.pow(r[2]-o[2],2));d.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?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)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],i=e[1],r=e[2];return i/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.hsl.rgb=function(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++,i>1&&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},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,i=t[2]/100,a=n,r=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,a*=r<=1?r:2-r,[e,100*(0===i?2*a/(r+a):2*n/(i+n)),100*((i+n)/2)]},a.hsv.rgb=function(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));switch(i*=255,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]}},a.hsv.hsl=function(t){var e,n,i,a=t[0],r=t[1]/100,o=t[2]/100,s=Math.max(o,.01);return i=(2-r)*o,n=r*s,[a,100*(n=(n/=(e=(2-r)*s)<=1?e:2-e)||0),100*(i/=2)]},a.hwb.rgb=function(t){var e,n,i,a,r,o,s,l=t[0]/360,u=t[1]/100,d=t[2]/100,h=u+d;switch(h>1&&(u/=h,d/=h),i=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(i=1-i),a=u+i*((n=1-d)-u),e){default:case 6:case 0:r=n,o=a,s=u;break;case 1:r=a,o=n,s=u;break;case 2:r=u,o=n,s=a;break;case 3:r=u,o=a,s=n;break;case 4:r=a,o=u,s=n;break;case 5:r=n,o=u,s=a}return[255*r,255*o,255*s]},a.cmyk.rgb=function(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))]},a.xyz.rgb=function(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=(e=3.2406*a+-1.5372*r+-.4986*o)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[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))]},a.xyz.lab=function(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.lab.xyz=function(t){var e,n,i,a=t[0];e=t[1]/500+(n=(a+16)/116),i=n-t[2]/200;var r=Math.pow(n,3),o=Math.pow(e,3),s=Math.pow(i,3);return n=r>.008856?r:(n-16/116)/7.787,e=o>.008856?o:(e-16/116)/7.787,i=s>.008856?s:(i-16/116)/7.787,[e*=95.047,n*=100,i*=108.883]},a.lab.lch=function(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]},a.lch.lab=function(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)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],i=t[2],r=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],i=t[2];return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},a.rgb.hcg=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255,r=Math.max(Math.max(n,i),a),o=Math.min(Math.min(n,i),a),s=r-o;return e=s<=0?0:r===n?(i-a)/s%6:r===i?2+(a-n)/s:4+(n-i)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?o/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=1,a=0;return(i=n<.5?2*e*n:2*e*(1-n))<1&&(a=(n-.5*i)/(1-i)),[t[0],100*i,100*a]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=e*n,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,i=t[2]/100;if(0===n)return[255*i,255*i,255*i];var a,r=[0,0,0],o=e%1*6,s=o%1,l=1-s;switch(Math.floor(o)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=l,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=l,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=l}return a=(1-n)*i,[255*(n*r[0]+a),255*(n*r[1]+a),255*(n*r[2]+a)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),i=0;return n>0&&(i=e/n),[t[0],100*i,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],100*i,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,i=n-e,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}));n.rgb,n.hsl,n.hsv,n.hwb,n.cmyk,n.xyz,n.lab,n.lch,n.hex,n.keyword,n.ansi16,n.ansi256,n.hcg,n.apple,n.gray;function i(t){var e=function(){for(var t={},e=Object.keys(n),i=e.length,a=0;a1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var i=n.length,a=0;a1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)}))}));var s=o,l={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]},u={getRgba:d,getHsla:h,getRgb:function(t){var e=d(t);return e&&e.slice(0,3)},getHsl:function(t){var e=h(t);return e&&e.slice(0,3)},getHwb:c,getAlpha:function(t){var e=d(t);if(e)return e[3];if(e=h(t))return e[3];if(e=c(t))return e[3]},hexString:function(t,e){e=void 0!==e&&3===t.length?e:t[3];return"#"+v(t[0])+v(t[1])+v(t[2])+(e>=0&&e<1?v(Math.round(255*e)):"")},rgbString:function(t,e){if(e<1||t[3]&&t[3]<1)return f(t,e);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:f,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return g(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:g,hslString:function(t,e){if(e<1||t[3]&&t[3]<1)return p(t,e);return"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:p,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 b[t.slice(0,3)]}};function d(t){if(t){var e=[0,0,0],n=1,i=t.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(i){a=(i=i[1])[3];for(var r=0;rn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"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=t,i=void 0===e?.5:e,a=2*i-1,r=this.alpha()-n.alpha(),o=((a*r==-1?a:(a+r)/(1+a*r))+1)/2,s=1-o;return this.rgb(o*this.red()+s*n.red(),o*this.green()+s*n.green(),o*this.blue()+s*n.blue()).alpha(this.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new y,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}},y.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},y.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},y.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i=0;a--)e.call(n,t[a],a);else for(a=0;a=1?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),i<1?(i=1,e=n/4):e=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),i<1?(i=1,e=n/4):e=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),i<1?(i=1,e=n/4):e=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){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+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-S.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*S.easeInBounce(2*t):.5*S.easeOutBounce(2*t-1)+.5}},C={effects:S};M.easingEffects=S;var P=Math.PI,A=P/180,D=2*P,T=P/2,I=P/4,F=2*P/3,L={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,i/2),s=e+o,l=n+o,u=e+i-o,d=n+a-o;t.moveTo(e,l),se.left-1e-6&&t.xe.top-1e-6&&t.y0&&this.requestAnimationFrame()},advance:function(){for(var t,e,n,i,a=this.animations,r=0;r=n?(V.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(r,1)):++r}},J=V.options.resolve,Q=["push","pop","shift","splice","unshift"];function tt(t,e){var n=t._chartjs;if(n){var i=n.listeners,a=i.indexOf(e);-1!==a&&i.splice(a,1),i.length>0||(Q.forEach((function(e){delete t[e]})),delete t._chartjs)}}var et=function(t,e){this.initialize(t,e)};V.extend(et.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this.getMeta(),e=this.chart,n=e.scales,i=this.getDataset(),a=e.options.scales;null!==t.xAxisID&&t.xAxisID in n&&!i.xAxisID||(t.xAxisID=i.xAxisID||a.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in n&&!i.yAxisID||(t.yAxisID=i.yAxisID||a.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]},_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())},reset:function(){this._update(!0)},destroy:function(){this._data&&tt(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;tn&&this.insertElements(n,i-n)},insertElements:function(t,e){for(var n=0;na?(r=a/e.innerRadius,t.arc(o,s,e.innerRadius-a,i+r,n-r,!0)):t.arc(o,s,a,i+Math.PI/2,n-Math.PI/2),t.closePath(),t.clip()}function rt(t,e,n){var i="inner"===e.borderAlign;i?(t.lineWidth=2*e.borderWidth,t.lineJoin="round"):(t.lineWidth=e.borderWidth,t.lineJoin="bevel"),n.fullCircles&&function(t,e,n,i){var a,r=n.endAngle;for(i&&(n.endAngle=n.startAngle+it,at(t,n),n.endAngle=r,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=it,n.fullCircles--)),t.beginPath(),t.arc(n.x,n.y,n.innerRadius,n.startAngle+it,n.startAngle,!0),a=0;as;)a-=it;for(;a=o&&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,e=this._chart.ctx,n=this._view,i="inner"===n.borderAlign?.33:0,a={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/it)};if(e.save(),e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+it,e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),t=0;tt.x&&(e=vt(e,"left","right")):t.basen?n:i,r:l.right||a<0?0:a>e?e:a,b:l.bottom||r<0?0:r>n?n:r,l:l.left||o<0?0:o>e?e:o}}function xt(t,e,n){var i=null===e,a=null===n,r=!(!t||i&&a)&&mt(t);return r&&(i||e>=r.left&&e<=r.right)&&(a||n>=r.top&&n<=r.bottom)}z._set("global",{elements:{rectangle:{backgroundColor:gt,borderColor:gt,borderSkipped:"bottom",borderWidth:0}}});var yt=X.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,n=function(t){var e=mt(t),n=e.right-e.left,i=e.bottom-e.top,a=bt(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i},inner:{x:e.left+a.l,y:e.top+a.t,w:n-a.l-a.r,h:i-a.t-a.b}}}(e),i=n.outer,a=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(i.x,i.y,i.w,i.h),i.w===a.w&&i.h===a.h||(t.save(),t.beginPath(),t.rect(i.x,i.y,i.w,i.h),t.clip(),t.fillStyle=e.borderColor,t.rect(a.x,a.y,a.w,a.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return xt(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return pt(n)?xt(n,t,null):xt(n,null,e)},inXRange:function(t){return xt(this._view,t,null)},inYRange:function(t){return xt(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return pt(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return pt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),_t={},kt=ot,wt=ut,Mt=ft,St=yt;_t.Arc=kt,_t.Line=wt,_t.Point=Mt,_t.Rectangle=St;var Ct=V._deprecated,Pt=V.valueOrDefault;function At(t,e,n){var i,a,r=n.barThickness,o=e.stackCount,s=e.pixels[t],l=V.isNullOrUndef(r)?function(t,e){var n,i,a,r,o=t._length;for(a=1,r=e.length;a0?Math.min(o,Math.abs(i-n)):o,n=i;return o}(e.scale,e.pixels):-1;return V.isNullOrUndef(r)?(i=l*n.categoryPercentage,a=n.barPercentage):(i=r*o,a=1),{chunk:i/o,ratio:a,start:s-i/2}}z._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),z._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var Dt=nt.extend({dataElementType:_t.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var t,e,n=this;nt.prototype.initialize.apply(n,arguments),(t=n.getMeta()).stack=n.getDataset().stack,t.bar=!0,e=n._getIndexScale().options,Ct("bar chart",e.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),Ct("bar chart",e.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),Ct("bar chart",e.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),Ct("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),Ct("bar chart",e.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(t){var e,n,i=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,n=i.length;e=0&&p.min>=0?p.min:p.max,y=void 0===p.start?p.end:p.max>=0&&p.min>=0?p.max-p.min:p.min-p.max,_=g.length;if(v||void 0===v&&void 0!==b)for(i=0;i<_&&(a=g[i]).index!==t;++i)a.stack===b&&(r=void 0===(u=h._parseValue(f[a.index].data[e])).start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(p.min<0&&r<0||p.max>=0&&r>0)&&(x+=r));return o=h.getPixelForValue(x),l=(s=h.getPixelForValue(x+y))-o,void 0!==m&&Math.abs(l)=0&&!c||y<0&&c?o-m:o+m),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(t,e,n,i){var a="flex"===i.barThickness?function(t,e,n){var i,a=e.pixels,r=a[t],o=t>0?a[t-1]:null,s=t=Ot?-Rt:b<-Ot?Rt:0)+m,y=Math.cos(b),_=Math.sin(b),k=Math.cos(x),w=Math.sin(x),M=b<=0&&x>=0||x>=Rt,S=b<=zt&&x>=zt||x>=Rt+zt,C=b<=-zt&&x>=-zt||x>=Ot+zt,P=b===-Ot||x>=Ot?-1:Math.min(y,y*p,k,k*p),A=C?-1:Math.min(_,_*p,w,w*p),D=M?1:Math.max(y,y*p,k,k*p),T=S?1:Math.max(_,_*p,w,w*p);u=(D-P)/2,d=(T-A)/2,h=-(D+P)/2,c=-(T+A)/2}for(i=0,a=g.length;i0&&!isNaN(t)?Rt*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,i,a,r,o,s,l,u=0,d=this.chart;if(!t)for(e=0,n=d.data.datasets.length;e(u=s>u?s:u)?l:u);return u},setHoverStyle:function(t){var e=t._model,n=t._options,i=V.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Lt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Lt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Lt(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,n=0;n0&&Vt(l[t-1]._model,s)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=u(n.controlPointPreviousY,s.top,s.bottom)),t0&&(r=t.getDatasetMeta(r[0]._datasetIndex).data),r},"x-axis":function(t,e){return ie(t,e,{intersect:!1})},point:function(t,e){return te(t,Jt(e,t))},nearest:function(t,e,n){var i=Jt(e,t);n.axis=n.axis||"xy";var a=ne(n.axis);return ee(t,i,n.intersect,a)},x:function(t,e,n){var i=Jt(e,t),a=[],r=!1;return Qt(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=Jt(e,t),a=[],r=!1;return Qt(t,(function(t){t.inYRange(i.y)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a}}},re=V.extend;function oe(t,e){return V.where(t,(function(t){return t.pos===e}))}function se(t,e){return t.sort((function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i.index-a.index:i.weight-a.weight}))}function le(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function ue(t,e,n){var i,a,r=n.box,o=t.maxPadding;if(n.size&&(t[n.pos]-=n.size),n.size=n.horizontal?r.height:r.width,t[n.pos]+=n.size,r.getPadding){var s=r.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(i=e.outerWidth-le(o,t,"left","right"),a=e.outerHeight-le(o,t,"top","bottom"),i!==t.w||a!==t.h)return t.w=i,t.h=a,n.horizontal?i!==t.w:a!==t.h}function de(t,e){var n=e.maxPadding;function i(t){var i={left:0,top:0,right:0,bottom:0};return t.forEach((function(t){i[t]=Math.max(e[t],n[t])})),i}return i(t?["left","right"]:["top","bottom"])}function he(t,e,n){var i,a,r,o,s,l,u=[];for(i=0,a=t.length;idiv{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}"}))&&fe.default||fe,me="$chartjs",ve="chartjs-size-monitor",be="chartjs-render-monitor",xe="chartjs-render-animation",ye=["animationstart","webkitAnimationStart"],_e={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function ke(t,e){var n=V.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}var we=!!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 Me(t,e,n){t.addEventListener(e,n,we)}function Se(t,e,n){t.removeEventListener(e,n,we)}function Ce(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 Pe(t){var e=document.createElement("div");return e.className=t||"",e}function Ae(t,e,n){var i,a,r,o,s=t[me]||(t[me]={}),l=s.resizer=function(t){var e=Pe(ve),n=Pe(ve+"-expand"),i=Pe(ve+"-shrink");n.appendChild(Pe()),i.appendChild(Pe()),e.appendChild(n),e.appendChild(i),e._reset=function(){n.scrollLeft=1e6,n.scrollTop=1e6,i.scrollLeft=1e6,i.scrollTop=1e6};var a=function(){e._reset(),t()};return Me(n,"scroll",a.bind(n,"expand")),Me(i,"scroll",a.bind(i,"shrink")),e}((i=function(){if(s.resizer){var i=n.options.maintainAspectRatio&&t.parentNode,a=i?i.clientWidth:0;e(Ce("resize",n)),i&&i.clientWidth0){var r=t[0];r.label?n=r.label:r.xLabel?n=r.xLabel:a>0&&r.index-1?t.split("\n"):t}function We(t){var e=z.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:Re(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:Re(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:Re(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:Re(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:Re(t.titleFontStyle,e.defaultFontStyle),titleFontSize:Re(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:Re(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:Re(t.footerFontStyle,e.defaultFontStyle),footerFontSize:Re(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 Ve(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function He(t){return Be([],Ee(t))}var je=X.extend({initialize:function(){this._model=We(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options,n=e.callbacks,i=n.beforeTitle.apply(t,arguments),a=n.title.apply(t,arguments),r=n.afterTitle.apply(t,arguments),o=[];return o=Be(o,Ee(i)),o=Be(o,Ee(a)),o=Be(o,Ee(r))},getBeforeBody:function(){return He(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,i=n._options.callbacks,a=[];return V.each(t,(function(t){var r={before:[],lines:[],after:[]};Be(r.before,Ee(i.beforeLabel.call(n,t,e))),Be(r.lines,i.label.call(n,t,e)),Be(r.after,Ee(i.afterLabel.call(n,t,e))),a.push(r)})),a},getAfterBody:function(){return He(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),i=e.footer.apply(t,arguments),a=e.afterFooter.apply(t,arguments),r=[];return r=Be(r,Ee(n)),r=Be(r,Ee(i)),r=Be(r,Ee(a))},update:function(t){var e,n,i,a,r,o,s,l,u,d,h=this,c=h._options,f=h._model,g=h._model=We(c),p=h._active,m=h._data,v={xAlign:f.xAlign,yAlign:f.yAlign},b={x:f.x,y:f.y},x={width:f.width,height:f.height},y={x:f.caretX,y:f.caretY};if(p.length){g.opacity=1;var _=[],k=[];y=Ne[c.position].call(h,p,h._eventPosition);var w=[];for(e=0,n=p.length;ei.width&&(a=i.width-e.width),a<0&&(a=0)),"top"===d?r+=h:r-="bottom"===d?e.height+h:e.height/2,"center"===d?"left"===u?a+=h:"right"===u&&(a-=h):"left"===u?a-=c:"right"===u&&(a+=c),{x:a,y:r}}(g,x,v=function(t,e){var n,i,a,r,o,s=t._model,l=t._chart,u=t._chart.chartArea,d="center",h="center";s.yl.height-e.height&&(h="bottom");var c=(u.left+u.right)/2,f=(u.top+u.bottom)/2;"center"===h?(n=function(t){return t<=c},i=function(t){return t>c}):(n=function(t){return t<=e.width/2},i=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,x),h._chart)}else g.opacity=0;return g.xAlign=v.xAlign,g.yAlign=v.yAlign,g.x=b.x,g.y=b.y,g.width=x.width,g.height=x.height,g.caretX=y.x,g.caretY=y.y,h._model=g,t&&c.custom&&c.custom.call(h,g),h},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,p=e.width,m=e.height;if("center"===c)s=g+m/2,"left"===h?(a=(i=f)-u,r=i,o=s+u,l=s-u):(a=(i=f+p)+u,r=i,o=s-u,l=s+u);else if("left"===h?(i=(a=f+d+u)-u,r=a+u):"right"===h?(i=(a=f+p-d-u)-u,r=a+u):(i=(a=n.caretX)-u,r=a+u),"top"===c)s=(o=g)-u,l=o;else{s=(o=g+m)+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){var i,a,r,o=e.title,s=o.length;if(s){var l=ze(e.rtl,e.x,e.width);for(t.x=Ve(e,e._titleAlign),n.textAlign=l.textAlign(e._titleAlign),n.textBaseline="middle",i=e.titleFontSize,a=e.titleSpacing,n.fillStyle=e.titleFontColor,n.font=V.fontString(i,e._titleFontStyle,e._titleFontFamily),r=0;r0&&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&&(t.save(),t.globalAlpha=a,this.drawBackground(i,e,t,n),i.y+=e.yPadding,V.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),V.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},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),i.reverse&&n._active.reverse()),(e=!V.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}}),qe=Ne,Ue=je;Ue.positioners=qe;var Ye=V.valueOrDefault;function Ge(){return V.merge({},[].slice.call(arguments),{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=e[t].length&&e[t].push({}),!e[t][a].type||o.type&&o.type!==e[t][a].type?V.merge(e[t][a],[Oe.getScaleDefaults(r),o]):V.merge(e[t][a],o)}else V._merger(t,e,n,i)}})}function Xe(){return V.merge({},[].slice.call(arguments),{merger:function(t,e,n,i){var a=e[t]||{},r=n[t];"scales"===t?e[t]=Ge(a,r):"scale"===t?e[t]=V.merge(a,[Oe.getScaleDefaults(r.type),r]):V._merger(t,e,n,i)}})}function Ke(t){var e=t.options;V.each(t.scales,(function(e){ge.removeBox(t,e)})),e=Xe(z.global,z[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function Ze(t,e,n){var i,a=function(t){return t.id===i};do{i=e+n++}while(V.findIndex(t,a)>=0);return i}function $e(t){return"top"===t||"bottom"===t}function Je(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}z._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var Qe=function(t,e){return this.construct(t,e),this};V.extend(Qe.prototype,{construct:function(t,e){var n=this;e=function(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=Xe(z.global,z[t.type],t.options||{}),t}(e);var i=Fe.acquireContext(t,e),a=i&&i.canvas,r=a&&a.height,o=a&&a.width;n.id=V.uid(),n.ctx=i,n.canvas=a,n.config=e,n.width=o,n.height=r,n.aspectRatio=r?o/r:null,n.options=e.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,Qe.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),i&&a?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Le.notify(t,"beforeInit"),V.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),Le.notify(t,"afterInit"),t},clear:function(){return V.canvas.clear(this),this},stop:function(){return $.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(V.getMaximumWidth(i))),o=Math.max(0,Math.floor(a?r/a:V.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",V.retinaScale(e,n.devicePixelRatio),!t)){var s={width:r,height:o};Le.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;V.each(e.xAxes,(function(t,n){t.id||(t.id=Ze(e.xAxes,"x-axis-",n))})),V.each(e.yAxes,(function(t,n){t.id||(t.id=Ze(e.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},i=[],a=Object.keys(n).reduce((function(t,e){return t[e]=!1,t}),{});e.scales&&(i=i.concat((e.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(e.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),e.scale&&i.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),V.each(i,(function(e){var i=e.options,r=i.id,o=Ye(i.type,e.dtype);$e(i.position)!==$e(e.dposition)&&(i.position=e.dposition),a[r]=!0;var s=null;if(r in n&&n[r].type===o)(s=n[r]).options=i,s.ctx=t.ctx,s.chart=t;else{var l=Oe.getScaleConstructor(o);if(!l)return;s=new l({id:r,type:o,options:i,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)})),V.each(a,(function(t,e){t||delete n[e]})),t.scales=n,Oe.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,n=this,i=[],a=n.data.datasets;for(t=0,e=a.length;t=0;--n)this.drawDataset(e[n],t);Le.notify(this,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n={meta:t,index:t.index,easingValue:e};!1!==Le.notify(this,"beforeDatasetDraw",[n])&&(t.controller.draw(e),Le.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this.tooltip,n={tooltip:e,easingValue:t};!1!==Le.notify(this,"beforeTooltipDraw",[n])&&(e.draw(),Le.notify(this,"afterTooltipDraw",[n]))},getElementAtEvent:function(t){return ae.modes.single(this,t)},getElementsAtEvent:function(t){return ae.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return ae.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=ae.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return ae.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,order:e.order||0,index:t}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&t!==Math.floor(t)&&(i=t-Math.floor(t));var a=V.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=V.log10(Math.abs(t)),s=Math.floor(o)-Math.floor(a);s=Math.max(Math.min(s,20),0),r=t.toExponential(s)}else{var l=-1*Math.floor(a);l=Math.max(Math.min(l,20),0),r=t.toFixed(l)}else r="0";return r},logarithmic:function(t,e,n){var i=t/Math.pow(10,Math.floor(V.log10(t)));return 0===t?"0":1===i||2===i||5===i||0===e||e===n.length-1?t.toExponential():""}}},on=V.isArray,sn=V.isNullOrUndef,ln=V.valueOrDefault,un=V.valueAtIndexOrDefault;function dn(t,e,n){var i,a=t.getTicks().length,r=Math.min(e,a-1),o=t.getPixelForTick(r),s=t._startPixel,l=t._endPixel;if(!(n&&(i=1===a?Math.max(o-s,l-o):0===e?(t.getPixelForTick(1)-o)/2:(o-t.getPixelForTick(r-1))/2,(o+=rl+1e-6)))return o}function hn(t,e,n,i){var a,r,o,s,l,u,d,h,c,f,g,p,m,v=n.length,b=[],x=[],y=[];for(a=0;ae){for(n=0;n=c||d<=1||!s.isHorizontal()?s.labelRotation=h:(e=(t=s._getLabelSizes()).widest.width,n=t.highest.height-t.highest.offset,i=Math.min(s.maxWidth,s.chart.width-e),e+6>(a=l.offset?s.maxWidth/d:i/(d-1))&&(a=i/(d-(l.offset?.5:1)),r=s.maxHeight-cn(l.gridLines)-u.padding-fn(l.scaleLabel),o=Math.sqrt(e*e+n*n),f=V.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/a,1)),Math.asin(Math.min(r/o,1))-Math.asin(n/o))),f=Math.max(h,Math.min(c,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){V.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){V.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=t.chart,i=t.options,a=i.ticks,r=i.scaleLabel,o=i.gridLines,s=t._isVisible(),l="bottom"===i.position,u=t.isHorizontal();if(u?e.width=t.maxWidth:s&&(e.width=cn(o)+fn(r)),u?s&&(e.height=cn(o)+fn(r)):e.height=t.maxHeight,a.display&&s){var d=pn(a),h=t._getLabelSizes(),c=h.first,f=h.last,g=h.widest,p=h.highest,m=.4*d.minor.lineHeight,v=a.padding;if(u){var b=0!==t.labelRotation,x=V.toRadians(t.labelRotation),y=Math.cos(x),_=Math.sin(x),k=_*g.width+y*(p.height-(b?p.offset:0))+(b?0:m);e.height=Math.min(t.maxHeight,e.height+k+v);var w,M,S=t.getPixelForTick(0)-t.left,C=t.right-t.getPixelForTick(t.getTicks().length-1);b?(w=l?y*c.width+_*c.offset:_*(c.height-c.offset),M=l?_*(f.height-f.offset):y*f.width+_*f.offset):(w=c.width/2,M=f.width/2),t.paddingLeft=Math.max((w-S)*t.width/(t.width-S),0)+3,t.paddingRight=Math.max((M-C)*t.width/(t.width-C),0)+3}else{var P=a.mirror?0:g.width+v+m;e.width=Math.min(t.maxWidth,e.width+P),t.paddingTop=c.height/2,t.paddingBottom=f.height/2}}t.handleMargins(),u?(t.width=t._length=n.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){V.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(sn(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!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},_convertTicksToLabels:function(t){var e,n,i,a=this;for(a.ticks=t.map((function(t){return t.value})),a.beforeTickToLabelConversion(),e=a.convertTicksToLabels(t)||a.ticks,a.afterTickToLabelConversion(),n=0,i=t.length;nn-1?null:this.getPixelForDecimal(t*i+(e?i/2:0))},getPixelForDecimal:function(t){return this._reversePixels&&(t=1-t),this._startPixel+t*this._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},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:t>0&&e>0?t:0},_autoSkip:function(t){var e,n,i,a,r=this.options.ticks,o=this._length,s=r.maxTicksLimit||o/this._tickSize()+1,l=r.major.enabled?function(t){var e,n,i=[];for(e=0,n=t.length;es)return function(t,e,n){var i,a,r=0,o=e[0];for(n=Math.ceil(n),i=0;iu)return r;return Math.max(u,1)}(l,t,0,s),u>0){for(e=0,n=u-1;e1?(h-d)/(u-1):null,vn(t,i,V.isNullOrUndef(a)?0:d-a,d),vn(t,i,h,V.isNullOrUndef(a)?t.length:h+a),mn(t)}return vn(t,i),mn(t)},_tickSize:function(){var t=this.options.ticks,e=V.toRadians(this.labelRotation),n=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),a=this._getLabelSizes(),r=t.autoSkipPadding||0,o=a?a.widest.width+r:0,s=a?a.highest.height+r:0;return this.isHorizontal()?s*n>o*i?o/n:s/i:s*i=0&&(o=t),void 0!==r&&(t=n.indexOf(r))>=0&&(s=t),e.minIndex=o,e.maxIndex=s,e.min=n[o],e.max=n[s]},buildTicks:function(){var t=this._getLabels(),e=this.minIndex,n=this.maxIndex;this.ticks=0===e&&n===t.length-1?t:t.slice(e,n+1)},getLabelForIndex:function(t,e){var n=this.chart;return n.getDatasetMeta(e).controller._getValueScaleId()===this.id?this.getRightValue(n.data.datasets[e].data[t]):this._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,n=t.ticks;xn.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),n&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(n.length-(e?0:1),1))},getPixelForValue:function(t,e,n){var i,a,r,o=this;return yn(e)||yn(n)||(t=o.chart.data.datasets[n].data[e]),yn(t)||(i=o.isHorizontal()?t.x:t.y),(void 0!==i||void 0!==t&&isNaN(e))&&(a=o._getLabels(),t=V.valueOrDefault(i,t),e=-1!==(r=a.indexOf(t))?r:e,isNaN(e)&&(e=t)),o.getPixelForDecimal((e-o._startValue)/o._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange);return Math.min(Math.max(e,0),this.ticks.length-1)},getBasePixel:function(){return this.bottom}}),kn={position:"bottom"};_n._defaults=kn;var wn=V.noop,Mn=V.isNullOrUndef;var Sn=xn.extend({getRightValue:function(t){return"string"==typeof t?+t:xn.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=V.sign(t.min),i=V.sign(t.max);n<0&&i<0?t.max=0:n>0&&i>0&&(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:function(){var t,e=this.options.ticks,n=e.stepSize,i=e.maxTicksLimit;return n?t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1:(t=this._computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:wn,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:V.valueOrDefault(e.fixedStepSize,e.stepSize)},a=t.ticks=function(t,e){var n,i,a,r,o=[],s=t.stepSize,l=s||1,u=t.maxTicks-1,d=t.min,h=t.max,c=t.precision,f=e.min,g=e.max,p=V.niceNum((g-f)/u/l)*l;if(p<1e-14&&Mn(d)&&Mn(h))return[f,g];(r=Math.ceil(g/p)-Math.floor(f/p))>u&&(p=V.niceNum(r*p/u/l)*l),s||Mn(c)?n=Math.pow(10,V._decimalPlaces(p)):(n=Math.pow(10,c),p=Math.ceil(p*n)/n),i=Math.floor(f/p)*p,a=Math.ceil(g/p)*p,s&&(!Mn(d)&&V.almostWhole(d/p,p/1e3)&&(i=d),!Mn(h)&&V.almostWhole(h/p,p/1e3)&&(a=h)),r=(a-i)/p,r=V.almostEquals(r,Math.round(r),p/1e3)?Math.round(r):Math.ceil(r),i=Math.round(i*n)/n,a=Math.round(a*n)/n,o.push(Mn(d)?i:d);for(var m=1;me.length-1?null:this.getPixelForValue(e[t])}}),Tn=Cn;Dn._defaults=Tn;var In=V.valueOrDefault,Fn=V.math.log10;var Ln={position:"left",ticks:{callback:rn.formatters.logarithmic}};function On(t,e){return V.isFinite(t)&&t>=0?t:e}var Rn=xn.extend({determineDataLimits:function(){var t,e,n,i,a,r,o=this,s=o.options,l=o.chart,u=l.data.datasets,d=o.isHorizontal();function h(t){return d?t.xAxisID===o.id:t.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var c=s.stacked;if(void 0===c)for(t=0;t0){var e=V.min(t),n=V.max(t);o.min=Math.min(o.min,e),o.max=Math.max(o.max,n)}}))}else for(t=0;t0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(Fn(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),i={min:On(e.min),max:On(e.max)},a=t.ticks=function(t,e){var n,i,a=[],r=In(t.min,Math.pow(10,Math.floor(Fn(e.min)))),o=Math.floor(Fn(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===r?(n=Math.floor(Fn(e.minNotZero)),i=Math.floor(e.minNotZero/Math.pow(10,n)),a.push(r),r=i*Math.pow(10,n)):(n=Math.floor(Fn(r)),i=Math.floor(r/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{a.push(r),10===++i&&(i=1,l=++n>=0?1:l),r=Math.round(i*Math.pow(10,n)*l)/l}while(ne.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(Fn(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,n=0;xn.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),n=In(t.options.ticks.fontSize,z.global.defaultFontSize)/t._length),t._startValue=Fn(e),t._valueOffset=n,t._valueRange=(Fn(t.max)-Fn(e))/(1-n)},getPixelForValue:function(t){var e=this,n=0;return(t=+e.getRightValue(t))>e.min&&t>0&&(n=(Fn(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(n)},getValueForPixel:function(t){var e=this,n=e.getDecimalForPixel(t);return 0===n&&0===e.min?0:Math.pow(10,e._startValue+(n-e._valueOffset)*e._valueRange)}}),zn=Ln;Rn._defaults=zn;var Nn=V.valueOrDefault,Bn=V.valueAtIndexOrDefault,En=V.options.resolve,Wn={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:rn.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function Vn(t){var e=t.ticks;return e.display&&t.display?Nn(e.fontSize,z.global.defaultFontSize)+2*e.backdropPaddingY:0}function Hn(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:ta?{start:e-n,end:e}:{start:e,end:e+n}}function jn(t){return 0===t||180===t?"center":t<180?"left":"right"}function qn(t,e,n,i){var a,r,o=n.y+i/2;if(V.isArray(e))for(a=0,r=e.length;a270||t<90)&&(n.y-=e.h)}function Yn(t){return V.isNumber(t)?t:0}var Gn=Sn.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Vn(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;V.each(e.data.datasets,(function(a,r){if(e.isDatasetVisible(r)){var o=e.getDatasetMeta(r);V.each(a.data,(function(e,a){var r=+t.getRightValue(e);isNaN(r)||o.data[a].hidden||(n=Math.min(r,n),i=Math.max(r,i))}))}})),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Vn(this.options))},convertTicksToLabels:function(){var t=this;Sn.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map((function(){var e=V.callback(t.options.pointLabels.callback,arguments,t);return e||0===e?e:""}))},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this.options;t.display&&t.pointLabels.display?function(t){var e,n,i,a=V.options._parseFont(t.options.pointLabels),r={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=a.string,t._pointLabelSizes=[];var s,l,u,d=t.chart.data.labels.length;for(e=0;er.r&&(r.r=f.end,o.r=h),g.startr.b&&(r.b=g.end,o.b=h)}t.setReductions(t.drawingArea,r,o)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(t,e,n){var i=this,a=e.l/Math.sin(n.l),r=Math.max(e.r-i.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),s=-Math.max(e.b-(i.height-i.paddingTop),0)/Math.cos(n.b);a=Yn(a),r=Yn(r),o=Yn(o),s=Yn(s),i.drawingArea=Math.min(Math.floor(t-(a+r)/2),Math.floor(t-(o+s)/2)),i.setCenterPoint(a,r,o,s)},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-a.paddingTop-i-a.drawingArea;a.xCenter=Math.floor((o+r)/2+a.left),a.yCenter=Math.floor((s+l)/2+a.top+a.paddingTop)},getIndexAngle:function(t){var e=this.chart,n=(t*(360/e.data.labels.length)+((e.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(V.isNullOrUndef(t))return NaN;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(t){var e=this.min,n=this.max;return this.getPointPositionForValue(t||0,this.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0)},_drawGrid:function(){var t,e,n,i=this,a=i.ctx,r=i.options,o=r.gridLines,s=r.angleLines,l=Nn(s.lineWidth,o.lineWidth),u=Nn(s.color,o.color);if(r.pointLabels.display&&function(t){var e=t.ctx,n=t.options,i=n.pointLabels,a=Vn(n),r=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),o=V.options._parseFont(i);e.save(),e.font=o.string,e.textBaseline="middle";for(var s=t.chart.data.labels.length-1;s>=0;s--){var l=0===s?a/2:0,u=t.getPointPosition(s,r+l+5),d=Bn(i.fontColor,s,z.global.defaultFontColor);e.fillStyle=d;var h=t.getIndexAngle(s),c=V.toDegrees(h);e.textAlign=jn(c),Un(c,t._pointLabelSizes[s],u),qn(e,t.pointLabels[s],u,o.lineHeight)}e.restore()}(i),o.display&&V.each(i.ticks,(function(t,n){0!==n&&(e=i.getDistanceFromCenterForValue(i.ticksAsNumbers[n]),function(t,e,n,i){var a,r=t.ctx,o=e.circular,s=t.chart.data.labels.length,l=Bn(e.color,i-1),u=Bn(e.lineWidth,i-1);if((o||s)&&l&&u){if(r.save(),r.strokeStyle=l,r.lineWidth=u,r.setLineDash&&(r.setLineDash(e.borderDash||[]),r.lineDashOffset=e.borderDashOffset||0),r.beginPath(),o)r.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{a=t.getPointPosition(0,n),r.moveTo(a.x,a.y);for(var d=1;d=0;t--)e=i.getDistanceFromCenterForValue(r.ticks.reverse?i.min:i.max),n=i.getPointPosition(t,e),a.beginPath(),a.moveTo(i.xCenter,i.yCenter),a.lineTo(n.x,n.y),a.stroke();a.restore()}},_drawLabels:function(){var t=this,e=t.ctx,n=t.options.ticks;if(n.display){var i,a,r=t.getIndexAngle(0),o=V.options._parseFont(n),s=Nn(n.fontColor,z.global.defaultFontColor);e.save(),e.font=o.string,e.translate(t.xCenter,t.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",V.each(t.ticks,(function(r,l){(0!==l||n.reverse)&&(i=t.getDistanceFromCenterForValue(t.ticksAsNumbers[l]),n.showLabelBackdrop&&(a=e.measureText(r).width,e.fillStyle=n.backdropColor,e.fillRect(-a/2-n.backdropPaddingX,-i-o.size/2-n.backdropPaddingY,a+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),e.fillStyle=s,e.fillText(r,0,-i))})),e.restore()}},_drawTitle:V.noop}),Xn=Wn;Gn._defaults=Xn;var Kn=V._deprecated,Zn=V.options.resolve,$n=V.valueOrDefault,Jn=Number.MIN_SAFE_INTEGER||-9007199254740991,Qn=Number.MAX_SAFE_INTEGER||9007199254740991,ti={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ei=Object.keys(ti);function ni(t,e){return t-e}function ii(t){return V.valueOrDefault(t.time.min,t.ticks.min)}function ai(t){return V.valueOrDefault(t.time.max,t.ticks.max)}function ri(t,e,n,i){var a=function(t,e,n){for(var i,a,r,o=0,s=t.length-1;o>=0&&o<=s;){if(a=t[(i=o+s>>1)-1]||null,r=t[i],!a)return{lo:null,hi:r};if(r[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 oi(t,e){var n=t._adapter,i=t.options.time,a=i.parser,r=a||i.format,o=e;return"function"==typeof a&&(o=a(o)),V.isFinite(o)||(o="string"==typeof r?n.parse(o,r):n.parse(o)),null!==o?+o:(a||"function"!=typeof r||(o=r(e),V.isFinite(o)||(o=n.parse(o))),o)}function si(t,e){if(V.isNullOrUndef(e))return null;var n=t.options.time,i=oi(t,t.getRightValue(e));return null===i?i:(n.round&&(i=+t._adapter.startOf(i,n.round)),i)}function li(t,e,n,i){var a,r,o,s=ei.length;for(a=ei.indexOf(t);a=0&&(e[r].major=!0);return e}(t,r,o,n):r}var di=xn.extend({initialize:function(){this.mergeTicksOptions(),xn.prototype.initialize.call(this)},update:function(){var t=this,e=t.options,n=e.time||(e.time={}),i=t._adapter=new an._date(e.adapters.date);return Kn("time scale",n.format,"time.format","time.parser"),Kn("time scale",n.min,"time.min","ticks.min"),Kn("time scale",n.max,"time.max","ticks.max"),V.mergeIf(n.displayFormats,i.formats()),xn.prototype.update.apply(t,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),xn.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,n,i,a,r,o,s=this,l=s.chart,u=s._adapter,d=s.options,h=d.time.unit||"day",c=Qn,f=Jn,g=[],p=[],m=[],v=s._getLabels();for(t=0,n=v.length;t1?function(t){var e,n,i,a={},r=[];for(e=0,n=t.length;e1e5*u)throw e+" and "+n+" are too far apart with stepSize of "+u+" "+l;for(a=h;a=a&&n<=r&&d.push(n);return i.min=a,i.max=r,i._unit=l.unit||(s.autoSkip?li(l.minUnit,i.min,i.max,h):function(t,e,n,i,a){var r,o;for(r=ei.length-1;r>=ei.indexOf(n);r--)if(o=ei[r],ti[o].common&&t._adapter.diff(a,i,o)>=e-1)return o;return ei[n?ei.indexOf(n):0]}(i,d.length,l.minUnit,i.min,i.max)),i._majorUnit=s.major.enabled&&"year"!==i._unit?function(t){for(var e=ei.indexOf(t)+1,n=ei.length;ee&&s=0&&t0?s:1}}),hi={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};di._defaults=hi;var ci={category:_n,linear:Dn,logarithmic:Rn,radialLinear:Gn,time:di},fi={datetime:"MMM D, YYYY, h:mm:ss a",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"};an._date.override("function"==typeof t?{_id:"moment",formats:function(){return fi},parse:function(e,n){return"string"==typeof e&&"string"==typeof n?e=t(e,n):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,n){return t(e).format(n)},add:function(e,n,i){return t(e).add(n,i).valueOf()},diff:function(e,n,i){return t(e).diff(t(n),i)},startOf:function(e,n,i){return e=t(e),"isoWeek"===n?e.isoWeekday(i).valueOf():e.startOf(n).valueOf()},endOf:function(e,n){return t(e).endOf(n).valueOf()},_create:function(e){return t(e)}}:{}),z._set("global",{plugins:{filler:{propagate:!0}}});var gi={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=n)&&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 mi(t){return(t.el._scale||{}).getPointPositionForValue?function(t){var e,n,i,a,r,o=t.el._scale,s=o.options,l=o.chart.data.labels.length,u=t.fill,d=[];if(!l)return null;for(e=s.ticks.reverse?o.max:o.min,n=s.ticks.reverse?o.min:o.max,i=o.getPointPositionForValue(0,e),a=0;a0;--r)V.canvas.lineTo(t,n[r],n[r-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),r=a-1;r>0;--r)t.arc(o,s,l,n[r].angle,n[r-1].angle,!0)}}function _i(t,e,n,i,a,r){var o,s,l,u,d,h,c,f,g=e.length,p=i.spanGaps,m=[],v=[],b=0,x=0;for(t.beginPath(),o=0,s=g;o=0;--n)(e=l[n].$filler)&&e.visible&&(a=(i=e.el)._view,r=i._children||[],o=e.mapper,s=a.backgroundColor||z.global.defaultColor,o&&s&&r.length&&(V.canvas.clipArea(u,t.chartArea),_i(u,r,o,a,s,i._loop),V.canvas.unclipArea(u)))}},wi=V.rtl.getRtlAdapter,Mi=V.noop,Si=V.valueOrDefault;function Ci(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}z._set("global",{legend:{display:!0,position:"top",align:"center",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,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,n=t.options.legend||{},i=n.labels&&n.labels.usePointStyle;return t._getSortedDatasetMetas().map((function(n){var a=n.controller.getStyle(i?0:void 0);return{text:e[n.index].label,fillStyle:a.backgroundColor,hidden:!t.isDatasetVisible(n.index),lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,pointStyle:a.pointStyle,rotation:a.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data.datasets;for(a.setAttribute("class",t.id+"-legend"),e=0,n=r.length;el.width)&&(h+=o+n.padding,d[d.length-(e>0?0:1)]=0),s[e]={left:0,top:0,width:i,height:o},d[d.length-1]+=i+n.padding})),l.height+=h}else{var c=n.padding,f=t.columnWidths=[],g=t.columnHeights=[],p=n.padding,m=0,v=0;V.each(t.legendItems,(function(t,e){var i=Ci(n,o)+o/2+a.measureText(t.text).width;e>0&&v+o+2*c>l.height&&(p+=m+n.padding,f.push(m),g.push(v),m=0,v=0),m=Math.max(m,i),v+=o+c,s[e]={left:0,top:0,width:i,height:o}})),p+=m,f.push(m),g.push(v),l.width+=p}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:Mi,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,i=z.global,a=i.defaultColor,r=i.elements.line,o=t.height,s=t.columnHeights,l=t.width,u=t.lineWidths;if(e.display){var d,h=wi(e.rtl,t.left,t.minSize.width),c=t.ctx,f=Si(n.fontColor,i.defaultFontColor),g=V.options._parseFont(n),p=g.size;c.textAlign=h.textAlign("left"),c.textBaseline="middle",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=g.string;var m=Ci(n,p),v=t.legendHitBoxes,b=function(t,i){switch(e.align){case"start":return n.padding;case"end":return t-i;default:return(t-i+n.padding)/2}},x=t.isHorizontal();d=x?{x:t.left+b(l,u[0]),y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+b(o,s[0]),line:0},V.rtl.overrideTextDirection(t.ctx,e.textDirection);var y=p+n.padding;V.each(t.legendItems,(function(e,i){var f=c.measureText(e.text).width,g=m+p/2+f,_=d.x,k=d.y;h.setWidth(t.minSize.width),x?i>0&&_+g+n.padding>t.left+t.minSize.width&&(k=d.y+=y,d.line++,_=d.x=t.left+b(l,u[d.line])):i>0&&k+y>t.top+t.minSize.height&&(_=d.x=_+t.columnWidths[d.line]+n.padding,d.line++,k=d.y=t.top+b(o,s[d.line]));var w=h.x(_);!function(t,e,i){if(!(isNaN(m)||m<=0)){c.save();var o=Si(i.lineWidth,r.borderWidth);if(c.fillStyle=Si(i.fillStyle,a),c.lineCap=Si(i.lineCap,r.borderCapStyle),c.lineDashOffset=Si(i.lineDashOffset,r.borderDashOffset),c.lineJoin=Si(i.lineJoin,r.borderJoinStyle),c.lineWidth=o,c.strokeStyle=Si(i.strokeStyle,a),c.setLineDash&&c.setLineDash(Si(i.lineDash,r.borderDash)),n&&n.usePointStyle){var s=m*Math.SQRT2/2,l=h.xPlus(t,m/2),u=e+p/2;V.canvas.drawPoint(c,i.pointStyle,s,l,u,i.rotation)}else c.fillRect(h.leftForLtr(t,m),e,m,p),0!==o&&c.strokeRect(h.leftForLtr(t,m),e,m,p);c.restore()}}(w,k,e),v[i].left=h.leftForLtr(w,v[i].width),v[i].top=k,function(t,e,n,i){var a=p/2,r=h.xPlus(t,m+a),o=e+a;c.fillText(n.text,r,o),n.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(r,o),c.lineTo(h.xPlus(r,i),o),c.stroke())}(w,k,e,f),x?d.x+=g+n.padding:d.y+=y})),V.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var n,i,a,r=this;if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)for(a=r.legendHitBoxes,n=0;n=(i=a[n]).left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height)return r.legendItems[n];return null},handleEvent:function(t){var e,n=this,i=n.options,a="mouseup"===t.type?"click":t.type;if("mousemove"===a){if(!i.onHover&&!i.onLeave)return}else{if("click"!==a)return;if(!i.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===a?e&&i.onClick&&i.onClick.call(n,t.native,e):(i.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),i.onHover&&e&&i.onHover.call(n,t.native,e))}});function Ai(t,e){var n=new Pi({ctx:t.ctx,options:e,chart:t});ge.configure(t,n,e),ge.addBox(t,n),t.legend=n}var Di={id:"legend",_element:Pi,beforeInit:function(t){var e=t.options.legend;e&&Ai(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(V.mergeIf(e,z.global.legend),n?(ge.configure(t,n,e),n.options=e):Ai(t,e)):n&&(ge.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},Ti=V.noop;z._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Ii=X.extend({initialize:function(t){V.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:Ti,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:Ti,beforeSetDimensions:Ti,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:Ti,beforeBuildLabels:Ti,buildLabels:Ti,afterBuildLabels:Ti,beforeFit:Ti,fit:function(){var t,e=this,n=e.options,i=e.minSize={},a=e.isHorizontal();n.display?(t=(V.isArray(n.text)?n.text.length:1)*V.options._parseFont(n).lineHeight+2*n.padding,e.width=i.width=a?e.maxWidth:t,e.height=i.height=a?t:e.maxHeight):e.width=i.width=e.height=i.height=0},afterFit:Ti,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var i,a,r,o=V.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,u=0,d=t.top,h=t.left,c=t.bottom,f=t.right;e.fillStyle=V.valueOrDefault(n.fontColor,z.global.defaultFontColor),e.font=o.string,t.isHorizontal()?(a=h+(f-h)/2,r=d+l,i=f-h):(a="left"===n.position?h+l:f-l,r=d+(c-d)/2,i=c-d,u=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(a,r),e.rotate(u),e.textAlign="center",e.textBaseline="middle";var g=n.text;if(V.isArray(g))for(var p=0,m=0;m=0;i--){var a=t[i];if(e(a))return a}},V.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},V.almostEquals=function(t,e,n){return Math.abs(t-e)=t},V.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},V.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},V.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0===(t=+t)||isNaN(t)?t:t>0?1:-1},V.toRadians=function(t){return t*(Math.PI/180)},V.toDegrees=function(t){return t*(180/Math.PI)},V._decimalPlaces=function(t){if(V.isFinite(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}},V.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}},V.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},V.aliasPixel=function(t){return t%2==0?0:.5},V._alignPixel=function(t,e,n){var i=t.currentDevicePixelRatio,a=n/2;return Math.round((e-a)*i)/i+a},V.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)}}},V.EPSILON=Number.EPSILON||1e-14,V.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;e0?d[e-1]:null,(a=e0?d[e-1]:null,a=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},V.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},V.niceNum=function(t,e){var n=Math.floor(V.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)},V.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)},V.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.target||t.srcElement,o=r.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=a.clientX,i=a.clientY);var l=parseFloat(V.getStyle(r,"padding-left")),u=parseFloat(V.getStyle(r,"padding-top")),d=parseFloat(V.getStyle(r,"padding-right")),h=parseFloat(V.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)}},V.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},V.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},V._calculatePadding=function(t,e,n){return(e=V.getStyle(t,e)).indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},V._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},V.getMaximumWidth=function(t){var e=V._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,i=n-V._calculatePadding(e,"padding-left",n)-V._calculatePadding(e,"padding-right",n),a=V.getConstraintWidth(t);return isNaN(a)?i:Math.min(i,a)},V.getMaximumHeight=function(t){var e=V._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,i=n-V._calculatePadding(e,"padding-top",n)-V._calculatePadding(e,"padding-bottom",n),a=V.getConstraintHeight(t);return isNaN(a)?i:Math.min(i,a)},V.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},V.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")}},V.fontString=function(t,e,n){return e+" "+t+"px "+n},V.longestText=function(t,e,n,i){var a=(i=i||{}).data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},r=i.garbageCollect=[],i.font=e),t.font=e;var o,s,l,u,d,h=0,c=n.length;for(o=0;on.length){for(o=0;oi&&(i=r),i},V.numberOfLabelLines=function(t){var e=1;return V.each(t,(function(t){V.isArray(t)&&t.length>e&&(e=t.length)})),e},V.color=k?function(t){return t instanceof CanvasGradient&&(t=z.global.defaultColor),k(t)}:function(t){return console.error("Color.js not found!"),t},V.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:V.color(t).saturate(.5).darken(.1).rgbString()}}(),tn._adapters=an,tn.Animation=Z,tn.animationService=$,tn.controllers=$t,tn.DatasetController=nt,tn.defaults=z,tn.Element=X,tn.elements=_t,tn.Interaction=ae,tn.layouts=ge,tn.platform=Fe,tn.plugins=Le,tn.Scale=xn,tn.scaleService=Oe,tn.Ticks=rn,tn.Tooltip=Ue,tn.helpers.each(ci,(function(t,e){tn.scaleService.registerScaleType(e,t,t._defaults)})),Li)Li.hasOwnProperty(Ni)&&tn.plugins.register(Li[Ni]);tn.platform.initialize();var Bi=tn;return"undefined"!=typeof window&&(window.Chart=tn),tn.Chart=tn,tn.Legend=Li.legend._element,tn.Title=Li.title._element,tn.pluginService=tn.plugins,tn.PluginBase=tn.Element.extend({}),tn.canvasHelpers=tn.helpers.canvas,tn.layoutService=tn.layouts,tn.LinearScaleBase=Sn,tn.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],(function(t){tn[t]=function(e,n){return new tn(e,tn.helpers.merge(n||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}})),Bi})); diff --git a/public/js/plugins/chartist.min.js b/public/js/plugins/chartist.min.js deleted file mode 100644 index 7a8672c7..00000000 --- a/public/js/plugins/chartist.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/* Chartist.js 0.11.0 - * Copyright © 2017 Gion Kunz - * Free to use under either the WTFPL license or the MIT license. - * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL - * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT - */ - -!function(a,b){"function"==typeof define&&define.amd?define("Chartist",[],function(){return a.Chartist=b()}):"object"==typeof module&&module.exports?module.exports=b():a.Chartist=b()}(this,function(){var a={version:"0.11.0"};return function(a,b,c){"use strict";c.namespaces={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",ct:"http://gionkunz.github.com/chartist-js/ct"},c.noop=function(a){return a},c.alphaNumerate=function(a){return String.fromCharCode(97+a%26)},c.extend=function(a){var b,d,e;for(a=a||{},b=1;b":">",'"':""","'":"'"},c.serialize=function(a){return null===a||void 0===a?a:("number"==typeof a?a=""+a:"object"==typeof a&&(a=JSON.stringify({data:a})),Object.keys(c.escapingMap).reduce(function(a,b){return c.replaceAll(a,b,c.escapingMap[b])},a))},c.deserialize=function(a){if("string"!=typeof a)return a;a=Object.keys(c.escapingMap).reduce(function(a,b){return c.replaceAll(a,c.escapingMap[b],b)},a);try{a=JSON.parse(a),a=void 0!==a.data?a.data:a}catch(b){}return a},c.createSvg=function(a,b,d,e){var f;return b=b||"100%",d=d||"100%",Array.prototype.slice.call(a.querySelectorAll("svg")).filter(function(a){return a.getAttributeNS(c.namespaces.xmlns,"ct")}).forEach(function(b){a.removeChild(b)}),f=new c.Svg("svg").attr({width:b,height:d}).addClass(e),f._node.style.width=b,f._node.style.height=d,a.appendChild(f._node),f},c.normalizeData=function(a,b,d){var e,f={raw:a,normalized:{}};return f.normalized.series=c.getDataArray({series:a.series||[]},b,d),e=f.normalized.series.every(function(a){return a instanceof Array})?Math.max.apply(null,f.normalized.series.map(function(a){return a.length})):f.normalized.series.length,f.normalized.labels=(a.labels||[]).slice(),Array.prototype.push.apply(f.normalized.labels,c.times(Math.max(0,e-f.normalized.labels.length)).map(function(){return""})),b&&c.reverseData(f.normalized),f},c.safeHasProperty=function(a,b){return null!==a&&"object"==typeof a&&a.hasOwnProperty(b)},c.isDataHoleValue=function(a){return null===a||void 0===a||"number"==typeof a&&isNaN(a)},c.reverseData=function(a){a.labels.reverse(),a.series.reverse();for(var b=0;bf.high&&(f.high=c),h&&c0?f.low=0:(f.high=1,f.low=0)),f},c.isNumeric=function(a){return null!==a&&isFinite(a)},c.isFalseyButZero=function(a){return!a&&0!==a},c.getNumberOrUndefined=function(a){return c.isNumeric(a)?+a:void 0},c.isMultiValue=function(a){return"object"==typeof a&&("x"in a||"y"in a)},c.getMultiValue=function(a,b){return c.isMultiValue(a)?c.getNumberOrUndefined(a[b||"y"]):c.getNumberOrUndefined(a)},c.rho=function(a){function b(a,c){return a%c===0?c:b(c,a%c)}function c(a){return a*a+1}if(1===a)return a;var d,e=2,f=2;if(a%2===0)return 2;do e=c(e)%a,f=c(c(f))%a,d=b(Math.abs(e-f),a);while(1===d);return d},c.getBounds=function(a,b,d,e){function f(a,b){return a===(a+=b)&&(a*=1+(b>0?o:-o)),a}var g,h,i,j=0,k={high:b.high,low:b.low};k.valueRange=k.high-k.low,k.oom=c.orderOfMagnitude(k.valueRange),k.step=Math.pow(10,k.oom),k.min=Math.floor(k.low/k.step)*k.step,k.max=Math.ceil(k.high/k.step)*k.step,k.range=k.max-k.min,k.numberOfSteps=Math.round(k.range/k.step);var l=c.projectLength(a,k.step,k),m=l=d)k.step=1;else if(e&&n=d)k.step=n;else for(;;){if(m&&c.projectLength(a,k.step,k)<=d)k.step*=2;else{if(m||!(c.projectLength(a,k.step/2,k)>=d))break;if(k.step/=2,e&&k.step%1!==0){k.step*=2;break}}if(j++>1e3)throw new Error("Exceeded maximum number of iterations while optimizing scale step!")}var o=2.221e-16;for(k.step=Math.max(k.step,o),h=k.min,i=k.max;h+k.step<=k.low;)h=f(h,k.step);for(;i-k.step>=k.high;)i=f(i,-k.step);k.min=h,k.max=i,k.range=k.max-k.min;var p=[];for(g=k.min;g<=k.max;g=f(g,k.step)){var q=c.roundWithPrecision(g);q!==p[p.length-1]&&p.push(q)}return k.values=p,k},c.polarToCartesian=function(a,b,c,d){var e=(d-90)*Math.PI/180;return{x:a+c*Math.cos(e),y:b+c*Math.sin(e)}},c.createChartRect=function(a,b,d){var e=!(!b.axisX&&!b.axisY),f=e?b.axisY.offset:0,g=e?b.axisX.offset:0,h=a.width()||c.quantity(b.width).value||0,i=a.height()||c.quantity(b.height).value||0,j=c.normalizePadding(b.chartPadding,d);h=Math.max(h,f+j.left+j.right),i=Math.max(i,g+j.top+j.bottom);var k={padding:j,width:function(){return this.x2-this.x1},height:function(){return this.y1-this.y2}};return e?("start"===b.axisX.position?(k.y2=j.top+g,k.y1=Math.max(i-j.bottom,k.y2+1)):(k.y2=j.top,k.y1=Math.max(i-j.bottom-g,k.y2+1)),"start"===b.axisY.position?(k.x1=j.left+f,k.x2=Math.max(h-j.right,k.x1+1)):(k.x1=j.left,k.x2=Math.max(h-j.right-f,k.x1+1))):(k.x1=j.left,k.x2=Math.max(h-j.right,k.x1+1),k.y2=j.top,k.y1=Math.max(i-j.bottom,k.y2+1)),k},c.createGrid=function(a,b,d,e,f,g,h,i){var j={};j[d.units.pos+"1"]=a,j[d.units.pos+"2"]=a,j[d.counterUnits.pos+"1"]=e,j[d.counterUnits.pos+"2"]=e+f;var k=g.elem("line",j,h.join(" "));i.emit("draw",c.extend({type:"grid",axis:d,index:b,group:g,element:k},j))},c.createGridBackground=function(a,b,c,d){var e=a.elem("rect",{x:b.x1,y:b.y2,width:b.width(),height:b.height()},c,!0);d.emit("draw",{type:"gridBackground",group:a,element:e})},c.createLabel=function(a,d,e,f,g,h,i,j,k,l,m){var n,o={};if(o[g.units.pos]=a+i[g.units.pos],o[g.counterUnits.pos]=i[g.counterUnits.pos],o[g.units.len]=d,o[g.counterUnits.len]=Math.max(0,h-10),l){var p=b.createElement("span");p.className=k.join(" "),p.setAttribute("xmlns",c.namespaces.xhtml),p.innerText=f[e],p.style[g.units.len]=Math.round(o[g.units.len])+"px",p.style[g.counterUnits.len]=Math.round(o[g.counterUnits.len])+"px",n=j.foreignObject(p,c.extend({style:"overflow: visible;"},o))}else n=j.elem("text",o,k.join(" ")).text(f[e]);m.emit("draw",c.extend({type:"label",axis:g,index:e,group:j,element:n,text:f[e]},o))},c.getSeriesOption=function(a,b,c){if(a.name&&b.series&&b.series[a.name]){var d=b.series[a.name];return d.hasOwnProperty(c)?d[c]:b[c]}return b[c]},c.optionsProvider=function(b,d,e){function f(b){var f=h;if(h=c.extend({},j),d)for(i=0;i=2&&a[h]<=a[h-2]&&(g=!0),g&&(f.push({pathCoordinates:[],valueData:[]}),g=!1),f[f.length-1].pathCoordinates.push(a[h],a[h+1]),f[f.length-1].valueData.push(b[h/2]));return f}}(window,document,a),function(a,b,c){"use strict";c.Interpolation={},c.Interpolation.none=function(a){var b={fillHoles:!1};return a=c.extend({},b,a),function(b,d){for(var e=new c.Svg.Path,f=!0,g=0;g1){var i=[];return h.forEach(function(a){i.push(f(a.pathCoordinates,a.valueData))}),c.Svg.Path.join(i)}if(b=h[0].pathCoordinates,g=h[0].valueData,b.length<=4)return c.Interpolation.none()(b,g);for(var j,k=(new c.Svg.Path).move(b[0],b[1],!1,g[0]),l=0,m=b.length;m-2*!j>l;l+=2){var n=[{x:+b[l-2],y:+b[l-1]},{x:+b[l],y:+b[l+1]},{x:+b[l+2],y:+b[l+3]},{x:+b[l+4],y:+b[l+5]}];j?l?m-4===l?n[3]={x:+b[0],y:+b[1]}:m-2===l&&(n[2]={x:+b[0],y:+b[1]},n[3]={x:+b[2],y:+b[3]}):n[0]={x:+b[m-2],y:+b[m-1]}:m-4===l?n[3]=n[2]:l||(n[0]={x:+b[l],y:+b[l+1]}),k.curve(d*(-n[0].x+6*n[1].x+n[2].x)/6+e*n[2].x,d*(-n[0].y+6*n[1].y+n[2].y)/6+e*n[2].y,d*(n[1].x+6*n[2].x-n[3].x)/6+e*n[2].x,d*(n[1].y+6*n[2].y-n[3].y)/6+e*n[2].y,n[2].x,n[2].y,!1,g[(l+2)/2])}return k}return c.Interpolation.none()([])}},c.Interpolation.monotoneCubic=function(a){var b={fillHoles:!1};return a=c.extend({},b,a),function d(b,e){var f=c.splitIntoSegments(b,e,{fillHoles:a.fillHoles,increasingX:!0});if(f.length){if(f.length>1){var g=[];return f.forEach(function(a){g.push(d(a.pathCoordinates,a.valueData))}),c.Svg.Path.join(g)}if(b=f[0].pathCoordinates,e=f[0].valueData,b.length<=4)return c.Interpolation.none()(b,e);var h,i,j=[],k=[],l=b.length/2,m=[],n=[],o=[],p=[];for(h=0;h0!=n[h]>0?m[h]=0:(m[h]=3*(p[h-1]+p[h])/((2*p[h]+p[h-1])/n[h-1]+(p[h]+2*p[h-1])/n[h]),isFinite(m[h])||(m[h]=0));for(i=(new c.Svg.Path).move(j[0],k[0],!1,e[0]),h=0;h1}).map(function(a){var b=a.pathElements[0],c=a.pathElements[a.pathElements.length-1];return a.clone(!0).position(0).remove(1).move(b.x,r).line(b.x,b.y).position(a.pathElements.length+1).line(c.x,r)}).forEach(function(c){var h=i.elem("path",{d:c.stringify()},a.classNames.area,!0);this.eventEmitter.emit("draw",{type:"area",values:b.normalized.series[g],path:c.clone(),series:f,seriesIndex:g,axisX:d,axisY:e,chartRect:j,index:g,group:i,element:h})}.bind(this))}}.bind(this)),this.eventEmitter.emit("created",{bounds:e.bounds,chartRect:j,axisX:d,axisY:e,svg:this.svg,options:a})}function e(a,b,d,e){c.Line["super"].constructor.call(this,a,b,f,c.extend({},f,d),e)}var f={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:c.noop,type:void 0},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:c.noop,type:void 0,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,showLine:!0,showPoint:!0,showArea:!1,areaBase:0,lineSmooth:!0,showGridBackground:!1,low:void 0,high:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},fullWidth:!1,reverseData:!1,classNames:{chart:"ct-chart-line",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",line:"ct-line",point:"ct-point",area:"ct-area",grid:"ct-grid",gridGroup:"ct-grids",gridBackground:"ct-grid-background",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};c.Line=c.Base.extend({constructor:e,createChart:d})}(window,document,a),function(a,b,c){"use strict";function d(a){var b,d;a.distributeSeries?(b=c.normalizeData(this.data,a.reverseData,a.horizontalBars?"x":"y"),b.normalized.series=b.normalized.series.map(function(a){return[a]})):b=c.normalizeData(this.data,a.reverseData,a.horizontalBars?"x":"y"),this.svg=c.createSvg(this.container,a.width,a.height,a.classNames.chart+(a.horizontalBars?" "+a.classNames.horizontalBars:""));var e=this.svg.elem("g").addClass(a.classNames.gridGroup),g=this.svg.elem("g"),h=this.svg.elem("g").addClass(a.classNames.labelGroup);if(a.stackBars&&0!==b.normalized.series.length){var i=c.serialMap(b.normalized.series,function(){ -return Array.prototype.slice.call(arguments).map(function(a){return a}).reduce(function(a,b){return{x:a.x+(b&&b.x)||0,y:a.y+(b&&b.y)||0}},{x:0,y:0})});d=c.getHighLow([i],a,a.horizontalBars?"x":"y")}else d=c.getHighLow(b.normalized.series,a,a.horizontalBars?"x":"y");d.high=+a.high||(0===a.high?0:d.high),d.low=+a.low||(0===a.low?0:d.low);var j,k,l,m,n,o=c.createChartRect(this.svg,a,f.padding);k=a.distributeSeries&&a.stackBars?b.normalized.labels.slice(0,1):b.normalized.labels,a.horizontalBars?(j=m=void 0===a.axisX.type?new c.AutoScaleAxis(c.Axis.units.x,b.normalized.series,o,c.extend({},a.axisX,{highLow:d,referenceValue:0})):a.axisX.type.call(c,c.Axis.units.x,b.normalized.series,o,c.extend({},a.axisX,{highLow:d,referenceValue:0})),l=n=void 0===a.axisY.type?new c.StepAxis(c.Axis.units.y,b.normalized.series,o,{ticks:k}):a.axisY.type.call(c,c.Axis.units.y,b.normalized.series,o,a.axisY)):(l=m=void 0===a.axisX.type?new c.StepAxis(c.Axis.units.x,b.normalized.series,o,{ticks:k}):a.axisX.type.call(c,c.Axis.units.x,b.normalized.series,o,a.axisX),j=n=void 0===a.axisY.type?new c.AutoScaleAxis(c.Axis.units.y,b.normalized.series,o,c.extend({},a.axisY,{highLow:d,referenceValue:0})):a.axisY.type.call(c,c.Axis.units.y,b.normalized.series,o,c.extend({},a.axisY,{highLow:d,referenceValue:0})));var p=a.horizontalBars?o.x1+j.projectValue(0):o.y1-j.projectValue(0),q=[];l.createGridAndLabels(e,h,this.supportsForeignObject,a,this.eventEmitter),j.createGridAndLabels(e,h,this.supportsForeignObject,a,this.eventEmitter),a.showGridBackground&&c.createGridBackground(e,o,a.classNames.gridBackground,this.eventEmitter),b.raw.series.forEach(function(d,e){var f,h,i=e-(b.raw.series.length-1)/2;f=a.distributeSeries&&!a.stackBars?l.axisLength/b.normalized.series.length/2:a.distributeSeries&&a.stackBars?l.axisLength/2:l.axisLength/b.normalized.series[e].length/2,h=g.elem("g"),h.attr({"ct:series-name":d.name,"ct:meta":c.serialize(d.meta)}),h.addClass([a.classNames.series,d.className||a.classNames.series+"-"+c.alphaNumerate(e)].join(" ")),b.normalized.series[e].forEach(function(g,k){var r,s,t,u;if(u=a.distributeSeries&&!a.stackBars?e:a.distributeSeries&&a.stackBars?0:k,r=a.horizontalBars?{x:o.x1+j.projectValue(g&&g.x?g.x:0,k,b.normalized.series[e]),y:o.y1-l.projectValue(g&&g.y?g.y:0,u,b.normalized.series[e])}:{x:o.x1+l.projectValue(g&&g.x?g.x:0,u,b.normalized.series[e]),y:o.y1-j.projectValue(g&&g.y?g.y:0,k,b.normalized.series[e])},l instanceof c.StepAxis&&(l.options.stretch||(r[l.units.pos]+=f*(a.horizontalBars?-1:1)),r[l.units.pos]+=a.stackBars||a.distributeSeries?0:i*a.seriesBarDistance*(a.horizontalBars?-1:1)),t=q[k]||p,q[k]=t-(p-r[l.counterUnits.pos]),void 0!==g){var v={};v[l.units.pos+"1"]=r[l.units.pos],v[l.units.pos+"2"]=r[l.units.pos],!a.stackBars||"accumulate"!==a.stackMode&&a.stackMode?(v[l.counterUnits.pos+"1"]=p,v[l.counterUnits.pos+"2"]=r[l.counterUnits.pos]):(v[l.counterUnits.pos+"1"]=t,v[l.counterUnits.pos+"2"]=q[k]),v.x1=Math.min(Math.max(v.x1,o.x1),o.x2),v.x2=Math.min(Math.max(v.x2,o.x1),o.x2),v.y1=Math.min(Math.max(v.y1,o.y2),o.y1),v.y2=Math.min(Math.max(v.y2,o.y2),o.y1);var w=c.getMetaData(d,k);s=h.elem("line",v,a.classNames.bar).attr({"ct:value":[g.x,g.y].filter(c.isNumeric).join(","),"ct:meta":c.serialize(w)}),this.eventEmitter.emit("draw",c.extend({type:"bar",value:g,index:k,meta:w,series:d,seriesIndex:e,axisX:m,axisY:n,chartRect:o,group:h,element:s},v))}}.bind(this))}.bind(this)),this.eventEmitter.emit("created",{bounds:j.bounds,chartRect:o,axisX:m,axisY:n,svg:this.svg,options:a})}function e(a,b,d,e){c.Bar["super"].constructor.call(this,a,b,f,c.extend({},f,d),e)}var f={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:c.noop,scaleMinSpace:30,onlyInteger:!1},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:c.noop,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,high:void 0,low:void 0,referenceValue:0,chartPadding:{top:15,right:15,bottom:5,left:10},seriesBarDistance:15,stackBars:!1,stackMode:"accumulate",horizontalBars:!1,distributeSeries:!1,reverseData:!1,showGridBackground:!1,classNames:{chart:"ct-chart-bar",horizontalBars:"ct-horizontal-bars",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",bar:"ct-bar",grid:"ct-grid",gridGroup:"ct-grids",gridBackground:"ct-grid-background",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};c.Bar=c.Base.extend({constructor:e,createChart:d})}(window,document,a),function(a,b,c){"use strict";function d(a,b,c){var d=b.x>a.x;return d&&"explode"===c||!d&&"implode"===c?"start":d&&"implode"===c||!d&&"explode"===c?"end":"middle"}function e(a){var b,e,f,h,i,j=c.normalizeData(this.data),k=[],l=a.startAngle;this.svg=c.createSvg(this.container,a.width,a.height,a.donut?a.classNames.chartDonut:a.classNames.chartPie),e=c.createChartRect(this.svg,a,g.padding),f=Math.min(e.width()/2,e.height()/2),i=a.total||j.normalized.series.reduce(function(a,b){return a+b},0);var m=c.quantity(a.donutWidth);"%"===m.unit&&(m.value*=f/100),f-=a.donut&&!a.donutSolid?m.value/2:0,h="outside"===a.labelPosition||a.donut&&!a.donutSolid?f:"center"===a.labelPosition?0:a.donutSolid?f-m.value/2:f/2,h+=a.labelOffset;var n={x:e.x1+e.width()/2,y:e.y2+e.height()/2},o=1===j.raw.series.filter(function(a){return a.hasOwnProperty("value")?0!==a.value:0!==a}).length;j.raw.series.forEach(function(a,b){k[b]=this.svg.elem("g",null,null)}.bind(this)),a.showLabel&&(b=this.svg.elem("g",null,null)),j.raw.series.forEach(function(e,g){if(0!==j.normalized.series[g]||!a.ignoreEmptyValues){k[g].attr({"ct:series-name":e.name}),k[g].addClass([a.classNames.series,e.className||a.classNames.series+"-"+c.alphaNumerate(g)].join(" "));var p=i>0?l+j.normalized.series[g]/i*360:0,q=Math.max(0,l-(0===g||o?0:.2));p-q>=359.99&&(p=q+359.99);var r,s,t,u=c.polarToCartesian(n.x,n.y,f,q),v=c.polarToCartesian(n.x,n.y,f,p),w=new c.Svg.Path(!a.donut||a.donutSolid).move(v.x,v.y).arc(f,f,0,p-l>180,0,u.x,u.y);a.donut?a.donutSolid&&(t=f-m.value,r=c.polarToCartesian(n.x,n.y,t,l-(0===g||o?0:.2)),s=c.polarToCartesian(n.x,n.y,t,p),w.line(r.x,r.y),w.arc(t,t,0,p-l>180,1,s.x,s.y)):w.line(n.x,n.y);var x=a.classNames.slicePie;a.donut&&(x=a.classNames.sliceDonut,a.donutSolid&&(x=a.classNames.sliceDonutSolid));var y=k[g].elem("path",{d:w.stringify()},x);if(y.attr({"ct:value":j.normalized.series[g],"ct:meta":c.serialize(e.meta)}),a.donut&&!a.donutSolid&&(y._node.style.strokeWidth=m.value+"px"),this.eventEmitter.emit("draw",{type:"slice",value:j.normalized.series[g],totalDataSum:i,index:g,meta:e.meta,series:e,group:k[g],element:y,path:w.clone(),center:n,radius:f,startAngle:l,endAngle:p}),a.showLabel){var z;z=1===j.raw.series.length?{x:n.x,y:n.y}:c.polarToCartesian(n.x,n.y,h,l+(p-l)/2);var A;A=j.normalized.labels&&!c.isFalseyButZero(j.normalized.labels[g])?j.normalized.labels[g]:j.normalized.series[g];var B=a.labelInterpolationFnc(A,g);if(B||0===B){var C=b.elem("text",{dx:z.x,dy:z.y,"text-anchor":d(n,z,a.labelDirection)},a.classNames.label).text(""+B);this.eventEmitter.emit("draw",{type:"label",index:g,group:b,element:C,text:""+B,x:z.x,y:z.y})}}l=p}}.bind(this)),this.eventEmitter.emit("created",{chartRect:e,svg:this.svg,options:a})}function f(a,b,d,e){c.Pie["super"].constructor.call(this,a,b,g,c.extend({},g,d),e)}var g={width:void 0,height:void 0,chartPadding:5,classNames:{chartPie:"ct-chart-pie",chartDonut:"ct-chart-donut",series:"ct-series",slicePie:"ct-slice-pie",sliceDonut:"ct-slice-donut",sliceDonutSolid:"ct-slice-donut-solid",label:"ct-label"},startAngle:0,total:void 0,donut:!1,donutSolid:!1,donutWidth:60,showLabel:!0,labelOffset:0,labelPosition:"inside",labelInterpolationFnc:c.noop,labelDirection:"neutral",reverseData:!1,ignoreEmptyValues:!1};c.Pie=c.Base.extend({constructor:f,createChart:e,determineAnchorPosition:d})}(window,document,a),a}); diff --git a/public/js/plugins/course.js b/public/js/plugins/course.js new file mode 100644 index 00000000..18e6d334 --- /dev/null +++ b/public/js/plugins/course.js @@ -0,0 +1,45 @@ +$('.richeditor').trumbowyg({ + lang: 'fr', + btns: [ + ['viewHTML'], + ['emoji'], + ['undo', 'redo'], // Only supported in Blink browsers + ['strong', 'em', 'del'], + ['superscript', 'subscript'], + ['fontfamily'], + ['fontsize'], + ['foreColor', 'backColor'], + ['link'], + ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'], + ['unorderedList', 'orderedList'], + ['horizontalRule'], + ['removeformat'], + ['fullscreen'] + ] +}); + +function switchPlanStatus(id) +{ + $.ajax({ + type: 'POST', + url: '/api/course/'+id+'/plan/validate?api_token='+api_token, + success: function (data) { + if (data == '1') + { + showNotification('success','Le plan de cours est maintenant vérifié','top', 'center'); + $("[name='isPlanCheck']").prop( "checked", true ); + + } + else + { + showNotification('warning','Le plan de cours n\'est maintenant plus vérifié','top', 'center'); + $("[name='isPlanCheck']").prop( "checked", false ); + + } + }, + error: function () { + showNotification('error','Erreur impossible de changer le status du plan de cours','top', 'center'); + $("[name='isPlanCheck']").prop( "checked", false ); + } + }) +} \ No newline at end of file diff --git a/public/js/plugins/drive-explorer.js b/public/js/plugins/drive-explorer.js index 59c89a63..10a4ba64 100644 --- a/public/js/plugins/drive-explorer.js +++ b/public/js/plugins/drive-explorer.js @@ -4,8 +4,13 @@ var currentFolder = ''; var folderGoBack = []; var permissionModalHtml = null; var progressBar = 0; -function init(folder) +var originalFolder; +var mode = ''; +function init(folder,pmode = '') { + mode = pmode; + console.log(mode); + originalFolder = folder; loadFolder(folder); loadHistory(); } @@ -28,7 +33,17 @@ function loadHistory() { updateProgressBar(progressBar+10); if(!currentFolder == '' || !currentFolder == 'root') { - btnBack.removeAttr('disabled'); + if (mode == 'folder') + { + if (currentFolder != originalFolder) + { + btnBack.removeAttr('disabled'); + } + } + else + { + btnBack.removeAttr('disabled'); + } } updateProgressBar(progressBar+5); }, @@ -50,11 +65,13 @@ function loadFolder(folder) { type: 'GET', url: '/api/drive/folders/'+folder+'?api_token=' + api_token, success: function (template) { - // Load Explorer Content updateProgressBar(progressBar+30); $(".drive-explorer").html(template); currentFolder = folder; - window.history.pushState("object or string", "Page Title", "/admin/drive/"+folder); + if (mode != 'folder') + { + window.history.pushState("object or string", "Page Title", "/admin/drive/"+folder); + } updateProgressBar(progressBar+5); hideLoader(); @@ -68,7 +85,21 @@ function loadFolder(folder) { } else { - $('#backbtn').removeAttr('disabled'); + if (mode == 'folder') + { + if (currentFolder != originalFolder) + { + $('#backbtn').removeAttr('disabled'); + } + else + { + $('#backbtn').prop('disabled','true'); + } + } + else + { + $('#backbtn').removeAttr('disabled'); + } } } updateProgressBar(progressBar+10); @@ -151,13 +182,16 @@ function editPermission(folder,subject,id) $('#permissionModal').on('hidden.bs.modal', function (e) { $('#permissionModalHtml').html(permissionModalHtml); }); - + let csrf = $('input[name="_token"]').val(); $.ajax({ type: 'GET', url: '/api/drive/'+folder+'/permission/'+subject+'/'+id+'?api_token=' + api_token, success: function (modal) { permissionModalHtml = $('#permissionModalHtml').html(); $('#permissionModalHtml').html(modal); + + $('#csrf').val(csrf); + $('#permissionModal').modal('show'); }, error: function () { @@ -166,6 +200,51 @@ function editPermission(folder,subject,id) }); } +function addPermission(folder,subject) +{ + $('#permissionModal').on('hidden.bs.modal', function (e) { + $('#permissionModalHtml').html(permissionModalHtml); + }); + let csrf = $('input[name="_token"]').val(); + $.ajax({ + type: 'GET', + url: '/api/drive/'+folder+'/addpermission/'+subject+'/?api_token=' + api_token, + success: function (modal) { + permissionModalHtml = $('#permissionModalHtml').html(); + $('#permissionModalHtml').html(modal); + + $('#csrf').val(csrf); + + $('#permissionModal').modal('show'); + }, + error: function () { + showNotification('error', 'Impossible de charger le dossier '+folder, 'top', 'center') + } + }); +} + +function deletePermission(folder,subject,id) +{ + $('#permissionModal').on('hidden.bs.modal', function (e) { + $('#permissionModalHtml').html(permissionModalHtml); + }); + swal({ + title: 'Êtes vous certain de vouloir supprimer les permissions ?', + text: "Vous ne pourrez pas annuler cette action", + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Oui', + cancelButtonText: 'Non' + }).then((result) => { + if (result.value) { + window.location.href = '/admin/drive/'+folder+'/deletepermission/'+subject+'/'+id; + } + }) + +} + function updateProgressBar(value) { progressBar = value; @@ -180,3 +259,17 @@ function updateProgressBar(value) $('.progress').fadeIn(650); } } + +function updateHeader(perm) +{ + if (perm == 1) + { + $('#createDropdown').removeClass('d-none'); + $('#uploadDropdown').removeClass('d-none'); + } + else + { + $('#createDropdown').addClass('d-none'); + $('#uploadDropdown').addClass('d-none'); + } +} diff --git a/resources/custom.css b/resources/custom.css index 4ca0c16e..1eb79b1c 100644 --- a/resources/custom.css +++ b/resources/custom.css @@ -1836,4 +1836,8 @@ h2 { .no-hover:hover { background-color: initial; +} + +tfoot > tr { + width: 100%; } \ No newline at end of file diff --git a/resources/views/admin/configs/ranks/show.blade.php b/resources/views/admin/configs/ranks/show.blade.php index 13c75cb3..58822c77 100644 --- a/resources/views/admin/configs/ranks/show.blade.php +++ b/resources/views/admin/configs/ranks/show.blade.php @@ -14,14 +14,14 @@
- + Nom du grade
- + Description du grade
@@ -33,35 +33,31 @@

@foreach(\App\Permission::allToArray() as $key => $cat) -
- - -
-
-
- @foreach($cat as $r) -
- -
{{$r['communName']}}
-
- - - -
-

- {{$r['desc']}} -

-
- @endforeach +
+

{{$key}}

+
+ @foreach($cat as $r) +
+ +

{{$r['communName']}}
+ {{$r['desc']}} +

-
+
+
+ + +
+
+
+ @endforeach
@endforeach diff --git a/resources/views/admin/configs/schedule.blade.php b/resources/views/admin/configs/schedule.blade.php index 335ab19d..4c164ee4 100644 --- a/resources/views/admin/configs/schedule.blade.php +++ b/resources/views/admin/configs/schedule.blade.php @@ -1,100 +1,150 @@ @extends('layouts.admin.main') @section('content') -
-
-
- Configuration Horaire d'instruction -
-
-
- @csrf -
Configuration des périodes
-
-
- - - Nombre de période dans une soirée d'instruction régulière -
-
-
- @for ($i = 1; $i <= \App\Config::getData('admin_periode_nb'); $i++) -
-
-

- -

+
+
+
+

Configuration de l'année d'instruction

+
+
+
+ + @method('PATCH') + @csrf +
+
+
Configuration de l'année d'instruction
- -
-
-
-
- - - Heure de début de la période dans une soirée d'instruction régulière +
+
+ + +
+
+
+
+ + +
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+

Type d'évènement

+
+
+
+
+ @foreach($events_type as $event_type) +
+
+
+

{{$event_type->name}}

+
+
+

De {{$event_type->begin_time}} à {{$event_type->end_time}} - {{$event_type->location}}

+
+ @if($event_type->is_mandatory) + +

Obligatoire

+ @else + +

N'est pas obligatoire

+ @endif
-
- - - Heure de fin de la période dans une soirée d'instruction régulière +
+ @if($event_type->use_weekly_msg) + +

Utilise les messages de la semaine

+ @else + +

N'utilise pas les messages de la semaine

+ @endif +
+
+ @if($event_type->use_schedule) + +

Utilise un horaire

+ @else + +

N'utilise pas un horaire

+ @endif +
+
+ {!! $event_type->admin_desc !!} +
+
+ +
+ @if($event_type->id != 1) + + @else + + @endif +
-
- @endfor -
-
- + @endforeach
- -
-
-
-@endsection - -@section('breadcrumb') - @endsection @section('custom_scripts') - -@endsection + +@endsection \ No newline at end of file diff --git a/resources/views/admin/course/index.blade.php b/resources/views/admin/course/index.blade.php new file mode 100644 index 00000000..95a00988 --- /dev/null +++ b/resources/views/admin/course/index.blade.php @@ -0,0 +1,135 @@ +@extends('layouts.admin.main') + +@section('content') +
+
+
+

Liste des cours

+
+
+
+
+
+

Liste des cours dans l'horaire

+ +
+
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + @foreach($courses as $course) + + + + + + + + + + + @endforeach + +
OCOMNomInstructeurDateNiveauPériodePlan de cours
{{$course->ocom}}{{$course->name}}{{$course->instructor()}}{{$course->event->date_begin}}{{$course->level}}{{$course->periode}} + @if($course->lessonPlan) + @if($course->lessonPlan->approved == 1) + + @else + + @endif + @else + + @endif + + + add + +
+
+
+
+
+@endsection + +@section('breadcrumb') + Base de données des cours +@endsection + +@section('custom_scripts') + +@endsection diff --git a/resources/views/admin/course/show.blade.php b/resources/views/admin/course/show.blade.php new file mode 100644 index 00000000..8a98f0ec --- /dev/null +++ b/resources/views/admin/course/show.blade.php @@ -0,0 +1,315 @@ +@extends('layouts.admin.main') + +@section('content') +
+
+
+
+

{{$course->name}} ({{$course->event->date_begin}})

+
+
+
+
+
+ +

{{$course->name}}

+
+
+ +

{{$username}}

+
+
+ +

{{$course->ocom}}

+
+
+ +

{{$course->event->date_begin}}

+
+
+ +

{{$course->periode}}

+
+
+ +

{{$course->level}}

+
+
+
+
+ +
+ @if($course->comment == null) +

Aucun commentaire

+ @else +
{!! $course->comment !!}
+ @endif +
+
+ +
+ @if($course->comment_officer == null) +

Aucun commentaire

+ @else +
{!! $course->comment_officer !!}
+ @endif +
+
+ +
+
+ @if(\Auth::user()->p('course_comment_officer') == 1) + + @endif +
+
+
+
+ + @if($course->lessonPlan == null) + + @else +
+
+ +

{{$course->lessonPlan->file}}

+
+
+ +

{{$course->lessonPlan->created_at}}

+ +
+
+ +

{{$course->lessonPlan->updated_at}}

+
+
+ + @if(\Auth::user()->p('course_validate_plan') == 1) +
+ +
+ @else + @if($course->lessonPlan->approved == 1) +

+ @else +

+ @endif + @endif +
+
+ +

+ + cloud_download + +

+
+
+
+
+ + +
+
+
+
+ + @if($course->lessonPlan->desc == null) +

Aucun commentaire

+ @else +
{!! $course->lessonPlan->desc !!}
+ @endif +
+
+ + @if($course->lessonPlan->comment == null) +

Aucun commentaire

+ @else +
{!! $course->lessonPlan->comment !!}
+ @endif +
+
+ +
+
+ @if(\Auth::user()->p('course_comment_plan_officer') == 1) + + @endif +
+
+
+
+
+
+
+
+ @endif + +
+
+
+
+
+
+
+ + + + + +@endsection + +@section('custom_scripts') + +@endsection + diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index 7b7ffc6a..7288dd19 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -6,7 +6,7 @@
-

Cours à venir

+

Mes cours à venir

@@ -15,14 +15,31 @@

Aucun cours à venir

@else - @foreach (\Auth::user()->futureCourses() as $course) + @foreach ($userClasse as $course) @if($course->event != null)
-
+
-

{{$course->ocom}} - {{$course->name}}

-

{{date('Y-m-d',strtotime($course->event->date_begin))}}

-

Période {{$course->periode}}, Niveau {{$course->level}}

+

+ {{$course->ocom}} - {{$course->name}} + @if($course->lessonPlan) + @if($course->lessonPlan->approved == 1) + + @else + + @endif + @else + + @endif +

+
+

{{date('Y-m-d',strtotime($course->event->date_begin))}}

+

Période {{$course->periode}}, Niveau {{$course->level}}

+
+
+ Détail +
+
@@ -30,6 +47,7 @@ @endforeach @endif
+ Afficher tous mes cours
@@ -85,6 +103,7 @@

diff --git a/resources/views/admin/event_type/show.blade.php b/resources/views/admin/event_type/show.blade.php new file mode 100644 index 00000000..d1e4e4fd --- /dev/null +++ b/resources/views/admin/event_type/show.blade.php @@ -0,0 +1,55 @@ +@extends('layouts.admin.main') + +@section('content') +
+
+
+

{{$event_type->name}}

+
+
+
+
+ @method('PATCH') + @csrf +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ +
+
+
+
+
+
+
+@endsection + +@section('custom_scripts') + +@endsection \ No newline at end of file diff --git a/resources/views/admin/files/Google Drive/explorer.blade.php b/resources/views/admin/files/Google Drive/explorer.blade.php index 8ab83f30..9e940dad 100644 --- a/resources/views/admin/files/Google Drive/explorer.blade.php +++ b/resources/views/admin/files/Google Drive/explorer.blade.php @@ -108,4 +108,7 @@ @endif -Dernière mise à jour {{date('r')}} \ No newline at end of file +Dernière mise à jour {{date('r')}} + \ No newline at end of file diff --git a/resources/views/admin/files/Google Drive/index.blade.php b/resources/views/admin/files/Google Drive/index.blade.php index f9ef5bf1..12fc506f 100644 --- a/resources/views/admin/files/Google Drive/index.blade.php +++ b/resources/views/admin/files/Google Drive/index.blade.php @@ -11,7 +11,7 @@
- - @@ -141,6 +140,10 @@ @endsection diff --git a/resources/views/admin/files/Google Drive/permission.blade.php b/resources/views/admin/files/Google Drive/permission.blade.php index 2826231c..e2f1f3ab 100644 --- a/resources/views/admin/files/Google Drive/permission.blade.php +++ b/resources/views/admin/files/Google Drive/permission.blade.php @@ -9,7 +9,7 @@
Permission des grades
- +
@@ -17,9 +17,9 @@ @@ -101,7 +101,7 @@ - @@ -111,7 +111,7 @@
GradeÉcriture Gestion - +
Permission des postes
- +
@@ -119,9 +119,9 @@ @@ -163,7 +163,7 @@ - @@ -172,7 +172,7 @@
PosteÉcriture Gestion - +
Permission des utilisateurs
- +
@@ -180,9 +180,9 @@ @@ -224,7 +224,7 @@ - @@ -235,6 +235,7 @@ + @csrf @endsection -@section('breadcrumb') - Fichier / Google Drive -@endsection - @section('custom_scripts') diff --git a/resources/views/admin/files/Google Drive/permission/add.blade.php b/resources/views/admin/files/Google Drive/permission/add.blade.php new file mode 100644 index 00000000..8241d993 --- /dev/null +++ b/resources/views/admin/files/Google Drive/permission/add.blade.php @@ -0,0 +1,81 @@ + + + + @method('patch') + + + + \ No newline at end of file diff --git a/resources/views/admin/files/Google Drive/permission/edit.blade.php b/resources/views/admin/files/Google Drive/permission/edit.blade.php index 7f5ea4a3..0d7f77f7 100644 --- a/resources/views/admin/files/Google Drive/permission/edit.blade.php +++ b/resources/views/admin/files/Google Drive/permission/edit.blade.php @@ -5,7 +5,7 @@ - @csrf + @method('patch')
UtilisateursÉcriture Gestion - +
+ + + + + + + + + @foreach($dir as $d) + + + + + + @endforeach + +
+ Nom + + Dernière modification +
+ {{$d['name']}} + + {{strftime('%e %b %Y',$d['timestamp'])}} + + + cloud_download + +
+
+
+
+
+@endsection + +@section('custom_scripts') + +@endsection diff --git a/resources/views/admin/files/guide.blade.php b/resources/views/admin/files/guide.blade.php index c1acc618..2c992e68 100644 --- a/resources/views/admin/files/guide.blade.php +++ b/resources/views/admin/files/guide.blade.php @@ -3,61 +3,39 @@ @section('content')
-
- Fichiers - +
+

Guides pédagogiques et Norme de qualification

-

Les fichiers si dessous sont disponible autant dans l'espace administration que dans l'espace cadet cadre. - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @foreach($dir as $d) + + + + + + @endforeach
Nom
+ Nom + + Dernière modification +
Niveau 1
Guide PédagogiqueTélécharger
Guide de QualificationTélécharger
Niveau 2
Guide PédagogiqueTélécharger
Guide de QualificationTélécharger
Niveau 3
Guide PédagogiqueTélécharger
Guide de QualificationTélécharger
Niveau 4
Guide PédagogiqueTélécharger
Guide de QualificationTélécharger
+ {{$d['name']}} + + {{strftime('%e %b %Y',$d['timestamp'])}} + + + cloud_download + +

@@ -66,10 +44,10 @@
@endsection -@section('breadcrumb') -Fichier / Guide Pédagogique -@endsection - @section('custom_scripts') - + @endsection diff --git a/resources/views/admin/ocom/show.blade.php b/resources/views/admin/ocom/show.blade.php index 8985d930..b11cff99 100644 --- a/resources/views/admin/ocom/show.blade.php +++ b/resources/views/admin/ocom/show.blade.php @@ -58,6 +58,7 @@ Date Instructeur Niveau + Plan de cours @@ -67,6 +68,23 @@ {{$course->event->date_begin}} {{$course->instructor()}} {{$course->level}} + + @if($course->lessonPlan) + + @if($course->lessonPlan->approved == 1) + + @else + + @endif + + @else + + @endif + @endforeach @@ -90,7 +108,6 @@ $('.tooltip').tooltip('enable') $(document).ready(function() { $('#table').DataTable({ - "lengthMenu": [[25, 50, -1], [25, 50, "All"]], "ordering" : true, "order": [[1, "asc"]] }); diff --git a/resources/views/admin/stats/component/lessonPlan.blade.php b/resources/views/admin/stats/component/lessonPlan.blade.php new file mode 100644 index 00000000..dfa07a1d --- /dev/null +++ b/resources/views/admin/stats/component/lessonPlan.blade.php @@ -0,0 +1,34 @@ +
+
+
+

Plan de cours remis

+

Combiens de plan de cours on été remis au courant de cette année d'instruction

+
+
+
+
+
+ +
+
+
+
+
+
+ \ No newline at end of file diff --git a/resources/views/admin/stats/instruction.blade.php b/resources/views/admin/stats/instruction.blade.php new file mode 100644 index 00000000..cde255f8 --- /dev/null +++ b/resources/views/admin/stats/instruction.blade.php @@ -0,0 +1,127 @@ +@extends('layouts.admin.main') + +@section('content') +
+
+
+
+

Statistique de l'instruction

+
+
+
+
+
+

+ {{$nbCourseUpToThisDay}} cours on été donnée cette année d'instruction par {{$nbInstructorUpToThisDay}} instructeurs différent au cours de {{$nbEventUpToThisDay}} activitées +

+
+
+
+
+
+
+
+
+
+

Plan de cours remis

+

Combiens de plan de cours on été remis au courant de cette année d'instruction

+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+

Cours de l'année d'instruction

+

Combiens de cours ont été donnée au courant de cette année d'instruction

+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+

Cours total de la DB

+

Combiens de cours ont été donnée au courant de cette année d'instruction par rapport au total de la DB

+
+
+
+
+
+ +
+
+
+
+
+
+
+@endsection + +@section('custom_scripts') + +@endsection diff --git a/resources/views/admin/update.blade.php b/resources/views/admin/update.blade.php index d2a843d7..70ee48af 100644 --- a/resources/views/admin/update.blade.php +++ b/resources/views/admin/update.blade.php @@ -51,6 +51,46 @@
+
  • +
    +
    + +
    +
    + Ajout d'une section "Mes cours" +
    +
    +
  • +
  • +
    +
    + +
    +
    + Ajout d'une section "Mes fichiers" +
    +
    +
  • +
  • +
    +
    + +
    +
    + Ajout d'une liste des cours pour l'instruction +
    +
    +
  • +
  • +
    +
    + +
    +
    + Ajout de statistique pour l'instruction +
    +
    +
  • @@ -91,6 +131,26 @@
  • +
  • +
    +
    + +
    +
    + Mise à jour de la section "Guide pédagogique et Norme de qualification" +
    +
    +
  • +
  • +
    +
    + +
    +
    + Mise à jour de la section "Fichier" de l'instruction +
    +
    +
  • diff --git a/resources/views/admin/user/profil/courses.blade.php b/resources/views/admin/user/profil/courses.blade.php new file mode 100644 index 00000000..a4088665 --- /dev/null +++ b/resources/views/admin/user/profil/courses.blade.php @@ -0,0 +1,84 @@ +@extends('layouts.admin.main') + +@section('content') +
    +
    +
    +

    Mes cours

    +
    +
    +
    +
    +
    +

    Liste de mes cours dans l'horaire

    + +
    +
    + + + + + + + + + + + + + + + @foreach($courses as $course) + + + + + + + + + + + @endforeach + +
    OCOMNomInstructeurDateNiveauPériodePlan de cours
    {{$course->ocom}}{{$course->name}}{{$course->instructor()}}{{$course->event->date_begin}}{{$course->level}}{{$course->periode}} + @if($course->lessonPlan) + @if($course->lessonPlan->approved == 1) + + @else + + @endif + @else + + @endif + + + add + +
    +
    +
    +
    +
    +@endsection + +@section('custom_scripts') + + +@endsection diff --git a/resources/views/layouts/admin/head.blade.php b/resources/views/layouts/admin/head.blade.php index 8184ce7c..4a96b0dd 100644 --- a/resources/views/layouts/admin/head.blade.php +++ b/resources/views/layouts/admin/head.blade.php @@ -29,6 +29,7 @@ + diff --git a/resources/views/layouts/admin/header.blade.php b/resources/views/layouts/admin/header.blade.php index 0b4bb47b..6d15ce17 100644 --- a/resources/views/layouts/admin/header.blade.php +++ b/resources/views/layouts/admin/header.blade.php @@ -67,7 +67,8 @@ foreach (Auth::user()->unreadNotifications as $notification) {