/*
	Copyright (c) 2004-2016, The JS Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/

//>>built
define("dojo/string",["./_base/kernel","./_base/lang"],function(l,g){var m=/[&<>'"\/]/g,n={"\x26":"\x26amp;","\x3c":"\x26lt;","\x3e":"\x26gt;",'"':"\x26quot;","'":"\x26#x27;","/":"\x26#x2F;"},f={};g.setObject("dojo.string",f);f.escape=function(a){return a?a.replace(m,function(b){return n[b]}):""};f.codePointAt=String.prototype.codePointAt?function(a,b){return String.prototype.codePointAt.call(a,b)}:function(a,b){if(null==a)throw new TypeError("codePointAt called on null or undefined");a=String(a);
var c=a.length;var d=b?Number(b):0;d!=d&&(d=0);if(!(0>d||d>=c)){var e=a.charCodeAt(d);return 55296<=e&&56319>=e&&c>d+1&&(c=a.charCodeAt(d+1),56320<=c&&57343>=c)?1024*(e-55296)+c-56320+65536:e}};f.fromCodePoint=String.fromCodePoint||function(){var a=[],b=0,c="";var d=0;for(len=arguments.length;d!==len;++d){b=+arguments[d];if(!(1114111>b&&b>>>0===b))throw RangeError("Invalid code point: "+b);65535>=b?b=a.push(b):(b-=65536,b=a.push((b>>10)+55296,b%1024+56320));16383<=b&&(c+=String.fromCharCode.apply(null,
a),a.length=0)}return c+String.fromCharCode.apply(null,a)};f.rep=function(a,b){if(0>=b||!a)return"";for(var c=[];;){b&1&&c.push(a);if(!(b>>=1))break;a+=a}return c.join("")};f.pad=function(a,b,c,d){c||(c="0");a=String(a);b=f.rep(c,Math.ceil((b-a.length)/c.length));return d?a+b:b+a};f.substitute=function(a,b,c,d){d=d||l.global;c=c?g.hitch(d,c):function(e){return e};return a.replace(/\$\{([^\s:\}]*)(?::([^\s:\}]+))?\}/g,function(e,h,k){if(""==h)return"$";e=g.getObject(h,!1,b);k&&(e=g.getObject(k,!1,
d).call(d,e,h));k=c(e,h);if("undefined"===typeof k)throw Error('string.substitute could not find key "'+h+'" in template');return k.toString()})};f.trim=String.prototype.trim?g.trim:function(a){a=a.replace(/^\s+/,"");for(var b=a.length-1;0<=b;b--)if(/\S/.test(a.charAt(b))){a=a.substring(0,b+1);break}return a};return f});