!function(e,t){"use strict";varn=t.prototype.trim,r=t.prototype.trimRight,i=t.prototype.trimLeft,s=function(e){returne*1||0},o=function(e,t){if(t<1)return"";varn="";while(t>0)t&1&&(n+=e),t>>=1,e+=e;returnn},u=[].slice,a=function(e){returne==null?"\\s":e.source?e.source:"["+p.escapeRegExp(e)+"]"},f={lt:"<",gt:">",quot:'"',apos:"'",amp:"&"},l={};for(varcinf)l[f[c]]=c;varh=function(){functione(e){returnObject.prototype.toString.call(e).slice(8,-1).toLowerCase()}varn=o,r=function(){returnr.cache.hasOwnProperty(arguments[0])||(r.cache[arguments[0]]=r.parse(arguments[0])),r.format.call(null,r.cache[arguments[0]],arguments)};returnr.format=function(r,i){vars=1,o=r.length,u="",a,f=[],l,c,p,d,v,m;for(l=0;l<o;l++){u=e(r[l]);if(u==="string")f.push(r[l]);elseif(u==="array"){p=r[l];if(p[2]){a=i[s];for(c=0;c<p[2].length;c++){if(!a.hasOwnProperty(p[2][c]))thrownewError(h('[_.sprintf] property "%s" does not exist',p[2][c]));a=a[p[2][c]]}}elsep[1]?a=i[p[1]]:a=i[s++];if(/[^s]/.test(p[8])&&e(a)!="number")thrownewError(h("[_.sprintf] expecting number but found %s",e(a)));switch(p[8]){case"b":a=a.toString(2);break;case"c":a=t.fromCharCode(a);break;case"d":a=parseInt(a,10);break;case"e":a=p[7]?a.toExponential(p[7]):a.toExponential();break;case"f":a=p[7]?parseFloat(a).toFixed(p[7]):parseFloat(a);break;case"o":a=a.toString(8);break;case"s":a=(a=t(a))&&p[7]?a.substring(0,p[7]):a;break;case"u":a=Math.abs(a);break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase()}a=/[def]/.test(p[8])&&p[3]&&a>=0?"+"+a:a,v=p[4]?p[4]=="0"?"0":p[4].charAt(1):" ",m=p[6]-t(a).length,d=p[6]?n(v,m):"",f.push(p[5]?a+d:d+a)}}returnf.join("")},r.cache={},r.parse=function(e){vart=e,n=[],r=[],i=0;while(t){if((n=/^[^\x25]+/.exec(t))!==null)r.push(n[0]);elseif((n=/^\x25{2}/.exec(t))!==null)r.push("%");else{if((n=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(t))===null)thrownewError("[_.sprintf] huh?");if(n[2]){i|=1;vars=[],o=n[2],u=[];if((u=/^([a-z_][a-z_\d]*)/i.exec(o))===null)thrownewError("[_.sprintf] huh?");s.push(u[1]);while((o=o.substring(u[0].length))!=="")if((u=/^\.([a-z_][a-z_\d]*)/i.exec(o))!==null)s.push(u[1]);else{if((u=/^\[(\d+)\]/.exec(o))===null)thrownewError("[_.sprintf] huh?");s.push(u[1])}n[2]=s}elsei|=2;if(i===3)thrownewError("[_.sprintf] mixing positional and named placeholders is not (yet) supported");r.push(n)}t=t.substring(n[0].length)}returnr},r}(),p={VERSION:"2.3.0",isBlank:function(e){returne==null&&(e=""),/^\s*$/.test(e)},stripTags:function(e){returne==null?"":t(e).replace(/<\/?[^>]+>/g,"")},capitalize:function(e){returne=e==null?"":t(e),e.charAt(0).toUpperCase()+e.slice(1)},chop:function(e,n){returne==null?[]:(e=t(e),n=~~n,n>0?e.match(newRegExp(".{1,"+n+"}","g")):[e])},clean:function(e){returnp.strip(e).replace(/\s+/g," ")},count:function(e,n){returne==null||n==null?0:t(e).split(n).length-1},chars:function(e){returne==null?[]:t(e).split("")},swapCase:function(e){returne==null?"":t(e).replace(/\S/g,function(e){returne===e.toUpperCase()?e.toLowerCase():e.toUpperCase()})},escapeHTML:function(e){returne==null?"":t(e).replace(/[&<>"']/g,function(e){return"&"+l[e]+";"})},unescapeHTML:function(e){returne==null?"":t(e).replace(/\&([^;]+);/g,function(e,n){varr;returnninf?f[n]:(r=n.match(/^#x([\da-fA-F]+)$/))?t.fromCharCode(parseInt(r[1],16)):(r=n.match(/^#(\d+)$/))?t.fromCharCode(~~r[1]):e})},escapeRegExp:function(e){returne==null?"":t(e).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")},splice:function(e,t,n,r){vari=p.chars(e);returni.splice(~~t,~~n,r),i.join("")},insert:function(e,t,n){returnp.splice(e,t,0,n)},include:function(e,n){returnn===""?!0:e==null?!1:t(e).indexOf(n)!==-1},join:function(){vare=u.call(arguments),t=e.shift();returnt==null&&(t=""),e.join(t)},lines:function(e){returne==null?[]:t(e).split("\n")},reverse:function(e){returnp.chars(e).reverse().join("")},startsWith:function(e,n){returnn===""?!0:e==null||n==null?!1:(e=t(e),n=t(n),e.length>=n.length&&e.slice(0,n.length)===n)},endsWith:function(e,n){returnn===""?!0:e==null||n==null?!1:(e=t(e),n=t(n),e.length>=n.length&&e.slice(e.length-n.length)===n)},succ:function(e){returne==null?"":(e=t(e),e.slice(0,-1)+t.fromCharCode(e.charCodeAt(e.length-1)+1))},titleize:function(e){returne==null?"":t(e).replace(/(?:^|\s)\S/g,function(e){returne.toUpperCase()})},camelize:function(e){returnp.trim(e).replace(/[-_\s]+(.)?/g,function(e,t){returnt.toUpperCase()})},underscored:function(e){returnp.trim(e).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},dasherize:function(e){returnp.trim(e).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()},classify:function(e){returnp.titleize(t(e).replace(/_/g," ")).replace(/\s/g,"")},humanize:function(e){returnp.capitalize(p.underscored(e).replace(/_id$/,"").replace(/_/g," "))},trim:function(e,r){returne==null?"":!r&&n?n.call(e):(r=a(r),t(e).replace(newRegExp("^"+r+"+|"+r+"+$","g"),""))},ltrim:function(e,n){returne==null?"":!n&&i?i.call(e):(n=a(n),t(e).replace(newRegExp("^"+n+"+"),""))},rtrim:function(e,n){returne==null?"":!n&&r?r.call(e):(n=a(n),t(e).replace(newRegExp(n+"+$"),""))},truncate:function(e,n,r){returne==null?"":(e=t(e),r=r||"...",n=~~n,e.length>n?e.slice(0,n)+r:e)},prune:function(e,n,r){if(e==null)return"";e=t(e),n=~~n,r=r!=null?t(r):"...";if(e.length<=n)returne;vari=function(e){returne.toUpperCase()!==e.toLowerCase()?"A":" "},s=e.slice(0,n+1).replace(/.(?=\W*\w*$)/g,i);returns.slice(s.length-2).match(/\w\w/)?s=s.replace(/\s*\S+$/,""):s=p.rtrim(s.slice(0,s.length-1)),(s+r).length>e.length?e:e.slice(0,s.length)+r},words:function(e,t){returnp.isBlank(e)?[]:p.trim(e,t).split(t||/\s+/)},pad:function(e,n,r,i){e=e==null?"":t(e),n=~~n;vars=0;r?r.length>1&&(r=r.charAt(0)):r=" ";switch(i){case"right":returns=n-e.length,e+o(r,s);case"both":returns=n-e.length,o(r,Math.ceil(s/2))+e+o(r,Math.floor(s/2));default:returns=n-e.length,o(r,s)+e}},lpad:function(e,t,n){returnp.pad(e,t,n)},rpad:function(e,t,n){returnp.pad(e,t,n,"right")},lrpad:function(e,t,n){returnp.pad(e,t,n,"both")},sprintf:h,vsprintf:function(e,t){returnt.unshift(e),h.apply(null,t)},toNumber:function(e,n){if(e==null||e=="")return0;e=t(e);varr=s(s(e).toFixed(~~n));returnr===0&&!e.match(/^0+$/)?Number.NaN:r},numberFormat:function(e,t,n,r){if(isNaN(e)||e==null)return"";e=e.toFixed(~~t),r=r||",";vari=e.split("."),s=i[0],o=i[1]?(n||".")+i[1]:"";returns.replace(/(\d)(?=(?:\d{3})+$)/g,"$1"+r)+o},strRight:function(e,n){if(e==null)return"";e=t(e),n=n!=null?t(n):n;varr=n?e.indexOf(n):-1;return~r?e.slice(r+n.length,e.length):e},strRightBack:function(e,n){if(e==null)return"";e=t(e),n=n!=null?t(n):n;varr=n?e.lastIndexOf(n):-1;return~r?e.slice(r+n.length,e.length):e},strLeft:function(e,n){if(e==null)return"";e=t(e),n=n!=null?t(n):n;varr=n?e.indexOf(n):-1;return~r?e.slice(0,r):e},strLeftBack:function(e,t){if(e==null)return"";e+="",t=t!=null?""+t:t;varn=e.lastIndexOf(t);return~n?e.slice(0,n):e},toSentence:function(e,t,n,r){t=t||", ",n=n||" and ";vari=e.slice(),s=i.pop();returne.length>2&&r&&(n=p.rtrim(t)+n),i.length?i.join(t)+n+s:s},toSentenceSerial:function(){vare=u.call(arguments);returne[3]=!0,p.toSentence.apply(p,e)},slugify:function(e){if(e==null)return"";varn="ąàáäâãåæćęèéëêìíïîłńòóöôõøùúüûñçżź",r="aaaaaaaaceeeeeiiiilnoooooouuuunczz",i=newRegExp(a(n),"g");returne=t(e).toLowerCase().replace(i,function(e){vart=n.indexOf(e);returnr.charAt(t)||"-"}),p.dasherize(e.replace(/[^\w\s-]/g,""))},surround:function(e,t){return[t,e,t].join("")},quote:function(e){returnp.surround(e,'"')},exports:function(){vare={};for(vartinthis){if(!this.hasOwnProperty(t)||t.match(/^(?:include|contains|reverse)$/))continue;e[t]=this[t]}returne},repeat:function(e,n,r){if(e==null)return"";n=~~n;if(r==null)returno(t(e),n);for(vari=[];n>0;i[--n]=e);returni.join(r)},levenshtein:function(e,n){if(e==null&&n==null)return0;if(e==null)returnt(n).length;if(n==null)returnt(e).length;e=t(e),n=t(n);varr=[],i,s;for(varo=0;o<=n.length;o++)for(varu=0;u<=e.length;u++)o&&u?e.charAt(u-1)===n.charAt(o-1)?s=i:s=Math.min(r[u],r[u-1],i)+1:s=o+u,i=r[u],r[u]=s;returnr.pop()}};p.strip=p.trim,p.lstrip=p.ltrim,p.rstrip=p.rtrim,p.center=p.lrpad,p.rjust=p.lpad,p.ljust=p.rpad,p.contains=p.include,p.q=p.quote,typeofexports!="undefined"?(typeofmodule!="undefined"&&module.exports&&(module.exports=p),exports._s=p):typeofdefine=="function"&&define.amd?define("underscore.string",[],function(){returnp}):(e._=e._||{},e._.string=e._.str=p)}(this,String);