From 6ca2b76cebd8c6f913c34f7441a8cee9c16adcd4 Mon Sep 17 00:00:00 2001 From: Jordan Wright Date: Sun, 21 Apr 2019 16:34:52 -0500 Subject: [PATCH] Update Javascript Dependencies (#1440) * updated devDependencies, migrated gulpfile.js to gulp 4.0 syntax (#1438) * Rebuilding JS dependencies with new gulp config. Updated yarn.lock. Co-authored-by: Christian Schwartz --- gulpfile.js | 23 +- package.json | 19 +- static/js/dist/app/autocomplete.min.js | 2 +- static/js/dist/app/campaign_results.min.js | 2 +- static/js/dist/app/campaigns.min.js | 2 +- static/js/dist/app/dashboard.min.js | 2 +- static/js/dist/app/gophish.min.js | 2 +- static/js/dist/app/landing_pages.min.js | 2 +- static/js/dist/app/sending_profiles.min.js | 2 +- static/js/dist/app/templates.min.js | 2 +- static/js/dist/app/users.min.js | 2 +- static/js/dist/vendor.min.js | 31 +- yarn.lock | 2968 ++++++++++++++++++++ 13 files changed, 2999 insertions(+), 60 deletions(-) create mode 100644 yarn.lock diff --git a/gulpfile.js b/gulpfile.js index ea8e31b5..f89ed36e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -17,8 +17,7 @@ var gulp = require('gulp'), dest_js_directory = 'static/js/dist/', dest_css_directory = 'static/css/dist/'; -gulp.task('vendorjs', function () { - // Vendor minifying / concat +vendorjs = function () { return gulp.src([ vendor_directory + 'jquery.js', vendor_directory + 'bootstrap.min.js', @@ -46,11 +45,11 @@ gulp.task('vendorjs', function () { })) .pipe(uglify()) .pipe(gulp.dest(dest_js_directory)); -}) +} -gulp.task('scripts', function () { +scripts = function () { // Gophish app files - gulp.src(app_directory) + return gulp.src(app_directory) .pipe(rename({ suffix: '.min' })) @@ -58,9 +57,9 @@ gulp.task('scripts', function () { console.log(e); })) .pipe(gulp.dest(dest_js_directory + 'app/')); -}) +} -gulp.task('styles', function () { +styles = function () { return gulp.src([ css_directory + 'bootstrap.min.css', css_directory + 'main.css', @@ -80,8 +79,10 @@ gulp.task('styles', function () { })) .pipe(concat('gophish.css')) .pipe(gulp.dest(dest_css_directory)); -}) +} -gulp.task('build', ['vendorjs', 'scripts', 'styles']); - -gulp.task('default', ['build']); \ No newline at end of file +exports.vendorjs = vendorjs +exports.scripts = scripts +exports.styles = styles +exports.build = gulp.parallel(vendorjs, scripts, styles) +exports.default = exports.build \ No newline at end of file diff --git a/package.json b/package.json index 36d7e62c..1f17d851 100644 --- a/package.json +++ b/package.json @@ -12,17 +12,16 @@ }, "homepage": "https://getgophish.com", "devDependencies": { - "clean-css": "^3.4.23", - "gulp": "^3.9.1", - "gulp-clean-css": "^2.3.2", - "gulp-cli": "^1.4.0", + "clean-css": "^4.2.1", + "gulp": "^4.0.0", + "gulp-clean-css": "^4.0.0", + "gulp-cli": "^2.2.0", "gulp-concat": "^2.6.1", - "gulp-jshint": "^2.0.4", - "gulp-rename": "^1.2.2", - "gulp-uglify": "^2.0.0", - "gulp-util": "^3.0.8", - "gulp-wrap": "^0.13.0", - "jshint": "^2.9.4", + "gulp-jshint": "^2.1.0", + "gulp-rename": "^1.4.0", + "gulp-uglify": "^3.0.2", + "gulp-wrap": "^0.15.0", + "jshint": "^2.10.2", "jshint-stylish": "^2.2.1" } } diff --git a/static/js/dist/app/autocomplete.min.js b/static/js/dist/app/autocomplete.min.js index 09a85ec5..0f6c41b4 100644 --- a/static/js/dist/app/autocomplete.min.js +++ b/static/js/dist/app/autocomplete.min.js @@ -1 +1 @@ -var TEMPLATE_TAGS=[{id:1,name:"RId",description:"The unique ID for the recipient."},{id:2,name:"FirstName",description:"The recipient's first name."},{id:3,name:"LastName",description:"The recipient's last name."},{id:4,name:"Position",description:"The recipient's position."},{id:5,name:"From",description:"The address emails are sent from."},{id:6,name:"TrackingURL",description:"The URL to track emails being opened."},{id:7,name:"Tracker",description:"An HTML tag that adds a hidden tracking image (recommended instead of TrackingURL)."},{id:8,name:"URL",description:"The URL to your Gophish listener."},{id:9,name:"BaseURL",description:"The base URL with the path and rid parameter stripped. Useful for making links to static files."}],textTestCallback=function(e){return e.collapsed?CKEDITOR.plugins.textMatch.match(e,matchCallback):null},matchCallback=function(e,t){var i=/\{{2}\.?([A-z]|\})*$/,a=e.slice(0,t).match(i);return a?{start:a.index,end:t}:null},dataCallback=function(e,t){t(TEMPLATE_TAGS.filter(function(t){return 0==("{{."+t.name.toLowerCase()+"}}").indexOf(e.query.toLowerCase())}))},setupAutocomplete=function(e){e.on("instanceReady",function(e){new CKEDITOR.plugins.autocomplete(e.editor,{textTestCallback:textTestCallback,dataCallback:dataCallback,itemTemplate:'
  • {name}
    {description}
  • ',outputTemplate:"[[.{name}]]"}).getHtmlToInsert=function(e){var t=this.outputTemplate.output(e);return t=t.replace("[[","{{").replace("]]","}}")}})}; \ No newline at end of file +var TEMPLATE_TAGS=[{id:1,name:"RId",description:"The unique ID for the recipient."},{id:2,name:"FirstName",description:"The recipient's first name."},{id:3,name:"LastName",description:"The recipient's last name."},{id:4,name:"Position",description:"The recipient's position."},{id:5,name:"From",description:"The address emails are sent from."},{id:6,name:"TrackingURL",description:"The URL to track emails being opened."},{id:7,name:"Tracker",description:"An HTML tag that adds a hidden tracking image (recommended instead of TrackingURL)."},{id:8,name:"URL",description:"The URL to your Gophish listener."},{id:9,name:"BaseURL",description:"The base URL with the path and rid parameter stripped. Useful for making links to static files."}],textTestCallback=function(e){return e.collapsed?CKEDITOR.plugins.textMatch.match(e,matchCallback):null},matchCallback=function(e,t){var i=e.slice(0,t).match(/\{{2}\.?([A-z]|\})*$/);return i?{start:i.index,end:t}:null},dataCallback=function(t,e){e(TEMPLATE_TAGS.filter(function(e){return 0==("{{."+e.name.toLowerCase()+"}}").indexOf(t.query.toLowerCase())}))},setupAutocomplete=function(e){e.on("instanceReady",function(e){new CKEDITOR.plugins.autocomplete(e.editor,{textTestCallback:textTestCallback,dataCallback:dataCallback,itemTemplate:'
  • {name}
    {description}
  • ',outputTemplate:"[[.{name}]]"}).getHtmlToInsert=function(e){var t=this.outputTemplate.output(e);return t=t.replace("[[","{{").replace("]]","}}")}})}; \ No newline at end of file diff --git a/static/js/dist/app/campaign_results.min.js b/static/js/dist/app/campaign_results.min.js index 8c461d9a..d02e60e3 100644 --- a/static/js/dist/app/campaign_results.min.js +++ b/static/js/dist/app/campaign_results.min.js @@ -1 +1 @@ -function dismiss(){$("#modal\\.flashes").empty(),$("#modal").modal("hide"),$("#resultsTable").dataTable().DataTable().clear().draw()}function deleteCampaign(){swal({title:"Are you sure?",text:"This will delete the campaign. This can't be undone!",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Delete Campaign",confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,showLoaderOnConfirm:!0,preConfirm:function(){return new Promise(function(e,t){api.campaignId.delete(campaign.id).success(function(t){e()}).error(function(e){t(e.responseJSON.message)})})}}).then(function(){swal("Campaign Deleted!","This campaign has been deleted!","success"),$('button:contains("OK")').on("click",function(){location.href="/campaigns"})})}function completeCampaign(){swal({title:"Are you sure?",text:"Gophish will stop processing events for this campaign",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Complete Campaign",confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,showLoaderOnConfirm:!0,preConfirm:function(){return new Promise(function(e,t){api.campaignId.complete(campaign.id).success(function(t){e()}).error(function(e){t(e.responseJSON.message)})})}}).then(function(){swal("Campaign Completed!","This campaign has been completed!","success"),$("#complete_button")[0].disabled=!0,$("#complete_button").text("Completed!"),doPoll=!1})}function exportAsCSV(e){exportHTML=$("#exportButton").html();var t=null,a=campaign.name+" - "+capitalize(e)+".csv";switch(e){case"results":t=campaign.results;break;case"events":t=campaign.timeline}if(t){$("#exportButton").html('');var s=Papa.unparse(t,{}),i=new Blob([s],{type:"text/csv;charset=utf-8;"});if(navigator.msSaveBlob)navigator.msSaveBlob(i,a);else{var l=window.URL.createObjectURL(i),n=document.createElement("a");n.href=l,n.setAttribute("download",a),document.body.appendChild(n),n.click(),document.body.removeChild(n)}$("#exportButton").html(exportHTML)}}function replay(e){function t(){form.attr({action:url}),form.appendTo("body").submit().remove()}request=campaign.timeline[e],details=JSON.parse(request.details),url=null,form=$("
    ").attr({method:"POST",target:"_blank"}),$.each(Object.keys(details.payload),function(e,t){return"rid"==t||("__original_url"==t?(url=details.payload[t],!0):void $("").attr({name:t}).val(details.payload[t]).appendTo(form))}),swal({title:"Where do you want the credentials submitted to?",input:"text",showCancelButton:!0,inputPlaceholder:"http://example.com/login",inputValue:url||"",inputValidator:function(e){return new Promise(function(t,a){e?t():a("Invalid URL.")})}}).then(function(e){url=e,t()})}function renderTimeline(e){return record={id:e[0],first_name:e[2],last_name:e[3],email:e[4],position:e[5],status:e[6],reported:e[7],send_date:e[8]},results='
    Timeline for '+escapeHtml(record.first_name)+" "+escapeHtml(record.last_name)+'
    Email: '+escapeHtml(record.email)+"
    Result ID: "+escapeHtml(record.id)+'
    ',$.each(campaign.timeline,function(e,t){t.email&&t.email!=record.email||(results+='
    ',results+='
    '+escapeHtml(t.message)+' '+moment.utc(t.time).local().format("MMMM Do YYYY h:mm:ss a")+"",t.details&&(details=JSON.parse(t.details),"Clicked Link"!=t.message&&"Submitted Data"!=t.message||(deviceView=renderDevice(details),deviceView&&(results+=deviceView)),"Submitted Data"==t.message&&(results+='
    ',results+='
    View Details
    '),details.payload&&(results+='
    ',results+=' ',results+=" ",$.each(Object.keys(details.payload),function(e,t){if("rid"==t)return!0;results+=" ",results+=" ",results+=" ",results+=" "}),results+="
    ParameterValue(s)
    "+escapeHtml(t)+""+escapeHtml(details.payload[t])+"
    ",results+="
    "),details.error&&(results+='
    View Details
    ',results+='
    ',results+='Error '+details.error,results+="
    ")),results+="
    ")}),"Scheduled"!=record.status&&"Retrying"!=record.status||(results+='
    ',results+='
    Scheduled to send at '+record.send_date+""),results+="
    ",results}function createStatusLabel(e,t){var a=statuses[e].label||"label-default",s=''+e+"";if("Scheduled"==e||"Retrying"==e){s=''+e+""}return s}function poll(){api.campaignId.results(campaign.id).success(function(e){campaign=e;var t=[];$.each(campaign.timeline,function(e,a){var s=moment.utc(a.time).local();t.push({email:a.email,x:s.valueOf(),y:1})});var t=[];$.each(campaign.timeline,function(e,a){var s=moment.utc(a.time).local();t.push({email:a.email,message:a.message,x:s.valueOf(),y:1,marker:{fillColor:statuses[a.message].color}})}),$("#timeline_chart").highcharts().series[0].update({data:t});var a={};Object.keys(statusMapping).forEach(function(e){a[e]=0}),$.each(campaign.results,function(e,t){a[t.status]++,t.reported&&a["Email Reported"]++;for(var s=progressListing.indexOf(t.status),e=0;e":"":e},targets:[7]}]}),resultsTable.clear();var a={},s=[];Object.keys(statusMapping).forEach(function(e){a[e]=0}),$.each(campaign.results,function(e,t){resultsTable.row.add([t.id,'',escapeHtml(t.first_name)||"",escapeHtml(t.last_name)||"",escapeHtml(t.email)||"",escapeHtml(t.position)||"",t.status,t.reported,moment(t.send_date).format("MMMM Do YYYY, h:mm:ss a")]),a[t.status]++,t.reported&&a["Email Reported"]++;for(var s=progressListing.indexOf(t.status),e=0;e',s="laptop";t.device.type&&("tablet"!=t.device.type&&"mobile"!=t.device.type||(s=t.device.type));var i="";t.device.vendor&&"microsoft"==(i=t.device.vendor.toLowerCase())&&(i="windows");var l="Unknown";t.os.name&&(l=t.os.name,"Mac OS"==l?i="apple":"Windows"==l&&(i="windows"),t.device.vendor&&t.device.model&&(l=t.device.vendor+" "+t.device.model)),t.os.version&&(l=l+" (OS Version: "+t.os.version+")"),deviceString='
    '+escapeHtml(l)+"
    ",a+=deviceString;var n="Unknown",r="info-circle",o="";return t.browser&&t.browser.name&&(n=t.browser.name,n=n.replace("Mobile ",""),n&&"ie"==(r=n.toLowerCase())&&(r="internet-explorer"),o="(Version: "+t.browser.version+")"),a+='
    '+n+" "+o+"
    ",a+="
    "},renderTimelineChart=function(e){return Highcharts.chart("timeline_chart",{chart:{zoomType:"x",type:"line",height:"200px"},title:{text:"Campaign Timeline"},xAxis:{type:"datetime",dateTimeLabelFormats:{second:"%l:%M:%S",minute:"%l:%M",hour:"%l:%M",day:"%b %d, %Y",week:"%b %d, %Y",month:"%b %Y"}},yAxis:{min:0,max:2,visible:!1,tickInterval:1,labels:{enabled:!1},title:{text:""}},tooltip:{formatter:function(){return Highcharts.dateFormat("%A, %b %d %l:%M:%S %P",new Date(this.x))+"
    Event: "+this.point.message+"
    Email: "+this.point.email+""}},legend:{enabled:!1},plotOptions:{series:{marker:{enabled:!0,symbol:"circle",radius:3},cursor:"pointer"},line:{states:{hover:{lineWidth:1}}}},credits:{enabled:!1},series:[{data:e.data,dashStyle:"shortdash",color:"#cccccc",lineWidth:1,turboThreshold:0}]})},renderPieChart=function(e){return Highcharts.chart(e.elemId,{chart:{type:"pie",events:{load:function(){var t=this,a=t.renderer,s=t.series[0],i=t.plotLeft+s.center[0],l=t.plotTop+s.center[1];this.innerText=a.text(e.data[0].count,i,l).attr({"text-anchor":"middle","font-size":"24px","font-weight":"bold",fill:e.colors[0],"font-family":"Helvetica,Arial,sans-serif"}).add()},render:function(){this.innerText.attr({text:e.data[0].count})}}},title:{text:e.title},plotOptions:{pie:{innerSize:"80%",dataLabels:{enabled:!1}}},credits:{enabled:!1},tooltip:{formatter:function(){return void 0!=this.key&&''+this.point.name+": "+this.y+"%
    "}},series:[{data:e.data,colors:e.colors}]})},updateMap=function(e){map&&(bubbles=[],$.each(campaign.results,function(e,t){if(0==t.latitude&&0==t.longitude)return!0;newIP=!0,$.each(bubbles,function(e,a){if(a.ip==t.ip)return bubbles[e].radius+=1,newIP=!1,!1}),newIP&&bubbles.push({latitude:t.latitude,longitude:t.longitude,name:t.ip,fillKey:"point",radius:2})}),map.bubbles(bubbles))},setRefresh;$(document).ready(function(){Highcharts.setOptions({global:{useUTC:!1}}),load(),setRefresh=setTimeout(refresh,6e4)}); \ No newline at end of file +var map=null,doPoll=!0,statuses={"Email Sent":{color:"#1abc9c",label:"label-success",icon:"fa-envelope",point:"ct-point-sent"},"Emails Sent":{color:"#1abc9c",label:"label-success",icon:"fa-envelope",point:"ct-point-sent"},"In progress":{label:"label-primary"},Queued:{label:"label-info"},Completed:{label:"label-success"},"Email Opened":{color:"#f9bf3b",label:"label-warning",icon:"fa-envelope-open",point:"ct-point-opened"},"Clicked Link":{color:"#F39C12",label:"label-clicked",icon:"fa-mouse-pointer",point:"ct-point-clicked"},Success:{color:"#f05b4f",label:"label-danger",icon:"fa-exclamation",point:"ct-point-clicked"},"Email Reported":{color:"#45d6ef",label:"label-info",icon:"fa-bullhorn",point:"ct-point-reported"},Error:{color:"#6c7a89",label:"label-default",icon:"fa-times",point:"ct-point-error"},"Error Sending Email":{color:"#6c7a89",label:"label-default",icon:"fa-times",point:"ct-point-error"},"Submitted Data":{color:"#f05b4f",label:"label-danger",icon:"fa-exclamation",point:"ct-point-clicked"},Unknown:{color:"#6c7a89",label:"label-default",icon:"fa-question",point:"ct-point-error"},Sending:{color:"#428bca",label:"label-primary",icon:"fa-spinner",point:"ct-point-sending"},Retrying:{color:"#6c7a89",label:"label-default",icon:"fa-clock-o",point:"ct-point-error"},Scheduled:{color:"#428bca",label:"label-primary",icon:"fa-clock-o",point:"ct-point-sending"},"Campaign Created":{label:"label-success",icon:"fa-rocket"}},statusMapping={"Email Sent":"sent","Email Opened":"opened","Clicked Link":"clicked","Submitted Data":"submitted_data","Email Reported":"reported"},progressListing=["Email Sent","Email Opened","Clicked Link","Submitted Data"],campaign={},bubbles=[];function dismiss(){$("#modal\\.flashes").empty(),$("#modal").modal("hide"),$("#resultsTable").dataTable().DataTable().clear().draw()}function deleteCampaign(){swal({title:"Are you sure?",text:"This will delete the campaign. This can't be undone!",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Delete Campaign",confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,showLoaderOnConfirm:!0,preConfirm:function(){return new Promise(function(t,a){api.campaignId.delete(campaign.id).success(function(e){t()}).error(function(e){a(e.responseJSON.message)})})}}).then(function(){swal("Campaign Deleted!","This campaign has been deleted!","success"),$('button:contains("OK")').on("click",function(){location.href="/campaigns"})})}function completeCampaign(){swal({title:"Are you sure?",text:"Gophish will stop processing events for this campaign",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Complete Campaign",confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,showLoaderOnConfirm:!0,preConfirm:function(){return new Promise(function(t,a){api.campaignId.complete(campaign.id).success(function(e){t()}).error(function(e){a(e.responseJSON.message)})})}}).then(function(){swal("Campaign Completed!","This campaign has been completed!","success"),$("#complete_button")[0].disabled=!0,$("#complete_button").text("Completed!"),doPoll=!1})}function exportAsCSV(e){exportHTML=$("#exportButton").html();var t=null,a=campaign.name+" - "+capitalize(e)+".csv";switch(e){case"results":t=campaign.results;break;case"events":t=campaign.timeline}if(t){$("#exportButton").html('');var s=Papa.unparse(t,{}),i=new Blob([s],{type:"text/csv;charset=utf-8;"});if(navigator.msSaveBlob)navigator.msSaveBlob(i,a);else{var l=window.URL.createObjectURL(i),n=document.createElement("a");n.href=l,n.setAttribute("download",a),document.body.appendChild(n),n.click(),document.body.removeChild(n)}$("#exportButton").html(exportHTML)}}function replay(e){return request=campaign.timeline[e],details=JSON.parse(request.details),url=null,form=$("").attr({method:"POST",target:"_blank"}),$.each(Object.keys(details.payload),function(e,t){return"rid"==t||("__original_url"==t?(url=details.payload[t],!0):void $("").attr({name:t}).val(details.payload[t]).appendTo(form))}),void swal({title:"Where do you want the credentials submitted to?",input:"text",showCancelButton:!0,inputPlaceholder:"http://example.com/login",inputValue:url||"",inputValidator:function(a){return new Promise(function(e,t){a?e():t("Invalid URL.")})}}).then(function(e){url=e,t()});function t(){form.attr({action:url}),form.appendTo("body").submit().remove()}}var renderDevice=function(e){var t=UAParser(details.browser["user-agent"]),a='
    ',s="laptop";t.device.type&&("tablet"!=t.device.type&&"mobile"!=t.device.type||(s=t.device.type));var i="";t.device.vendor&&"microsoft"==(i=t.device.vendor.toLowerCase())&&(i="windows");var l="Unknown";t.os.name&&("Mac OS"==(l=t.os.name)?i="apple":"Windows"==l&&(i="windows"),t.device.vendor&&t.device.model&&(l=t.device.vendor+" "+t.device.model)),t.os.version&&(l=l+" (OS Version: "+t.os.version+")"),deviceString='
    '+escapeHtml(l)+"
    ",a+=deviceString;var n="Unknown",r="info-circle",o="";return t.browser&&t.browser.name&&((n=(n=t.browser.name).replace("Mobile ",""))&&"ie"==(r=n.toLowerCase())&&(r="internet-explorer"),o="(Version: "+t.browser.version+")"),a+='
    '+n+" "+o+"
    ",a+="
    "};function renderTimeline(e){return record={id:e[0],first_name:e[2],last_name:e[3],email:e[4],position:e[5],status:e[6],reported:e[7],send_date:e[8]},results='
    Timeline for '+escapeHtml(record.first_name)+" "+escapeHtml(record.last_name)+'
    Email: '+escapeHtml(record.email)+"
    Result ID: "+escapeHtml(record.id)+'
    ',$.each(campaign.timeline,function(e,t){t.email&&t.email!=record.email||(results+='
    ',results+='
    '+escapeHtml(t.message)+' '+moment.utc(t.time).local().format("MMMM Do YYYY h:mm:ss a")+"",t.details&&(details=JSON.parse(t.details),"Clicked Link"!=t.message&&"Submitted Data"!=t.message||(deviceView=renderDevice(details),deviceView&&(results+=deviceView)),"Submitted Data"==t.message&&(results+='
    ',results+='
    View Details
    '),details.payload&&(results+='
    ',results+=' ',results+=" ",$.each(Object.keys(details.payload),function(e,t){if("rid"==t)return!0;results+=" ",results+=" ",results+=" ",results+=" "}),results+="
    ParameterValue(s)
    "+escapeHtml(t)+""+escapeHtml(details.payload[t])+"
    ",results+="
    "),details.error&&(results+='
    View Details
    ',results+='
    ',results+='Error '+details.error,results+="
    ")),results+="
    ")}),"Scheduled"!=record.status&&"Retrying"!=record.status||(results+='
    ',results+='
    Scheduled to send at '+record.send_date+""),results+="
    ",results}var setRefresh,renderTimelineChart=function(e){return Highcharts.chart("timeline_chart",{chart:{zoomType:"x",type:"line",height:"200px"},title:{text:"Campaign Timeline"},xAxis:{type:"datetime",dateTimeLabelFormats:{second:"%l:%M:%S",minute:"%l:%M",hour:"%l:%M",day:"%b %d, %Y",week:"%b %d, %Y",month:"%b %Y"}},yAxis:{min:0,max:2,visible:!1,tickInterval:1,labels:{enabled:!1},title:{text:""}},tooltip:{formatter:function(){return Highcharts.dateFormat("%A, %b %d %l:%M:%S %P",new Date(this.x))+"
    Event: "+this.point.message+"
    Email: "+this.point.email+""}},legend:{enabled:!1},plotOptions:{series:{marker:{enabled:!0,symbol:"circle",radius:3},cursor:"pointer"},line:{states:{hover:{lineWidth:1}}}},credits:{enabled:!1},series:[{data:e.data,dashStyle:"shortdash",color:"#cccccc",lineWidth:1,turboThreshold:0}]})},renderPieChart=function(l){return Highcharts.chart(l.elemId,{chart:{type:"pie",events:{load:function(){var e=this,t=e.renderer,a=e.series[0],s=e.plotLeft+a.center[0],i=e.plotTop+a.center[1];this.innerText=t.text(l.data[0].count,s,i).attr({"text-anchor":"middle","font-size":"24px","font-weight":"bold",fill:l.colors[0],"font-family":"Helvetica,Arial,sans-serif"}).add()},render:function(){this.innerText.attr({text:l.data[0].count})}}},title:{text:l.title},plotOptions:{pie:{innerSize:"80%",dataLabels:{enabled:!1}}},credits:{enabled:!1},tooltip:{formatter:function(){return null!=this.key&&''+this.point.name+": "+this.y+"%
    "}},series:[{data:l.data,colors:l.colors}]})},updateMap=function(e){map&&(bubbles=[],$.each(campaign.results,function(e,a){if(0==a.latitude&&0==a.longitude)return!0;newIP=!0,$.each(bubbles,function(e,t){if(t.ip==a.ip)return bubbles[e].radius+=1,newIP=!1}),newIP&&bubbles.push({latitude:a.latitude,longitude:a.longitude,name:a.ip,fillKey:"point",radius:2})}),map.bubbles(bubbles))};function createStatusLabel(e,t){var a=statuses[e].label||"label-default",s=''+e+"";"Scheduled"!=e&&"Retrying"!=e||(s=''+e+"");return s}function poll(){api.campaignId.results(campaign.id).success(function(e){campaign=e;var s=[];$.each(campaign.timeline,function(e,t){var a=moment.utc(t.time).local();s.push({email:t.email,x:a.valueOf(),y:1})});s=[];$.each(campaign.timeline,function(e,t){var a=moment.utc(t.time).local();s.push({email:t.email,message:t.message,x:a.valueOf(),y:1,marker:{fillColor:statuses[t.message].color}})}),$("#timeline_chart").highcharts().series[0].update({data:s});var i={};Object.keys(statusMapping).forEach(function(e){i[e]=0}),$.each(campaign.results,function(e,t){i[t.status]++,t.reported&&i["Email Reported"]++;var a=progressListing.indexOf(t.status);for(e=0;e":"":e},targets:[7]}]}),resultsTable.clear();var s={},i=[];Object.keys(statusMapping).forEach(function(e){s[e]=0}),$.each(campaign.results,function(e,t){resultsTable.row.add([t.id,'',escapeHtml(t.first_name)||"",escapeHtml(t.last_name)||"",escapeHtml(t.email)||"",escapeHtml(t.position)||"",t.status,t.reported,moment(t.send_date).format("MMMM Do YYYY, h:mm:ss a")]),s[t.status]++,t.reported&&s["Email Reported"]++;var a=progressListing.indexOf(t.status);for(e=0;e '+e.responseJSON.message+"
    "),swal.close()})})}}).then(function(){swal("Campaign Scheduled!","This campaign has been scheduled for launch!","success"),$('button:contains("OK")').on("click",function(){window.location="/campaigns/"+campaign.id.toString()})})}function sendTestEmail(){var e={template:{name:$("#template").select2("data")[0].text},first_name:$("input[name=to_first_name]").val(),last_name:$("input[name=to_last_name]").val(),email:$("input[name=to_email]").val(),position:$("input[name=to_position]").val(),url:$("#url").val(),page:{name:$("#page").select2("data")[0].text},smtp:{name:$("#profile").select2("data")[0].text}};btnHtml=$("#sendTestModalSubmit").html(),$("#sendTestModalSubmit").html(' Sending'),api.send_test_email(e).success(function(e){$("#sendTestEmailModal\\.flashes").empty().append('
    Email Sent!
    '),$("#sendTestModalSubmit").html(btnHtml)}).error(function(e){$("#sendTestEmailModal\\.flashes").empty().append('
    '+e.responseJSON.message+"
    "),$("#sendTestModalSubmit").html(btnHtml)})}function dismiss(){$("#modal\\.flashes").empty(),$("#name").val(""),$("#template").val("").change(),$("#page").val("").change(),$("#url").val(""),$("#profile").val("").change(),$("#users").val("").change(),$("#modal").modal("hide")}function deleteCampaign(e){swal({title:"Are you sure?",text:"This will delete the campaign. This can't be undone!",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Delete "+campaigns[e].name,confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,preConfirm:function(){return new Promise(function(a,t){api.campaignId.delete(campaigns[e].id).success(function(e){a()}).error(function(e){t(e.responseJSON.message)})})}}).then(function(){swal("Campaign Deleted!","This campaign has been deleted!","success"),$('button:contains("OK")').on("click",function(){location.reload()})})}function setupOptions(){api.groups.get().success(function(e){if(0==e.length)return modalError("No groups found!"),!1;var a=$.map(e,function(e){return e.text=e.name,e});$("#users.form-control").select2({placeholder:"Select Groups",data:a})}),api.templates.get().success(function(e){if(0==e.length)return modalError("No templates found!"),!1;var a=$.map(e,function(e){return e.text=e.name,e}),t=$("#template.form-control");t.select2({placeholder:"Select a Template",data:a}),1===e.length&&(t.val(a[0].id),t.trigger("change.select2"))}),api.pages.get().success(function(e){if(0==e.length)return modalError("No pages found!"),!1;var a=$.map(e,function(e){return e.text=e.name,e}),t=$("#page.form-control");t.select2({placeholder:"Select a Landing Page",data:a}),1===e.length&&(t.val(a[0].id),t.trigger("change.select2"))}),api.SMTP.get().success(function(e){if(0==e.length)return modalError("No profiles found!"),!1;var a=$.map(e,function(e){return e.text=e.name,e}),t=$("#profile.form-control");t.select2({placeholder:"Select a Sending Profile",data:a}).select2("val",a[0]),1===e.length&&(t.val(a[0].id),t.trigger("change.select2"))})}function edit(e){setupOptions()}function copy(e){setupOptions(),api.campaignId.get(campaigns[e].id).success(function(e){$("#name").val("Copy of "+e.name),e.template.id?($("#template").val(e.template.id.toString()),$("#template").trigger("change.select2")):$("#template").select2({placeholder:e.template.name}),e.page.id?($("#page").val(e.page.id.toString()),$("#page").trigger("change.select2")):$("#page").select2({placeholder:e.page.name}),e.smtp.id?($("#profile").val(e.smtp.id.toString()),$("#profile").trigger("change.select2")):$("#profile").select2({placeholder:e.smtp.name}),$("#url").val(e.url)}).error(function(e){$("#modal\\.flashes").empty().append('
    '+e.responseJSON.message+"
    ")})}var labels={"In progress":"label-primary",Queued:"label-info",Completed:"label-success","Emails Sent":"label-success",Error:"label-danger"},campaigns=[],campaign={};$(document).ready(function(){$("#launch_date").datetimepicker({widgetPositioning:{vertical:"bottom"},showTodayButton:!0,defaultDate:moment(),format:"MMMM Do YYYY, h:mm a"}),$("#send_by_date").datetimepicker({widgetPositioning:{vertical:"bottom"},showTodayButton:!0,useCurrent:!1,format:"MMMM Do YYYY, h:mm a"}),$(".modal").on("hidden.bs.modal",function(e){$(this).removeClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")-1)}),$(".modal").on("shown.bs.modal",function(e){void 0===$("body").data("fv_open_modals")&&$("body").data("fv_open_modals",0),$(this).hasClass("fv-modal-stack")||($(this).addClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")+1),$(this).css("z-index",1040+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not(".fv-modal-stack").css("z-index",1039+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not("fv-modal-stack").addClass("fv-modal-stack"))}),$(document).on("hidden.bs.modal",".modal",function(){$(".modal:visible").length&&$(document.body).addClass("modal-open")}),$("#modal").on("hidden.bs.modal",function(e){dismiss()}),api.campaigns.summary().success(function(e){campaigns=e.campaigns,$("#loading").hide(),campaigns.length>0?($("#campaignTable").show(),$("#campaignTableArchive").show(),campaignTableOriginal=$("#campaignTable").DataTable({columnDefs:[{orderable:!1,targets:"no-sort"}],order:[[1,"desc"]]}),campaignTableArchive=$("#campaignTableArchive").DataTable({columnDefs:[{orderable:!1,targets:"no-sort"}],order:[[1,"desc"]]}),$.each(campaigns,function(e,a){campaignTable=campaignTableOriginal,"Completed"===a.status&&(campaignTable=campaignTableArchive),label=labels[a.status]||"label-default";var t;if(moment(a.launch_date).isAfter(moment())){t="Scheduled to start: "+moment(a.launch_date).format("MMMM Do YYYY, h:mm:ss a");var n=t+"

    Number of recipients: "+a.stats.total}else{t="Launch Date: "+moment(a.launch_date).format("MMMM Do YYYY, h:mm:ss a");var n=t+"

    Number of recipients: "+a.stats.total+"

    Emails opened: "+a.stats.opened+"

    Emails clicked: "+a.stats.clicked+"

    Submitted Credentials: "+a.stats.submitted_data+"

    Errors : "+a.stats.error+"Reported : "+a.stats.reported}campaignTable.row.add([escapeHtml(a.name),moment(a.created_date).format("MMMM Do YYYY, h:mm:ss a"),''+a.status+"",""]).draw(),$('[data-toggle="tooltip"]').tooltip()})):$("#emptyMessage").show()}).error(function(){$("#loading").hide(),errorFlash("Error fetching campaigns")}),$.fn.select2.defaults.set("width","100%"),$.fn.select2.defaults.set("dropdownParent",$("#modal_body")),$.fn.select2.defaults.set("theme","bootstrap"),$.fn.select2.defaults.set("sorter",function(e){return e.sort(function(e,a){return e.text.toLowerCase()>a.text.toLowerCase()?1:e.text.toLowerCase() '+e.responseJSON.message+"
    "),swal.close()})})}}).then(function(){swal("Campaign Scheduled!","This campaign has been scheduled for launch!","success"),$('button:contains("OK")').on("click",function(){window.location="/campaigns/"+campaign.id.toString()})})}function sendTestEmail(){var e={template:{name:$("#template").select2("data")[0].text},first_name:$("input[name=to_first_name]").val(),last_name:$("input[name=to_last_name]").val(),email:$("input[name=to_email]").val(),position:$("input[name=to_position]").val(),url:$("#url").val(),page:{name:$("#page").select2("data")[0].text},smtp:{name:$("#profile").select2("data")[0].text}};btnHtml=$("#sendTestModalSubmit").html(),$("#sendTestModalSubmit").html(' Sending'),api.send_test_email(e).success(function(e){$("#sendTestEmailModal\\.flashes").empty().append('
    Email Sent!
    '),$("#sendTestModalSubmit").html(btnHtml)}).error(function(e){$("#sendTestEmailModal\\.flashes").empty().append('
    '+e.responseJSON.message+"
    "),$("#sendTestModalSubmit").html(btnHtml)})}function dismiss(){$("#modal\\.flashes").empty(),$("#name").val(""),$("#template").val("").change(),$("#page").val("").change(),$("#url").val(""),$("#profile").val("").change(),$("#users").val("").change(),$("#modal").modal("hide")}function deleteCampaign(e){swal({title:"Are you sure?",text:"This will delete the campaign. This can't be undone!",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Delete "+campaigns[e].name,confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,preConfirm:function(){return new Promise(function(a,t){api.campaignId.delete(campaigns[e].id).success(function(e){a()}).error(function(e){t(e.responseJSON.message)})})}}).then(function(){swal("Campaign Deleted!","This campaign has been deleted!","success"),$('button:contains("OK")').on("click",function(){location.reload()})})}function setupOptions(){api.groups.get().success(function(e){if(0==e.length)return modalError("No groups found!"),!1;var a=$.map(e,function(e){return e.text=e.name,e});$("#users.form-control").select2({placeholder:"Select Groups",data:a})}),api.templates.get().success(function(e){if(0==e.length)return modalError("No templates found!"),!1;var a=$.map(e,function(e){return e.text=e.name,e}),t=$("#template.form-control");t.select2({placeholder:"Select a Template",data:a}),1===e.length&&(t.val(a[0].id),t.trigger("change.select2"))}),api.pages.get().success(function(e){if(0==e.length)return modalError("No pages found!"),!1;var a=$.map(e,function(e){return e.text=e.name,e}),t=$("#page.form-control");t.select2({placeholder:"Select a Landing Page",data:a}),1===e.length&&(t.val(a[0].id),t.trigger("change.select2"))}),api.SMTP.get().success(function(e){if(0==e.length)return modalError("No profiles found!"),!1;var a=$.map(e,function(e){return e.text=e.name,e}),t=$("#profile.form-control");t.select2({placeholder:"Select a Sending Profile",data:a}).select2("val",a[0]),1===e.length&&(t.val(a[0].id),t.trigger("change.select2"))})}function edit(e){setupOptions()}function copy(e){setupOptions(),api.campaignId.get(campaigns[e].id).success(function(e){$("#name").val("Copy of "+e.name),e.template.id?($("#template").val(e.template.id.toString()),$("#template").trigger("change.select2")):$("#template").select2({placeholder:e.template.name}),e.page.id?($("#page").val(e.page.id.toString()),$("#page").trigger("change.select2")):$("#page").select2({placeholder:e.page.name}),e.smtp.id?($("#profile").val(e.smtp.id.toString()),$("#profile").trigger("change.select2")):$("#profile").select2({placeholder:e.smtp.name}),$("#url").val(e.url)}).error(function(e){$("#modal\\.flashes").empty().append('
    '+e.responseJSON.message+"
    ")})}$(document).ready(function(){$("#launch_date").datetimepicker({widgetPositioning:{vertical:"bottom"},showTodayButton:!0,defaultDate:moment(),format:"MMMM Do YYYY, h:mm a"}),$("#send_by_date").datetimepicker({widgetPositioning:{vertical:"bottom"},showTodayButton:!0,useCurrent:!1,format:"MMMM Do YYYY, h:mm a"}),$(".modal").on("hidden.bs.modal",function(e){$(this).removeClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")-1)}),$(".modal").on("shown.bs.modal",function(e){void 0===$("body").data("fv_open_modals")&&$("body").data("fv_open_modals",0),$(this).hasClass("fv-modal-stack")||($(this).addClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")+1),$(this).css("z-index",1040+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not(".fv-modal-stack").css("z-index",1039+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not("fv-modal-stack").addClass("fv-modal-stack"))}),$(document).on("hidden.bs.modal",".modal",function(){$(".modal:visible").length&&$(document.body).addClass("modal-open")}),$("#modal").on("hidden.bs.modal",function(e){dismiss()}),api.campaigns.summary().success(function(e){campaigns=e.campaigns,$("#loading").hide(),0
    Number of recipients: "+a.stats.total;else t="Launch Date: "+moment(a.launch_date).format("MMMM Do YYYY, h:mm:ss a")+"

    Number of recipients: "+a.stats.total+"

    Emails opened: "+a.stats.opened+"

    Emails clicked: "+a.stats.clicked+"

    Submitted Credentials: "+a.stats.submitted_data+"

    Errors : "+a.stats.error+"Reported : "+a.stats.reported;campaignTable.row.add([escapeHtml(a.name),moment(a.created_date).format("MMMM Do YYYY, h:mm:ss a"),''+a.status+"",""]).draw(),$('[data-toggle="tooltip"]').tooltip()})):$("#emptyMessage").show()}).error(function(){$("#loading").hide(),errorFlash("Error fetching campaigns")}),$.fn.select2.defaults.set("width","100%"),$.fn.select2.defaults.set("dropdownParent",$("#modal_body")),$.fn.select2.defaults.set("theme","bootstrap"),$.fn.select2.defaults.set("sorter",function(e){return e.sort(function(e,a){return e.text.toLowerCase()>a.text.toLowerCase()?1:e.text.toLowerCase()●'+this.point.name+": "+this.y+"%
    "}},series:[{data:e.data,colors:e.colors}]})}function generateStatsPieCharts(e){var t=[],a={},l=0;$.each(e,function(e,t){$.each(t.stats,function(e,t){if("total"==e)return l+=t,!0;a[e]?a[e]+=t:a[e]=t})}),$.each(a,function(e,a){if(!(e in statsMapping))return!0;status_label=statsMapping[e],t.push({name:status_label,y:Math.floor(a/l*100),count:a}),t.push({name:"",y:100-Math.floor(a/l*100)});renderPieChart({elemId:e+"_chart",title:status_label,name:e,data:t,colors:[statuses[status_label].color,"#dddddd"]});t=[]})}function generateTimelineChart(e){var t=[];$.each(e,function(e,a){var l=moment.utc(a.created_date).local();a.y=0,a.y+=a.stats.clicked,a.y=Math.floor(a.y/a.stats.total*100),t.push({campaign_id:a.id,name:a.name,x:l.valueOf(),y:a.y})}),Highcharts.chart("overview_chart",{chart:{zoomType:"x",type:"areaspline"},title:{text:"Phishing Success Overview"},xAxis:{type:"datetime",dateTimeLabelFormats:{second:"%l:%M:%S",minute:"%l:%M",hour:"%l:%M",day:"%b %d, %Y",week:"%b %d, %Y",month:"%b %Y"}},yAxis:{min:0,max:100,title:{text:"% of Success"}},tooltip:{formatter:function(){return Highcharts.dateFormat("%A, %b %d %l:%M:%S %P",new Date(this.x))+"
    "+this.point.name+"
    % Success: "+this.y+"%"}},legend:{enabled:!1},plotOptions:{series:{marker:{enabled:!0,symbol:"circle",radius:3},cursor:"pointer",point:{events:{click:function(e){window.location.href="/campaigns/"+this.campaign_id}}}}},credits:{enabled:!1},series:[{data:t,color:"#f05b4f",fillOpacity:.5}]})}var campaigns=[],statuses={"Email Sent":{color:"#1abc9c",label:"label-success",icon:"fa-envelope",point:"ct-point-sent"},"Emails Sent":{color:"#1abc9c",label:"label-success",icon:"fa-envelope",point:"ct-point-sent"},"In progress":{label:"label-primary"},Queued:{label:"label-info"},Completed:{label:"label-success"},"Email Opened":{color:"#f9bf3b",label:"label-warning",icon:"fa-envelope",point:"ct-point-opened"},"Email Reported":{color:"#45d6ef",label:"label-warning",icon:"fa-bullhorne",point:"ct-point-reported"},"Clicked Link":{color:"#F39C12",label:"label-clicked",icon:"fa-mouse-pointer",point:"ct-point-clicked"},Success:{color:"#f05b4f",label:"label-danger",icon:"fa-exclamation",point:"ct-point-clicked"},Error:{color:"#6c7a89",label:"label-default",icon:"fa-times",point:"ct-point-error"},"Error Sending Email":{color:"#6c7a89",label:"label-default",icon:"fa-times",point:"ct-point-error"},"Submitted Data":{color:"#f05b4f",label:"label-danger",icon:"fa-exclamation",point:"ct-point-clicked"},Unknown:{color:"#6c7a89",label:"label-default",icon:"fa-question",point:"ct-point-error"},Sending:{color:"#428bca",label:"label-primary",icon:"fa-spinner",point:"ct-point-sending"},"Campaign Created":{label:"label-success",icon:"fa-rocket"}},statsMapping={sent:"Email Sent",opened:"Email Opened",email_reported:"Email Reported",clicked:"Clicked Link",submitted_data:"Submitted Data"};$(document).ready(function(){Highcharts.setOptions({global:{useUTC:!1}}),api.campaigns.summary().success(function(e){$("#loading").hide(),campaigns=e.campaigns,campaigns.length>0?($("#dashboard").show(),campaignTable=$("#campaignTable").DataTable({columnDefs:[{orderable:!1,targets:"no-sort"},{className:"color-sent",targets:[2]},{className:"color-opened",targets:[3]},{className:"color-clicked",targets:[4]},{className:"color-success",targets:[5]},{className:"color-reported",targets:[6]}],order:[[1,"desc"]]}),$.each(campaigns,function(e,t){var a,l=moment(t.created_date).format("MMMM Do YYYY, h:mm:ss a"),i=statuses[t.status].label||"label-default";if(moment(t.launch_date).isAfter(moment())){a="Scheduled to start: "+moment(t.launch_date).format("MMMM Do YYYY, h:mm:ss a");var n=a+"

    Number of recipients: "+t.stats.total}else{a="Launch Date: "+moment(t.launch_date).format("MMMM Do YYYY, h:mm:ss a");var n=a+"

    Number of recipients: "+t.stats.total+"

    Emails opened: "+t.stats.opened+"

    Emails clicked: "+t.stats.clicked+"

    Submitted Credentials: "+t.stats.submitted_data+"

    Errors : "+t.stats.error+"

    Reported : "+t.stats.email_reported}campaignTable.row.add([escapeHtml(t.name),l,t.stats.sent,t.stats.opened,t.stats.clicked,t.stats.submitted_data,t.stats.email_reported,''+t.status+"",""]).draw(),$('[data-toggle="tooltip"]').tooltip()}),generateStatsPieCharts(campaigns),generateTimelineChart(campaigns)):$("#emptyMessage").show()}).error(function(){errorFlash("Error fetching campaigns")})}); \ No newline at end of file +var campaigns=[],statuses={"Email Sent":{color:"#1abc9c",label:"label-success",icon:"fa-envelope",point:"ct-point-sent"},"Emails Sent":{color:"#1abc9c",label:"label-success",icon:"fa-envelope",point:"ct-point-sent"},"In progress":{label:"label-primary"},Queued:{label:"label-info"},Completed:{label:"label-success"},"Email Opened":{color:"#f9bf3b",label:"label-warning",icon:"fa-envelope",point:"ct-point-opened"},"Email Reported":{color:"#45d6ef",label:"label-warning",icon:"fa-bullhorne",point:"ct-point-reported"},"Clicked Link":{color:"#F39C12",label:"label-clicked",icon:"fa-mouse-pointer",point:"ct-point-clicked"},Success:{color:"#f05b4f",label:"label-danger",icon:"fa-exclamation",point:"ct-point-clicked"},Error:{color:"#6c7a89",label:"label-default",icon:"fa-times",point:"ct-point-error"},"Error Sending Email":{color:"#6c7a89",label:"label-default",icon:"fa-times",point:"ct-point-error"},"Submitted Data":{color:"#f05b4f",label:"label-danger",icon:"fa-exclamation",point:"ct-point-clicked"},Unknown:{color:"#6c7a89",label:"label-default",icon:"fa-question",point:"ct-point-error"},Sending:{color:"#428bca",label:"label-primary",icon:"fa-spinner",point:"ct-point-sending"},"Campaign Created":{label:"label-success",icon:"fa-rocket"}},statsMapping={sent:"Email Sent",opened:"Email Opened",email_reported:"Email Reported",clicked:"Clicked Link",submitted_data:"Submitted Data"};function deleteCampaign(e){confirm("Delete "+campaigns[e].name+"?")&&api.campaignId.delete(campaigns[e].id).success(function(e){successFlash(e.message),location.reload()})}function renderPieChart(i){return Highcharts.chart(i.elemId,{chart:{type:"pie",events:{load:function(){var e=this,t=e.renderer,a=e.series[0],l=e.plotLeft+a.center[0],n=e.plotTop+a.center[1];this.innerText=t.text(i.data[0].count,l,n).attr({"text-anchor":"middle","font-size":"16px","font-weight":"bold",fill:i.colors[0],"font-family":"Helvetica,Arial,sans-serif"}).add()},render:function(){this.innerText.attr({text:i.data[0].count})}}},title:{text:i.title},plotOptions:{pie:{innerSize:"80%",dataLabels:{enabled:!1}}},credits:{enabled:!1},tooltip:{formatter:function(){return null!=this.key&&''+this.point.name+": "+this.y+"%
    "}},series:[{data:i.data,colors:i.colors}]})}function generateStatsPieCharts(e){var a=[],l={},n=0;$.each(e,function(e,t){$.each(t.stats,function(e,t){if("total"==e)return n+=t,!0;l[e]?l[e]+=t:l[e]=t})}),$.each(l,function(e,t){if(!(e in statsMapping))return!0;status_label=statsMapping[e],a.push({name:status_label,y:Math.floor(t/n*100),count:t}),a.push({name:"",y:100-Math.floor(t/n*100)});renderPieChart({elemId:e+"_chart",title:status_label,name:e,data:a,colors:[statuses[status_label].color,"#dddddd"]});a=[]})}function generateTimelineChart(e){var l=[];$.each(e,function(e,t){var a=moment.utc(t.created_date).local();t.y=0,t.y+=t.stats.clicked,t.y=Math.floor(t.y/t.stats.total*100),l.push({campaign_id:t.id,name:t.name,x:a.valueOf(),y:t.y})}),Highcharts.chart("overview_chart",{chart:{zoomType:"x",type:"areaspline"},title:{text:"Phishing Success Overview"},xAxis:{type:"datetime",dateTimeLabelFormats:{second:"%l:%M:%S",minute:"%l:%M",hour:"%l:%M",day:"%b %d, %Y",week:"%b %d, %Y",month:"%b %Y"}},yAxis:{min:0,max:100,title:{text:"% of Success"}},tooltip:{formatter:function(){return Highcharts.dateFormat("%A, %b %d %l:%M:%S %P",new Date(this.x))+"
    "+this.point.name+"
    % Success: "+this.y+"%"}},legend:{enabled:!1},plotOptions:{series:{marker:{enabled:!0,symbol:"circle",radius:3},cursor:"pointer",point:{events:{click:function(e){window.location.href="/campaigns/"+this.campaign_id}}}}},credits:{enabled:!1},series:[{data:l,color:"#f05b4f",fillOpacity:.5}]})}$(document).ready(function(){Highcharts.setOptions({global:{useUTC:!1}}),api.campaigns.summary().success(function(e){$("#loading").hide(),0<(campaigns=e.campaigns).length?($("#dashboard").show(),campaignTable=$("#campaignTable").DataTable({columnDefs:[{orderable:!1,targets:"no-sort"},{className:"color-sent",targets:[2]},{className:"color-opened",targets:[3]},{className:"color-clicked",targets:[4]},{className:"color-success",targets:[5]},{className:"color-reported",targets:[6]}],order:[[1,"desc"]]}),$.each(campaigns,function(e,t){var a=moment(t.created_date).format("MMMM Do YYYY, h:mm:ss a"),l=statuses[t.status].label||"label-default";if(moment(t.launch_date).isAfter(moment()))var n="Scheduled to start: "+moment(t.launch_date).format("MMMM Do YYYY, h:mm:ss a")+"

    Number of recipients: "+t.stats.total;else n="Launch Date: "+moment(t.launch_date).format("MMMM Do YYYY, h:mm:ss a")+"

    Number of recipients: "+t.stats.total+"

    Emails opened: "+t.stats.opened+"

    Emails clicked: "+t.stats.clicked+"

    Submitted Credentials: "+t.stats.submitted_data+"

    Errors : "+t.stats.error+"

    Reported : "+t.stats.email_reported;campaignTable.row.add([escapeHtml(t.name),a,t.stats.sent,t.stats.opened,t.stats.clicked,t.stats.submitted_data,t.stats.email_reported,''+t.status+"",""]).draw(),$('[data-toggle="tooltip"]').tooltip()}),generateStatsPieCharts(campaigns),generateTimelineChart(campaigns)):$("#emptyMessage").show()}).error(function(){errorFlash("Error fetching campaigns")})}); \ No newline at end of file diff --git a/static/js/dist/app/gophish.min.js b/static/js/dist/app/gophish.min.js index 526ae20d..2decaa38 100644 --- a/static/js/dist/app/gophish.min.js +++ b/static/js/dist/app/gophish.min.js @@ -1 +1 @@ -function errorFlash(e){$("#flashes").empty(),$("#flashes").append('
    '+e+"
    ")}function successFlash(e){$("#flashes").empty(),$("#flashes").append('
    '+e+"
    ")}function modalError(e){$("#modal\\.flashes").empty().append('
    '+e+"
    ")}function query(e,t,n,r){return $.ajax({url:"/api"+e,async:r,method:t,data:JSON.stringify(n),dataType:"json",contentType:"application/json",beforeSend:function(e){e.setRequestHeader("Authorization","Bearer "+user.api_key)}})}function escapeHtml(e){return $("
    ").text(e).html()}function unescapeHtml(e){return $("
    ").html(e).text()}var capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},api={campaigns:{get:function(){return query("/campaigns/","GET",{},!1)},post:function(e){return query("/campaigns/","POST",e,!1)},summary:function(){return query("/campaigns/summary","GET",{},!1)}},campaignId:{get:function(e){return query("/campaigns/"+e,"GET",{},!0)},delete:function(e){return query("/campaigns/"+e,"DELETE",{},!1)},results:function(e){return query("/campaigns/"+e+"/results","GET",{},!0)},complete:function(e){return query("/campaigns/"+e+"/complete","GET",{},!0)},summary:function(e){return query("/campaigns/"+e+"/summary","GET",{},!0)}},groups:{get:function(){return query("/groups/","GET",{},!1)},post:function(e){return query("/groups/","POST",e,!1)},summary:function(){return query("/groups/summary","GET",{},!0)}},groupId:{get:function(e){return query("/groups/"+e,"GET",{},!1)},put:function(e){return query("/groups/"+e.id,"PUT",e,!1)},delete:function(e){return query("/groups/"+e,"DELETE",{},!1)}},templates:{get:function(){return query("/templates/","GET",{},!1)},post:function(e){return query("/templates/","POST",e,!1)}},templateId:{get:function(e){return query("/templates/"+e,"GET",{},!1)},put:function(e){return query("/templates/"+e.id,"PUT",e,!1)},delete:function(e){return query("/templates/"+e,"DELETE",{},!1)}},pages:{get:function(){return query("/pages/","GET",{},!1)},post:function(e){return query("/pages/","POST",e,!1)}},pageId:{get:function(e){return query("/pages/"+e,"GET",{},!1)},put:function(e){return query("/pages/"+e.id,"PUT",e,!1)},delete:function(e){return query("/pages/"+e,"DELETE",{},!1)}},SMTP:{get:function(){return query("/smtp/","GET",{},!1)},post:function(e){return query("/smtp/","POST",e,!1)}},SMTPId:{get:function(e){return query("/smtp/"+e,"GET",{},!1)},put:function(e){return query("/smtp/"+e.id,"PUT",e,!1)},delete:function(e){return query("/smtp/"+e,"DELETE",{},!1)}},import_email:function(e){return query("/import/email","POST",e,!1)},clone_site:function(e){return query("/import/site","POST",e,!1)},send_test_email:function(e){return query("/util/send_test_email","POST",e,!0)},reset:function(){return query("/reset","POST",{},!0)}};$(document).ready(function(){var e=location.pathname;$(".nav-sidebar li").each(function(){var t=$(this);t.find("a").attr("href")===e&&t.addClass("active")}),$.fn.dataTable.moment("MMMM Do YYYY, h:mm:ss a"),$('[data-toggle="tooltip"]').tooltip()}); \ No newline at end of file +function errorFlash(e){$("#flashes").empty(),$("#flashes").append('
    '+e+"
    ")}function successFlash(e){$("#flashes").empty(),$("#flashes").append('
    '+e+"
    ")}function modalError(e){$("#modal\\.flashes").empty().append('
    '+e+"
    ")}function query(e,t,n,r){return $.ajax({url:"/api"+e,async:r,method:t,data:JSON.stringify(n),dataType:"json",contentType:"application/json",beforeSend:function(e){e.setRequestHeader("Authorization","Bearer "+user.api_key)}})}function escapeHtml(e){return $("
    ").text(e).html()}function unescapeHtml(e){return $("
    ").html(e).text()}var capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},api={campaigns:{get:function(){return query("/campaigns/","GET",{},!1)},post:function(e){return query("/campaigns/","POST",e,!1)},summary:function(){return query("/campaigns/summary","GET",{},!1)}},campaignId:{get:function(e){return query("/campaigns/"+e,"GET",{},!0)},delete:function(e){return query("/campaigns/"+e,"DELETE",{},!1)},results:function(e){return query("/campaigns/"+e+"/results","GET",{},!0)},complete:function(e){return query("/campaigns/"+e+"/complete","GET",{},!0)},summary:function(e){return query("/campaigns/"+e+"/summary","GET",{},!0)}},groups:{get:function(){return query("/groups/","GET",{},!1)},post:function(e){return query("/groups/","POST",e,!1)},summary:function(){return query("/groups/summary","GET",{},!0)}},groupId:{get:function(e){return query("/groups/"+e,"GET",{},!1)},put:function(e){return query("/groups/"+e.id,"PUT",e,!1)},delete:function(e){return query("/groups/"+e,"DELETE",{},!1)}},templates:{get:function(){return query("/templates/","GET",{},!1)},post:function(e){return query("/templates/","POST",e,!1)}},templateId:{get:function(e){return query("/templates/"+e,"GET",{},!1)},put:function(e){return query("/templates/"+e.id,"PUT",e,!1)},delete:function(e){return query("/templates/"+e,"DELETE",{},!1)}},pages:{get:function(){return query("/pages/","GET",{},!1)},post:function(e){return query("/pages/","POST",e,!1)}},pageId:{get:function(e){return query("/pages/"+e,"GET",{},!1)},put:function(e){return query("/pages/"+e.id,"PUT",e,!1)},delete:function(e){return query("/pages/"+e,"DELETE",{},!1)}},SMTP:{get:function(){return query("/smtp/","GET",{},!1)},post:function(e){return query("/smtp/","POST",e,!1)}},SMTPId:{get:function(e){return query("/smtp/"+e,"GET",{},!1)},put:function(e){return query("/smtp/"+e.id,"PUT",e,!1)},delete:function(e){return query("/smtp/"+e,"DELETE",{},!1)}},import_email:function(e){return query("/import/email","POST",e,!1)},clone_site:function(e){return query("/import/site","POST",e,!1)},send_test_email:function(e){return query("/util/send_test_email","POST",e,!0)},reset:function(){return query("/reset","POST",{},!0)}};$(document).ready(function(){var t=location.pathname;$(".nav-sidebar li").each(function(){var e=$(this);e.find("a").attr("href")===t&&e.addClass("active")}),$.fn.dataTable.moment("MMMM Do YYYY, h:mm:ss a"),$('[data-toggle="tooltip"]').tooltip()}); \ No newline at end of file diff --git a/static/js/dist/app/landing_pages.min.js b/static/js/dist/app/landing_pages.min.js index 477a8f6f..23226a32 100644 --- a/static/js/dist/app/landing_pages.min.js +++ b/static/js/dist/app/landing_pages.min.js @@ -1 +1 @@ -function save(e){var a={};a.name=$("#name").val(),editor=CKEDITOR.instances.html_editor,a.html=editor.getData(),a.capture_credentials=$("#capture_credentials_checkbox").prop("checked"),a.capture_passwords=$("#capture_passwords_checkbox").prop("checked"),a.redirect_url=$("#redirect_url_input").val(),-1!=e?(a.id=pages[e].id,api.pageId.put(a).success(function(e){successFlash("Page edited successfully!"),load(),dismiss()})):api.pages.post(a).success(function(e){successFlash("Page added successfully!"),load(),dismiss()}).error(function(e){modalError(e.responseJSON.message)})}function dismiss(){$("#modal\\.flashes").empty(),$("#name").val(""),$("#html_editor").val(""),$("#url").val(""),$("#redirect_url_input").val(""),$("#modal").find("input[type='checkbox']").prop("checked",!1),$("#capture_passwords").hide(),$("#redirect_url").hide(),$("#modal").modal("hide")}function importSite(){url=$("#url").val(),url?api.clone_site({url:url,include_resources:!1}).success(function(e){$("#html_editor").val(e.html),CKEDITOR.instances.html_editor.setMode("wysiwyg"),$("#importSiteModal").modal("hide")}).error(function(e){modalError(e.responseJSON.message)}):modalError("No URL Specified!")}function edit(e){$("#modalSubmit").unbind("click").click(function(){save(e)}),$("#html_editor").ckeditor(),setupAutocomplete(CKEDITOR.instances.html_editor);var a={};-1!=e&&(a=pages[e],$("#name").val(a.name),$("#html_editor").val(a.html),$("#capture_credentials_checkbox").prop("checked",a.capture_credentials),$("#capture_passwords_checkbox").prop("checked",a.capture_passwords),$("#redirect_url_input").val(a.redirect_url),a.capture_credentials&&($("#capture_passwords").show(),$("#redirect_url").show()))}function copy(e){$("#modalSubmit").unbind("click").click(function(){save(-1)}),$("#html_editor").ckeditor();var a=pages[e];$("#name").val("Copy of "+a.name),$("#html_editor").val(a.html)}function load(){$("#pagesTable").hide(),$("#emptyMessage").hide(),$("#loading").show(),api.pages.get().success(function(e){pages=e,$("#loading").hide(),pages.length>0?($("#pagesTable").show(),pagesTable=$("#pagesTable").DataTable({destroy:!0,columnDefs:[{orderable:!1,targets:"no-sort"}]}),pagesTable.clear(),$.each(pages,function(e,a){pagesTable.row.add([escapeHtml(a.name),moment(a.modified_date).format("MMMM Do YYYY, h:mm:ss a"),"
    \t\t
    "]).draw()}),$('[data-toggle="tooltip"]').tooltip()):$("#emptyMessage").show()}).error(function(){$("#loading").hide(),errorFlash("Error fetching pages")})}var pages=[],deletePage=function(e){swal({title:"Are you sure?",text:"This will delete the landing page. This can't be undone!",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Delete "+escapeHtml(pages[e].name),confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,preConfirm:function(){return new Promise(function(a,t){api.pageId.delete(pages[e].id).success(function(e){a()}).error(function(e){t(e.responseJSON.message)})})}}).then(function(){swal("Landing Page Deleted!","This landing page has been deleted!","success"),$('button:contains("OK")').on("click",function(){location.reload()})})};$(document).ready(function(){$(".modal").on("hidden.bs.modal",function(e){$(this).removeClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")-1)}),$(".modal").on("shown.bs.modal",function(e){void 0===$("body").data("fv_open_modals")&&$("body").data("fv_open_modals",0),$(this).hasClass("fv-modal-stack")||($(this).addClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")+1),$(this).css("z-index",1040+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not(".fv-modal-stack").css("z-index",1039+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not("fv-modal-stack").addClass("fv-modal-stack"))}),$.fn.modal.Constructor.prototype.enforceFocus=function(){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy(function(e){this.$element[0]===e.target||this.$element.has(e.target).length||$(e.target).closest(".cke_dialog, .cke").length||this.$element.trigger("focus")},this))},$(document).on("hidden.bs.modal",".modal",function(){$(".modal:visible").length&&$(document.body).addClass("modal-open")}),$("#modal").on("hidden.bs.modal",function(e){dismiss()}),$("#capture_credentials_checkbox").change(function(){$("#capture_passwords").toggle(),$("#redirect_url").toggle()}),CKEDITOR.on("dialogDefinition",function(e){var a=e.data.name,t=e.data.definition;if("link"==a){t.minWidth=500,t.minHeight=100;t.getContents("info").get("linkType").hidden=!0}}),load()}); \ No newline at end of file +var pages=[];function save(e){var a={};a.name=$("#name").val(),editor=CKEDITOR.instances.html_editor,a.html=editor.getData(),a.capture_credentials=$("#capture_credentials_checkbox").prop("checked"),a.capture_passwords=$("#capture_passwords_checkbox").prop("checked"),a.redirect_url=$("#redirect_url_input").val(),-1!=e?(a.id=pages[e].id,api.pageId.put(a).success(function(e){successFlash("Page edited successfully!"),load(),dismiss()})):api.pages.post(a).success(function(e){successFlash("Page added successfully!"),load(),dismiss()}).error(function(e){modalError(e.responseJSON.message)})}function dismiss(){$("#modal\\.flashes").empty(),$("#name").val(""),$("#html_editor").val(""),$("#url").val(""),$("#redirect_url_input").val(""),$("#modal").find("input[type='checkbox']").prop("checked",!1),$("#capture_passwords").hide(),$("#redirect_url").hide(),$("#modal").modal("hide")}var deletePage=function(e){swal({title:"Are you sure?",text:"This will delete the landing page. This can't be undone!",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Delete "+escapeHtml(pages[e].name),confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,preConfirm:function(){return new Promise(function(a,t){api.pageId.delete(pages[e].id).success(function(e){a()}).error(function(e){t(e.responseJSON.message)})})}}).then(function(){swal("Landing Page Deleted!","This landing page has been deleted!","success"),$('button:contains("OK")').on("click",function(){location.reload()})})};function importSite(){url=$("#url").val(),url?api.clone_site({url:url,include_resources:!1}).success(function(e){$("#html_editor").val(e.html),CKEDITOR.instances.html_editor.setMode("wysiwyg"),$("#importSiteModal").modal("hide")}).error(function(e){modalError(e.responseJSON.message)}):modalError("No URL Specified!")}function edit(e){$("#modalSubmit").unbind("click").click(function(){save(e)}),$("#html_editor").ckeditor(),setupAutocomplete(CKEDITOR.instances.html_editor);var a={};-1!=e&&(a=pages[e],$("#name").val(a.name),$("#html_editor").val(a.html),$("#capture_credentials_checkbox").prop("checked",a.capture_credentials),$("#capture_passwords_checkbox").prop("checked",a.capture_passwords),$("#redirect_url_input").val(a.redirect_url),a.capture_credentials&&($("#capture_passwords").show(),$("#redirect_url").show()))}function copy(e){$("#modalSubmit").unbind("click").click(function(){save(-1)}),$("#html_editor").ckeditor();var a=pages[e];$("#name").val("Copy of "+a.name),$("#html_editor").val(a.html)}function load(){$("#pagesTable").hide(),$("#emptyMessage").hide(),$("#loading").show(),api.pages.get().success(function(e){pages=e,$("#loading").hide(),0\t\t
    "]).draw()}),$('[data-toggle="tooltip"]').tooltip()):$("#emptyMessage").show()}).error(function(){$("#loading").hide(),errorFlash("Error fetching pages")})}$(document).ready(function(){$(".modal").on("hidden.bs.modal",function(e){$(this).removeClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")-1)}),$(".modal").on("shown.bs.modal",function(e){void 0===$("body").data("fv_open_modals")&&$("body").data("fv_open_modals",0),$(this).hasClass("fv-modal-stack")||($(this).addClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")+1),$(this).css("z-index",1040+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not(".fv-modal-stack").css("z-index",1039+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not("fv-modal-stack").addClass("fv-modal-stack"))}),$.fn.modal.Constructor.prototype.enforceFocus=function(){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy(function(e){this.$element[0]===e.target||this.$element.has(e.target).length||$(e.target).closest(".cke_dialog, .cke").length||this.$element.trigger("focus")},this))},$(document).on("hidden.bs.modal",".modal",function(){$(".modal:visible").length&&$(document.body).addClass("modal-open")}),$("#modal").on("hidden.bs.modal",function(e){dismiss()}),$("#capture_credentials_checkbox").change(function(){$("#capture_passwords").toggle(),$("#redirect_url").toggle()}),CKEDITOR.on("dialogDefinition",function(e){var a=e.data.name,t=e.data.definition;"link"==a&&(t.minWidth=500,t.minHeight=100,t.getContents("info").get("linkType").hidden=!0)}),load()}); \ No newline at end of file diff --git a/static/js/dist/app/sending_profiles.min.js b/static/js/dist/app/sending_profiles.min.js index da9e0936..85f9dd7b 100644 --- a/static/js/dist/app/sending_profiles.min.js +++ b/static/js/dist/app/sending_profiles.min.js @@ -1 +1 @@ -function sendTestEmail(){var e=[];$.each($("#headersTable").DataTable().rows().data(),function(a,t){e.push({key:unescapeHtml(t[0]),value:unescapeHtml(t[1])})});var a={template:{},first_name:$("input[name=to_first_name]").val(),last_name:$("input[name=to_last_name]").val(),email:$("input[name=to_email]").val(),position:$("input[name=to_position]").val(),url:"",smtp:{from_address:$("#from").val(),host:$("#host").val(),username:$("#username").val(),password:$("#password").val(),ignore_cert_errors:$("#ignore_cert_errors").prop("checked"),headers:e}};btnHtml=$("#sendTestModalSubmit").html(),$("#sendTestModalSubmit").html(' Sending'),api.send_test_email(a).success(function(e){$("#sendTestEmailModal\\.flashes").empty().append('
    \t Email Sent!
    '),$("#sendTestModalSubmit").html(btnHtml)}).error(function(e){$("#sendTestEmailModal\\.flashes").empty().append('
    \t '+e.responseJSON.message+"
    "),$("#sendTestModalSubmit").html(btnHtml)})}function save(e){var a={headers:[]};$.each($("#headersTable").DataTable().rows().data(),function(e,t){a.headers.push({key:unescapeHtml(t[0]),value:unescapeHtml(t[1])})}),a.name=$("#name").val(),a.interface_type=$("#interface_type").val(),a.from_address=$("#from").val(),a.host=$("#host").val(),a.username=$("#username").val(),a.password=$("#password").val(),a.ignore_cert_errors=$("#ignore_cert_errors").prop("checked"),-1!=e?(a.id=profiles[e].id,api.SMTPId.put(a).success(function(e){successFlash("Profile edited successfully!"),load(),dismiss()}).error(function(e){modalError(e.responseJSON.message)})):api.SMTP.post(a).success(function(e){successFlash("Profile added successfully!"),load(),dismiss()}).error(function(e){modalError(e.responseJSON.message)})}function dismiss(){$("#modal\\.flashes").empty(),$("#name").val(""),$("#interface_type").val("SMTP"),$("#from").val(""),$("#host").val(""),$("#username").val(""),$("#password").val(""),$("#ignore_cert_errors").prop("checked",!0),$("#headersTable").dataTable().DataTable().clear().draw(),$("#modal").modal("hide")}function edit(e){headers=$("#headersTable").dataTable({destroy:!0,columnDefs:[{orderable:!1,targets:"no-sort"}]}),$("#modalSubmit").unbind("click").click(function(){save(e)});var a={};-1!=e&&(a=profiles[e],$("#name").val(a.name),$("#interface_type").val(a.interface_type),$("#from").val(a.from_address),$("#host").val(a.host),$("#username").val(a.username),$("#password").val(a.password),$("#ignore_cert_errors").prop("checked",a.ignore_cert_errors),$.each(a.headers,function(e,a){addCustomHeader(a.key,a.value)}))}function copy(e){$("#modalSubmit").unbind("click").click(function(){save(-1)});var a={};a=profiles[e],$("#name").val("Copy of "+a.name),$("#interface_type").val(a.interface_type),$("#from").val(a.from_address),$("#host").val(a.host),$("#username").val(a.username),$("#password").val(a.password),$("#ignore_cert_errors").prop("checked",a.ignore_cert_errors)}function load(){$("#profileTable").hide(),$("#emptyMessage").hide(),$("#loading").show(),api.SMTP.get().success(function(e){profiles=e,$("#loading").hide(),profiles.length>0?($("#profileTable").show(),profileTable=$("#profileTable").DataTable({destroy:!0,columnDefs:[{orderable:!1,targets:"no-sort"}]}),profileTable.clear(),$.each(profiles,function(e,a){profileTable.row.add([escapeHtml(a.name),a.interface_type,moment(a.modified_date).format("MMMM Do YYYY, h:mm:ss a"),"
    \t\t
    "]).draw()}),$('[data-toggle="tooltip"]').tooltip()):$("#emptyMessage").show()}).error(function(){$("#loading").hide(),errorFlash("Error fetching profiles")})}function addCustomHeader(e,a){var t=[escapeHtml(e),escapeHtml(a),''],s=headers.DataTable(),o=s.column(0).data().indexOf(escapeHtml(e));o>=0?s.row(o,{order:"index"}).data(t):s.row.add(t),s.draw()}var profiles=[],dismissSendTestEmailModal=function(){$("#sendTestEmailModal\\.flashes").empty(),$("#sendTestModalSubmit").html(" Send")},deleteProfile=function(e){swal({title:"Are you sure?",text:"This will delete the sending profile. This can't be undone!",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Delete "+escapeHtml(profiles[e].name),confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,preConfirm:function(){return new Promise(function(a,t){api.SMTPId.delete(profiles[e].id).success(function(e){a()}).error(function(e){t(e.responseJSON.message)})})}}).then(function(){swal("Sending Profile Deleted!","This sending profile has been deleted!","success"),$('button:contains("OK")').on("click",function(){location.reload()})})};$(document).ready(function(){$(".modal").on("hidden.bs.modal",function(e){$(this).removeClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")-1)}),$(".modal").on("shown.bs.modal",function(e){void 0===$("body").data("fv_open_modals")&&$("body").data("fv_open_modals",0),$(this).hasClass("fv-modal-stack")||($(this).addClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")+1),$(this).css("z-index",1040+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not(".fv-modal-stack").css("z-index",1039+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not("fv-modal-stack").addClass("fv-modal-stack"))}),$.fn.modal.Constructor.prototype.enforceFocus=function(){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy(function(e){this.$element[0]===e.target||this.$element.has(e.target).length||$(e.target).closest(".cke_dialog, .cke").length||this.$element.trigger("focus")},this))},$(document).on("hidden.bs.modal",".modal",function(){$(".modal:visible").length&&$(document.body).addClass("modal-open")}),$("#modal").on("hidden.bs.modal",function(e){dismiss()}),$("#sendTestEmailModal").on("hidden.bs.modal",function(e){dismissSendTestEmailModal()}),$("#headersForm").on("submit",function(){return headerKey=$("#headerKey").val(),headerValue=$("#headerValue").val(),""!=headerKey&&""!=headerValue&&(addCustomHeader(headerKey,headerValue),$("#headersForm>div>input").val(""),$("#headerKey").focus(),!1)}),$("#headersTable").on("click","span>i.fa-trash-o",function(){headers.DataTable().row($(this).parents("tr")).remove().draw()}),load()}); \ No newline at end of file +var profiles=[];function sendTestEmail(){var t=[];$.each($("#headersTable").DataTable().rows().data(),function(e,a){t.push({key:unescapeHtml(a[0]),value:unescapeHtml(a[1])})});var e={template:{},first_name:$("input[name=to_first_name]").val(),last_name:$("input[name=to_last_name]").val(),email:$("input[name=to_email]").val(),position:$("input[name=to_position]").val(),url:"",smtp:{from_address:$("#from").val(),host:$("#host").val(),username:$("#username").val(),password:$("#password").val(),ignore_cert_errors:$("#ignore_cert_errors").prop("checked"),headers:t}};btnHtml=$("#sendTestModalSubmit").html(),$("#sendTestModalSubmit").html(' Sending'),api.send_test_email(e).success(function(e){$("#sendTestEmailModal\\.flashes").empty().append('
    \t Email Sent!
    '),$("#sendTestModalSubmit").html(btnHtml)}).error(function(e){$("#sendTestEmailModal\\.flashes").empty().append('
    \t '+e.responseJSON.message+"
    "),$("#sendTestModalSubmit").html(btnHtml)})}function save(e){var t={headers:[]};$.each($("#headersTable").DataTable().rows().data(),function(e,a){t.headers.push({key:unescapeHtml(a[0]),value:unescapeHtml(a[1])})}),t.name=$("#name").val(),t.interface_type=$("#interface_type").val(),t.from_address=$("#from").val(),t.host=$("#host").val(),t.username=$("#username").val(),t.password=$("#password").val(),t.ignore_cert_errors=$("#ignore_cert_errors").prop("checked"),-1!=e?(t.id=profiles[e].id,api.SMTPId.put(t).success(function(e){successFlash("Profile edited successfully!"),load(),dismiss()}).error(function(e){modalError(e.responseJSON.message)})):api.SMTP.post(t).success(function(e){successFlash("Profile added successfully!"),load(),dismiss()}).error(function(e){modalError(e.responseJSON.message)})}function dismiss(){$("#modal\\.flashes").empty(),$("#name").val(""),$("#interface_type").val("SMTP"),$("#from").val(""),$("#host").val(""),$("#username").val(""),$("#password").val(""),$("#ignore_cert_errors").prop("checked",!0),$("#headersTable").dataTable().DataTable().clear().draw(),$("#modal").modal("hide")}var dismissSendTestEmailModal=function(){$("#sendTestEmailModal\\.flashes").empty(),$("#sendTestModalSubmit").html(" Send")},deleteProfile=function(e){swal({title:"Are you sure?",text:"This will delete the sending profile. This can't be undone!",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Delete "+escapeHtml(profiles[e].name),confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,preConfirm:function(){return new Promise(function(a,t){api.SMTPId.delete(profiles[e].id).success(function(e){a()}).error(function(e){t(e.responseJSON.message)})})}}).then(function(){swal("Sending Profile Deleted!","This sending profile has been deleted!","success"),$('button:contains("OK")').on("click",function(){location.reload()})})};function edit(e){headers=$("#headersTable").dataTable({destroy:!0,columnDefs:[{orderable:!1,targets:"no-sort"}]}),$("#modalSubmit").unbind("click").click(function(){save(e)});var a={};-1!=e&&(a=profiles[e],$("#name").val(a.name),$("#interface_type").val(a.interface_type),$("#from").val(a.from_address),$("#host").val(a.host),$("#username").val(a.username),$("#password").val(a.password),$("#ignore_cert_errors").prop("checked",a.ignore_cert_errors),$.each(a.headers,function(e,a){addCustomHeader(a.key,a.value)}))}function copy(e){$("#modalSubmit").unbind("click").click(function(){save(-1)});var a;a=profiles[e],$("#name").val("Copy of "+a.name),$("#interface_type").val(a.interface_type),$("#from").val(a.from_address),$("#host").val(a.host),$("#username").val(a.username),$("#password").val(a.password),$("#ignore_cert_errors").prop("checked",a.ignore_cert_errors)}function load(){$("#profileTable").hide(),$("#emptyMessage").hide(),$("#loading").show(),api.SMTP.get().success(function(e){profiles=e,$("#loading").hide(),0\t\t
    "]).draw()}),$('[data-toggle="tooltip"]').tooltip()):$("#emptyMessage").show()}).error(function(){$("#loading").hide(),errorFlash("Error fetching profiles")})}function addCustomHeader(e,a){var t=[escapeHtml(e),escapeHtml(a),''],s=headers.DataTable(),o=s.column(0).data().indexOf(escapeHtml(e));0<=o?s.row(o,{order:"index"}).data(t):s.row.add(t),s.draw()}$(document).ready(function(){$(".modal").on("hidden.bs.modal",function(e){$(this).removeClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")-1)}),$(".modal").on("shown.bs.modal",function(e){void 0===$("body").data("fv_open_modals")&&$("body").data("fv_open_modals",0),$(this).hasClass("fv-modal-stack")||($(this).addClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")+1),$(this).css("z-index",1040+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not(".fv-modal-stack").css("z-index",1039+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not("fv-modal-stack").addClass("fv-modal-stack"))}),$.fn.modal.Constructor.prototype.enforceFocus=function(){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy(function(e){this.$element[0]===e.target||this.$element.has(e.target).length||$(e.target).closest(".cke_dialog, .cke").length||this.$element.trigger("focus")},this))},$(document).on("hidden.bs.modal",".modal",function(){$(".modal:visible").length&&$(document.body).addClass("modal-open")}),$("#modal").on("hidden.bs.modal",function(e){dismiss()}),$("#sendTestEmailModal").on("hidden.bs.modal",function(e){dismissSendTestEmailModal()}),$("#headersForm").on("submit",function(){return headerKey=$("#headerKey").val(),headerValue=$("#headerValue").val(),""==headerKey||""==headerValue||(addCustomHeader(headerKey,headerValue),$("#headersForm>div>input").val(""),$("#headerKey").focus()),!1}),$("#headersTable").on("click","span>i.fa-trash-o",function(){headers.DataTable().row($(this).parents("tr")).remove().draw()}),load()}); \ No newline at end of file diff --git a/static/js/dist/app/templates.min.js b/static/js/dist/app/templates.min.js index 643f36b6..36f58287 100644 --- a/static/js/dist/app/templates.min.js +++ b/static/js/dist/app/templates.min.js @@ -1 +1 @@ -function save(t){var e={attachments:[]};e.name=$("#name").val(),e.subject=$("#subject").val(),e.html=CKEDITOR.instances.html_editor.getData(),e.html=e.html.replace(/https?:\/\/{{\.URL}}/gi,"{{.URL}}"),$("#use_tracker_checkbox").prop("checked")?-1==e.html.indexOf("{{.Tracker}}")&&-1==e.html.indexOf("{{.TrackingUrl}}")&&(e.html=e.html.replace("","{{.Tracker}}")):e.html=e.html.replace("{{.Tracker}}",""),e.text=$("#text_editor").val(),$.each($("#attachmentsTable").DataTable().rows().data(),function(t,a){e.attachments.push({name:unescapeHtml(a[1]),content:a[3],type:a[4]})}),-1!=t?(e.id=templates[t].id,api.templateId.put(e).success(function(t){successFlash("Template edited successfully!"),load(),dismiss()}).error(function(t){modalError(t.responseJSON.message)})):api.templates.post(e).success(function(t){successFlash("Template added successfully!"),load(),dismiss()}).error(function(t){modalError(t.responseJSON.message)})}function dismiss(){$("#modal\\.flashes").empty(),$("#attachmentsTable").dataTable().DataTable().clear().draw(),$("#name").val(""),$("#subject").val(""),$("#text_editor").val(""),$("#html_editor").val(""),$("#modal").modal("hide")}function deleteTemplate(t){confirm("Delete "+templates[t].name+"?")&&api.templateId.delete(templates[t].id).success(function(t){successFlash(t.message),load()})}function attach(t){attachmentsTable=$("#attachmentsTable").DataTable({destroy:!0,order:[[1,"asc"]],columnDefs:[{orderable:!1,targets:"no-sort"},{sClass:"datatable_hidden",targets:[3,4]}]}),$.each(t,function(t,e){var a=new FileReader;a.onload=function(t){var o=icons[e.type]||"fa-file-o";attachmentsTable.row.add(['',escapeHtml(e.name),'',a.result.split(",")[1],e.type||"application/octet-stream"]).draw()},a.onerror=function(t){console.log(t)},a.readAsDataURL(e)})}function edit(t){$("#modalSubmit").unbind("click").click(function(){save(t)}),$("#attachmentUpload").unbind("click").click(function(){this.value=null}),$("#html_editor").ckeditor(),setupAutocomplete(CKEDITOR.instances.html_editor),$("#attachmentsTable").show(),attachmentsTable=$("#attachmentsTable").DataTable({destroy:!0,order:[[1,"asc"]],columnDefs:[{orderable:!1,targets:"no-sort"},{sClass:"datatable_hidden",targets:[3,4]}]});var e={attachments:[]};-1!=t&&(e=templates[t],$("#name").val(e.name),$("#subject").val(e.subject),$("#html_editor").val(e.html),$("#text_editor").val(e.text),$.each(e.attachments,function(t,e){var a=icons[e.type]||"fa-file-o";attachmentsTable.row.add(['',escapeHtml(e.name),'',e.content,e.type||"application/octet-stream"]).draw()}),-1!=e.html.indexOf("{{.Tracker}}")?$("#use_tracker_checkbox").prop("checked",!0):$("#use_tracker_checkbox").prop("checked",!1)),$("#attachmentsTable").unbind("click").on("click","span>i.fa-trash-o",function(){attachmentsTable.row($(this).parents("tr")).remove().draw()})}function copy(t){$("#modalSubmit").unbind("click").click(function(){save(-1)}),$("#attachmentUpload").unbind("click").click(function(){this.value=null}),$("#html_editor").ckeditor(),$("#attachmentsTable").show(),attachmentsTable=$("#attachmentsTable").DataTable({destroy:!0,order:[[1,"asc"]],columnDefs:[{orderable:!1,targets:"no-sort"},{sClass:"datatable_hidden",targets:[3,4]}]});var e={attachments:[]};e=templates[t],$("#name").val("Copy of "+e.name),$("#subject").val(e.subject),$("#html_editor").val(e.html),$("#text_editor").val(e.text),$.each(e.attachments,function(t,e){var a=icons[e.type]||"fa-file-o";attachmentsTable.row.add(['',escapeHtml(e.name),'',e.content,e.type||"application/octet-stream"]).draw()}),$("#attachmentsTable").unbind("click").on("click","span>i.fa-trash-o",function(){attachmentsTable.row($(this).parents("tr")).remove().draw()}),-1!=e.html.indexOf("{{.Tracker}}")?$("#use_tracker_checkbox").prop("checked",!0):$("#use_tracker_checkbox").prop("checked",!1)}function importEmail(){raw=$("#email_content").val(),convert_links=$("#convert_links_checkbox").prop("checked"),raw?api.import_email({content:raw,convert_links:convert_links}).success(function(t){$("#text_editor").val(t.text),$("#html_editor").val(t.html),$("#subject").val(t.subject),t.html&&(CKEDITOR.instances.html_editor.setMode("wysiwyg"),$('.nav-tabs a[href="#html"]').click()),$("#importEmailModal").modal("hide")}).error(function(t){modalError(t.responseJSON.message)}):modalError("No Content Specified!")}function load(){$("#templateTable").hide(),$("#emptyMessage").hide(),$("#loading").show(),api.templates.get().success(function(t){templates=t,$("#loading").hide(),templates.length>0?($("#templateTable").show(),templateTable=$("#templateTable").DataTable({destroy:!0,columnDefs:[{orderable:!1,targets:"no-sort"}]}),templateTable.clear(),$.each(templates,function(t,e){templateTable.row.add([escapeHtml(e.name),moment(e.modified_date).format("MMMM Do YYYY, h:mm:ss a"),"
    \t\t
    "]).draw()}),$('[data-toggle="tooltip"]').tooltip()):$("#emptyMessage").show()}).error(function(){$("#loading").hide(),errorFlash("Error fetching templates")})}var templates=[],icons={"application/vnd.ms-excel":"fa-file-excel-o","text/plain":"fa-file-text-o","image/gif":"fa-file-image-o","image/png":"fa-file-image-o","application/pdf":"fa-file-pdf-o","application/x-zip-compressed":"fa-file-archive-o","application/x-gzip":"fa-file-archive-o","application/vnd.openxmlformats-officedocument.presentationml.presentation":"fa-file-powerpoint-o","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"fa-file-word-o","application/octet-stream":"fa-file-o","application/x-msdownload":"fa-file-o"},deleteTemplate=function(t){swal({title:"Are you sure?",text:"This will delete the template. This can't be undone!",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Delete "+escapeHtml(templates[t].name),confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,preConfirm:function(){return new Promise(function(e,a){api.templateId.delete(templates[t].id).success(function(t){e()}).error(function(t){a(t.responseJSON.message)})})}}).then(function(){swal("Template Deleted!","This template has been deleted!","success"),$('button:contains("OK")').on("click",function(){location.reload()})})};$(document).ready(function(){$(".modal").on("hidden.bs.modal",function(t){$(this).removeClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")-1)}),$(".modal").on("shown.bs.modal",function(t){void 0===$("body").data("fv_open_modals")&&$("body").data("fv_open_modals",0),$(this).hasClass("fv-modal-stack")||($(this).addClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")+1),$(this).css("z-index",1040+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not(".fv-modal-stack").css("z-index",1039+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not("fv-modal-stack").addClass("fv-modal-stack"))}),$.fn.modal.Constructor.prototype.enforceFocus=function(){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy(function(t){this.$element[0]===t.target||this.$element.has(t.target).length||$(t.target).closest(".cke_dialog, .cke").length||this.$element.trigger("focus")},this))},$(document).on("hidden.bs.modal",".modal",function(){$(".modal:visible").length&&$(document.body).addClass("modal-open")}),$("#modal").on("hidden.bs.modal",function(t){dismiss()}),$("#importEmailModal").on("hidden.bs.modal",function(t){$("#email_content").val("")}),CKEDITOR.on("dialogDefinition",function(t){var e=t.data.name,a=t.data.definition;if("link"==e){a.minWidth=500,a.minHeight=100;a.getContents("info").get("linkType").hidden=!0}}),load()}); \ No newline at end of file +var templates=[],icons={"application/vnd.ms-excel":"fa-file-excel-o","text/plain":"fa-file-text-o","image/gif":"fa-file-image-o","image/png":"fa-file-image-o","application/pdf":"fa-file-pdf-o","application/x-zip-compressed":"fa-file-archive-o","application/x-gzip":"fa-file-archive-o","application/vnd.openxmlformats-officedocument.presentationml.presentation":"fa-file-powerpoint-o","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"fa-file-word-o","application/octet-stream":"fa-file-o","application/x-msdownload":"fa-file-o"};function save(t){var a={attachments:[]};a.name=$("#name").val(),a.subject=$("#subject").val(),a.html=CKEDITOR.instances.html_editor.getData(),a.html=a.html.replace(/https?:\/\/{{\.URL}}/gi,"{{.URL}}"),$("#use_tracker_checkbox").prop("checked")?-1==a.html.indexOf("{{.Tracker}}")&&-1==a.html.indexOf("{{.TrackingUrl}}")&&(a.html=a.html.replace("","{{.Tracker}}")):a.html=a.html.replace("{{.Tracker}}",""),a.text=$("#text_editor").val(),$.each($("#attachmentsTable").DataTable().rows().data(),function(t,e){a.attachments.push({name:unescapeHtml(e[1]),content:e[3],type:e[4]})}),-1!=t?(a.id=templates[t].id,api.templateId.put(a).success(function(t){successFlash("Template edited successfully!"),load(),dismiss()}).error(function(t){modalError(t.responseJSON.message)})):api.templates.post(a).success(function(t){successFlash("Template added successfully!"),load(),dismiss()}).error(function(t){modalError(t.responseJSON.message)})}function dismiss(){$("#modal\\.flashes").empty(),$("#attachmentsTable").dataTable().DataTable().clear().draw(),$("#name").val(""),$("#subject").val(""),$("#text_editor").val(""),$("#html_editor").val(""),$("#modal").modal("hide")}var deleteTemplate=function(t){swal({title:"Are you sure?",text:"This will delete the template. This can't be undone!",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Delete "+escapeHtml(templates[t].name),confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,preConfirm:function(){return new Promise(function(e,a){api.templateId.delete(templates[t].id).success(function(t){e()}).error(function(t){a(t.responseJSON.message)})})}}).then(function(){swal("Template Deleted!","This template has been deleted!","success"),$('button:contains("OK")').on("click",function(){location.reload()})})};function deleteTemplate(t){confirm("Delete "+templates[t].name+"?")&&api.templateId.delete(templates[t].id).success(function(t){successFlash(t.message),load()})}function attach(t){attachmentsTable=$("#attachmentsTable").DataTable({destroy:!0,order:[[1,"asc"]],columnDefs:[{orderable:!1,targets:"no-sort"},{sClass:"datatable_hidden",targets:[3,4]}]}),$.each(t,function(t,a){var o=new FileReader;o.onload=function(t){var e=icons[a.type]||"fa-file-o";attachmentsTable.row.add(['',escapeHtml(a.name),'',o.result.split(",")[1],a.type||"application/octet-stream"]).draw()},o.onerror=function(t){console.log(t)},o.readAsDataURL(a)})}function edit(t){$("#modalSubmit").unbind("click").click(function(){save(t)}),$("#attachmentUpload").unbind("click").click(function(){this.value=null}),$("#html_editor").ckeditor(),setupAutocomplete(CKEDITOR.instances.html_editor),$("#attachmentsTable").show(),attachmentsTable=$("#attachmentsTable").DataTable({destroy:!0,order:[[1,"asc"]],columnDefs:[{orderable:!1,targets:"no-sort"},{sClass:"datatable_hidden",targets:[3,4]}]});var e={attachments:[]};-1!=t&&(e=templates[t],$("#name").val(e.name),$("#subject").val(e.subject),$("#html_editor").val(e.html),$("#text_editor").val(e.text),$.each(e.attachments,function(t,e){var a=icons[e.type]||"fa-file-o";attachmentsTable.row.add(['',escapeHtml(e.name),'',e.content,e.type||"application/octet-stream"]).draw()}),-1!=e.html.indexOf("{{.Tracker}}")?$("#use_tracker_checkbox").prop("checked",!0):$("#use_tracker_checkbox").prop("checked",!1)),$("#attachmentsTable").unbind("click").on("click","span>i.fa-trash-o",function(){attachmentsTable.row($(this).parents("tr")).remove().draw()})}function copy(t){$("#modalSubmit").unbind("click").click(function(){save(-1)}),$("#attachmentUpload").unbind("click").click(function(){this.value=null}),$("#html_editor").ckeditor(),$("#attachmentsTable").show(),attachmentsTable=$("#attachmentsTable").DataTable({destroy:!0,order:[[1,"asc"]],columnDefs:[{orderable:!1,targets:"no-sort"},{sClass:"datatable_hidden",targets:[3,4]}]});var e={attachments:[]};e=templates[t],$("#name").val("Copy of "+e.name),$("#subject").val(e.subject),$("#html_editor").val(e.html),$("#text_editor").val(e.text),$.each(e.attachments,function(t,e){var a=icons[e.type]||"fa-file-o";attachmentsTable.row.add(['',escapeHtml(e.name),'',e.content,e.type||"application/octet-stream"]).draw()}),$("#attachmentsTable").unbind("click").on("click","span>i.fa-trash-o",function(){attachmentsTable.row($(this).parents("tr")).remove().draw()}),-1!=e.html.indexOf("{{.Tracker}}")?$("#use_tracker_checkbox").prop("checked",!0):$("#use_tracker_checkbox").prop("checked",!1)}function importEmail(){raw=$("#email_content").val(),convert_links=$("#convert_links_checkbox").prop("checked"),raw?api.import_email({content:raw,convert_links:convert_links}).success(function(t){$("#text_editor").val(t.text),$("#html_editor").val(t.html),$("#subject").val(t.subject),t.html&&(CKEDITOR.instances.html_editor.setMode("wysiwyg"),$('.nav-tabs a[href="#html"]').click()),$("#importEmailModal").modal("hide")}).error(function(t){modalError(t.responseJSON.message)}):modalError("No Content Specified!")}function load(){$("#templateTable").hide(),$("#emptyMessage").hide(),$("#loading").show(),api.templates.get().success(function(t){templates=t,$("#loading").hide(),0\t\t
    "]).draw()}),$('[data-toggle="tooltip"]').tooltip()):$("#emptyMessage").show()}).error(function(){$("#loading").hide(),errorFlash("Error fetching templates")})}$(document).ready(function(){$(".modal").on("hidden.bs.modal",function(t){$(this).removeClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")-1)}),$(".modal").on("shown.bs.modal",function(t){void 0===$("body").data("fv_open_modals")&&$("body").data("fv_open_modals",0),$(this).hasClass("fv-modal-stack")||($(this).addClass("fv-modal-stack"),$("body").data("fv_open_modals",$("body").data("fv_open_modals")+1),$(this).css("z-index",1040+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not(".fv-modal-stack").css("z-index",1039+10*$("body").data("fv_open_modals")),$(".modal-backdrop").not("fv-modal-stack").addClass("fv-modal-stack"))}),$.fn.modal.Constructor.prototype.enforceFocus=function(){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy(function(t){this.$element[0]===t.target||this.$element.has(t.target).length||$(t.target).closest(".cke_dialog, .cke").length||this.$element.trigger("focus")},this))},$(document).on("hidden.bs.modal",".modal",function(){$(".modal:visible").length&&$(document.body).addClass("modal-open")}),$("#modal").on("hidden.bs.modal",function(t){dismiss()}),$("#importEmailModal").on("hidden.bs.modal",function(t){$("#email_content").val("")}),CKEDITOR.on("dialogDefinition",function(t){var e=t.data.name,a=t.data.definition;"link"==e&&(a.minWidth=500,a.minHeight=100,a.getContents("info").get("linkType").hidden=!0)}),load()}); \ No newline at end of file diff --git a/static/js/dist/app/users.min.js b/static/js/dist/app/users.min.js index dc7d028f..02d746e8 100644 --- a/static/js/dist/app/users.min.js +++ b/static/js/dist/app/users.min.js @@ -1 +1 @@ -function save(e){var a=[];$.each($("#targetsTable").DataTable().rows().data(),function(e,t){a.push({first_name:unescapeHtml(t[0]),last_name:unescapeHtml(t[1]),email:unescapeHtml(t[2]),position:unescapeHtml(t[3])})});var t={name:$("#name").val(),targets:a};-1!=e?(t.id=e,api.groupId.put(t).success(function(e){successFlash("Group updated successfully!"),load(),dismiss(),$("#modal").modal("hide")}).error(function(e){modalError(e.responseJSON.message)})):api.groups.post(t).success(function(e){successFlash("Group added successfully!"),load(),dismiss(),$("#modal").modal("hide")}).error(function(e){modalError(e.responseJSON.message)})}function dismiss(){$("#targetsTable").dataTable().DataTable().clear().draw(),$("#name").val(""),$("#modal\\.flashes").empty()}function edit(e){if(targets=$("#targetsTable").dataTable({destroy:!0,columnDefs:[{orderable:!1,targets:"no-sort"}]}),$("#modalSubmit").unbind("click").click(function(){save(e)}),-1==e);else api.groupId.get(e).success(function(e){$("#name").val(e.name),$.each(e.targets,function(e,a){targets.DataTable().row.add([escapeHtml(a.first_name),escapeHtml(a.last_name),escapeHtml(a.email),escapeHtml(a.position),'']).draw()})}).error(function(){errorFlash("Error fetching group")});$("#csvupload").fileupload({url:"/api/import/group",dataType:"json",beforeSend:function(e){e.setRequestHeader("Authorization","Bearer "+user.api_key)},add:function(e,a){$("#modal\\.flashes").empty();var t=/(csv|txt)$/i,s=a.originalFiles[0].name;if(s&&!t.test(s.split(".").pop()))return modalError("Unsupported file extension (use .csv or .txt)"),!1;a.submit()},done:function(e,a){$.each(a.result,function(e,a){addTarget(a.first_name,a.last_name,a.email,a.position)}),targets.DataTable().draw()}})}function addTarget(e,a,t,s){var o=escapeHtml(t).toLowerCase(),r=[escapeHtml(e),escapeHtml(a),o,escapeHtml(s),''],n=targets.DataTable(),i=n.column(2,{order:"index"}).data().indexOf(o);i>=0?n.row(i,{order:"index"}).data(r):n.row.add(r)}function load(){$("#groupTable").hide(),$("#emptyMessage").hide(),$("#loading").show(),api.groups.summary().success(function(e){if($("#loading").hide(),e.total>0){groups=e.groups,$("#emptyMessage").hide(),$("#groupTable").show();var a=$("#groupTable").DataTable({destroy:!0,columnDefs:[{orderable:!1,targets:"no-sort"}]});a.clear(),$.each(groups,function(e,t){a.row.add([escapeHtml(t.name),escapeHtml(t.num_targets),moment(t.modified_date).format("MMMM Do YYYY, h:mm:ss a"),"
    "]).draw()})}else $("#emptyMessage").show()}).error(function(){errorFlash("Error fetching groups")})}var groups=[],downloadCSVTemplate=function(){var e=[{"First Name":"Example","Last Name":"User",Email:"foobar@example.com",Position:"Systems Administrator"}],a=Papa.unparse(e,{}),t=new Blob([a],{type:"text/csv;charset=utf-8;"});if(navigator.msSaveBlob)navigator.msSaveBlob(t,"group_template.csv");else{var s=window.URL.createObjectURL(t),o=document.createElement("a");o.href=s,o.setAttribute("download","group_template.csv"),document.body.appendChild(o),o.click(),document.body.removeChild(o)}},deleteGroup=function(e){var a=groups.find(function(a){return a.id===e});a&&swal({title:"Are you sure?",text:"This will delete the group. This can't be undone!",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Delete "+escapeHtml(a.name),confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,preConfirm:function(){return new Promise(function(a,t){api.groupId.delete(e).success(function(e){a()}).error(function(e){t(e.responseJSON.message)})})}}).then(function(){swal("Group Deleted!","This group has been deleted!","success"),$('button:contains("OK")').on("click",function(){location.reload()})})};$(document).ready(function(){load(),$("#targetForm").submit(function(){return addTarget($("#firstName").val(),$("#lastName").val(),$("#email").val(),$("#position").val()),targets.DataTable().draw(),$("#targetForm>div>input").val(""),$("#firstName").focus(),!1}),$("#targetsTable").on("click","span>i.fa-trash-o",function(){targets.DataTable().row($(this).parents("tr")).remove().draw()}),$("#modal").on("hide.bs.modal",function(){dismiss()}),$("#csv-template").click(downloadCSVTemplate)}); \ No newline at end of file +var groups=[];function save(e){var t=[];$.each($("#targetsTable").DataTable().rows().data(),function(e,a){t.push({first_name:unescapeHtml(a[0]),last_name:unescapeHtml(a[1]),email:unescapeHtml(a[2]),position:unescapeHtml(a[3])})});var a={name:$("#name").val(),targets:t};-1!=e?(a.id=e,api.groupId.put(a).success(function(e){successFlash("Group updated successfully!"),load(),dismiss(),$("#modal").modal("hide")}).error(function(e){modalError(e.responseJSON.message)})):api.groups.post(a).success(function(e){successFlash("Group added successfully!"),load(),dismiss(),$("#modal").modal("hide")}).error(function(e){modalError(e.responseJSON.message)})}function dismiss(){$("#targetsTable").dataTable().DataTable().clear().draw(),$("#name").val(""),$("#modal\\.flashes").empty()}function edit(e){if(targets=$("#targetsTable").dataTable({destroy:!0,columnDefs:[{orderable:!1,targets:"no-sort"}]}),$("#modalSubmit").unbind("click").click(function(){save(e)}),-1==e);else api.groupId.get(e).success(function(e){$("#name").val(e.name),$.each(e.targets,function(e,a){targets.DataTable().row.add([escapeHtml(a.first_name),escapeHtml(a.last_name),escapeHtml(a.email),escapeHtml(a.position),'']).draw()})}).error(function(){errorFlash("Error fetching group")});$("#csvupload").fileupload({url:"/api/import/group",dataType:"json",beforeSend:function(e){e.setRequestHeader("Authorization","Bearer "+user.api_key)},add:function(e,a){$("#modal\\.flashes").empty();var t=a.originalFiles[0].name;if(t&&!/(csv|txt)$/i.test(t.split(".").pop()))return modalError("Unsupported file extension (use .csv or .txt)"),!1;a.submit()},done:function(e,a){$.each(a.result,function(e,a){addTarget(a.first_name,a.last_name,a.email,a.position)}),targets.DataTable().draw()}})}var downloadCSVTemplate=function(){var e="group_template.csv",a=Papa.unparse([{"First Name":"Example","Last Name":"User",Email:"foobar@example.com",Position:"Systems Administrator"}],{}),t=new Blob([a],{type:"text/csv;charset=utf-8;"});if(navigator.msSaveBlob)navigator.msSaveBlob(t,e);else{var s=window.URL.createObjectURL(t),o=document.createElement("a");o.href=s,o.setAttribute("download",e),document.body.appendChild(o),o.click(),document.body.removeChild(o)}},deleteGroup=function(s){var e=groups.find(function(e){return e.id===s});e&&swal({title:"Are you sure?",text:"This will delete the group. This can't be undone!",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Delete "+escapeHtml(e.name),confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,preConfirm:function(){return new Promise(function(a,t){api.groupId.delete(s).success(function(e){a()}).error(function(e){t(e.responseJSON.message)})})}}).then(function(){swal("Group Deleted!","This group has been deleted!","success"),$('button:contains("OK")').on("click",function(){location.reload()})})};function addTarget(e,a,t,s){var o=escapeHtml(t).toLowerCase(),r=[escapeHtml(e),escapeHtml(a),o,escapeHtml(s),''],n=targets.DataTable(),i=n.column(2,{order:"index"}).data().indexOf(o);0<=i?n.row(i,{order:"index"}).data(r):n.row.add(r)}function load(){$("#groupTable").hide(),$("#emptyMessage").hide(),$("#loading").show(),api.groups.summary().success(function(e){if($("#loading").hide(),0
    "]).draw()})}else $("#emptyMessage").show()}).error(function(){errorFlash("Error fetching groups")})}$(document).ready(function(){load(),$("#targetForm").submit(function(){return addTarget($("#firstName").val(),$("#lastName").val(),$("#email").val(),$("#position").val()),targets.DataTable().draw(),$("#targetForm>div>input").val(""),$("#firstName").focus(),!1}),$("#targetsTable").on("click","span>i.fa-trash-o",function(){targets.DataTable().row($(this).parents("tr")).remove().draw()}),$("#modal").on("hide.bs.modal",function(){dismiss()}),$("#csv-template").click(downloadCSVTemplate)}); \ No newline at end of file diff --git a/static/js/dist/vendor.min.js b/static/js/dist/vendor.min.js index 198a5889..2f348ef3 100755 --- a/static/js/dist/vendor.min.js +++ b/static/js/dist/vendor.min.js @@ -1,30 +1 @@ -if(function(t,e){function n(t){var e=t.length,n=ct.type(t);return!ct.isWindow(t)&&(!(1!==t.nodeType||!e)||("array"===n||"function"!==n&&(0===e||"number"==typeof e&&e>0&&e-1 in t)))}function i(t){var e=Ct[t]={};return ct.each(t.match(dt)||[],function(t,n){e[n]=!0}),e}function r(t,n,i,r){if(ct.acceptData(t)){var o,a,s=ct.expando,l=t.nodeType,u=l?ct.cache:t,c=l?t[s]:t[s]&&s;if(c&&u[c]&&(r||u[c].data)||i!==e||"string"!=typeof n)return c||(c=l?t[s]=et.pop()||ct.guid++:s),u[c]||(u[c]=l?{}:{toJSON:ct.noop}),("object"==typeof n||"function"==typeof n)&&(r?u[c]=ct.extend(u[c],n):u[c].data=ct.extend(u[c].data,n)),a=u[c],r||(a.data||(a.data={}),a=a.data),i!==e&&(a[ct.camelCase(n)]=i),"string"==typeof n?null==(o=a[n])&&(o=a[ct.camelCase(n)]):o=a,o}}function o(t,e,n){if(ct.acceptData(t)){var i,r,o=t.nodeType,a=o?ct.cache:t,l=o?t[ct.expando]:ct.expando;if(a[l]){if(e&&(i=n?a[l]:a[l].data)){ct.isArray(e)?e=e.concat(ct.map(e,ct.camelCase)):e in i?e=[e]:(e=ct.camelCase(e),e=e in i?[e]:e.split(" ")),r=e.length;for(;r--;)delete i[e[r]];if(n?!s(i):!ct.isEmptyObject(i))return}(n||(delete a[l].data,s(a[l])))&&(o?ct.cleanData([t],!0):ct.support.deleteExpando||a!=a.window?delete a[l]:a[l]=null)}}}function a(t,n,i){if(i===e&&1===t.nodeType){var r="data-"+n.replace(Tt,"-$1").toLowerCase();if("string"==typeof(i=t.getAttribute(r))){try{i="true"===i||"false"!==i&&("null"===i?null:+i+""===i?+i:Mt.test(i)?ct.parseJSON(i):i)}catch(t){}ct.data(t,n,i)}else i=e}return i}function s(t){var e;for(e in t)if(("data"!==e||!ct.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function l(){return!0}function u(){return!1}function c(){try{return Z.activeElement}catch(t){}}function h(t,e){do{t=t[e]}while(t&&1!==t.nodeType);return t}function d(t,e,n){if(ct.isFunction(e))return ct.grep(t,function(t,i){return!!e.call(t,i,t)!==n});if(e.nodeType)return ct.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(Wt.test(e))return ct.filter(e,t,n);e=ct.filter(e,t)}return ct.grep(t,function(t){return ct.inArray(t,e)>=0!==n})}function f(t){var e=Yt.split("|"),n=t.createDocumentFragment();if(n.createElement)for(;e.length;)n.createElement(e.pop());return n}function p(t,e){return ct.nodeName(t,"table")&&ct.nodeName(1===e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function g(t){return t.type=(null!==ct.find.attr(t,"type"))+"/"+t.type,t}function m(t){var e=re.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function v(t,e){for(var n,i=0;null!=(n=t[i]);i++)ct._data(n,"globalEval",!e||ct._data(e[i],"globalEval"))}function y(t,e){if(1===e.nodeType&&ct.hasData(t)){var n,i,r,o=ct._data(t),a=ct._data(e,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(i=0,r=s[n].length;r>i;i++)ct.event.add(e,n,s[n][i])}a.data&&(a.data=ct.extend({},a.data))}}function b(t,e){var n,i,r;if(1===e.nodeType){if(n=e.nodeName.toLowerCase(),!ct.support.noCloneEvent&&e[ct.expando]){r=ct._data(e);for(i in r.events)ct.removeEvent(e,i,r.handle);e.removeAttribute(ct.expando)}"script"===n&&e.text!==t.text?(g(e).text=t.text,m(e)):"object"===n?(e.parentNode&&(e.outerHTML=t.outerHTML),ct.support.html5Clone&&t.innerHTML&&!ct.trim(e.innerHTML)&&(e.innerHTML=t.innerHTML)):"input"===n&&ee.test(t.type)?(e.defaultChecked=e.checked=t.checked,e.value!==t.value&&(e.value=t.value)):"option"===n?e.defaultSelected=e.selected=t.defaultSelected:("input"===n||"textarea"===n)&&(e.defaultValue=t.defaultValue)}}function x(t,n){var i,r,o=0,a=typeof t.getElementsByTagName!==X?t.getElementsByTagName(n||"*"):typeof t.querySelectorAll!==X?t.querySelectorAll(n||"*"):e;if(!a)for(a=[],i=t.childNodes||t;null!=(r=i[o]);o++)!n||ct.nodeName(r,n)?a.push(r):ct.merge(a,x(r,n));return n===e||n&&ct.nodeName(t,n)?ct.merge([t],a):a}function w(t){ee.test(t.type)&&(t.defaultChecked=t.checked)}function S(t,e){if(e in t)return e;for(var n=e.charAt(0).toUpperCase()+e.slice(1),i=e,r=ke.length;r--;)if((e=ke[r]+n)in t)return e;return i}function _(t,e){return t=e||t,"none"===ct.css(t,"display")||!ct.contains(t.ownerDocument,t)}function k(t,e){for(var n,i,r,o=[],a=0,s=t.length;s>a;a++)i=t[a],i.style&&(o[a]=ct._data(i,"olddisplay"),n=i.style.display,e?(o[a]||"none"!==n||(i.style.display=""),""===i.style.display&&_(i)&&(o[a]=ct._data(i,"olddisplay",D(i.nodeName)))):o[a]||(r=_(i),(n&&"none"!==n||!r)&&ct._data(i,"olddisplay",r?n:ct.css(i,"display"))));for(a=0;s>a;a++)i=t[a],i.style&&(e&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=e?o[a]||"":"none"));return t}function C(t,e,n){var i=ve.exec(e);return i?Math.max(0,i[1]-(n||0))+(i[2]||"px"):e}function M(t,e,n,i,r){for(var o=n===(i?"border":"content")?4:"width"===e?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=ct.css(t,n+_e[o],!0,r)),i?("content"===n&&(a-=ct.css(t,"padding"+_e[o],!0,r)),"margin"!==n&&(a-=ct.css(t,"border"+_e[o]+"Width",!0,r))):(a+=ct.css(t,"padding"+_e[o],!0,r),"padding"!==n&&(a+=ct.css(t,"border"+_e[o]+"Width",!0,r)));return a}function T(t,e,n){var i=!0,r="width"===e?t.offsetWidth:t.offsetHeight,o=ce(t),a=ct.support.boxSizing&&"border-box"===ct.css(t,"boxSizing",!1,o);if(0>=r||null==r){if(r=he(t,e,o),(0>r||null==r)&&(r=t.style[e]),ye.test(r))return r;i=a&&(ct.support.boxSizingReliable||r===t.style[e]),r=parseFloat(r)||0}return r+M(t,e,n||(a?"border":"content"),i,o)+"px"}function D(t){var e=Z,n=xe[t];return n||(n=A(t,e),"none"!==n&&n||(ue=(ue||ct("').bind("load",function(){var e,o=t.isArray(n.paramName)?n.paramName:[n.paramName];r.unbind("load").bind("load",function(){var e;try{if(e=r.contents(),!e.length||!e[0].firstChild)throw new Error}catch(t){e=void 0}l(200,"success",{iframe:e}),t('').appendTo(i),window.setTimeout(function(){i.remove()},0)}),i.prop("target",r.prop("name")).prop("action",n.url).prop("method",n.type),n.formData&&t.each(n.formData,function(e,n){t('').prop("name",n.name).val(n.value).appendTo(i)}),n.fileInput&&n.fileInput.length&&"POST"===n.type&&(e=n.fileInput.clone(),n.fileInput.after(function(t){return e[t]}),n.paramName&&n.fileInput.each(function(e){t(this).prop("name",o[e]||n.paramName)}),i.append(n.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),n.fileInput.removeAttr("form")),i.submit(),e&&e.length&&n.fileInput.each(function(n,i){var r=t(e[n]);t(i).prop("name",r.prop("name")).attr("form",r.attr("form")),r.replaceWith(i)})}),i.append(r).appendTo(document.body)},abort:function(){r&&r.unbind("load").prop("src",a),i&&i.remove()}}}}),t.ajaxSetup({converters:{"iframe text":function(e){return e&&t(e[0].body).text()},"iframe json":function(e){return e&&t.parseJSON(t(e[0].body).text())},"iframe html":function(e){return e&&t(e[0].body).html()},"iframe xml":function(e){var n=e&&e[0];return n&&t.isXMLDoc(n)?n:t.parseXML(n.XMLDocument&&n.XMLDocument.xml||t(n.body).html())},"iframe script":function(e){return e&&t.globalEval(t(e[0].body).text())}}})}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Sweetalert2=e()}(this,function(){"use strict";function t(){if(void 0===arguments[0])return console.error("sweetAlert2 expects at least 1 attribute!"),!1;var t=l({},I);switch(typeof arguments[0]){case"string":t.title=arguments[0],t.text=arguments[1]||"",t.type=arguments[2]||"";break;case"object":l(t,arguments[0]),t.extraParams=arguments[0].extraParams,"email"===t.input&&null===t.inputValidator&&(t.inputValidator=function(t){return new Promise(function(e,n){/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/.test(t)?e():n("Invalid email address")})});break;default:return console.error('Unexpected type of argument! Expected "string" or "object", got '+typeof arguments[0]),!1}N(t);var i=f();return new Promise(function(o,a){function s(t,e){for(var n=0;n0;)I.removeAttribute(I.attributes[0].name);for(var H in t.inputAttributes)I.setAttribute(H,t.inputAttributes[H]);I.className=j,t.inputClass&&b(I,t.inputClass),k(I)}var z;switch(t.input){case"text":case"email":case"password":case"file":I=w(i,r.input),I.value=t.inputValue,I.placeholder=t.inputPlaceholder,I.type=t.input,S(I);break;case"select":var B=w(i,r.select);if(B.innerHTML="",t.inputPlaceholder){var W=document.createElement("option");W.innerHTML=t.inputPlaceholder,W.value="",W.disabled=!0,W.selected=!0,B.appendChild(W)}z=function(e){for(var n in e){var i=document.createElement("option");i.value=n,i.innerHTML=e[n],t.inputValue===n&&(i.selected=!0),B.appendChild(i)}S(B),B.focus()};break;case"radio":var $=w(i,r.radio);$.innerHTML="",z=function(e){for(var n in e){var i=1,o=document.createElement("input"),a=document.createElement("label"),s=document.createElement("span");o.type="radio",o.name=r.radio,o.value=n,o.id=r.radio+"-"+i++,t.inputValue===n&&(o.checked=!0),s.innerHTML=e[n],a.appendChild(o),a.appendChild(s),a.for=o.id,$.appendChild(a)}S($);var l=$.querySelectorAll("input");l.length&&l[0].focus()};break;case"checkbox":var q=w(i,r.checkbox),U=i.querySelector("#"+r.checkbox);U.value=1,U.checked=Boolean(t.inputValue);var Y=q.getElementsByTagName("span");Y.length&&q.removeChild(Y[0]),Y=document.createElement("span"),Y.innerHTML=t.inputPlaceholder,q.appendChild(Y),S(q);break;case"textarea":var G=w(i,r.textarea);G.value=t.inputValue,G.placeholder=t.inputPlaceholder,S(G);break;case null:break;default:console.error('Unexpected type of input! Expected "text" or "email" or "password", "select", "checkbox", "textarea" or "file", got '+typeof arguments[0])}"select"!==t.input&&"radio"!==t.input||(t.inputOptions instanceof Promise?(e.showLoading(),t.inputOptions.then(function(t){e.hideLoading(),z(t)})):"object"==typeof t.inputOptions?z(t.inputOptions):console.error("Unexpected type of inputOptions! Expected object or Promise, got "+t.inputOptions)),R(),F(t.animation,t.onOpen),s(-1,1)})}function e(){var n=arguments,i=f();return null===i&&(e.init(),i=f()),v(i,"visible")&&L(),t.apply(this,n)}var n="swal2-",i=function(t){var e={};for(var i in t)e[t[i]]=n+t[i];return e},r=i(["container","modal","overlay","close","content","spacer","confirm","cancel","icon","image","input","select","radio","checkbox","textarea","validationerror"]),o=i(["success","warning","info","question","error"]),a={title:"",text:"",html:"",type:null,animation:!0,allowOutsideClick:!0,allowEscapeKey:!0,showConfirmButton:!0,showCancelButton:!1,preConfirm:null,confirmButtonText:"OK",confirmButtonColor:"#3085d6",confirmButtonClass:null,cancelButtonText:"Cancel",cancelButtonColor:"#aaa",cancelButtonClass:null,buttonsStyling:!0,reverseButtons:!1,showCloseButton:!1,showLoaderOnConfirm:!1,imageUrl:null,imageWidth:null,imageHeight:null,imageClass:null,timer:null,width:500,padding:20,background:"#fff",input:null,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputClass:null,inputAttributes:{},inputValidator:null,onOpen:null,onClose:null},s='
    ',l=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},u=function(t,e){t=String(t).replace(/[^0-9a-f]/gi,""),t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),e=e||0;for(var n="#",i=0;3>i;i++){var r=parseInt(t.substr(2*i,2),16);r=Math.round(Math.min(Math.max(0,r+r*e),255)).toString(16),n+=("00"+r).substr(r.length)}return n},c=n+"mediaquery",h={previousDocumentClick:null,previousWindowKeyDown:null,previousActiveElement:null},d=function(t){return document.querySelector("."+t)},f=function(){return d(r.modal)},p=function(){return d(r.overlay)},g=function(){return d(r.confirm)},m=function(){return d(r.cancel)},v=function(t,e){return new RegExp(" "+e+" ").test(" "+t.className+" ")},y=function(t){t.focus();var e=t.value;t.value="",t.value=e},b=function(t,e){e&&!v(t,e)&&(t.className+=" "+e)},x=function(t,e){var n=" "+t.className.replace(/[\t\r\n]/g," ")+" ";if(v(t,e)){for(;n.indexOf(" "+e+" ")>=0;)n=n.replace(" "+e+" "," ");t.className=n.replace(/^\s+|\s+$/g,"")}},w=function(t,e){for(var n=0;n1?1:r,n=+new Date,+t.style.opacity<1&&setTimeout(i,e)};i()}},A=function(t,e){if(+t.style.opacity>0){e=e||16;var n=t.style.opacity,i=+new Date,r=function(){var o=new Date-i,a=+t.style.opacity-o/(100*n);t.style.opacity=a,i=+new Date,+t.style.opacity>0?setTimeout(r,e):k(t)};r()}},P=function(t){if("function"==typeof MouseEvent){var e=new MouseEvent("click",{view:window,bubbles:!1,cancelable:!0});t.dispatchEvent(e)}else if(document.createEvent){var n=document.createEvent("MouseEvents");n.initEvent("click",!1,!1),t.dispatchEvent(n)}else document.createEventObject?t.fireEvent("onclick"):"function"==typeof t.onclick&&t.onclick()},E=function(t){"function"==typeof t.stopPropagation?(t.stopPropagation(),t.preventDefault()):window.event&&window.event.hasOwnProperty("cancelBubble")&&(window.event.cancelBubble=!0)},O=function(){var t=document.createElement("div"),e={WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd oanimationend",msAnimation:"MSAnimationEnd",animation:"animationend"};for(var n in e)if(e.hasOwnProperty(n)&&void 0!==t.style[n])return e[n];return!1}(),L=function(){var t=f();window.onkeydown=h.previousWindowKeyDown,document.onclick=h.previousDocumentClick,h.previousActiveElement&&h.previousActiveElement.focus(),clearTimeout(t.timeout);var e=document.getElementsByTagName("head")[0],n=document.getElementById(c);n&&e.removeChild(n)},I=l({},a),N=function(t){var e,n=f();n.style.width=t.width+"px",n.style.padding=t.padding+"px",n.style.marginLeft=-t.width/2+"px",n.style.background=t.background;var i=document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",a.id=c;var s=t.width+parseInt(.05*t.width*2,10);a.innerHTML="@media screen and (max-width: "+s+"px) {."+r.modal+" {width: auto !important;left: 5% !important;right: 5% !important;margin-left: 0 !important;}}",i.appendChild(a);var l=n.querySelector("h2"),u=n.querySelector("."+r.content),h=g(),d=m(),p=n.querySelector("."+r.spacer),v=n.querySelector("."+r.close);if(l.innerHTML=t.title.split("\n").join("
    "),t.text||t.html){if("object"==typeof t.html)if(u.innerHTML="",0 in t.html)for(e=0;e in t.html;e++)u.appendChild(t.html[e]);else u.appendChild(t.html);else u.innerHTML=t.html||t.text.split("\n").join("
    ");_(u)}else C(u);if(t.showCloseButton?_(v):C(v),n.className=r.modal,t.customClass&&b(n,t.customClass),C(n.querySelectorAll("."+r.icon)),t.type){var y=!1;for(var w in o)if(t.type===w){y=!0;break}if(!y)return console.error("Unknown alert type: "+t.type),!1;var S=n.querySelector("."+r.icon+"."+o[t.type]);switch(_(S),t.type){case"success":b(S,"animate"),b(S.querySelector(".tip"),"animate-success-tip"),b(S.querySelector(".long"),"animate-success-long");break;case"error":b(S,"animate-error-icon"),b(S.querySelector(".x-mark"),"animate-x-mark");break;case"warning":b(S,"pulse-warning")}}var k=n.querySelector("."+r.image);t.imageUrl?(k.setAttribute("src",t.imageUrl),_(k),t.imageWidth&&k.setAttribute("width",t.imageWidth),t.imageHeight&&k.setAttribute("height",t.imageHeight),t.imageClass&&b(k,t.imageClass)):C(k),t.showCancelButton?d.style.display="inline-block":C(d),t.showConfirmButton?M(h,"display"):C(h),t.showConfirmButton||t.showCancelButton?_(p):C(p),h.innerHTML=t.confirmButtonText,d.innerHTML=t.cancelButtonText,t.buttonsStyling&&(h.style.backgroundColor=t.confirmButtonColor,d.style.backgroundColor=t.cancelButtonColor),h.className=r.confirm,b(h,t.confirmButtonClass),d.className=r.cancel,b(d,t.cancelButtonClass),t.buttonsStyling?(b(h,"styled"),b(d,"styled")):(x(h,"styled"),x(d,"styled"),h.style.backgroundColor=h.style.borderLeftColor=h.style.borderRightColor="",d.style.backgroundColor=d.style.borderLeftColor=d.style.borderRightColor=""),!0===t.animation?x(n,"no-animation"):b(n,"no-animation")},F=function(t,e){var n=f();t?(D(p(),10),b(n,"show-swal2"),x(n,"hide-swal2")):_(p()),_(n),h.previousActiveElement=document.activeElement,b(n,"visible"),null!==e&&"function"==typeof e&&e.call(this,n)},R=function(){var t=f();t.style.marginTop=T(t)};return e.queue=function(t){return new Promise(function(n,i){!function r(o,a){ -o1)throw new TypeError("isEnabled expects a single character string parameter");switch(t){case"y":return-1!==l.indexOf("Y");case"M":return-1!==l.indexOf("M");case"d":return-1!==l.toLowerCase().indexOf("d");case"h":case"H":return-1!==l.toLowerCase().indexOf("h");case"m":return-1!==l.indexOf("m");case"s":return-1!==l.indexOf("s");default:return!1}},C=function(){return k("h")||k("m")||k("s")},M=function(){return k("y")||k("M")||k("d")},T=function(){var e=t("").append(t("").append(t("").addClass("prev").attr("data-action","previous").append(t("").addClass(i.icons.previous))).append(t("").addClass("picker-switch").attr("data-action","pickerSwitch").attr("colspan",i.calendarWeeks?"6":"5")).append(t("").addClass("next").attr("data-action","next").append(t("").addClass(i.icons.next)))),n=t("").append(t("").append(t("").attr("colspan",i.calendarWeeks?"8":"7")));return[t("
    ").addClass("datepicker-days").append(t("").addClass("table-condensed").append(e).append(t(""))),t("
    ").addClass("datepicker-months").append(t("
    ").addClass("table-condensed").append(e.clone()).append(n.clone())),t("
    ").addClass("datepicker-years").append(t("
    ").addClass("table-condensed").append(e.clone()).append(n.clone())),t("
    ").addClass("datepicker-decades").append(t("
    ").addClass("table-condensed").append(e.clone()).append(n.clone()))]},D=function(){var e=t(""),n=t(""),r=t("");return k("h")&&(e.append(t("
    ").append(t("").attr({href:"#",tabindex:"-1",title:i.tooltips.incrementHour}).addClass("btn").attr("data-action","incrementHours").append(t("").addClass(i.icons.up)))),n.append(t("").append(t("").addClass("timepicker-hour").attr({"data-time-component":"hours",title:i.tooltips.pickHour}).attr("data-action","showHours"))),r.append(t("").append(t("").attr({href:"#",tabindex:"-1",title:i.tooltips.decrementHour}).addClass("btn").attr("data-action","decrementHours").append(t("").addClass(i.icons.down))))),k("m")&&(k("h")&&(e.append(t("").addClass("separator")),n.append(t("").addClass("separator").html(":")),r.append(t("").addClass("separator"))),e.append(t("").append(t("").attr({href:"#",tabindex:"-1",title:i.tooltips.incrementMinute}).addClass("btn").attr("data-action","incrementMinutes").append(t("").addClass(i.icons.up)))),n.append(t("").append(t("").addClass("timepicker-minute").attr({"data-time-component":"minutes",title:i.tooltips.pickMinute}).attr("data-action","showMinutes"))),r.append(t("").append(t("").attr({href:"#",tabindex:"-1",title:i.tooltips.decrementMinute}).addClass("btn").attr("data-action","decrementMinutes").append(t("").addClass(i.icons.down))))),k("s")&&(k("m")&&(e.append(t("").addClass("separator")),n.append(t("").addClass("separator").html(":")),r.append(t("").addClass("separator"))),e.append(t("").append(t("").attr({href:"#",tabindex:"-1",title:i.tooltips.incrementSecond}).addClass("btn").attr("data-action","incrementSeconds").append(t("").addClass(i.icons.up)))),n.append(t("").append(t("").addClass("timepicker-second").attr({"data-time-component":"seconds",title:i.tooltips.pickSecond}).attr("data-action","showSeconds"))),r.append(t("").append(t("").attr({href:"#",tabindex:"-1",title:i.tooltips.decrementSecond}).addClass("btn").attr("data-action","decrementSeconds").append(t("").addClass(i.icons.down))))),s||(e.append(t("").addClass("separator")),n.append(t("").append(t("").addClass("separator"))),t("
    ").addClass("timepicker-picker").append(t("").addClass("table-condensed").append([e,n,r]))},A=function(){var e=t("
    ").addClass("timepicker-hours").append(t("
    ").addClass("table-condensed")),n=t("
    ").addClass("timepicker-minutes").append(t("
    ").addClass("table-condensed")),i=t("
    ").addClass("timepicker-seconds").append(t("
    ").addClass("table-condensed")),r=[D()];return k("h")&&r.push(e),k("m")&&r.push(n),k("s")&&r.push(i),r},P=function(){var e=[];return i.showTodayButton&&e.push(t("
    ").append(t("").attr({"data-action":"today",title:i.tooltips.today}).append(t("").addClass(i.icons.today)))),!i.sideBySide&&M()&&C()&&e.push(t("").append(t("").attr({"data-action":"togglePicker",title:i.tooltips.selectTime}).append(t("").addClass(i.icons.time)))),i.showClear&&e.push(t("").append(t("").attr({"data-action":"clear",title:i.tooltips.clear}).append(t("").addClass(i.icons.clear)))),i.showClose&&e.push(t("").append(t("").attr({"data-action":"close",title:i.tooltips.close}).append(t("").addClass(i.icons.close)))),t("").addClass("table-condensed").append(t("").append(t("").append(e)))},E=function(){var e=t("
    ").addClass("bootstrap-datetimepicker-widget dropdown-menu"),n=t("
    ").addClass("datepicker").append(T()),r=t("
    ").addClass("timepicker").append(A()),o=t("
      ").addClass("list-unstyled"),a=t("
    • ").addClass("picker-switch"+(i.collapse?" accordion-toggle":"")).append(P());return i.inline&&e.removeClass("dropdown-menu"),s&&e.addClass("usetwentyfour"),k("s")&&!s&&e.addClass("wider"),i.sideBySide&&M()&&C()?(e.addClass("timepicker-sbs"),"top"===i.toolbarPlacement&&e.append(a),e.append(t("
      ").addClass("row").append(n.addClass("col-md-6")).append(r.addClass("col-md-6"))),"bottom"===i.toolbarPlacement&&e.append(a),e):("top"===i.toolbarPlacement&&o.append(a),M()&&o.append(t("
    • ").addClass(i.collapse&&C()?"collapse in":"").append(n)),"default"===i.toolbarPlacement&&o.append(a),C()&&o.append(t("
    • ").addClass(i.collapse&&M()?"collapse":"").append(r)),"bottom"===i.toolbarPlacement&&o.append(a),e.append(o))},O=function(){var e,r=(f||n).position(),o=(f||n).offset(),a=i.widgetPositioning.vertical,s=i.widgetPositioning.horizontal;if(i.widgetParent)e=i.widgetParent.append(p);else if(n.is("input"))e=n.after(p).parent();else{if(i.inline)return void(e=n.append(p));e=n,n.children().first().after(p)}if("auto"===a&&(a=o.top+1.5*p.height()>=t(window).height()+t(window).scrollTop()&&p.height()+n.outerHeight()t(window).width()?"right":"left"),"top"===a?p.addClass("top").removeClass("bottom"):p.addClass("bottom").removeClass("top"),"right"===s?p.addClass("pull-right"):p.removeClass("pull-right"),"relative"!==e.css("position")&&(e=e.parents().filter(function(){return"relative"===t(this).css("position")}).first()),0===e.length)throw new Error("datetimepicker component should be placed within a relative positioned container");p.css({top:"top"===a?"auto":r.top+n.outerHeight(),bottom:"top"===a?r.top+n.outerHeight():"auto",left:"left"===s?e===n?0:r.left:"auto",right:"left"===s?"auto":e.outerWidth()-n.outerWidth()-(e===n?0:r.left)})},L=function(t){"dp.change"===t.type&&(t.date&&t.date.isSame(t.oldDate)||!t.date&&!t.oldDate)||n.trigger(t)},I=function(t){"y"===t&&(t="YYYY"),L({type:"dp.update",change:t,viewDate:o.clone()})},N=function(t){p&&(t&&(c=Math.max(g,Math.min(3,c+t))),p.find(".datepicker > div").hide().filter(".datepicker-"+m[c].clsName).show())},F=function(){var e=t("
    "),n=o.clone().startOf("w").startOf("d");for(!0===i.calendarWeeks&&e.append(t(""),i.calendarWeeks&&n.append('"),c.push(n)),a="",e.isBefore(o,"M")&&(a+=" old"),e.isAfter(o,"M")&&(a+=" new"),e.isSame(r,"d")&&!d&&(a+=" active"),B(e,"d")||(a+=" disabled"),e.isSame(_(),"d")&&(a+=" today"),0!==e.day()&&6!==e.day()||(a+=" weekend"),n.append('"),e.add(1,"d");l.find("tbody").empty().append(c),$(),q(),U()}},G=function(){var e=p.find(".timepicker-hours table"),n=o.clone().startOf("d"),i=[],r=t("");for(o.hour()>11&&!s&&n.hour(12);n.isSame(o,"d")&&(s||o.hour()<12&&n.hour()<12||o.hour()>11);)n.hour()%4==0&&(r=t(""),i.push(r)),r.append('"),n.add(1,"h");e.empty().append(i)},X=function(){for(var e=p.find(".timepicker-minutes table"),n=o.clone().startOf("h"),r=[],a=t(""),s=1===i.stepping?5:i.stepping;o.isSame(n,"h");)n.minute()%(4*s)==0&&(a=t(""),r.push(a)),a.append('"),n.add(s,"m");e.empty().append(r)},V=function(){for(var e=p.find(".timepicker-seconds table"),n=o.clone().startOf("m"),i=[],r=t("");o.isSame(n,"m");)n.second()%20==0&&(r=t(""),i.push(r)),r.append('"),n.add(5,"s");e.empty().append(i)},Z=function(){var t,e,n=p.find(".timepicker span[data-time-component]");s||(t=p.find(".timepicker [data-action=togglePeriod]"),e=r.clone().add(r.hours()>=12?-12:12,"h"),t.text(r.format("A")),B(e,"h")?t.removeClass("disabled"):t.addClass("disabled")),n.filter("[data-time-component=hours]").text(r.format(s?"HH":"hh")),n.filter("[data-time-component=minutes]").text(r.format("mm")),n.filter("[data-time-component=seconds]").text(r.format("ss")),G(),X(),V()},K=function(){p&&(Y(),Z())},J=function(t){var e=d?null:r;if(!t)return d=!0,a.val(""),n.data("date",""),L({type:"dp.change",date:!1,oldDate:e}),void K();t=t.clone().locale(i.locale),1!==i.stepping&&t.minutes(Math.round(t.minutes()/i.stepping)*i.stepping%60).seconds(0),B(t)?(r=t,o=r.clone(),a.val(r.format(l)),n.data("date",r.format(l)),d=!1,K(),L({type:"dp.change",date:r.clone(),oldDate:e})):(i.keepInvalid||a.val(d?"":r.format(l)),L({type:"dp.error",date:t}))},Q=function(){var e=!1;return p?(p.find(".collapse").each(function(){var n=t(this).data("collapse");return!n||!n.transitioning||(e=!0,!1)}),e?h:(f&&f.hasClass("btn")&&f.toggleClass("active"),p.hide(),t(window).off("resize",O),p.off("click","[data-action]"),p.off("mousedown",!1),p.remove(),p=!1,L({type:"dp.hide",date:r.clone()}),a.blur(),h)):h},tt=function(){J(null)},et={next:function(){var t=m[c].navFnc;o.add(m[c].navStep,t),Y(),I(t)},previous:function(){var t=m[c].navFnc;o.subtract(m[c].navStep,t),Y(),I(t)},pickerSwitch:function(){N(1)},selectMonth:function(e){var n=t(e.target).closest("tbody").find("span").index(t(e.target));o.month(n),c===g?(J(r.clone().year(o.year()).month(o.month())),i.inline||Q()):(N(-1),Y()),I("M")},selectYear:function(e){var n=parseInt(t(e.target).text(),10)||0;o.year(n),c===g?(J(r.clone().year(o.year())),i.inline||Q()):(N(-1),Y()),I("YYYY")},selectDecade:function(e){var n=parseInt(t(e.target).data("selection"),10)||0;o.year(n),c===g?(J(r.clone().year(o.year())),i.inline||Q()):(N(-1),Y()),I("YYYY")},selectDay:function(e){var n=o.clone();t(e.target).is(".old")&&n.subtract(1,"M"),t(e.target).is(".new")&&n.add(1,"M"),J(n.date(parseInt(t(e.target).text(),10))),C()||i.keepOpen||i.inline||Q()},incrementHours:function(){var t=r.clone().add(1,"h");B(t,"h")&&J(t)},incrementMinutes:function(){var t=r.clone().add(i.stepping,"m");B(t,"m")&&J(t)},incrementSeconds:function(){var t=r.clone().add(1,"s");B(t,"s")&&J(t)},decrementHours:function(){var t=r.clone().subtract(1,"h");B(t,"h")&&J(t)},decrementMinutes:function(){var t=r.clone().subtract(i.stepping,"m");B(t,"m")&&J(t)},decrementSeconds:function(){var t=r.clone().subtract(1,"s");B(t,"s")&&J(t)},togglePeriod:function(){J(r.clone().add(r.hours()>=12?-12:12,"h"))},togglePicker:function(e){var n,r=t(e.target),o=r.closest("ul"),a=o.find(".in"),s=o.find(".collapse:not(.in)");if(a&&a.length){if((n=a.data("collapse"))&&n.transitioning)return;a.collapse?(a.collapse("hide"),s.collapse("show")):(a.removeClass("in"),s.addClass("in")),r.is("span")?r.toggleClass(i.icons.time+" "+i.icons.date):r.find("span").toggleClass(i.icons.time+" "+i.icons.date)}},showPicker:function(){p.find(".timepicker > div:not(.timepicker-picker)").hide(),p.find(".timepicker .timepicker-picker").show()},showHours:function(){p.find(".timepicker .timepicker-picker").hide(),p.find(".timepicker .timepicker-hours").show()},showMinutes:function(){p.find(".timepicker .timepicker-picker").hide(),p.find(".timepicker .timepicker-minutes").show()},showSeconds:function(){p.find(".timepicker .timepicker-picker").hide(),p.find(".timepicker .timepicker-seconds").show()},selectHour:function(e){var n=parseInt(t(e.target).text(),10);s||(r.hours()>=12?12!==n&&(n+=12):12===n&&(n=0)),J(r.clone().hours(n)),et.showPicker.call(h)},selectMinute:function(e){J(r.clone().minutes(parseInt(t(e.target).text(),10))),et.showPicker.call(h)},selectSecond:function(e){J(r.clone().seconds(parseInt(t(e.target).text(),10))),et.showPicker.call(h)},clear:tt,today:function(){var t=_();B(t,"d")&&J(t)},close:Q},nt=function(e){return!t(e.currentTarget).is(".disabled")&&(et[t(e.currentTarget).data("action")].apply(h,arguments),!1)},it=function(){var e,n={year:function(t){return t.month(0).date(1).hours(0).seconds(0).minutes(0)},month:function(t){return t.date(1).hours(0).seconds(0).minutes(0)},day:function(t){return t.hours(0).seconds(0).minutes(0)},hour:function(t){return t.seconds(0).minutes(0)},minute:function(t){return t.seconds(0)}};return a.prop("disabled")||!i.ignoreReadonly&&a.prop("readonly")||p?h:(void 0!==a.val()&&0!==a.val().trim().length?J(ot(a.val().trim())):i.useCurrent&&d&&(a.is("input")&&0===a.val().trim().length||i.inline)&&(e=_(),"string"==typeof i.useCurrent&&(e=n[i.useCurrent](e)),J(e)),p=E(),F(),W(),p.find(".timepicker-hours").hide(),p.find(".timepicker-minutes").hide(),p.find(".timepicker-seconds").hide(),K(),N(),t(window).on("resize",O),p.on("click","[data-action]",nt),p.on("mousedown",!1),f&&f.hasClass("btn")&&f.toggleClass("active"),p.show(),O(),i.focusOnShow&&!a.is(":focus")&&a.focus(),L({type:"dp.show"}),h)},rt=function(){return p?Q():it()},ot=function(t){return t=void 0===i.parseInputDate?e.isMoment(t)||t instanceof Date?e(t):_(t):i.parseInputDate(t),t.locale(i.locale),t},at=function(t){var e,n,r,o,a=null,s=[],l={},u=t.which;S[u]="p";for(e in S)S.hasOwnProperty(e)&&"p"===S[e]&&(s.push(e),parseInt(e,10)!==u&&(l[e]=!0));for(e in i.keyBinds)if(i.keyBinds.hasOwnProperty(e)&&"function"==typeof i.keyBinds[e]&&(r=e.split(" "),r.length===s.length&&w[u]===r[r.length-1])){for(o=!0,n=r.length-2;n>=0;n--)if(!(w[r[n]]in l)){o=!1;break}if(o){a=i.keyBinds[e];break}}a&&(a.call(h,p),t.stopPropagation(),t.preventDefault())},st=function(t){S[t.which]="r",t.stopPropagation(),t.preventDefault()},lt=function(e){var n=t(e.target).val().trim(),i=n?ot(n):null;return J(i),e.stopImmediatePropagation(),!1},ut=function(){a.off({change:lt,blur:blur,keydown:at,keyup:st,focus:i.allowInputToggle?Q:""}),n.is("input")?a.off({focus:it}):f&&(f.off("click",rt),f.off("mousedown",!1))},ct=function(e){var n={};return t.each(e,function(){var t=ot(this);t.isValid()&&(n[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(n).length&&n},ht=function(e){var n={};return t.each(e,function(){n[this]=!0}),!!Object.keys(n).length&&n},dt=function(){var t=i.format||"L LT";l=t.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return(r.localeData().longDateFormat(t)||t).replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return r.localeData().longDateFormat(t)||t})}),u=i.extraFormats?i.extraFormats.slice():[],u.indexOf(t)<0&&u.indexOf(l)<0&&u.push(l),s=l.toLowerCase().indexOf("a")<1&&l.replace(/\[.*?\]/g,"").indexOf("h")<1,k("y")&&(g=2),k("M")&&(g=1),k("d")&&(g=0),c=Math.max(g,c),d||J(r)};if(h.destroy=function(){Q(),ut(),n.removeData("DateTimePicker"),n.removeData("date")},h.toggle=rt,h.show=it,h.hide=Q,h.disable=function(){return Q(),f&&f.hasClass("btn")&&f.addClass("disabled"),a.prop("disabled",!0),h},h.enable=function(){return f&&f.hasClass("btn")&&f.removeClass("disabled"),a.prop("disabled",!1),h},h.ignoreReadonly=function(t){if(0===arguments.length)return i.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");return i.ignoreReadonly=t,h},h.options=function(e){if(0===arguments.length)return t.extend(!0,{},i);if(!(e instanceof Object))throw new TypeError("options() options parameter should be an object");return t.extend(!0,i,e),t.each(i,function(t,e){if(void 0===h[t])throw new TypeError("option "+t+" is not recognized!");h[t](e)}),h},h.date=function(t){if(0===arguments.length)return d?null:r.clone();if(!(null===t||"string"==typeof t||e.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");return J(null===t?null:ot(t)),h},h.format=function(t){if(0===arguments.length)return i.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a sting or boolean:false parameter "+t);return i.format=t,l&&dt(),h},h.timeZone=function(t){return 0===arguments.length?i.timeZone:(i.timeZone=t,h)},h.dayViewHeaderFormat=function(t){if(0===arguments.length)return i.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");return i.dayViewHeaderFormat=t,h},h.extraFormats=function(t){if(0===arguments.length)return i.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");return i.extraFormats=t,u&&dt(),h},h.disabledDates=function(e){if(0===arguments.length)return i.disabledDates?t.extend({},i.disabledDates):i.disabledDates;if(!e)return i.disabledDates=!1,K(),h;if(!(e instanceof Array))throw new TypeError("disabledDates() expects an array parameter");return i.disabledDates=ct(e),i.enabledDates=!1,K(),h},h.enabledDates=function(e){if(0===arguments.length)return i.enabledDates?t.extend({},i.enabledDates):i.enabledDates;if(!e)return i.enabledDates=!1,K(),h;if(!(e instanceof Array))throw new TypeError("enabledDates() expects an array parameter");return i.enabledDates=ct(e),i.disabledDates=!1,K(),h},h.daysOfWeekDisabled=function(t){if(0===arguments.length)return i.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return i.daysOfWeekDisabled=!1,K(),h;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(i.daysOfWeekDisabled=t.reduce(function(t,e){return(e=parseInt(e,10))>6||e<0||isNaN(e)?t:(-1===t.indexOf(e)&&t.push(e),t)},[]).sort(),i.useCurrent&&!i.keepInvalid){for(var e=0;!B(r,"d");){if(r.add(1,"d"),7===e)throw"Tried 7 times to find a valid date";e++}J(r)}return K(),h},h.maxDate=function(t){if(0===arguments.length)return i.maxDate?i.maxDate.clone():i.maxDate;if("boolean"==typeof t&&!1===t)return i.maxDate=!1,K(),h;"string"==typeof t&&("now"!==t&&"moment"!==t||(t=_()));var e=ot(t);if(!e.isValid())throw new TypeError("maxDate() Could not parse date parameter: "+t);if(i.minDate&&e.isBefore(i.minDate))throw new TypeError("maxDate() date parameter is before options.minDate: "+e.format(l));return i.maxDate=e,i.useCurrent&&!i.keepInvalid&&r.isAfter(t)&&J(i.maxDate),o.isAfter(e)&&(o=e.clone().subtract(i.stepping,"m")),K(),h},h.minDate=function(t){if(0===arguments.length)return i.minDate?i.minDate.clone():i.minDate;if("boolean"==typeof t&&!1===t)return i.minDate=!1,K(),h;"string"==typeof t&&("now"!==t&&"moment"!==t||(t=_()));var e=ot(t);if(!e.isValid())throw new TypeError("minDate() Could not parse date parameter: "+t);if(i.maxDate&&e.isAfter(i.maxDate))throw new TypeError("minDate() date parameter is after options.maxDate: "+e.format(l));return i.minDate=e,i.useCurrent&&!i.keepInvalid&&r.isBefore(t)&&J(i.minDate),o.isBefore(e)&&(o=e.clone().add(i.stepping,"m")),K(),h},h.defaultDate=function(t){if(0===arguments.length)return i.defaultDate?i.defaultDate.clone():i.defaultDate;if(!t)return i.defaultDate=!1,h;"string"==typeof t&&("now"!==t&&"moment"!==t||(t=_()));var e=ot(t);if(!e.isValid())throw new TypeError("defaultDate() Could not parse date parameter: "+t);if(!B(e))throw new TypeError("defaultDate() date passed is invalid according to component setup validations");return i.defaultDate=e,(i.defaultDate&&i.inline||""===a.val().trim())&&J(i.defaultDate),h},h.locale=function(t){if(0===arguments.length)return i.locale;if(!e.localeData(t))throw new TypeError("locale() locale "+t+" is not loaded from moment locales!");return i.locale=t,r.locale(i.locale),o.locale(i.locale),l&&dt(),p&&(Q(),it()),h},h.stepping=function(t){return 0===arguments.length?i.stepping:(t=parseInt(t,10),(isNaN(t)||t<1)&&(t=1),i.stepping=t,h)},h.useCurrent=function(t){var e=["year","month","day","hour","minute"];if(0===arguments.length)return i.useCurrent;if("boolean"!=typeof t&&"string"!=typeof t)throw new TypeError("useCurrent() expects a boolean or string parameter");if("string"==typeof t&&-1===e.indexOf(t.toLowerCase()))throw new TypeError("useCurrent() expects a string parameter of "+e.join(", "));return i.useCurrent=t,h},h.collapse=function(t){if(0===arguments.length)return i.collapse;if("boolean"!=typeof t)throw new TypeError("collapse() expects a boolean parameter");return i.collapse===t?h:(i.collapse=t,p&&(Q(),it()),h)},h.icons=function(e){if(0===arguments.length)return t.extend({},i.icons);if(!(e instanceof Object))throw new TypeError("icons() expects parameter to be an Object");return t.extend(i.icons,e),p&&(Q(),it()),h},h.tooltips=function(e){if(0===arguments.length)return t.extend({},i.tooltips);if(!(e instanceof Object))throw new TypeError("tooltips() expects parameter to be an Object");return t.extend(i.tooltips,e),p&&(Q(),it()),h},h.useStrict=function(t){if(0===arguments.length)return i.useStrict;if("boolean"!=typeof t)throw new TypeError("useStrict() expects a boolean parameter");return i.useStrict=t,h},h.sideBySide=function(t){if(0===arguments.length)return i.sideBySide;if("boolean"!=typeof t)throw new TypeError("sideBySide() expects a boolean parameter");return i.sideBySide=t,p&&(Q(),it()),h},h.viewMode=function(t){if(0===arguments.length)return i.viewMode;if("string"!=typeof t)throw new TypeError("viewMode() expects a string parameter");if(-1===v.indexOf(t))throw new TypeError("viewMode() parameter must be one of ("+v.join(", ")+") value");return i.viewMode=t,c=Math.max(v.indexOf(t),g),N(),h},h.toolbarPlacement=function(t){if(0===arguments.length)return i.toolbarPlacement;if("string"!=typeof t)throw new TypeError("toolbarPlacement() expects a string parameter");if(-1===x.indexOf(t))throw new TypeError("toolbarPlacement() parameter must be one of ("+x.join(", ")+") value");return i.toolbarPlacement=t,p&&(Q(),it()),h},h.widgetPositioning=function(e){if(0===arguments.length)return t.extend({},i.widgetPositioning);if("[object Object]"!=={}.toString.call(e))throw new TypeError("widgetPositioning() expects an object variable");if(e.horizontal){if("string"!=typeof e.horizontal)throw new TypeError("widgetPositioning() horizontal variable must be a string");if(e.horizontal=e.horizontal.toLowerCase(),-1===b.indexOf(e.horizontal))throw new TypeError("widgetPositioning() expects horizontal parameter to be one of ("+b.join(", ")+")");i.widgetPositioning.horizontal=e.horizontal}if(e.vertical){if("string"!=typeof e.vertical)throw new TypeError("widgetPositioning() vertical variable must be a string");if(e.vertical=e.vertical.toLowerCase(),-1===y.indexOf(e.vertical))throw new TypeError("widgetPositioning() expects vertical parameter to be one of ("+y.join(", ")+")");i.widgetPositioning.vertical=e.vertical}return K(),h},h.calendarWeeks=function(t){if(0===arguments.length)return i.calendarWeeks;if("boolean"!=typeof t)throw new TypeError("calendarWeeks() expects parameter to be a boolean value");return i.calendarWeeks=t,K(),h},h.showTodayButton=function(t){if(0===arguments.length)return i.showTodayButton;if("boolean"!=typeof t)throw new TypeError("showTodayButton() expects a boolean parameter");return i.showTodayButton=t,p&&(Q(),it()),h},h.showClear=function(t){if(0===arguments.length)return i.showClear;if("boolean"!=typeof t)throw new TypeError("showClear() expects a boolean parameter");return i.showClear=t,p&&(Q(),it()),h},h.widgetParent=function(e){if(0===arguments.length)return i.widgetParent;if("string"==typeof e&&(e=t(e)),null!==e&&"string"!=typeof e&&!(e instanceof t))throw new TypeError("widgetParent() expects a string or a jQuery object parameter");return i.widgetParent=e,p&&(Q(),it()),h},h.keepOpen=function(t){ -if(0===arguments.length)return i.keepOpen;if("boolean"!=typeof t)throw new TypeError("keepOpen() expects a boolean parameter");return i.keepOpen=t,h},h.focusOnShow=function(t){if(0===arguments.length)return i.focusOnShow;if("boolean"!=typeof t)throw new TypeError("focusOnShow() expects a boolean parameter");return i.focusOnShow=t,h},h.inline=function(t){if(0===arguments.length)return i.inline;if("boolean"!=typeof t)throw new TypeError("inline() expects a boolean parameter");return i.inline=t,h},h.clear=function(){return tt(),h},h.keyBinds=function(t){return i.keyBinds=t,h},h.getMoment=function(t){return _(t)},h.debug=function(t){if("boolean"!=typeof t)throw new TypeError("debug() expects a boolean parameter");return i.debug=t,h},h.allowInputToggle=function(t){if(0===arguments.length)return i.allowInputToggle;if("boolean"!=typeof t)throw new TypeError("allowInputToggle() expects a boolean parameter");return i.allowInputToggle=t,h},h.showClose=function(t){if(0===arguments.length)return i.showClose;if("boolean"!=typeof t)throw new TypeError("showClose() expects a boolean parameter");return i.showClose=t,h},h.keepInvalid=function(t){if(0===arguments.length)return i.keepInvalid;if("boolean"!=typeof t)throw new TypeError("keepInvalid() expects a boolean parameter");return i.keepInvalid=t,h},h.datepickerInput=function(t){if(0===arguments.length)return i.datepickerInput;if("string"!=typeof t)throw new TypeError("datepickerInput() expects a string parameter");return i.datepickerInput=t,h},h.parseInputDate=function(t){if(0===arguments.length)return i.parseInputDate;if("function"!=typeof t)throw new TypeError("parseInputDate() sholud be as function");return i.parseInputDate=t,h},h.disabledTimeIntervals=function(e){if(0===arguments.length)return i.disabledTimeIntervals?t.extend({},i.disabledTimeIntervals):i.disabledTimeIntervals;if(!e)return i.disabledTimeIntervals=!1,K(),h;if(!(e instanceof Array))throw new TypeError("disabledTimeIntervals() expects an array parameter");return i.disabledTimeIntervals=e,K(),h},h.disabledHours=function(e){if(0===arguments.length)return i.disabledHours?t.extend({},i.disabledHours):i.disabledHours;if(!e)return i.disabledHours=!1,K(),h;if(!(e instanceof Array))throw new TypeError("disabledHours() expects an array parameter");if(i.disabledHours=ht(e),i.enabledHours=!1,i.useCurrent&&!i.keepInvalid){for(var n=0;!B(r,"h");){if(r.add(1,"h"),24===n)throw"Tried 24 times to find a valid date";n++}J(r)}return K(),h},h.enabledHours=function(e){if(0===arguments.length)return i.enabledHours?t.extend({},i.enabledHours):i.enabledHours;if(!e)return i.enabledHours=!1,K(),h;if(!(e instanceof Array))throw new TypeError("enabledHours() expects an array parameter");if(i.enabledHours=ht(e),i.disabledHours=!1,i.useCurrent&&!i.keepInvalid){for(var n=0;!B(r,"h");){if(r.add(1,"h"),24===n)throw"Tried 24 times to find a valid date";n++}J(r)}return K(),h},h.viewDate=function(t){if(0===arguments.length)return o.clone();if(!t)return o=r.clone(),h;if(!("string"==typeof t||e.isMoment(t)||t instanceof Date))throw new TypeError("viewDate() parameter must be one of [string, moment or Date]");return o=ot(t),I(),h},n.is("input"))a=n;else if(a=n.find(i.datepickerInput),0===a.size())a=n.find("input");else if(!a.is("input"))throw new Error('CSS class "'+i.datepickerInput+'" cannot be applied to non input element');if(n.hasClass("input-group")&&(f=0===n.find(".datepickerbutton").size()?n.find(".input-group-addon"):n.find(".datepickerbutton")),!i.inline&&!a.is("input"))throw new Error("Could not initialize DateTimePicker without an input element");return r=_(),o=r.clone(),t.extend(!0,i,function(){var e,r={};return e=n.is("input")||i.inline?n.data():n.find("input").data(),e.dateOptions&&e.dateOptions instanceof Object&&(r=t.extend(!0,r,e.dateOptions)),t.each(i,function(t){var n="date"+t.charAt(0).toUpperCase()+t.slice(1);void 0!==e[n]&&(r[t]=e[n])}),r}()),h.options(i),dt(),function(){a.on({change:lt,blur:i.debug?"":Q,keydown:at,keyup:st,focus:i.allowInputToggle?it:""}),n.is("input")?a.on({focus:it}):f&&(f.on("click",rt),f.on("mousedown",!1))}(),a.prop("disabled")&&h.disable(),a.is("input")&&0!==a.val().trim().length?J(ot(a.val().trim())):i.defaultDate&&void 0===a.attr("placeholder")&&J(i.defaultDate),i.inline&&it(),h};t.fn.datetimepicker=function(e){return this.each(function(){var i=t(this);i.data("DateTimePicker")||(e=t.extend(!0,{},t.fn.datetimepicker.defaults,e),i.data("DateTimePicker",n(i,e)))})},t.fn.datetimepicker.defaults={timeZone:"Etc/UTC",format:!1,dayViewHeaderFormat:"MMMM YYYY",extraFormats:!1,stepping:1,minDate:!1,maxDate:!1,useCurrent:!0,collapse:!0,locale:e.locale(),defaultDate:!1,disabledDates:!1,enabledDates:!1,icons:{time:"glyphicon glyphicon-time",date:"glyphicon glyphicon-calendar",up:"glyphicon glyphicon-chevron-up",down:"glyphicon glyphicon-chevron-down",previous:"glyphicon glyphicon-chevron-left",next:"glyphicon glyphicon-chevron-right",today:"glyphicon glyphicon-screenshot",clear:"glyphicon glyphicon-trash",close:"glyphicon glyphicon-remove"},tooltips:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",prevMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",prevYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",prevDecade:"Previous Decade",nextDecade:"Next Decade",prevCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",togglePeriod:"Toggle Period",selectTime:"Select Time"},useStrict:!1,sideBySide:!1,daysOfWeekDisabled:!1,calendarWeeks:!1,viewMode:"days",toolbarPlacement:"default",showTodayButton:!1,showClear:!1,showClose:!1,widgetPositioning:{horizontal:"auto",vertical:"auto"},widgetParent:null,ignoreReadonly:!1,keepOpen:!1,focusOnShow:!0,inline:!1,keepInvalid:!1,datepickerInput:".datepickerinput",keyBinds:{up:function(t){if(t){var e=this.date()||this.getMoment();t.find(".datepicker").is(":visible")?this.date(e.clone().subtract(7,"d")):this.date(e.clone().add(this.stepping(),"m"))}},down:function(t){if(!t)return void this.show();var e=this.date()||this.getMoment();t.find(".datepicker").is(":visible")?this.date(e.clone().add(7,"d")):this.date(e.clone().subtract(this.stepping(),"m"))},"control up":function(t){if(t){var e=this.date()||this.getMoment();t.find(".datepicker").is(":visible")?this.date(e.clone().subtract(1,"y")):this.date(e.clone().add(1,"h"))}},"control down":function(t){if(t){var e=this.date()||this.getMoment();t.find(".datepicker").is(":visible")?this.date(e.clone().add(1,"y")):this.date(e.clone().subtract(1,"h"))}},left:function(t){if(t){var e=this.date()||this.getMoment();t.find(".datepicker").is(":visible")&&this.date(e.clone().subtract(1,"d"))}},right:function(t){if(t){var e=this.date()||this.getMoment();t.find(".datepicker").is(":visible")&&this.date(e.clone().add(1,"d"))}},pageUp:function(t){if(t){var e=this.date()||this.getMoment();t.find(".datepicker").is(":visible")&&this.date(e.clone().subtract(1,"M"))}},pageDown:function(t){if(t){var e=this.date()||this.getMoment();t.find(".datepicker").is(":visible")&&this.date(e.clone().add(1,"M"))}},enter:function(){this.hide()},escape:function(){this.hide()},"control space":function(t){t.find(".timepicker").is(":visible")&&t.find('.btn[data-action="togglePeriod"]').click()},t:function(){this.date(this.getMoment())},delete:function(){this.clear()}},debug:!1,allowInputToggle:!1,disabledTimeIntervals:!1,disabledHours:!1,enabledHours:!1,viewDate:!1}}),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t){var e=function(){if(t&&t.fn&&t.fn.select2&&t.fn.select2.amd)var e=t.fn.select2.amd;var e;return function(){if(!e||!e.requirejs){e?n=e:e={};var t,n,i;!function(e){function r(t,e){return x.call(t,e)}function o(t,e){var n,i,r,o,a,s,l,u,c,h,d,f=e&&e.split("/"),p=y.map,g=p&&p["*"]||{};if(t&&"."===t.charAt(0))if(e){for(t=t.split("/"),a=t.length-1,y.nodeIdCompat&&S.test(t[a])&&(t[a]=t[a].replace(S,"")),t=f.slice(0,f.length-1).concat(t),c=0;c0&&(t.splice(c-1,2),c-=2)}t=t.join("/")}else 0===t.indexOf("./")&&(t=t.substring(2));if((f||g)&&p){for(n=t.split("/"),c=n.length;c>0;c-=1){if(i=n.slice(0,c).join("/"),f)for(h=f.length;h>0;h-=1)if((r=p[f.slice(0,h).join("/")])&&(r=r[i])){o=r,s=c;break}if(o)break;!l&&g&&g[i]&&(l=g[i],u=c)}!o&&l&&(o=l,s=u),o&&(n.splice(0,s,o),t=n.join("/"))}return t}function a(t,n){return function(){var i=w.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),f.apply(e,i.concat([t,n]))}}function s(t){return function(e){return o(e,t)}}function l(t){return function(e){m[t]=e}}function u(t){if(r(v,t)){var n=v[t];delete v[t],b[t]=!0,d.apply(e,n)}if(!r(m,t)&&!r(b,t))throw new Error("No "+t);return m[t]}function c(t){var e,n=t?t.indexOf("!"):-1;return n>-1&&(e=t.substring(0,n),t=t.substring(n+1,t.length)),[e,t]}function h(t){return function(){return y&&y.config&&y.config[t]||{}}}var d,f,p,g,m={},v={},y={},b={},x=Object.prototype.hasOwnProperty,w=[].slice,S=/\.js$/;p=function(t,e){var n,i=c(t),r=i[0];return t=i[1],r&&(r=o(r,e),n=u(r)),r?t=n&&n.normalize?n.normalize(t,s(e)):o(t,e):(t=o(t,e),i=c(t),r=i[0],t=i[1],r&&(n=u(r))),{f:r?r+"!"+t:t,n:t,pr:r,p:n}},g={require:function(t){return a(t)},exports:function(t){var e=m[t];return void 0!==e?e:m[t]={}},module:function(t){return{id:t,uri:"",exports:m[t],config:h(t)}}},d=function(t,n,i,o){var s,c,h,d,f,y,x=[],w=typeof i;if(o=o||t,"undefined"===w||"function"===w){for(n=!n.length&&i.length?["require","exports","module"]:n,f=0;f0&&(e.call(arguments,t.prototype.constructor),r=n.prototype.constructor),r.apply(this,arguments)}function r(){this.constructor=i}var o=e(n),a=e(t);n.displayName=t.displayName,i.prototype=new r;for(var s=0;sn;n++)t[n].apply(this,e)},n.Observable=i,n.generateChars=function(t){for(var e="",n=0;t>n;n++){e+=Math.floor(36*Math.random()).toString(36)}return e},n.bind=function(t,e){return function(){t.apply(e,arguments)}},n._convertData=function(t){for(var e in t){var n=e.split("-"),i=t;if(1!==n.length){for(var r=0;r":">",'"':""","'":"'","/":"/"};return"string"!=typeof t?t:String(t).replace(/[&<>"'\/\\]/g,function(t){return e[t]})},n.appendMany=function(e,n){if("1.7"===t.fn.jquery.substr(0,3)){var i=t();t.map(n,function(t){i=i.add(t)}),n=i}e.append(n)},n}),e.define("select2/results",["jquery","./utils"],function(t,e){function n(t,e,i){this.$element=t,this.data=i,this.options=e,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('
      ');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e,e},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(e){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var i=t('
    • '),r=this.options.get("translations").get(e.message);i.append(n(r(e.args))),i[0].className+=" select2-results__message",this.$results.append(i)},n.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},n.prototype.append=function(t){this.hideLoading();var e=[];if(null==t.results||0===t.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));t.results=this.sort(t.results);for(var n=0;n0?e.first().trigger("mouseenter"):t.first().trigger("mouseenter"),this.ensureHighlightVisible()},n.prototype.setClasses=function(){var e=this;this.data.current(function(n){var i=t.map(n,function(t){return t.id.toString()});e.$results.find(".select2-results__option[aria-selected]").each(function(){var e=t(this),n=t.data(this,"data"),r=""+n.id;null!=n.element&&n.element.selected||null==n.element&&t.inArray(r,i)>-1?e.attr("aria-selected","true"):e.attr("aria-selected","false")})})},n.prototype.showLoading=function(t){this.hideLoading();var e=this.options.get("translations").get("searching"),n={disabled:!0,loading:!0,text:e(t)},i=this.option(n);i.className+=" loading-results",this.$results.prepend(i)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(e){var n=document.createElement("li");n.className="select2-results__option";var i={role:"treeitem","aria-selected":"false"};e.disabled&&(delete i["aria-selected"],i["aria-disabled"]="true"),null==e.id&&delete i["aria-selected"],null!=e._resultId&&(n.id=e._resultId),e.title&&(n.title=e.title),e.children&&(i.role="group",i["aria-label"]=e.text,delete i["aria-selected"]);for(var r in i){var o=i[r];n.setAttribute(r,o)}if(e.children){var a=t(n),s=document.createElement("strong");s.className="select2-results__group",t(s),this.template(e,s);for(var l=[],u=0;u",{class:"select2-results__options select2-results__options--nested"});d.append(l),a.append(s),a.append(d)}else this.template(e,n);return t.data(n,"data",e),n},n.prototype.bind=function(e,n){var i=this,r=e.id+"-results";this.$results.attr("id",r),e.on("results:all",function(t){i.clear(),i.append(t.data),e.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),e.on("results:append",function(t){i.append(t.data),e.isOpen()&&i.setClasses()}),e.on("query",function(t){i.hideMessages(),i.showLoading(t)}),e.on("select",function(){e.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),e.on("unselect",function(){e.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),e.on("open",function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()}),e.on("close",function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")}),e.on("results:toggle",function(){var t=i.getHighlightedResults();0!==t.length&&t.trigger("mouseup")}),e.on("results:select",function(){var t=i.getHighlightedResults();if(0!==t.length){var e=t.data("data");"true"==t.attr("aria-selected")?i.trigger("close",{}):i.trigger("select",{data:e})}}),e.on("results:previous",function(){var t=i.getHighlightedResults(),e=i.$results.find("[aria-selected]"),n=e.index(t);if(0!==n){var r=n-1;0===t.length&&(r=0);var o=e.eq(r);o.trigger("mouseenter");var a=i.$results.offset().top,s=o.offset().top,l=i.$results.scrollTop()+(s-a);0===r?i.$results.scrollTop(0):0>s-a&&i.$results.scrollTop(l)}}),e.on("results:next",function(){var t=i.getHighlightedResults(),e=i.$results.find("[aria-selected]"),n=e.index(t),r=n+1;if(!(r>=e.length)){var o=e.eq(r);o.trigger("mouseenter");var a=i.$results.offset().top+i.$results.outerHeight(!1),s=o.offset().top+o.outerHeight(!1),l=i.$results.scrollTop()+s-a;0===r?i.$results.scrollTop(0):s>a&&i.$results.scrollTop(l)}}),e.on("results:focus",function(t){t.element.addClass("select2-results__option--highlighted")}),e.on("results:message",function(t){i.displayMessage(t)}),t.fn.mousewheel&&this.$results.on("mousewheel",function(t){var e=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-e+t.deltaY,r=t.deltaY>0&&e-t.deltaY<=0,o=t.deltaY<0&&n<=i.$results.height();r?(i.$results.scrollTop(0),t.preventDefault(),t.stopPropagation()):o&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),t.preventDefault(),t.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(e){var n=t(this),r=n.data("data");return"true"===n.attr("aria-selected")?void(i.options.get("multiple")?i.trigger("unselect",{originalEvent:e,data:r}):i.trigger("close",{})):void i.trigger("select",{originalEvent:e,data:r})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(e){var n=t(this).data("data");i.getHighlightedResults().removeClass("select2-results__option--highlighted"),i.trigger("results:focus",{data:n,element:t(this)})})},n.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var t=this.getHighlightedResults();if(0!==t.length){var e=this.$results.find("[aria-selected]"),n=e.index(t),i=this.$results.offset().top,r=t.offset().top,o=this.$results.scrollTop()+(r-i),a=r-i;o-=2*t.outerHeight(!1),2>=n?this.$results.scrollTop(0):(a>this.$results.outerHeight()||0>a)&&this.$results.scrollTop(o)}},n.prototype.template=function(e,n){var i=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),o=i(e,n);null==o?n.style.display="none":"string"==typeof o?n.innerHTML=r(o):t(n).append(o)},n}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(t,e,n){function i(t,e){this.$element=t,this.options=e,i.__super__.constructor.call(this)}return e.Extend(i,e.Observable),i.prototype.render=function(){var e=t('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),this.$selection=e,e},i.prototype.bind=function(t,e){var i=this,r=(t.id,t.id+"-results");this.container=t,this.$selection.on("focus",function(t){i.trigger("focus",t)}),this.$selection.on("blur",function(t){i._handleBlur(t)}),this.$selection.on("keydown",function(t){i.trigger("keypress",t),t.which===n.SPACE&&t.preventDefault()}),t.on("results:focus",function(t){i.$selection.attr("aria-activedescendant",t.data._resultId)}),t.on("selection:update",function(t){i.update(t.data)}),t.on("open",function(){i.$selection.attr("aria-expanded","true"),i.$selection.attr("aria-owns",r),i._attachCloseHandler(t)}),t.on("close",function(){i.$selection.attr("aria-expanded","false"),i.$selection.removeAttr("aria-activedescendant"),i.$selection.removeAttr("aria-owns"),i.$selection.focus(),i._detachCloseHandler(t)}),t.on("enable",function(){i.$selection.attr("tabindex",i._tabindex)}),t.on("disable",function(){i.$selection.attr("tabindex","-1")})},i.prototype._handleBlur=function(e){var n=this;window.setTimeout(function(){document.activeElement==n.$selection[0]||t.contains(n.$selection[0],document.activeElement)||n.trigger("blur",e)},1)},i.prototype._attachCloseHandler=function(e){t(document.body).on("mousedown.select2."+e.id,function(e){var n=t(e.target),i=n.closest(".select2");t(".select2.select2-container--open").each(function(){var e=t(this);this!=i[0]&&e.data("element").select2("close")})})},i.prototype._detachCloseHandler=function(e){t(document.body).off("mousedown.select2."+e.id)},i.prototype.position=function(t,e){e.find(".selection").append(t)},i.prototype.destroy=function(){this._detachCloseHandler(this.container)},i.prototype.update=function(t){throw new Error("The `update` method must be defined in child classes.")},i}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(t,e,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,e),r.prototype.render=function(){var t=r.__super__.render.call(this);return t.addClass("select2-selection--single"),t.html(''),t},r.prototype.bind=function(t,e){var n=this;r.__super__.bind.apply(this,arguments);var i=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(t){1===t.which&&n.trigger("toggle",{originalEvent:t})}),this.$selection.on("focus",function(t){}),this.$selection.on("blur",function(t){}),t.on("focus",function(e){t.isOpen()||n.$selection.focus()}),t.on("selection:update",function(t){n.update(t.data)})},r.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},r.prototype.display=function(t,e){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(t,e))},r.prototype.selectionContainer=function(){return t("")},r.prototype.update=function(t){if(0===t.length)return void this.clear();var e=t[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(e,n);n.empty().append(i),n.prop("title",e.title||e.text)},r}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(t,e,n){function i(t,e){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,e),i.prototype.render=function(){var t=i.__super__.render.call(this);return t.addClass("select2-selection--multiple"),t.html('
        '),t},i.prototype.bind=function(e,n){var r=this;i.__super__.bind.apply(this,arguments),this.$selection.on("click",function(t){r.trigger("toggle",{originalEvent:t})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!r.options.get("disabled")){var n=t(this),i=n.parent(),o=i.data("data");r.trigger("unselect",{originalEvent:e,data:o})}})},i.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},i.prototype.display=function(t,e){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(t,e))},i.prototype.selectionContainer=function(){return t('
      • ×
      • ')},i.prototype.update=function(t){if(this.clear(),0!==t.length){for(var e=[],i=0;i1||n)return t.call(this,e);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},e}),e.define("select2/selection/allowClear",["jquery","../keys"],function(t,e){function n(){}return n.prototype.bind=function(t,e,n){var i=this;t.call(this,e,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(t){i._handleClear(t)}),e.on("keypress",function(t){i._handleKeyboardClear(t,e)})},n.prototype._handleClear=function(t,e){if(!this.options.get("disabled")){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){e.stopPropagation();for(var i=n.data("data"),r=0;r0||0===n.length)){var i=t('×');i.data("data",n),this.$selection.find(".select2-selection__rendered").prepend(i)}},n}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(t,e,n){function i(t,e,n){t.call(this,e,n)}return i.prototype.render=function(e){var n=t('');this.$searchContainer=n,this.$search=n.find("input");var i=e.call(this);return this._transferTabIndex(),i},i.prototype.bind=function(t,e,i){var r=this;t.call(this,e,i),e.on("open",function(){r.$search.trigger("focus")}),e.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")}),e.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),e.on("disable",function(){r.$search.prop("disabled",!0)}),e.on("focus",function(t){r.$search.trigger("focus")}),e.on("results:focus",function(t){r.$search.attr("aria-activedescendant",t.id)}),this.$selection.on("focusin",".select2-search--inline",function(t){r.trigger("focus",t)}),this.$selection.on("focusout",".select2-search--inline",function(t){r._handleBlur(t)}),this.$selection.on("keydown",".select2-search--inline",function(t){if(t.stopPropagation(),r.trigger("keypress",t),r._keyUpPrevented=t.isDefaultPrevented(),t.which===n.BACKSPACE&&""===r.$search.val()){var e=r.$searchContainer.prev(".select2-selection__choice");if(e.length>0){var i=e.data("data");r.searchRemoveChoice(i),t.preventDefault()}}});var o=document.documentMode,a=o&&11>=o;this.$selection.on("input.searchcheck",".select2-search--inline",function(t){return a?void r.$selection.off("input.search input.searchcheck"):void r.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(t){if(a&&"input"===t.type)return void r.$selection.off("input.search input.searchcheck");var e=t.which;e!=n.SHIFT&&e!=n.CTRL&&e!=n.ALT&&e!=n.TAB&&r.handleSearch(t)})},i.prototype._transferTabIndex=function(t){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},i.prototype.createPlaceholder=function(t,e){this.$search.attr("placeholder",e.text)},i.prototype.update=function(t,e){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),t.call(this,e),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.focus()},i.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},i.prototype.searchRemoveChoice=function(t,e){this.trigger("unselect",{data:e}),this.$search.val(e.text),this.handleSearch()},i.prototype.resizeSearch=function(){this.$search.css("width","25px");var t="";if(""!==this.$search.attr("placeholder"))t=this.$selection.find(".select2-selection__rendered").innerWidth();else{t=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",t)},i}),e.define("select2/selection/eventRelay",["jquery"],function(t){function e(){}return e.prototype.bind=function(e,n,i){var r=this,o=["open","opening","close","closing","select","selecting","unselect","unselecting"],a=["opening","closing","selecting","unselecting"];e.call(this,n,i),n.on("*",function(e,n){if(-1!==t.inArray(e,o)){n=n||{};var i=t.Event("select2:"+e,{params:n});r.$element.trigger(i),-1!==t.inArray(e,a)&&(n.prevented=i.isDefaultPrevented())}})},e}),e.define("select2/translation",["jquery","require"],function(t,e){function n(t){this.dict=t||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(t){return this.dict[t]},n.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},n._cache={},n.loadPath=function(t){if(!(t in n._cache)){var i=e(t);n._cache[t]=i}return new n(n._cache[t])},n}),e.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A", -"Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),e.define("select2/data/base",["../utils"],function(t){function e(t,n){e.__super__.constructor.call(this)}return t.Extend(e,t.Observable),e.prototype.current=function(t){throw new Error("The `current` method must be defined in child classes.")},e.prototype.query=function(t,e){throw new Error("The `query` method must be defined in child classes.")},e.prototype.bind=function(t,e){},e.prototype.destroy=function(){},e.prototype.generateResultId=function(e,n){var i=e.id+"-result-";return i+=t.generateChars(4),i+=null!=n.id?"-"+n.id.toString():"-"+t.generateChars(4)},e}),e.define("select2/data/select",["./base","../utils","jquery"],function(t,e,n){function i(t,e){this.$element=t,this.options=e,i.__super__.constructor.call(this)}return e.Extend(i,t),i.prototype.current=function(t){var e=[],i=this;this.$element.find(":selected").each(function(){var t=n(this),r=i.item(t);e.push(r)}),t(e)},i.prototype.select=function(t){var e=this;if(t.selected=!0,n(t.element).is("option"))return t.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(i){var r=[];t=[t],t.push.apply(t,i);for(var o=0;o=0){var u=r.filter(function(t){return function(){return n(this).val()==t.id}}(l)),c=this.item(u),h=n.extend(!0,{},l,c),d=this.option(h);u.replaceWith(d)}else{var f=this.option(l);if(l.children){var p=this.convertToOptions(l.children);e.appendMany(f,p)}a.push(f)}}return a},i}),e.define("select2/data/ajax",["./array","../utils","jquery"],function(t,e,n){function i(t,e){this.ajaxOptions=this._applyDefaults(e.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),i.__super__.constructor.call(this,t,e)}return e.Extend(i,t),i.prototype._applyDefaults=function(t){var e={data:function(t){return n.extend({},t,{q:t.term})},transport:function(t,e,i){var r=n.ajax(t);return r.then(e),r.fail(i),r}};return n.extend({},e,t,!0)},i.prototype.processResults=function(t){return t},i.prototype.query=function(t,e){function i(){var i=o.transport(o,function(i){var o=r.processResults(i,t);r.options.get("debug")&&window.console&&console.error&&(o&&o.results&&n.isArray(o.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),e(o)},function(){i.status&&"0"===i.status||r.trigger("results:message",{message:"errorLoading"})});r._request=i}var r=this;null!=this._request&&(n.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var o=n.extend({type:"GET"},this.ajaxOptions);"function"==typeof o.url&&(o.url=o.url.call(this.$element,t)),"function"==typeof o.data&&(o.data=o.data.call(this.$element,t)),this.ajaxOptions.delay&&null!=t.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(i,this.ajaxOptions.delay)):i()},i}),e.define("select2/data/tags",["jquery"],function(t){function e(e,n,i){var r=i.get("tags"),o=i.get("createTag");void 0!==o&&(this.createTag=o);var a=i.get("insertTag");if(void 0!==a&&(this.insertTag=a),e.call(this,n,i),t.isArray(r))for(var s=0;s0&&e.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:e.term,params:e}}):void t.call(this,e,n)},t}),e.define("select2/data/maximumSelectionLength",[],function(){function t(t,e,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),t.call(this,e,n)}return t.prototype.query=function(t,e,n){var i=this;this.current(function(r){var o=null!=r?r.length:0;return i.maximumSelectionLength>0&&o>=i.maximumSelectionLength?void i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):void t.call(i,e,n)})},t}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(t,e){this.$element=t,this.options=e,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$dropdown=e,e},n.prototype.bind=function(){},n.prototype.position=function(t,e){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(t,e){function n(){}return n.prototype.render=function(e){var n=e.call(this),i=t('');return this.$searchContainer=i,this.$search=i.find("input"),n.prepend(i),n},n.prototype.bind=function(e,n,i){var r=this;e.call(this,n,i),this.$search.on("keydown",function(t){r.trigger("keypress",t),r._keyUpPrevented=t.isDefaultPrevented()}),this.$search.on("input",function(e){t(this).off("keyup")}),this.$search.on("keyup input",function(t){r.handleSearch(t)}),n.on("open",function(){r.$search.attr("tabindex",0),r.$search.focus(),window.setTimeout(function(){r.$search.focus()},0)}),n.on("close",function(){r.$search.attr("tabindex",-1),r.$search.val("")}),n.on("focus",function(){n.isOpen()&&r.$search.focus()}),n.on("results:all",function(t){if(null==t.query.term||""===t.query.term){r.showSearch(t)?r.$searchContainer.removeClass("select2-search--hide"):r.$searchContainer.addClass("select2-search--hide")}})},n.prototype.handleSearch=function(t){if(!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},n.prototype.showSearch=function(t,e){return!0},n}),e.define("select2/dropdown/hidePlaceholder",[],function(){function t(t,e,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),t.call(this,e,n,i)}return t.prototype.append=function(t,e){e.results=this.removePlaceholder(e.results),t.call(this,e)},t.prototype.normalizePlaceholder=function(t,e){return"string"==typeof e&&(e={id:"",text:e}),e},t.prototype.removePlaceholder=function(t,e){for(var n=e.slice(0),i=e.length-1;i>=0;i--){var r=e[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},t}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(t){function e(t,e,n,i){this.lastParams={},t.call(this,e,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(t,e){this.$loadingMore.remove(),this.loading=!1,t.call(this,e),this.showLoadingMore(e)&&this.$results.append(this.$loadingMore)},e.prototype.bind=function(e,n,i){var r=this;e.call(this,n,i),n.on("query",function(t){r.lastParams=t,r.loading=!0}),n.on("query:append",function(t){r.lastParams=t,r.loading=!0}),this.$results.on("scroll",function(){var e=t.contains(document.documentElement,r.$loadingMore[0]);if(!r.loading&&e){r.$results.offset().top+r.$results.outerHeight(!1)+50>=r.$loadingMore.offset().top+r.$loadingMore.outerHeight(!1)&&r.loadMore()}})},e.prototype.loadMore=function(){this.loading=!0;var e=t.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(t,e){return e.pagination&&e.pagination.more},e.prototype.createLoadingMore=function(){var e=t('
      • '),n=this.options.get("translations").get("loadingMore");return e.html(n(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(t,e){function n(e,n,i){this.$dropdownParent=i.get("dropdownParent")||t(document.body),e.call(this,n,i)}return n.prototype.bind=function(t,e,n){var i=this,r=!1;t.call(this,e,n),e.on("open",function(){i._showDropdown(),i._attachPositioningHandler(e),r||(r=!0,e.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),e.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}))}),e.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(e)}),this.$dropdownContainer.on("mousedown",function(t){t.stopPropagation()})},n.prototype.destroy=function(t){t.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(t,e,n){e.attr("class",n.attr("class")),e.removeClass("select2"),e.addClass("select2-container--open"),e.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(e){var n=t(""),i=e.call(this);return n.append(i),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(t){this.$dropdownContainer.detach()},n.prototype._attachPositioningHandler=function(n,i){var r=this,o="scroll.select2."+i.id,a="resize.select2."+i.id,s="orientationchange.select2."+i.id,l=this.$container.parents().filter(e.hasScroll);l.each(function(){t(this).data("select2-scroll-position",{x:t(this).scrollLeft(),y:t(this).scrollTop()})}),l.on(o,function(e){var n=t(this).data("select2-scroll-position");t(this).scrollTop(n.y)}),t(window).on(o+" "+a+" "+s,function(t){r._positionDropdown(),r._resizeDropdown()})},n.prototype._detachPositioningHandler=function(n,i){var r="scroll.select2."+i.id,o="resize.select2."+i.id,a="orientationchange.select2."+i.id;this.$container.parents().filter(e.hasScroll).off(r),t(window).off(r+" "+o+" "+a)},n.prototype._positionDropdown=function(){var e=t(window),n=this.$dropdown.hasClass("select2-dropdown--above"),i=this.$dropdown.hasClass("select2-dropdown--below"),r=null,o=this.$container.offset();o.bottom=o.top+this.$container.outerHeight(!1);var a={height:this.$container.outerHeight(!1)};a.top=o.top,a.bottom=o.top+a.height;var s={height:this.$dropdown.outerHeight(!1)},l={top:e.scrollTop(),bottom:e.scrollTop()+e.height()},u=l.topo.bottom+s.height,h={left:o.left,top:a.bottom},d=this.$dropdownParent;"static"===d.css("position")&&(d=d.offsetParent());var f=d.offset();h.top-=f.top,h.left-=f.left,n||i||(r="below"),c||!u||n?!u&&c&&n&&(r="below"):r="above",("above"==r||n&&"below"!==r)&&(h.top=a.top-f.top-s.height),null!=r&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+r),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+r)),this.$dropdownContainer.css(h)},n.prototype._resizeDropdown=function(){var t={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(t.minWidth=t.width,t.position="relative",t.width="auto"),this.$dropdown.css(t)},n.prototype._showDropdown=function(t){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function t(e){for(var n=0,i=0;i0&&(h.dataAdapter=u.Decorate(h.dataAdapter,v)),h.maximumInputLength>0&&(h.dataAdapter=u.Decorate(h.dataAdapter,y)),h.maximumSelectionLength>0&&(h.dataAdapter=u.Decorate(h.dataAdapter,b)),h.tags&&(h.dataAdapter=u.Decorate(h.dataAdapter,g)),(null!=h.tokenSeparators||null!=h.tokenizer)&&(h.dataAdapter=u.Decorate(h.dataAdapter,m)),null!=h.query){var D=e(h.amdBase+"compat/query");h.dataAdapter=u.Decorate(h.dataAdapter,D)}if(null!=h.initSelection){var A=e(h.amdBase+"compat/initSelection");h.dataAdapter=u.Decorate(h.dataAdapter,A)}}if(null==h.resultsAdapter&&(h.resultsAdapter=n,null!=h.ajax&&(h.resultsAdapter=u.Decorate(h.resultsAdapter,_)),null!=h.placeholder&&(h.resultsAdapter=u.Decorate(h.resultsAdapter,S)),h.selectOnClose&&(h.resultsAdapter=u.Decorate(h.resultsAdapter,M))),null==h.dropdownAdapter){if(h.multiple)h.dropdownAdapter=x;else{var P=u.Decorate(x,w);h.dropdownAdapter=P}if(0!==h.minimumResultsForSearch&&(h.dropdownAdapter=u.Decorate(h.dropdownAdapter,C)),h.closeOnSelect&&(h.dropdownAdapter=u.Decorate(h.dropdownAdapter,T)),null!=h.dropdownCssClass||null!=h.dropdownCss||null!=h.adaptDropdownCssClass){var E=e(h.amdBase+"compat/dropdownCss");h.dropdownAdapter=u.Decorate(h.dropdownAdapter,E)}h.dropdownAdapter=u.Decorate(h.dropdownAdapter,k)}if(null==h.selectionAdapter){if(h.multiple?h.selectionAdapter=r:h.selectionAdapter=i,null!=h.placeholder&&(h.selectionAdapter=u.Decorate(h.selectionAdapter,o)),h.allowClear&&(h.selectionAdapter=u.Decorate(h.selectionAdapter,a)),h.multiple&&(h.selectionAdapter=u.Decorate(h.selectionAdapter,s)),null!=h.containerCssClass||null!=h.containerCss||null!=h.adaptContainerCssClass){var O=e(h.amdBase+"compat/containerCss");h.selectionAdapter=u.Decorate(h.selectionAdapter,O)}h.selectionAdapter=u.Decorate(h.selectionAdapter,l)}if("string"==typeof h.language)if(h.language.indexOf("-")>0){var L=h.language.split("-"),I=L[0];h.language=[h.language,I]}else h.language=[h.language];if(t.isArray(h.language)){var N=new c;h.language.push("en");for(var F=h.language,R=0;R0){for(var o=t.extend(!0,{},r),a=r.children.length-1;a>=0;a--){null==n(i,r.children[a])&&o.children.splice(a,1)}return o.children.length>0?o:n(i,o)}var s=e(r.text).toUpperCase(),l=e(i.term).toUpperCase();return s.indexOf(l)>-1?r:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:u.escapeMarkup,language:D,matcher:n,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(t){return t},templateResult:function(t){return t.text},templateSelection:function(t){return t.text},theme:"default",width:"resolve"}},A.prototype.set=function(e,n){var i=t.camelCase(e),r={};r[i]=n;var o=u._convertData(r);t.extend(this.defaults,o)},new A}),e.define("select2/options",["require","jquery","./defaults","./utils"],function(t,e,n,i){function r(e,r){if(this.options=e,null!=r&&this.fromElement(r),this.options=n.apply(this.options),r&&r.is("input")){var o=t(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=i.Decorate(this.options.dataAdapter,o)}}return r.prototype.fromElement=function(t){var n=["select2"];null==this.options.multiple&&(this.options.multiple=t.prop("multiple")),null==this.options.disabled&&(this.options.disabled=t.prop("disabled")),null==this.options.language&&(t.prop("lang")?this.options.language=t.prop("lang").toLowerCase():t.closest("[lang]").prop("lang")&&(this.options.language=t.closest("[lang]").prop("lang"))),null==this.options.dir&&(t.prop("dir")?this.options.dir=t.prop("dir"):t.closest("[dir]").prop("dir")?this.options.dir=t.closest("[dir]").prop("dir"):this.options.dir="ltr"),t.prop("disabled",this.options.disabled),t.prop("multiple",this.options.multiple),t.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),t.data("data",t.data("select2Tags")),t.data("tags",!0)),t.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),t.attr("ajax--url",t.data("ajaxUrl")),t.data("ajax--url",t.data("ajaxUrl")));var r={};r=e.fn.jquery&&"1."==e.fn.jquery.substr(0,2)&&t[0].dataset?e.extend(!0,{},t[0].dataset,t.data()):t.data();var o=e.extend(!0,{},r);o=i._convertData(o);for(var a in o)e.inArray(a,n)>-1||(e.isPlainObject(this.options[a])?e.extend(this.options[a],o[a]):this.options[a]=o[a]);return this},r.prototype.get=function(t){return this.options[t]},r.prototype.set=function(t,e){this.options[t]=e},r}),e.define("select2/core",["jquery","./options","./utils","./keys"],function(t,e,n,i){var r=function(t,n){null!=t.data("select2")&&t.data("select2").destroy(),this.$element=t,this.id=this._generateId(t),n=n||{},this.options=new e(n,t),r.__super__.constructor.call(this);var i=t.attr("tabindex")||0;t.data("old-tabindex",i),t.attr("tabindex","-1");var o=this.options.get("dataAdapter");this.dataAdapter=new o(t,this.options);var a=this.render();this._placeContainer(a);var s=this.options.get("selectionAdapter");this.selection=new s(t,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,a);var l=this.options.get("dropdownAdapter");this.dropdown=new l(t,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,a);var u=this.options.get("resultsAdapter");this.results=new u(t,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var c=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(), -this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(t){c.trigger("selection:update",{data:t})}),t.addClass("select2-hidden-accessible"),t.attr("aria-hidden","true"),this._syncAttributes(),t.data("select2",this)};return n.Extend(r,n.Observable),r.prototype._generateId=function(t){var e="";return e=null!=t.attr("id")?t.attr("id"):null!=t.attr("name")?t.attr("name")+"-"+n.generateChars(2):n.generateChars(4),e=e.replace(/(:|\.|\[|\]|,)/g,""),e="select2-"+e},r.prototype._placeContainer=function(t){t.insertAfter(this.$element);var e=this._resolveWidth(this.$element,this.options.get("width"));null!=e&&t.css("width",e)},r.prototype._resolveWidth=function(t,e){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==e){var i=this._resolveWidth(t,"style");return null!=i?i:this._resolveWidth(t,"element")}if("element"==e){var r=t.outerWidth(!1);return 0>=r?"auto":r+"px"}if("style"==e){var o=t.attr("style");if("string"!=typeof o)return null;for(var a=o.split(";"),s=0,l=a.length;l>s;s+=1){var u=a[s].replace(/\s/g,""),c=u.match(n);if(null!==c&&c.length>=1)return c[1]}return null}return e},r.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},r.prototype._registerDomEvents=function(){var e=this;this.$element.on("change.select2",function(){e.dataAdapter.current(function(t){e.trigger("selection:update",{data:t})})}),this.$element.on("focus.select2",function(t){e.trigger("focus",t)}),this._syncA=n.bind(this._syncAttributes,this),this._syncS=n.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=i?(this._observer=new i(function(n){t.each(n,e._syncA),t.each(n,e._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",e._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",e._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",e._syncS,!1))},r.prototype._registerDataEvents=function(){var t=this;this.dataAdapter.on("*",function(e,n){t.trigger(e,n)})},r.prototype._registerSelectionEvents=function(){var e=this,n=["toggle","focus"];this.selection.on("toggle",function(){e.toggleDropdown()}),this.selection.on("focus",function(t){e.focus(t)}),this.selection.on("*",function(i,r){-1===t.inArray(i,n)&&e.trigger(i,r)})},r.prototype._registerDropdownEvents=function(){var t=this;this.dropdown.on("*",function(e,n){t.trigger(e,n)})},r.prototype._registerResultsEvents=function(){var t=this;this.results.on("*",function(e,n){t.trigger(e,n)})},r.prototype._registerEvents=function(){var t=this;this.on("open",function(){t.$container.addClass("select2-container--open")}),this.on("close",function(){t.$container.removeClass("select2-container--open")}),this.on("enable",function(){t.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){t.$container.addClass("select2-container--disabled")}),this.on("blur",function(){t.$container.removeClass("select2-container--focus")}),this.on("query",function(e){t.isOpen()||t.trigger("open",{}),this.dataAdapter.query(e,function(n){t.trigger("results:all",{data:n,query:e})})}),this.on("query:append",function(e){this.dataAdapter.query(e,function(n){t.trigger("results:append",{data:n,query:e})})}),this.on("keypress",function(e){var n=e.which;t.isOpen()?n===i.ESC||n===i.TAB||n===i.UP&&e.altKey?(t.close(),e.preventDefault()):n===i.ENTER?(t.trigger("results:select",{}),e.preventDefault()):n===i.SPACE&&e.ctrlKey?(t.trigger("results:toggle",{}),e.preventDefault()):n===i.UP?(t.trigger("results:previous",{}),e.preventDefault()):n===i.DOWN&&(t.trigger("results:next",{}),e.preventDefault()):(n===i.ENTER||n===i.SPACE||n===i.DOWN&&e.altKey)&&(t.open(),e.preventDefault())})},r.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},r.prototype._syncSubtree=function(t,e){var n=!1,i=this;if(!t||!t.target||"OPTION"===t.target.nodeName||"OPTGROUP"===t.target.nodeName){if(e)if(e.addedNodes&&e.addedNodes.length>0)for(var r=0;r0&&(n=!0);else n=!0;n&&this.dataAdapter.current(function(t){i.trigger("selection:update",{data:t})})}},r.prototype.trigger=function(t,e){var n=r.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===e&&(e={}),t in i){var o=i[t],a={prevented:!1,name:t,args:e};if(n.call(this,o,a),a.prevented)return void(e.prevented=!0)}n.call(this,t,e)},r.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},r.prototype.open=function(){this.isOpen()||this.trigger("query",{})},r.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},r.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},r.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},r.prototype.focus=function(t){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},r.prototype.enable=function(t){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==t||0===t.length)&&(t=[!0]);var e=!t[0];this.$element.prop("disabled",e)},r.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},r.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();var n=e[0];t.isArray(n)&&(n=t.map(n,function(t){return t.toString()})),this.$element.val(n).trigger("change")},r.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},r.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),e.data("element",this.$element),e},r}),e.define("jquery-mousewheel",["jquery"],function(t){return t}),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(t,e,n,i){if(null==t.fn.select2){var r=["open","close","destroy"];t.fn.select2=function(e){if("object"==typeof(e=e||{}))return this.each(function(){var i=t.extend(!0,{},e);new n(t(this),i)}),this;if("string"==typeof e){var i,o=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=t(this).data("select2");null==n&&window.console&&console.error&&console.error("The select2('"+e+"') method was called on an element that is not using Select2."),i=n[e].apply(n,o)}),t.inArray(e,r)>-1?this:i}throw new Error("Invalid arguments for Select2: "+e)}}return null==t.fn.select2.defaults&&(t.fn.select2.defaults=i),n}),{define:e.define,require:e.require}}(),n=e.require("jquery.select2");return t.fn.select2.amd=e,n}),function(t,e,n){"use strict";!function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){n(1),n(50),n(51),n(52),n(54),n(55),n(58),n(59),n(60),n(61),n(62),n(63),n(64),n(65),n(66),n(68),n(70),n(72),n(74),n(77),n(78),n(79),n(83),n(86),n(87),n(88),n(89),n(91),n(92),n(93),n(94),n(95),n(97),n(99),n(100),n(101),n(103),n(104),n(105),n(107),n(108),n(109),n(111),n(112),n(113),n(114),n(115),n(116),n(117),n(118),n(119),n(120),n(121),n(122),n(123),n(124),n(126),n(130),n(131),n(132),n(133),n(137),n(139),n(140),n(141),n(142),n(143),n(144),n(145),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(158),n(159),n(161),n(162),n(163),n(167),n(168),n(169),n(170),n(171),n(173),n(174),n(175),n(176),n(179),n(181),n(182),n(183),n(185),n(187),n(189),n(190),n(191),n(193),n(194),n(195),n(196),n(203),n(206),n(207),n(209),n(210),n(211),n(212),n(213),n(214),n(215),n(216),n(217),n(218),n(219),n(220),n(222),n(223),n(224),n(225),n(226),n(227),n(228),n(229),n(231),n(234),n(235),n(237),n(238),n(239),n(240),n(241),n(242),n(243),n(244),n(245),n(246),n(247),n(249),n(250),n(251),n(252),n(253),n(254),n(255),n(256),n(258),n(259),n(261),n(262),n(263),n(264),n(267),n(268),n(269),n(270),n(271),n(272),n(273),n(274),n(276),n(277),n(278),n(279),n(280),n(281),n(282),n(283),n(284),n(285),n(286),n(287),n(288),n(291),n(156),n(293),n(292),n(294),n(295),n(296),n(297),n(298),n(300),n(301),n(302),n(304),t.exports=n(305)},function(t,e,i){var r=i(2),o=i(3),a=i(4),s=i(6),l=i(16),u=i(20).KEY,c=i(5),h=i(21),d=i(22),f=i(17),p=i(23),g=i(24),m=i(25),v=i(27),y=i(40),b=i(43),x=i(10),w=i(30),S=i(14),_=i(15),k=i(44),C=i(47),M=i(49),T=i(9),D=i(28),A=M.f,P=T.f,E=C.f,O=r.Symbol,L=r.JSON,I=L&&L.stringify,N="prototype",F=p("_hidden"),R=p("toPrimitive"),j={}.propertyIsEnumerable,H=h("symbol-registry"),z=h("symbols"),B=h("op-symbols"),W=Object[N],$="function"==typeof O,q=r.QObject,U=!q||!q[N]||!q[N].findChild,Y=a&&c(function(){return 7!=k(P({},"a",{get:function(){return P(this,"a",{value:7}).a}})).a})?function(t,e,n){var i=A(W,e);i&&delete W[e],P(t,e,n),i&&t!==W&&P(W,e,i)}:P,G=function(t){var e=z[t]=k(O[N]);return e._k=t,e},X=$&&"symbol"==typeof O.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof O},V=function(t,e,n){return t===W&&V(B,e,n),x(t),e=S(e,!0),x(n),o(z,e)?(n.enumerable?(o(t,F)&&t[F][e]&&(t[F][e]=!1),n=k(n,{enumerable:_(0,!1)})):(o(t,F)||P(t,F,_(1,{})),t[F][e]=!0),Y(t,e,n)):P(t,e,n)},Z=function(t,e){x(t);for(var n,i=y(e=w(e)),r=0,o=i.length;o>r;)V(t,n=i[r++],e[n]);return t},K=function(t,e){return e===n?k(t):Z(k(t),e)},J=function(t){var e=j.call(this,t=S(t,!0));return!(this===W&&o(z,t)&&!o(B,t))&&(!(e||!o(this,t)||!o(z,t)||o(this,F)&&this[F][t])||e)},Q=function(t,e){if(t=w(t),e=S(e,!0),t!==W||!o(z,e)||o(B,e)){var n=A(t,e);return!n||!o(z,e)||o(t,F)&&t[F][e]||(n.enumerable=!0),n}},tt=function(t){for(var e,n=E(w(t)),i=[],r=0;n.length>r;)o(z,e=n[r++])||e==F||e==u||i.push(e);return i},et=function(t){for(var e,n=t===W,i=E(n?B:w(t)),r=[],a=0;i.length>a;)!o(z,e=i[a++])||n&&!o(W,e)||r.push(z[e]);return r};$||(O=function(){if(this instanceof O)throw TypeError("Symbol is not a constructor!");var t=f(arguments.length>0?arguments[0]:n),e=function(n){this===W&&e.call(B,n),o(this,F)&&o(this[F],t)&&(this[F][t]=!1),Y(this,t,_(1,n))};return a&&U&&Y(W,t,{configurable:!0,set:e}),G(t)},l(O[N],"toString",function(){return this._k}),M.f=Q,T.f=V,i(48).f=C.f=tt,i(42).f=J,i(41).f=et,a&&!i(26)&&l(W,"propertyIsEnumerable",J,!0),g.f=function(t){return G(p(t))}),s(s.G+s.W+s.F*!$,{Symbol:O});for(var nt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),it=0;nt.length>it;)p(nt[it++]);for(var nt=D(p.store),it=0;nt.length>it;)m(nt[it++]);s(s.S+s.F*!$,"Symbol",{for:function(t){return o(H,t+="")?H[t]:H[t]=O(t)},keyFor:function(t){if(X(t))return v(H,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){U=!0},useSimple:function(){U=!1}}),s(s.S+s.F*!$,"Object",{create:K,defineProperty:V,defineProperties:Z,getOwnPropertyDescriptor:Q,getOwnPropertyNames:tt,getOwnPropertySymbols:et}),L&&s(s.S+s.F*(!$||c(function(){var t=O();return"[null]"!=I([t])||"{}"!=I({a:t})||"{}"!=I(Object(t))})),"JSON",{stringify:function(t){if(t!==n&&!X(t)){for(var e,i,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);return e=r[1],"function"==typeof e&&(i=e),!i&&b(e)||(e=function(t,e){if(i&&(e=i.call(this,t,e)),!X(e))return e}),r[1]=e,I.apply(L,r)}}}),O[N][R]||i(8)(O[N],R,O[N].valueOf),d(O,"Symbol"),d(Math,"Math",!0),d(r.JSON,"JSON",!0)},function(t,n){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof e&&(e=i)},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){t.exports=!n(5)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,i){var r=i(2),o=i(7),a=i(8),s=i(16),l=i(18),u="prototype",c=function(t,e,i){var h,d,f,p,g=t&c.F,m=t&c.G,v=t&c.S,y=t&c.P,b=t&c.B,x=m?r:v?r[e]||(r[e]={}):(r[e]||{})[u],w=m?o:o[e]||(o[e]={}),S=w[u]||(w[u]={});m&&(i=e);for(h in i)d=!g&&x&&x[h]!==n,f=(d?x:i)[h],p=b&&d?l(f,r):y&&"function"==typeof f?l(Function.call,f):f,x&&s(x,h,f,t&c.U),w[h]!=f&&a(w,h,p),y&&S[h]!=f&&(S[h]=f)};r.core=o,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(e,n){var i=e.exports={version:"2.4.0"};"number"==typeof t&&(t=i)},function(t,e,n){var i=n(9),r=n(15);t.exports=n(4)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var i=n(10),r=n(12),o=n(14),a=Object.defineProperty;e.f=n(4)?Object.defineProperty:function(t,e,n){if(i(t),e=o(e,!0),i(n),r)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var i=n(11);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){t.exports=!n(4)&&!n(5)(function(){return 7!=Object.defineProperty(n(13)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var i=n(11),r=n(2).document,o=i(r)&&i(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},function(t,e,n){var i=n(11);t.exports=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var i=n(2),r=n(8),o=n(3),a=n(17)("src"),s="toString",l=Function[s],u=(""+l).split(s);n(7).inspectSource=function(t){return l.call(t)},(t.exports=function(t,e,n,s){var l="function"==typeof n;l&&(o(n,"name")||r(n,"name",e)),t[e]!==n&&(l&&(o(n,a)||r(n,a,t[e]?""+t[e]:u.join(String(e)))),t===i?t[e]=n:s?t[e]?t[e]=n:r(t,e,n):(delete t[e],r(t,e,n)))})(Function.prototype,s,function(){return"function"==typeof this&&this[a]||l.call(this)})},function(t,e){var i=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(t===n?"":t,")_",(++i+r).toString(36))}},function(t,e,i){var r=i(19);t.exports=function(t,e,i){if(r(t),e===n)return t;switch(i){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var i=n(17)("meta"),r=n(11),o=n(3),a=n(9).f,s=0,l=Object.isExtensible||function(){return!0},u=!n(5)(function(){return l(Object.preventExtensions({}))}),c=function(t){a(t,i,{value:{i:"O"+ ++s,w:{}}})},h=function(t,e){if(!r(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,i)){if(!l(t))return"F";if(!e)return"E";c(t)}return t[i].i},d=function(t,e){if(!o(t,i)){if(!l(t))return!0;if(!e)return!1;c(t)}return t[i].w},f=function(t){return u&&p.NEED&&l(t)&&!o(t,i)&&c(t),t},p=t.exports={KEY:i,NEED:!1,fastKey:h,getWeak:d,onFreeze:f}},function(t,e,n){var i=n(2),r="__core-js_shared__",o=i[r]||(i[r]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e,n){var i=n(9).f,r=n(3),o=n(23)("toStringTag");t.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,o)&&i(t,o,{configurable:!0,value:e})}},function(t,e,n){var i=n(21)("wks"),r=n(17),o=n(2).Symbol,a="function"==typeof o;(t.exports=function(t){return i[t]||(i[t]=a&&o[t]||(a?o:r)("Symbol."+t))}).store=i},function(t,e,n){e.f=n(23)},function(t,e,n){var i=n(2),r=n(7),o=n(26),a=n(24),s=n(9).f;t.exports=function(t){var e=r.Symbol||(r.Symbol=o?{}:i.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},function(t,e){t.exports=!1},function(t,e,n){var i=n(28),r=n(30);t.exports=function(t,e){for(var n,o=r(t),a=i(o),s=a.length,l=0;s>l;)if(o[n=a[l++]]===e)return n}},function(t,e,n){var i=n(29),r=n(39);t.exports=Object.keys||function(t){return i(t,r)}},function(t,e,n){var i=n(3),r=n(30),o=n(34)(!1),a=n(38)("IE_PROTO");t.exports=function(t,e){var n,s=r(t),l=0,u=[];for(n in s)n!=a&&i(s,n)&&u.push(n);for(;e.length>l;)i(s,n=e[l++])&&(~o(u,n)||u.push(n));return u}},function(t,e,n){var i=n(31),r=n(33);t.exports=function(t){return i(r(t))}},function(t,e,n){var i=n(32);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(t==n)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var i=n(30),r=n(35),o=n(37);t.exports=function(t){return function(e,n,a){var s,l=i(e),u=r(l.length),c=o(a,u);if(t&&n!=n){for(;u>c;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===n)return t||c||0;return!t&&-1}}},function(t,e,n){var i=n(36),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},function(t,e,n){var i=n(36),r=Math.max,o=Math.min;t.exports=function(t,e){return t=i(t),t<0?r(t+e,0):o(t,e)}},function(t,e,n){var i=n(21)("keys"),r=n(17);t.exports=function(t){return i[t]||(i[t]=r(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var i=n(28),r=n(41),o=n(42);t.exports=function(t){var e=i(t),n=r.f;if(n)for(var a,s=n(t),l=o.f,u=0;s.length>u;)l.call(t,a=s[u++])&&e.push(a);return e}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var i=n(32);t.exports=Array.isArray||function(t){return"Array"==i(t)}},function(t,e,i){var r=i(10),o=i(45),a=i(39),s=i(38)("IE_PROTO"),l=function(){},u="prototype",c=function(){var t,e=i(13)("iframe"),n=a.length;for(e.style.display="none",i(46).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("
        ").addClass("cw").text("#"));n.isBefore(o.clone().endOf("w"));)e.append(t("").addClass("dow").text(n.format("dd"))),n.add(1,"d");p.find(".datepicker-days thead").append(e)},R=function(t){return!0===i.disabledDates[t.format("YYYY-MM-DD")]},j=function(t){return!0===i.enabledDates[t.format("YYYY-MM-DD")]},H=function(t){return!0===i.disabledHours[t.format("H")]},z=function(t){return!0===i.enabledHours[t.format("H")]},B=function(e,n){if(!e.isValid())return!1;if(i.disabledDates&&"d"===n&&R(e))return!1;if(i.enabledDates&&"d"===n&&!j(e))return!1;if(i.minDate&&e.isBefore(i.minDate,n))return!1;if(i.maxDate&&e.isAfter(i.maxDate,n))return!1;if(i.daysOfWeekDisabled&&"d"===n&&-1!==i.daysOfWeekDisabled.indexOf(e.day()))return!1;if(i.disabledHours&&("h"===n||"m"===n||"s"===n)&&H(e))return!1;if(i.enabledHours&&("h"===n||"m"===n||"s"===n)&&!z(e))return!1;if(i.disabledTimeIntervals&&("h"===n||"m"===n||"s"===n)){var r=!1;if(t.each(i.disabledTimeIntervals,function(){if(e.isBetween(this[0],this[1]))return r=!0,!1}),r)return!1}return!0},W=function(){for(var e=[],n=o.clone().startOf("y").startOf("d");n.isSame(o,"y");)e.push(t("").attr("data-action","selectMonth").addClass("month").text(n.format("MMM"))),n.add(1,"M");p.find(".datepicker-months td").empty().append(e)},$=function(){var e=p.find(".datepicker-months"),n=e.find("th"),a=e.find("tbody").find("span");n.eq(0).find("span").attr("title",i.tooltips.prevYear),n.eq(1).attr("title",i.tooltips.selectYear),n.eq(2).find("span").attr("title",i.tooltips.nextYear),e.find(".disabled").removeClass("disabled"),B(o.clone().subtract(1,"y"),"y")||n.eq(0).addClass("disabled"),n.eq(1).text(o.year()),B(o.clone().add(1,"y"),"y")||n.eq(2).addClass("disabled"),a.removeClass("active"),r.isSame(o,"y")&&!d&&a.eq(r.month()).addClass("active"),a.each(function(e){B(o.clone().month(e),"M")||t(this).addClass("disabled")})},q=function(){var t=p.find(".datepicker-years"),e=t.find("th"),n=o.clone().subtract(5,"y"),a=o.clone().add(6,"y"),s="";for(e.eq(0).find("span").attr("title",i.tooltips.prevDecade),e.eq(1).attr("title",i.tooltips.selectDecade),e.eq(2).find("span").attr("title",i.tooltips.nextDecade),t.find(".disabled").removeClass("disabled"),i.minDate&&i.minDate.isAfter(n,"y")&&e.eq(0).addClass("disabled"),e.eq(1).text(n.year()+"-"+a.year()),i.maxDate&&i.maxDate.isBefore(a,"y")&&e.eq(2).addClass("disabled");!n.isAfter(a,"y");)s+=''+n.year()+"",n.add(1,"y");t.find("td").html(s)},U=function(){var t=p.find(".datepicker-decades"),n=t.find("th"),a=e({y:o.year()-o.year()%100-1}),s=a.clone().add(100,"y"),l=a.clone(),u="";for(n.eq(0).find("span").attr("title",i.tooltips.prevCentury),n.eq(2).find("span").attr("title",i.tooltips.nextCentury),t.find(".disabled").removeClass("disabled"),(a.isSame(e({y:1900}))||i.minDate&&i.minDate.isAfter(a,"y"))&&n.eq(0).addClass("disabled"),n.eq(1).text(a.year()+"-"+s.year()),(a.isSame(e({y:2e3}))||i.maxDate&&i.maxDate.isBefore(s,"y"))&&n.eq(2).addClass("disabled");!a.isAfter(s,"y");)u+=''+(a.year()+1)+" - "+(a.year()+12)+"",a.add(12,"y");u+="",t.find("td").html(u),n.eq(1).text(l.year()+1+"-"+a.year())},Y=function(){var e,n,a,s,l=p.find(".datepicker-days"),u=l.find("th"),c=[];if(M()){for(u.eq(0).find("span").attr("title",i.tooltips.prevMonth),u.eq(1).attr("title",i.tooltips.selectMonth),u.eq(2).find("span").attr("title",i.tooltips.nextMonth),l.find(".disabled").removeClass("disabled"),u.eq(1).text(o.format(i.dayViewHeaderFormat)),B(o.clone().subtract(1,"M"),"M")||u.eq(0).addClass("disabled"),B(o.clone().add(1,"M"),"M")||u.eq(2).addClass("disabled"),e=o.clone().startOf("M").startOf("w").startOf("d"),s=0;s<42;s++)0===e.weekday()&&(n=t("
        '+e.week()+"'+e.date()+"
        '+n.format(s?"HH":"hh")+"
        '+n.format("mm")+"
        '+n.format("ss")+"