removed sugar.js, port functionality to moment and underscore.js

bring in latest ace from local so we don't mess up with https
This commit is contained in:
Sam 2013-06-11 06:48:50 +10:00
parent eed5875505
commit fa8a84f20c
211 changed files with 1773 additions and 8914 deletions

View File

@ -9,7 +9,7 @@
Discourse.AdminDashboardController = Ember.Controller.extend({
loading: true,
versionCheck: null,
problemsCheckInterval: '1 minute ago',
problemsCheckMinutes: 1,
foundProblems: function() {
return(Discourse.User.current('admin') && this.get('problems') && this.get('problems').length > 0);
@ -33,9 +33,9 @@ Discourse.AdminDashboardController = Ember.Controller.extend({
c.set('problems', d.problems);
c.set('loadingProblems', false);
if( d.problems && d.problems.length > 0 ) {
c.problemsCheckInterval = '1 minute ago';
c.problemsCheckInterval = 1;
} else {
c.problemsCheckInterval = '10 minutes ago';
c.problemsCheckInterval = 10;
}
});
},

View File

@ -20,7 +20,7 @@ Discourse.AdminUsersListController = Ember.ArrayController.extend(Discourse.Pres
**/
selectAllChanged: function() {
var _this = this;
this.get('content').each(function(user) {
_.each(this.get('content'),function(user) {
user.set('selected', _this.get('selectAll'));
});
}.observes('selectAll'),

View File

@ -76,9 +76,9 @@ Discourse.AdminUser = Discourse.User.extend({
}).property('admin', 'moderator'),
banDuration: (function() {
var banned_at = Date.create(this.banned_at);
var banned_till = Date.create(this.banned_till);
return banned_at.short() + " - " + banned_till.short();
var banned_at = moment(this.banned_at);
var banned_till = moment(this.banned_till);
return banned_at.format('L') + " - " + banned_till.format('L');
}).property('banned_till', 'banned_at'),
ban: function() {

View File

@ -21,7 +21,7 @@ Discourse.EmailLog.reopenClass({
Discourse.ajax("/admin/email/logs.json", {
data: { filter: filter }
}).then(function(logs) {
logs.each(function(log) {
_.each(logs,function(log) {
result.pushObject(Discourse.EmailLog.create(log));
});
});

View File

@ -12,8 +12,8 @@ Discourse.FlaggedPost = Discourse.Post.extend({
var r,
_this = this;
r = [];
this.post_actions.each(function(a) {
return r.push(_this.userLookup[a.user_id]);
_.each(this.post_actions, function(action) {
r.push(_this.userLookup[action.user_id]);
});
return r;
}.property(),
@ -22,12 +22,12 @@ Discourse.FlaggedPost = Discourse.Post.extend({
var r,
_this = this;
r = [];
this.post_actions.each(function(a) {
if (a.message) {
return r.push({
user: _this.userLookup[a.user_id],
message: a.message,
permalink: a.permalink
_.each(this.post_actions,function(action) {
if (action.message) {
r.push({
user: _this.userLookup[action.user_id],
message: action.message,
permalink: action.permalink
});
}
});
@ -69,11 +69,11 @@ Discourse.FlaggedPost.reopenClass({
result.set('loading', true);
Discourse.ajax("/admin/flags/" + filter + ".json").then(function(data) {
var userLookup = {};
data.users.each(function(u) {
userLookup[u.id] = Discourse.User.create(u);
_.each(data.users,function(user) {
userLookup[user.id] = Discourse.User.create(user);
});
data.posts.each(function(p) {
var f = Discourse.FlaggedPost.create(p);
_.each(data.posts,function(post) {
var f = Discourse.FlaggedPost.create(post);
f.userLookup = userLookup;
result.pushObject(f);
});

View File

@ -20,7 +20,7 @@ Discourse.GithubCommit = Discourse.Model.extend({
}.property("sha"),
timeAgo: function() {
return Date.create(this.get('commit.committer.date')).relative();
return Discourse.Formatter.relativeAge(new Date(this.get('commit.committer.date'), {format: 'medium', leaveAgo: true}));
}.property("commit.committer.date")
});
@ -32,10 +32,10 @@ Discourse.GithubCommit.reopenClass({
type: 'get',
data: { per_page: 40 }
}).then(function (response) {
response.data.each(function(commit) {
_.each(response.data,function(commit) {
result.pushObject( Discourse.GithubCommit.create(commit) );
});
});
return result;
}
});
});

View File

@ -15,7 +15,7 @@ Discourse.Group = Discourse.Model.extend({
var group = this;
Discourse.ajax('/admin/groups/' + this.get('id') + '/users').then(function(payload){
var users = Em.A()
payload.each(function(user){
_.each(payload,function(user){
users.addObject(Discourse.User.create(user));
});
group.set('users', users)
@ -28,7 +28,7 @@ Discourse.Group = Discourse.Model.extend({
var users = this.get('users');
var usernames = "";
if(users) {
usernames = $.map(users, function(user){
usernames = _.map(users, function(user){
return user.get('username');
}).join(',')
}
@ -82,7 +82,7 @@ Discourse.Group.reopenClass({
var list = Discourse.SelectableArray.create();
Discourse.ajax("/admin/groups.json").then(function(groups){
groups.each(function(group){
_.each(groups,function(group){
list.addObject(Discourse.Group.create(group));
});
});

View File

@ -5,7 +5,7 @@ Discourse.Report = Discourse.Model.extend({
valueAt: function(numDaysAgo) {
if (this.data) {
var wantedDate = Date.create(numDaysAgo + ' days ago', 'en').format('{yyyy}-{MM}-{dd}');
var wantedDate = moment().subtract('days', numDaysAgo).format('YYYY-MM-DD');
var item = this.data.find( function(d, i, arr) { return d.x === wantedDate; } );
if (item) {
return item.y;
@ -16,11 +16,11 @@ Discourse.Report = Discourse.Model.extend({
sumDays: function(startDaysAgo, endDaysAgo) {
if (this.data) {
var earliestDate = Date.create(endDaysAgo + ' days ago', 'en').beginningOfDay();
var latestDate = Date.create(startDaysAgo + ' days ago', 'en').beginningOfDay();
var earliestDate = moment().subtract('days', endDaysAgo).startOf('day');
var latestDate = moment().subtract('days',startDaysAgo).startOf('day');
var d, sum = 0;
this.data.each(function(datum){
d = Date.create(datum.x);
_.each(this.data,function(datum){
d = moment(datum.x);
if(d >= earliestDate && d <= latestDate) {
sum += datum.y;
}

View File

@ -23,7 +23,7 @@ Discourse.SiteCustomization = Discourse.Model.extend({
var _this = this;
if(!this.originals) return false;
var changed = this.trackedProperties.any(function(p) {
var changed = _.some(this.trackedProperties,function(p) {
return _this.originals[p] !== _this.get(p);
});
@ -38,8 +38,8 @@ Discourse.SiteCustomization = Discourse.Model.extend({
startTrackingChanges: function() {
var _this = this;
var originals = {};
this.trackedProperties.each(function(p) {
originals[p] = _this.get(p);
_.each(this.trackedProperties,function(prop) {
originals[prop] = _this.get(prop);
return true;
});
this.set('originals', originals);
@ -90,7 +90,7 @@ Discourse.SiteCustomization = Discourse.Model.extend({
var SiteCustomizations = Ember.ArrayProxy.extend({
selectedItemChanged: function() {
var selected = this.get('selectedItem');
return this.get('content').each(function(i) {
_.each(this.get('content'),function(i) {
return i.set('selected', selected === i);
});
}.observes('selectedItem')
@ -101,7 +101,7 @@ Discourse.SiteCustomization.reopenClass({
var customizations = SiteCustomizations.create({ content: [], loading: true });
Discourse.ajax("/admin/site_customizations").then(function (data) {
if (data) {
data.site_customizations.each(function(c) {
_.each(data.site_customizations,function(c) {
customizations.pushObject(Discourse.SiteCustomization.create(c.site_customizations));
});
}

View File

@ -91,7 +91,7 @@ Discourse.SiteSetting.reopenClass({
findAll: function() {
var result = Em.A();
Discourse.ajax("/admin/site_settings").then(function (settings) {
settings.site_settings.each(function(s) {
_.each(settings.site_settings,function(s) {
s.originalValue = s.value;
result.pushObject(Discourse.SiteSetting.create(s));
});

View File

@ -14,13 +14,13 @@ Discourse.AdminDashboardRoute = Discourse.Route.extend({
},
fetchDashboardData: function(c) {
if( !c.get('dashboardFetchedAt') || Date.create('1 hour ago', 'en') > c.get('dashboardFetchedAt') ) {
if( !c.get('dashboardFetchedAt') || moment().subtract('hour', 1).toDate() > c.get('dashboardFetchedAt') ) {
c.set('dashboardFetchedAt', new Date());
Discourse.AdminDashboard.find().then(function(d) {
if( Discourse.SiteSettings.version_checks ){
c.set('versionCheck', Discourse.VersionCheck.create(d.version_check));
}
d.reports.each(function(report){
_.each(d.reports,function(report){
c.set(report.type, Discourse.Report.create(report));
});
c.set('admins', d.admins);
@ -33,14 +33,14 @@ Discourse.AdminDashboardRoute = Discourse.Route.extend({
});
}
if( !c.get('problemsFetchedAt') || Date.create(c.problemsCheckInterval, 'en') > c.get('problemsFetchedAt') ) {
if( !c.get('problemsFetchedAt') || moment.subtract('minute',c.problemsCheckMinutes).toDate() > c.get('problemsFetchedAt') ) {
c.set('problemsFetchedAt', new Date());
c.loadProblems();
}
},
fetchGithubCommits: function(c) {
if( !c.get('commitsCheckedAt') || Date.create('1 hour ago', 'en') > c.get('commitsCheckedAt') ) {
if( !c.get('commitsCheckedAt') || moment().subtract('hour',1).toDate() > c.get('commitsCheckedAt') ) {
c.set('commitsCheckedAt', new Date());
c.set('githubCommits', Discourse.GithubCommit.findAll());
}

View File

@ -8,8 +8,8 @@
**/
var oneWeekAgo = function() {
// TODO: Take out due to being evil sugar js?
return Date.create(7 + ' days ago', 'en').format('{yyyy}-{MM}-{dd}');
// TODO localize date format?
return moment().subtract('days',7).format('yyyy-MM-dd');
}
Discourse.AdminEmailPreviewDigestRoute = Discourse.Route.extend(Discourse.ModelReady, {

View File

@ -52,10 +52,10 @@ Discourse.AceEditorView = Discourse.View.extend({
if (window.ace) {
initAce();
} else {
$LAB.script('http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js').wait(initAce);
$LAB.script('/javascripts/ace/ace.js').wait(initAce);
}
}
});
Discourse.View.registerHelper('aceEditor', Discourse.AceEditorView);
Discourse.View.registerHelper('aceEditor', Discourse.AceEditorView);

View File

@ -16,11 +16,9 @@
<%
if Rails.env.development?
require_asset ("./external_development/ember.js")
require_asset ("./external_development/sugar-1.3.5.js")
require_asset ("./external_development/group-helper.js")
else
require_asset ("./external_production/ember.js")
require_asset ("./external_production/sugar-1.3.5.js")
require_asset ("./external_production/group-helper.js")
end

View File

@ -294,7 +294,7 @@ Discourse = Ember.Application.createWithMixins({
bus.subscribe("/categories", function(data){
var site = Discourse.Site.instance();
data.categories.each(function(c){
_.each(data.categories,function(c){
site.updateCategory(c)
});
});

View File

@ -92,7 +92,7 @@ $.fn.autocomplete = function(options) {
this.width(150);
this.attr('name', this.attr('name') + "-renamed");
var vals = this.val().split(",");
vals.each(function(x) {
_.each(vals,function(x) {
if (x !== "") {
if (options.reverseTransform) {
x = options.reverseTransform(x);

View File

@ -91,15 +91,15 @@ Discourse.BBCode = {
var result = {};
Object.keys(Discourse.BBCode.replacers, function(name, rules) {
_.each(Discourse.BBCode.replacers, function(rules, name) {
var parsed = result[name] = [];
Object.keys(Object.merge(Discourse.BBCode.replacers.base.withoutArgs, rules.withoutArgs), function(tag, val) {
_.each(_.extend(Discourse.BBCode.replacers.base.withoutArgs, rules.withoutArgs), function(val, tag) {
parsed.push({ regexp: new RegExp("\\[" + tag + "\\]([\\s\\S]*?)\\[\\/" + tag + "\\]", "igm"), fn: val });
});
Object.keys(Object.merge(Discourse.BBCode.replacers.base.withArgs, rules.withArgs), function(tag, val) {
_.each(_.extend(Discourse.BBCode.replacers.base.withArgs, rules.withArgs), function(val, tag) {
parsed.push({ regexp: new RegExp("\\[" + tag + "=?(.+?)\\]([\\s\\S]*?)\\[\\/" + tag + "\\]", "igm"), fn: val });
});
@ -172,7 +172,7 @@ Discourse.BBCode = {
}
result.template = function(input) {
replacements.each(function(r) {
_.each(replacements,function(r) {
var val = r.value.trim();
val = val.replace(r.content, r.content.replace(/\n/g, '<br>'));
input = input.replace(r.key, val);
@ -196,7 +196,7 @@ Discourse.BBCode = {
paramsString = matches[1].replace(/\"/g, '');
paramsSplit = paramsString.split(/\, */);
params = [];
paramsSplit.each(function(p, i) {
_.each(paramsSplit,function(p,i) {
if (i > 0) {
var assignment = p.split(':');
if (assignment[0] && assignment[1]) {

View File

@ -53,10 +53,12 @@ Discourse.Development = {
if (n === name || v.time < 1) continue;
ary.push({ k: n, v: v });
}
ary.sortBy(function(item) {
if (item.v && item.v.time) return -item.v.time;
return 0;
}).each(function(item) {
ary.sort(function(x,y) {
x = x.v && x.v.time ? -x.v.time : 0;
y = y.v && y.v.time ? -y.v.time : 0;
return x > y;
});
_.each(ary, function(item,idx) {
var output = f("" + item.k, item.v);
if (output) {
console.log(output);
@ -114,7 +116,7 @@ Discourse.Development = {
// Observe file changes
return Discourse.MessageBus.subscribe("/file-change", function(data) {
Ember.TEMPLATES.empty = Handlebars.compile("<div></div>");
return data.each(function(me) {
_.each(data,function(me,idx) {
var js;
if (me === "refresh") {
return document.location.reload(true);
@ -123,14 +125,13 @@ Discourse.Development = {
return $LAB.script(js + "?hash=" + me.hash).wait(function() {
var templateName;
templateName = js.replace(".js", "").replace("/assets/", "");
return $.each(Ember.View.views, function() {
var _this = this;
if (this.get('templateName') === templateName) {
this.set('templateName', 'empty');
this.rerender();
return _.each(Ember.View.views, function(view) {
if (view.get('templateName') === templateName) {
view.set('templateName', 'empty');
view.rerender();
Em.run.schedule('afterRender', function() {
_this.set('templateName', templateName);
_this.rerender();
view.set('templateName', templateName);
view.rerender();
});
}
});
@ -149,4 +150,4 @@ Discourse.Development = {
});
}
};
};

View File

@ -1,16 +1,33 @@
Discourse.Formatter = (function(){
var updateRelativeAge, autoUpdatingRelativeAge, relativeAge, relativeAgeTiny, relativeAgeMedium, relativeAgeMediumSpan, longDate;
var updateRelativeAge, autoUpdatingRelativeAge, relativeAge, relativeAgeTiny,
relativeAgeMedium, relativeAgeMediumSpan, longDate, toTitleCase,
shortDate;
var shortDateNoYearFormat = Ember.String.i18n("dates.short_date_no_year");
var longDateFormat = Ember.String.i18n("dates.long_date");
var shortDateFormat = Ember.String.i18n("dates.short_date");
shortDate = function(date){
return moment(date).format(shortDateFormat);
};
// http://stackoverflow.com/questions/196972/convert-string-to-title-case-with-javascript
// TODO: locale support ?
toTitleCase = function toTitleCase(str)
{
return str.replace(/\w\S*/g, function(txt){
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
}
longDate = function(dt) {
return moment(dt).format(longDateFormat);
};
updateRelativeAge = function(elems) {
// jQuery .each
elems.each(function(){
var $this = $(this);
$this.html(relativeAge(new Date($this.data('time')), $this.data('format')));
@ -97,7 +114,6 @@ Discourse.Formatter = (function(){
formatted = t("x_days", {count: Math.round((distanceInMinutes - 720.0) / 1440.0)});
break;
}
return formatted || '&mdash';
};
@ -121,7 +137,7 @@ Discourse.Formatter = (function(){
displayDate = Em.String.i18n("now");
} else if (distance > fiveDaysAgo) {
if ((new Date()).getFullYear() !== date.getFullYear()) {
displayDate = moment(date).format(shortDateFormat);
displayDate = shortDate(date);
} else {
displayDate = moment(date).format(shortDateNoYearFormat);
}
@ -153,6 +169,8 @@ Discourse.Formatter = (function(){
longDate: longDate,
relativeAge: relativeAge,
autoUpdatingRelativeAge: autoUpdatingRelativeAge,
updateRelativeAge: updateRelativeAge
updateRelativeAge: updateRelativeAge,
toTitleCase: toTitleCase,
shortDate: shortDate
};
})();

View File

@ -166,7 +166,7 @@ Discourse.Markdown = {
if (Discourse && Discourse.Onebox) {
onebox = Discourse.Onebox.lookupCache(url);
}
if (onebox && !onebox.isBlank()) {
if (onebox && onebox.trim().length > 0) {
return arguments[2] + onebox;
} else {
return arguments[2] + arguments[4] + " class=\"onebox\" target=\"_blank\">" + arguments[6];

View File

@ -69,8 +69,8 @@ Discourse.MessageBus = (function() {
return;
}
data = {};
callbacks.each(function(c) {
data[c.channel] = c.last_id === void 0 ? -1 : c.last_id;
_.each(callbacks, function(callback) {
data[callback.channel] = callback.last_id === void 0 ? -1 : callback.last_id;
});
gotData = false;
_this.longPoll = $.ajax(Discourse.getURL("/message-bus/") + clientId + "/poll?" + (!shouldLongPoll() || !_this.enableLongPolling ? "dlp=t" : ""), {
@ -83,9 +83,9 @@ Discourse.MessageBus = (function() {
},
success: function(messages) {
failCount = 0;
return messages.each(function(message) {
_.each(messages,function(message) {
gotData = true;
return callbacks.each(function(callback) {
_.each(callbacks, function(callback) {
if (callback.channel === message.channel) {
callback.last_id = message.message_id;
callback.func(message.data);
@ -139,11 +139,11 @@ Discourse.MessageBus = (function() {
unsubscribe: function(channel) {
// TODO proper globbing
var glob;
if (channel.endsWith("*")) {
if (channel.indexOf("*", channel.length - 1) !== -1) {
channel = channel.substr(0, channel.length - 1);
glob = true;
}
callbacks = callbacks.filter(function(callback) {
callbacks = $.grep(callbacks,function(callback) {
if (glob) {
return callback.channel.substr(0, channel.length) !== channel;
} else {

View File

@ -77,7 +77,7 @@ Discourse.ScreenTrack = Ember.Object.extend({
// Update our total timings
var totalTimings = this.get('totalTimings');
Object.values(this.get('timings'), function(timing) {
_.each(this.get('timings'), function(timing,key) {
if (!totalTimings[timing.postNumber])
totalTimings[timing.postNumber] = 0;
@ -90,15 +90,16 @@ Discourse.ScreenTrack = Ember.Object.extend({
var topicId = parseInt(this.get('topicId'), 10);
var highestSeen = 0;
Object.keys(newTimings, function(postNumber) {
_.each(newTimings, function(time,postNumber) {
highestSeen = Math.max(highestSeen, parseInt(postNumber, 10));
});
var highestSeenByTopic = Discourse.get('highestSeenByTopic');
if ((highestSeenByTopic[topicId] || 0) < highestSeen) {
highestSeenByTopic[topicId] = highestSeen;
Discourse.TopicTrackingState.current().updateSeen(topicId, highestSeen);
}
if (!Object.isEmpty(newTimings)) {
if (!$.isEmptyObject(newTimings)) {
Discourse.ajax('/topics/timings', {
data: {
@ -144,8 +145,8 @@ Discourse.ScreenTrack = Ember.Object.extend({
// TODO: Eyeline has a smarter more accurate function here. It's bad to do jQuery
// in a model like component, so we should refactor this out later.
var screenTrack = this;
return Object.keys(this.get('timings'), function(id) {
var $element, elemBottom, elemTop, timing;
_.each(this.get('timings'),function(timing,id) {
var $element, elemBottom, elemTop;
$element = $(id);
if ($element.length === 1) {
elemTop = $element.offset().top;
@ -153,7 +154,6 @@ Discourse.ScreenTrack = Ember.Object.extend({
// If part of the element is on the screen, increase the counter
if (((docViewTop <= elemTop && elemTop <= docViewBottom)) || ((docViewTop <= elemBottom && elemBottom <= docViewBottom))) {
timing = screenTrack.timings[id];
timing.time = timing.time + diff;
}
}

View File

@ -47,7 +47,7 @@ Discourse.UserSearch = {
var organizeResults = function(r) {
var result = [];
r.users.each(function(u) {
_.each(r.users,function(u) {
if (exclude.indexOf(u.username) === -1) {
result.push(u);
}

View File

@ -11,12 +11,12 @@ Discourse.EditTopicAutoCloseController = Discourse.ObjectController.extend(Disco
setDays: function() {
if( this.get('auto_close_at') ) {
var closeTime = Date.create( this.get('auto_close_at') );
if (closeTime.isFuture()) {
var closeTime = new Date( this.get('auto_close_at') );
if (closeTime > new Date()) {
this.set('auto_close_days', closeTime.daysSince());
}
} else {
this.set('auto_close_days', "");
this.set('auto_close_days', '');
}
}.observes('auto_close_at'),
@ -31,15 +31,15 @@ Discourse.EditTopicAutoCloseController = Discourse.ObjectController.extend(Disco
setAutoClose: function(days) {
var editTopicAutoCloseController = this;
Discourse.ajax({
url: "/t/" + this.get('id') + "/autoclose",
url: '/t/' + this.get('id') + '/autoclose',
type: 'PUT',
dataType: 'json',
data: { auto_close_days: days > 0 ? days : null }
}).then(function(){
editTopicAutoCloseController.set('auto_close_at', Date.create(days + ' days from now').toJSON());
editTopicAutoCloseController.set('auto_close_at', moment().add('days', days).format());
}, function (error) {
bootbox.alert(Em.String.i18n('generic_error'));
});
}
});
});

View File

@ -65,15 +65,15 @@ Discourse.HistoryController = Discourse.ObjectController.extend(Discourse.ModalF
var historyController = this;
this.get('model').loadVersions().then(function(result) {
result.each(function(item) {
item.description = "v" + item.number + " - " + Date.create(item.created_at).relative() + " - " +
_.each(result,function(item) {
item.description = "v" + item.number + " - " + Discourse.Formatter.relativeAge(new Date(item.created_at), {format: 'medium', leaveAgo: true}) + " - " +
Em.String.i18n("changed_by", { author: item.display_username });
});
historyController.setProperties({
loading: false,
versionLeft: result.first(),
versionRight: result.last(),
versionLeft: result[0],
versionRight: result[result.length-1],
versions: result
});
});

View File

@ -41,11 +41,11 @@ Discourse.SearchController = Em.ArrayController.extend(Discourse.Presence, {
// Default order
var order = ['topic', 'category', 'user'];
results = order.map(function(o) { return results_hashed[o] }).without(void 0);
results = _(order).map(function(o) { return results_hashed[o] }).without(void 0);
var index = 0;
results.forEach(function(r) {
r.results.each(function(item) {
_.each(r.results,function(item) {
item.index = index++;
});
});
@ -92,4 +92,4 @@ Discourse.SearchController = Em.ArrayController.extend(Discourse.Presence, {
}
}
});
});

View File

@ -127,7 +127,7 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected
jumpTop: function() {
if (this.get('bestOf')) {
Discourse.TopicView.scrollTo(this.get('id'), this.get('posts').first().get('post_number'));
Discourse.TopicView.scrollTo(this.get('id'), this.get('posts')[0].get('post_number'));
} else {
Discourse.URL.routeTo(this.get('url'));
}
@ -253,12 +253,12 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected
var topicController = this;
var postFilters = this.get('postFilters');
return Discourse.Topic.find(this.get('id'), postFilters).then(function(result) {
var first = result.posts.first();
var first = result.posts[0];
if (first) {
topicController.set('currentPost', first.post_number);
}
$('#topic-progress .solid').data('progress', false);
result.posts.each(function(p) {
_.each(result.posts,function(p) {
// Skip the first post
if (p.post_number === 1) return;
posts.pushObject(Discourse.Post.create(p, topic));

View File

@ -13,7 +13,7 @@ Handlebars.registerHelper('breakUp', function(property, options) {
if (tokens.length === 1) return prop;
result = "";
tokens.each(function(token, index) {
_.each(tokens,function(token,index) {
result += token;
if (token.indexOf(' ') === -1 && (index < tokens.length - 1)) {
result += "- ";
@ -29,7 +29,7 @@ Handlebars.registerHelper('breakUp', function(property, options) {
@for Handlebars
**/
Handlebars.registerHelper('shorten', function(property, options) {
return Ember.Handlebars.get(this, property, options).truncate(35);
return Ember.Handlebars.get(this, property, options).substring(0,35);
});
/**
@ -100,7 +100,7 @@ Handlebars.registerHelper('shortenUrl', function(property, options) {
}
url = url.replace(/^https?:\/\//, '');
url = url.replace(/^www\./, '');
return url.truncate(80);
return url.substring(0,80);
});
/**

View File

@ -23,10 +23,10 @@ Discourse.Presence = Em.Mixin.create({
if (!prop) return true;
switch (typeof prop) {
case "string":
return prop.trim().isBlank();
case "object":
return Object.isEmpty(prop);
case "string":
return prop.trim().length === 0;
case "object":
return $.isEmptyObject(prop);
}
return false;
},

View File

@ -112,8 +112,8 @@ Discourse.ActionSummary = Discourse.Model.extend({
}).then(function (result) {
var users = Em.A();
actionSummary.set('users', users);
result.each(function(u) {
users.pushObject(Discourse.User.create(u));
_.each(result,function(user) {
users.pushObject(Discourse.User.create(user));
});
});
}

View File

@ -86,7 +86,7 @@ Discourse.Category.reopenClass({
if (!category) return "";
var id = Em.get(category, 'id');
var slug = Em.get(category, 'slug');
if ((!slug) || slug.isBlank()) return "" + id + "-category";
if (!slug || slug.trim().length === 0) return "" + id + "-category";
return slug;
},

View File

@ -15,14 +15,14 @@ Discourse.CategoryList.reopenClass({
var users = this.extractByKey(result.featured_users, Discourse.User);
result.category_list.categories.each(function(c) {
_.each(result.category_list.categories,function(c) {
if (c.featured_user_ids) {
c.featured_users = c.featured_user_ids.map(function(u) {
c.featured_users = _.map(c.featured_user_ids,function(u) {
return users[u];
});
}
if (c.topics) {
c.topics = c.topics.map(function(t) {
c.topics = _.map(c.topics,function(t) {
return Discourse.Topic.create(t);
});
}

View File

@ -328,7 +328,7 @@ Discourse.Composer = Discourse.Model.extend({
// perhaps our post came from elsewhere eg. draft
var idx = -1;
var postNumber = post.get('post_number');
posts.each(function(p, i) {
_.each(posts,function(p,i) {
if (p.get('post_number') === postNumber) {
idx = i;
}
@ -408,7 +408,7 @@ Discourse.Composer = Discourse.Model.extend({
createdPost.set('created_at', new Date());
// If we're near the end of the topic, load new posts
var lastPost = topic.posts.last();
var lastPost = topic.posts[topic.posts.length-1];
if (lastPost) {
var diff = topic.get('highest_post_number') - lastPost.get('post_number');

View File

@ -18,7 +18,7 @@ Discourse.Model = Ember.Object.extend(Discourse.Presence, {
**/
mergeAttributes: function(attrs, builders) {
var _this = this;
return Object.keys(attrs, function(k, v) {
_.each(attrs, function(v,k) {
// If they're in a builder we use that
var builder, col;
if (typeof v === 'object' && builders && (builder = builders[k])) {
@ -26,7 +26,7 @@ Discourse.Model = Ember.Object.extend(Discourse.Presence, {
_this.set(k, Em.A());
}
col = _this.get(k);
return v.each(function(obj) {
_.each(v,function(obj) {
col.pushObject(builder.create(obj));
});
} else {
@ -49,7 +49,7 @@ Discourse.Model.reopenClass({
extractByKey: function(collection, klass) {
var retval = {};
if (!collection) return retval;
collection.each(function(c) {
_.each(collection,function(c) {
retval[c.id] = klass.create(c);
});
return retval;

View File

@ -114,7 +114,7 @@ Discourse.Post = Discourse.Model.extend({
rightNow = new Date().getTime();
// Show heat on age
updatedAtDate = Date.create(updatedAt).getTime();
updatedAtDate = new Date(updatedAt).getTime();
if (updatedAtDate > (rightNow - 60 * 60 * 1000 * 12)) return 'heatmap-high';
if (updatedAtDate > (rightNow - 60 * 60 * 1000 * 24)) return 'heatmap-med';
if (updatedAtDate > (rightNow - 60 * 60 * 1000 * 48)) return 'heatmap-low';
@ -207,10 +207,11 @@ Discourse.Post = Discourse.Model.extend({
// Update all the properties
if (!obj) return;
Object.each(obj, function(key, val) {
if (key === 'actions_summary') return false;
if (val) {
post.set(key, val);
_.each(obj, function(val,key) {
if (key !== 'actions_summary'){
if (val) {
post.set(key, val);
}
}
});
@ -218,7 +219,7 @@ Discourse.Post = Discourse.Model.extend({
this.set('actions_summary', Em.A());
if (obj.actions_summary) {
var lookup = Em.Object.create();
obj.actions_summary.each(function(a) {
_.each(obj.actions_summary,function(a) {
var actionSummary;
a.post = post;
a.actionType = Discourse.Site.instance().postActionTypeById(a.id);
@ -238,7 +239,7 @@ Discourse.Post = Discourse.Model.extend({
var parent = this;
return Discourse.ajax("/posts/" + (this.get('id')) + "/replies").then(function(loaded) {
var replies = parent.get('replies');
loaded.each(function(reply) {
_.each(loaded,function(reply) {
var post = Discourse.Post.create(reply);
post.set('topic', parent.get('topic'));
replies.pushObject(post);

View File

@ -8,7 +8,7 @@ Discourse.SelectableArray = Em.ArrayProxy.extend({
this.select(this[index]);
},
select: function(selected){
this.content.each(function(item){
_.each(this.content,function(item){
if(item === selected){
Em.set(item, "active", true)
} else {

View File

@ -10,7 +10,7 @@ Discourse.Site = Discourse.Model.extend({
notificationLookup: function() {
var result = [];
Object.keys(this.get('notification_types'), function(k, v) {
_.each(this.get('notification_types'), function(v,k) {
result[v] = k;
});
return result;
@ -40,28 +40,29 @@ Discourse.Site.reopenClass({
create: function(obj) {
var _this = this;
return Object.tap(this._super(obj), function(result) {
var result = this._super(obj);
if (result.categories) {
result.categories = result.categories.map(function(c) {
return Discourse.Category.create(c);
});
}
if (result.post_action_types) {
result.postActionByIdLookup = Em.Object.create();
result.post_action_types = result.post_action_types.map(function(p) {
var actionType;
actionType = Discourse.PostActionType.create(p);
result.postActionByIdLookup.set("action" + p.id, actionType);
return actionType;
});
}
if (result.archetypes) {
result.archetypes = result.archetypes.map(function(a) {
return Discourse.Archetype.create(a);
});
}
});
if (result.categories) {
result.categories = _.map(result.categories, function(c) {
return Discourse.Category.create(c);
});
}
if (result.post_action_types) {
result.postActionByIdLookup = Em.Object.create();
result.post_action_types = _.map(result.post_action_types,function(p) {
var actionType;
actionType = Discourse.PostActionType.create(p);
result.postActionByIdLookup.set("action" + p.id, actionType);
return actionType;
});
}
if (result.archetypes) {
result.archetypes = _.map(result.archetypes,function(a) {
return Discourse.Archetype.create(a);
});
}
return result;
}
});

View File

@ -44,7 +44,7 @@ Discourse.Topic = Discourse.Model.extend({
url: function() {
var slug = this.get('slug');
if (slug.isBlank()) {
if (slug.trim().length === 0) {
slug = "topic";
}
return Discourse.getURL("/t/") + slug + "/" + (this.get('id'));
@ -69,16 +69,19 @@ Discourse.Topic = Discourse.Model.extend({
// The last post in the topic
lastPost: function() {
return this.get('posts').last();
var posts = this.get('posts')
return posts[posts.length-1];
},
postsChanged: function() {
var last, posts;
posts = this.get('posts');
last = posts.last();
last = posts[posts.length - 1];
if (!(last && last.set && !last.lastPost)) return;
posts.each(function(p) {
if (p.lastPost) return p.set('lastPost', false);
_.each(posts,function(p) {
if (p.lastPost) {
p.set('lastPost', false);
}
});
last.set('lastPost', true);
return true;
@ -232,7 +235,7 @@ Discourse.Topic = Discourse.Model.extend({
opts.nearPost = parseInt(opts.nearPost, 10);
closestPostNumber = 0;
postDiff = Number.MAX_VALUE;
result.posts.each(function(p) {
_.each(result.posts,function(p) {
var diff = Math.abs(p.post_number - opts.nearPost);
if (diff < postDiff) {
postDiff = diff;
@ -263,7 +266,7 @@ Discourse.Topic = Discourse.Model.extend({
// Okay this is weird, but let's store the length of the next post when there
lastPost = null;
result.posts.each(function(p) {
_.each(result.posts,function(p) {
p.scrollToAfterInsert = opts.nearPost;
var post = Discourse.Post.create(p);
post.set('topic', topic);
@ -327,12 +330,12 @@ Discourse.Topic = Discourse.Model.extend({
var map, posts;
map = {};
posts = this.get('posts');
posts.each(function(p) {
map["" + p.post_number] = true;
_.each(posts,function(post) {
map["" + post.post_number] = true;
});
return newPosts.each(function(p) {
if (!map[p.get('post_number')]) {
return posts.pushObject(p);
_.each(newPosts,function(post) {
if (!map[post.get('post_number')]) {
posts.pushObject(post);
}
});
},
@ -445,7 +448,7 @@ Discourse.Topic.reopenClass({
return PreloadStore.getAndRemove("topic_" + topicId, function() {
return Discourse.ajax(url + ".json", {data: data});
}).then(function(result) {
var first = result.posts.first();
var first = result.posts[0];
if (first && opts && opts.bestOf) {
first.bestOfFirst = true;
}
@ -476,19 +479,21 @@ Discourse.Topic.reopenClass({
},
create: function(obj, topicView) {
return Object.tap(this._super(obj), function(result) {
if (result.participants) {
result.participants = result.participants.map(function(u) {
return Discourse.User.create(u);
});
result.fewParticipants = Em.A();
return result.participants.each(function(p) {
if (result.fewParticipants.length >= 8) return false;
result.fewParticipants.pushObject(p);
return true;
});
}
});
var result = this._super(obj);
if (result.participants) {
result.participants = _.map(result.participants,function(u) {
return Discourse.User.create(u);
});
result.fewParticipants = Em.A();
_.each(result.participants,function(p) {
// TODO should not be hardcoded
if (result.fewParticipants.length >= 8) return false;
result.fewParticipants.pushObject(p);
});
}
return result;
}
});

View File

@ -11,13 +11,13 @@ Discourse.TopicList = Discourse.Model.extend({
forEachNew: function(topics, callback) {
var topicIds = [];
this.get('topics').each(function(t) {
topicIds[t.get('id')] = true;
_.each(this.get('topics'),function(topic) {
topicIds[topic.get('id')] = true;
});
topics.each(function(t) {
if(!topicIds[t.id]) {
callback(t);
_.each(topics,function(topic) {
if(!topicIds[topic.id]) {
callback(topic);
}
});
},
@ -99,12 +99,12 @@ Discourse.TopicList.reopenClass({
categories = this.extractByKey(result.categories, Discourse.Category);
users = this.extractByKey(result.users, Discourse.User);
topics = Em.A();
result.topic_list.topics.each(function(ft) {
_.each(result.topic_list.topics,function(ft) {
ft.category = categories[ft.category_id];
ft.posters.each(function(p) {
_.each(ft.posters,function(p) {
p.user = users[p.user_id];
});
return topics.pushObject(Discourse.Topic.create(ft));
topics.pushObject(Discourse.Topic.create(ft));
});
return topics;
},

View File

@ -32,6 +32,14 @@ Discourse.TopicTrackingState = Discourse.Model.extend({
}
},
updateSeen: function(topicId, highestSeen) {
var state = this.states["t" + topicId];
if(state && state.last_read_post_number < highestSeen) {
state.last_read_post_number = highestSeen;
this.incrementMessageCount();
}
},
notify: function(data){
if (!this.newIncoming) { return; }
@ -75,25 +83,24 @@ Discourse.TopicTrackingState = Discourse.Model.extend({
if(filter === "new" && !list.more_topics_url){
// scrub all new rows and reload from list
$.each(this.states, function(){
if(this.last_read_post_number === null) {
tracker.removeTopic(this.topic_id);
_.each(this.states, function(state){
if(state.last_read_post_number === null) {
tracker.removeTopic(state.topic_id);
}
});
}
if(filter === "unread" && !list.more_topics_url){
// scrub all new rows and reload from list
$.each(this.states, function(){
if(this.last_read_post_number !== null) {
tracker.removeTopic(this.topic_id);
_.each(this.states, function(state){
if(state.last_read_post_number !== null) {
tracker.removeTopic(state.topic_id);
}
});
}
$.each(list.topics, function(){
_.each(list.topics, function(topic){
var row = {};
var topic = this;
row.topic_id = topic.id;
if(topic.unseen) {
@ -123,28 +130,27 @@ Discourse.TopicTrackingState = Discourse.Model.extend({
},
countNew: function(){
var count = 0;
$.each(this.states, function(){
count += this.last_read_post_number === null ? 1 : 0;
});
return count;
return _.chain(this.states)
.where({last_read_post_number: null})
.value()
.length;
},
countUnread: function(){
var count = 0;
$.each(this.states, function(){
count += (this.last_read_post_number !== null &&
this.last_read_post_number < this.highest_post_number) ? 1 : 0;
_.each(this.states, function(topic){
count += (topic.last_read_post_number !== null &&
topic.last_read_post_number < topic.highest_post_number) ? 1 : 0;
});
return count;
},
countCategory: function(category) {
var count = 0;
$.each(this.states, function(){
if (this.category_name === category) {
count += (this.last_read_post_number === null ||
this.last_read_post_number < this.highest_post_number) ? 1 : 0;
_.each(this.states, function(topic){
if (topic.category_name === category) {
count += (topic.last_read_post_number === null ||
topic.last_read_post_number < topic.highest_post_number) ? 1 : 0;
}
});
return count;
@ -167,8 +173,8 @@ Discourse.TopicTrackingState = Discourse.Model.extend({
var states = this.states;
if(data) {
data.each(function(row){
states["t" + row.topic_id] = row;
_.each(data,function(topic){
states["t" + topic.topic_id] = topic;
});
}
}

View File

@ -209,9 +209,11 @@ Discourse.User = Discourse.Model.extend({
**/
statsCountNonPM: function() {
if (this.blank('statsExcludingPms')) return 0;
return this.get('statsExcludingPms').getEach('count').reduce(function (accum, val) {
return accum + val;
var count = 0;
_.each(this.get('statsExcludingPms'), function(val) {
count += val.count;
});
return count;
}.property('statsExcludingPms.@each.count'),
/**
@ -242,7 +244,7 @@ Discourse.User = Discourse.Model.extend({
return PreloadStore.getAndRemove("user_" + user.get('username'), function() {
return Discourse.ajax("/users/" + user.get('username') + '.json');
}).then(function (json) {
json.user.stats = Discourse.User.groupStats(json.user.stats.map(function(s) {
json.user.stats = Discourse.User.groupStats(_.map(json.user.stats,function(s) {
if (s.count) s.count = parseInt(s.count, 10);
return Discourse.UserActionStat.create(s);
}));

View File

@ -158,7 +158,7 @@ Discourse.UserAction.reopenClass({
uniq = {};
collapsed = Em.A();
pos = 0;
stream.each(function(item) {
_.each(stream, function(item) {
var current, found, key;
key = "" + item.topic_id + "-" + item.post_number;
found = uniq[key];

View File

@ -24,10 +24,10 @@ Discourse.UserStream = Discourse.Model.extend({
var stream = this;
return Discourse.ajax(url, {cache: 'false'}).then( function(result) {
if (result && result.user_actions && result.user_actions.each) {
if (result && result.user_actions) {
var copy = Em.A();
result.user_actions.each(function(i) {
return copy.pushObject(Discourse.UserAction.create(i));
_.each(result.user_actions,function(action) {
copy.pushObject(Discourse.UserAction.create(action));
});
copy = Discourse.UserAction.collapseStream(copy);
stream.get('content').pushObjects(copy);
@ -36,4 +36,4 @@ Discourse.UserStream = Discourse.Model.extend({
});
}
});
});

View File

@ -44,7 +44,7 @@ Discourse.FilteredListRoute = Discourse.Route.extend({
}
});
Discourse.ListController.filters.each(function(filter) {
Discourse.ListController.filters.forEach(function(filter) {
Discourse["List" + (filter.capitalize()) + "Route"] = Discourse.FilteredListRoute.extend({ filter: filter });
});

View File

@ -37,7 +37,7 @@ Discourse.DropdownButtonView = Discourse.View.extend({
buffer.push("</button>");
buffer.push("<ul class='dropdown-menu'>");
this.get('dropDownContent').each(function(row) {
_.each(this.get('dropDownContent'), function(row) {
var id = row[0],
textKey = row[1],
title = Em.String.i18n(textKey + ".title"),

View File

@ -24,7 +24,7 @@ Discourse.ComboboxView = Discourse.View.extend({
if (this.get('content')) {
var comboboxView = this;
this.get('content').each(function(o) {
_.each(this.get('content'),function(o) {
var val = o[comboboxView.get('valueAttribute')];
if (val) { val = val.toString(); }
@ -66,7 +66,7 @@ Discourse.ComboboxView = Discourse.View.extend({
}
if (this.classNames && this.classNames.length > 0) {
// Apply the classes to Chosen's dropdown div too:
this.classNames.each(function(c) {
_.each(this.classNames,function(c) {
$elem.chosen().next().addClass(c);
});
}
@ -78,4 +78,4 @@ Discourse.ComboboxView = Discourse.View.extend({
});
Discourse.View.registerHelper('combobox', Discourse.ComboboxView);
Discourse.View.registerHelper('combobox', Discourse.ComboboxView);

View File

@ -53,8 +53,8 @@ Discourse.ComposerView = Discourse.View.extend({
// if the caret is on the last line ensure preview scrolled to bottom
caretPosition = Discourse.Utilities.caretPosition(_this.wmdInput[0]);
if (!_this.wmdInput.val().substring(caretPosition).match(/\n/)) {
$wmdPreview = $('#wmd-preview:visible');
if ($wmdPreview.length > 0) {
$wmdPreview = $('#wmd-preview');
if ($wmdPreview.is(':visible')) {
return $wmdPreview.scrollTop($wmdPreview[0].scrollHeight);
}
}

View File

@ -43,7 +43,7 @@ Discourse.NavItemView = Discourse.View.extend({
};
if (categoryName) {
name = 'category';
extra.categoryName = categoryName.titleize();
extra.categoryName = Discourse.Formatter.toTitleCase(categoryName);
}
return I18n.t("js.filters." + name + ".title", extra);
}.property('count'),

View File

@ -163,7 +163,7 @@ Discourse.PostView = Discourse.View.extend({
var link_counts;
if (link_counts = this.get('post.link_counts')) {
link_counts.each(function(lc) {
_.each(link_counts, function(lc) {
if (lc.clicks > 0) {
postView.$(".cooked a[href]").each(function() {
var link = $(this);

View File

@ -18,7 +18,7 @@ Discourse.TopicClosingView = Discourse.View.extend({
render: function(buffer) {
if (!this.present('topic.auto_close_at')) return;
var autoCloseAt = Date.create(this.get('topic.auto_close_at'));
var autoCloseAt = new Date(this.get('topic.auto_close_at'));
if (autoCloseAt.isPast()) return;
@ -54,4 +54,4 @@ Discourse.TopicClosingView = Discourse.View.extend({
this.delayedRerender.cancel();
}
}
});
});

View File

@ -139,21 +139,22 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
hasNewSuggested: function(){
var incoming = this.get('topicTrackingState.newIncoming');
var suggested = this.get('topic.suggested_topics');
var topicId = this.get('topic.id');
if(suggested) {
var lookup = incoming.slice(-5).reverse().unique();
if(lookup.length < 5) {
suggested.each(function(topic){
if (topic) {
lookup.push(topic.get('id'));
lookup = lookup.unique();
return lookup.length < 5;
}
});
}
var topicId = this.get('topic.id');
lookup = lookup.exclude(function(id){ return id === topicId; });
var existing = _(suggested).map(function(topic){
topic.get("id");
});
var lookup = _.chain(incoming)
.last(5)
.reverse()
.union(existing)
.uniq()
.without(topicId)
.first(5)
.value();
this.debounceLoadSuggested(lookup);
}
@ -237,7 +238,7 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
if (post.post_number === 1) return;
// double check
if (this.topic && this.topic.posts && this.topic.posts.length > 0 && this.topic.posts.first().post_number !== post.post_number) return;
if (this.topic && this.topic.posts && this.topic.posts.length > 0 && this.topic.posts[0].post_number !== post.post_number) return;
// half mutex
if (this.get('controller.loading')) return;
@ -251,11 +252,11 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
posts = topicView.get('topic.posts');
// Add a scrollTo record to the last post inserted to the DOM
lastPostNum = result.posts.first().post_number;
result.posts.each(function(p) {
lastPostNum = result.posts[0].post_number;
_.each(result.posts,function(post) {
var newPost;
newPost = Discourse.Post.create(p, topicView.get('topic'));
if (p.post_number === lastPostNum) {
newPost = Discourse.Post.create(post, topicView.get('topic'));
if (post.post_number === lastPostNum) {
newPost.set('scrollTo', {
top: $(window).scrollTop(),
height: $(document).height()
@ -292,7 +293,7 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
if (this.get('controller.seenBottom')) return;
// Don't double load ever
if (this.topic.posts.last().post_number !== post.post_number) return;
if (this.topic.posts[this.topic.posts.length-1].post_number !== post.post_number) return;
this.set('controller.loadingBelow', true);
this.set('controller.loading', true);
var opts = $.extend({ postsAfter: post.get('post_number') }, this.get('controller.postFilters'));
@ -303,13 +304,13 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
if (result.at_bottom || result.posts.length === 0) {
topicView.set('controller.seenBottom', 'true');
}
topic.pushPosts(result.posts.map(function(p) {
topic.pushPosts(_.map(result.posts,function(p) {
return Discourse.Post.create(p, topic);
}));
if (result.suggested_topics) {
var suggested = Em.A();
result.suggested_topics.each(function(st) {
suggested.pushObject(Discourse.Topic.create(st));
_.each(result.suggested_topics,function(topic) {
suggested.pushObject(Discourse.Topic.create(topic));
});
topicView.set('topic.suggested_topics', suggested);
}
@ -422,8 +423,8 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
// mark everything on screen read
var topicView = this;
$.each(info.onScreen,function(){
var seen = topicView.postSeen($(rows[this]));
_.each(info.onScreen,function(item){
var seen = topicView.postSeen($(rows[item]));
currentPost = currentPost || seen;
});

View File

@ -21,7 +21,7 @@ Discourse.UserSelector = Discourse.TextField.extend({
},
onChangeItems: function(items) {
items = $.map(items, function(i) {
items = _.map(items, function(i) {
if (i.username) {
return i.username;
} else {
@ -62,4 +62,4 @@ Discourse.UserSelector.reopenClass({
}
});
Discourse.View.registerHelper('userSelector', Discourse.UserSelector);
Discourse.View.registerHelper('userSelector', Discourse.UserSelector);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,195 +0,0 @@
/*
* Sugar Library v1.3.5
*
* Freely distributable and licensed under the MIT-style license.
* Copyright (c) 2012 Andrew Plummer
* http://sugarjs.com/
*
* ---------------------------- */
(function(){var k=true,l=null,n=false;function aa(a){return function(){return a}}var p=Object,q=Array,r=RegExp,s=Date,t=String,u=Number,v=Math,ba=typeof global!=="undefined"?global:this,ca=p.defineProperty&&p.defineProperties,x="Array,Boolean,Date,Function,Number,String,RegExp".split(","),da=y(x[0]),fa=y(x[1]),ga=y(x[2]),z=y(x[3]),A=y(x[4]),C=y(x[5]),D=y(x[6]);function y(a){return function(b){return p.prototype.toString.call(b)==="[object "+a+"]"}}
function ha(a){if(!a.SugarMethods){ia(a,"SugarMethods",{});E(a,n,n,{restore:function(){var b=arguments.length===0,c=F(arguments);G(a.SugarMethods,function(d,e){if(b||c.indexOf(d)>-1)ia(e.wa?a.prototype:a,d,e.method)})},extend:function(b,c,d){E(a,d!==n,c,b)}})}}function E(a,b,c,d){var e=b?a.prototype:a,g;ha(a);G(d,function(f,i){g=e[f];if(typeof c==="function")i=ja(e[f],i,c);if(c!==n||!e[f])ia(e,f,i);a.SugarMethods[f]={wa:b,method:i,Da:g}})}
function H(a,b,c,d,e){var g={};d=C(d)?d.split(","):d;d.forEach(function(f,i){e(g,f,i)});E(a,b,c,g)}function ja(a,b,c){return function(){return a&&(c===k||!c.apply(this,arguments))?a.apply(this,arguments):b.apply(this,arguments)}}function ia(a,b,c){if(ca)p.defineProperty(a,b,{value:c,configurable:k,enumerable:n,writable:k});else a[b]=c}function F(a,b){var c=[],d;for(d=0;d<a.length;d++){c.push(a[d]);b&&b.call(a,a[d],d)}return c}function I(a){return a!==void 0}function K(a){return a===void 0}
function ka(a){return a&&typeof a==="object"}function L(a){return!!a&&p.prototype.toString.call(a)==="[object Object]"&&"hasOwnProperty"in a}function la(a,b){return p.hasOwnProperty.call(a,b)}function G(a,b){for(var c in a)if(la(a,c))if(b.call(a,c,a[c])===n)break}function ma(a,b){G(b,function(c){a[c]=b[c]});return a}function na(a){ma(this,a)}na.prototype.constructor=p;function oa(a,b,c,d){var e=[];a=parseInt(a);for(var g=d<0;!g&&a<=b||g&&a>=b;){e.push(a);c&&c.call(this,a);a+=d||1}return e}
function M(a,b,c){c=v[c||"round"];var d=v.pow(10,v.abs(b||0));if(b<0)d=1/d;return c(a*d)/d}function N(a,b){return M(a,b,"floor")}function P(a,b,c,d){d=v.abs(a).toString(d||10);d=pa(b-d.replace(/\.\d+/,"").length,"0")+d;if(c||a<0)d=(a<0?"-":"+")+d;return d}function qa(a){if(a>=11&&a<=13)return"th";else switch(a%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}
function ra(){return"\t\n\u000b\u000c\r \u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u2028\u2029\u3000\ufeff"}function pa(a,b){return q(v.max(0,I(a)?a:1)+1).join(b||"")}function sa(a,b){var c=a.toString().match(/[^/]*$/)[0];if(b)c=(c+b).split("").sort().join("").replace(/([gimy])\1+/g,"$1");return c}function Q(a){C(a)||(a=t(a));return a.replace(/([\\/'*+?|()\[\]{}.^$])/g,"\\$1")}
function ta(a,b){var c=typeof a,d,e,g,f,i,j;if(c==="string")return a;g=p.prototype.toString.call(a);d=L(a);e=g==="[object Array]";if(a!=l&&d||e){b||(b=[]);if(b.length>1)for(j=b.length;j--;)if(b[j]===a)return"CYC";b.push(a);d=t(a.constructor);f=e?a:p.keys(a).sort();for(j=0;j<f.length;j++){i=e?j:f[j];d+=i+ta(a[i],b)}b.pop()}else d=1/a===-Infinity?"-0":t(a&&a.valueOf?a.valueOf():a);return c+g+d}
function ua(a){var b=p.prototype.toString.call(a);return b==="[object Date]"||b==="[object Array]"||b==="[object String]"||b==="[object Number]"||b==="[object RegExp]"||b==="[object Boolean]"||b==="[object Arguments]"||L(a)}function va(a,b,c){var d=[],e=a.length,g=b[b.length-1]!==n,f;F(b,function(i){if(fa(i))return n;if(g){i%=e;if(i<0)i=e+i}f=c?a.charAt(i)||"":a[i];d.push(f)});return d.length<2?d[0]:d}
function wa(a,b){H(b,k,n,a,function(c,d){c[d+(d==="equal"?"s":"")]=function(){return p[d].apply(l,[this].concat(F(arguments)))}})}ha(p);G(x,function(a,b){ha(ba[b])});
E(p,n,n,{keys:function(a){var b=[];if(!ka(a)&&!D(a)&&!z(a))throw new TypeError("Object required");G(a,function(c){b.push(c)});return b}});
function xa(a,b,c,d){var e=a.length,g=d==-1,f=g?e-1:0;c=isNaN(c)?f:parseInt(c>>0);if(c<0)c=e+c;if(!g&&c<0||g&&c>=e)c=f;for(;g&&c>=0||!g&&c<e;){if(a[c]===b)return c;c+=d}return-1}function ya(a,b,c,d){var e=a.length,g=0,f=I(c);za(b);if(e==0&&!f)throw new TypeError("Reduce called on empty array with no initial value");else if(f)c=c;else{c=a[d?e-1:g];g++}for(;g<e;){f=d?e-g-1:g;if(f in a)c=b(c,a[f],f,a);g++}return c}function za(a){if(!a||!a.call)throw new TypeError("Callback is not callable");}
function Aa(a){if(a.length===0)throw new TypeError("First argument must be defined");}E(q,n,n,{isArray:function(a){return da(a)}});
E(q,k,n,{every:function(a,b){var c=this.length,d=0;for(Aa(arguments);d<c;){if(d in this&&!a.call(b,this[d],d,this))return n;d++}return k},some:function(a,b){var c=this.length,d=0;for(Aa(arguments);d<c;){if(d in this&&a.call(b,this[d],d,this))return k;d++}return n},map:function(a,b){var c=this.length,d=0,e=Array(c);for(Aa(arguments);d<c;){if(d in this)e[d]=a.call(b,this[d],d,this);d++}return e},filter:function(a,b){var c=this.length,d=0,e=[];for(Aa(arguments);d<c;){d in this&&a.call(b,this[d],d,this)&&
e.push(this[d]);d++}return e},indexOf:function(a,b){if(C(this))return this.indexOf(a,b);return xa(this,a,b,1)},lastIndexOf:function(a,b){if(C(this))return this.lastIndexOf(a,b);return xa(this,a,b,-1)},forEach:function(a,b){var c=this.length,d=0;for(za(a);d<c;){d in this&&a.call(b,this[d],d,this);d++}},reduce:function(a,b){return ya(this,a,b)},reduceRight:function(a,b){return ya(this,a,b,k)}});
E(Function,k,n,{bind:function(a){var b=this,c=F(arguments).slice(1),d;if(!z(this))throw new TypeError("Function.prototype.bind called on a non-function");d=function(){return b.apply(b.prototype&&this instanceof b?this:a,c.concat(F(arguments)))};d.prototype=this.prototype;return d}});E(s,n,n,{now:function(){return(new s).getTime()}});
(function(){var a=ra().match(/^\s+$/);try{t.prototype.trim.call([1])}catch(b){a=n}E(t,k,!a,{trim:function(){return this.toString().trimLeft().trimRight()},trimLeft:function(){return this.replace(r("^["+ra()+"]+"),"")},trimRight:function(){return this.replace(r("["+ra()+"]+$"),"")}})})();
(function(){var a=new s(s.UTC(1999,11,31));a=a.toISOString&&a.toISOString()==="1999-12-31T00:00:00.000Z";H(s,k,!a,"toISOString,toJSON",function(b,c){b[c]=function(){return P(this.getUTCFullYear(),4)+"-"+P(this.getUTCMonth()+1,2)+"-"+P(this.getUTCDate(),2)+"T"+P(this.getUTCHours(),2)+":"+P(this.getUTCMinutes(),2)+":"+P(this.getUTCSeconds(),2)+"."+P(this.getUTCMilliseconds(),3)+"Z"}})})();
function Ba(a,b,c,d){var e=k;if(a===b)return k;else if(D(b)&&C(a))return r(b).test(a);else if(z(b)&&!z(a))return b.apply(c,d);else if(L(b)&&ka(a)){G(b,function(g){Ba(a[g],b[g],c,[a[g],a])||(e=n)});return e}else return ua(a)&&ua(b)?ta(a)===ta(b):a===b}function R(a,b,c,d){return K(b)?a:z(b)?b.apply(c,d||[]):z(a[b])?a[b].call(a):a[b]}
function T(a,b,c,d){var e,g;if(c<0)c=a.length+c;g=isNaN(c)?0:c;for(c=d===k?a.length+g:a.length;g<c;){e=g%a.length;if(e in a){if(b.call(a,a[e],e,a)===n)break}else return Ca(a,b,g,d);g++}}function Ca(a,b,c){var d=[],e;for(e in a)e in a&&e>>>0==e&&e!=4294967295&&e>=c&&d.push(parseInt(e));d.sort().each(function(g){return b.call(a,a[g],g,a)});return a}function Ea(a,b,c,d,e){var g,f;T(a,function(i,j,h){if(Ba(i,b,h,[i,j,h])){g=i;f=j;return n}},c,d);return e?f:g}
function Fa(a,b){var c=[],d={},e;T(a,function(g,f){e=b?R(g,b,a,[g,f,a]):g;Ga(d,e)||c.push(g)});return c}function Ha(a,b,c){var d=[],e={};b.each(function(g){Ga(e,g)});a.each(function(g){var f=ta(g),i=!ua(g);if(Ia(e,f,g,i)!=c){var j=0;if(i)for(f=e[f];j<f.length;)if(f[j]===g)f.splice(j,1);else j+=1;else delete e[f];d.push(g)}});return d}function Ja(a,b,c){b=b||Infinity;c=c||0;var d=[];T(a,function(e){if(da(e)&&c<b)d=d.concat(Ja(e,b,c+1));else d.push(e)});return d}
function Ka(a){var b=[];F(a,function(c){b=b.concat(c)});return b}function Ia(a,b,c,d){var e=b in a;if(d){a[b]||(a[b]=[]);e=a[b].indexOf(c)!==-1}return e}function Ga(a,b){var c=ta(b),d=!ua(b),e=Ia(a,c,b,d);if(d)a[c].push(b);else a[c]=b;return e}function La(a,b,c,d){var e,g=[],f=c==="max",i=c==="min",j=Array.isArray(a);G(a,function(h){var m=a[h];h=R(m,b,a,j?[m,parseInt(h),a]:[]);if(h===e)g.push(m);else if(K(e)||f&&h>e||i&&h<e){g=[m];e=h}});j||(g=Ja(g,1));return d?g:g[0]}
function Ma(a){if(q[Na])a=a.toLowerCase();return a.replace(q[Oa],"")}function Pa(a,b){var c=a.charAt(b);return(q[Qa]||{})[c]||c}function Ra(a){var b=q[Sa];return a?b.indexOf(a):l}var Sa="AlphanumericSortOrder",Oa="AlphanumericSortIgnore",Na="AlphanumericSortIgnoreCase",Qa="AlphanumericSortEquivalents";E(q,n,n,{create:function(){var a=[],b;F(arguments,function(c){if(ka(c)){b=q.prototype.slice.call(c);if(b.length>0)c=b}a=a.concat(c)});return a}});
E(q,k,n,{find:function(a,b,c){return Ea(this,a,b,c)},findAll:function(a,b,c){var d=[];T(this,function(e,g,f){Ba(e,a,f,[e,g,f])&&d.push(e)},b,c);return d},findIndex:function(a,b,c){a=Ea(this,a,b,c,k);return K(a)?-1:a},count:function(a){if(K(a))return this.length;return this.findAll(a).length},removeAt:function(a,b){if(K(a))return this;if(K(b))b=a;for(var c=0;c<=b-a;c++)this.splice(a,1);return this},include:function(a,b){return this.clone().add(a,b)},exclude:function(){return q.prototype.remove.apply(this.clone(),
arguments)},clone:function(){return ma([],this)},unique:function(a){return Fa(this,a)},flatten:function(a){return Ja(this,a)},union:function(){return Fa(this.concat(Ka(arguments)))},intersect:function(){return Ha(this,Ka(arguments),n)},subtract:function(){return Ha(this,Ka(arguments),k)},at:function(){return va(this,arguments)},first:function(a){if(K(a))return this[0];if(a<0)a=0;return this.slice(0,a)},last:function(a){if(K(a))return this[this.length-1];return this.slice(this.length-a<0?0:this.length-
a)},from:function(a){return this.slice(a)},to:function(a){if(K(a))a=this.length;return this.slice(0,a)},min:function(a,b){return La(this,a,"min",b)},max:function(a,b){return La(this,a,"max",b)},least:function(a,b){return La(this.groupBy.apply(this,[a]),"length","min",b)},most:function(a,b){return La(this.groupBy.apply(this,[a]),"length","max",b)},sum:function(a){a=a?this.map(a):this;return a.length>0?a.reduce(function(b,c){return b+c}):0},average:function(a){a=a?this.map(a):this;return a.length>0?
a.sum()/a.length:0},inGroups:function(a,b){var c=arguments.length>1,d=this,e=[],g=M(this.length/a,void 0,"ceil");oa(0,a-1,function(f){f=f*g;var i=d.slice(f,f+g);c&&i.length<g&&oa(1,g-i.length,function(){i=i.add(b)});e.push(i)});return e},inGroupsOf:function(a,b){var c=[],d=this.length,e=this,g;if(d===0||a===0)return e;if(K(a))a=1;if(K(b))b=l;oa(0,M(d/a,void 0,"ceil")-1,function(f){for(g=e.slice(a*f,a*f+a);g.length<a;)g.push(b);c.push(g)});return c},isEmpty:function(){return this.compact().length==
0},sortBy:function(a,b){var c=this.clone();c.sort(function(d,e){var g,f;g=R(d,a,c,[d]);f=R(e,a,c,[e]);if(C(g)&&C(f)){g=g;f=f;var i,j,h,m,o=0,w=0;g=Ma(g);f=Ma(f);do{h=Pa(g,o);m=Pa(f,o);i=Ra(h);j=Ra(m);if(i===-1||j===-1){i=g.charCodeAt(o)||l;j=f.charCodeAt(o)||l}h=h!==g.charAt(o);m=m!==f.charAt(o);if(h!==m&&w===0)w=h-m;o+=1}while(i!=l&&j!=l&&i===j);g=i===j?w:i<j?-1:1}else g=g<f?-1:g>f?1:0;return g*(b?-1:1)});return c},randomize:function(){for(var a=this.concat(),b,c,d=a.length;d;b=parseInt(v.random()*
d),c=a[--d],a[d]=a[b],a[b]=c);return a},zip:function(){var a=F(arguments);return this.map(function(b,c){return[b].concat(a.map(function(d){return c in d?d[c]:l}))})},sample:function(a){var b=[],c=this.clone(),d;if(K(a))a=1;for(;b.length<a;){d=N(v.random()*(c.length-1));b.push(c[d]);c.removeAt(d);if(c.length==0)break}return arguments.length>0?b:b[0]},each:function(a,b,c){T(this,a,b,c);return this},add:function(a,b){if(!A(u(b))||isNaN(b))b=this.length;q.prototype.splice.apply(this,[b,0].concat(a));
return this},remove:function(){var a,b=this;F(arguments,function(c){for(a=0;a<b.length;)if(Ba(b[a],c,b,[b[a],a,b]))b.splice(a,1);else a++});return b},compact:function(a){var b=[];T(this,function(c){if(da(c))b.push(c.compact());else if(a&&c)b.push(c);else!a&&c!=l&&c.valueOf()===c.valueOf()&&b.push(c)});return b},groupBy:function(a,b){var c=this,d={},e;T(c,function(g,f){e=R(g,a,c,[g,f,c]);d[e]||(d[e]=[]);d[e].push(g)});b&&G(d,b);return d},none:function(){return!this.any.apply(this,arguments)}});
E(q,k,n,{all:q.prototype.every,any:q.prototype.some,insert:q.prototype.add});function Ta(a){if(a&&a.valueOf)a=a.valueOf();return p.keys(a)}function Ua(a,b){H(p,n,n,a,function(c,d){c[d]=function(e,g,f){f=q.prototype[d].call(Ta(e),function(i){return b?R(e[i],g,e,[i,e[i],e]):Ba(e[i],g,e,[i,e[i],e])},f);if(da(f))f=f.reduce(function(i,j){i[j]=e[j];return i},{});return f}});wa(a,na)}
E(p,n,n,{map:function(a,b){return Ta(a).reduce(function(c,d){c[d]=R(a[d],b,a,[d,a[d],a]);return c},{})},reduce:function(a){var b=Ta(a).map(function(c){return a[c]});return b.reduce.apply(b,F(arguments).slice(1))},size:function(a){return Ta(a).length}});(function(){H(q,k,function(){var a=arguments;return a.length>0&&!z(a[0])},"map,every,all,some,any,none,filter",function(a,b){a[b]=function(c){return this[b](function(d,e){return b==="map"?R(d,c,this,[d,e,this]):Ba(d,c,this,[d,e,this])})}})})();
(function(){q[Sa]="A\u00c1\u00c0\u00c2\u00c3\u0104BC\u0106\u010c\u00c7D\u010e\u00d0E\u00c9\u00c8\u011a\u00ca\u00cb\u0118FG\u011eH\u0131I\u00cd\u00cc\u0130\u00ce\u00cfJKL\u0141MN\u0143\u0147\u00d1O\u00d3\u00d2\u00d4PQR\u0158S\u015a\u0160\u015eT\u0164U\u00da\u00d9\u016e\u00db\u00dcVWXY\u00ddZ\u0179\u017b\u017d\u00de\u00c6\u0152\u00d8\u00d5\u00c5\u00c4\u00d6".split("").map(function(b){return b+b.toLowerCase()}).join("");var a={};T("A\u00c1\u00c0\u00c2\u00c3\u00c4,C\u00c7,E\u00c9\u00c8\u00ca\u00cb,I\u00cd\u00cc\u0130\u00ce\u00cf,O\u00d3\u00d2\u00d4\u00d5\u00d6,S\u00df,U\u00da\u00d9\u00db\u00dc".split(","),
function(b){var c=b.charAt(0);T(b.slice(1).split(""),function(d){a[d]=c;a[d.toLowerCase()]=c.toLowerCase()})});q[Na]=k;q[Qa]=a})();Ua("each,any,all,none,count,find,findAll,isEmpty");Ua("sum,average,min,max,least,most",k);wa("map,reduce,size",na);
var U,Va,Wa=["ampm","hour","minute","second","ampm","utc","offset_sign","offset_hours","offset_minutes","ampm"],Xa="({t})?\\s*(\\d{1,2}(?:[,.]\\d+)?)(?:{h}(\\d{1,2}(?:[,.]\\d+)?)?{m}(?::?(\\d{1,2}(?:[,.]\\d+)?){s})?\\s*(?:({t})|(Z)|(?:([+-])(\\d{2,2})(?::?(\\d{2,2}))?)?)?|\\s*({t}))",Ya={},Za,$a,ab,bb=[],cb=[{ba:"f{1,4}|ms|milliseconds",format:function(a){return V(a,"Milliseconds")}},{ba:"ss?|seconds",format:function(a){return V(a,"Seconds")}},{ba:"mm?|minutes",format:function(a){return V(a,"Minutes")}},
{ba:"hh?|hours|12hr",format:function(a){a=V(a,"Hours");return a===0?12:a-N(a/13)*12}},{ba:"HH?|24hr",format:function(a){return V(a,"Hours")}},{ba:"dd?|date|day",format:function(a){return V(a,"Date")}},{ba:"dow|weekday",la:k,format:function(a,b,c){a=V(a,"Day");return b.weekdays[a+(c-1)*7]}},{ba:"MM?",format:function(a){return V(a,"Month")+1}},{ba:"mon|month",la:k,format:function(a,b,c){a=V(a,"Month");return b.months[a+(c-1)*12]}},{ba:"y{2,4}|year",format:function(a){return V(a,"FullYear")}},{ba:"[Tt]{1,2}",
format:function(a,b,c,d){if(b.ampm.length==0)return"";a=V(a,"Hours");b=b.ampm[N(a/12)];if(d.length===1)b=b.slice(0,1);if(d.slice(0,1)==="T")b=b.toUpperCase();return b}},{ba:"z{1,4}|tz|timezone",text:k,format:function(a,b,c,d){a=a.getUTCOffset();if(d=="z"||d=="zz")a=a.replace(/(\d{2})(\d{2})/,function(e,g){return P(g,d.length)});return a}},{ba:"iso(tz|timezone)",format:function(a){return a.getUTCOffset(k)}},{ba:"ord",format:function(a){a=V(a,"Date");return a+qa(a)}}],db=[{$:"year",method:"FullYear",
ja:k,da:function(a){return(365+(a?a.isLeapYear()?1:0:0.25))*24*60*60*1E3}},{$:"month",method:"Month",ja:k,da:function(a,b){var c=30.4375,d;if(a){d=a.daysInMonth();if(b<=d.days())c=d}return c*24*60*60*1E3}},{$:"week",method:"Week",da:aa(6048E5)},{$:"day",method:"Date",ja:k,da:aa(864E5)},{$:"hour",method:"Hours",da:aa(36E5)},{$:"minute",method:"Minutes",da:aa(6E4)},{$:"second",method:"Seconds",da:aa(1E3)},{$:"millisecond",method:"Milliseconds",da:aa(1)}],eb={};
function fb(a){ma(this,a);this.ga=bb.concat()}
fb.prototype={getMonth:function(a){return A(a)?a-1:this.months.indexOf(a)%12},getWeekday:function(a){return this.weekdays.indexOf(a)%7},oa:function(a){var b;return A(a)?a:a&&(b=this.numbers.indexOf(a))!==-1?(b+1)%10:1},ta:function(a){var b=this;return a.replace(r(this.num,"g"),function(c){return b.oa(c)||""})},ra:function(a){return U.units[this.units.indexOf(a)%8]},ua:function(a){return this.na(a,a[2]>0?"future":"past")},qa:function(a){return this.na(gb(a),"duration")},va:function(a){a=a||this.code;
return a==="en"||a==="en-US"?k:this.variant},ya:function(a){return a===this.ampm[0]},za:function(a){return a&&a===this.ampm[1]},na:function(a,b){var c,d,e=a[0],g=a[1],f=a[2],i=this[b]||this.relative;if(z(i))return i.call(this,e,g,f,b);d=this.units[(this.plural&&e>1?1:0)*8+g]||this.units[g];if(this.capitalizeUnit)d=hb(d);c=this.modifiers.filter(function(j){return j.name=="sign"&&j.value==(f>0?1:-1)})[0];return i.replace(/\{(.*?)\}/g,function(j,h){switch(h){case "num":return e;case "unit":return d;
case "sign":return c.src}})},sa:function(){return this.ma?[this.ma].concat(this.ga):this.ga},addFormat:function(a,b,c,d,e){var g=c||[],f=this,i;a=a.replace(/\s+/g,"[-,. ]*");a=a.replace(/\{([^,]+?)\}/g,function(j,h){var m,o,w,B=h.match(/\?$/);w=h.match(/^(\d+)\??$/);var J=h.match(/(\d)(?:-(\d))?/),O=h.replace(/[^a-z]+$/,"");if(w)m=f.tokens[w[1]];else if(f[O])m=f[O];else if(f[O+"s"]){m=f[O+"s"];if(J){o=[];m.forEach(function(ea,Da){var S=Da%(f.units?8:m.length);if(S>=J[1]&&S<=(J[2]||J[1]))o.push(ea)});
m=o}m=ib(m)}if(w)w="(?:"+m+")";else{c||g.push(O);w="("+m+")"}if(B)w+="?";return w});if(b){b=jb(Xa,f,e);e=["t","[\\s\\u3000]"].concat(f.timeMarker);i=a.match(/\\d\{\d,\d\}\)+\??$/);kb(f,"(?:"+b+")[,\\s\\u3000]+?"+a,Wa.concat(g),d);kb(f,a+"(?:[,\\s]*(?:"+e.join("|")+(i?"+":"*")+")"+b+")?",g.concat(Wa),d)}else kb(f,a,g,d)}};function lb(a,b){var c;C(a)||(a="");c=eb[a]||eb[a.slice(0,2)];if(b===n&&!c)throw Error("Invalid locale.");return c||Va}
function mb(a,b){function c(j){var h=f[j];if(C(h))f[j]=h.split(",");else h||(f[j]=[])}function d(j,h){j=j.split("+").map(function(m){return m.replace(/(.+):(.+)$/,function(o,w,B){return B.split("|").map(function(J){return w+J}).join("|")})}).join("|");return j.split("|").forEach(h)}function e(j,h,m){var o=[];f[j].forEach(function(w,B){if(h)w+="+"+w.slice(0,3);d(w,function(J,O){o[O*m+B]=J.toLowerCase()})});f[j]=o}function g(j,h,m){j="\\d{"+j+","+h+"}";if(m)j+="|(?:"+ib(f.numbers)+")+";return j}var f,
i;f=new fb(b);c("modifiers");"months,weekdays,units,numbers,articles,tokens,timeMarker,ampm,timeSuffixes,dateParse,timeParse".split(",").forEach(c);i=!f.monthSuffix;e("months",i,12);e("weekdays",i,7);e("units",n,8);e("numbers",n,10);f.code=a;f.date=g(1,2,f.digitDate);f.year=g(4,4);f.num=function(){var j=["\\d+"].concat(f.articles);if(f.numbers)j=j.concat(f.numbers);return ib(j)}();(function(){var j=[];f.ha={};f.modifiers.forEach(function(h){var m=h.name;d(h.src,function(o){var w=f[m];f.ha[o]=h;j.push({name:m,
src:o,value:h.value});f[m]=w?w+"|"+o:o})});f.day+="|"+ib(f.weekdays);f.modifiers=j})();if(f.monthSuffix){f.month=g(1,2);f.months=oa(1,12).map(function(j){return j+f.monthSuffix})}f.full_month=g(1,2)+"|"+ib(f.months);f.timeSuffixes.length>0&&f.addFormat(jb(Xa,f),n,Wa);f.addFormat("{day}",k);f.addFormat("{month}"+(f.monthSuffix||""));f.addFormat("{year}"+(f.yearSuffix||""));f.timeParse.forEach(function(j){f.addFormat(j,k)});f.dateParse.forEach(function(j){f.addFormat(j)});return eb[a]=f}
function kb(a,b,c,d){a.ga.unshift({Ba:d,xa:a,Aa:r("^"+b+"$","i"),to:c})}function hb(a){return a.slice(0,1).toUpperCase()+a.slice(1)}function ib(a){return a.filter(function(b){return!!b}).join("|")}function nb(a,b){var c;if(L(a[0]))return a;else if(A(a[0])&&!A(a[1]))return[a[0]];else if(C(a[0])&&b)return[ob(a[0]),a[1]];c={};$a.forEach(function(d,e){c[d.$]=a[e]});return[c]}
function ob(a,b){var c={};if(match=a.match(/^(\d+)?\s?(\w+?)s?$/i)){if(K(b))b=parseInt(match[1])||1;c[match[2].toLowerCase()]=b}return c}function pb(a,b){var c={},d,e;b.forEach(function(g,f){d=a[f+1];if(!(K(d)||d==="")){if(g==="year")c.Ca=d;e=parseFloat(d.replace(/,/,"."));c[g]=!isNaN(e)?e:d.toLowerCase()}});return c}function qb(a){a=a.trim().replace(/^(just )?now|\.+$/i,"");return rb(a)}
function rb(a){return a.replace(Za,function(b,c,d){var e=0,g=1,f,i;if(c)return b;d.split("").reverse().forEach(function(j){j=Ya[j];var h=j>9;if(h){if(f)e+=g;g*=j/(i||1);i=j}else{if(f===n)g*=10;e+=g*j}f=h});if(f)e+=g;return e})}
function sb(a,b,c,d){var e=new s,g=n,f,i,j,h,m,o,w,B,J;e.utc(d);if(ga(a))e=new s(a.getTime());else if(A(a))e=new s(a);else if(L(a)){e.set(a,k);h=a}else if(C(a)){f=lb(b);a=qb(a);f&&G(f.sa(),function(O,ea){var Da=a.match(ea.Aa);if(Da){j=ea;i=j.xa;h=pb(Da,j.to,i);h.utc&&e.utc();i.ma=j;if(h.timestamp){h=h.timestamp;return n}if(j.Ba&&!C(h.month)&&(C(h.date)||f.va(b))){B=h.month;h.month=h.date;h.date=B}if(h.year&&h.Ca.length===2)h.year=M(V(new s,"FullYear")/100)*100-M(h.year/100)*100+h.year;if(h.month){h.month=
i.getMonth(h.month);if(h.shift&&!h.unit)h.unit=i.units[7]}if(h.weekday&&h.date)delete h.weekday;else if(h.weekday){h.weekday=i.getWeekday(h.weekday);if(h.shift&&!h.unit)h.unit=i.units[5]}if(h.day&&(B=i.ha[h.day])){h.day=B.value;e.reset();g=k}else if(h.day&&(o=i.getWeekday(h.day))>-1){delete h.day;if(h.num&&h.month){J=function(){var S=e.getWeekday();e.setWeekday(7*(h.num-1)+(S>o?o+7:o))};h.day=1}else h.weekday=o}if(h.date&&!A(h.date))h.date=i.ta(h.date);if(i.za(h.ampm)&&h.hour<12)h.hour+=12;else if(i.ya(h.ampm)&&
h.hour===12)h.hour=0;if("offset_hours"in h||"offset_minutes"in h){e.utc();h.offset_minutes=h.offset_minutes||0;h.offset_minutes+=h.offset_hours*60;if(h.offset_sign==="-")h.offset_minutes*=-1;h.minute-=h.offset_minutes}if(h.unit){g=k;w=i.oa(h.num);m=i.ra(h.unit);if(h.shift||h.edge){w*=(B=i.ha[h.shift])?B.value:0;if(m==="month"&&I(h.date)){e.set({day:h.date},k);delete h.date}if(m==="year"&&I(h.month)){e.set({month:h.month,day:h.date},k);delete h.month;delete h.date}}if(h.sign&&(B=i.ha[h.sign]))w*=B.value;
if(I(h.weekday)){e.set({weekday:h.weekday},k);delete h.weekday}h[m]=(h[m]||0)+w}if(h.year_sign==="-")h.year*=-1;ab.slice(1,4).forEach(function(S,Ub){var zb=h[S.$],Ab=zb%1;if(Ab){h[ab[Ub].$]=M(Ab*(S.$==="second"?1E3:60));h[S.$]=N(zb)}});return n}});if(j)if(g)e.advance(h);else{e._utc&&e.reset();tb(e,h,k,n,c)}else e=a?new s(a):new s;if(h&&h.edge){B=i.ha[h.edge];G(ab.slice(4),function(O,ea){if(I(h[ea.$])){m=ea.$;return n}});if(m==="year")h.fa="month";else if(m==="month"||m==="week")h.fa="day";e[(B.value<
0?"endOf":"beginningOf")+hb(m)]();B.value===-2&&e.reset()}J&&J()}e.utc(n);return{ea:e,set:h}}function gb(a){var b,c=v.abs(a),d=c,e=0;ab.slice(1).forEach(function(g,f){b=N(M(c/g.da()*10)/10);if(b>=1){d=b;e=f+1}});return[d,e,a]}
function ub(a,b,c,d){var e,g=lb(d),f=r(/^[A-Z]/);if(a.isValid())if(Date[b])b=Date[b];else{if(z(b)){e=gb(a.millisecondsFromNow());b=b.apply(a,e.concat(g))}}else return"Invalid Date";if(!b&&c){e=e||gb(a.millisecondsFromNow());if(e[1]===0){e[1]=1;e[0]=1}return g.ua(e)}b=b||"long";b=g[b]||b;cb.forEach(function(i){b=b.replace(r("\\{("+i.ba+")(\\d)?\\}",i.la?"i":""),function(j,h,m){j=i.format(a,g,m||1,h);m=h.length;var o=h.match(/^(.)\1+$/);if(i.la){if(m===3)j=j.slice(0,3);if(o||h.match(f))j=hb(j)}else if(o&&
!i.text)j=(A(j)?P(j,m):j.toString()).slice(-m);return j})});return b}
function vb(a,b,c,d){var e=sb(b,l,l,d),g=0;d=b=0;var f;if(c>0){b=d=c;f=k}if(!e.ea.isValid())return n;if(e.set&&e.set.fa){db.forEach(function(j){if(j.$===e.set.fa)g=j.da(e.ea,a-e.ea)-1});c=hb(e.set.fa);if(e.set.edge||e.set.shift)e.ea["beginningOf"+c]();if(e.set.fa==="month")i=e.ea.clone()["endOf"+c]().getTime();if(!f&&e.set.sign&&e.set.fa!="millisecond"){b=50;d=-50}}f=a.getTime();c=e.ea.getTime();var i=i||c+g;return f>=c-b&&f<=i+d}
function tb(a,b,c,d,e){function g(h){return I(b[h])?b[h]:b[h+"s"]}function f(h){return I(g(h))}var i,j;if(A(b)&&d)b={milliseconds:b};else if(A(b)){a.setTime(b);return a}if(b.date)b.day=b.date;G(ab,function(h,m){var o=m.$==="day";if(f(m.$)||o&&f("weekday")){b.fa=m.$;j=+h;return n}else if(c&&m.$!=="week"&&(!o||!f("week")))W(a,m.method,o?1:0)});db.forEach(function(h){var m=h.$;h=h.method;var o;o=g(m);if(!K(o)){if(d){if(m==="week"){o=(b.day||0)+o*7;h="Date"}o=o*d+V(a,h)}else m==="month"&&f("day")&&W(a,
"Date",15);W(a,h,o);if(d&&m==="month"){m=o;if(m<0)m+=12;m%12!=V(a,"Month")&&W(a,"Date",0)}}});if(!d&&!f("day")&&f("weekday")){i=g("weekday");a.setWeekday(i)}(function(){var h=new s;return e===-1&&a>h||e===1&&a<h})()&&G(ab.slice(j+1),function(h,m){if((m.ja||m.$==="week"&&f("weekday"))&&!(f(m.$)||m.$==="day"&&f("weekday"))){a[m.ia](e);return n}});return a}function V(a,b){return a["get"+(a._utc?"UTC":"")+b]()}function W(a,b,c){return a["set"+(a._utc?"UTC":"")+b](c)}
function jb(a,b,c){var d={h:0,m:1,s:2},e;b=b||U;return a.replace(/{([a-z])}/g,function(g,f){var i=[],j=f==="h",h=j&&!c;if(f==="t")return b.ampm.join("|");else{j&&i.push(":");if(e=b.timeSuffixes[d[f]])i.push(e+"\\s*");return i.length===0?"":"(?:"+i.join("|")+")"+(h?"":"?")}})}function X(a,b,c){var d,e;if(A(a[1]))d=nb(a)[0];else{d=a[0];e=a[1]}return sb(d,e,b,c).ea}
s.extend({create:function(){return X(arguments)},past:function(){return X(arguments,-1)},future:function(){return X(arguments,1)},addLocale:function(a,b){return mb(a,b)},setLocale:function(a){var b=lb(a,n);Va=b;if(a&&a!=b.code)b.code=a;return b},getLocale:function(a){return!a?Va:lb(a,n)},addFormat:function(a,b,c){kb(lb(c),a,b)}},n,n);
s.extend({set:function(){var a=nb(arguments);return tb(this,a[0],a[1])},setWeekday:function(a){if(!K(a))return W(this,"Date",V(this,"Date")+a-V(this,"Day"))},setWeek:function(a){if(!K(a)){V(this,"Date");W(this,"Month",0);W(this,"Date",a*7+1);return this.getTime()}},getWeek:function(){var a=this;a=a.clone();var b=V(a,"Day")||7;a.addDays(4-b).reset();return 1+N(a.daysSince(a.clone().beginningOfYear())/7)},getUTCOffset:function(a){var b=this._utc?0:this.getTimezoneOffset(),c=a===k?":":"";if(!b&&a)return"Z";
return P(M(-b/60),2,k)+c+P(b%60,2)},utc:function(a){this._utc=a===k||arguments.length===0;return this},isUTC:function(){return!!this._utc||this.getTimezoneOffset()===0},advance:function(){var a=nb(arguments,k);return tb(this,a[0],a[1],1)},rewind:function(){var a=nb(arguments,k);return tb(this,a[0],a[1],-1)},isValid:function(){return!isNaN(this.getTime())},isAfter:function(a,b){return this.getTime()>s.create(a).getTime()-(b||0)},isBefore:function(a,b){return this.getTime()<s.create(a).getTime()+(b||
0)},isBetween:function(a,b,c){var d=this.getTime();a=s.create(a).getTime();var e=s.create(b).getTime();b=v.min(a,e);a=v.max(a,e);c=c||0;return b-c<d&&a+c>d},isLeapYear:function(){var a=V(this,"FullYear");return a%4===0&&a%100!==0||a%400===0},daysInMonth:function(){return 32-V(new s(V(this,"FullYear"),V(this,"Month"),32),"Date")},format:function(a,b){return ub(this,a,n,b)},relative:function(a,b){if(C(a)){b=a;a=l}return ub(this,a,k,b)},is:function(a,b,c){var d,e;if(this.isValid()){if(C(a)){a=a.trim().toLowerCase();
e=this.clone().utc(c);switch(k){case a==="future":return this.getTime()>(new s).getTime();case a==="past":return this.getTime()<(new s).getTime();case a==="weekday":return V(e,"Day")>0&&V(e,"Day")<6;case a==="weekend":return V(e,"Day")===0||V(e,"Day")===6;case (d=U.weekdays.indexOf(a)%7)>-1:return V(e,"Day")===d;case (d=U.months.indexOf(a)%12)>-1:return V(e,"Month")===d}}return vb(this,a,b,c)}},reset:function(a){var b={},c;a=a||"hours";if(a==="date")a="days";c=db.some(function(d){return a===d.$||
a===d.$+"s"});b[a]=a.match(/^days?/)?1:0;return c?this.set(b,k):this},clone:function(){var a=new s(this.getTime());a._utc=this._utc;return a}});s.extend({iso:function(){return this.toISOString()},getWeekday:s.prototype.getDay,getUTCWeekday:s.prototype.getUTCDay});
function wb(a,b){function c(){return M(this*b)}function d(){return X(arguments)[a.ia](this)}function e(){return X(arguments)[a.ia](-this)}var g=a.$,f={};f[g]=c;f[g+"s"]=c;f[g+"Before"]=e;f[g+"sBefore"]=e;f[g+"Ago"]=e;f[g+"sAgo"]=e;f[g+"After"]=d;f[g+"sAfter"]=d;f[g+"FromNow"]=d;f[g+"sFromNow"]=d;u.extend(f)}u.extend({duration:function(a){return lb(a).qa(this)}});
U=Va=s.addLocale("en",{plural:k,timeMarker:"at",ampm:"am,pm",months:"January,February,March,April,May,June,July,August,September,October,November,December",weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",units:"millisecond:|s,second:|s,minute:|s,hour:|s,day:|s,week:|s,month:|s,year:|s",numbers:"one,two,three,four,five,six,seven,eight,nine,ten",articles:"a,an,the",tokens:"the,st|nd|rd|th,of","short":"{Month} {d}, {yyyy}","long":"{Month} {d}, {yyyy} {h}:{mm}{tt}",full:"{Weekday} {Month} {d}, {yyyy} {h}:{mm}:{ss}{tt}",
past:"{num} {unit} {sign}",future:"{num} {unit} {sign}",duration:"{num} {unit}",modifiers:[{name:"day",src:"yesterday",value:-1},{name:"day",src:"today",value:0},{name:"day",src:"tomorrow",value:1},{name:"sign",src:"ago|before",value:-1},{name:"sign",src:"from now|after|from|in|later",value:1},{name:"edge",src:"last day",value:-2},{name:"edge",src:"end",value:-1},{name:"edge",src:"first day|beginning",value:1},{name:"shift",src:"last",value:-1},{name:"shift",src:"the|this",value:0},{name:"shift",
src:"next",value:1}],dateParse:["{num} {unit} {sign}","{sign} {num} {unit}","{month} {year}","{shift} {unit=5-7}","{0?} {date}{1}","{0?} {edge} of {shift?} {unit=4-7?}{month?}{year?}"],timeParse:["{0} {num}{1} {day} of {month} {year?}","{weekday?} {month} {date}{1?} {year?}","{date} {month} {year}","{shift} {weekday}","{shift} week {weekday}","{weekday} {2?} {shift} week","{num} {unit=4-5} {sign} {day}","{0?} {date}{1} of {month}","{0?}{month?} {date?}{1?} of {shift} {unit=6-7}"]});ab=db.concat().reverse();
$a=db.concat();$a.splice(2,1);
H(s,k,n,db,function(a,b,c){var d=b.$,e=hb(d),g=b.da(),f,i;b.ia="add"+e+"s";f=function(j,h){return M((this.getTime()-s.create(j,h).getTime())/g)};i=function(j,h){return M((s.create(j,h).getTime()-this.getTime())/g)};a[d+"sAgo"]=i;a[d+"sUntil"]=i;a[d+"sSince"]=f;a[d+"sFromNow"]=f;a[b.ia]=function(j,h){var m={};m[d]=j;return this.advance(m,h)};wb(b,g);c<3&&["Last","This","Next"].forEach(function(j){a["is"+j+e]=function(){return this.is(j+" "+d)}});if(c<4){a["beginningOf"+e]=function(){var j={};switch(d){case "year":j.year=
V(this,"FullYear");break;case "month":j.month=V(this,"Month");break;case "day":j.day=V(this,"Date");break;case "week":j.weekday=0}return this.set(j,k)};a["endOf"+e]=function(){var j={hours:23,minutes:59,seconds:59,milliseconds:999};switch(d){case "year":j.month=11;j.day=31;break;case "month":j.day=this.daysInMonth();break;case "week":j.weekday=6}return this.set(j,k)}}});U.addFormat("([+-])?(\\d{4,4})[-.]?{full_month}[-.]?(\\d{1,2})?",k,["year_sign","year","month","date"],n,k);
U.addFormat("(\\d{1,2})[-.\\/]{full_month}(?:[-.\\/](\\d{2,4}))?",k,["date","month","year"],k);U.addFormat("{full_month}[-.](\\d{4,4})",n,["month","year"]);U.addFormat("\\/Date\\((\\d+(?:\\+\\d{4,4})?)\\)\\/",n,["timestamp"]);U.addFormat(jb(Xa,U),n,Wa);bb=U.ga.slice(0,7).reverse();U.ga=U.ga.slice(7).concat(bb);H(s,k,n,"short,long,full",function(a,b){a[b]=function(c){return ub(this,b,n,c)}});
"\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e\u5343\u4e07".split("").forEach(function(a,b){if(b>9)b=v.pow(10,b-9);Ya[a]=b});"\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19".split("").forEach(function(a,b){Ya[a]=b});Za=r("([\u671f\u9031\u5468])?([\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e\u5343\u4e07\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19]+)(?!\u6628)","g");
(function(){var a="today,yesterday,tomorrow,weekday,weekend,future,past".split(","),b=U.weekdays.slice(0,7),c=U.months.slice(0,12);H(s,k,n,a.concat(b).concat(c),function(d,e){d["is"+hb(e)]=function(g){return this.is(e,0,g)}})})();(function(){s.extend({utc:{create:function(){return X(arguments,0,k)},past:function(){return X(arguments,-1,k)},future:function(){return X(arguments,1,k)}}},n,n)})();
s.extend({RFC1123:"{Dow}, {dd} {Mon} {yyyy} {HH}:{mm}:{ss} {tz}",RFC1036:"{Weekday}, {dd}-{Mon}-{yy} {HH}:{mm}:{ss} {tz}",ISO8601_DATE:"{yyyy}-{MM}-{dd}",ISO8601_DATETIME:"{yyyy}-{MM}-{dd}T{HH}:{mm}:{ss}.{fff}{isotz}"},n,n);
DateRange=function(a,b){this.start=s.create(a);this.end=s.create(b)};DateRange.prototype.toString=function(){return this.isValid()?this.start.full()+".."+this.end.full():"Invalid DateRange"};
E(DateRange,k,n,{isValid:function(){return this.start<this.end},duration:function(){return this.isValid()?this.end.getTime()-this.start.getTime():NaN},contains:function(a){var b=this;return(a.start&&a.end?[a.start,a.end]:[a]).every(function(c){return c>=b.start&&c<=b.end})},every:function(a,b){var c=this.start.clone(),d=[],e=0,g,f;if(C(a)){c.advance(ob(a,0),k);g=ob(a);f=a.toLowerCase()==="day"}else g={milliseconds:a};for(;c<=this.end;){d.push(c);b&&b(c,e);if(f&&V(c,"Hours")===23){c=c.clone();W(c,
"Hours",48)}else c=c.clone().advance(g,k);e++}return d},union:function(a){return new DateRange(this.start<a.start?this.start:a.start,this.end>a.end?this.end:a.end)},intersect:function(a){return new DateRange(this.start>a.start?this.start:a.start,this.end<a.end?this.end:a.end)}});H(DateRange,k,n,"Millisecond,Second,Minute,Hour,Day,Week,Month,Year",function(a,b){a["each"+b]=function(c){return this.every(b,c)}});E(s,n,n,{range:function(a,b){return new DateRange(a,b)}});
function xb(a,b,c,d,e){var g;if(!a.timers)a.timers=[];A(b)||(b=0);a.timers.push(setTimeout(function(){a.timers.splice(g,1);c.apply(d,e||[])},b));g=a.timers.length}
E(Function,k,n,{lazy:function(a,b){function c(){if(!(g&&e.length>b-2)){e.push([this,arguments]);f()}}var d=this,e=[],g=n,f,i,j;a=a||1;b=b||Infinity;i=M(a,void 0,"ceil");j=M(i/a);f=function(){if(!(g||e.length==0)){for(var h=v.max(e.length-j,0);e.length>h;)Function.prototype.apply.apply(d,e.shift());xb(c,i,function(){g=n;f()});g=k}};return c},delay:function(a){var b=F(arguments).slice(1);xb(this,a,this,this,b);return this},throttle:function(a){return this.lazy(a,1)},debounce:function(a){function b(){b.cancel();
xb(b,a,c,this,arguments)}var c=this;return b},cancel:function(){if(da(this.timers))for(;this.timers.length>0;)clearTimeout(this.timers.shift());return this},after:function(a){var b=this,c=0,d=[];if(A(a)){if(a===0){b.call();return b}}else a=1;return function(){var e;d.push(F(arguments));c++;if(c==a){e=b.call(this,d);c=0;d=[];return e}}},once:function(){var a=this;return function(){return la(a,"memo")?a.memo:a.memo=a.apply(this,arguments)}},fill:function(){var a=this,b=F(arguments);return function(){var c=
F(arguments);b.forEach(function(d,e){if(d!=l||e>=c.length)c.splice(e,0,d)});return a.apply(this,c)}}});
function yb(a,b,c,d,e,g){var f=a.toFixed(20),i=f.search(/\./);f=f.search(/[1-9]/);i=i-f;if(i>0)i-=1;e=v.max(v.min((i/3).floor(),e===n?c.length:e),-d);d=c.charAt(e+d-1);if(i<-9){e=-3;b=i.abs()-9;d=c.slice(0,1)}return(a/(g?(2).pow(10*e):(10).pow(e*3))).round(b||0).format()+d.trim()}
E(u,n,n,{random:function(a,b){var c,d;if(arguments.length==1){b=a;a=0}c=v.min(a||0,K(b)?1:b);d=v.max(a||0,K(b)?1:b)+1;return N(v.random()*(d-c)+c)}});
E(u,k,n,{log:function(a){return v.log(this)/(a?v.log(a):1)},abbr:function(a){return yb(this,a,"kmbt",0,4)},metric:function(a,b){return yb(this,a,"n\u03bcm kMGTPE",4,K(b)?1:b)},bytes:function(a,b){return yb(this,a,"kMGTPE",0,K(b)?4:b,k)+"B"},isInteger:function(){return this%1==0},isOdd:function(){return!this.isMultipleOf(2)},isEven:function(){return this.isMultipleOf(2)},isMultipleOf:function(a){return this%a===0},format:function(a,b,c){var d,e,g=/(\d+)(\d{3})/;if(t(b).match(/\d/))throw new TypeError("Thousands separator cannot contain numbers.");
d=A(a)?M(this,a||0).toFixed(v.max(a,0)):this.toString();b=b||",";c=c||".";e=d.split(".");d=e[0];for(e=e[1]||"";d.match(g);)d=d.replace(g,"$1"+b+"$2");if(e.length>0)d+=c+pa((a||0)-e.length,"0")+e;return d},hex:function(a){return this.pad(a||1,n,16)},upto:function(a,b,c){return oa(this,a,b,c||1)},downto:function(a,b,c){return oa(this,a,b,-(c||1))},times:function(a){if(a)for(var b=0;b<this;b++)a.call(this,b);return this.toNumber()},chr:function(){return t.fromCharCode(this)},pad:function(a,b,c){return P(this,
a,b,c)},ordinalize:function(){var a=this.abs();a=parseInt(a.toString().slice(-2));return this+qa(a)},toNumber:function(){return parseFloat(this,10)}});H(u,k,n,"round,floor,ceil",function(a,b){a[b]=function(c){return M(this,c,b)}});H(u,k,n,"abs,pow,sin,asin,cos,acos,tan,atan,exp,pow,sqrt",function(a,b){a[b]=function(c,d){return v[b](this,c,d)}});
var Bb="isObject,isNaN".split(","),Cb="keys,values,each,merge,clone,equal,watch,tap,has".split(",");
function Db(a,b,c,d){var e=/^(.+?)(\[.*\])$/,g,f,i;if(d!==n&&(f=b.match(e))){i=f[1];b=f[2].replace(/^\[|\]$/g,"").split("][");b.forEach(function(j){g=!j||j.match(/^\d+$/);if(!i&&da(a))i=a.length;a[i]||(a[i]=g?[]:{});a=a[i];i=j});if(!i&&g)i=a.length.toString();Db(a,i,c)}else a[b]=c.match(/^[\d.]+$/)?parseFloat(c):c==="true"?k:c==="false"?n:c}E(p,n,k,{watch:function(a,b,c){if(ca){var d=a[b];p.defineProperty(a,b,{enumerable:k,configurable:k,get:function(){return d},set:function(e){d=c.call(a,b,d,e)}})}}});
E(p,n,function(a,b){return z(b)},{keys:function(a,b){var c=p.keys(a);c.forEach(function(d){b.call(a,d,a[d])});return c}});
E(p,n,n,{isObject:function(a){return L(a)},isNaN:function(a){return A(a)&&a.valueOf()!==a.valueOf()},equal:function(a,b){return ua(a)&&ua(b)?ta(a)===ta(b):a===b},extended:function(a){return new na(a)},merge:function(a,b,c,d){var e,g;if(a&&typeof b!="string")for(e in b)if(la(b,e)&&a){g=b[e];if(I(a[e])){if(d===n)continue;if(z(d))g=d.call(b,e,a[e],b[e])}if(c===k&&g&&ka(g))if(ga(g))g=new s(g.getTime());else if(D(g))g=new r(g.source,sa(g));else{a[e]||(a[e]=q.isArray(g)?[]:{});p.merge(a[e],b[e],c,d);continue}a[e]=
g}return a},values:function(a,b){var c=[];G(a,function(d,e){c.push(e);b&&b.call(a,e)});return c},clone:function(a,b){if(!ka(a))return a;if(q.isArray(a))return a.concat();var c=a instanceof na?new na:{};return p.merge(c,a,b)},fromQueryString:function(a,b){var c=p.extended();a=a&&a.toString?a.toString():"";a.replace(/^.*?\?/,"").split("&").forEach(function(d){d=d.split("=");d.length===2&&Db(c,d[0],decodeURIComponent(d[1]),b)});return c},tap:function(a,b){var c=b;z(b)||(c=function(){b&&a[b]()});c.call(a,
a);return a},has:function(a,b){return la(a,b)}});H(p,n,n,x,function(a,b){var c="is"+b;Bb.push(c);a[c]=function(d){return p.prototype.toString.call(d)==="[object "+b+"]"}});(function(){E(p,n,function(){return arguments.length===0},{extend:function(){wa(Bb.concat(Cb),p)}})})();wa(Cb,na);
E(r,n,n,{escape:function(a){return Q(a)}});
E(r,k,n,{getFlags:function(){return sa(this)},setFlags:function(a){return r(this.source,a)},addFlag:function(a){return this.setFlags(sa(this,a))},removeFlag:function(a){return this.setFlags(sa(this).replace(a,""))}});
var Eb,Fb;
E(t,k,n,{escapeRegExp:function(){return Q(this)},escapeURL:function(a){return a?encodeURIComponent(this):encodeURI(this)},unescapeURL:function(a){return a?decodeURI(this):decodeURIComponent(this)},escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},unescapeHTML:function(){return this.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")},encodeBase64:function(){return Eb(this)},decodeBase64:function(){return Fb(this)},each:function(a,b){var c,
d;if(z(a)){b=a;a=/[\s\S]/g}else if(a)if(C(a))a=r(Q(a),"gi");else{if(D(a))a=r(a.source,sa(a,"g"))}else a=/[\s\S]/g;c=this.match(a)||[];if(b)for(d=0;d<c.length;d++)c[d]=b.call(this,c[d],d,c)||c[d];return c},shift:function(a){var b="";a=a||0;this.codes(function(c){b+=t.fromCharCode(c+a)});return b},codes:function(a){for(var b=[],c=0;c<this.length;c++){var d=this.charCodeAt(c);b.push(d);a&&a.call(this,d,c)}return b},chars:function(a){return this.each(a)},words:function(a){return this.trim().each(/\S+/g,
a)},lines:function(a){return this.trim().each(/^.*$/gm,a)},paragraphs:function(a){var b=this.trim().split(/[\r\n]{2,}/);return b=b.map(function(c){if(a)var d=a.call(c);return d?d:c})},startsWith:function(a,b){if(K(b))b=k;var c=D(a)?a.source.replace("^",""):Q(a);return r("^"+c,b?"":"i").test(this)},endsWith:function(a,b){if(K(b))b=k;var c=D(a)?a.source.replace("$",""):Q(a);return r(c+"$",b?"":"i").test(this)},isBlank:function(){return this.trim().length===0},has:function(a){return this.search(D(a)?
a:Q(a))!==-1},add:function(a,b){b=K(b)?this.length:b;return this.slice(0,b)+a+this.slice(b)},remove:function(a){return this.replace(a,"")},reverse:function(){return this.split("").reverse().join("")},compact:function(){return this.trim().replace(/([\r\n\s\u3000])+/g,function(a,b){return b==="\u3000"?b:" "})},at:function(){return va(this,arguments,k)},from:function(a){return this.slice(a)},to:function(a){if(K(a))a=this.length;return this.slice(0,a)},dasherize:function(){return this.underscore().replace(/_/g,
"-")},underscore:function(){return this.replace(/[-\s]+/g,"_").replace(t.Inflector&&t.Inflector.acronymRegExp,function(a,b){return(b>0?"_":"")+a.toLowerCase()}).replace(/([A-Z\d]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").toLowerCase()},camelize:function(a){return this.underscore().replace(/(^|_)([^_]+)/g,function(b,c,d,e){b=d;b=(c=t.Inflector)&&c.acronyms[b];b=C(b)?b:void 0;e=a!==n||e>0;if(b)return e?b:b.toLowerCase();return e?d.capitalize():d})},spacify:function(){return this.underscore().replace(/_/g,
" ")},stripTags:function(){var a=this;F(arguments.length>0?arguments:[""],function(b){a=a.replace(r("</?"+Q(b)+"[^<>]*>","gi"),"")});return a},removeTags:function(){var a=this;F(arguments.length>0?arguments:["\\S+"],function(b){b=r("<("+b+")[^<>]*(?:\\/>|>.*?<\\/\\1>)","gi");a=a.replace(b,"")});return a},truncate:function(a,b,c,d){var e="",g="",f=this.toString(),i="["+ra()+"]+",j="[^"+ra()+"]*",h=r(i+j+"$");d=K(d)?"...":t(d);if(f.length<=a)return f;switch(c){case "left":a=f.length-a;e=d;f=f.slice(a);
h=r("^"+j+i);break;case "middle":a=N(a/2);g=d+f.slice(f.length-a).trimLeft();f=f.slice(0,a);break;default:a=a;g=d;f=f.slice(0,a)}if(b===n&&this.slice(a,a+1).match(/\S/))f=f.remove(h);return e+f+g},pad:function(a,b){return pa(b,a)+this+pa(b,a)},padLeft:function(a,b){return pa(b,a)+this},padRight:function(a,b){return this+pa(b,a)},first:function(a){if(K(a))a=1;return this.substr(0,a)},last:function(a){if(K(a))a=1;return this.substr(this.length-a<0?0:this.length-a)},repeat:function(a){var b="",c=0;if(A(a)&&
a>0)for(;c<a;){b+=this;c++}return b},toNumber:function(a){var b=this.replace(/,/g,"");return b.match(/\./)?parseFloat(b):parseInt(b,a||10)},capitalize:function(a){var b;return this.toLowerCase().replace(a?/[\s\S]/g:/^\S/,function(c){var d=c.toUpperCase(),e;e=b?c:d;b=d!==c;return e})},assign:function(){var a={};F(arguments,function(b,c){if(L(b))ma(a,b);else a[c+1]=b});return this.replace(/\{([^{]+?)\}/g,function(b,c){return la(a,c)?a[c]:b})},namespace:function(a){a=a||ba;G(this.split("."),function(b,
c){return!!(a=a[c])});return a}});E(t,k,n,{insert:t.prototype.add});
(function(a){if(this.btoa){Eb=this.btoa;Fb=this.atob}else{var b=/[^A-Za-z0-9\+\/\=]/g;Eb=function(c){var d="",e,g,f,i,j,h,m=0;do{e=c.charCodeAt(m++);g=c.charCodeAt(m++);f=c.charCodeAt(m++);i=e>>2;e=(e&3)<<4|g>>4;j=(g&15)<<2|f>>6;h=f&63;if(isNaN(g))j=h=64;else if(isNaN(f))h=64;d=d+a.charAt(i)+a.charAt(e)+a.charAt(j)+a.charAt(h)}while(m<c.length);return d};Fb=function(c){var d="",e,g,f,i,j,h=0;if(c.match(b))throw Error("String contains invalid base64 characters");c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");
do{e=a.indexOf(c.charAt(h++));g=a.indexOf(c.charAt(h++));i=a.indexOf(c.charAt(h++));j=a.indexOf(c.charAt(h++));e=e<<2|g>>4;g=(g&15)<<4|i>>2;f=(i&3)<<6|j;d+=t.fromCharCode(e);if(i!=64)d+=t.fromCharCode(g);if(j!=64)d+=t.fromCharCode(f)}while(h<c.length);return d}}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=");
var Gb=[],Hb=[],Y=[],Ib=[],Jb={},Kb,Z;function Lb(a,b){var c=a.indexOf(b);c>-1&&a.splice(c,1)}
function Mb(a,b,c){C(b)&&Lb(Y,b);Lb(Y,c);a.unshift({ka:b,pa:c})}function Nb(a,b){return a==b||a=="all"||!a}function Ob(a){return Y.some(function(b){return(new r("\\b"+b+"$","i")).test(a)})}function Pb(a,b){a=C(a)?a.toString():"";return a.isBlank()||Ob(a)?a:Qb(a,b?Gb:Hb)}function Qb(a,b){G(b,function(c,d){if(a.match(d.ka)){a=a.replace(d.ka,d.pa);return n}});return a}function Rb(a){return a.replace(/^\W*[a-z]/,function(b){return b.toUpperCase()})}
Z={acronym:function(a){Jb[a.toLowerCase()]=a;a=p.keys(Jb).map(function(b){return Jb[b]});Z.acronymRegExp=r(a.join("|"),"g")},plural:function(a,b){Mb(Gb,a,b)},singular:function(a,b){Mb(Hb,a,b)},irregular:function(a,b){var c=a.first(),d=a.from(1),e=b.first(),g=b.from(1),f=e.toUpperCase(),i=e.toLowerCase(),j=c.toUpperCase(),h=c.toLowerCase();Lb(Y,a);Lb(Y,b);if(j==f){Z.plural(new r("({1}){2}$".assign(c,d),"i"),"$1"+g);Z.plural(new r("({1}){2}$".assign(e,g),"i"),"$1"+g);Z.singular(new r("({1}){2}$".assign(e,
g),"i"),"$1"+d)}else{Z.plural(new r("{1}{2}$".assign(j,d)),f+g);Z.plural(new r("{1}{2}$".assign(h,d)),i+g);Z.plural(new r("{1}{2}$".assign(f,g)),f+g);Z.plural(new r("{1}{2}$".assign(i,g)),i+g);Z.singular(new r("{1}{2}$".assign(f,g)),j+d);Z.singular(new r("{1}{2}$".assign(i,g)),h+d)}},uncountable:function(a){var b=q.isArray(a)?a:F(arguments);Y=Y.concat(b)},human:function(a,b){Ib.unshift({ka:a,pa:b})},clear:function(a){if(Nb(a,"singulars"))Hb=[];if(Nb(a,"plurals"))Gb=[];if(Nb(a,"uncountables"))Y=[];
if(Nb(a,"humans"))Ib=[];if(Nb(a,"acronyms"))Jb={}}};Kb=["and","or","nor","a","an","the","so","but","to","of","at","by","from","into","on","onto","off","out","in","over","with","for"];Z.plural(/$/,"s");Z.plural(/s$/gi,"s");Z.plural(/(ax|test)is$/gi,"$1es");Z.plural(/(octop|vir|fung|foc|radi|alumn)(i|us)$/gi,"$1i");Z.plural(/(census|alias|status)$/gi,"$1es");Z.plural(/(bu)s$/gi,"$1ses");Z.plural(/(buffal|tomat)o$/gi,"$1oes");Z.plural(/([ti])um$/gi,"$1a");Z.plural(/([ti])a$/gi,"$1a");
Z.plural(/sis$/gi,"ses");Z.plural(/f+e?$/gi,"ves");Z.plural(/(cuff|roof)$/gi,"$1s");Z.plural(/([ht]ive)$/gi,"$1s");Z.plural(/([^aeiouy]o)$/gi,"$1es");Z.plural(/([^aeiouy]|qu)y$/gi,"$1ies");Z.plural(/(x|ch|ss|sh)$/gi,"$1es");Z.plural(/(matr|vert|ind)(?:ix|ex)$/gi,"$1ices");Z.plural(/([ml])ouse$/gi,"$1ice");Z.plural(/([ml])ice$/gi,"$1ice");Z.plural(/^(ox)$/gi,"$1en");Z.plural(/^(oxen)$/gi,"$1");Z.plural(/(quiz)$/gi,"$1zes");Z.plural(/(phot|cant|hom|zer|pian|portic|pr|quart|kimon)o$/gi,"$1os");
Z.plural(/(craft)$/gi,"$1");Z.plural(/([ft])[eo]{2}(th?)$/gi,"$1ee$2");Z.singular(/s$/gi,"");Z.singular(/([pst][aiu]s)$/gi,"$1");Z.singular(/([aeiouy])ss$/gi,"$1ss");Z.singular(/(n)ews$/gi,"$1ews");Z.singular(/([ti])a$/gi,"$1um");Z.singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/gi,"$1$2sis");Z.singular(/(^analy)ses$/gi,"$1sis");Z.singular(/(i)(f|ves)$/i,"$1fe");Z.singular(/([aeolr]f?)(f|ves)$/i,"$1f");Z.singular(/([ht]ive)s$/gi,"$1");Z.singular(/([^aeiouy]|qu)ies$/gi,"$1y");
Z.singular(/(s)eries$/gi,"$1eries");Z.singular(/(m)ovies$/gi,"$1ovie");Z.singular(/(x|ch|ss|sh)es$/gi,"$1");Z.singular(/([ml])(ous|ic)e$/gi,"$1ouse");Z.singular(/(bus)(es)?$/gi,"$1");Z.singular(/(o)es$/gi,"$1");Z.singular(/(shoe)s?$/gi,"$1");Z.singular(/(cris|ax|test)[ie]s$/gi,"$1is");Z.singular(/(octop|vir|fung|foc|radi|alumn)(i|us)$/gi,"$1us");Z.singular(/(census|alias|status)(es)?$/gi,"$1");Z.singular(/^(ox)(en)?/gi,"$1");Z.singular(/(vert|ind)(ex|ices)$/gi,"$1ex");
Z.singular(/(matr)(ix|ices)$/gi,"$1ix");Z.singular(/(quiz)(zes)?$/gi,"$1");Z.singular(/(database)s?$/gi,"$1");Z.singular(/ee(th?)$/gi,"oo$1");Z.irregular("person","people");Z.irregular("man","men");Z.irregular("child","children");Z.irregular("sex","sexes");Z.irregular("move","moves");Z.irregular("save","saves");Z.irregular("save","saves");Z.irregular("cow","kine");Z.irregular("goose","geese");Z.irregular("zombie","zombies");Z.uncountable("equipment,information,rice,money,species,series,fish,sheep,jeans".split(","));
E(t,k,n,{pluralize:function(){return Pb(this,k)},singularize:function(){return Pb(this,n)},humanize:function(){var a=Qb(this,Ib);a=a.replace(/_id$/g,"");a=a.replace(/(_)?([a-z\d]*)/gi,function(b,c,d){return(c?" ":"")+(Jb[d]||d.toLowerCase())});return Rb(a)},titleize:function(){var a=/[.:;!]$/,b,c,d;return this.spacify().humanize().words(function(e,g,f){b=a.test(e);d=g==0||g==f.length-1||b||c;c=b;return d||Kb.indexOf(e)===-1?Rb(e):e}).join(" ")},parameterize:function(a){var b=this;if(a===undefined)a=
"-";if(b.normalize)b=b.normalize();b=b.replace(/[^a-z0-9\-_]+/gi,a);if(a)b=b.replace(new r("^{sep}+|{sep}+$|({sep}){sep}+".assign({sep:Q(a)}),"g"),"$1");return encodeURI(b.toLowerCase())}});t.Inflector=Z;t.Inflector.acronyms=Jb;
var Sb,Tb="",Vb,Wb=[{type:"a",shift:65248,start:65,end:90},{type:"a",shift:65248,start:97,end:122},{type:"n",shift:65248,start:48,end:57},{type:"p",shift:65248,start:33,end:47},{type:"p",shift:65248,start:58,end:64},{type:"p",shift:65248,start:91,end:96},{type:"p",shift:65248,start:123,end:126}],Xb,Yb=/[\u0020-\u00A5]|[\uFF61-\uFF9F][\uff9e\uff9f]?/g,Zb=/[\u3000-\u301C]|[\u301A-\u30FC]|[\uFF01-\uFF60]|[\uFFE0-\uFFE6]/g,$b="\uff61\uff64\uff62\uff63\u00a5\u00a2\u00a3",ac="\u3002\u3001\u300c\u300d\uffe5\uffe0\uffe1",
bc=/[\u30ab\u30ad\u30af\u30b1\u30b3\u30b5\u30b7\u30b9\u30bb\u30bd\u30bf\u30c1\u30c4\u30c6\u30c8\u30cf\u30d2\u30d5\u30d8\u30db]/,cc=/[\u30cf\u30d2\u30d5\u30d8\u30db\u30f2]/,dc="\uff71\uff72\uff73\uff74\uff75\uff67\uff68\uff69\uff6a\uff6b\uff76\uff77\uff78\uff79\uff7a\uff7b\uff7c\uff7d\uff7e\uff7f\uff80\uff81\uff82\uff6f\uff83\uff84\uff85\uff86\uff87\uff88\uff89\uff8a\uff8b\uff8c\uff8d\uff8e\uff8f\uff90\uff91\uff92\uff93\uff94\uff6c\uff95\uff6d\uff96\uff6e\uff97\uff98\uff99\uff9a\uff9b\uff9c\uff66\uff9d\uff70\uff65",
ec="\u30a2\u30a4\u30a6\u30a8\u30aa\u30a1\u30a3\u30a5\u30a7\u30a9\u30ab\u30ad\u30af\u30b1\u30b3\u30b5\u30b7\u30b9\u30bb\u30bd\u30bf\u30c1\u30c4\u30c3\u30c6\u30c8\u30ca\u30cb\u30cc\u30cd\u30ce\u30cf\u30d2\u30d5\u30d8\u30db\u30de\u30df\u30e0\u30e1\u30e2\u30e4\u30e3\u30e6\u30e5\u30e8\u30e7\u30e9\u30ea\u30eb\u30ec\u30ed\u30ef\u30f2\u30f3\u30fc\u30fb";
function fc(a,b,c,d){Xb||gc();var e=F(b).join(""),g=Xb[d];e=e.replace(/all/,"").replace(/(\w)lphabet|umbers?|atakana|paces?|unctuation/g,"$1");return a.replace(c,function(f){return g[f]&&(!e||e.has(g[f].type))?g[f].to:f})}
function gc(){var a;Xb={zenkaku:{},hankaku:{}};Wb.forEach(function(b){oa(b.start,b.end,function(c){$(b.type,t.fromCharCode(c),t.fromCharCode(c+b.shift))})});ec.each(function(b,c){a=dc.charAt(c);$("k",a,b);b.match(bc)&&$("k",a+"\uff9e",b.shift(1));b.match(cc)&&$("k",a+"\uff9f",b.shift(2))});ac.each(function(b,c){$("p",$b.charAt(c),b)});$("k","\uff73\uff9e","\u30f4");$("k","\uff66\uff9e","\u30fa");$("s"," ","\u3000")}function $(a,b,c){Xb.zenkaku[b]={type:a,to:c};Xb.hankaku[c]={type:a,to:b}}
function hc(){Sb={};G(Vb,function(a,b){b.split("").forEach(function(c){Sb[c]=a});Tb+=b});Tb=r("["+Tb+"]","g")}
Vb={A:"A\u24b6\uff21\u00c0\u00c1\u00c2\u1ea6\u1ea4\u1eaa\u1ea8\u00c3\u0100\u0102\u1eb0\u1eae\u1eb4\u1eb2\u0226\u01e0\u00c4\u01de\u1ea2\u00c5\u01fa\u01cd\u0200\u0202\u1ea0\u1eac\u1eb6\u1e00\u0104\u023a\u2c6f",B:"B\u24b7\uff22\u1e02\u1e04\u1e06\u0243\u0182\u0181",C:"C\u24b8\uff23\u0106\u0108\u010a\u010c\u00c7\u1e08\u0187\u023b\ua73e",D:"D\u24b9\uff24\u1e0a\u010e\u1e0c\u1e10\u1e12\u1e0e\u0110\u018b\u018a\u0189\ua779",E:"E\u24ba\uff25\u00c8\u00c9\u00ca\u1ec0\u1ebe\u1ec4\u1ec2\u1ebc\u0112\u1e14\u1e16\u0114\u0116\u00cb\u1eba\u011a\u0204\u0206\u1eb8\u1ec6\u0228\u1e1c\u0118\u1e18\u1e1a\u0190\u018e",
F:"F\u24bb\uff26\u1e1e\u0191\ua77b",G:"G\u24bc\uff27\u01f4\u011c\u1e20\u011e\u0120\u01e6\u0122\u01e4\u0193\ua7a0\ua77d\ua77e",H:"H\u24bd\uff28\u0124\u1e22\u1e26\u021e\u1e24\u1e28\u1e2a\u0126\u2c67\u2c75\ua78d",I:"I\u24be\uff29\u00cc\u00cd\u00ce\u0128\u012a\u012c\u0130\u00cf\u1e2e\u1ec8\u01cf\u0208\u020a\u1eca\u012e\u1e2c\u0197",J:"J\u24bf\uff2a\u0134\u0248",K:"K\u24c0\uff2b\u1e30\u01e8\u1e32\u0136\u1e34\u0198\u2c69\ua740\ua742\ua744\ua7a2",L:"L\u24c1\uff2c\u013f\u0139\u013d\u1e36\u1e38\u013b\u1e3c\u1e3a\u0141\u023d\u2c62\u2c60\ua748\ua746\ua780",
M:"M\u24c2\uff2d\u1e3e\u1e40\u1e42\u2c6e\u019c",N:"N\u24c3\uff2e\u01f8\u0143\u00d1\u1e44\u0147\u1e46\u0145\u1e4a\u1e48\u0220\u019d\ua790\ua7a4",O:"O\u24c4\uff2f\u00d2\u00d3\u00d4\u1ed2\u1ed0\u1ed6\u1ed4\u00d5\u1e4c\u022c\u1e4e\u014c\u1e50\u1e52\u014e\u022e\u0230\u00d6\u022a\u1ece\u0150\u01d1\u020c\u020e\u01a0\u1edc\u1eda\u1ee0\u1ede\u1ee2\u1ecc\u1ed8\u01ea\u01ec\u00d8\u01fe\u0186\u019f\ua74a\ua74c",P:"P\u24c5\uff30\u1e54\u1e56\u01a4\u2c63\ua750\ua752\ua754",Q:"Q\u24c6\uff31\ua756\ua758\u024a",R:"R\u24c7\uff32\u0154\u1e58\u0158\u0210\u0212\u1e5a\u1e5c\u0156\u1e5e\u024c\u2c64\ua75a\ua7a6\ua782",
S:"S\u24c8\uff33\u1e9e\u015a\u1e64\u015c\u1e60\u0160\u1e66\u1e62\u1e68\u0218\u015e\u2c7e\ua7a8\ua784",T:"T\u24c9\uff34\u1e6a\u0164\u1e6c\u021a\u0162\u1e70\u1e6e\u0166\u01ac\u01ae\u023e\ua786",U:"U\u24ca\uff35\u00d9\u00da\u00db\u0168\u1e78\u016a\u1e7a\u016c\u00dc\u01db\u01d7\u01d5\u01d9\u1ee6\u016e\u0170\u01d3\u0214\u0216\u01af\u1eea\u1ee8\u1eee\u1eec\u1ef0\u1ee4\u1e72\u0172\u1e76\u1e74\u0244",V:"V\u24cb\uff36\u1e7c\u1e7e\u01b2\ua75e\u0245",W:"W\u24cc\uff37\u1e80\u1e82\u0174\u1e86\u1e84\u1e88\u2c72",
X:"X\u24cd\uff38\u1e8a\u1e8c",Y:"Y\u24ce\uff39\u1ef2\u00dd\u0176\u1ef8\u0232\u1e8e\u0178\u1ef6\u1ef4\u01b3\u024e\u1efe",Z:"Z\u24cf\uff3a\u0179\u1e90\u017b\u017d\u1e92\u1e94\u01b5\u0224\u2c7f\u2c6b\ua762",a:"a\u24d0\uff41\u1e9a\u00e0\u00e1\u00e2\u1ea7\u1ea5\u1eab\u1ea9\u00e3\u0101\u0103\u1eb1\u1eaf\u1eb5\u1eb3\u0227\u01e1\u00e4\u01df\u1ea3\u00e5\u01fb\u01ce\u0201\u0203\u1ea1\u1ead\u1eb7\u1e01\u0105\u2c65\u0250",b:"b\u24d1\uff42\u1e03\u1e05\u1e07\u0180\u0183\u0253",c:"c\u24d2\uff43\u0107\u0109\u010b\u010d\u00e7\u1e09\u0188\u023c\ua73f\u2184",
d:"d\u24d3\uff44\u1e0b\u010f\u1e0d\u1e11\u1e13\u1e0f\u0111\u018c\u0256\u0257\ua77a",e:"e\u24d4\uff45\u00e8\u00e9\u00ea\u1ec1\u1ebf\u1ec5\u1ec3\u1ebd\u0113\u1e15\u1e17\u0115\u0117\u00eb\u1ebb\u011b\u0205\u0207\u1eb9\u1ec7\u0229\u1e1d\u0119\u1e19\u1e1b\u0247\u025b\u01dd",f:"f\u24d5\uff46\u1e1f\u0192\ua77c",g:"g\u24d6\uff47\u01f5\u011d\u1e21\u011f\u0121\u01e7\u0123\u01e5\u0260\ua7a1\u1d79\ua77f",h:"h\u24d7\uff48\u0125\u1e23\u1e27\u021f\u1e25\u1e29\u1e2b\u1e96\u0127\u2c68\u2c76\u0265",i:"i\u24d8\uff49\u00ec\u00ed\u00ee\u0129\u012b\u012d\u00ef\u1e2f\u1ec9\u01d0\u0209\u020b\u1ecb\u012f\u1e2d\u0268\u0131",
j:"j\u24d9\uff4a\u0135\u01f0\u0249",k:"k\u24da\uff4b\u1e31\u01e9\u1e33\u0137\u1e35\u0199\u2c6a\ua741\ua743\ua745\ua7a3",l:"l\u24db\uff4c\u0140\u013a\u013e\u1e37\u1e39\u013c\u1e3d\u1e3b\u017f\u0142\u019a\u026b\u2c61\ua749\ua781\ua747",m:"m\u24dc\uff4d\u1e3f\u1e41\u1e43\u0271\u026f",n:"n\u24dd\uff4e\u01f9\u0144\u00f1\u1e45\u0148\u1e47\u0146\u1e4b\u1e49\u019e\u0272\u0149\ua791\ua7a5",o:"o\u24de\uff4f\u00f2\u00f3\u00f4\u1ed3\u1ed1\u1ed7\u1ed5\u00f5\u1e4d\u022d\u1e4f\u014d\u1e51\u1e53\u014f\u022f\u0231\u00f6\u022b\u1ecf\u0151\u01d2\u020d\u020f\u01a1\u1edd\u1edb\u1ee1\u1edf\u1ee3\u1ecd\u1ed9\u01eb\u01ed\u00f8\u01ff\u0254\ua74b\ua74d\u0275",
p:"p\u24df\uff50\u1e55\u1e57\u01a5\u1d7d\ua751\ua753\ua755",q:"q\u24e0\uff51\u024b\ua757\ua759",r:"r\u24e1\uff52\u0155\u1e59\u0159\u0211\u0213\u1e5b\u1e5d\u0157\u1e5f\u024d\u027d\ua75b\ua7a7\ua783",s:"s\u24e2\uff53\u015b\u1e65\u015d\u1e61\u0161\u1e67\u1e63\u1e69\u0219\u015f\u023f\ua7a9\ua785\u1e9b",t:"t\u24e3\uff54\u1e6b\u1e97\u0165\u1e6d\u021b\u0163\u1e71\u1e6f\u0167\u01ad\u0288\u2c66\ua787",u:"u\u24e4\uff55\u00f9\u00fa\u00fb\u0169\u1e79\u016b\u1e7b\u016d\u00fc\u01dc\u01d8\u01d6\u01da\u1ee7\u016f\u0171\u01d4\u0215\u0217\u01b0\u1eeb\u1ee9\u1eef\u1eed\u1ef1\u1ee5\u1e73\u0173\u1e77\u1e75\u0289",
v:"v\u24e5\uff56\u1e7d\u1e7f\u028b\ua75f\u028c",w:"w\u24e6\uff57\u1e81\u1e83\u0175\u1e87\u1e85\u1e98\u1e89\u2c73",x:"x\u24e7\uff58\u1e8b\u1e8d",y:"y\u24e8\uff59\u1ef3\u00fd\u0177\u1ef9\u0233\u1e8f\u00ff\u1ef7\u1e99\u1ef5\u01b4\u024f\u1eff",z:"z\u24e9\uff5a\u017a\u1e91\u017c\u017e\u1e93\u1e95\u01b6\u0225\u0240\u2c6c\ua763",AA:"\ua732",AE:"\u00c6\u01fc\u01e2",AO:"\ua734",AU:"\ua736",AV:"\ua738\ua73a",AY:"\ua73c",DZ:"\u01f1\u01c4",Dz:"\u01f2\u01c5",LJ:"\u01c7",Lj:"\u01c8",NJ:"\u01ca",Nj:"\u01cb",OI:"\u01a2",
OO:"\ua74e",OU:"\u0222",TZ:"\ua728",VY:"\ua760",aa:"\ua733",ae:"\u00e6\u01fd\u01e3",ao:"\ua735",au:"\ua737",av:"\ua739\ua73b",ay:"\ua73d",dz:"\u01f3\u01c6",hv:"\u0195",lj:"\u01c9",nj:"\u01cc",oi:"\u01a3",ou:"\u0223",oo:"\ua74f",ss:"\u00df",tz:"\ua729",vy:"\ua761"};
E(t,k,n,{normalize:function(){Sb||hc();return this.replace(Tb,function(a){return Sb[a]})},hankaku:function(){return fc(this,arguments,Zb,"hankaku")},zenkaku:function(){return fc(this,arguments,Yb,"zenkaku")},hiragana:function(a){var b=this;if(a!==n)b=b.zenkaku("k");return b.replace(/[\u30A1-\u30F6]/g,function(c){return c.shift(-96)})},katakana:function(){return this.replace(/[\u3041-\u3096]/g,function(a){return a.shift(96)})}});
[{ca:["Arabic"],source:"\u0600-\u06ff"},{ca:["Cyrillic"],source:"\u0400-\u04ff"},{ca:["Devanagari"],source:"\u0900-\u097f"},{ca:["Greek"],source:"\u0370-\u03ff"},{ca:["Hangul"],source:"\uac00-\ud7af\u1100-\u11ff"},{ca:["Han","Kanji"],source:"\u4e00-\u9fff\uf900-\ufaff"},{ca:["Hebrew"],source:"\u0590-\u05ff"},{ca:["Hiragana"],source:"\u3040-\u309f\u30fb-\u30fc"},{ca:["Kana"],source:"\u3040-\u30ff\uff61-\uff9f"},{ca:["Katakana"],source:"\u30a0-\u30ff\uff61-\uff9f"},{ca:["Latin"],source:"\u0001-\u0080-\u00ff\u0100-\u017f\u0180-\u024f"},
{ca:["Thai"],source:"\u0e00-\u0e7f"}].forEach(function(a){var b=r("^["+a.source+"\\s]+$"),c=r("["+a.source+"]");a.ca.forEach(function(d){ia(t.prototype,"is"+d,function(){return b.test(this.trim())});ia(t.prototype,"has"+d,function(){return c.test(this)})})});
Date.addLocale("da",{plural:k,months:"januar,februar,marts,april,maj,juni,juli,august,september,oktober,november,december",weekdays:"s\u00f8ndag|sondag,mandag,tirsdag,onsdag,torsdag,fredag,l\u00f8rdag|lordag",units:"millisekund:|er,sekund:|er,minut:|ter,tim:e|er,dag:|e,ug:e|er|en,m\u00e5ned:|er|en+maaned:|er|en,\u00e5r:||et+aar:||et",numbers:"en|et,to,tre,fire,fem,seks,syv,otte,ni,ti",tokens:"den,for",articles:"den","short":"d. {d}. {month} {yyyy}","long":"den {d}. {month} {yyyy} {H}:{mm}",full:"{Weekday} den {d}. {month} {yyyy} {H}:{mm}:{ss}",
past:"{num} {unit} {sign}",future:"{sign} {num} {unit}",duration:"{num} {unit}",ampm:"am,pm",modifiers:[{name:"day",src:"forg\u00e5rs|i forg\u00e5rs|forgaars|i forgaars",value:-2},{name:"day",src:"i g\u00e5r|ig\u00e5r|i gaar|igaar",value:-1},{name:"day",src:"i dag|idag",value:0},{name:"day",src:"i morgen|imorgen",value:1},{name:"day",src:"over morgon|overmorgen|i over morgen|i overmorgen|iovermorgen",value:2},{name:"sign",src:"siden",value:-1},{name:"sign",src:"om",value:1},{name:"shift",src:"i sidste|sidste",
value:-1},{name:"shift",src:"denne",value:0},{name:"shift",src:"n\u00e6ste|naeste",value:1}],dateParse:["{num} {unit} {sign}","{sign} {num} {unit}","{1?} {num} {unit} {sign}","{shift} {unit=5-7}"],timeParse:["{0?} {weekday?} {date?} {month} {year}","{date} {month}","{shift} {weekday}"]});
Date.addLocale("de",{plural:k,capitalizeUnit:k,months:"Januar,Februar,M\u00e4rz|Marz,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember",weekdays:"Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag",units:"Millisekunde:|n,Sekunde:|n,Minute:|n,Stunde:|n,Tag:|en,Woche:|n,Monat:|en,Jahr:|en",numbers:"ein:|e|er|en|em,zwei,drei,vier,fuenf,sechs,sieben,acht,neun,zehn",tokens:"der","short":"{d}. {Month} {yyyy}","long":"{d}. {Month} {yyyy} {H}:{mm}",full:"{Weekday} {d}. {Month} {yyyy} {H}:{mm}:{ss}",
past:"{sign} {num} {unit}",future:"{sign} {num} {unit}",duration:"{num} {unit}",timeMarker:"um",ampm:"am,pm",modifiers:[{name:"day",src:"vorgestern",value:-2},{name:"day",src:"gestern",value:-1},{name:"day",src:"heute",value:0},{name:"day",src:"morgen",value:1},{name:"day",src:"\u00fcbermorgen|ubermorgen|uebermorgen",value:2},{name:"sign",src:"vor:|her",value:-1},{name:"sign",src:"in",value:1},{name:"shift",src:"letzte:|r|n|s",value:-1},{name:"shift",src:"n\u00e4chste:|r|n|s+nachste:|r|n|s+naechste:|r|n|s+kommende:n|r",
value:1}],dateParse:["{sign} {num} {unit}","{num} {unit} {sign}","{shift} {unit=5-7}"],timeParse:["{weekday?} {date?} {month} {year?}","{shift} {weekday}"]});
Date.addLocale("es",{plural:k,months:"enero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre",weekdays:"domingo,lunes,martes,mi\u00e9rcoles|miercoles,jueves,viernes,s\u00e1bado|sabado",units:"milisegundo:|s,segundo:|s,minuto:|s,hora:|s,d\u00eda|d\u00edas|dia|dias,semana:|s,mes:|es,a\u00f1o|a\u00f1os|ano|anos",numbers:"uno,dos,tres,cuatro,cinco,seis,siete,ocho,nueve,diez",tokens:"el,de","short":"{d} {month} {yyyy}","long":"{d} {month} {yyyy} {H}:{mm}",full:"{Weekday} {d} {month} {yyyy} {H}:{mm}:{ss}",
past:"{sign} {num} {unit}",future:"{num} {unit} {sign}",duration:"{num} {unit}",timeMarker:"a las",ampm:"am,pm",modifiers:[{name:"day",src:"anteayer",value:-2},{name:"day",src:"ayer",value:-1},{name:"day",src:"hoy",value:0},{name:"day",src:"ma\u00f1ana|manana",value:1},{name:"sign",src:"hace",value:-1},{name:"sign",src:"de ahora",value:1},{name:"shift",src:"pasad:o|a",value:-1},{name:"shift",src:"pr\u00f3ximo|pr\u00f3xima|proximo|proxima",value:1}],dateParse:["{sign} {num} {unit}","{num} {unit} {sign}",
"{0?} {unit=5-7} {shift}","{0?} {shift} {unit=5-7}"],timeParse:["{shift} {weekday}","{weekday} {shift}","{date?} {1?} {month} {1?} {year?}"]});
Date.addLocale("fi",{plural:k,timeMarker:"kello",ampm:",",months:"tammikuu,helmikuu,maaliskuu,huhtikuu,toukokuu,kes\u00e4kuu,hein\u00e4kuu,elokuu,syyskuu,lokakuu,marraskuu,joulukuu",weekdays:"sunnuntai,maanantai,tiistai,keskiviikko,torstai,perjantai,lauantai",units:"millisekun:ti|tia|teja|tina|nin,sekun:ti|tia|teja|tina|nin,minuut:ti|tia|teja|tina|in,tun:ti|tia|teja|tina|nin,p\u00e4iv:\u00e4|\u00e4\u00e4|i\u00e4|\u00e4n\u00e4|\u00e4n,viik:ko|koa|koja|on|kona,kuukau:si|sia|tta|den|tena,vuo:si|sia|tta|den|tena",numbers:"yksi|ensimm\u00e4inen,kaksi|toinen,kolm:e|as,nelj\u00e4:s,vii:si|des,kuu:si|des,seitsem\u00e4:n|s,kahdeksa:n|s,yhdeks\u00e4:n|s,kymmene:n|s",
articles:"",optionals:"","short":"{d}. {month}ta {yyyy}","long":"{d}. {month}ta {yyyy} kello {H}.{mm}",full:"{Weekday}na {d}. {month}ta {yyyy} kello {H}.{mm}",relative:function(a,b,c,d){function e(f){return(a===1?"":a+" ")+g[8*f+b]}var g=this.units;switch(d){case "duration":return e(0);case "past":return e(a>1?1:0)+" sitten";case "future":return e(4)+" p\u00e4\u00e4st\u00e4"}},modifiers:[{name:"day",src:"toissa p\u00e4iv\u00e4n\u00e4|toissa p\u00e4iv\u00e4ist\u00e4",value:-2},{name:"day",src:"eilen|eilist\u00e4",
value:-1},{name:"day",src:"t\u00e4n\u00e4\u00e4n",value:0},{name:"day",src:"huomenna|huomista",value:1},{name:"day",src:"ylihuomenna|ylihuomista",value:2},{name:"sign",src:"sitten|aiemmin",value:-1},{name:"sign",src:"p\u00e4\u00e4st\u00e4|kuluttua|my\u00f6hemmin",value:1},{name:"edge",src:"viimeinen|viimeisen\u00e4",value:-2},{name:"edge",src:"lopussa",value:-1},{name:"edge",src:"ensimm\u00e4inen|ensimm\u00e4isen\u00e4",value:1},{name:"shift",src:"edellinen|edellisen\u00e4|edelt\u00e4v\u00e4|edelt\u00e4v\u00e4n\u00e4|viime|toissa",
value:-1},{name:"shift",src:"t\u00e4n\u00e4|t\u00e4m\u00e4n",value:0},{name:"shift",src:"seuraava|seuraavana|tuleva|tulevana|ensi",value:1}],dateParse:["{num} {unit} {sign}","{sign} {num} {unit}","{num} {unit=4-5} {sign} {day}","{month} {year}","{shift} {unit=5-7}"],timeParse:["{0} {num}{1} {day} of {month} {year?}","{weekday?} {month} {date}{1} {year?}","{date} {month} {year}","{shift} {weekday}","{shift} week {weekday}","{weekday} {2} {shift} week","{0} {date}{1} of {month}","{0}{month?} {date?}{1} of {shift} {unit=6-7}"]});
Date.addLocale("fr",{plural:k,months:"janvier,f\u00e9vrier|fevrier,mars,avril,mai,juin,juillet,ao\u00fbt,septembre,octobre,novembre,d\u00e9cembre|decembre",weekdays:"dimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi",units:"milliseconde:|s,seconde:|s,minute:|s,heure:|s,jour:|s,semaine:|s,mois,an:|s|n\u00e9e|nee",numbers:"un:|e,deux,trois,quatre,cinq,six,sept,huit,neuf,dix",tokens:["l'|la|le"],"short":"{d} {month} {yyyy}","long":"{d} {month} {yyyy} {H}:{mm}",full:"{Weekday} {d} {month} {yyyy} {H}:{mm}:{ss}",
past:"{sign} {num} {unit}",future:"{sign} {num} {unit}",duration:"{num} {unit}",timeMarker:"\u00e0",ampm:"am,pm",modifiers:[{name:"day",src:"hier",value:-1},{name:"day",src:"aujourd'hui",value:0},{name:"day",src:"demain",value:1},{name:"sign",src:"il y a",value:-1},{name:"sign",src:"dans|d'ici",value:1},{name:"shift",src:"derni:\u00e8r|er|\u00e8re|ere",value:-1},{name:"shift",src:"prochain:|e",value:1}],dateParse:["{sign} {num} {unit}","{sign} {num} {unit}","{0?} {unit=5-7} {shift}"],timeParse:["{0?} {date?} {month} {year?}",
"{0?} {weekday} {shift}"]});
Date.addLocale("it",{plural:k,months:"Gennaio,Febbraio,Marzo,Aprile,Maggio,Giugno,Luglio,Agosto,Settembre,Ottobre,Novembre,Dicembre",weekdays:"Domenica,Luned:\u00ec|i,Marted:\u00ec|i,Mercoled:\u00ec|i,Gioved:\u00ec|i,Venerd:\u00ec|i,Sabato",units:"millisecond:o|i,second:o|i,minut:o|i,or:a|e,giorn:o|i,settiman:a|e,mes:e|i,ann:o|i",numbers:"un:|a|o|',due,tre,quattro,cinque,sei,sette,otto,nove,dieci",tokens:"l'|la|il","short":"{d} {Month} {yyyy}","long":"{d} {Month} {yyyy} {H}:{mm}",full:"{Weekday} {d} {Month} {yyyy} {H}:{mm}:{ss}",
past:"{num} {unit} {sign}",future:"{num} {unit} {sign}",duration:"{num} {unit}",timeMarker:"alle",ampm:"am,pm",modifiers:[{name:"day",src:"ieri",value:-1},{name:"day",src:"oggi",value:0},{name:"day",src:"domani",value:1},{name:"day",src:"dopodomani",value:2},{name:"sign",src:"fa",value:-1},{name:"sign",src:"da adesso",value:1},{name:"shift",src:"scors:o|a",value:-1},{name:"shift",src:"prossim:o|a",value:1}],dateParse:["{num} {unit} {sign}","{0?} {unit=5-7} {shift}","{0?} {shift} {unit=5-7}"],timeParse:["{weekday?} {date?} {month} {year?}",
"{shift} {weekday}"]});
Date.addLocale("ja",{monthSuffix:"\u6708",weekdays:"\u65e5\u66dc\u65e5,\u6708\u66dc\u65e5,\u706b\u66dc\u65e5,\u6c34\u66dc\u65e5,\u6728\u66dc\u65e5,\u91d1\u66dc\u65e5,\u571f\u66dc\u65e5",units:"\u30df\u30ea\u79d2,\u79d2,\u5206,\u6642\u9593,\u65e5,\u9031\u9593|\u9031,\u30f6\u6708|\u30f5\u6708|\u6708,\u5e74","short":"{yyyy}\u5e74{M}\u6708{d}\u65e5","long":"{yyyy}\u5e74{M}\u6708{d}\u65e5 {H}\u6642{mm}\u5206",full:"{yyyy}\u5e74{M}\u6708{d}\u65e5 {Weekday} {H}\u6642{mm}\u5206{ss}\u79d2",past:"{num}{unit}{sign}",
future:"{num}{unit}{sign}",duration:"{num}{unit}",timeSuffixes:"\u6642,\u5206,\u79d2",ampm:"\u5348\u524d,\u5348\u5f8c",modifiers:[{name:"day",src:"\u4e00\u6628\u65e5",value:-2},{name:"day",src:"\u6628\u65e5",value:-1},{name:"day",src:"\u4eca\u65e5",value:0},{name:"day",src:"\u660e\u65e5",value:1},{name:"day",src:"\u660e\u5f8c\u65e5",value:2},{name:"sign",src:"\u524d",value:-1},{name:"sign",src:"\u5f8c",value:1},{name:"shift",src:"\u53bb|\u5148",value:-1},{name:"shift",src:"\u6765",value:1}],dateParse:["{num}{unit}{sign}"],
timeParse:["{shift}{unit=5-7}{weekday?}","{year}\u5e74{month?}\u6708?{date?}\u65e5?","{month}\u6708{date?}\u65e5?","{date}\u65e5"]});
Date.addLocale("ko",{digitDate:k,monthSuffix:"\uc6d4",weekdays:"\uc77c\uc694\uc77c,\uc6d4\uc694\uc77c,\ud654\uc694\uc77c,\uc218\uc694\uc77c,\ubaa9\uc694\uc77c,\uae08\uc694\uc77c,\ud1a0\uc694\uc77c",units:"\ubc00\ub9ac\ucd08,\ucd08,\ubd84,\uc2dc\uac04,\uc77c,\uc8fc,\uac1c\uc6d4|\ub2ec,\ub144",numbers:"\uc77c|\ud55c,\uc774,\uc0bc,\uc0ac,\uc624,\uc721,\uce60,\ud314,\uad6c,\uc2ed","short":"{yyyy}\ub144{M}\uc6d4{d}\uc77c","long":"{yyyy}\ub144{M}\uc6d4{d}\uc77c {H}\uc2dc{mm}\ubd84",full:"{yyyy}\ub144{M}\uc6d4{d}\uc77c {Weekday} {H}\uc2dc{mm}\ubd84{ss}\ucd08",
past:"{num}{unit} {sign}",future:"{num}{unit} {sign}",duration:"{num}{unit}",timeSuffixes:"\uc2dc,\ubd84,\ucd08",ampm:"\uc624\uc804,\uc624\ud6c4",modifiers:[{name:"day",src:"\uadf8\uc800\uaed8",value:-2},{name:"day",src:"\uc5b4\uc81c",value:-1},{name:"day",src:"\uc624\ub298",value:0},{name:"day",src:"\ub0b4\uc77c",value:1},{name:"day",src:"\ubaa8\ub808",value:2},{name:"sign",src:"\uc804",value:-1},{name:"sign",src:"\ud6c4",value:1},{name:"shift",src:"\uc9c0\ub09c|\uc791",value:-1},{name:"shift",src:"\uc774\ubc88",
value:0},{name:"shift",src:"\ub2e4\uc74c|\ub0b4",value:1}],dateParse:["{num}{unit} {sign}","{shift?} {unit=5-7}"],timeParse:["{shift} {unit=5?} {weekday}","{year}\ub144{month?}\uc6d4?{date?}\uc77c?","{month}\uc6d4{date?}\uc77c?","{date}\uc77c"]});
Date.addLocale("nl",{plural:k,months:"januari,februari,maart,april,mei,juni,juli,augustus,september,oktober,november,december",weekdays:"zondag|zo,maandag|ma,dinsdag|di,woensdag|woe|wo,donderdag|do,vrijdag|vrij|vr,zaterdag|za",units:"milliseconde:|n,seconde:|n,minu:ut|ten,uur,dag:|en,we:ek|ken,maand:|en,jaar",numbers:"een,twee,drie,vier,vijf,zes,zeven,acht,negen",tokens:"","short":"{d} {Month} {yyyy}","long":"{d} {Month} {yyyy} {H}:{mm}",full:"{Weekday} {d} {Month} {yyyy} {H}:{mm}:{ss}",past:"{num} {unit} {sign}",
future:"{num} {unit} {sign}",duration:"{num} {unit}",timeMarker:"'s|om",modifiers:[{name:"day",src:"gisteren",value:-1},{name:"day",src:"vandaag",value:0},{name:"day",src:"morgen",value:1},{name:"day",src:"overmorgen",value:2},{name:"sign",src:"geleden",value:-1},{name:"sign",src:"vanaf nu",value:1},{name:"shift",src:"laatste|vorige|afgelopen",value:-1},{name:"shift",src:"volgend:|e",value:1}],dateParse:["{num} {unit} {sign}","{0?} {unit=5-7} {shift}","{0?} {shift} {unit=5-7}"],timeParse:["{weekday?} {date?} {month} {year?}",
"{shift} {weekday}"]});
Date.addLocale("pl",{plural:k,months:"Stycze\u0144|Stycznia,Luty|Lutego,Marzec|Marca,Kwiecie\u0144|Kwietnia,Maj|Maja,Czerwiec|Czerwca,Lipiec|Lipca,Sierpie\u0144|Sierpnia,Wrzesie\u0144|Wrze\u015bnia,Pa\u017adziernik|Pa\u017adziernika,Listopad|Listopada,Grudzie\u0144|Grudnia",weekdays:"Niedziela|Niedziel\u0119,Poniedzia\u0142ek,Wtorek,\u015arod:a|\u0119,Czwartek,Pi\u0105tek,Sobota|Sobot\u0119",units:"milisekund:a|y|,sekund:a|y|,minut:a|y|,godzin:a|y|,dzie\u0144|dni,tydzie\u0144|tygodnie|tygodni,miesi\u0105ce|miesi\u0105ce|miesi\u0119cy,rok|lata|lat",numbers:"jeden|jedn\u0105,dwa|dwie,trzy,cztery,pi\u0119\u0107,sze\u015b\u0107,siedem,osiem,dziewi\u0119\u0107,dziesi\u0119\u0107",
optionals:"w|we,roku","short":"{d} {Month} {yyyy}","long":"{d} {Month} {yyyy} {H}:{mm}",full:"{Weekday}, {d} {Month} {yyyy} {H}:{mm}:{ss}",past:"{num} {unit} {sign}",future:"{sign} {num} {unit}",duration:"{num} {unit}",timeMarker:"o",ampm:"am,pm",modifiers:[{name:"day",src:"przedwczoraj",value:-2},{name:"day",src:"wczoraj",value:-1},{name:"day",src:"dzisiaj|dzi\u015b",value:0},{name:"day",src:"jutro",value:1},{name:"day",src:"pojutrze",value:2},{name:"sign",src:"temu|przed",value:-1},{name:"sign",
src:"za",value:1},{name:"shift",src:"zesz\u0142y|zesz\u0142a|ostatni|ostatnia",value:-1},{name:"shift",src:"nast\u0119pny|nast\u0119pna|nast\u0119pnego|przysz\u0142y|przysz\u0142a|przysz\u0142ego",value:1}],dateParse:["{num} {unit} {sign}","{sign} {num} {unit}","{month} {year}","{shift} {unit=5-7}","{0} {shift?} {weekday}"],timeParse:["{date} {month} {year?} {1}","{0} {shift?} {weekday}"]});
Date.addLocale("pt",{plural:k,months:"janeiro,fevereiro,mar\u00e7o,abril,maio,junho,julho,agosto,setembro,outubro,novembro,dezembro",weekdays:"domingo,segunda-feira,ter\u00e7a-feira,quarta-feira,quinta-feira,sexta-feira,s\u00e1bado|sabado",units:"milisegundo:|s,segundo:|s,minuto:|s,hora:|s,dia:|s,semana:|s,m\u00eas|m\u00eases|mes|meses,ano:|s",numbers:"um,dois,tr\u00eas|tres,quatro,cinco,seis,sete,oito,nove,dez,uma,duas",tokens:"a,de","short":"{d} de {month} de {yyyy}","long":"{d} de {month} de {yyyy} {H}:{mm}",
full:"{Weekday}, {d} de {month} de {yyyy} {H}:{mm}:{ss}",past:"{num} {unit} {sign}",future:"{sign} {num} {unit}",duration:"{num} {unit}",timeMarker:"\u00e0s",ampm:"am,pm",modifiers:[{name:"day",src:"anteontem",value:-2},{name:"day",src:"ontem",value:-1},{name:"day",src:"hoje",value:0},{name:"day",src:"amanh:\u00e3|a",value:1},{name:"sign",src:"atr\u00e1s|atras|h\u00e1|ha",value:-1},{name:"sign",src:"daqui a",value:1},{name:"shift",src:"passad:o|a",value:-1},{name:"shift",src:"pr\u00f3ximo|pr\u00f3xima|proximo|proxima",
value:1}],dateParse:["{num} {unit} {sign}","{sign} {num} {unit}","{0?} {unit=5-7} {shift}","{0?} {shift} {unit=5-7}"],timeParse:["{date?} {1?} {month} {1?} {year?}","{0?} {shift} {weekday}"]});
Date.addLocale("ru",{months:"\u042f\u043d\u0432\u0430\u0440:\u044f|\u044c,\u0424\u0435\u0432\u0440\u0430\u043b:\u044f|\u044c,\u041c\u0430\u0440\u0442:\u0430|,\u0410\u043f\u0440\u0435\u043b:\u044f|\u044c,\u041c\u0430:\u044f|\u0439,\u0418\u044e\u043d:\u044f|\u044c,\u0418\u044e\u043b:\u044f|\u044c,\u0410\u0432\u0433\u0443\u0441\u0442:\u0430|,\u0421\u0435\u043d\u0442\u044f\u0431\u0440:\u044f|\u044c,\u041e\u043a\u0442\u044f\u0431\u0440:\u044f|\u044c,\u041d\u043e\u044f\u0431\u0440:\u044f|\u044c,\u0414\u0435\u043a\u0430\u0431\u0440:\u044f|\u044c",weekdays:"\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435,\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a,\u0412\u0442\u043e\u0440\u043d\u0438\u043a,\u0421\u0440\u0435\u0434\u0430,\u0427\u0435\u0442\u0432\u0435\u0440\u0433,\u041f\u044f\u0442\u043d\u0438\u0446\u0430,\u0421\u0443\u0431\u0431\u043e\u0442\u0430",
units:"\u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434:\u0430|\u0443|\u044b|,\u0441\u0435\u043a\u0443\u043d\u0434:\u0430|\u0443|\u044b|,\u043c\u0438\u043d\u0443\u0442:\u0430|\u0443|\u044b|,\u0447\u0430\u0441:||\u0430|\u043e\u0432,\u0434\u0435\u043d\u044c|\u0434\u0435\u043d\u044c|\u0434\u043d\u044f|\u0434\u043d\u0435\u0439,\u043d\u0435\u0434\u0435\u043b:\u044f|\u044e|\u0438|\u044c|\u0435,\u043c\u0435\u0441\u044f\u0446:||\u0430|\u0435\u0432|\u0435,\u0433\u043e\u0434|\u0433\u043e\u0434|\u0433\u043e\u0434\u0430|\u043b\u0435\u0442|\u0433\u043e\u0434\u0443",
numbers:"\u043e\u0434:\u0438\u043d|\u043d\u0443,\u0434\u0432:\u0430|\u0435,\u0442\u0440\u0438,\u0447\u0435\u0442\u044b\u0440\u0435,\u043f\u044f\u0442\u044c,\u0448\u0435\u0441\u0442\u044c,\u0441\u0435\u043c\u044c,\u0432\u043e\u0441\u0435\u043c\u044c,\u0434\u0435\u0432\u044f\u0442\u044c,\u0434\u0435\u0441\u044f\u0442\u044c",tokens:"\u0432|\u043d\u0430,\u0433\u043e\u0434\u0430","short":"{d} {month} {yyyy} \u0433\u043e\u0434\u0430","long":"{d} {month} {yyyy} \u0433\u043e\u0434\u0430 {H}:{mm}",full:"{Weekday} {d} {month} {yyyy} \u0433\u043e\u0434\u0430 {H}:{mm}:{ss}",
relative:function(a,b,c,d){c=a.toString().slice(-1);switch(k){case a>=11&&a<=15:mult=3;break;case c==1:mult=1;break;case c>=2&&c<=4:mult=2;break;default:mult=3}a=a+" "+this.units[mult*8+b];switch(d){case "duration":return a;case "past":return a+" \u043d\u0430\u0437\u0430\u0434";case "future":return"\u0447\u0435\u0440\u0435\u0437 "+a}},timeMarker:"\u0432",ampm:" \u0443\u0442\u0440\u0430, \u0432\u0435\u0447\u0435\u0440\u0430",modifiers:[{name:"day",src:"\u043f\u043e\u0437\u0430\u0432\u0447\u0435\u0440\u0430",
value:-2},{name:"day",src:"\u0432\u0447\u0435\u0440\u0430",value:-1},{name:"day",src:"\u0441\u0435\u0433\u043e\u0434\u043d\u044f",value:0},{name:"day",src:"\u0437\u0430\u0432\u0442\u0440\u0430",value:1},{name:"day",src:"\u043f\u043e\u0441\u043b\u0435\u0437\u0430\u0432\u0442\u0440\u0430",value:2},{name:"sign",src:"\u043d\u0430\u0437\u0430\u0434",value:-1},{name:"sign",src:"\u0447\u0435\u0440\u0435\u0437",value:1},{name:"shift",src:"\u043f\u0440\u043e\u0448\u043b:\u044b\u0439|\u043e\u0439|\u043e\u043c",
value:-1},{name:"shift",src:"\u0441\u043b\u0435\u0434\u0443\u044e\u0449:\u0438\u0439|\u0435\u0439|\u0435\u043c",value:1}],dateParse:["{num} {unit} {sign}","{sign} {num} {unit}","{month} {year}","{0?} {shift} {unit=5-7}"],timeParse:["{date} {month} {year?} {1?}","{0?} {shift} {weekday}"]});
Date.addLocale("sv",{plural:k,months:"januari,februari,mars,april,maj,juni,juli,augusti,september,oktober,november,december",weekdays:"s\u00f6ndag|sondag,m\u00e5ndag:|en+mandag:|en,tisdag,onsdag,torsdag,fredag,l\u00f6rdag|lordag",units:"millisekund:|er,sekund:|er,minut:|er,timm:e|ar,dag:|ar,veck:a|or|an,m\u00e5nad:|er|en+manad:|er|en,\u00e5r:||et+ar:||et",numbers:"en|ett,tv\u00e5|tva,tre,fyra,fem,sex,sju,\u00e5tta|atta,nio,tio",tokens:"den,f\u00f6r|for",articles:"den","short":"den {d} {month} {yyyy}",
"long":"den {d} {month} {yyyy} {H}:{mm}",full:"{Weekday} den {d} {month} {yyyy} {H}:{mm}:{ss}",past:"{num} {unit} {sign}",future:"{sign} {num} {unit}",duration:"{num} {unit}",ampm:"am,pm",modifiers:[{name:"day",src:"f\u00f6rrg\u00e5r|i f\u00f6rrg\u00e5r|if\u00f6rrg\u00e5r|forrgar|i forrgar|iforrgar",value:-2},{name:"day",src:"g\u00e5r|i g\u00e5r|ig\u00e5r|gar|i gar|igar",value:-1},{name:"day",src:"dag|i dag|idag",value:0},{name:"day",src:"morgon|i morgon|imorgon",value:1},{name:"day",src:"\u00f6ver morgon|\u00f6vermorgon|i \u00f6ver morgon|i \u00f6vermorgon|i\u00f6vermorgon|over morgon|overmorgon|i over morgon|i overmorgon|iovermorgon",
value:2},{name:"sign",src:"sedan|sen",value:-1},{name:"sign",src:"om",value:1},{name:"shift",src:"i f\u00f6rra|f\u00f6rra|i forra|forra",value:-1},{name:"shift",src:"denna",value:0},{name:"shift",src:"n\u00e4sta|nasta",value:1}],dateParse:["{num} {unit} {sign}","{sign} {num} {unit}","{1?} {num} {unit} {sign}","{shift} {unit=5-7}"],timeParse:["{0?} {weekday?} {date?} {month} {year}","{date} {month}","{shift} {weekday}"]});
Date.addLocale("zh-CN",{variant:k,monthSuffix:"\u6708",weekdays:"\u661f\u671f\u65e5|\u5468\u65e5,\u661f\u671f\u4e00|\u5468\u4e00,\u661f\u671f\u4e8c|\u5468\u4e8c,\u661f\u671f\u4e09|\u5468\u4e09,\u661f\u671f\u56db|\u5468\u56db,\u661f\u671f\u4e94|\u5468\u4e94,\u661f\u671f\u516d|\u5468\u516d",units:"\u6beb\u79d2,\u79d2\u949f,\u5206\u949f,\u5c0f\u65f6,\u5929,\u4e2a\u661f\u671f|\u5468,\u4e2a\u6708,\u5e74",tokens:"\u65e5|\u53f7","short":"{yyyy}\u5e74{M}\u6708{d}\u65e5","long":"{yyyy}\u5e74{M}\u6708{d}\u65e5 {tt}{h}:{mm}",
full:"{yyyy}\u5e74{M}\u6708{d}\u65e5 {weekday} {tt}{h}:{mm}:{ss}",past:"{num}{unit}{sign}",future:"{num}{unit}{sign}",duration:"{num}{unit}",timeSuffixes:"\u70b9|\u65f6,\u5206\u949f?,\u79d2",ampm:"\u4e0a\u5348,\u4e0b\u5348",modifiers:[{name:"day",src:"\u524d\u5929",value:-2},{name:"day",src:"\u6628\u5929",value:-1},{name:"day",src:"\u4eca\u5929",value:0},{name:"day",src:"\u660e\u5929",value:1},{name:"day",src:"\u540e\u5929",value:2},{name:"sign",src:"\u524d",value:-1},{name:"sign",src:"\u540e",value:1},
{name:"shift",src:"\u4e0a|\u53bb",value:-1},{name:"shift",src:"\u8fd9",value:0},{name:"shift",src:"\u4e0b|\u660e",value:1}],dateParse:["{num}{unit}{sign}","{shift}{unit=5-7}"],timeParse:["{shift}{weekday}","{year}\u5e74{month?}\u6708?{date?}{0?}","{month}\u6708{date?}{0?}","{date}[\u65e5\u53f7]"]});
Date.addLocale("zh-TW",{monthSuffix:"\u6708",weekdays:"\u661f\u671f\u65e5|\u9031\u65e5,\u661f\u671f\u4e00|\u9031\u4e00,\u661f\u671f\u4e8c|\u9031\u4e8c,\u661f\u671f\u4e09|\u9031\u4e09,\u661f\u671f\u56db|\u9031\u56db,\u661f\u671f\u4e94|\u9031\u4e94,\u661f\u671f\u516d|\u9031\u516d",units:"\u6beb\u79d2,\u79d2\u9418,\u5206\u9418,\u5c0f\u6642,\u5929,\u500b\u661f\u671f|\u9031,\u500b\u6708,\u5e74",tokens:"\u65e5|\u865f","short":"{yyyy}\u5e74{M}\u6708{d}\u65e5","long":"{yyyy}\u5e74{M}\u6708{d}\u65e5 {tt}{h}:{mm}",
full:"{yyyy}\u5e74{M}\u6708{d}\u65e5 {Weekday} {tt}{h}:{mm}:{ss}",past:"{num}{unit}{sign}",future:"{num}{unit}{sign}",duration:"{num}{unit}",timeSuffixes:"\u9ede|\u6642,\u5206\u9418?,\u79d2",ampm:"\u4e0a\u5348,\u4e0b\u5348",modifiers:[{name:"day",src:"\u524d\u5929",value:-2},{name:"day",src:"\u6628\u5929",value:-1},{name:"day",src:"\u4eca\u5929",value:0},{name:"day",src:"\u660e\u5929",value:1},{name:"day",src:"\u5f8c\u5929",value:2},{name:"sign",src:"\u524d",value:-1},{name:"sign",src:"\u5f8c",value:1},
{name:"shift",src:"\u4e0a|\u53bb",value:-1},{name:"shift",src:"\u9019",value:0},{name:"shift",src:"\u4e0b|\u660e",value:1}],dateParse:["{num}{unit}{sign}","{shift}{unit=5-7}"],timeParse:["{shift}{weekday}","{year}\u5e74{month?}\u6708?{date?}{0?}","{month}\u6708{date?}{0?}","{date}[\u65e5\u865f]"]});})();

View File

@ -1,98 +1,98 @@
// create CS locale, because it's not supported by Sugar at all
Date.addLocale('cs', {
'plural': true,
'capitalizeUnit': false,
'months': 'ledna,února,března,dubna,května,června,července,srpna,září,října,listopadu,prosince',
'weekdays': 'neděle,pondělí,úterý,středa,čtvrtek,pátek,sobota',
'units': 'milisekund:a|y||ou|ami,sekund:a|y||ou|ami,minut:a|y||ou|ami,hodin:a|y||ou|ami,den|dny|dnů|dnem|dny,týden|týdny|týdnů|týdnem|týdny,měsíc:|e|ů|em|emi,rok|roky|let|rokem|lety',
'short': '{d}. {month} {yyyy}',
'short_no_year': '{d}. {month}',
'long': '{d}. {month} {yyyy} {H}:{mm}',
'full': '{weekday} {d}. {month} {yyyy} {H}:{mm}:{ss}',
'relative': function(num, unit, ms, format) {
var numberWithUnit, last = num.toString().slice(-1);
var mult;
if (format === 'past' || format === 'future') {
if (num === 1) mult = 3;
else mult = 4;
} else {
if (num === 1) mult = 0;
else if (num >= 2 && num <= 4) mult = 1;
else mult = 2;
}
numberWithUnit = num + ' ' + this.units[(mult * 8) + unit];
switch(format) {
case 'duration': return numberWithUnit;
case 'past': return 'před ' + numberWithUnit;
case 'future': return 'za ' + numberWithUnit;
}
}
});
// create DA locale, because it's not supported by Sugar at all
// TODO: currently just English, needs to be translated and localized
Date.addLocale('da', {
'plural': true,
'capitalizeUnit': false,
'months': 'January,February,March,April,May,June,July,August,September,October,November,December',
'weekdays': 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday',
'units': 'millisecond:|s,second:|s,minute:|s,hour:|s,day:|s,week:|s,month:|s,year:|s',
'short': '{Month} {d}, {yyyy}',
'short_no_year': '{Month} {d}',
'long': '{Month} {d}, {yyyy} {h}:{mm}{tt}',
'full': '{Weekday} {Month} {d}, {yyyy} {h}:{mm}:{ss}{tt}',
'past': '{num} {unit} {sign}',
'future': '{num} {unit} {sign}',
'duration': '{num} {unit}'
});
// fix DE locale
Date.getLocale('de').short_no_year = '{d}. {month}';
// fix EN locale
Date.getLocale('en').short_no_year = '{d} {Mon}';
// fix ES locale
Date.getLocale('es').short_no_year = '{d} {month}';
// fix FR locale
Date.getLocale('fr').short_no_year = '{d} {month}';
// create ID locale, because it's not supported by Sugar at all
// TODO: currently just English, needs to be translated and localized
Date.addLocale('id', {
'plural': true,
'capitalizeUnit': false,
'months': 'January,February,March,April,May,June,July,August,September,October,November,December',
'weekdays': 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday',
'units': 'millisecond:|s,second:|s,minute:|s,hour:|s,day:|s,week:|s,month:|s,year:|s',
'short': '{Month} {d}, {yyyy}',
'short_no_year': '{Month} {d}',
'long': '{Month} {d}, {yyyy} {h}:{mm}{tt}',
'full': '{Weekday} {Month} {d}, {yyyy} {h}:{mm}:{ss}{tt}',
'past': '{num} {unit} {sign}',
'future': '{num} {unit} {sign}',
'duration': '{num} {unit}'
});
// fix IT locale
Date.getLocale('it').short_no_year = '{d} {Month}';
// fix NL locale
Date.getLocale('nl').short_no_year = '{d} {Month}';
// fix PT locale
Date.getLocale('pt').short_no_year = '{d} de {month}';
// fix SV locale
Date.getLocale('sv').short_no_year = 'den {d} {month}';
// fix zh_CN locale
Date.getLocale('zh-CN').short_no_year = '{yyyy}年{M}月';
// fix zh_TW locale
Date.getLocale('zh-TW').short_no_year = '{yyyy}年{M}月';
// set the current date locale, replace underscore with dash to make zh_CN work
Date.setLocale(I18n.locale.replace("_","-"));
// // create CS locale, because it's not supported by Sugar at all
// Date.addLocale('cs', {
// 'plural': true,
// 'capitalizeUnit': false,
// 'months': 'ledna,února,března,dubna,května,června,července,srpna,září,října,listopadu,prosince',
// 'weekdays': 'neděle,pondělí,úterý,středa,čtvrtek,pátek,sobota',
// 'units': 'milisekund:a|y||ou|ami,sekund:a|y||ou|ami,minut:a|y||ou|ami,hodin:a|y||ou|ami,den|dny|dnů|dnem|dny,týden|týdny|týdnů|týdnem|týdny,měsíc:|e|ů|em|emi,rok|roky|let|rokem|lety',
// 'short': '{d}. {month} {yyyy}',
// 'short_no_year': '{d}. {month}',
// 'long': '{d}. {month} {yyyy} {H}:{mm}',
// 'full': '{weekday} {d}. {month} {yyyy} {H}:{mm}:{ss}',
// 'relative': function(num, unit, ms, format) {
// var numberWithUnit, last = num.toString().slice(-1);
// var mult;
// if (format === 'past' || format === 'future') {
// if (num === 1) mult = 3;
// else mult = 4;
// } else {
// if (num === 1) mult = 0;
// else if (num >= 2 && num <= 4) mult = 1;
// else mult = 2;
// }
// numberWithUnit = num + ' ' + this.units[(mult * 8) + unit];
// switch(format) {
// case 'duration': return numberWithUnit;
// case 'past': return 'před ' + numberWithUnit;
// case 'future': return 'za ' + numberWithUnit;
// }
// }
// });
//
// // create DA locale, because it's not supported by Sugar at all
// // TODO: currently just English, needs to be translated and localized
// Date.addLocale('da', {
// 'plural': true,
// 'capitalizeUnit': false,
// 'months': 'January,February,March,April,May,June,July,August,September,October,November,December',
// 'weekdays': 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday',
// 'units': 'millisecond:|s,second:|s,minute:|s,hour:|s,day:|s,week:|s,month:|s,year:|s',
// 'short': '{Month} {d}, {yyyy}',
// 'short_no_year': '{Month} {d}',
// 'long': '{Month} {d}, {yyyy} {h}:{mm}{tt}',
// 'full': '{Weekday} {Month} {d}, {yyyy} {h}:{mm}:{ss}{tt}',
// 'past': '{num} {unit} {sign}',
// 'future': '{num} {unit} {sign}',
// 'duration': '{num} {unit}'
// });
//
//
// // fix DE locale
// Date.getLocale('de').short_no_year = '{d}. {month}';
//
// // fix EN locale
// Date.getLocale('en').short_no_year = '{d} {Mon}';
//
// // fix ES locale
// Date.getLocale('es').short_no_year = '{d} {month}';
//
// // fix FR locale
// Date.getLocale('fr').short_no_year = '{d} {month}';
//
// // create ID locale, because it's not supported by Sugar at all
// // TODO: currently just English, needs to be translated and localized
// Date.addLocale('id', {
// 'plural': true,
// 'capitalizeUnit': false,
// 'months': 'January,February,March,April,May,June,July,August,September,October,November,December',
// 'weekdays': 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday',
// 'units': 'millisecond:|s,second:|s,minute:|s,hour:|s,day:|s,week:|s,month:|s,year:|s',
// 'short': '{Month} {d}, {yyyy}',
// 'short_no_year': '{Month} {d}',
// 'long': '{Month} {d}, {yyyy} {h}:{mm}{tt}',
// 'full': '{Weekday} {Month} {d}, {yyyy} {h}:{mm}:{ss}{tt}',
// 'past': '{num} {unit} {sign}',
// 'future': '{num} {unit} {sign}',
// 'duration': '{num} {unit}'
// });
//
// // fix IT locale
// Date.getLocale('it').short_no_year = '{d} {Month}';
//
// // fix NL locale
// Date.getLocale('nl').short_no_year = '{d} {Month}';
//
// // fix PT locale
// Date.getLocale('pt').short_no_year = '{d} de {month}';
//
// // fix SV locale
// Date.getLocale('sv').short_no_year = 'den {d} {month}';
//
// // fix zh_CN locale
// Date.getLocale('zh-CN').short_no_year = '{yyyy}年{M}月';
//
// // fix zh_TW locale
// Date.getLocale('zh-TW').short_no_year = '{yyyy}年{M}月';
//
// // set the current date locale, replace underscore with dash to make zh_CN work
// Date.setLocale(I18n.locale.replace("_","-"));

View File

@ -75,6 +75,7 @@ predef:
- I18n
- bootbox
- moment
- _
browser: true # true if the standard browser globals should be predefined
rhino: false # true if the Rhino environment globals should be predefined

View File

@ -81,12 +81,12 @@ module PrettyText
@ctx["helpers"] = Helpers.new
ctx_load( "app/assets/javascripts/external/md5.js",
"app/assets/javascripts/external/underscore.js",
"app/assets/javascripts/external/Markdown.Converter.js",
"app/assets/javascripts/external/twitter-text-1.5.0.js",
"lib/headless-ember.js",
"app/assets/javascripts/external/rsvp.js",
Rails.configuration.ember.handlebars_location,
"app/assets/javascripts/external_production/sugar-1.3.5.js")
Rails.configuration.ember.handlebars_location)
@ctx.eval("var Discourse = {}; Discourse.SiteSettings = #{SiteSetting.client_settings_json};")
@ctx.eval("var window = {}; window.devicePixelRatio = 2;") # hack to make code think stuff is retina

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"],function(e,t,n){var r=function(e){this.$editor=e;var t=this,n=[],r=!1;this.onAfterExec=function(){r=!1,t.processRows(n),n=[]},this.onExec=function(){r=!0},this.onChange=function(e){var t=e.data.range;r&&(n.indexOf(t.start.row)==-1&&n.push(t.start.row),t.end.row!=t.start.row&&n.push(t.end.row))}};(function(){this.processRows=function(e){this.$inChange=!0;var t=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(t.indexOf(i)>-1)continue;var s=this.$findCellWidthsForBlock(i),o=this.$setBlockCellWidthsToMax(s.cellWidths),u=s.firstRow;for(var a=0,f=o.length;a<f;a++){var l=o[a];t.push(u),this.$adjustRow(u,l),u++}}this.$inChange=!1},this.$findCellWidthsForBlock=function(e){var t=[],n,r=e;while(r>=0){n=this.$cellWidthsForRow(r);if(n.length==0)break;t.unshift(n),r--}var i=r+1;r=e;var s=this.$editor.session.getLength();while(r<s-1){r++,n=this.$cellWidthsForRow(r);if(n.length==0)break;t.push(n)}return{cellWidths:t,firstRow:i}},this.$cellWidthsForRow=function(e){var t=this.$selectionColumnsForRow(e),n=[-1].concat(this.$tabsForRow(e)),r=n.map(function(e){return 0}).slice(1),i=this.$editor.session.getLine(e);for(var s=0,o=n.length-1;s<o;s++){var u=n[s]+1,a=n[s+1],f=this.$rightmostSelectionInCell(t,a),l=i.substring(u,a);r[s]=Math.max(l.replace(/\s+$/g,"").length,f-u)}return r},this.$selectionColumnsForRow=function(e){var t=[],n=this.$editor.getCursorPosition();return this.$editor.session.getSelection().isEmpty()&&e==n.row&&t.push(n.column),t},this.$setBlockCellWidthsToMax=function(e){var t=!0,n,r,i,s=this.$izip_longest(e);for(var o=0,u=s.length;o<u;o++){var a=s[o];if(!a.push){console.error(a);continue}a.push(NaN);for(var f=0,l=a.length;f<l;f++){var c=a[f];t&&(n=f,i=0,t=!1);if(isNaN(c)){r=f;for(var h=n;h<r;h++)e[h][o]=i;t=!0}i=Math.max(i,c)}}return e},this.$rightmostSelectionInCell=function(e,t){var n=0;if(e.length){var r=[];for(var i=0,s=e.length;i<s;i++)e[i]<=t?r.push(i):r.push(0);n=Math.max.apply(Math,r)}return n},this.$tabsForRow=function(e){var t=[],n=this.$editor.session.getLine(e),r=/\t/g,i;while((i=r.exec(n))!=null)t.push(i.index);return t},this.$adjustRow=function(e,t){var n=this.$tabsForRow(e);if(n.length==0)return;var r=0,i=-1,s=this.$izip(t,n);for(var o=0,u=s.length;o<u;o++){var a=s[o][0],f=s[o][1];i+=1+a,f+=r;var l=i-f;if(l==0)continue;var c=this.$editor.session.getLine(e).substr(0,f),h=c.replace(/\s*$/g,""),p=c.length-h.length;l>0&&(this.$editor.session.getDocument().insertInLine({row:e,column:f+1},Array(l+1).join(" ")+" "),this.$editor.session.getDocument().removeInLine(e,f,f+1),r+=l),l<0&&p>=-l&&(this.$editor.session.getDocument().removeInLine(e,f+l,f),r+=l)}},this.$izip_longest=function(e){if(!e[0])return[];var t=e[0].length,n=e.length;for(var r=1;r<n;r++){var i=e[r].length;i>t&&(t=i)}var s=[];for(var o=0;o<t;o++){var u=[];for(var r=0;r<n;r++)e[r][o]===""?u.push(NaN):u.push(e[r][o]);s.push(u)}return s},this.$izip=function(e,t){var n=e.length>=t.length?t.length:e.length,r=[];for(var i=0;i<n;i++){var s=[e[i],t[i]];r.push(s)}return r}}).call(r.prototype),t.ElasticTabstopsLite=r;var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{useElasticTabstops:{set:function(e){e?(this.elasticTabstops||(this.elasticTabstops=new r(this)),this.commands.on("afterExec",this.elasticTabstops.onAfterExec),this.commands.on("exec",this.elasticTabstops.onExec),this.on("change",this.elasticTabstops.onChange)):this.elasticTabstops&&(this.commands.removeListener("afterExec",this.elasticTabstops.onAfterExec),this.commands.removeListener("exec",this.elasticTabstops.onExec),this.removeListener("change",this.elasticTabstops.onChange))}}})})

View File

@ -0,0 +1 @@
define("ace/ext/emmet",["require","exports","module","ace/keyboard/hash_handler","ace/editor","ace/config"],function(e,t,n){function o(){}var r=e("ace/keyboard/hash_handler").HashHandler,i=e("ace/editor").Editor,s;i.prototype.indexToPosition=function(e){return this.session.doc.indexToPosition(e)},i.prototype.positionToIndex=function(e){return this.session.doc.positionToIndex(e)},o.prototype={setupContext:function(e){this.ace=e,this.indentation=e.session.getTabString(),s||(s=window.emmet),s.require("resources").setVariable("indentation",this.indentation),this.$syntax=null,this.$syntax=this.getSyntax()},getSelectionRange:function(){var e=this.ace.getSelectionRange();return{start:this.ace.positionToIndex(e.start),end:this.ace.positionToIndex(e.end)}},createSelection:function(e,t){this.ace.selection.setRange({start:this.ace.indexToPosition(e),end:this.ace.indexToPosition(t)})},getCurrentLineRange:function(){var e=this.ace.getCursorPosition().row,t=this.ace.session.getLine(e).length,n=this.ace.positionToIndex({row:e,column:0});return{start:n,end:n+t}},getCaretPos:function(){var e=this.ace.getCursorPosition();return this.ace.positionToIndex(e)},setCaretPos:function(e){var t=this.ace.indexToPosition(e);this.ace.clearSelection(),this.ace.selection.moveCursorToPosition(t)},getCurrentLine:function(){var e=this.ace.getCursorPosition().row;return this.ace.session.getLine(e)},replaceContent:function(e,t,n,r){n==null&&(n=t==null?this.getContent().length:t),t==null&&(t=0);var i=s.require("utils");r||(e=i.padString(e,i.getLinePaddingFromPosition(this.getContent(),t)));var o=s.require("tabStops").extract(e,{escape:function(e){return e}});e=o.text;var u=o.tabstops[0];u?(u.start+=t,u.end+=t):u={start:e.length+t,end:e.length+t};var a=this.ace.getSelectionRange();a.start=this.ace.indexToPosition(t),a.end=this.ace.indexToPosition(n),this.ace.session.replace(a,e),a.start=this.ace.indexToPosition(u.start),a.end=this.ace.indexToPosition(u.end),this.ace.selection.setRange(a)},getContent:function(){return this.ace.getValue()},getSyntax:function(){if(this.$syntax)return this.$syntax;var e=this.ace.session.$modeId.split("/").pop();if(e=="html"||e=="php"){var t=this.ace.getCursorPosition(),n=this.ace.session.getState(t.row);typeof n!="string"&&(n=n[0]),n&&(n=n.split("-"),n.length>1?e=n[0]:e=="php"&&(e="html"))}return e},getProfileName:function(){switch(this.getSyntax()){case"css":return"css";case"xml":case"xsl":return"xml";case"html":var e=s.require("resources").getVariable("profile");return e||(e=this.ace.session.getLines(0,2).join("").search(/<!DOCTYPE[^>]+XHTML/i)!=-1?"xhtml":"html"),e}return"xhtml"},prompt:function(e){return prompt(e)},getSelection:function(){return this.ace.session.getTextRange()},getFilePath:function(){return""}};var u={expand_abbreviation:{mac:"ctrl+alt+e",win:"alt+e"},match_pair_outward:{mac:"ctrl+d",win:"ctrl+,"},match_pair_inward:{mac:"ctrl+j",win:"ctrl+shift+0"},matching_pair:{mac:"ctrl+alt+j",win:"alt+j"},next_edit_point:"alt+right",prev_edit_point:"alt+left",toggle_comment:{mac:"command+/",win:"ctrl+/"},split_join_tag:{mac:"shift+command+'",win:"shift+ctrl+`"},remove_tag:{mac:"command+'",win:"shift+ctrl+;"},evaluate_math_expression:{mac:"shift+command+y",win:"shift+ctrl+y"},increment_number_by_1:"ctrl+up",decrement_number_by_1:"ctrl+down",increment_number_by_01:"alt+up",decrement_number_by_01:"alt+down",increment_number_by_10:{mac:"alt+command+up",win:"shift+alt+up"},decrement_number_by_10:{mac:"alt+command+down",win:"shift+alt+down"},select_next_item:{mac:"shift+command+.",win:"shift+ctrl+."},select_previous_item:{mac:"shift+command+,",win:"shift+ctrl+,"},reflect_css_value:{mac:"shift+command+r",win:"shift+ctrl+r"},encode_decode_data_url:{mac:"shift+ctrl+d",win:"ctrl+'"},expand_abbreviation_with_tab:"Tab",wrap_with_abbreviation:{mac:"shift+ctrl+a",win:"shift+ctrl+a"}},a=new o;t.commands=new r,t.runEmmetCommand=function(e){a.setupContext(e);if(a.getSyntax()=="php")return!1;var t=s.require("actions");if(this.action=="expand_abbreviation_with_tab"&&!e.selection.isEmpty())return!1;if(this.action=="wrap_with_abbreviation")return setTimeout(function(){t.run("wrap_with_abbreviation",a)},0);try{var n=t.run(this.action,a)}catch(r){e._signal("changeStatus",typeof r=="string"?r:r.message),console.log(r)}return n};for(var f in u)t.commands.addCommand({name:"emmet:"+f,action:f,bindKey:u[f],exec:t.runEmmetCommand,multiSelectAction:"forEach"});var l=function(e,n){var r=n;if(!r)return;var i=r.session.$modeId,s=i&&/css|less|sass|html|php/.test(i);e.enableEmmet===!1&&(s=!1),s?r.keyBinding.addKeyboardHandler(t.commands):r.keyBinding.removeKeyboardHandler(t.commands)};t.AceEmmetEditor=o,e("ace/config").defineOptions(i.prototype,"editor",{enableEmmet:{set:function(e){this[e?"on":"removeListener"]("changeMode",l),l({enableEmmet:!!e},this)},value:!0}}),t.setCore=function(e){s=e}})

View File

@ -0,0 +1 @@
define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"],function(e,t,n){function i(t){if(!document.getElementById("kbshortcutmenu")){var n=e("./menu_tools/overlay_page").overlayPage,r=e("./menu_tools/get_editor_keyboard_shortcuts").getEditorKeybordShortcuts,i=r(t),s=document.createElement("div"),o=i.reduce(function(e,t){return e+'<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'+t.command+"</span> : "+'<span class="ace_optionsMenuKey">'+t.key+"</span></div>"},"");s.id="kbshortcutmenu",s.innerHTML="<h1>Keyboard Shortcuts</h1>"+o+"</div>",n(t,s,"0","0","0",null)}}var r=e("ace/editor").Editor;n.exports.init=function(e){r.prototype.showKeyboardShortcuts=function(){i(this)},e.commands.addCommands([{name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e,t){e.showKeyboardShortcuts()}}])}}),define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,t,n){var r=e("../../lib/dom"),i="#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);-webkit-transition: all 0.5s;transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 1000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}";r.importCssString(i),n.exports.overlayPage=function(t,n,i,s,o,u){function l(e){e.keyCode===27&&a.click()}i=i?"top: "+i+";":"",o=o?"bottom: "+o+";":"",s=s?"right: "+s+";":"",u=u?"left: "+u+";":"";var a=document.createElement("div"),f=document.createElement("div");a.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; background-color: rgba(0, 0, 0, 0.3);",a.addEventListener("click",function(){document.removeEventListener("keydown",l),a.parentNode.removeChild(a),t.focus(),a=null}),document.addEventListener("keydown",l),f.style.cssText=i+s+o+u,f.addEventListener("click",function(e){e.stopPropagation()});var c=r.createElement("div");c.style.position="relative";var h=r.createElement("div");h.className="ace_closeButton",h.addEventListener("click",function(){a.click()}),c.appendChild(h),f.appendChild(c),f.appendChild(n),a.appendChild(f),document.body.appendChild(a),t.blur()}}),define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"],function(e,t,n){var r=e("../../lib/keys");n.exports.getEditorKeybordShortcuts=function(e){var t=r.KEY_MODS,n=[],i={};return e.keyBinding.$handlers.forEach(function(e){var r=e.commmandKeyBinding;for(var s in r){var o=parseInt(s);o==-1?o="":isNaN(o)?o=s:o=""+(o&t.command?"Cmd-":"")+(o&t.ctrl?"Ctrl-":"")+(o&t.alt?"Alt-":"")+(o&t.shift?"Shift-":"");for(var u in r[s]){var a=r[s][u];typeof a!="string"&&(a=a.name),i[a]?i[a].key+="|"+o+u:(i[a]={key:o+u,command:a},n.push(i[a]))}}}),n}})

View File

@ -0,0 +1 @@
define("ace/ext/modelist",["require","exports","module"],function(e,t,n){function i(e){var t=a.text,n=e.split(/[\/\\]/).pop();for(var i=0;i<r.length;i++)if(r[i].supportsFile(n)){t=r[i];break}return t}var r=[],s=function(e,t,n){this.name=e,this.caption=t,this.mode="ace/mode/"+e,this.extensions=n;if(/\^/.test(n))var r=n.replace(/\|(\^)?/g,function(e,t){return"$|"+(t?"^":"^.*\\.")})+"$";else var r="^.*\\.("+n+")$";this.extRe=new RegExp(r,"gi")};s.prototype.supportsFile=function(e){return e.match(this.extRe)};var o={ABAP:["abap"],ADA:["ada|adb"],ActionScript:["as"],AsciiDoc:["asciidoc"],Assembly_x86:["asm"],AutoHotKey:["ahk"],BatchFile:["bat|cmd"],C9Search:["c9search_results"],C_Cpp:["c|cc|cpp|cxx|h|hh|hpp"],Clojure:["clj"],Cobol:["^CBL|COB"],coffee:["^Cakefile|coffee|cf|cson"],ColdFusion:["cfm"],CSharp:["cs"],CSS:["css"],Curly:["curly"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Dot:["dot"],Erlang:["erl|hrl"],EJS:["ejs"],Forth:["frt|fs|ldr"],FreeMarker:["ftl"],Glsl:["glsl|frag|vert"],golang:["go"],Groovy:["groovy"],HAML:["haml"],Haskell:["hs"],haXe:["hx"],HTML:["htm|html|xhtml"],HTML_Ruby:["erb|rhtml|html.erb"],Ini:["Ini|conf"],Jade:["jade"],Java:["java"],JavaScript:["js"],JSON:["json"],JSONiq:["jq"],JSP:["jsp"],JSX:["jsx"],Julia:["jl"],LaTeX:["latex|tex|ltx|bib"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],LogiQL:["logic|lql"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^GNUmakefile|^makefile|^Makefile|^OCamlMakefile|make"],MATLAB:["matlab"],Markdown:["md|markdown"],MySQL:["mysql"],MUSHCode:["mc|mush"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Pascal:["pas|p"],Perl:["pl|pm"],pgSQL:["pgsql"],PHP:["php|phtml"],Powershell:["ps1"],Prolog:["plg|prolog"],Properties:["properties"],Python:["py"],R:["r"],RDoc:["Rd"],RHTML:["Rhtml"],Ruby:["ru|gemspec|rake|rb"],Rust:["rs"],SASS:["sass"],SCAD:["scad"],Scala:["scala"],Scheme:["scm|rkt"],SCSS:["scss"],SH:["sh|bash"],snippets:["snippets"],SQL:["sql"],Stylus:["styl|stylus"],SVG:["svg"],Tcl:["tcl"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],Twig:["twig"],Typescript:["typescript|ts|str"],VBScript:["vbs"],Velocity:["vm"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"],XQuery:["xq"],YAML:["yaml"]},u={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C/C++",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)"},a={};for(var f in o){var l=o[f],c=u[f]||f,h=f.toLowerCase(),p=new s(h,c,l[0]);a[h]=p,r.push(p)}n.exports={getModeForPath:i,modes:r,modesByName:a}})

View File

@ -0,0 +1 @@
define("ace/ext/options",["require","exports","module"],function(e,t,n){function u(e,t){var n=document.getElementById(e);localStorage&&localStorage.getItem(e)&&(n.checked=localStorage.getItem(e)=="1");var r=function(){t(!!n.checked),saveOption(n)};n.onclick=r,r()}function a(e,t){var n=document.getElementById(e);localStorage&&localStorage.getItem(e)&&(n.value=localStorage.getItem(e));var r=function(){t(n.value),saveOption(n)};n.onchange=r,r()}function f(e,t){e.forEach(function(e){var n=document.createElement("option");n.setAttribute("value",e.name),n.innerHTML=e.desc,t.appendChild(n)})}function l(e,t){if(Array.isArray(e)){f(e,t);return}for(var n in e){var r=document.createElement("optgroup");r.setAttribute("label",n),f(e[n],r),t.appendChild(r)}}function c(e){if(e.values){var t=dom.createElement("select");t.setAttribute("size",e.visibleSize||1),l(e.values,t)}else var t=dom.createElement("checkbox");return t.setAttribute("name","opt_"+e.name),t}function h(e){if(e.values){var t=dom.createElement("select");t.setAttribute("size",e.visibleSize||1),l(e.values,t)}else var t=dom.createElement("checkbox");return t.setAttribute("name","opt_"+e.name),t}var r=modelist.modesByName,i=[["Document",function(e){doclist.loadDoc(e,function(e){if(!e)return;e=env.split.setSession(e),updateUIEditorOptions(),env.editor.focus()})},doclist.all],["Mode",function(e){env.editor.session.setMode(r[e].mode||r.text.mode),env.editor.session.modeName=e},function(e){return env.editor.session.modeName||"text"},modelist.modes],["Split",function(e){var t=env.split;if(e=="none")t.getSplits()==2&&(env.secondSession=t.getEditor(1).session),t.setSplits(1);else{var n=t.getSplits()==1;e=="below"?t.setOrientation(t.BELOW):t.setOrientation(t.BESIDE),t.setSplits(2);if(n){var r=env.secondSession||t.getEditor(0).session,i=t.setSession(r,1);i.name=r.name}}},["None","Beside","Below"]],["Theme",function(e){if(!e)return;env.editor.setTheme("ace/theme/"+e),themeEl.selectedValue=e},function(){return env.editor.getTheme()},{Bright:{chrome:"Chrome",clouds:"Clouds",crimson_editor:"Crimson Editor",dawn:"Dawn",dreamweaver:"Dreamweaver",eclipse:"Eclipse",github:"GitHub",solarized_light:"Solarized Light",textmate:"TextMate",tomorrow:"Tomorrow",xcode:"XCode"},Dark:{ambiance:"Ambiance",chaos:"Chaos",clouds_midnight:"Clouds Midnight",cobalt:"Cobalt",idle_fingers:"idleFingers",kr_theme:"krTheme",merbivore:"Merbivore",merbivore_soft:"Merbivore Soft",mono_industrial:"Mono Industrial",monokai:"Monokai",pastel_on_dark:"Pastel on dark",solarized_dark:"Solarized Dark",twilight:"Twilight",tomorrow_night:"Tomorrow Night",tomorrow_night_blue:"Tomorrow Night Blue",tomorrow_night_bright:"Tomorrow Night Bright",tomorrow_night_eighties:"Tomorrow Night 80s",vibrant_ink:"Vibrant Ink"}}],["Code Folding",function(e){env.editor.getSession().setFoldStyle(e),env.editor.setShowFoldWidgets(e!=="manual")},["manual","mark begin","mark begin and end"]],["Soft Wrap",function(e){e=e.toLowerCase();var t=env.editor.getSession(),n=env.editor.renderer;t.setUseWrapMode(e=="off");var r=parseInt(e)||null;n.setPrintMarginColumn(r||80),t.setWrapLimitRange(r,r)},["Off","40 Chars","80 Chars","Free"]],["Key Binding",function(e){env.editor.setKeyboardHandler(keybindings[e])},["Ace","Vim","Emacs","Custom"]],["Font Size",function(e){env.split.setFontSize(e+"px")},[10,11,12,14,16,20,24]],["Full Line Selection",function(e){env.editor.setSelectionStyle(e?"line":"text")}],["Highlight Active Line",function(e){env.editor.setHighlightActiveLine(e)}],["Show Invisibles",function(e){env.editor.setShowInvisibles(e)}],["Show Gutter",function(e){env.editor.renderer.setShowGutter(e)}],["Show Indent Guides",function(e){env.editor.renderer.setDisplayIndentGuides(e)}],["Show Print Margin",function(e){env.editor.renderer.setShowPrintMargin(e)}],["Persistent HScroll",function(e){env.editor.renderer.setHScrollBarAlwaysVisible(e)}],["Animate Scrolling",function(e){env.editor.setAnimatedScroll(e)}],["Use Soft Tab",function(e){env.editor.getSession().setUseSoftTabs(e)}],["Highlight Selected Word",function(e){env.editor.setHighlightSelectedWord(e)}],["Enable Behaviours",function(e){env.editor.setBehavioursEnabled(e)}],["Fade Fold Widgets",function(e){env.editor.setFadeFoldWidgets(e)}],["Show Token info",function(e){env.editor.setFadeFoldWidgets(e)}]],o=function(e){var t=[],n=document.createElement("div");n.style.cssText="position: absolute; overflow: hidden";var r=document.createElement("div");return r.style.cssText="width: 120%;height:100%;overflow: scroll",n.appendChild(r),t.push("<table><tbody>"),e.forEach(function(e){}),t.push("<tr>","<td>",'<label for="',s,'"></label>',"</td><td>",'<input type="',s,'" name="',s,'" id="',s,'">',"</td>","</tr>"),t.push("</tbody></table>"),n};o(i)})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"],function(e,t,n){var r=e("../lib/event");t.contextMenuHandler=function(e){var t=e.target,n=t.textInput.getElement();if(!t.selection.isEmpty())return;var i=t.getCursorPosition(),s=t.session.getWordRange(i.row,i.column),o=t.session.getTextRange(s);t.session.tokenRe.lastIndex=0;if(!t.session.tokenRe.test(o))return;var u="",a=o+" "+u;n.value=a,n.setSelectionRange(o.length+1,o.length+1),n.setSelectionRange(0,0);var f=!1;r.addListener(n,"keydown",function l(){r.removeListener(n,"keydown",l),f=!0}),t.textInput.setInputHandler(function(e){console.log(e,a,n.selectionStart,n.selectionEnd);if(e==a)return"";if(e.lastIndexOf(a,0)===0)return e.slice(a.length);if(e.substr(n.selectionEnd)==a)return e.slice(0,-a.length);if(e.slice(-2)==u){var r=e.slice(0,-2);if(r.slice(-1)==" ")return f?r.substring(0,n.selectionEnd):(r=r.slice(0,-1),t.session.replace(s,r),"")}return e})};var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{spellcheck:{set:function(e){var n=this.textInput.getElement();n.spellcheck=!!e,e?this.on("nativecontextmenu",t.contextMenuHandler):this.removeListener("nativecontextmenu",t.contextMenuHandler)},value:!0}})})

View File

@ -0,0 +1 @@
define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config"],function(e,t,n){var r=e("../edit_session").EditSession,i=e("../layer/text").Text,s=".ace_editor {font-family: 'Monaco', 'Menlo', 'Droid Sans Mono', 'Courier New', monospace;font-size: 12px;}.ace_editor .ace_gutter {width: 25px !important;display: block;float: left;text-align: right;padding: 0 3px 0 0;margin-right: 3px;}.ace_line { clear: both; }*.ace_gutter-cell {-moz-user-select: -moz-none;-khtml-user-select: none;-webkit-user-select: none;user-select: none;}",o=e("../config");t.render=function(e,n,r,i,s,u){function f(){var o=t.renderSync(e,n,r,i,s);return u?u(o):o}var a=0;return typeof r=="string"&&(a++,o.loadModule(["theme",r],function(e){r=e,--a||f()})),typeof n=="string"&&(a++,o.loadModule(["mode",n],function(e){n=new e.Mode,--a||f()})),a||f()},t.renderSync=function(e,t,n,o,u){o=parseInt(o||1,10);var a=new r("");a.setUseWorker(!1),a.setMode(t);var f=new i(document.createElement("div"));f.setSession(a),f.config={characterWidth:10,lineHeight:20},a.setValue(e);var l=[],c=a.getLength();for(var h=0;h<c;h++)l.push("<div class='ace_line'>"),u||l.push("<span class='ace_gutter ace_gutter-cell' unselectable='on'>"+(h+o)+"</span>"),f.$renderLine(l,h,!0,!1),l.push("</div>");var p="<div class=':cssClass'> <div class='ace_editor ace_scroller ace_text-layer'> :code </div> </div>".replace(/:cssClass/,n.cssClass).replace(/:code/,l.join(""));return f.destroy(),{css:s+n.cssText,html:p}}})

View File

@ -0,0 +1 @@
define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t,n){var r=e("ace/lib/dom"),i=e("ace/lib/lang"),s=function(e,t){this.element=r.createElement("div"),this.element.className="ace_status-indicator",this.element.style.cssText="display: inline-block;",t.appendChild(this.element);var n=i.delayedCall(function(){this.updateStatus(e)}.bind(this));e.on("changeStatus",function(){n.schedule(100)}),e.on("changeSelection",function(){n.schedule(100)})};(function(){this.updateStatus=function(e){function n(e,n){e&&t.push(e,n||"|")}var t=[];e.$vimModeHandler?n(e.$vimModeHandler.getStatusText()):e.commands.recording&&n("REC");var r=e.selection.lead;n(r.row+":"+r.column," ");if(!e.selection.isEmpty()){var i=e.getSelectionRange();n("("+(i.end.row-i.start.row)+":"+(i.end.column-i.start.column)+")")}t.pop(),this.element.textContent=t.join("")}}).call(s.prototype),t.StatusBar=s})

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
define("ace/ext/themelist",["require","exports","module","ace/ext/themelist_utils/themes"],function(e,t,n){n.exports.themes=e("ace/ext/themelist_utils/themes").themes,n.exports.ThemeDescription=function(e){this.name=e,this.desc=e.split("_").map(function(e){return e[0].toUpperCase()+e.slice(1)}).join(" "),this.theme="ace/theme/"+e},n.exports.themesByName={},n.exports.themes=n.exports.themes.map(function(e){return n.exports.themesByName[e]=new n.exports.ThemeDescription(e),n.exports.themesByName[e]})}),define("ace/ext/themelist_utils/themes",["require","exports","module"],function(e,t,n){n.exports.themes=["ambiance","chaos","chrome","clouds","clouds_midnight","cobalt","crimson_editor","dawn","dreamweaver","eclipse","github","idle_fingers","kr_theme","merbivore","merbivore_soft","monokai","mono_industrial","pastel_on_dark","solarized_dark","solarized_light","terminal","textmate","tomorrow","tomorrow_night","tomorrow_night_blue","tomorrow_night_bright","tomorrow_night_eighties","twilight","vibrant_ink","xcode"]})

View File

@ -0,0 +1 @@
define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,t,n){var r=e("../lib/lang");t.$detectIndentation=function(e,t){function h(e){var t=0;for(var r=e;r<n.length;r+=e)t+=n[r]||0;return t}var n=[],r=[],i=0,s=0,o=Math.min(e.length,1e3);for(var u=0;u<o;u++){var a=e[u];if(!/^\s*[^*+\-\s]/.test(a))continue;var f=a.match(/^\t*/)[0].length;a[0]==" "&&i++;var l=a.match(/^ */)[0].length;if(l&&a[l]!=" "){var c=l-s;c>0&&!(s%c)&&!(l%c)&&(r[c]=(r[c]||0)+1),n[l]=(n[l]||0)+1}s=l;while(a[a.length-1]=="\\")a=e[u++]}var p=r.reduce(function(e,t){return e+t},0),d={score:0,length:0},v=0;for(var u=1;u<12;u++){if(u==1){v=h(u);var m=1}else var m=h(u)/v;r[u]&&(m+=r[u]/p),m>d.score&&(d={score:m,length:u})}if(d.score&&d.score>1.4)var g=d.length;if(i>v+1)return{ch:" ",length:g};if(v+1>i)return{ch:" ",length:g}},t.detectIndentation=function(e){var n=e.getLines(0,1e3),r=t.$detectIndentation(n)||{};return r.ch&&e.setUseSoftTabs(r.ch==" "),r.length&&e.setTabSize(r.length),r},t.trimTrailingSpace=function(e){var t=e.getDocument(),n=t.getAllLines();for(var r=0,i=n.length;r<i;r++){var s=n[r],o=s.search(/\s+$/);o!==-1&&t.removeInLine(r,o,s.length)}},t.convertIndentation=function(e,t,n){var i=e.getTabString()[0],s=e.getTabSize();n||(n=s),t||(t=i);var o=t==" "?t:r.stringRepeat(t,n),u=e.doc,a=u.getAllLines(),f={},l={};for(var c=0,h=a.length;c<h;c++){var p=a[c],d=p.match(/^\s*/)[0];if(d){var v=e.$getStringScreenWidth(d)[0],m=Math.floor(v/s),g=v%s,y=f[m]||(f[m]=r.stringRepeat(o,m));y+=l[g]||(l[g]=r.stringRepeat(" ",g)),y!=d&&(u.removeInLine(c,0,d.length),u.insertInLine({row:c,column:0},y))}}e.setTabSize(n),e.setUseSoftTabs(t==" ")},t.$parseStringArg=function(e){var t={};/t/.test(e)?t.ch=" ":/s/.test(e)&&(t.ch=" ");var n=e.match(/\d+/);return n&&(t.length=parseInt(n[0])),t},t.$parseArg=function(e){return e?typeof e=="string"?t.$parseStringArg(e):typeof e.text=="string"?t.$parseStringArg(e.text):e:{}},t.commands=[{name:"detectIndentation",exec:function(e){t.detectIndentation(e.session)}},{name:"trimTrailingSpace",exec:function(e){t.trimTrailingSpace(e.session)}},{name:"convertIndentation",exec:function(e,n){var r=t.$parseArg(n);t.convertIndentation(e.session,n.ch,n.length)}},{name:"setIndentation",exec:function(e,n){var r=t.$parseArg(n);r.length&&e.session.setTabSize(r.length),r.ch&&e.session.setUseSoftTabs(r.ch==" ")}}]})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
define("ace/mode/ada",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/ada_highlight_rules","ace/range"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./ada_highlight_rules").AdaHighlightRules,u=e("../range").Range,a=function(){this.$tokenizer=new s((new o).getRules())};r.inherits(a,i),function(){this.lineCommentStart="--"}.call(a.prototype),t.Mode=a}),define("ace/mode/ada_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="abort|else|new|return|abs|elsif|not|reverse|abstract|end|null|accept|entry|select|access|exception|of|separate|aliased|exit|or|some|all|others|subtype|and|for|out|synchronized|array|function|overriding|at|tagged|generic|package|task|begin|goto|pragma|terminate|body|private|then|if|procedure|type|case|in|protected|constant|interface|until||is|raise|use|declare|range|delay|limited|record|when|delta|loop|rem|while|digits|renames|with|do|mod|requeue|xor",t="true|false|null",n="count|min|max|avg|sum|rank|now|coalesce|main",r=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]}};r.inherits(s,i),t.AdaHighlightRules=s})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
define("ace/mode/batchfile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/batchfile_highlight_rules","ace/mode/folding/cstyle"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./batchfile_highlight_rules").BatchFileHighlightRules,u=e("./folding/cstyle").FoldMode,a=function(){var e=new o;this.foldingRules=new u,this.$tokenizer=new s(e.getRules())};r.inherits(a,i),function(){this.lineCommentStart="::",this.blockComment=""}.call(a.prototype),t.Mode=a}),define("ace/mode/batchfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"keyword.command.dosbatch",regex:"\\b(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\\b",caseInsensitive:!0},{token:"keyword.control.statement.dosbatch",regex:"\\b(?:goto|call|exit)\\b",caseInsensitive:!0},{token:"keyword.control.conditional.if.dosbatch",regex:"\\bif\\s+not\\s+(?:exist|defined|errorlevel|cmdextversion)\\b",caseInsensitive:!0},{token:"keyword.control.conditional.dosbatch",regex:"\\b(?:if|else)\\b",caseInsensitive:!0},{token:"keyword.control.repeat.dosbatch",regex:"\\bfor\\b",caseInsensitive:!0},{token:"keyword.operator.dosbatch",regex:"\\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\\b"},{token:["doc.comment","comment"],regex:"(?:^|\\b)(rem)($|\\s.*$)",caseInsensitive:!0},{token:"comment.line.colons.dosbatch",regex:"::.*$"},{include:"variable"},{token:"punctuation.definition.string.begin.shell",regex:'"',push:[{token:"punctuation.definition.string.end.shell",regex:'"',next:"pop"},{include:"variable"},{defaultToken:"string.quoted.double.dosbatch"}]},{token:"keyword.operator.pipe.dosbatch",regex:"[|]"},{token:"keyword.operator.redirect.shell",regex:"&>|\\d*>&\\d*|\\d*(?:>>|>|<)|\\d*<&|\\d*<>"}],variable:[{token:"constant.numeric",regex:"%%\\w+"},{token:["markup.list","constant.other","markup.list"],regex:"(%)(\\w+)(%?)"}]},this.normalizeRules()};s.metaData={name:"Batch File",scopeName:"source.dosbatch",fileTypes:["bat"]},r.inherits(s,i),t.BatchFileHighlightRules=s}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i=r.match(this.foldingStartMarker);if(i){var s=i.index;return i[1]?this.openingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s+i[0].length,1)}if(t!=="markbeginend")return;var i=r.match(this.foldingStopMarker);if(i){var s=i.index+i[0].length;return i[1]?this.closingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s,-1)}}}.call(o.prototype)})

View File

@ -0,0 +1 @@
define("ace/mode/c9search",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/c9search_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/c9search"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./c9search_highlight_rules").C9SearchHighlightRules,u=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("./folding/c9search").FoldMode,f=function(){this.$tokenizer=new s((new o).getRules()),this.$outdent=new u,this.foldingRules=new a};r.inherits(f,i),function(){this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t);return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)}}.call(f.prototype),t.Mode=f}),define("ace/mode/c9search_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:["c9searchresults.constant.numeric","c9searchresults.text","c9searchresults.text"],regex:"(^\\s+[0-9]+)(:\\s*)(.+)"},{token:["string","text"],regex:"(.+)(:$)"}]}};r.inherits(s,i),t.C9SearchHighlightRules=s}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/folding/c9search",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(){};r.inherits(o,s),function(){this.foldingStartMarker=/^(\S.*\:|Searching for.*)$/,this.foldingStopMarker=/^(\s+|Found.*)$/,this.getFoldWidgetRange=function(e,t,n){var r=e.doc.getAllLines(n),s=r[n],o=/^(Found.*|Searching for.*)$/,u=/^(\S.*\:|\s*)$/,a=o.test(s)?o:u;if(this.foldingStartMarker.test(s)){for(var f=n+1,l=e.getLength();f<l;f++)if(a.test(r[f]))break;return new i(n,s.length,f,0)}if(this.foldingStopMarker.test(s)){for(var f=n-1;f>=0;f--){s=r[f];if(a.test(s))break}return new i(f,s.length,n,0)}}}.call(o.prototype)})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
define("ace/mode/cobol",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/cobol_highlight_rules","ace/range"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./cobol_highlight_rules").CobolHighlightRules,u=e("../range").Range,a=function(){this.$tokenizer=new s((new o).getRules())};r.inherits(a,i),function(){this.lineCommentStart="*"}.call(a.prototype),t.Mode=a}),define("ace/mode/cobol_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="ACCEPT|MERGE|SUM|ADD||MESSAGE|TABLE|ADVANCING|MODE|TAPE|AFTER|MULTIPLY|TEST|ALL|NEGATIVE|TEXT|ALPHABET|NEXT|THAN|ALSO|NO|THEN|ALTERNATE|NOT|THROUGH|AND|NUMBER|THRU|ANY|OCCURS|TIME|ARE|OF|TO|AREA|OFF|TOP||ASCENDING|OMITTED|TRUE|ASSIGN|ON|TYPE|AT|OPEN|UNIT|AUTHOR|OR|UNTIL|BEFORE|OTHER|UP|BLANK|OUTPUT|USE|BLOCK|PAGE|USING|BOTTOM|PERFORM|VALUE|BY|PIC|VALUES|CALL|PICTURE|WHEN|CANCEL|PLUS|WITH|CD|POINTER|WRITE|CHARACTER|POSITION||ZERO|CLOSE|POSITIVE|ZEROS|COLUMN|PROCEDURE|ZEROES|COMMA|PROGRAM|COMMON|PROGRAM-ID|COMMUNICATION|QUOTE|COMP|RANDOM|COMPUTE|READ|CONTAINS|RECEIVE|CONFIGURATION|RECORD|CONTINUE|REDEFINES|CONTROL|REFERENCE|COPY|REMAINDER|COUNT|REPLACE|DATA|REPORT|DATE|RESERVE|DAY|RESET|DELETE|RETURN|DESTINATION|REWIND|DISABLE|REWRITE|DISPLAY|RIGHT|DIVIDE|RUN|DOWN|SAME|ELSE|SEARCH|ENABLE|SECTION|END|SELECT|ENVIRONMENT|SENTENCE|EQUAL|SET|ERROR|SIGN|EXIT|SEQUENTIAL|EXTERNAL|SIZE|FLASE|SORT|FILE|SOURCE|LENGTH|SPACE|LESS|STANDARD|LIMIT|START|LINE|STOP|LOCK|STRING|LOW-VALUE|SUBTRACT",t="true|false|null",n="count|min|max|avg|sum|rank|now|coalesce|main",r=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"\\*.*$"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]}};r.inherits(s,i),t.CobolHighlightRules=s})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
define("ace/mode/diff",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/diff_highlight_rules","ace/mode/folding/diff"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./diff_highlight_rules").DiffHighlightRules,u=e("./folding/diff").FoldMode,a=function(){this.$tokenizer=new s((new o).getRules()),this.foldingRules=new u(["diff","index","\\+{3}","@@|\\*{5}"],"i")};r.inherits(a,i),function(){}.call(a.prototype),t.Mode=a}),define("ace/mode/diff_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{regex:"^(?:\\*{15}|={67}|-{3}|\\+{3})$",token:"punctuation.definition.separator.diff",name:"keyword"},{regex:"^(@@)(\\s*.+?\\s*)(@@)(.*)$",token:["constant","constant.numeric","constant","comment.doc.tag"]},{regex:"^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$",token:["constant.numeric","punctuation.definition.range.diff","constant.function","constant.numeric","punctuation.definition.range.diff","invalid"],name:"meta."},{regex:"^(\\-{3}|\\+{3}|\\*{3})( .+)$",token:["constant.numeric","meta.tag"]},{regex:"^([!+>])(.*?)(\\s*)$",token:["support.constant","text","invalid"]},{regex:"^([<\\-])(.*?)(\\s*)$",token:["support.function","string","invalid"]},{regex:"^(diff)(\\s+--\\w+)?(.+?)( .+)?$",token:["variable","variable","keyword","variable"]},{regex:"^Index.+$",token:"variable"},{regex:"\\s*$",token:"invalid"},{defaultToken:"invisible",caseInsensitive:!0}]}};r.inherits(s,i),t.DiffHighlightRules=s}),define("ace/mode/folding/diff",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(e,t){this.regExpList=e,this.flag=t,this.foldingStartMarker=RegExp("^("+e.join("|")+")",this.flag)};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i={row:n,column:r.length},o=this.regExpList;for(var u=1;u<=o.length;u++){var a=RegExp("^("+o.slice(0,u).join("|")+")",this.flag);if(a.test(r))break}for(var f=e.getLength();++n<f;){r=e.getLine(n);if(a.test(r))break}if(n==i.row+1)return;return s.fromPoints(i,{row:n-1,column:r.length})}}.call(o.prototype)})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More