json-min.js revision 481402e2c2b8e4d633d9c023579d0250205ccc8e
YUI.add("json-parse",function(Y){var _JSON=Y.config.win.JSON,Native=(Object.prototype.toString.call(_JSON)==="[object JSON]"&&_JSON),_UNICODE_EXCEPTIONS=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_ESCAPES=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,_VALUES=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS=/(?:^|:|,)(?:\s*\[)+/g,_UNSAFE=/[^\],:{}\s]/,_escapeException=function(c){return"\\u"+("0000"+(+(c.charCodeAt(0))).toString(16)).slice(-4);},_revive=function(data,reviver){var walk=function(o,key){var k,v,value=o[key];if(value&&typeof value==="object"){for(k in value){if(value.hasOwnProperty(k)){v=walk(value,k);if(v===undefined){delete value[k];}else{value[k]=v;}}}}return reviver.call(o,key,value);};return typeof reviver==="function"?walk({"":data},""):data;},_parse=function(s,reviver){if(typeof s==="string"){s=s.replace(_UNICODE_EXCEPTIONS,_escapeException);if(!_UNSAFE.test(s.replace(_ESCAPES,"@").replace(_VALUES,"]").replace(_BRACKETS,""))){return _revive(eval("("+s+")"),reviver);}}throw new SyntaxError("JSON.parse");};Y.namespace("JSON").parse=function(s,reviver){return Native&&Y.JSON.useNativeParse?Native.parse(s,reviver):_parse(s,reviver);};Y.JSON.useNativeParse=!!Native;},"@VERSION@");YUI.add("json-stringify",function(C){var b=C.config.win.JSON,E=C.Lang,A=E.isFunction,L=E.isObject,N=E.isArray,X=Object.prototype.toString,W=(X.call(b)==="[object JSON]"&&b),h="undefined",O="object",e="null",R="string",U="number",Q="boolean",D="date",H={"undefined":h,"string":R,"[object String]":R,"number":U,"[object Number]":U,"boolean":Q,"[object Boolean]":Q,"[object Date]":D},i="",g="{",G="}",F="[",V="]",T=",",K=",\n",B="\n",I=":",f=": ",M='"',Z=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function c(j){var Y=typeof j;return H[Y]||H[X.call(j)]||(Y===O?(j?O:e):h);}function P(Y){if(!a[Y]){a[Y]="\\u"+("0000"+(+(Y.charCodeAt(0))).toString(16)).slice(-4);}return a[Y];}function J(Y){return M+Y.replace(Z,P)+M;}function d(Y,j){return Y.replace(/^/gm,j);}function S(j,s,Y){if(j===undefined){return undefined;}var l=A(s)?s:null,r=X.call(Y).match(/String|Number/)||[],t=C.JSON.dateToString,q=[],n,m,p;if(l||!N(s)){s=undefined;}if(s){n={};for(m=0,p=s.length;m<p;++m){n[s[m]]=true;}s=n;}Y=r[0]==="Number"?new Array(Math.min(Math.max(0,Y),10)+1).join(" "):(Y||i).slice(0,10);function k(y,AD){var u=A(l)?l.call(y,AD,y[AD]):y[AD],AB=[],AA=Y?f:I,z,x,AE,w,AC;switch(c(u)){case O:break;case R:return J(u);case U:return isFinite(u)?u+i:e;case Q:return u+i;case D:return t(u);case e:return e;default:return undefined;}for(x=q.length-1;x>=0;--x){if(q[x]===u){throw new Error("JSON.stringify. Cyclical reference");}}z=N(u);q.push(u);if(z){for(x=u.length-1;x>=0;--x){AB[x]=k(u,x)||e;}}else{AE=s||u;x=0;for(w in AE){if(AE.hasOwnProperty(w)){AC=k(u,w);if(AC){AB[x++]=J(w)+AA+AC;}}}}q.pop();if(Y&&AB.length){return z?F+B+d(AB.join(K),Y)+B+V:g+B+d(AB.join(K),Y)+B+G;}else{return z?F+AB.join(T)+V:g+AB.join(T)+G;}}return k({"":j},"");}C.mix(C.namespace("JSON"),{useNativeStringify:!!W,dateToString:function(j){function Y(k){return k<10?"0"+k:k;}return M+j.getUTCFullYear()+"-"+Y(j.getUTCMonth()+1)+"-"+Y(j.getUTCDate())+"T"+Y(j.getUTCHours())+I+Y(j.getUTCMinutes())+I+Y(j.getUTCSeconds())+"Z"+M;},stringify:function(k,Y,j){return W&&C.JSON.useNativeStringify?W.stringify(k,Y,j):S(k,Y,j);}});},"@VERSION@");YUI.add("json",function(A){},"@VERSION@",{use:["json-parse","json-stringify"]});