code_text
stringlengths
604
999k
repo_name
stringlengths
4
100
file_path
stringlengths
4
873
language
stringclasses
23 values
license
stringclasses
15 values
size
int32
1.02k
999k
"use strict";angular.module("ngLocale",[],["$provide",function(a){var b={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};a.value("$locale",{DATETIME_FORMATS:{AMPMS:["\u0bae\u0bc1\u0bb1\u0bcd\u0baa\u0b95\u0bb2\u0bcd","\u0baa\u0bbf\u0bb1\u0bcd\u0baa\u0b95\u0bb2\u0bcd"],DAY:["\u0b9e\u0bbe\u0baf\u0bbf\u0bb1\u0bc1","\u0ba4\u0bbf\u0b99\u0bcd\u0b95\u0bb3\u0bcd","\u0b9a\u0bc6\u0bb5\u0bcd\u0bb5\u0bbe\u0baf\u0bcd","\u0baa\u0bc1\u0ba4\u0ba9\u0bcd","\u0bb5\u0bbf\u0baf\u0bbe\u0bb4\u0ba9\u0bcd","\u0bb5\u0bc6\u0bb3\u0bcd\u0bb3\u0bbf","\u0b9a\u0ba9\u0bbf"],ERANAMES:["\u0b95\u0bbf\u0bb1\u0bbf\u0bb8\u0bcd\u0ba4\u0bc1\u0bb5\u0bc1\u0b95\u0bcd\u0b95\u0bc1 \u0bae\u0bc1\u0ba9\u0bcd","\u0b85\u0ba9\u0bcb \u0b9f\u0bcb\u0bae\u0bbf\u0ba9\u0bbf"],ERAS:["\u0b95\u0bbf.\u0bae\u0bc1.","\u0b95\u0bbf.\u0baa\u0bbf."],MONTH:["\u0b9c\u0ba9\u0bb5\u0bb0\u0bbf","\u0baa\u0bbf\u0baa\u0bcd\u0bb0\u0bb5\u0bb0\u0bbf","\u0bae\u0bbe\u0bb0\u0bcd\u0b9a\u0bcd","\u0b8f\u0baa\u0bcd\u0bb0\u0bb2\u0bcd","\u0bae\u0bc7","\u0b9c\u0bc2\u0ba9\u0bcd","\u0b9c\u0bc2\u0bb2\u0bc8","\u0b86\u0b95\u0bb8\u0bcd\u0b9f\u0bcd","\u0b9a\u0bc6\u0baa\u0bcd\u0b9f\u0bae\u0bcd\u0baa\u0bb0\u0bcd","\u0b85\u0b95\u0bcd\u0b9f\u0bcb\u0baa\u0bb0\u0bcd","\u0ba8\u0bb5\u0bae\u0bcd\u0baa\u0bb0\u0bcd","\u0b9f\u0bbf\u0b9a\u0bae\u0bcd\u0baa\u0bb0\u0bcd"],SHORTDAY:["\u0b9e\u0bbe","\u0ba4\u0bbf","\u0b9a\u0bc6","\u0baa\u0bc1","\u0bb5\u0bbf","\u0bb5\u0bc6","\u0b9a"],SHORTMONTH:["\u0b9c\u0ba9.","\u0baa\u0bbf\u0baa\u0bcd.","\u0bae\u0bbe\u0bb0\u0bcd.","\u0b8f\u0baa\u0bcd.","\u0bae\u0bc7","\u0b9c\u0bc2\u0ba9\u0bcd","\u0b9c\u0bc2\u0bb2\u0bc8","\u0b86\u0b95.","\u0b9a\u0bc6\u0baa\u0bcd.","\u0b85\u0b95\u0bcd.","\u0ba8\u0bb5.","\u0b9f\u0bbf\u0b9a."],fullDate:"EEEE, d MMMM, y",longDate:"d MMMM, y",medium:"d MMM, y h:mm:ss a",mediumDate:"d MMM, y",mediumTime:"h:mm:ss a","short":"d-M-yy h:mm a",shortDate:"d-M-yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"Rs",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:2,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:2,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"\u00a4\u00a0-",negSuf:"",posPre:"\u00a4\u00a0",posSuf:""}]},id:"ta-lk",pluralCat:function(d,c){if(d==1){return b.ONE}return b.OTHER}})}]);
2947721120/cdnjs
ajax/libs/angular-i18n/1.3.15/angular-locale_ta-lk.min.js
JavaScript
mit
2,232
"use strict";angular.module("ngLocale",[],["$provide",function(a){var d={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};function c(f){f=f+"";var e=f.indexOf(".");return(e==-1)?0:f.length-e-1}function b(j,e){var g=e;if(undefined===g){g=Math.min(c(j),3)}var i=Math.pow(10,g);var h=((j*i)|0)%i;return{v:g,f:h}}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["kang\u2019ama","kingoto"],DAY:["Ijumapili","Ijumatatu","Ijumanne","Ijumatano","Alhamisi","Ijumaa","Ijumamosi"],ERANAMES:["Kabla ya Mayesu","Baada ya Mayesu"],ERAS:["KM","BM"],MONTH:["Mweri wa kwanza","Mweri wa kaili","Mweri wa katatu","Mweri wa kaana","Mweri wa tanu","Mweri wa sita","Mweri wa saba","Mweri wa nane","Mweri wa tisa","Mweri wa ikumi","Mweri wa ikumi na moja","Mweri wa ikumi na mbili"],SHORTDAY:["Ijp","Ijt","Ijn","Ijtn","Alh","Iju","Ijm"],SHORTMONTH:["M1","M2","M3","M4","M5","M6","M7","M8","M9","M10","M11","M12"],fullDate:"EEEE, d MMMM y",longDate:"d MMMM y",medium:"d MMM y h:mm:ss a",mediumDate:"d MMM y",mediumTime:"h:mm:ss a","short":"dd/MM/y h:mm a",shortDate:"dd/MM/y",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"TSh",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"\u00a4-",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"rof",pluralCat:function(h,f){var g=h|0;var e=b(h,f);if(g==1&&e.v==0){return d.ONE}return d.OTHER}})}]);
CyrusSUEN/cdnjs
ajax/libs/angular-i18n/1.3.16/angular-locale_rof.min.js
JavaScript
mit
1,461
"use strict";angular.module("ngLocale",[],["$provide",function(a){var b={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};a.value("$locale",{DATETIME_FORMATS:{AMPMS:["\u03c0.\u03bc.","\u03bc.\u03bc."],DAY:["\u039a\u03c5\u03c1\u03b9\u03b1\u03ba\u03ae","\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1","\u03a4\u03c1\u03af\u03c4\u03b7","\u03a4\u03b5\u03c4\u03ac\u03c1\u03c4\u03b7","\u03a0\u03ad\u03bc\u03c0\u03c4\u03b7","\u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae","\u03a3\u03ac\u03b2\u03b2\u03b1\u03c4\u03bf"],ERANAMES:["\u03c0\u03c1\u03bf \u03a7\u03c1\u03b9\u03c3\u03c4\u03bf\u03cd","\u03bc\u03b5\u03c4\u03ac \u03a7\u03c1\u03b9\u03c3\u03c4\u03cc\u03bd"],ERAS:["\u03c0.\u03a7.","\u03bc.\u03a7."],MONTH:["\u0399\u03b1\u03bd\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5","\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5","\u039c\u03b1\u03c1\u03c4\u03af\u03bf\u03c5","\u0391\u03c0\u03c1\u03b9\u03bb\u03af\u03bf\u03c5","\u039c\u03b1\u0390\u03bf\u03c5","\u0399\u03bf\u03c5\u03bd\u03af\u03bf\u03c5","\u0399\u03bf\u03c5\u03bb\u03af\u03bf\u03c5","\u0391\u03c5\u03b3\u03bf\u03cd\u03c3\u03c4\u03bf\u03c5","\u03a3\u03b5\u03c0\u03c4\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5","\u039f\u03ba\u03c4\u03c9\u03b2\u03c1\u03af\u03bf\u03c5","\u039d\u03bf\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5","\u0394\u03b5\u03ba\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5"],SHORTDAY:["\u039a\u03c5\u03c1","\u0394\u03b5\u03c5","\u03a4\u03c1\u03af","\u03a4\u03b5\u03c4","\u03a0\u03ad\u03bc","\u03a0\u03b1\u03c1","\u03a3\u03ac\u03b2"],SHORTMONTH:["\u0399\u03b1\u03bd","\u03a6\u03b5\u03b2","\u039c\u03b1\u03c1","\u0391\u03c0\u03c1","\u039c\u03b1\u0390","\u0399\u03bf\u03c5\u03bd","\u0399\u03bf\u03c5\u03bb","\u0391\u03c5\u03b3","\u03a3\u03b5\u03c0","\u039f\u03ba\u03c4","\u039d\u03bf\u03b5","\u0394\u03b5\u03ba"],fullDate:"EEEE, d MMMM y",longDate:"d MMMM y",medium:"d MMM y h:mm:ss a",mediumDate:"d MMM y",mediumTime:"h:mm:ss a","short":"d/M/yy h:mm a",shortDate:"d/M/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"\u20ac",DECIMAL_SEP:",",GROUP_SEP:".",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-",negSuf:"\u00a0\u00a4",posPre:"",posSuf:"\u00a0\u00a4"}]},id:"el",pluralCat:function(d,c){if(d==1){return b.ONE}return b.OTHER}})}]);
freak3dot/cdnjs
ajax/libs/angular-i18n/1.3.16/angular-locale_el.min.js
JavaScript
mit
2,356
"use strict";angular.module("ngLocale",[],["$provide",function(a){var b={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:["\u06cc\u06a9\u0634\u0646\u0628\u0647","\u062f\u0648\u0634\u0646\u0628\u0647","\u0633\u0647\u200c\u0634\u0646\u0628\u0647","\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647","\u067e\u0646\u062c\u0634\u0646\u0628\u0647","\u062c\u0645\u0639\u0647","\u0634\u0646\u0628\u0647"],ERANAMES:["\u0642.\u0645.","\u0645."],ERAS:["\u0642.\u0645.","\u0645."],MONTH:["\u062c\u0646\u0648\u0631\u06cc","\u0641\u0628\u0631\u0648\u0631\u06cc","\u0645\u0627\u0631\u0686","\u0627\u067e\u0631\u06cc\u0644","\u0645\u06cc","\u062c\u0648\u0646","\u062c\u0648\u0644\u0627\u06cc","\u0627\u06af\u0633\u062a","\u0633\u067e\u062a\u0645\u0628\u0631","\u0627\u06a9\u062a\u0648\u0628\u0631","\u0646\u0648\u0645\u0628\u0631","\u062f\u0633\u0645\u0628\u0631"],SHORTDAY:["\u06cc.","\u062f.","\u0633.","\u0686.","\u067e.","\u062c.","\u0634."],SHORTMONTH:["\u062c\u0646\u0648","\u0641\u0628\u0631","\u0645\u0627\u0631","\u0627\u067e\u0631","\u0645\u0640\u06cc","\u062c\u0648\u0646","\u062c\u0648\u0644","\u0627\u06af\u0633","\u0633\u067e\u062a","\u0627\u06a9\u062a","\u0646\u0648\u0645","\u062f\u0633\u0645"],fullDate:"y \u0646\u0686\u06cc \u06cc\u06cc\u0644 d \u0646\u0686\u06cc MMMM EEEE \u06a9\u0648\u0646\u06cc",longDate:"d \u0646\u0686\u06cc MMMM y",medium:"d MMM y H:mm:ss",mediumDate:"d MMM y",mediumTime:"H:mm:ss","short":"y/M/d H:mm",shortDate:"y/M/d",shortTime:"H:mm"},NUMBER_FORMATS:{CURRENCY_SYM:"Af.",DECIMAL_SEP:"\u066b",GROUP_SEP:"\u066c",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-",negSuf:"\u00a0\u00a4",posPre:"",posSuf:"\u00a0\u00a4"}]},id:"uz-arab",pluralCat:function(d,c){if(d==1){return b.ONE}return b.OTHER}})}]);
extend1994/cdnjs
ajax/libs/angular-i18n/1.3.20/angular-locale_uz-arab.min.js
JavaScript
mit
1,913
// numeral.js // version : 1.4.6 // author : Adam Draper // license : MIT // http://adamwdraper.github.com/Numeral-js/ (function(){function o(e){this._n=e}function u(e,t,n){var r=Math.pow(10,t),i;i=(Math.round(e*r)/r).toFixed(t);if(n){var s=new RegExp("0{1,"+n+"}$");i=i.replace(s,"")}return i}function a(e,t){var n;t.indexOf("$")>-1?n=l(e,t):t.indexOf("%")>-1?n=c(e,t):t.indexOf(":")>-1?n=h(e,t):n=d(e,t);return n}function f(e,t){if(t.indexOf(":")>-1)e._n=p(t);else if(t===i)e._n=0;else{var s=t;n[r].delimiters.decimal!=="."&&(t=t.replace(/\./g,"").replace(n[r].delimiters.decimal,"."));var o=new RegExp(n[r].abbreviations.thousand+"(?:\\)|(\\"+n[r].currency.symbol+")?(?:\\))?)?$"),u=new RegExp(n[r].abbreviations.million+"(?:\\)|(\\"+n[r].currency.symbol+")?(?:\\))?)?$"),a=new RegExp(n[r].abbreviations.billion+"(?:\\)|(\\"+n[r].currency.symbol+")?(?:\\))?)?$"),f=new RegExp(n[r].abbreviations.trillion+"(?:\\)|(\\"+n[r].currency.symbol+")?(?:\\))?)?$"),l=["KB","MB","GB","TB","PB","EB","ZB","YB"],c=!1;for(var h=0;h<=l.length;h++){c=t.indexOf(l[h])>-1?Math.pow(1024,h+1):!1;if(c)break}e._n=(c?c:1)*(s.match(o)?Math.pow(10,3):1)*(s.match(u)?Math.pow(10,6):1)*(s.match(a)?Math.pow(10,9):1)*(s.match(f)?Math.pow(10,12):1)*(t.indexOf("%")>-1?.01:1)*Number((t.indexOf("(")>-1?"-":"")+t.replace(/[^0-9\.-]+/g,""));e._n=c?Math.ceil(e._n):e._n}return e._n}function l(e,t){var i=t.indexOf("$")<=1?!0:!1,s="";if(t.indexOf(" $")>-1){s=" ";t=t.replace(" $","")}else if(t.indexOf("$ ")>-1){s=" ";t=t.replace("$ ","")}else t=t.replace("$","");var o=a(e,t);if(i)if(o.indexOf("(")>-1||o.indexOf("-")>-1){o=o.split("");o.splice(1,0,n[r].currency.symbol+s);o=o.join("")}else o=n[r].currency.symbol+s+o;else if(o.indexOf(")")>-1){o=o.split("");o.splice(-1,0,s+n[r].currency.symbol);o=o.join("")}else o=o+s+n[r].currency.symbol;return o}function c(e,t){var n="";if(t.indexOf(" %")>-1){n=" ";t=t.replace(" %","")}else t=t.replace("%","");e._n=e._n*100;var r=a(e,t);if(r.indexOf(")")>-1){r=r.split("");r.splice(-1,0,n+"%");r=r.join("")}else r=r+n+"%";return r}function h(e,t){var n=Math.floor(e._n/60/60),r=Math.floor((e._n-n*60*60)/60),i=Math.round(e._n-n*60*60-r*60);return n+":"+(r<10?"0"+r:r)+":"+(i<10?"0"+i:i)}function p(e){var t=e.split(":"),n=0;if(t.length===3){n+=Number(t[0])*60*60;n+=Number(t[1])*60;n+=Number(t[2])}else if(t.lenght===2){n+=Number(t[0])*60;n+=Number(t[1])}return Number(n)}function d(e,t){var s=!1,o=!1,a="",f="",l="",c=Math.abs(e._n);if(e._n===0&&i!==null)return i;if(t.indexOf("(")>-1){s=!0;t=t.slice(1,-1)}if(t.indexOf("a")>-1){if(t.indexOf(" a")>-1){a=" ";t=t.replace(" a","")}else t=t.replace("a","");if(c>=Math.pow(10,12)){a+=n[r].abbreviations.tillion;e._n=e._n/Math.pow(10,12)}else if(c<Math.pow(10,12)&&c>=Math.pow(10,9)){a+=n[r].abbreviations.billion;e._n=e._n/Math.pow(10,9)}else if(c<Math.pow(10,9)&&c>=Math.pow(10,6)){a+=n[r].abbreviations.million;e._n=e._n/Math.pow(10,6)}else if(c<Math.pow(10,6)&&c>=Math.pow(10,3)){a+=n[r].abbreviations.thousand;e._n=e._n/Math.pow(10,3)}}if(t.indexOf("b")>-1){if(t.indexOf(" b")>-1){f=" ";t=t.replace(" b","")}else t=t.replace("b","");var h=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],p,d;for(var v=0;v<=h.length;v++){p=Math.pow(1024,v);d=Math.pow(1024,v+1);if(e._n>=p&&e._n<d){f+=h[v];p>0&&(e._n=e._n/p);break}}}if(t.indexOf("o")>-1){if(t.indexOf(" o")>-1){l=" ";t=t.replace(" o","")}else t=t.replace("o","");l+=n[r].ordinal(e._n)}if(t.indexOf("[.]")>-1){o=!0;t=t.replace("[.]",".")}var m=e._n.toString().split(".")[0],g=t.split(".")[1],y=t.indexOf(","),b="",w=!1;if(g){if(g.indexOf("[")>-1){g=g.replace("]","");g=g.split("[");b=u(e._n,g[0].length+g[1].length,g[1].length)}else b=u(e._n,g.length);m=b.split(".")[0];b.split(".")[1].length?b=n[r].delimiters.decimal+b.split(".")[1]:b="";o&&Number(b)===0&&(b="")}else m=u(e._n,null);if(m.indexOf("-")>-1){m=m.slice(1);w=!0}y>-1&&(m=m.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+n[r].delimiters.thousands));t.indexOf(".")===0&&(m="");return(s&&w?"(":"")+(!s&&w?"-":"")+m+b+(l?l:"")+(a?a:"")+(f?f:"")+(s&&w?")":"")}function v(e,t){n[e]=t}var e,t="1.4.6",n={},r="en",i=null,s=typeof module!="undefined"&&module.exports;e=function(t){e.isNumeral(t)?t=t.value():Number(t)||(t=0);return new o(Number(t))};e.version=t;e.isNumeral=function(e){return e instanceof o};e.language=function(t,i){if(!t)return r;t&&!i&&(r=t);(i||!n[t])&&v(t,i);return e};e.language("en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return~~(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th"},currency:{symbol:"$"}});e.zeroFormat=function(e){typeof e=="string"?i=e:i=null};e.fn=o.prototype={clone:function(){return e(this)},format:function(t){return a(this,t?t:e.defaultFormat)},unformat:function(t){return f(this,t?t:e.defaultFormat)},value:function(){return this._n},valueOf:function(){return this._n},set:function(e){this._n=Number(e);return this},add:function(e){this._n=this._n+Number(e);return this},subtract:function(e){this._n=this._n-Number(e);return this},multiply:function(e){this._n=this._n*Number(e);return this},divide:function(e){this._n=this._n/Number(e);return this},difference:function(e){var t=this._n-Number(e);t<0&&(t=-t);return t}};s&&(module.exports=e);typeof ender=="undefined"&&(this.numeral=e);typeof define=="function"&&define.amd&&define([],function(){return e})}).call(this);
daudmabena/cdnjs
ajax/libs/numeral.js/1.4.6/numeral.min.js
JavaScript
mit
5,388
"use strict";angular.module("ngLocale",[],["$provide",function(a){var d={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};function c(f){f=f+"";var e=f.indexOf(".");return(e==-1)?0:f.length-e-1}function b(j,e){var g=e;if(undefined===g){g=Math.min(c(j),3)}var i=Math.pow(10,g);var h=((j*i)|0)%i;return{v:g,f:h}}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["A.M.","P.M."],DAY:["Mb\u1ecds\u1ecb \u1ee4ka","M\u1ecdnde","Tiuzdee","Wenezdee","T\u1ecd\u1ecdzdee","Fra\u1ecbdee","Sat\u1ecddee"],ERANAMES:["Tupu Kristi","Af\u1ecd Kristi"],ERAS:["T.K.","A.K."],MONTH:["Jen\u1ee5war\u1ecb","Febr\u1ee5war\u1ecb","Maach\u1ecb","Eprel","Mee","Juun","Jula\u1ecb","\u1eccg\u1ecd\u1ecdst","Septemba","\u1eccktoba","Novemba","Disemba"],SHORTDAY:["\u1ee4ka","M\u1ecdn","Tiu","Wen","T\u1ecd\u1ecd","Fra\u1ecb","Sat"],SHORTMONTH:["Jen","Feb","Maa","Epr","Mee","Juu","Jul","\u1eccg\u1ecd","Sep","\u1ecckt","Nov","Dis"],fullDate:"EEEE, d MMMM y",longDate:"d MMMM y",medium:"d MMM y h:mm:ss a",mediumDate:"d MMM y",mediumTime:"h:mm:ss a","short":"dd/MM/y h:mm a",shortDate:"dd/MM/y",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"\u20a6",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"\u00a4-",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"ig-ng",pluralCat:function(h,f){var g=h|0;var e=b(h,f);if(g==1&&e.v==0){return d.ONE}return d.OTHER}})}]);
amoyeh/cdnjs
ajax/libs/angular-i18n/1.3.17/angular-locale_ig-ng.min.js
JavaScript
mit
1,477
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Debug\Tests\FatalErrorHandler; use Symfony\Component\ClassLoader\ClassLoader as SymfonyClassLoader; use Symfony\Component\ClassLoader\UniversalClassLoader as SymfonyUniversalClassLoader; use Symfony\Component\Debug\Exception\FatalErrorException; use Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler; use Symfony\Component\Debug\DebugClassLoader; use Composer\Autoload\ClassLoader as ComposerClassLoader; class ClassNotFoundFatalErrorHandlerTest extends \PHPUnit_Framework_TestCase { public static function setUpBeforeClass() { foreach (spl_autoload_functions() as $function) { if (!is_array($function)) { continue; } // get class loaders wrapped by DebugClassLoader if ($function[0] instanceof DebugClassLoader) { $function = $function[0]->getClassLoader(); } if ($function[0] instanceof ComposerClassLoader) { $function[0]->add('Symfony_Component_Debug_Tests_Fixtures', dirname(dirname(dirname(dirname(dirname(__DIR__)))))); break; } } } /** * @dataProvider provideClassNotFoundData */ public function testHandleClassNotFound($error, $translatedMessage, $autoloader = null) { if ($autoloader) { // Unregister all autoloaders to ensure the custom provided // autoloader is the only one to be used during the test run. $autoloaders = spl_autoload_functions(); array_map('spl_autoload_unregister', $autoloaders); spl_autoload_register($autoloader); } $handler = new ClassNotFoundFatalErrorHandler(); $exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line'])); if ($autoloader) { spl_autoload_unregister($autoloader); array_map('spl_autoload_register', $autoloaders); } $this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $exception); $this->assertSame($translatedMessage, $exception->getMessage()); $this->assertSame($error['type'], $exception->getSeverity()); $this->assertSame($error['file'], $exception->getFile()); $this->assertSame($error['line'], $exception->getLine()); } /** * @group legacy */ public function testLegacyHandleClassNotFound() { $prefixes = array('Symfony\Component\Debug\Exception\\' => realpath(__DIR__.'/../../Exception')); $symfonyUniversalClassLoader = new SymfonyUniversalClassLoader(); $symfonyUniversalClassLoader->registerPrefixes($prefixes); $this->testHandleClassNotFound( array( 'type' => 1, 'line' => 12, 'file' => 'foo.php', 'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found', ), "Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\Debug\Exception\UndefinedFunctionException\"?", array($symfonyUniversalClassLoader, 'loadClass') ); } public function provideClassNotFoundData() { $prefixes = array('Symfony\Component\Debug\Exception\\' => realpath(__DIR__.'/../../Exception')); $symfonyAutoloader = new SymfonyClassLoader(); $symfonyAutoloader->addPrefixes($prefixes); $debugClassLoader = new DebugClassLoader(array($symfonyAutoloader, 'loadClass')); return array( array( array( 'type' => 1, 'line' => 12, 'file' => 'foo.php', 'message' => 'Class \'WhizBangFactory\' not found', ), "Attempted to load class \"WhizBangFactory\" from the global namespace.\nDid you forget a \"use\" statement?", ), array( array( 'type' => 1, 'line' => 12, 'file' => 'foo.php', 'message' => 'Class \'Foo\\Bar\\WhizBangFactory\' not found', ), "Attempted to load class \"WhizBangFactory\" from namespace \"Foo\\Bar\".\nDid you forget a \"use\" statement for another namespace?", ), array( array( 'type' => 1, 'line' => 12, 'file' => 'foo.php', 'message' => 'Class \'UndefinedFunctionException\' not found', ), "Attempted to load class \"UndefinedFunctionException\" from the global namespace.\nDid you forget a \"use\" statement for \"Symfony\Component\Debug\Exception\UndefinedFunctionException\"?", ), array( array( 'type' => 1, 'line' => 12, 'file' => 'foo.php', 'message' => 'Class \'PEARClass\' not found', ), "Attempted to load class \"PEARClass\" from the global namespace.\nDid you forget a \"use\" statement for \"Symfony_Component_Debug_Tests_Fixtures_PEARClass\"?", ), array( array( 'type' => 1, 'line' => 12, 'file' => 'foo.php', 'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found', ), "Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\Debug\Exception\UndefinedFunctionException\"?", ), array( array( 'type' => 1, 'line' => 12, 'file' => 'foo.php', 'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found', ), "Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\Debug\Exception\UndefinedFunctionException\"?", array($symfonyAutoloader, 'loadClass'), ), array( array( 'type' => 1, 'line' => 12, 'file' => 'foo.php', 'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found', ), "Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\Debug\Exception\UndefinedFunctionException\"?", array($debugClassLoader, 'loadClass'), ), array( array( 'type' => 1, 'line' => 12, 'file' => 'foo.php', 'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found', ), "Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\\Bar\".\nDid you forget a \"use\" statement for another namespace?", function ($className) { /* do nothing here */ }, ), ); } public function testCannotRedeclareClass() { if (!file_exists(__DIR__.'/../FIXTURES2/REQUIREDTWICE.PHP')) { $this->markTestSkipped('Can only be run on case insensitive filesystems'); } require_once __DIR__.'/../FIXTURES2/REQUIREDTWICE.PHP'; $error = array( 'type' => 1, 'line' => 12, 'file' => 'foo.php', 'message' => 'Class \'Foo\\Bar\\RequiredTwice\' not found', ); $handler = new ClassNotFoundFatalErrorHandler(); $exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line'])); $this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $exception); } }
tyua07/laravel-admin
vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php
PHP
mit
8,485
<?php /* * This file is part of SwiftMailer. * (c) 2004-2009 Chris Corbyn * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Analyzes characters for a specific character set. * * @package Swift * @subpackage Encoder * @author Chris Corbyn * @author Xavier De Cock <xdecock@gmail.com> */ interface Swift_CharacterReader { const MAP_TYPE_INVALID = 0x01; const MAP_TYPE_FIXED_LEN = 0x02; const MAP_TYPE_POSITIONS = 0x03; /** * Returns the complete character map * * @param string $string * @param integer $startOffset * @param array $currentMap * @param mixed $ignoredChars * * @return integer */ public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars); /** * Returns the mapType, see constants. * * @return integer */ public function getMapType(); /** * Returns an integer which specifies how many more bytes to read. * * A positive integer indicates the number of more bytes to fetch before invoking * this method again. * * A value of zero means this is already a valid character. * A value of -1 means this cannot possibly be a valid character. * * @param integer[] $bytes * @param integer $size * * @return integer */ public function validateByteSequence($bytes, $size); /** * Returns the number of bytes which should be read to start each character. * * For fixed width character sets this should be the number of octets-per-character. * For multibyte character sets this will probably be 1. * * @return integer */ public function getInitialByteSize(); }
c0710204/Symfony-hostM
vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader.php
PHP
mit
1,819
<?php /** * CodeIgniter * * An open source application development framework for PHP * * This content is released under the MIT License (MIT) * * Copyright (c) 2014 - 2016, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com * @since Version 1.3.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); /** * MS SQL Database Adapter Class * * Note: _DB is an extender class that the app controller * creates dynamically based on whether the query builder * class is being used or not. * * @package CodeIgniter * @subpackage Drivers * @category Database * @author EllisLab Dev Team * @link https://codeigniter.com/user_guide/database/ */ class CI_DB_mssql_driver extends CI_DB { /** * Database driver * * @var string */ public $dbdriver = 'mssql'; // -------------------------------------------------------------------- /** * ORDER BY random keyword * * @var array */ protected $_random_keyword = array('NEWID()', 'RAND(%d)'); /** * Quoted identifier flag * * Whether to use SQL-92 standard quoted identifier * (double quotes) or brackets for identifier escaping. * * @var bool */ protected $_quoted_identifier = TRUE; // -------------------------------------------------------------------- /** * Class constructor * * Appends the port number to the hostname, if needed. * * @param array $params * @return void */ public function __construct($params) { parent::__construct($params); if ( ! empty($this->port)) { $this->hostname .= (DIRECTORY_SEPARATOR === '\\' ? ',' : ':').$this->port; } } // -------------------------------------------------------------------- /** * Non-persistent database connection * * @param bool $persistent * @return resource */ public function db_connect($persistent = FALSE) { $this->conn_id = ($persistent) ? mssql_pconnect($this->hostname, $this->username, $this->password) : mssql_connect($this->hostname, $this->username, $this->password); if ( ! $this->conn_id) { return FALSE; } // ---------------------------------------------------------------- // Select the DB... assuming a database name is specified in the config file if ($this->database !== '' && ! $this->db_select()) { log_message('error', 'Unable to select database: '.$this->database); return ($this->db_debug === TRUE) ? $this->display_error('db_unable_to_select', $this->database) : FALSE; } // Determine how identifiers are escaped $query = $this->query('SELECT CASE WHEN (@@OPTIONS | 256) = @@OPTIONS THEN 1 ELSE 0 END AS qi'); $query = $query->row_array(); $this->_quoted_identifier = empty($query) ? FALSE : (bool) $query['qi']; $this->_escape_char = ($this->_quoted_identifier) ? '"' : array('[', ']'); return $this->conn_id; } // -------------------------------------------------------------------- /** * Select the database * * @param string $database * @return bool */ public function db_select($database = '') { if ($database === '') { $database = $this->database; } // Note: Escaping is required in the event that the DB name // contains reserved characters. if (mssql_select_db('['.$database.']', $this->conn_id)) { $this->database = $database; return TRUE; } return FALSE; } // -------------------------------------------------------------------- /** * Execute the query * * @param string $sql an SQL query * @return mixed resource if rows are returned, bool otherwise */ protected function _execute($sql) { return mssql_query($sql, $this->conn_id); } // -------------------------------------------------------------------- /** * Begin Transaction * * @return bool */ protected function _trans_begin() { return $this->simple_query('BEGIN TRAN'); } // -------------------------------------------------------------------- /** * Commit Transaction * * @return bool */ protected function _trans_commit() { return $this->simple_query('COMMIT TRAN'); } // -------------------------------------------------------------------- /** * Rollback Transaction * * @return bool */ protected function _trans_rollback() { return $this->simple_query('ROLLBACK TRAN'); } // -------------------------------------------------------------------- /** * Affected Rows * * @return int */ public function affected_rows() { return mssql_rows_affected($this->conn_id); } // -------------------------------------------------------------------- /** * Insert ID * * Returns the last id created in the Identity column. * * @return string */ public function insert_id() { $query = version_compare($this->version(), '8', '>=') ? 'SELECT SCOPE_IDENTITY() AS last_id' : 'SELECT @@IDENTITY AS last_id'; $query = $this->query($query); $query = $query->row(); return $query->last_id; } // -------------------------------------------------------------------- /** * Set client character set * * @param string $charset * @return bool */ protected function _db_set_charset($charset) { return (ini_set('mssql.charset', $charset) !== FALSE); } // -------------------------------------------------------------------- /** * Version number query string * * @return string */ protected function _version() { return "SELECT SERVERPROPERTY('ProductVersion') AS ver"; } // -------------------------------------------------------------------- /** * List table query * * Generates a platform-specific query string so that the table names can be fetched * * @param bool $prefix_limit * @return string */ protected function _list_tables($prefix_limit = FALSE) { $sql = 'SELECT '.$this->escape_identifiers('name') .' FROM '.$this->escape_identifiers('sysobjects') .' WHERE '.$this->escape_identifiers('type')." = 'U'"; if ($prefix_limit !== FALSE && $this->dbprefix !== '') { $sql .= ' AND '.$this->escape_identifiers('name')." LIKE '".$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } return $sql.' ORDER BY '.$this->escape_identifiers('name'); } // -------------------------------------------------------------------- /** * List column query * * Generates a platform-specific query string so that the column names can be fetched * * @param string $table * @return string */ protected function _list_columns($table = '') { return 'SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns WHERE UPPER(TABLE_NAME) = '.$this->escape(strtoupper($table)); } // -------------------------------------------------------------------- /** * Returns an object with field data * * @param string $table * @return array */ public function field_data($table) { $sql = 'SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION, COLUMN_DEFAULT FROM INFORMATION_SCHEMA.Columns WHERE UPPER(TABLE_NAME) = '.$this->escape(strtoupper($table)); if (($query = $this->query($sql)) === FALSE) { return FALSE; } $query = $query->result_object(); $retval = array(); for ($i = 0, $c = count($query); $i < $c; $i++) { $retval[$i] = new stdClass(); $retval[$i]->name = $query[$i]->COLUMN_NAME; $retval[$i]->type = $query[$i]->DATA_TYPE; $retval[$i]->max_length = ($query[$i]->CHARACTER_MAXIMUM_LENGTH > 0) ? $query[$i]->CHARACTER_MAXIMUM_LENGTH : $query[$i]->NUMERIC_PRECISION; $retval[$i]->default = $query[$i]->COLUMN_DEFAULT; } return $retval; } // -------------------------------------------------------------------- /** * Error * * Returns an array containing code and message of the last * database error that has occured. * * @return array */ public function error() { // We need this because the error info is discarded by the // server the first time you request it, and query() already // calls error() once for logging purposes when a query fails. static $error = array('code' => 0, 'message' => NULL); $message = mssql_get_last_message(); if ( ! empty($message)) { $error['code'] = $this->query('SELECT @@ERROR AS code')->row()->code; $error['message'] = $message; } return $error; } // -------------------------------------------------------------------- /** * Update statement * * Generates a platform-specific update string from the supplied data * * @param string $table * @param array $values * @return string */ protected function _update($table, $values) { $this->qb_limit = FALSE; $this->qb_orderby = array(); return parent::_update($table, $values); } // -------------------------------------------------------------------- /** * Truncate statement * * Generates a platform-specific truncate string from the supplied data * * If the database does not support the TRUNCATE statement, * then this method maps to 'DELETE FROM table' * * @param string $table * @return string */ protected function _truncate($table) { return 'TRUNCATE TABLE '.$table; } // -------------------------------------------------------------------- /** * Delete statement * * Generates a platform-specific delete string from the supplied data * * @param string $table * @return string */ protected function _delete($table) { if ($this->qb_limit) { return 'WITH ci_delete AS (SELECT TOP '.$this->qb_limit.' * FROM '.$table.$this->_compile_wh('qb_where').') DELETE FROM ci_delete'; } return parent::_delete($table); } // -------------------------------------------------------------------- /** * LIMIT * * Generates a platform-specific LIMIT clause * * @param string $sql SQL Query * @return string */ protected function _limit($sql) { $limit = $this->qb_offset + $this->qb_limit; // As of SQL Server 2005 (9.0.*) ROW_NUMBER() is supported, // however an ORDER BY clause is required for it to work if (version_compare($this->version(), '9', '>=') && $this->qb_offset && ! empty($this->qb_orderby)) { $orderby = $this->_compile_order_by(); // We have to strip the ORDER BY clause $sql = trim(substr($sql, 0, strrpos($sql, $orderby))); // Get the fields to select from our subquery, so that we can avoid CI_rownum appearing in the actual results if (count($this->qb_select) === 0) { $select = '*'; // Inevitable } else { // Use only field names and their aliases, everything else is out of our scope. $select = array(); $field_regexp = ($this->_quoted_identifier) ? '("[^\"]+")' : '(\[[^\]]+\])'; for ($i = 0, $c = count($this->qb_select); $i < $c; $i++) { $select[] = preg_match('/(?:\s|\.)'.$field_regexp.'$/i', $this->qb_select[$i], $m) ? $m[1] : $this->qb_select[$i]; } $select = implode(', ', $select); } return 'SELECT '.$select." FROM (\n\n" .preg_replace('/^(SELECT( DISTINCT)?)/i', '\\1 ROW_NUMBER() OVER('.trim($orderby).') AS '.$this->escape_identifiers('CI_rownum').', ', $sql) ."\n\n) ".$this->escape_identifiers('CI_subquery') ."\nWHERE ".$this->escape_identifiers('CI_rownum').' BETWEEN '.($this->qb_offset + 1).' AND '.$limit; } return preg_replace('/(^\SELECT (DISTINCT)?)/i','\\1 TOP '.$limit.' ', $sql); } // -------------------------------------------------------------------- /** * Insert batch statement * * Generates a platform-specific insert string from the supplied data. * * @param string $table Table name * @param array $keys INSERT keys * @param array $values INSERT values * @return string|bool */ protected function _insert_batch($table, $keys, $values) { // Multiple-value inserts are only supported as of SQL Server 2008 if (version_compare($this->version(), '10', '>=')) { return parent::_insert_batch($table, $keys, $values); } return ($this->db->db_debug) ? $this->db->display_error('db_unsupported_feature') : FALSE; } // -------------------------------------------------------------------- /** * Close DB Connection * * @return void */ protected function _close() { mssql_close($this->conn_id); } }
fyulistian/politeknik-learning
system/database/drivers/mssql/mssql_driver.php
PHP
mit
13,592
angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; $provide.value("$locale", {"DATETIME_FORMATS":{"MONTH":["ianuarie","februarie","martie","aprilie","mai","iunie","iulie","august","septembrie","octombrie","noiembrie","decembrie"],"SHORTMONTH":["ian.","feb.","mar.","apr.","mai","iun.","iul.","aug.","sept.","oct.","nov.","dec."],"DAY":["duminică","luni","marți","miercuri","joi","vineri","sÒmbătă"],"SHORTDAY":["Du","Lu","Ma","Mi","Jo","Vi","SÒ"],"AMPMS":["AM","PM"],"medium":"dd.MM.yyyy HH:mm:ss","short":"dd.MM.yyyy HH:mm","fullDate":"EEEE, d MMMM y","longDate":"d MMMM y","mediumDate":"dd.MM.yyyy","shortDate":"dd.MM.yyyy","mediumTime":"HH:mm:ss","shortTime":"HH:mm"},"NUMBER_FORMATS":{"DECIMAL_SEP":",","GROUP_SEP":".","PATTERNS":[{"minInt":1,"minFrac":0,"macFrac":0,"posPre":"","posSuf":"","negPre":"-","negSuf":"","gSize":3,"lgSize":3,"maxFrac":3},{"minInt":1,"minFrac":2,"macFrac":0,"posPre":"","posSuf":" \u00A4","negPre":"-","negSuf":" \u00A4","gSize":3,"lgSize":3,"maxFrac":2}],"CURRENCY_SYM":"MDL"},"pluralCat":function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } if (n == 0 || n != 1 && (n % 100) >= 1 && (n % 100) <= 19 && n == Math.floor(n)) { return PLURAL_CATEGORY.FEW; } return PLURAL_CATEGORY.OTHER;},"id":"mo"}); }]);
boneskull/cdnjs
ajax/libs/angular-i18n/1.0.0rc11/angular-locale_mo.js
JavaScript
mit
1,384
/*! * jQuery JavaScript Library v2.1.0 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2014-01-23T21:10Z */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b=a.length,c=ab.type(a);return"function"===c||ab.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}function d(a,b,c){if(ab.isFunction(b))return ab.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return ab.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(hb.test(b))return ab.filter(b,a,c);b=ab.filter(b,a)}return ab.grep(a,function(a){return U.call(b,a)>=0!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b=ob[a]={};return ab.each(a.match(nb)||[],function(a,c){b[c]=!0}),b}function g(){$.removeEventListener("DOMContentLoaded",g,!1),a.removeEventListener("load",g,!1),ab.ready()}function h(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=ab.expando+Math.random()}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(ub,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:tb.test(c)?ab.parseJSON(c):c}catch(e){}sb.set(a,b,c)}else c=void 0;return c}function j(){return!0}function k(){return!1}function l(){try{return $.activeElement}catch(a){}}function m(a,b){return ab.nodeName(a,"table")&&ab.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function n(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function o(a){var b=Kb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function p(a,b){for(var c=0,d=a.length;d>c;c++)rb.set(a[c],"globalEval",!b||rb.get(b[c],"globalEval"))}function q(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(rb.hasData(a)&&(f=rb.access(a),g=rb.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)ab.event.add(b,e,j[e][c])}sb.hasData(a)&&(h=sb.access(a),i=ab.extend({},h),sb.set(b,i))}}function r(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&ab.nodeName(a,b)?ab.merge([a],c):c}function s(a,b){var c=b.nodeName.toLowerCase();"input"===c&&yb.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function t(b,c){var d=ab(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:ab.css(d[0],"display");return d.detach(),e}function u(a){var b=$,c=Ob[a];return c||(c=t(a,b),"none"!==c&&c||(Nb=(Nb||ab("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=Nb[0].contentDocument,b.write(),b.close(),c=t(a,b),Nb.detach()),Ob[a]=c),c}function v(a,b,c){var d,e,f,g,h=a.style;return c=c||Rb(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||ab.contains(a.ownerDocument,a)||(g=ab.style(a,b)),Qb.test(g)&&Pb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function w(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}function x(a,b){if(b in a)return b;for(var c=b[0].toUpperCase()+b.slice(1),d=b,e=Xb.length;e--;)if(b=Xb[e]+c,b in a)return b;return d}function y(a,b,c){var d=Tb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function z(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=ab.css(a,c+wb[f],!0,e)),d?("content"===c&&(g-=ab.css(a,"padding"+wb[f],!0,e)),"margin"!==c&&(g-=ab.css(a,"border"+wb[f]+"Width",!0,e))):(g+=ab.css(a,"padding"+wb[f],!0,e),"padding"!==c&&(g+=ab.css(a,"border"+wb[f]+"Width",!0,e)));return g}function A(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Rb(a),g="border-box"===ab.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=v(a,b,f),(0>e||null==e)&&(e=a.style[b]),Qb.test(e))return e;d=g&&(Z.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+z(a,b,c||(g?"border":"content"),d,f)+"px"}function B(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=rb.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&xb(d)&&(f[g]=rb.access(d,"olddisplay",u(d.nodeName)))):f[g]||(e=xb(d),(c&&"none"!==c||!e)&&rb.set(d,"olddisplay",e?c:ab.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function C(a,b,c,d,e){return new C.prototype.init(a,b,c,d,e)}function D(){return setTimeout(function(){Yb=void 0}),Yb=ab.now()}function E(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=wb[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function F(a,b,c){for(var d,e=(cc[b]||[]).concat(cc["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function G(a,b,c){var d,e,f,g,h,i,j,k=this,l={},m=a.style,n=a.nodeType&&xb(a),o=rb.get(a,"fxshow");c.queue||(h=ab._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,k.always(function(){k.always(function(){h.unqueued--,ab.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],j=ab.css(a,"display"),"none"===j&&(j=u(a.nodeName)),"inline"===j&&"none"===ab.css(a,"float")&&(m.display="inline-block")),c.overflow&&(m.overflow="hidden",k.always(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],$b.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(n?"hide":"show")){if("show"!==e||!o||void 0===o[d])continue;n=!0}l[d]=o&&o[d]||ab.style(a,d)}if(!ab.isEmptyObject(l)){o?"hidden"in o&&(n=o.hidden):o=rb.access(a,"fxshow",{}),f&&(o.hidden=!n),n?ab(a).show():k.done(function(){ab(a).hide()}),k.done(function(){var b;rb.remove(a,"fxshow");for(b in l)ab.style(a,b,l[b])});for(d in l)g=F(n?o[d]:0,d,k),d in o||(o[d]=g.start,n&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function H(a,b){var c,d,e,f,g;for(c in a)if(d=ab.camelCase(c),e=b[d],f=a[c],ab.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=ab.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function I(a,b,c){var d,e,f=0,g=bc.length,h=ab.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Yb||D(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:ab.extend({},b),opts:ab.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Yb||D(),duration:c.duration,tweens:[],createTween:function(b,c){var d=ab.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(H(k,j.opts.specialEasing);g>f;f++)if(d=bc[f].call(j,a,k,j.opts))return d;return ab.map(k,F,j),ab.isFunction(j.opts.start)&&j.opts.start.call(a,j),ab.fx.timer(ab.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function J(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(nb)||[];if(ab.isFunction(c))for(;d=f[e++];)"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function K(a,b,c,d){function e(h){var i;return f[h]=!0,ab.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||g||f[j]?g?!(i=j):void 0:(b.dataTypes.unshift(j),e(j),!1)}),i}var f={},g=a===vc;return e(b.dataTypes[0])||!f["*"]&&e("*")}function L(a,b){var c,d,e=ab.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&ab.extend(!0,a,d),a}function M(a,b,c){for(var d,e,f,g,h=a.contents,i=a.dataTypes;"*"===i[0];)i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function N(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];for(f=k.shift();f;)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}function O(a,b,c,d){var e;if(ab.isArray(b))ab.each(b,function(b,e){c||zc.test(a)?d(a,e):O(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==ab.type(b))d(a,b);else for(e in b)O(a+"["+e+"]",b[e],c,d)}function P(a){return ab.isWindow(a)?a:9===a.nodeType&&a.defaultView}var Q=[],R=Q.slice,S=Q.concat,T=Q.push,U=Q.indexOf,V={},W=V.toString,X=V.hasOwnProperty,Y="".trim,Z={},$=a.document,_="2.1.0",ab=function(a,b){return new ab.fn.init(a,b)},bb=/^-ms-/,cb=/-([\da-z])/gi,db=function(a,b){return b.toUpperCase()};ab.fn=ab.prototype={jquery:_,constructor:ab,selector:"",length:0,toArray:function(){return R.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:R.call(this)},pushStack:function(a){var b=ab.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return ab.each(this,a,b)},map:function(a){return this.pushStack(ab.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(R.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:T,sort:Q.sort,splice:Q.splice},ab.extend=ab.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||ab.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(ab.isPlainObject(d)||(e=ab.isArray(d)))?(e?(e=!1,f=c&&ab.isArray(c)?c:[]):f=c&&ab.isPlainObject(c)?c:{},g[b]=ab.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},ab.extend({expando:"jQuery"+(_+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===ab.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isPlainObject:function(a){if("object"!==ab.type(a)||a.nodeType||ab.isWindow(a))return!1;try{if(a.constructor&&!X.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}return!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?V[W.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=ab.trim(a),a&&(1===a.indexOf("use strict")?(b=$.createElement("script"),b.text=a,$.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(bb,"ms-").replace(cb,db)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,d){var e,f=0,g=a.length,h=c(a);if(d){if(h)for(;g>f&&(e=b.apply(a[f],d),e!==!1);f++);else for(f in a)if(e=b.apply(a[f],d),e===!1)break}else if(h)for(;g>f&&(e=b.call(a[f],f,a[f]),e!==!1);f++);else for(f in a)if(e=b.call(a[f],f,a[f]),e===!1)break;return a},trim:function(a){return null==a?"":Y.call(a)},makeArray:function(a,b){var d=b||[];return null!=a&&(c(Object(a))?ab.merge(d,"string"==typeof a?[a]:a):T.call(d,a)),d},inArray:function(a,b,c){return null==b?-1:U.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,d){var e,f=0,g=a.length,h=c(a),i=[];if(h)for(;g>f;f++)e=b(a[f],f,d),null!=e&&i.push(e);else for(f in a)e=b(a[f],f,d),null!=e&&i.push(e);return S.apply([],i)},guid:1,proxy:function(a,b){var c,d,e;return"string"==typeof b&&(c=a[b],b=a,a=c),ab.isFunction(a)?(d=R.call(arguments,2),e=function(){return a.apply(b||this,d.concat(R.call(arguments)))},e.guid=a.guid=a.guid||ab.guid++,e):void 0},now:Date.now,support:Z}),ab.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){V["[object "+b+"]"]=b.toLowerCase()});var eb=/*! * Sizzle CSS Selector Engine v1.10.16 * http://sizzlejs.com/ * * Copyright 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2014-01-13 */ function(a){function b(a,b,c,d){var e,f,g,h,i,j,l,o,p,q;if((b?b.ownerDocument||b:O)!==G&&F(b),b=b||G,c=c||[],!a||"string"!=typeof a)return c;if(1!==(h=b.nodeType)&&9!==h)return[];if(I&&!d){if(e=sb.exec(a))if(g=e[1]){if(9===h){if(f=b.getElementById(g),!f||!f.parentNode)return c;if(f.id===g)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(g))&&M(b,f)&&f.id===g)return c.push(f),c}else{if(e[2])return _.apply(c,b.getElementsByTagName(a)),c;if((g=e[3])&&x.getElementsByClassName&&b.getElementsByClassName)return _.apply(c,b.getElementsByClassName(g)),c}if(x.qsa&&(!J||!J.test(a))){if(o=l=N,p=b,q=9===h&&a,1===h&&"object"!==b.nodeName.toLowerCase()){for(j=m(a),(l=b.getAttribute("id"))?o=l.replace(ub,"\\$&"):b.setAttribute("id",o),o="[id='"+o+"'] ",i=j.length;i--;)j[i]=o+n(j[i]);p=tb.test(a)&&k(b.parentNode)||b,q=j.join(",")}if(q)try{return _.apply(c,p.querySelectorAll(q)),c}catch(r){}finally{l||b.removeAttribute("id")}}}return v(a.replace(ib,"$1"),b,c,d)}function c(){function a(c,d){return b.push(c+" ")>y.cacheLength&&delete a[b.shift()],a[c+" "]=d}var b=[];return a}function d(a){return a[N]=!0,a}function e(a){var b=G.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function f(a,b){for(var c=a.split("|"),d=a.length;d--;)y.attrHandle[c[d]]=b}function g(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||W)-(~a.sourceIndex||W);if(d)return d;if(c)for(;c=c.nextSibling;)if(c===b)return-1;return a?1:-1}function h(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function i(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function j(a){return d(function(b){return b=+b,d(function(c,d){for(var e,f=a([],c.length,b),g=f.length;g--;)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function k(a){return a&&typeof a.getElementsByTagName!==V&&a}function l(){}function m(a,c){var d,e,f,g,h,i,j,k=S[a+" "];if(k)return c?0:k.slice(0);for(h=a,i=[],j=y.preFilter;h;){(!d||(e=jb.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),d=!1,(e=kb.exec(h))&&(d=e.shift(),f.push({value:d,type:e[0].replace(ib," ")}),h=h.slice(d.length));for(g in y.filter)!(e=ob[g].exec(h))||j[g]&&!(e=j[g](e))||(d=e.shift(),f.push({value:d,type:g,matches:e}),h=h.slice(d.length));if(!d)break}return c?h.length:h?b.error(a):S(a,i).slice(0)}function n(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function o(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=Q++;return b.first?function(b,c,f){for(;b=b[d];)if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[P,f];if(g){for(;b=b[d];)if((1===b.nodeType||e)&&a(b,c,g))return!0}else for(;b=b[d];)if(1===b.nodeType||e){if(i=b[N]||(b[N]={}),(h=i[d])&&h[0]===P&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function p(a){return a.length>1?function(b,c,d){for(var e=a.length;e--;)if(!a[e](b,c,d))return!1;return!0}:a[0]}function q(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function r(a,b,c,e,f,g){return e&&!e[N]&&(e=r(e)),f&&!f[N]&&(f=r(f,g)),d(function(d,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=d||u(b||"*",h.nodeType?[h]:h,[]),r=!a||!d&&b?p:q(p,m,a,h,i),s=c?f||(d?a:o||e)?[]:g:r;if(c&&c(r,s,h,i),e)for(j=q(s,n),e(j,[],h,i),k=j.length;k--;)(l=j[k])&&(s[n[k]]=!(r[n[k]]=l));if(d){if(f||a){if(f){for(j=[],k=s.length;k--;)(l=s[k])&&j.push(r[k]=l);f(null,s=[],j,i)}for(k=s.length;k--;)(l=s[k])&&(j=f?bb.call(d,l):m[k])>-1&&(d[j]=!(g[j]=l))}}else s=q(s===g?s.splice(o,s.length):s),f?f(null,g,s,i):_.apply(g,s)})}function s(a){for(var b,c,d,e=a.length,f=y.relative[a[0].type],g=f||y.relative[" "],h=f?1:0,i=o(function(a){return a===b},g,!0),j=o(function(a){return bb.call(b,a)>-1},g,!0),k=[function(a,c,d){return!f&&(d||c!==C)||((b=c).nodeType?i(a,c,d):j(a,c,d))}];e>h;h++)if(c=y.relative[a[h].type])k=[o(p(k),c)];else{if(c=y.filter[a[h].type].apply(null,a[h].matches),c[N]){for(d=++h;e>d&&!y.relative[a[d].type];d++);return r(h>1&&p(k),h>1&&n(a.slice(0,h-1).concat({value:" "===a[h-2].type?"*":""})).replace(ib,"$1"),c,d>h&&s(a.slice(h,d)),e>d&&s(a=a.slice(d)),e>d&&n(a))}k.push(c)}return p(k)}function t(a,c){var e=c.length>0,f=a.length>0,g=function(d,g,h,i,j){var k,l,m,n=0,o="0",p=d&&[],r=[],s=C,t=d||f&&y.find.TAG("*",j),u=P+=null==s?1:Math.random()||.1,v=t.length;for(j&&(C=g!==G&&g);o!==v&&null!=(k=t[o]);o++){if(f&&k){for(l=0;m=a[l++];)if(m(k,g,h)){i.push(k);break}j&&(P=u)}e&&((k=!m&&k)&&n--,d&&p.push(k))}if(n+=o,e&&o!==n){for(l=0;m=c[l++];)m(p,r,g,h);if(d){if(n>0)for(;o--;)p[o]||r[o]||(r[o]=Z.call(i));r=q(r)}_.apply(i,r),j&&!d&&r.length>0&&n+c.length>1&&b.uniqueSort(i)}return j&&(P=u,C=s),p};return e?d(g):g}function u(a,c,d){for(var e=0,f=c.length;f>e;e++)b(a,c[e],d);return d}function v(a,b,c,d){var e,f,g,h,i,j=m(a);if(!d&&1===j.length){if(f=j[0]=j[0].slice(0),f.length>2&&"ID"===(g=f[0]).type&&x.getById&&9===b.nodeType&&I&&y.relative[f[1].type]){if(b=(y.find.ID(g.matches[0].replace(vb,wb),b)||[])[0],!b)return c;a=a.slice(f.shift().value.length)}for(e=ob.needsContext.test(a)?0:f.length;e--&&(g=f[e],!y.relative[h=g.type]);)if((i=y.find[h])&&(d=i(g.matches[0].replace(vb,wb),tb.test(f[0].type)&&k(b.parentNode)||b))){if(f.splice(e,1),a=d.length&&n(f),!a)return _.apply(c,d),c;break}}return B(a,j)(d,b,!I,c,tb.test(a)&&k(b.parentNode)||b),c}var w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N="sizzle"+-new Date,O=a.document,P=0,Q=0,R=c(),S=c(),T=c(),U=function(a,b){return a===b&&(E=!0),0},V="undefined",W=1<<31,X={}.hasOwnProperty,Y=[],Z=Y.pop,$=Y.push,_=Y.push,ab=Y.slice,bb=Y.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},cb="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",db="[\\x20\\t\\r\\n\\f]",eb="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",fb=eb.replace("w","w#"),gb="\\["+db+"*("+eb+")"+db+"*(?:([*^$|!~]?=)"+db+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+fb+")|)|)"+db+"*\\]",hb=":("+eb+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+gb.replace(3,8)+")*)|.*)\\)|)",ib=new RegExp("^"+db+"+|((?:^|[^\\\\])(?:\\\\.)*)"+db+"+$","g"),jb=new RegExp("^"+db+"*,"+db+"*"),kb=new RegExp("^"+db+"*([>+~]|"+db+")"+db+"*"),lb=new RegExp("="+db+"*([^\\]'\"]*?)"+db+"*\\]","g"),mb=new RegExp(hb),nb=new RegExp("^"+fb+"$"),ob={ID:new RegExp("^#("+eb+")"),CLASS:new RegExp("^\\.("+eb+")"),TAG:new RegExp("^("+eb.replace("w","w*")+")"),ATTR:new RegExp("^"+gb),PSEUDO:new RegExp("^"+hb),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+db+"*(even|odd|(([+-]|)(\\d*)n|)"+db+"*(?:([+-]|)"+db+"*(\\d+)|))"+db+"*\\)|)","i"),bool:new RegExp("^(?:"+cb+")$","i"),needsContext:new RegExp("^"+db+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+db+"*((?:-\\d)?\\d*)"+db+"*\\)|)(?=[^-]|$)","i")},pb=/^(?:input|select|textarea|button)$/i,qb=/^h\d$/i,rb=/^[^{]+\{\s*\[native \w/,sb=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tb=/[+~]/,ub=/'|\\/g,vb=new RegExp("\\\\([\\da-f]{1,6}"+db+"?|("+db+")|.)","ig"),wb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{_.apply(Y=ab.call(O.childNodes),O.childNodes),Y[O.childNodes.length].nodeType}catch(xb){_={apply:Y.length?function(a,b){$.apply(a,ab.call(b))}:function(a,b){for(var c=a.length,d=0;a[c++]=b[d++];);a.length=c-1}}}x=b.support={},A=b.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},F=b.setDocument=function(a){var b,c=a?a.ownerDocument||a:O,d=c.defaultView;return c!==G&&9===c.nodeType&&c.documentElement?(G=c,H=c.documentElement,I=!A(c),d&&d!==d.top&&(d.addEventListener?d.addEventListener("unload",function(){F()},!1):d.attachEvent&&d.attachEvent("onunload",function(){F()})),x.attributes=e(function(a){return a.className="i",!a.getAttribute("className")}),x.getElementsByTagName=e(function(a){return a.appendChild(c.createComment("")),!a.getElementsByTagName("*").length}),x.getElementsByClassName=rb.test(c.getElementsByClassName)&&e(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),x.getById=e(function(a){return H.appendChild(a).id=N,!c.getElementsByName||!c.getElementsByName(N).length}),x.getById?(y.find.ID=function(a,b){if(typeof b.getElementById!==V&&I){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},y.filter.ID=function(a){var b=a.replace(vb,wb);return function(a){return a.getAttribute("id")===b}}):(delete y.find.ID,y.filter.ID=function(a){var b=a.replace(vb,wb);return function(a){var c=typeof a.getAttributeNode!==V&&a.getAttributeNode("id");return c&&c.value===b}}),y.find.TAG=x.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==V?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){for(;c=f[e++];)1===c.nodeType&&d.push(c);return d}return f},y.find.CLASS=x.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==V&&I?b.getElementsByClassName(a):void 0},K=[],J=[],(x.qsa=rb.test(c.querySelectorAll))&&(e(function(a){a.innerHTML="<select t=''><option selected=''></option></select>",a.querySelectorAll("[t^='']").length&&J.push("[*^$]="+db+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||J.push("\\["+db+"*(?:value|"+cb+")"),a.querySelectorAll(":checked").length||J.push(":checked")}),e(function(a){var b=c.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&J.push("name"+db+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||J.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),J.push(",.*:")})),(x.matchesSelector=rb.test(L=H.webkitMatchesSelector||H.mozMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&e(function(a){x.disconnectedMatch=L.call(a,"div"),L.call(a,"[s!='']:x"),K.push("!=",hb)}),J=J.length&&new RegExp(J.join("|")),K=K.length&&new RegExp(K.join("|")),b=rb.test(H.compareDocumentPosition),M=b||rb.test(H.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},U=b?function(a,b){if(a===b)return E=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!x.sortDetached&&b.compareDocumentPosition(a)===d?a===c||a.ownerDocument===O&&M(O,a)?-1:b===c||b.ownerDocument===O&&M(O,b)?1:D?bb.call(D,a)-bb.call(D,b):0:4&d?-1:1)}:function(a,b){if(a===b)return E=!0,0;var d,e=0,f=a.parentNode,h=b.parentNode,i=[a],j=[b];if(!f||!h)return a===c?-1:b===c?1:f?-1:h?1:D?bb.call(D,a)-bb.call(D,b):0;if(f===h)return g(a,b);for(d=a;d=d.parentNode;)i.unshift(d);for(d=b;d=d.parentNode;)j.unshift(d);for(;i[e]===j[e];)e++;return e?g(i[e],j[e]):i[e]===O?-1:j[e]===O?1:0},c):G},b.matches=function(a,c){return b(a,null,null,c)},b.matchesSelector=function(a,c){if((a.ownerDocument||a)!==G&&F(a),c=c.replace(lb,"='$1']"),!(!x.matchesSelector||!I||K&&K.test(c)||J&&J.test(c)))try{var d=L.call(a,c);if(d||x.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return b(c,G,null,[a]).length>0},b.contains=function(a,b){return(a.ownerDocument||a)!==G&&F(a),M(a,b)},b.attr=function(a,b){(a.ownerDocument||a)!==G&&F(a);var c=y.attrHandle[b.toLowerCase()],d=c&&X.call(y.attrHandle,b.toLowerCase())?c(a,b,!I):void 0;return void 0!==d?d:x.attributes||!I?a.getAttribute(b):(d=a.getAttributeNode(b))&&d.specified?d.value:null},b.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},b.uniqueSort=function(a){var b,c=[],d=0,e=0;if(E=!x.detectDuplicates,D=!x.sortStable&&a.slice(0),a.sort(U),E){for(;b=a[e++];)b===a[e]&&(d=c.push(e));for(;d--;)a.splice(c[d],1)}return D=null,a},z=b.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(1===e||9===e||11===e){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=z(a)}else if(3===e||4===e)return a.nodeValue}else for(;b=a[d++];)c+=z(b);return c},y=b.selectors={cacheLength:50,createPseudo:d,match:ob,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(vb,wb),a[3]=(a[4]||a[5]||"").replace(vb,wb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||b.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&b.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return ob.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&mb.test(c)&&(b=m(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(vb,wb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=R[a+" "];return b||(b=new RegExp("(^|"+db+")"+a+"("+db+"|$)"))&&R(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==V&&a.getAttribute("class")||"")})},ATTR:function(a,c,d){return function(e){var f=b.attr(e,a);return null==f?"!="===c:c?(f+="","="===c?f===d:"!="===c?f!==d:"^="===c?d&&0===f.indexOf(d):"*="===c?d&&f.indexOf(d)>-1:"$="===c?d&&f.slice(-d.length)===d:"~="===c?(" "+f+" ").indexOf(d)>-1:"|="===c?f===d||f.slice(0,d.length+1)===d+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){for(;p;){for(l=b;l=l[p];)if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){for(k=q[N]||(q[N]={}),j=k[a]||[],n=j[0]===P&&j[1],m=j[0]===P&&j[2],l=n&&q.childNodes[n];l=++n&&l&&l[p]||(m=n=0)||o.pop();)if(1===l.nodeType&&++m&&l===b){k[a]=[P,n,m];break}}else if(s&&(j=(b[N]||(b[N]={}))[a])&&j[0]===P)m=j[1];else for(;(l=++n&&l&&l[p]||(m=n=0)||o.pop())&&((h?l.nodeName.toLowerCase()!==r:1!==l.nodeType)||!++m||(s&&((l[N]||(l[N]={}))[a]=[P,m]),l!==b)););return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,c){var e,f=y.pseudos[a]||y.setFilters[a.toLowerCase()]||b.error("unsupported pseudo: "+a);return f[N]?f(c):f.length>1?(e=[a,a,"",c],y.setFilters.hasOwnProperty(a.toLowerCase())?d(function(a,b){for(var d,e=f(a,c),g=e.length;g--;)d=bb.call(a,e[g]),a[d]=!(b[d]=e[g])}):function(a){return f(a,0,e)}):f}},pseudos:{not:d(function(a){var b=[],c=[],e=B(a.replace(ib,"$1"));return e[N]?d(function(a,b,c,d){for(var f,g=e(a,null,d,[]),h=a.length;h--;)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,d,f){return b[0]=a,e(b,null,f,c),!c.pop()}}),has:d(function(a){return function(c){return b(a,c).length>0}}),contains:d(function(a){return function(b){return(b.textContent||b.innerText||z(b)).indexOf(a)>-1}}),lang:d(function(a){return nb.test(a||"")||b.error("unsupported lang: "+a),a=a.replace(vb,wb).toLowerCase(),function(b){var c;do if(c=I?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===H},focus:function(a){return a===G.activeElement&&(!G.hasFocus||G.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!y.pseudos.empty(a)},header:function(a){return qb.test(a.nodeName)},input:function(a){return pb.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:j(function(){return[0]}),last:j(function(a,b){return[b-1]}),eq:j(function(a,b,c){return[0>c?c+b:c]}),even:j(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:j(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:j(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:j(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},y.pseudos.nth=y.pseudos.eq;for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})y.pseudos[w]=h(w);for(w in{submit:!0,reset:!0})y.pseudos[w]=i(w);return l.prototype=y.filters=y.pseudos,y.setFilters=new l,B=b.compile=function(a,b){var c,d=[],e=[],f=T[a+" "];if(!f){for(b||(b=m(a)),c=b.length;c--;)f=s(b[c]),f[N]?d.push(f):e.push(f);f=T(a,t(e,d))}return f},x.sortStable=N.split("").sort(U).join("")===N,x.detectDuplicates=!!E,F(),x.sortDetached=e(function(a){return 1&a.compareDocumentPosition(G.createElement("div"))}),e(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||f("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),x.attributes&&e(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||f("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),e(function(a){return null==a.getAttribute("disabled")})||f(cb,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),b}(a);ab.find=eb,ab.expr=eb.selectors,ab.expr[":"]=ab.expr.pseudos,ab.unique=eb.uniqueSort,ab.text=eb.getText,ab.isXMLDoc=eb.isXML,ab.contains=eb.contains;var fb=ab.expr.match.needsContext,gb=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,hb=/^.[^:#\[\.,]*$/;ab.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?ab.find.matchesSelector(d,a)?[d]:[]:ab.find.matches(a,ab.grep(b,function(a){return 1===a.nodeType}))},ab.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(ab(a).filter(function(){for(b=0;c>b;b++)if(ab.contains(e[b],this))return!0}));for(b=0;c>b;b++)ab.find(a,e[b],d);return d=this.pushStack(c>1?ab.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(d(this,a||[],!1))},not:function(a){return this.pushStack(d(this,a||[],!0))},is:function(a){return!!d(this,"string"==typeof a&&fb.test(a)?ab(a):a||[],!1).length}});var ib,jb=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,kb=ab.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:jb.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||ib).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof ab?b[0]:b,ab.merge(this,ab.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:$,!0)),gb.test(c[1])&&ab.isPlainObject(b))for(c in b)ab.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=$.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=$,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):ab.isFunction(a)?"undefined"!=typeof ib.ready?ib.ready(a):a(ab):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),ab.makeArray(a,this))};kb.prototype=ab.fn,ib=ab($);var lb=/^(?:parents|prev(?:Until|All))/,mb={children:!0,contents:!0,next:!0,prev:!0};ab.extend({dir:function(a,b,c){for(var d=[],e=void 0!==c;(a=a[b])&&9!==a.nodeType;)if(1===a.nodeType){if(e&&ab(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),ab.fn.extend({has:function(a){var b=ab(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(ab.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=fb.test(a)||"string"!=typeof a?ab(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&ab.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?ab.unique(f):f)},index:function(a){return a?"string"==typeof a?U.call(ab(a),this[0]):U.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(ab.unique(ab.merge(this.get(),ab(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}}),ab.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return ab.dir(a,"parentNode")},parentsUntil:function(a,b,c){return ab.dir(a,"parentNode",c)},next:function(a){return e(a,"nextSibling")},prev:function(a){return e(a,"previousSibling")},nextAll:function(a){return ab.dir(a,"nextSibling")},prevAll:function(a){return ab.dir(a,"previousSibling")},nextUntil:function(a,b,c){return ab.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return ab.dir(a,"previousSibling",c)},siblings:function(a){return ab.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return ab.sibling(a.firstChild)},contents:function(a){return a.contentDocument||ab.merge([],a.childNodes)}},function(a,b){ab.fn[a]=function(c,d){var e=ab.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=ab.filter(d,e)),this.length>1&&(mb[a]||ab.unique(e),lb.test(a)&&e.reverse()),this.pushStack(e)}});var nb=/\S+/g,ob={};ab.Callbacks=function(a){a="string"==typeof a?ob[a]||f(a):ab.extend({},a);var b,c,d,e,g,h,i=[],j=!a.once&&[],k=function(f){for(b=a.memory&&f,c=!0,h=e||0,e=0,g=i.length,d=!0;i&&g>h;h++)if(i[h].apply(f[0],f[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,i&&(j?j.length&&k(j.shift()):b?i=[]:l.disable())},l={add:function(){if(i){var c=i.length;!function f(b){ab.each(b,function(b,c){var d=ab.type(c);"function"===d?a.unique&&l.has(c)||i.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),d?g=i.length:b&&(e=c,k(b))}return this},remove:function(){return i&&ab.each(arguments,function(a,b){for(var c;(c=ab.inArray(b,i,c))>-1;)i.splice(c,1),d&&(g>=c&&g--,h>=c&&h--)}),this},has:function(a){return a?ab.inArray(a,i)>-1:!(!i||!i.length)},empty:function(){return i=[],g=0,this},disable:function(){return i=j=b=void 0,this},disabled:function(){return!i},lock:function(){return j=void 0,b||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return!i||c&&!j||(b=b||[],b=[a,b.slice?b.slice():b],d?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!c}};return l},ab.extend({Deferred:function(a){var b=[["resolve","done",ab.Callbacks("once memory"),"resolved"],["reject","fail",ab.Callbacks("once memory"),"rejected"],["notify","progress",ab.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return ab.Deferred(function(c){ab.each(b,function(b,f){var g=ab.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&ab.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?ab.extend(a,d):d}},e={};return d.pipe=d.then,ab.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b,c,d,e=0,f=R.call(arguments),g=f.length,h=1!==g||a&&ab.isFunction(a.promise)?g:0,i=1===h?a:ab.Deferred(),j=function(a,c,d){return function(e){c[a]=this,d[a]=arguments.length>1?R.call(arguments):e,d===b?i.notifyWith(c,d):--h||i.resolveWith(c,d)}};if(g>1)for(b=new Array(g),c=new Array(g),d=new Array(g);g>e;e++)f[e]&&ab.isFunction(f[e].promise)?f[e].promise().done(j(e,d,f)).fail(i.reject).progress(j(e,c,b)):--h;return h||i.resolveWith(d,f),i.promise()}});var pb;ab.fn.ready=function(a){return ab.ready.promise().done(a),this},ab.extend({isReady:!1,readyWait:1,holdReady:function(a){a?ab.readyWait++:ab.ready(!0)},ready:function(a){(a===!0?--ab.readyWait:ab.isReady)||(ab.isReady=!0,a!==!0&&--ab.readyWait>0||(pb.resolveWith($,[ab]),ab.fn.trigger&&ab($).trigger("ready").off("ready")))}}),ab.ready.promise=function(b){return pb||(pb=ab.Deferred(),"complete"===$.readyState?setTimeout(ab.ready):($.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1))),pb.promise(b)},ab.ready.promise();var qb=ab.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===ab.type(c)){e=!0;for(h in c)ab.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,ab.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(ab(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};ab.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType},h.uid=1,h.accepts=ab.acceptData,h.prototype={key:function(a){if(!h.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=h.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,ab.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(ab.isEmptyObject(f))ab.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,ab.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{ab.isArray(b)?d=b.concat(b.map(ab.camelCase)):(e=ab.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(nb)||[])),c=d.length;for(;c--;)delete g[d[c]]}},hasData:function(a){return!ab.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var rb=new h,sb=new h,tb=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ub=/([A-Z])/g;ab.extend({hasData:function(a){return sb.hasData(a)||rb.hasData(a)},data:function(a,b,c){return sb.access(a,b,c)},removeData:function(a,b){sb.remove(a,b)},_data:function(a,b,c){return rb.access(a,b,c)},_removeData:function(a,b){rb.remove(a,b)}}),ab.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=sb.get(f),1===f.nodeType&&!rb.get(f,"hasDataAttrs"))){for(c=g.length;c--;)d=g[c].name,0===d.indexOf("data-")&&(d=ab.camelCase(d.slice(5)),i(f,d,e[d]));rb.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){sb.set(this,a)}):qb(this,function(b){var c,d=ab.camelCase(a);if(f&&void 0===b){if(c=sb.get(f,a),void 0!==c)return c;if(c=sb.get(f,d),void 0!==c)return c;if(c=i(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=sb.get(this,d);sb.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&sb.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){sb.remove(this,a)})}}),ab.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=rb.get(a,b),c&&(!d||ab.isArray(c)?d=rb.access(a,b,ab.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=ab.queue(a,b),d=c.length,e=c.shift(),f=ab._queueHooks(a,b),g=function(){ab.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return rb.get(a,c)||rb.access(a,c,{empty:ab.Callbacks("once memory").add(function(){rb.remove(a,[b+"queue",c])})})}}),ab.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?ab.queue(this[0],a):void 0===b?this:this.each(function(){var c=ab.queue(this,a,b);ab._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&ab.dequeue(this,a)})},dequeue:function(a){return this.each(function(){ab.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=ab.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};for("string"!=typeof a&&(b=a,a=void 0),a=a||"fx";g--;)c=rb.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var vb=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,wb=["Top","Right","Bottom","Left"],xb=function(a,b){return a=b||a,"none"===ab.css(a,"display")||!ab.contains(a.ownerDocument,a)},yb=/^(?:checkbox|radio)$/i;!function(){var a=$.createDocumentFragment(),b=a.appendChild($.createElement("div"));b.innerHTML="<input type='radio' checked='checked' name='t'/>",Z.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",Z.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var zb="undefined";Z.focusinBubbles="onfocusin"in a;var Ab=/^key/,Bb=/^(?:mouse|contextmenu)|click/,Cb=/^(?:focusinfocus|focusoutblur)$/,Db=/^([^.]*)(?:\.(.+)|)$/;ab.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=rb.get(a);if(q)for(c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=ab.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return typeof ab!==zb&&ab.event.triggered!==b.type?ab.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(nb)||[""],j=b.length;j--;)h=Db.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=ab.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=ab.event.special[n]||{},k=ab.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&ab.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),ab.event.global[n]=!0)},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=rb.hasData(a)&&rb.get(a);if(q&&(i=q.events)){for(b=(b||"").match(nb)||[""],j=b.length;j--;)if(h=Db.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){for(l=ab.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;f--;)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||ab.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)ab.event.remove(a,n+b[j],c,d,!0);ab.isEmptyObject(i)&&(delete q.handle,rb.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,j,k,l,m=[d||$],n=X.call(b,"type")?b.type:b,o=X.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||$,3!==d.nodeType&&8!==d.nodeType&&!Cb.test(n+ab.event.triggered)&&(n.indexOf(".")>=0&&(o=n.split("."),n=o.shift(),o.sort()),j=n.indexOf(":")<0&&"on"+n,b=b[ab.expando]?b:new ab.Event(n,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=o.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:ab.makeArray(c,[b]),l=ab.event.special[n]||{},e||!l.trigger||l.trigger.apply(d,c)!==!1)){if(!e&&!l.noBubble&&!ab.isWindow(d)){for(i=l.delegateType||n,Cb.test(i+n)||(g=g.parentNode);g;g=g.parentNode)m.push(g),h=g; h===(d.ownerDocument||$)&&m.push(h.defaultView||h.parentWindow||a)}for(f=0;(g=m[f++])&&!b.isPropagationStopped();)b.type=f>1?i:l.bindType||n,k=(rb.get(g,"events")||{})[b.type]&&rb.get(g,"handle"),k&&k.apply(g,c),k=j&&g[j],k&&k.apply&&ab.acceptData(g)&&(b.result=k.apply(g,c),b.result===!1&&b.preventDefault());return b.type=n,e||b.isDefaultPrevented()||l._default&&l._default.apply(m.pop(),c)!==!1||!ab.acceptData(d)||j&&ab.isFunction(d[n])&&!ab.isWindow(d)&&(h=d[j],h&&(d[j]=null),ab.event.triggered=n,d[n](),ab.event.triggered=void 0,h&&(d[j]=h)),b.result}},dispatch:function(a){a=ab.event.fix(a);var b,c,d,e,f,g=[],h=R.call(arguments),i=(rb.get(this,"events")||{})[a.type]||[],j=ab.event.special[a.type]||{};if(h[0]=a,a.delegateTarget=this,!j.preDispatch||j.preDispatch.call(this,a)!==!1){for(g=ab.event.handlers.call(this,a,i),b=0;(e=g[b++])&&!a.isPropagationStopped();)for(a.currentTarget=e.elem,c=0;(f=e.handlers[c++])&&!a.isImmediatePropagationStopped();)(!a.namespace_re||a.namespace_re.test(f.namespace))&&(a.handleObj=f,a.data=f.data,d=((ab.event.special[f.origType]||{}).handle||f.handler).apply(e.elem,h),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()));return j.postDispatch&&j.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?ab(e,this).index(i)>=0:ab.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||$,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[ab.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];for(g||(this.fixHooks[e]=g=Bb.test(e)?this.mouseHooks:Ab.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new ab.Event(f),b=d.length;b--;)c=d[b],a[c]=f[c];return a.target||(a.target=$),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==l()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===l()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&ab.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return ab.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=ab.extend(new ab.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?ab.event.trigger(e,null,b):ab.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},ab.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},ab.Event=function(a,b){return this instanceof ab.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.getPreventDefault&&a.getPreventDefault()?j:k):this.type=a,b&&ab.extend(this,b),this.timeStamp=a&&a.timeStamp||ab.now(),void(this[ab.expando]=!0)):new ab.Event(a,b)},ab.Event.prototype={isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=j,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=j,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=j,this.stopPropagation()}},ab.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){ab.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!ab.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),Z.focusinBubbles||ab.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){ab.event.simulate(b,a.target,ab.event.fix(a),!0)};ab.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=rb.access(d,b);e||d.addEventListener(a,c,!0),rb.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=rb.access(d,b)-1;e?rb.access(d,b,e):(d.removeEventListener(a,c,!0),rb.remove(d,b))}}}),ab.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=k;else if(!d)return this;return 1===e&&(f=d,d=function(a){return ab().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=ab.guid++)),this.each(function(){ab.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,ab(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=k),this.each(function(){ab.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){ab.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?ab.event.trigger(a,b,c,!0):void 0}});var Eb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Fb=/<([\w:]+)/,Gb=/<|&#?\w+;/,Hb=/<(?:script|style|link)/i,Ib=/checked\s*(?:[^=]|=\s*.checked.)/i,Jb=/^$|\/(?:java|ecma)script/i,Kb=/^true\/(.*)/,Lb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Mb={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Mb.optgroup=Mb.option,Mb.tbody=Mb.tfoot=Mb.colgroup=Mb.caption=Mb.thead,Mb.th=Mb.td,ab.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=ab.contains(a.ownerDocument,a);if(!(Z.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||ab.isXMLDoc(a)))for(g=r(h),f=r(a),d=0,e=f.length;e>d;d++)s(f[d],g[d]);if(b)if(c)for(f=f||r(a),g=g||r(h),d=0,e=f.length;e>d;d++)q(f[d],g[d]);else q(a,h);return g=r(h,"script"),g.length>0&&p(g,!i&&r(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,n=a.length;n>m;m++)if(e=a[m],e||0===e)if("object"===ab.type(e))ab.merge(l,e.nodeType?[e]:e);else if(Gb.test(e)){for(f=f||k.appendChild(b.createElement("div")),g=(Fb.exec(e)||["",""])[1].toLowerCase(),h=Mb[g]||Mb._default,f.innerHTML=h[1]+e.replace(Eb,"<$1></$2>")+h[2],j=h[0];j--;)f=f.lastChild;ab.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));for(k.textContent="",m=0;e=l[m++];)if((!d||-1===ab.inArray(e,d))&&(i=ab.contains(e.ownerDocument,e),f=r(k.appendChild(e),"script"),i&&p(f),c))for(j=0;e=f[j++];)Jb.test(e.type||"")&&c.push(e);return k},cleanData:function(a){for(var b,c,d,e,f,g,h=ab.event.special,i=0;void 0!==(c=a[i]);i++){if(ab.acceptData(c)&&(f=c[rb.expando],f&&(b=rb.cache[f]))){if(d=Object.keys(b.events||{}),d.length)for(g=0;void 0!==(e=d[g]);g++)h[e]?ab.event.remove(c,e):ab.removeEvent(c,e,b.handle);rb.cache[f]&&delete rb.cache[f]}delete sb.cache[c[sb.expando]]}}}),ab.fn.extend({text:function(a){return qb(this,function(a){return void 0===a?ab.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=m(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=m(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?ab.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||ab.cleanData(r(c)),c.parentNode&&(b&&ab.contains(c.ownerDocument,c)&&p(r(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(ab.cleanData(r(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return ab.clone(this,a,b)})},html:function(a){return qb(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Hb.test(a)&&!Mb[(Fb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Eb,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(ab.cleanData(r(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,ab.cleanData(r(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=S.apply([],a);var c,d,e,f,g,h,i=0,j=this.length,k=this,l=j-1,m=a[0],p=ab.isFunction(m);if(p||j>1&&"string"==typeof m&&!Z.checkClone&&Ib.test(m))return this.each(function(c){var d=k.eq(c);p&&(a[0]=m.call(this,c,d.html())),d.domManip(a,b)});if(j&&(c=ab.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(e=ab.map(r(c,"script"),n),f=e.length;j>i;i++)g=c,i!==l&&(g=ab.clone(g,!0,!0),f&&ab.merge(e,r(g,"script"))),b.call(this[i],g,i);if(f)for(h=e[e.length-1].ownerDocument,ab.map(e,o),i=0;f>i;i++)g=e[i],Jb.test(g.type||"")&&!rb.access(g,"globalEval")&&ab.contains(h,g)&&(g.src?ab._evalUrl&&ab._evalUrl(g.src):ab.globalEval(g.textContent.replace(Lb,"")))}return this}}),ab.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){ab.fn[a]=function(a){for(var c,d=[],e=ab(a),f=e.length-1,g=0;f>=g;g++)c=g===f?this:this.clone(!0),ab(e[g])[b](c),T.apply(d,c.get());return this.pushStack(d)}});var Nb,Ob={},Pb=/^margin/,Qb=new RegExp("^("+vb+")(?!px)[a-z%]+$","i"),Rb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)};!function(){function b(){h.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",f.appendChild(g);var b=a.getComputedStyle(h,null);c="1%"!==b.top,d="4px"===b.width,f.removeChild(g)}var c,d,e="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",f=$.documentElement,g=$.createElement("div"),h=$.createElement("div");h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",Z.clearCloneStyle="content-box"===h.style.backgroundClip,g.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",g.appendChild(h),a.getComputedStyle&&ab.extend(Z,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return null==d&&b(),d},reliableMarginRight:function(){var b,c=h.appendChild($.createElement("div"));return c.style.cssText=h.style.cssText=e,c.style.marginRight=c.style.width="0",h.style.width="1px",f.appendChild(g),b=!parseFloat(a.getComputedStyle(c,null).marginRight),f.removeChild(g),h.innerHTML="",b}})}(),ab.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Sb=/^(none|table(?!-c[ea]).+)/,Tb=new RegExp("^("+vb+")(.*)$","i"),Ub=new RegExp("^([+-])=("+vb+")","i"),Vb={position:"absolute",visibility:"hidden",display:"block"},Wb={letterSpacing:0,fontWeight:400},Xb=["Webkit","O","Moz","ms"];ab.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=v(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=ab.camelCase(b),i=a.style;return b=ab.cssProps[h]||(ab.cssProps[h]=x(i,h)),g=ab.cssHooks[b]||ab.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Ub.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(ab.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||ab.cssNumber[h]||(c+="px"),Z.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]="",i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=ab.camelCase(b);return b=ab.cssProps[h]||(ab.cssProps[h]=x(a.style,h)),g=ab.cssHooks[b]||ab.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=v(a,b,d)),"normal"===e&&b in Wb&&(e=Wb[b]),""===c||c?(f=parseFloat(e),c===!0||ab.isNumeric(f)?f||0:e):e}}),ab.each(["height","width"],function(a,b){ab.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&Sb.test(ab.css(a,"display"))?ab.swap(a,Vb,function(){return A(a,b,d)}):A(a,b,d):void 0},set:function(a,c,d){var e=d&&Rb(a);return y(a,c,d?z(a,b,d,"border-box"===ab.css(a,"boxSizing",!1,e),e):0)}}}),ab.cssHooks.marginRight=w(Z.reliableMarginRight,function(a,b){return b?ab.swap(a,{display:"inline-block"},v,[a,"marginRight"]):void 0}),ab.each({margin:"",padding:"",border:"Width"},function(a,b){ab.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+wb[d]+b]=f[d]||f[d-2]||f[0];return e}},Pb.test(a)||(ab.cssHooks[a+b].set=y)}),ab.fn.extend({css:function(a,b){return qb(this,function(a,b,c){var d,e,f={},g=0;if(ab.isArray(b)){for(d=Rb(a),e=b.length;e>g;g++)f[b[g]]=ab.css(a,b[g],!1,d);return f}return void 0!==c?ab.style(a,b,c):ab.css(a,b)},a,b,arguments.length>1)},show:function(){return B(this,!0)},hide:function(){return B(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){xb(this)?ab(this).show():ab(this).hide()})}}),ab.Tween=C,C.prototype={constructor:C,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(ab.cssNumber[c]?"":"px")},cur:function(){var a=C.propHooks[this.prop];return a&&a.get?a.get(this):C.propHooks._default.get(this)},run:function(a){var b,c=C.propHooks[this.prop];return this.pos=b=this.options.duration?ab.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):C.propHooks._default.set(this),this}},C.prototype.init.prototype=C.prototype,C.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=ab.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){ab.fx.step[a.prop]?ab.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[ab.cssProps[a.prop]]||ab.cssHooks[a.prop])?ab.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},C.propHooks.scrollTop=C.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},ab.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},ab.fx=C.prototype.init,ab.fx.step={};var Yb,Zb,$b=/^(?:toggle|show|hide)$/,_b=new RegExp("^(?:([+-])=|)("+vb+")([a-z%]*)$","i"),ac=/queueHooks$/,bc=[G],cc={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=_b.exec(b),f=e&&e[3]||(ab.cssNumber[a]?"":"px"),g=(ab.cssNumber[a]||"px"!==f&&+d)&&_b.exec(ab.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,ab.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};ab.Animation=ab.extend(I,{tweener:function(a,b){ab.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],cc[c]=cc[c]||[],cc[c].unshift(b)},prefilter:function(a,b){b?bc.unshift(a):bc.push(a)}}),ab.speed=function(a,b,c){var d=a&&"object"==typeof a?ab.extend({},a):{complete:c||!c&&b||ab.isFunction(a)&&a,duration:a,easing:c&&b||b&&!ab.isFunction(b)&&b};return d.duration=ab.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in ab.fx.speeds?ab.fx.speeds[d.duration]:ab.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){ab.isFunction(d.old)&&d.old.call(this),d.queue&&ab.dequeue(this,d.queue)},d},ab.fn.extend({fadeTo:function(a,b,c,d){return this.filter(xb).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=ab.isEmptyObject(a),f=ab.speed(b,c,d),g=function(){var b=I(this,ab.extend({},a),f);(e||rb.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=ab.timers,g=rb.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&ac.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&ab.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=rb.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=ab.timers,g=d?d.length:0;for(c.finish=!0,ab.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),ab.each(["toggle","show","hide"],function(a,b){var c=ab.fn[b];ab.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(E(b,!0),a,d,e)}}),ab.each({slideDown:E("show"),slideUp:E("hide"),slideToggle:E("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){ab.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),ab.timers=[],ab.fx.tick=function(){var a,b=0,c=ab.timers;for(Yb=ab.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||ab.fx.stop(),Yb=void 0},ab.fx.timer=function(a){ab.timers.push(a),a()?ab.fx.start():ab.timers.pop()},ab.fx.interval=13,ab.fx.start=function(){Zb||(Zb=setInterval(ab.fx.tick,ab.fx.interval))},ab.fx.stop=function(){clearInterval(Zb),Zb=null},ab.fx.speeds={slow:600,fast:200,_default:400},ab.fn.delay=function(a,b){return a=ab.fx?ab.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=$.createElement("input"),b=$.createElement("select"),c=b.appendChild($.createElement("option"));a.type="checkbox",Z.checkOn=""!==a.value,Z.optSelected=c.selected,b.disabled=!0,Z.optDisabled=!c.disabled,a=$.createElement("input"),a.value="t",a.type="radio",Z.radioValue="t"===a.value}();var dc,ec,fc=ab.expr.attrHandle;ab.fn.extend({attr:function(a,b){return qb(this,ab.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){ab.removeAttr(this,a)})}}),ab.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===zb?ab.prop(a,b,c):(1===f&&ab.isXMLDoc(a)||(b=b.toLowerCase(),d=ab.attrHooks[b]||(ab.expr.match.bool.test(b)?ec:dc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=ab.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void ab.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(nb);if(f&&1===a.nodeType)for(;c=f[e++];)d=ab.propFix[c]||c,ab.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!Z.radioValue&&"radio"===b&&ab.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),ec={set:function(a,b,c){return b===!1?ab.removeAttr(a,c):a.setAttribute(c,c),c}},ab.each(ab.expr.match.bool.source.match(/\w+/g),function(a,b){var c=fc[b]||ab.find.attr;fc[b]=function(a,b,d){var e,f;return d||(f=fc[b],fc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,fc[b]=f),e}});var gc=/^(?:input|select|textarea|button)$/i;ab.fn.extend({prop:function(a,b){return qb(this,ab.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[ab.propFix[a]||a]})}}),ab.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!ab.isXMLDoc(a),f&&(b=ab.propFix[b]||b,e=ab.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||gc.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),Z.optSelected||(ab.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),ab.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ab.propFix[this.toLowerCase()]=this});var hc=/[\t\r\n\f]/g;ab.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(ab.isFunction(a))return this.each(function(b){ab(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(nb)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(hc," "):" ")){for(f=0;e=b[f++];)d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=ab.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(ab.isFunction(a))return this.each(function(b){ab(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(nb)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(hc," "):"")){for(f=0;e=b[f++];)for(;d.indexOf(" "+e+" ")>=0;)d=d.replace(" "+e+" "," ");g=a?ab.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(ab.isFunction(a)?function(c){ab(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c)for(var b,d=0,e=ab(this),f=a.match(nb)||[];b=f[d++];)e.hasClass(b)?e.removeClass(b):e.addClass(b);else(c===zb||"boolean"===c)&&(this.className&&rb.set(this,"__className__",this.className),this.className=this.className||a===!1?"":rb.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(hc," ").indexOf(b)>=0)return!0;return!1}});var ic=/\r/g;ab.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=ab.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,ab(this).val()):a,null==e?e="":"number"==typeof e?e+="":ab.isArray(e)&&(e=ab.map(e,function(a){return null==a?"":a+""})),b=ab.valHooks[this.type]||ab.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=ab.valHooks[e.type]||ab.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(ic,""):null==c?"":c)}}}),ab.extend({valHooks:{select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(Z.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&ab.nodeName(c.parentNode,"optgroup"))){if(b=ab(c).val(),f)return b;g.push(b)}return g},set:function(a,b){for(var c,d,e=a.options,f=ab.makeArray(b),g=e.length;g--;)d=e[g],(d.selected=ab.inArray(ab(d).val(),f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),ab.each(["radio","checkbox"],function(){ab.valHooks[this]={set:function(a,b){return ab.isArray(b)?a.checked=ab.inArray(ab(a).val(),b)>=0:void 0}},Z.checkOn||(ab.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),ab.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){ab.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),ab.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var jc=ab.now(),kc=/\?/;ab.parseJSON=function(a){return JSON.parse(a+"")},ab.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&ab.error("Invalid XML: "+a),b};var lc,mc,nc=/#.*$/,oc=/([?&])_=[^&]*/,pc=/^(.*?):[ \t]*([^\r\n]*)$/gm,qc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rc=/^(?:GET|HEAD)$/,sc=/^\/\//,tc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,uc={},vc={},wc="*/".concat("*");try{mc=location.href}catch(xc){mc=$.createElement("a"),mc.href="",mc=mc.href}lc=tc.exec(mc.toLowerCase())||[],ab.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:mc,type:"GET",isLocal:qc.test(lc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":wc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":ab.parseJSON,"text xml":ab.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?L(L(a,ab.ajaxSettings),b):L(ab.ajaxSettings,a)},ajaxPrefilter:J(uc),ajaxTransport:J(vc),ajax:function(a,b){function c(a,b,c,g){var i,k,r,s,u,w=b;2!==t&&(t=2,h&&clearTimeout(h),d=void 0,f=g||"",v.readyState=a>0?4:0,i=a>=200&&300>a||304===a,c&&(s=M(l,v,c)),s=N(l,s,v,i),i?(l.ifModified&&(u=v.getResponseHeader("Last-Modified"),u&&(ab.lastModified[e]=u),u=v.getResponseHeader("etag"),u&&(ab.etag[e]=u)),204===a||"HEAD"===l.type?w="nocontent":304===a?w="notmodified":(w=s.state,k=s.data,r=s.error,i=!r)):(r=w,(a||!w)&&(w="error",0>a&&(a=0))),v.status=a,v.statusText=(b||w)+"",i?o.resolveWith(m,[k,w,v]):o.rejectWith(m,[v,w,r]),v.statusCode(q),q=void 0,j&&n.trigger(i?"ajaxSuccess":"ajaxError",[v,l,i?k:r]),p.fireWith(m,[v,w]),j&&(n.trigger("ajaxComplete",[v,l]),--ab.active||ab.event.trigger("ajaxStop")))}"object"==typeof a&&(b=a,a=void 0),b=b||{};var d,e,f,g,h,i,j,k,l=ab.ajaxSetup({},b),m=l.context||l,n=l.context&&(m.nodeType||m.jquery)?ab(m):ab.event,o=ab.Deferred(),p=ab.Callbacks("once memory"),q=l.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!g)for(g={};b=pc.exec(f);)g[b[1].toLowerCase()]=b[2];b=g[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return d&&d.abort(b),c(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,l.url=((a||l.url||mc)+"").replace(nc,"").replace(sc,lc[1]+"//"),l.type=b.method||b.type||l.method||l.type,l.dataTypes=ab.trim(l.dataType||"*").toLowerCase().match(nb)||[""],null==l.crossDomain&&(i=tc.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]===lc[1]&&i[2]===lc[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(lc[3]||("http:"===lc[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=ab.param(l.data,l.traditional)),K(uc,l,b,v),2===t)return v;j=l.global,j&&0===ab.active++&&ab.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!rc.test(l.type),e=l.url,l.hasContent||(l.data&&(e=l.url+=(kc.test(e)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=oc.test(e)?e.replace(oc,"$1_="+jc++):e+(kc.test(e)?"&":"?")+"_="+jc++)),l.ifModified&&(ab.lastModified[e]&&v.setRequestHeader("If-Modified-Since",ab.lastModified[e]),ab.etag[e]&&v.setRequestHeader("If-None-Match",ab.etag[e])),(l.data&&l.hasContent&&l.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",l.contentType),v.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+wc+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)v.setRequestHeader(k,l.headers[k]);if(l.beforeSend&&(l.beforeSend.call(m,v,l)===!1||2===t))return v.abort();u="abort";for(k in{success:1,error:1,complete:1})v[k](l[k]);if(d=K(vc,l,b,v)){v.readyState=1,j&&n.trigger("ajaxSend",[v,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){v.abort("timeout")},l.timeout));try{t=1,d.send(r,c)}catch(w){if(!(2>t))throw w;c(-1,w)}}else c(-1,"No Transport");return v},getJSON:function(a,b,c){return ab.get(a,b,c,"json")},getScript:function(a,b){return ab.get(a,void 0,b,"script")}}),ab.each(["get","post"],function(a,b){ab[b]=function(a,c,d,e){return ab.isFunction(c)&&(e=e||d,d=c,c=void 0),ab.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),ab.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){ab.fn[b]=function(a){return this.on(b,a)}}),ab._evalUrl=function(a){return ab.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},ab.fn.extend({wrapAll:function(a){var b;return ab.isFunction(a)?this.each(function(b){ab(this).wrapAll(a.call(this,b))}):(this[0]&&(b=ab(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){for(var a=this;a.firstElementChild;)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(ab.isFunction(a)?function(b){ab(this).wrapInner(a.call(this,b))}:function(){var b=ab(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=ab.isFunction(a);return this.each(function(c){ab(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){ab.nodeName(this,"body")||ab(this).replaceWith(this.childNodes)}).end()}}),ab.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},ab.expr.filters.visible=function(a){return!ab.expr.filters.hidden(a)};var yc=/%20/g,zc=/\[\]$/,Ac=/\r?\n/g,Bc=/^(?:submit|button|image|reset|file)$/i,Cc=/^(?:input|select|textarea|keygen)/i;ab.param=function(a,b){var c,d=[],e=function(a,b){b=ab.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b) };if(void 0===b&&(b=ab.ajaxSettings&&ab.ajaxSettings.traditional),ab.isArray(a)||a.jquery&&!ab.isPlainObject(a))ab.each(a,function(){e(this.name,this.value)});else for(c in a)O(c,a[c],b,e);return d.join("&").replace(yc,"+")},ab.fn.extend({serialize:function(){return ab.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=ab.prop(this,"elements");return a?ab.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!ab(this).is(":disabled")&&Cc.test(this.nodeName)&&!Bc.test(a)&&(this.checked||!yb.test(a))}).map(function(a,b){var c=ab(this).val();return null==c?null:ab.isArray(c)?ab.map(c,function(a){return{name:b.name,value:a.replace(Ac,"\r\n")}}):{name:b.name,value:c.replace(Ac,"\r\n")}}).get()}}),ab.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Dc=0,Ec={},Fc={0:200,1223:204},Gc=ab.ajaxSettings.xhr();a.ActiveXObject&&ab(a).on("unload",function(){for(var a in Ec)Ec[a]()}),Z.cors=!!Gc&&"withCredentials"in Gc,Z.ajax=Gc=!!Gc,ab.ajaxTransport(function(a){var b;return Z.cors||Gc&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Dc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Ec[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Fc[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Ec[g]=b("abort"),f.send(a.hasContent&&a.data||null)},abort:function(){b&&b()}}:void 0}),ab.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return ab.globalEval(a),a}}}),ab.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),ab.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=ab("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),$.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Hc=[],Ic=/(=)\?(?=&|$)|\?\?/;ab.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Hc.pop()||ab.expando+"_"+jc++;return this[a]=!0,a}}),ab.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Ic.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ic.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=ab.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Ic,"$1"+e):b.jsonp!==!1&&(b.url+=(kc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||ab.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Hc.push(e)),g&&ab.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),ab.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||$;var d=gb.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=ab.buildFragment([a],b,e),e&&e.length&&ab(e).remove(),ab.merge([],d.childNodes))};var Jc=ab.fn.load;ab.fn.load=function(a,b,c){if("string"!=typeof a&&Jc)return Jc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=a.slice(h),a=a.slice(0,h)),ab.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&ab.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?ab("<div>").append(ab.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},ab.expr.filters.animated=function(a){return ab.grep(ab.timers,function(b){return a===b.elem}).length};var Kc=a.document.documentElement;ab.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=ab.css(a,"position"),l=ab(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=ab.css(a,"top"),i=ab.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),ab.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},ab.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){ab.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,ab.contains(b,d)?(typeof d.getBoundingClientRect!==zb&&(e=d.getBoundingClientRect()),c=P(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===ab.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),ab.nodeName(a[0],"html")||(d=a.offset()),d.top+=ab.css(a[0],"borderTopWidth",!0),d.left+=ab.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-ab.css(c,"marginTop",!0),left:b.left-d.left-ab.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||Kc;a&&!ab.nodeName(a,"html")&&"static"===ab.css(a,"position");)a=a.offsetParent;return a||Kc})}}),ab.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;ab.fn[b]=function(e){return qb(this,function(b,e,f){var g=P(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),ab.each(["top","left"],function(a,b){ab.cssHooks[b]=w(Z.pixelPosition,function(a,c){return c?(c=v(a,b),Qb.test(c)?ab(a).position()[b]+"px":c):void 0})}),ab.each({Height:"height",Width:"width"},function(a,b){ab.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){ab.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return qb(this,function(b,c,d){var e;return ab.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?ab.css(b,c,g):ab.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),ab.fn.size=function(){return this.length},ab.fn.andSelf=ab.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return ab});var Lc=a.jQuery,Mc=a.$;return ab.noConflict=function(b){return a.$===ab&&(a.$=Mc),b&&a.jQuery===ab&&(a.jQuery=Lc),ab},typeof b===zb&&(a.jQuery=a.$=ab),ab});
simevidas/cdnjs
ajax/libs/foundation-essential/5.2.1/js/vendor/jquery.js
JavaScript
mit
84,587
// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // /*============================================================= ** ** Source: GetDateFormatW_neg.c ** ** Purpose: Negative test the GetDateFormatW API. ** Call GetDateFormatW by passing an invalid parameter ** ** **============================================================*/ #define UNICODE #include <palsuite.h> int __cdecl main(int argc, char *argv[]) { int err; WCHAR *wpFormat; LPCSTR lpString = "gg"; CONST SYSTEMTIME *lpDate = NULL; LCID DefaultLocale; DWORD dwFlags; int DateSize; WCHAR *wpBuffer = NULL; /*Initialize the PAL environment*/ err = PAL_Initialize(argc, argv); if(0 != err) { return FAIL; } /*convert to a wide character string*/ wpFormat = convert((char *)lpString); dwFlags = DATE_USE_ALT_CALENDAR; /*set the flags*/ DateSize = 0; /*retrive the buffer size*/ DateSize = GetDateFormatW( DefaultLocale, /*system default locale*/ dwFlags, /*function option*/ (SYSTEMTIME *)lpDate, /*always is NULL*/ wpFormat, /*pointer to a picture string*/ wpBuffer, /*out buffer*/ DateSize); /*buffer size*/ if(DateSize <= 0) { free(wpFormat); Fail("\nRetrieved an invalid buffer size\n"); } wpBuffer = malloc((DateSize + 1)*sizeof(WCHAR)); if(NULL == wpBuffer) { free(wpFormat); Fail("\nFailed to allocate memory to store the formatted string\n"); } /*format a date by passing an invalid locale indentifier*/ err = GetDateFormatW( -1, /*invalid locale identifier*/ dwFlags, /*function option*/ (SYSTEMTIME *)lpDate, /*always is NULL, or use system date*/ wpFormat, /*pointer to a picture string*/ wpBuffer, /*out buffer*/ DateSize); /*buffer size*/ free(wpBuffer); free(wpFormat); if(0 != err || GetLastError() != ERROR_INVALID_PARAMETER) { Fail("\nFailed to call GetDateFormatW for a negative test by " "passing an invalid parameter, error code=%d\n", GetLastError()); } PAL_Terminate(); return PASS; }
xtypebee/coreclr
src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/GetDateFormatW_neg.c
C
mit
2,465
require "abstract_unit" require "active_support/dependencies" module ActiveSupport module Dependencies class ClassCacheTest < ActiveSupport::TestCase def setup @cache = ClassCache.new end def test_empty? assert @cache.empty? @cache.store(ClassCacheTest) assert !@cache.empty? end def test_clear! assert @cache.empty? @cache.store(ClassCacheTest) assert !@cache.empty? @cache.clear! assert @cache.empty? end def test_set_key @cache.store(ClassCacheTest) assert @cache.key?(ClassCacheTest.name) end def test_get_with_class @cache.store(ClassCacheTest) assert_equal ClassCacheTest, @cache.get(ClassCacheTest) end def test_get_with_name @cache.store(ClassCacheTest) assert_equal ClassCacheTest, @cache.get(ClassCacheTest.name) end def test_get_constantizes assert @cache.empty? assert_equal ClassCacheTest, @cache.get(ClassCacheTest.name) end def test_get_constantizes_fails_on_invalid_names assert @cache.empty? assert_raise NameError do @cache.get("OmgTotallyInvalidConstantName") end end def test_get_alias assert @cache.empty? assert_equal @cache[ClassCacheTest.name], @cache.get(ClassCacheTest.name) end def test_safe_get_constantizes assert @cache.empty? assert_equal ClassCacheTest, @cache.safe_get(ClassCacheTest.name) end def test_safe_get_constantizes_doesnt_fail_on_invalid_names assert @cache.empty? assert_nil @cache.safe_get("OmgTotallyInvalidConstantName") end def test_new_rejects_strings @cache.store ClassCacheTest.name assert !@cache.key?(ClassCacheTest.name) end def test_store_returns_self x = @cache.store ClassCacheTest assert_equal @cache, x end end end end
xlymian/rails
activesupport/test/class_cache_test.rb
Ruby
mit
2,009
<?php /** * This class takes care of all form related functionality * * Do not interact with this class directly, use `mc4wp_form` functions tagged with @access public instead. * * @class MC4WP_Form_Manager * @ignore * @access private */ class MC4WP_Form_Manager { /** * @var MC4WP_Form_Output_Manager */ protected $output_manager; /** * @var MC4WP_Form_Listener */ protected $listener; /** * @var MC4WP_Form_Tags */ protected $tags; /** * Constructor */ public function __construct() { $this->output_manager = new MC4WP_Form_Output_Manager(); $this->tags = new MC4WP_Form_Tags(); } /** * Hook! */ public function add_hooks() { add_action( 'init', array( $this, 'initialize' ) ); // forms add_action( 'wp_enqueue_scripts', array( $this, 'init_asset_manager' ), 1 ); add_action( 'template_redirect', array( 'MC4WP_Form_Previewer', 'init' ) ); // widget add_action( 'widgets_init', array( $this, 'register_widget' ) ); $this->output_manager->add_hooks(); $this->tags->add_hooks(); } /** * Initialize */ public function initialize() { $this->register_post_type(); $this->init_form_listener(); } /** * Register post type "mc4wp-form" */ public function register_post_type() { // register post type register_post_type( 'mc4wp-form', array( 'labels' => array( 'name' => 'MailChimp Sign-up Forms', 'singular_name' => 'Sign-up Form', 'add_new_item' => 'Add New Form', 'edit_item' => 'Edit Form', 'new_item' => 'New Form', 'all_items' => 'All Forms', 'view_item' => null ), 'public' => false ) ); } /** * Initialise the form listener * * @hooked `init` */ public function init_form_listener() { $request = $this->get_request(); $this->listener = new MC4WP_Form_Listener(); $this->listener->listen( $request ); } /** * Initialise asset manager * * @hooked `template_redirect` */ public function init_asset_manager() { $assets = new MC4WP_Form_Asset_Manager(); $assets->hook(); } /** * Register our Form widget */ public function register_widget() { register_widget( 'MC4WP_Form_Widget' ); } /** * @param $form_id * @param array $config * @param bool $echo * * @return string */ public function output_form( $form_id, $config = array(), $echo = true ) { return $this->output_manager->output_form( $form_id, $config, $echo ); } /** * Gets the currently submitted form * * @return MC4WP_Form|null */ public function get_submitted_form() { if( $this->listener->submitted_form instanceof MC4WP_Form ) { return $this->listener->submitted_form; } return null; } /** * Return all tags * * @return array */ public function get_tags() { return $this->tags->get(); } /** * @return MC4WP_Request */ private function get_request() { return mc4wp('request'); } }
smpetrey/adhoc.is
web/app/plugins/mailchimp-for-wp/includes/forms/class-form-manager.php
PHP
mit
2,901
# ############################################################################ # # Copyright (c) Microsoft Corporation. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of this distribution. If # you cannot locate the Apache License, Version 2.0, please send an email to # vspython@microsoft.com. By using this source code in any fashion, you are agreeing to be bound # by the terms of the Apache License, Version 2.0. # # You must not remove this notice, or any other, from this software. # # ########################################################################### __all__ = ['enable_attach', 'wait_for_attach', 'break_into_debugger', 'settrace', 'is_attached', 'AttachAlreadyEnabledError'] import atexit import getpass import os import os.path import platform import socket import struct import sys import threading try: import thread except ImportError: import _thread as thread try: import ssl except ImportError: ssl = None import ptvsd.visualstudio_py_debugger as vspd import ptvsd.visualstudio_py_repl as vspr from ptvsd.visualstudio_py_util import to_bytes, read_bytes, read_int, read_string, write_bytes, write_int, write_string # The server (i.e. the Python app) waits on a TCP port provided. Whenever anything connects to that port, # it immediately sends the octet sequence 'PTVSDBG', followed by version number represented as int64, # and then waits for the client to respond with the same exact byte sequence. After signatures are thereby # exchanged and found to match, the client is expected to provide a string secret (in the usual debugger # string format, None/ACII/Unicode prefix + length + data), which can be an empty string to designate the # lack of a specified secret. # # If the secret does not match the one expected by the server, it responds with 'RJCT', and then closes # the connection. Otherwise, the server responds with 'ACPT', and awaits a 4-octet command. The following # commands are recognized: # # 'INFO' # Report information about the process. The server responds with the following information, in order: # - Process ID (int64) # - Executable name (string) # - User name (string) # - Implementation name (string) # and then immediately closes connection. Note, all string fields can be empty or null strings. # # 'ATCH' # Attach debugger to the process. If successful, the server responds with 'ACPT', followed by process ID # (int64), and then the Python language version that the server is running represented by three int64s - # major, minor, micro; From there on the socket is assumed to be using the normal PTVS debugging protocol. # If attaching was not successful (which can happen if some other debugger is already attached), the server # responds with 'RJCT' and closes the connection. # # 'REPL' # Attach REPL to the process. If successful, the server responds with 'ACPT', and from there on the socket # is assumed to be using the normal PTVS REPL protocol. If not successful (which can happen if there is # no debugger attached), the server responds with 'RJCT' and closes the connection. PTVS_VER = '2.2' DEFAULT_PORT = 5678 PTVSDBG_VER = 6 # must be kept in sync with DebuggerProtocolVersion in PythonRemoteProcess.cs PTVSDBG = to_bytes('PTVSDBG') ACPT = to_bytes('ACPT') RJCT = to_bytes('RJCT') INFO = to_bytes('INFO') ATCH = to_bytes('ATCH') REPL = to_bytes('REPL') _attach_enabled = False _attached = threading.Event() vspd.DONT_DEBUG.append(os.path.normcase(__file__)) class AttachAlreadyEnabledError(Exception): """`ptvsd.enable_attach` has already been called in this process.""" def enable_attach(secret, address = ('0.0.0.0', DEFAULT_PORT), certfile = None, keyfile = None, redirect_output = True): """Enables Python Tools for Visual Studio to attach to this process remotely to debug Python code. Parameters ---------- secret : str Used to validate the clients - only those clients providing the valid secret will be allowed to connect to this server. On client side, the secret is prepended to the Qualifier string, separated from the hostname by ``'@'``, e.g.: ``'secret@myhost.cloudapp.net:5678'``. If secret is ``None``, there's no validation, and any client can connect freely. address : (str, int), optional Specifies the interface and port on which the debugging server should listen for TCP connections. It is in the same format as used for regular sockets of the `socket.AF_INET` family, i.e. a tuple of ``(hostname, port)``. On client side, the server is identified by the Qualifier string in the usual ``'hostname:port'`` format, e.g.: ``'myhost.cloudapp.net:5678'``. Default is ``('0.0.0.0', 5678)``. certfile : str, optional Used to enable SSL. If not specified, or if set to ``None``, the connection between this program and the debugger will be unsecure, and can be intercepted on the wire. If specified, the meaning of this parameter is the same as for `ssl.wrap_socket`. keyfile : str, optional Used together with `certfile` when SSL is enabled. Its meaning is the same as for ``ssl.wrap_socket``. redirect_output : bool, optional Specifies whether any output (on both `stdout` and `stderr`) produced by this program should be sent to the debugger. Default is ``True``. Notes ----- This function returns immediately after setting up the debugging server, and does not block program execution. If you need to block until debugger is attached, call `ptvsd.wait_for_attach`. The debugger can be detached and re-attached multiple times after `enable_attach` is called. This function can only be called once during the lifetime of the process. On a second call, `AttachAlreadyEnabledError` is raised. In circumstances where the caller does not control how many times the function will be called (e.g. when a script with a single call is run more than once by a hosting app or framework), the call should be wrapped in ``try..except``. Only the thread on which this function is called, and any threads that are created after it returns, will be visible in the debugger once it is attached. Any threads that are already running before this function is called will not be visible. """ if not ssl and (certfile or keyfile): raise ValueError('could not import the ssl module - SSL is not supported on this version of Python') if sys.platform == 'cli': # Check that IronPython was launched with -X:Frames and -X:Tracing, since we can't register our trace # func on the thread that calls enable_attach otherwise import clr x_tracing = clr.GetCurrentRuntime().GetLanguageByExtension('py').Options.Tracing x_frames = clr.GetCurrentRuntime().GetLanguageByExtension('py').Options.Frames if not x_tracing or not x_frames: raise RuntimeError('IronPython must be started with -X:Tracing and -X:Frames options to support PTVS remote debugging.') global _attach_enabled if _attach_enabled: raise AttachAlreadyEnabledError('ptvsd.enable_attach() has already been called in this process.') _attach_enabled = True atexit.register(vspd.detach_process_and_notify_debugger) server = socket.socket() server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) server.bind(address) server.listen(1) def server_thread_func(): while True: client = None raw_client = None try: client, addr = server.accept() if certfile: client = ssl.wrap_socket(client, server_side = True, ssl_version = ssl.PROTOCOL_TLSv1, certfile = certfile, keyfile = keyfile) write_bytes(client, PTVSDBG) write_int(client, PTVSDBG_VER) response = read_bytes(client, 7) if response != PTVSDBG: continue dbg_ver = read_int(client) if dbg_ver != PTVSDBG_VER: continue client_secret = read_string(client) if secret is None or secret == client_secret: write_bytes(client, ACPT) else: write_bytes(client, RJCT) continue response = read_bytes(client, 4) if response == INFO: try: pid = os.getpid() except AttributeError: pid = 0 write_int(client, pid) exe = sys.executable or '' write_string(client, exe) try: username = getpass.getuser() except AttributeError: username = '' write_string(client, username) try: impl = platform.python_implementation() except AttributeError: try: impl = sys.implementation.name except AttributeError: impl = 'Python' major, minor, micro, release_level, serial = sys.version_info os_and_arch = platform.system() if os_and_arch == "": os_and_arch = sys.platform try: if sys.maxsize > 2**32: os_and_arch += ' 64-bit' else: os_and_arch += ' 32-bit' except AttributeError: pass version = '%s %s.%s.%s (%s)' % (impl, major, minor, micro, os_and_arch) write_string(client, version) # Don't just drop the connection - let the debugger close it after it finishes reading. client.recv(1) elif response == ATCH: debug_options = vspd.parse_debug_options(read_string(client)) if redirect_output: debug_options.add('RedirectOutput') if vspd.DETACHED: write_bytes(client, ACPT) try: pid = os.getpid() except AttributeError: pid = 0 write_int(client, pid) major, minor, micro, release_level, serial = sys.version_info write_int(client, major) write_int(client, minor) write_int(client, micro) vspd.attach_process_from_socket(client, debug_options, report = True) vspd.mark_all_threads_for_break(vspd.STEPPING_ATTACH_BREAK) _attached.set() client = None else: write_bytes(client, RJCT) elif response == REPL: if not vspd.DETACHED: write_bytes(client, ACPT) vspd.connect_repl_using_socket(client) client = None else: write_bytes(client, RJCT) except (socket.error, OSError): pass finally: if client is not None: client.close() server_thread = threading.Thread(target = server_thread_func) server_thread.setDaemon(True) server_thread.start() frames = [] f = sys._getframe() while True: f = f.f_back if f is None: break frames.append(f) frames.reverse() cur_thread = vspd.new_thread() for f in frames: cur_thread.push_frame(f) def replace_trace_func(): for f in frames: f.f_trace = cur_thread.trace_func replace_trace_func() sys.settrace(cur_thread.trace_func) vspd.intercept_threads(for_attach = True) # Alias for convenience of users of pydevd settrace = enable_attach def wait_for_attach(timeout = None): """If a PTVS remote debugger is attached, returns immediately. Otherwise, blocks until a remote debugger attaches to this process, or until the optional timeout occurs. Parameters ---------- timeout : float, optional The timeout for the operation in seconds (or fractions thereof). """ if vspd.DETACHED: _attached.clear() _attached.wait(timeout) def break_into_debugger(): """If a PTVS remote debugger is attached, pauses execution of all threads, and breaks into the debugger with current thread as active. """ if not vspd.DETACHED: vspd.SEND_BREAK_COMPLETE = thread.get_ident() vspd.mark_all_threads_for_break() def is_attached(): """Returns ``True`` if debugger is attached, ``False`` otherwise.""" return not vspd.DETACHED
humanoidrobot/INFDEV01-6B
INFDEV01-6B/INFDEV01-6B/obj/Debug/attach_server.py
Python
mit
13,354
/*! jQuery v2.1.0 -ajax,-ajax/jsonp,-ajax/load,-ajax/parseJSON,-ajax/parseXML,-ajax/script,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-css,-css/addGetHookIf,-css/curCSS,-css/defaultDisplay,-css/hiddenVisibleSelectors,-css/support,-css/swap,-css/var/cssExpand,-css/var/getStyles,-css/var/isHidden,-css/var/rmargin,-css/var/rnumnonpx,-effects,-effects/Tween,-effects/animatedSelector,-dimensions,-offset,-event-alias | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m=a.document,n="2.1.0 -ajax,-ajax/jsonp,-ajax/load,-ajax/parseJSON,-ajax/parseXML,-ajax/script,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-css,-css/addGetHookIf,-css/curCSS,-css/defaultDisplay,-css/hiddenVisibleSelectors,-css/support,-css/swap,-css/var/cssExpand,-css/var/getStyles,-css/var/isHidden,-css/var/rmargin,-css/var/rnumnonpx,-effects,-effects/Tween,-effects/animatedSelector,-dimensions,-offset,-event-alias",o=function(a,b){return new o.fn.init(a,b)},p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};o.fn=o.prototype={jquery:n,constructor:o,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=o.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return o.each(this,a,b)},map:function(a){return this.pushStack(o.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},o.extend=o.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||o.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(o.isPlainObject(d)||(e=o.isArray(d)))?(e?(e=!1,f=c&&o.isArray(c)?c:[]):f=c&&o.isPlainObject(c)?c:{},g[b]=o.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},o.extend({expando:"jQuery"+(n+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===o.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isPlainObject:function(a){if("object"!==o.type(a)||a.nodeType||o.isWindow(a))return!1;try{if(a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}return!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=o.trim(a),a&&(1===a.indexOf("use strict")?(b=m.createElement("script"),b.text=a,m.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":k.call(a)},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?o.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),o.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||o.guid++,f):void 0},now:Date.now,support:l}),o.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=o.type(a);return"function"===c||o.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=a.document.documentElement,u,v=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.msMatchesSelector,w=function(a,b){if(a===b)return u=!0,0;var c=b.compareDocumentPosition&&a.compareDocumentPosition&&a.compareDocumentPosition(b);return c?1&c?a===m||o.contains(m,a)?-1:b===m||o.contains(m,b)?1:0:4&c?-1:1:a.compareDocumentPosition?-1:1};o.extend({find:function(a,b,c,d){var e,f,g=0;if(c=c||[],b=b||m,!a||"string"!=typeof a)return c;if(1!==(f=b.nodeType)&&9!==f)return[];if(d)while(e=d[g++])o.find.matchesSelector(e,a)&&c.push(e);else o.merge(c,b.querySelectorAll(a));return c},unique:function(a){var b,c=[],d=0,e=0;if(u=!1,a.sort(w),u){while(b=a[d++])b===a[d]&&(e=c.push(d));while(e--)a.splice(c[e],1)}return a},text:function(a){var b,c="",d=0,e=a.nodeType;if(e){if(1===e||9===e||11===e)return a.textContent;if(3===e||4===e)return a.nodeValue}else while(b=a[d++])c+=o.text(b);return c},contains:function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!c.contains(d))},isXMLDoc:function(a){return"HTML"!==(a.ownerDocument||a).documentElement.nodeName},expr:{attrHandle:{},match:{bool:/^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i,needsContext:/^[\x20\t\r\n\f]*[>+~]/}}}),o.extend(o.find,{matches:function(a,b){return o.find(a,null,null,b)},matchesSelector:function(a,b){return v.call(a,b)},attr:function(a,b){return a.getAttribute(b)}});var x=o.expr.match.needsContext,y=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,z=/^.[^:#\[\.,]*$/;function A(a,b,c){if(o.isFunction(b))return o.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return o.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(z.test(b))return o.filter(b,a,c);b=o.filter(b,a)}return o.grep(a,function(a){return g.call(b,a)>=0!==c})}o.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?o.find.matchesSelector(d,a)?[d]:[]:o.find.matches(a,o.grep(b,function(a){return 1===a.nodeType}))},o.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(o(a).filter(function(){for(b=0;c>b;b++)if(o.contains(e[b],this))return!0}));for(b=0;c>b;b++)o.find(a,e[b],d);return d=this.pushStack(c>1?o.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(A(this,a||[],!1))},not:function(a){return this.pushStack(A(this,a||[],!0))},is:function(a){return!!A(this,"string"==typeof a&&x.test(a)?o(a):a||[],!1).length}});var B,C=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,D=o.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:C.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||B).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof o?b[0]:b,o.merge(this,o.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:m,!0)),y.test(c[1])&&o.isPlainObject(b))for(c in b)o.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=m.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=m,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):o.isFunction(a)?"undefined"!=typeof B.ready?B.ready(a):a(o):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),o.makeArray(a,this))};D.prototype=o.fn,B=o(m);var E=/^(?:parents|prev(?:Until|All))/,F={children:!0,contents:!0,next:!0,prev:!0};o.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&o(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),o.fn.extend({has:function(a){var b=o(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(o.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=x.test(a)||"string"!=typeof a?o(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&o.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?o.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(o(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(o.unique(o.merge(this.get(),o(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function G(a,b){while((a=a[b])&&1!==a.nodeType);return a}o.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return o.dir(a,"parentNode")},parentsUntil:function(a,b,c){return o.dir(a,"parentNode",c)},next:function(a){return G(a,"nextSibling")},prev:function(a){return G(a,"previousSibling")},nextAll:function(a){return o.dir(a,"nextSibling")},prevAll:function(a){return o.dir(a,"previousSibling")},nextUntil:function(a,b,c){return o.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return o.dir(a,"previousSibling",c)},siblings:function(a){return o.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return o.sibling(a.firstChild)},contents:function(a){return a.contentDocument||o.merge([],a.childNodes)}},function(a,b){o.fn[a]=function(c,d){var e=o.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=o.filter(d,e)),this.length>1&&(F[a]||o.unique(e),E.test(a)&&e.reverse()),this.pushStack(e)}});var H=/\S+/g,I={};function J(a){var b=I[a]={};return o.each(a.match(H)||[],function(a,c){b[c]=!0}),b}o.Callbacks=function(a){a="string"==typeof a?I[a]||J(a):o.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){o.each(b,function(b,c){var d=o.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&o.each(arguments,function(a,b){var c;while((c=o.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?o.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},o.extend({Deferred:function(a){var b=[["resolve","done",o.Callbacks("once memory"),"resolved"],["reject","fail",o.Callbacks("once memory"),"rejected"],["notify","progress",o.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return o.Deferred(function(c){o.each(b,function(b,f){var g=o.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&o.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?o.extend(a,d):d}},e={};return d.pipe=d.then,o.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&o.isFunction(a.promise)?e:0,g=1===f?a:o.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&o.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var K;o.fn.ready=function(a){return o.ready.promise().done(a),this},o.extend({isReady:!1,readyWait:1,holdReady:function(a){a?o.readyWait++:o.ready(!0)},ready:function(a){(a===!0?--o.readyWait:o.isReady)||(o.isReady=!0,a!==!0&&--o.readyWait>0||(K.resolveWith(m,[o]),o.fn.trigger&&o(m).trigger("ready").off("ready")))}});function L(){m.removeEventListener("DOMContentLoaded",L,!1),a.removeEventListener("load",L,!1),o.ready()}o.ready.promise=function(b){return K||(K=o.Deferred(),"complete"===m.readyState?setTimeout(o.ready):(m.addEventListener("DOMContentLoaded",L,!1),a.addEventListener("load",L,!1))),K.promise(b)},o.ready.promise();var M=o.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===o.type(c)){e=!0;for(h in c)o.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,o.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(o(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};o.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function N(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=o.expando+Math.random()}N.uid=1,N.accepts=o.acceptData,N.prototype={key:function(a){if(!N.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=N.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,o.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(o.isEmptyObject(f))o.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,o.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{o.isArray(b)?d=b.concat(b.map(o.camelCase)):(e=o.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(H)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!o.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var O=new N,P=new N,Q=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,R=/([A-Z])/g;function S(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(R,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:Q.test(c)?o.parseJSON(c):c}catch(e){}P.set(a,b,c)}else c=void 0;return c}o.extend({hasData:function(a){return P.hasData(a)||O.hasData(a)},data:function(a,b,c){return P.access(a,b,c)},removeData:function(a,b){P.remove(a,b)},_data:function(a,b,c){return O.access(a,b,c)},_removeData:function(a,b){O.remove(a,b)}}),o.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=P.get(f),1===f.nodeType&&!O.get(f,"hasDataAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=o.camelCase(d.slice(5)),S(f,d,e[d]));O.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){P.set(this,a)}):M(this,function(b){var c,d=o.camelCase(a);if(f&&void 0===b){if(c=P.get(f,a),void 0!==c)return c;if(c=P.get(f,d),void 0!==c)return c;if(c=S(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=P.get(this,d);P.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&P.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){P.remove(this,a)})}}),o.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=O.get(a,b),c&&(!d||o.isArray(c)?d=O.access(a,b,o.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=o.queue(a,b),d=c.length,e=c.shift(),f=o._queueHooks(a,b),g=function(){o.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return O.get(a,c)||O.access(a,c,{empty:o.Callbacks("once memory").add(function(){O.remove(a,[b+"queue",c])})})}}),o.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?o.queue(this[0],a):void 0===b?this:this.each(function(){var c=o.queue(this,a,b);o._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&o.dequeue(this,a)})},dequeue:function(a){return this.each(function(){o.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=o.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=O.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=/^(?:checkbox|radio)$/i;!function(){var a=m.createDocumentFragment(),b=a.appendChild(m.createElement("div"));b.innerHTML="<input type='radio' checked='checked' name='t'/>",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var V="undefined";l.focusinBubbles="onfocusin"in a;var W=/^key/,X=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=/^([^.]*)(?:\.(.+)|)$/;function $(){return!0}function _(){return!1}function ab(){try{return m.activeElement}catch(a){}}o.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,p,q,r=O.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=o.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof o!==V&&o.event.triggered!==b.type?o.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(H)||[""],j=b.length;while(j--)h=Z.exec(b[j])||[],n=q=h[1],p=(h[2]||"").split(".").sort(),n&&(l=o.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=o.event.special[n]||{},k=o.extend({type:n,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&o.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(n,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),o.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,p,q,r=O.hasData(a)&&O.get(a);if(r&&(i=r.events)){b=(b||"").match(H)||[""],j=b.length;while(j--)if(h=Z.exec(b[j])||[],n=q=h[1],p=(h[2]||"").split(".").sort(),n){l=o.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||o.removeEvent(a,n,r.handle),delete i[n])}else for(n in i)o.event.remove(a,n+b[j],c,d,!0);o.isEmptyObject(i)&&(delete r.handle,O.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,p=[d||m],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||m,3!==d.nodeType&&8!==d.nodeType&&!Y.test(q+o.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[o.expando]?b:new o.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:o.makeArray(c,[b]),n=o.event.special[q]||{},e||!n.trigger||n.trigger.apply(d,c)!==!1)){if(!e&&!n.noBubble&&!o.isWindow(d)){for(i=n.delegateType||q,Y.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||m)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:n.bindType||q,l=(O.get(g,"events")||{})[b.type]&&O.get(g,"handle"),l&&l.apply(g,c),l=k&&g[k],l&&l.apply&&o.acceptData(g)&&(b.result=l.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||n._default&&n._default.apply(p.pop(),c)!==!1||!o.acceptData(d)||k&&o.isFunction(d[q])&&!o.isWindow(d)&&(h=d[k],h&&(d[k]=null),o.event.triggered=q,d[q](),o.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=o.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(O.get(this,"events")||{})[a.type]||[],k=o.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=o.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((o.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?o(e,this).index(i)>=0:o.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||m,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[o.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=X.test(e)?this.mouseHooks:W.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new o.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=m),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==ab()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===ab()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&o.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return o.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=o.extend(new o.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?o.event.trigger(e,null,b):o.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},o.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},o.Event=function(a,b){return this instanceof o.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.getPreventDefault&&a.getPreventDefault()?$:_):this.type=a,b&&o.extend(this,b),this.timeStamp=a&&a.timeStamp||o.now(),void(this[o.expando]=!0)):new o.Event(a,b)},o.Event.prototype={isDefaultPrevented:_,isPropagationStopped:_,isImmediatePropagationStopped:_,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=$,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=$,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=$,this.stopPropagation()}},o.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){o.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!o.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.focusinBubbles||o.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){o.event.simulate(b,a.target,o.event.fix(a),!0)};o.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=O.access(d,b);e||d.addEventListener(a,c,!0),O.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=O.access(d,b)-1;e?O.access(d,b,e):(d.removeEventListener(a,c,!0),O.remove(d,b))}}}),o.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=_;else if(!d)return this;return 1===e&&(f=d,d=function(a){return o().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=o.guid++)),this.each(function(){o.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,o(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=_),this.each(function(){o.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){o.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?o.event.trigger(a,b,c,!0):void 0}});var bb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,cb=/<([\w:]+)/,db=/<|&#?\w+;/,eb=/<(?:script|style|link)/i,fb=/checked\s*(?:[^=]|=\s*.checked.)/i,gb=/^$|\/(?:java|ecma)script/i,hb=/^true\/(.*)/,ib=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,jb={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};jb.optgroup=jb.option,jb.tbody=jb.tfoot=jb.colgroup=jb.caption=jb.thead,jb.th=jb.td;function kb(a,b){return o.nodeName(a,"table")&&o.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function lb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function mb(a){var b=hb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function nb(a,b){for(var c=0,d=a.length;d>c;c++)O.set(a[c],"globalEval",!b||O.get(b[c],"globalEval"))}function ob(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(O.hasData(a)&&(f=O.access(a),g=O.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)o.event.add(b,e,j[e][c])}P.hasData(a)&&(h=P.access(a),i=o.extend({},h),P.set(b,i))}}function pb(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&o.nodeName(a,b)?o.merge([a],c):c}function qb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&U.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}o.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=o.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||o.isXMLDoc(a)))for(g=pb(h),f=pb(a),d=0,e=f.length;e>d;d++)qb(f[d],g[d]);if(b)if(c)for(f=f||pb(a),g=g||pb(h),d=0,e=f.length;e>d;d++)ob(f[d],g[d]);else ob(a,h);return g=pb(h,"script"),g.length>0&&nb(g,!i&&pb(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,n=a.length;n>m;m++)if(e=a[m],e||0===e)if("object"===o.type(e))o.merge(l,e.nodeType?[e]:e);else if(db.test(e)){f=f||k.appendChild(b.createElement("div")),g=(cb.exec(e)||["",""])[1].toLowerCase(),h=jb[g]||jb._default,f.innerHTML=h[1]+e.replace(bb,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;o.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===o.inArray(e,d))&&(i=o.contains(e.ownerDocument,e),f=pb(k.appendChild(e),"script"),i&&nb(f),c)){j=0;while(e=f[j++])gb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f,g,h=o.event.special,i=0;void 0!==(c=a[i]);i++){if(o.acceptData(c)&&(f=c[O.expando],f&&(b=O.cache[f]))){if(d=Object.keys(b.events||{}),d.length)for(g=0;void 0!==(e=d[g]);g++)h[e]?o.event.remove(c,e):o.removeEvent(c,e,b.handle);O.cache[f]&&delete O.cache[f]}delete P.cache[c[P.expando]]}}}),o.fn.extend({text:function(a){return M(this,function(a){return void 0===a?o.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=kb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=kb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?o.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||o.cleanData(pb(c)),c.parentNode&&(b&&o.contains(c.ownerDocument,c)&&nb(pb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(o.cleanData(pb(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return o.clone(this,a,b)})},html:function(a){return M(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!eb.test(a)&&!jb[(cb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bb,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(o.cleanData(pb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,o.cleanData(pb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,n=k-1,p=a[0],q=o.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&fb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(c=o.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=o.map(pb(c,"script"),lb),g=f.length;k>j;j++)h=c,j!==n&&(h=o.clone(h,!0,!0),g&&o.merge(f,pb(h,"script"))),b.call(this[j],h,j); if(g)for(i=f[f.length-1].ownerDocument,o.map(f,mb),j=0;g>j;j++)h=f[j],gb.test(h.type||"")&&!O.access(h,"globalEval")&&o.contains(i,h)&&(h.src?o._evalUrl&&o._evalUrl(h.src):o.globalEval(h.textContent.replace(ib,"")))}return this}}),o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){o.fn[a]=function(a){for(var c,d=[],e=o(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),o(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}}),o.fn.delay=function(a,b){return a=o.fx?o.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=m.createElement("input"),b=m.createElement("select"),c=b.appendChild(m.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=m.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var rb,sb,tb=o.expr.attrHandle;o.fn.extend({attr:function(a,b){return M(this,o.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){o.removeAttr(this,a)})}}),o.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===V?o.prop(a,b,c):(1===f&&o.isXMLDoc(a)||(b=b.toLowerCase(),d=o.attrHooks[b]||(o.expr.match.bool.test(b)?sb:rb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=o.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void o.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(H);if(f&&1===a.nodeType)while(c=f[e++])d=o.propFix[c]||c,o.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&o.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),sb={set:function(a,b,c){return b===!1?o.removeAttr(a,c):a.setAttribute(c,c),c}},o.each(o.expr.match.bool.source.match(/\w+/g),function(a,b){var c=tb[b]||o.find.attr;tb[b]=function(a,b,d){var e,f;return d||(f=tb[b],tb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,tb[b]=f),e}});var ub=/^(?:input|select|textarea|button)$/i;o.fn.extend({prop:function(a,b){return M(this,o.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[o.propFix[a]||a]})}}),o.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!o.isXMLDoc(a),f&&(b=o.propFix[b]||b,e=o.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||ub.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),l.optSelected||(o.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),o.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){o.propFix[this.toLowerCase()]=this});var vb=/[\t\r\n\f]/g;o.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(o.isFunction(a))return this.each(function(b){o(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(H)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vb," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=o.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(o.isFunction(a))return this.each(function(b){o(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(H)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vb," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?o.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(o.isFunction(a)?function(c){o(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=o(this),f=a.match(H)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===V||"boolean"===c)&&(this.className&&O.set(this,"__className__",this.className),this.className=this.className||a===!1?"":O.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(vb," ").indexOf(b)>=0)return!0;return!1}});var wb=/\r/g;o.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=o.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,o(this).val()):a,null==e?e="":"number"==typeof e?e+="":o.isArray(e)&&(e=o.map(e,function(a){return null==a?"":a+""})),b=o.valHooks[this.type]||o.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=o.valHooks[e.type]||o.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(wb,""):null==c?"":c)}}}),o.extend({valHooks:{select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(l.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&o.nodeName(c.parentNode,"optgroup"))){if(b=o(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=o.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=o.inArray(o(d).val(),f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),o.each(["radio","checkbox"],function(){o.valHooks[this]={set:function(a,b){return o.isArray(b)?a.checked=o.inArray(o(a).val(),b)>=0:void 0}},l.checkOn||(o.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),o.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){o.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),o.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),o.fn.extend({wrapAll:function(a){var b;return o.isFunction(a)?this.each(function(b){o(this).wrapAll(a.call(this,b))}):(this[0]&&(b=o(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(o.isFunction(a)?function(b){o(this).wrapInner(a.call(this,b))}:function(){var b=o(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=o.isFunction(a);return this.each(function(c){o(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){o.nodeName(this,"body")||o(this).replaceWith(this.childNodes)}).end()}});var xb=/%20/g,yb=/\[\]$/,zb=/\r?\n/g,Ab=/^(?:submit|button|image|reset|file)$/i,Bb=/^(?:input|select|textarea|keygen)/i;function Cb(a,b,c,d){var e;if(o.isArray(b))o.each(b,function(b,e){c||yb.test(a)?d(a,e):Cb(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==o.type(b))d(a,b);else for(e in b)Cb(a+"["+e+"]",b[e],c,d)}o.param=function(a,b){var c,d=[],e=function(a,b){b=o.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=o.ajaxSettings&&o.ajaxSettings.traditional),o.isArray(a)||a.jquery&&!o.isPlainObject(a))o.each(a,function(){e(this.name,this.value)});else for(c in a)Cb(c,a[c],b,e);return d.join("&").replace(xb,"+")},o.fn.extend({serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=o.prop(this,"elements");return a?o.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!o(this).is(":disabled")&&Bb.test(this.nodeName)&&!Ab.test(a)&&(this.checked||!U.test(a))}).map(function(a,b){var c=o(this).val();return null==c?null:o.isArray(c)?o.map(c,function(a){return{name:b.name,value:a.replace(zb,"\r\n")}}):{name:b.name,value:c.replace(zb,"\r\n")}}).get()}}),o.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||m;var d=y.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=o.buildFragment([a],b,e),e&&e.length&&o(e).remove(),o.merge([],d.childNodes))},o.fn.size=function(){return this.length},o.fn.andSelf=o.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return o});var Db=a.jQuery,Eb=a.$;return o.noConflict=function(b){return a.$===o&&(a.$=Eb),b&&a.jQuery===o&&(a.jQuery=Db),o},typeof b===V&&(a.jQuery=a.$=o),o}); //# sourceMappingURL=jquery.min.map
eric-seekas/jquery-builder
dist/2.1.0/jquery-ajax-css-dimensions-effects-event-alias-offset-sizzle.min.js
JavaScript
mit
41,898
// Copyright 2013 The Closure Library Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS-IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ////////////////////////// NOTE ABOUT EDITING THIS FILE /////////////////////// // // // Any edits to this file must be applied to mat3d.js by running: // // swap_type.sh mat3f.js > mat3d.js // // // ////////////////////////// NOTE ABOUT EDITING THIS FILE /////////////////////// /** * @fileoverview Provides functions for operating on 3x3 float (32bit) * matrices. The matrices are stored in column-major order. * * The last parameter will typically be the output object and an object * can be both an input and output parameter to all methods except where * noted. * * See the README for notes about the design and structure of the API * (especially related to performance). * */ goog.provide('goog.vec.mat3f'); goog.provide('goog.vec.mat3f.Type'); goog.require('goog.vec'); /** @typedef {goog.vec.Float32} */ goog.vec.mat3f.Type; /** * Creates a mat3f with all elements initialized to zero. * * @return {!goog.vec.mat3f.Type} The new mat3f. */ goog.vec.mat3f.create = function() { return new Float32Array(9); }; /** * Creates a mat3f identity matrix. * * @return {!goog.vec.mat3f.Type} The new mat3f. */ goog.vec.mat3f.createIdentity = function() { var mat = goog.vec.mat3f.create(); mat[0] = mat[4] = mat[8] = 1; return mat; }; /** * Initializes the matrix from the set of values. Note the values supplied are * in column major order. * * @param {!goog.vec.mat3f.Type} mat The matrix to receive the * values. * @param {number} v00 The values at (0, 0). * @param {number} v10 The values at (1, 0). * @param {number} v20 The values at (2, 0). * @param {number} v01 The values at (0, 1). * @param {number} v11 The values at (1, 1). * @param {number} v21 The values at (2, 1). * @param {number} v02 The values at (0, 2). * @param {number} v12 The values at (1, 2). * @param {number} v22 The values at (2, 2). * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained together. */ goog.vec.mat3f.setFromValues = function( mat, v00, v10, v20, v01, v11, v21, v02, v12, v22) { mat[0] = v00; mat[1] = v10; mat[2] = v20; mat[3] = v01; mat[4] = v11; mat[5] = v21; mat[6] = v02; mat[7] = v12; mat[8] = v22; return mat; }; /** * Initializes mat3f mat from mat3f src. * * @param {!goog.vec.mat3f.Type} mat The destination matrix. * @param {!goog.vec.mat3f.Type} src The source matrix. * @return {!goog.vec.mat3f.Type} Return mat so that operations can be * chained together. */ goog.vec.mat3f.setFromMat3f = function(mat, src) { mat[0] = src[0]; mat[1] = src[1]; mat[2] = src[2]; mat[3] = src[3]; mat[4] = src[4]; mat[5] = src[5]; mat[6] = src[6]; mat[7] = src[7]; mat[8] = src[8]; return mat; }; /** * Initializes mat3f mat from mat3d src (typed as a Float64Array to * avoid circular goog.requires). * * @param {!goog.vec.mat3f.Type} mat The destination matrix. * @param {Float64Array} src The source matrix. * @return {!goog.vec.mat3f.Type} Return mat so that operations can be * chained together. */ goog.vec.mat3f.setFromMat3d = function(mat, src) { mat[0] = src[0]; mat[1] = src[1]; mat[2] = src[2]; mat[3] = src[3]; mat[4] = src[4]; mat[5] = src[5]; mat[6] = src[6]; mat[7] = src[7]; mat[8] = src[8]; return mat; }; /** * Initializes mat3f mat from Array src. * * @param {!goog.vec.mat3f.Type} mat The destination matrix. * @param {Array<number>} src The source matrix. * @return {!goog.vec.mat3f.Type} Return mat so that operations can be * chained together. */ goog.vec.mat3f.setFromArray = function(mat, src) { mat[0] = src[0]; mat[1] = src[1]; mat[2] = src[2]; mat[3] = src[3]; mat[4] = src[4]; mat[5] = src[5]; mat[6] = src[6]; mat[7] = src[7]; mat[8] = src[8]; return mat; }; /** * Retrieves the element at the requested row and column. * * @param {!goog.vec.mat3f.Type} mat The matrix containing the value to * retrieve. * @param {number} row The row index. * @param {number} column The column index. * @return {number} The element value at the requested row, column indices. */ goog.vec.mat3f.getElement = function(mat, row, column) { return mat[row + column * 3]; }; /** * Sets the element at the requested row and column. * * @param {!goog.vec.mat3f.Type} mat The matrix containing the value to * retrieve. * @param {number} row The row index. * @param {number} column The column index. * @param {number} value The value to set at the requested row, column. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained together. */ goog.vec.mat3f.setElement = function(mat, row, column, value) { mat[row + column * 3] = value; return mat; }; /** * Sets the diagonal values of the matrix from the given values. * * @param {!goog.vec.mat3f.Type} mat The matrix to receive the values. * @param {number} v00 The values for (0, 0). * @param {number} v11 The values for (1, 1). * @param {number} v22 The values for (2, 2). * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained together. */ goog.vec.mat3f.setDiagonalValues = function(mat, v00, v11, v22) { mat[0] = v00; mat[4] = v11; mat[8] = v22; return mat; }; /** * Sets the diagonal values of the matrix from the given vector. * * @param {!goog.vec.mat3f.Type} mat The matrix to receive the values. * @param {!goog.vec.vec3f.Type} vec The vector containing the values. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained together. */ goog.vec.mat3f.setDiagonal = function(mat, vec) { mat[0] = vec[0]; mat[4] = vec[1]; mat[8] = vec[2]; return mat; }; /** * Sets the specified column with the supplied values. * * @param {!goog.vec.mat3f.Type} mat The matrix to recieve the values. * @param {number} column The column index to set the values on. * @param {number} v0 The value for row 0. * @param {number} v1 The value for row 1. * @param {number} v2 The value for row 2. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained together. */ goog.vec.mat3f.setColumnValues = function(mat, column, v0, v1, v2) { var i = column * 3; mat[i] = v0; mat[i + 1] = v1; mat[i + 2] = v2; return mat; }; /** * Sets the specified column with the value from the supplied array. * * @param {!goog.vec.mat3f.Type} mat The matrix to receive the values. * @param {number} column The column index to set the values on. * @param {!goog.vec.vec3f.Type} vec The vector elements for the column. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained together. */ goog.vec.mat3f.setColumn = function(mat, column, vec) { var i = column * 3; mat[i] = vec[0]; mat[i + 1] = vec[1]; mat[i + 2] = vec[2]; return mat; }; /** * Retrieves the specified column from the matrix into the given vector * array. * * @param {!goog.vec.mat3f.Type} mat The matrix supplying the values. * @param {number} column The column to get the values from. * @param {!goog.vec.vec3f.Type} vec The vector elements to receive the * column. * @return {!goog.vec.vec3f.Type} return vec so that operations can be * chained together. */ goog.vec.mat3f.getColumn = function(mat, column, vec) { var i = column * 3; vec[0] = mat[i]; vec[1] = mat[i + 1]; vec[2] = mat[i + 2]; return vec; }; /** * Sets the columns of the matrix from the set of vector elements. * * @param {!goog.vec.mat3f.Type} mat The matrix to receive the values. * @param {!goog.vec.vec3f.Type} vec0 The values for column 0. * @param {!goog.vec.vec3f.Type} vec1 The values for column 1. * @param {!goog.vec.vec3f.Type} vec2 The values for column 2. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained together. */ goog.vec.mat3f.setColumns = function(mat, vec0, vec1, vec2) { goog.vec.mat3f.setColumn(mat, 0, vec0); goog.vec.mat3f.setColumn(mat, 1, vec1); goog.vec.mat3f.setColumn(mat, 2, vec2); return /** @type {!goog.vec.mat3f.Type} */ (mat); }; /** * Retrieves the column values from the given matrix into the given vector * elements. * * @param {!goog.vec.mat3f.Type} mat The matrix supplying the columns. * @param {!goog.vec.vec3f.Type} vec0 The vector to receive column 0. * @param {!goog.vec.vec3f.Type} vec1 The vector to receive column 1. * @param {!goog.vec.vec3f.Type} vec2 The vector to receive column 2. */ goog.vec.mat3f.getColumns = function(mat, vec0, vec1, vec2) { goog.vec.mat3f.getColumn(mat, 0, vec0); goog.vec.mat3f.getColumn(mat, 1, vec1); goog.vec.mat3f.getColumn(mat, 2, vec2); }; /** * Sets the row values from the supplied values. * * @param {!goog.vec.mat3f.Type} mat The matrix to receive the values. * @param {number} row The index of the row to receive the values. * @param {number} v0 The value for column 0. * @param {number} v1 The value for column 1. * @param {number} v2 The value for column 2. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained together. */ goog.vec.mat3f.setRowValues = function(mat, row, v0, v1, v2) { mat[row] = v0; mat[row + 3] = v1; mat[row + 6] = v2; return mat; }; /** * Sets the row values from the supplied vector. * * @param {!goog.vec.mat3f.Type} mat The matrix to receive the row values. * @param {number} row The index of the row. * @param {!goog.vec.vec3f.Type} vec The vector containing the values. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained together. */ goog.vec.mat3f.setRow = function(mat, row, vec) { mat[row] = vec[0]; mat[row + 3] = vec[1]; mat[row + 6] = vec[2]; return mat; }; /** * Retrieves the row values into the given vector. * * @param {!goog.vec.mat3f.Type} mat The matrix supplying the values. * @param {number} row The index of the row supplying the values. * @param {!goog.vec.vec3f.Type} vec The vector to receive the row. * @return {!goog.vec.vec3f.Type} return vec so that operations can be * chained together. */ goog.vec.mat3f.getRow = function(mat, row, vec) { vec[0] = mat[row]; vec[1] = mat[row + 3]; vec[2] = mat[row + 6]; return vec; }; /** * Sets the rows of the matrix from the supplied vectors. * * @param {!goog.vec.mat3f.Type} mat The matrix to receive the values. * @param {!goog.vec.vec3f.Type} vec0 The values for row 0. * @param {!goog.vec.vec3f.Type} vec1 The values for row 1. * @param {!goog.vec.vec3f.Type} vec2 The values for row 2. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained together. */ goog.vec.mat3f.setRows = function(mat, vec0, vec1, vec2) { goog.vec.mat3f.setRow(mat, 0, vec0); goog.vec.mat3f.setRow(mat, 1, vec1); goog.vec.mat3f.setRow(mat, 2, vec2); return /** @type {!goog.vec.mat3f.Type} */ (mat); }; /** * Retrieves the rows of the matrix into the supplied vectors. * * @param {!goog.vec.mat3f.Type} mat The matrix to supplying the values. * @param {!goog.vec.vec3f.Type} vec0 The vector to receive row 0. * @param {!goog.vec.vec3f.Type} vec1 The vector to receive row 1. * @param {!goog.vec.vec3f.Type} vec2 The vector to receive row 2. */ goog.vec.mat3f.getRows = function(mat, vec0, vec1, vec2) { goog.vec.mat3f.getRow(mat, 0, vec0); goog.vec.mat3f.getRow(mat, 1, vec1); goog.vec.mat3f.getRow(mat, 2, vec2); }; /** * Makes the given 3x3 matrix the zero matrix. * * @param {!goog.vec.mat3f.Type} mat The matrix. * @return {!goog.vec.mat3f.Type} return mat so operations can be chained. */ goog.vec.mat3f.makeZero = function(mat) { mat[0] = 0; mat[1] = 0; mat[2] = 0; mat[3] = 0; mat[4] = 0; mat[5] = 0; mat[6] = 0; mat[7] = 0; mat[8] = 0; return mat; }; /** * Makes the given 3x3 matrix the identity matrix. * * @param {!goog.vec.mat3f.Type} mat The matrix. * @return {!goog.vec.mat3f.Type} return mat so operations can be chained. */ goog.vec.mat3f.makeIdentity = function(mat) { mat[0] = 1; mat[1] = 0; mat[2] = 0; mat[3] = 0; mat[4] = 1; mat[5] = 0; mat[6] = 0; mat[7] = 0; mat[8] = 1; return mat; }; /** * Performs a per-component addition of the matrices mat0 and mat1, storing * the result into resultMat. * * @param {!goog.vec.mat3f.Type} mat0 The first addend. * @param {!goog.vec.mat3f.Type} mat1 The second addend. * @param {!goog.vec.mat3f.Type} resultMat The matrix to * receive the results (may be either mat0 or mat1). * @return {!goog.vec.mat3f.Type} return resultMat so that operations can be * chained together. */ goog.vec.mat3f.addMat = function(mat0, mat1, resultMat) { resultMat[0] = mat0[0] + mat1[0]; resultMat[1] = mat0[1] + mat1[1]; resultMat[2] = mat0[2] + mat1[2]; resultMat[3] = mat0[3] + mat1[3]; resultMat[4] = mat0[4] + mat1[4]; resultMat[5] = mat0[5] + mat1[5]; resultMat[6] = mat0[6] + mat1[6]; resultMat[7] = mat0[7] + mat1[7]; resultMat[8] = mat0[8] + mat1[8]; return resultMat; }; /** * Performs a per-component subtraction of the matrices mat0 and mat1, * storing the result into resultMat. * * @param {!goog.vec.mat3f.Type} mat0 The minuend. * @param {!goog.vec.mat3f.Type} mat1 The subtrahend. * @param {!goog.vec.mat3f.Type} resultMat The matrix to receive * the results (may be either mat0 or mat1). * @return {!goog.vec.mat3f.Type} return resultMat so that operations can be * chained together. */ goog.vec.mat3f.subMat = function(mat0, mat1, resultMat) { resultMat[0] = mat0[0] - mat1[0]; resultMat[1] = mat0[1] - mat1[1]; resultMat[2] = mat0[2] - mat1[2]; resultMat[3] = mat0[3] - mat1[3]; resultMat[4] = mat0[4] - mat1[4]; resultMat[5] = mat0[5] - mat1[5]; resultMat[6] = mat0[6] - mat1[6]; resultMat[7] = mat0[7] - mat1[7]; resultMat[8] = mat0[8] - mat1[8]; return resultMat; }; /** * Multiplies matrix mat0 with the given scalar, storing the result * into resultMat. * * @param {!goog.vec.mat3f.Type} mat The matrix. * @param {number} scalar The scalar value to multiple to each element of mat. * @param {!goog.vec.mat3f.Type} resultMat The matrix to receive * the results (may be mat). * @return {!goog.vec.mat3f.Type} return resultMat so that operations can be * chained together. */ goog.vec.mat3f.multScalar = function(mat, scalar, resultMat) { resultMat[0] = mat[0] * scalar; resultMat[1] = mat[1] * scalar; resultMat[2] = mat[2] * scalar; resultMat[3] = mat[3] * scalar; resultMat[4] = mat[4] * scalar; resultMat[5] = mat[5] * scalar; resultMat[6] = mat[6] * scalar; resultMat[7] = mat[7] * scalar; resultMat[8] = mat[8] * scalar; return resultMat; }; /** * Multiplies the two matrices mat0 and mat1 using matrix multiplication, * storing the result into resultMat. * * @param {!goog.vec.mat3f.Type} mat0 The first (left hand) matrix. * @param {!goog.vec.mat3f.Type} mat1 The second (right hand) matrix. * @param {!goog.vec.mat3f.Type} resultMat The matrix to receive * the results (may be either mat0 or mat1). * @return {!goog.vec.mat3f.Type} return resultMat so that operations can be * chained together. */ goog.vec.mat3f.multMat = function(mat0, mat1, resultMat) { var a00 = mat0[0], a10 = mat0[1], a20 = mat0[2]; var a01 = mat0[3], a11 = mat0[4], a21 = mat0[5]; var a02 = mat0[6], a12 = mat0[7], a22 = mat0[8]; var b00 = mat1[0], b10 = mat1[1], b20 = mat1[2]; var b01 = mat1[3], b11 = mat1[4], b21 = mat1[5]; var b02 = mat1[6], b12 = mat1[7], b22 = mat1[8]; resultMat[0] = a00 * b00 + a01 * b10 + a02 * b20; resultMat[1] = a10 * b00 + a11 * b10 + a12 * b20; resultMat[2] = a20 * b00 + a21 * b10 + a22 * b20; resultMat[3] = a00 * b01 + a01 * b11 + a02 * b21; resultMat[4] = a10 * b01 + a11 * b11 + a12 * b21; resultMat[5] = a20 * b01 + a21 * b11 + a22 * b21; resultMat[6] = a00 * b02 + a01 * b12 + a02 * b22; resultMat[7] = a10 * b02 + a11 * b12 + a12 * b22; resultMat[8] = a20 * b02 + a21 * b12 + a22 * b22; return resultMat; }; /** * Transposes the given matrix mat storing the result into resultMat. * * @param {!goog.vec.mat3f.Type} mat The matrix to transpose. * @param {!goog.vec.mat3f.Type} resultMat The matrix to receive * the results (may be mat). * @return {!goog.vec.mat3f.Type} return resultMat so that operations can be * chained together. */ goog.vec.mat3f.transpose = function(mat, resultMat) { if (resultMat == mat) { var a10 = mat[1], a20 = mat[2], a21 = mat[5]; resultMat[1] = mat[3]; resultMat[2] = mat[6]; resultMat[3] = a10; resultMat[5] = mat[7]; resultMat[6] = a20; resultMat[7] = a21; } else { resultMat[0] = mat[0]; resultMat[1] = mat[3]; resultMat[2] = mat[6]; resultMat[3] = mat[1]; resultMat[4] = mat[4]; resultMat[5] = mat[7]; resultMat[6] = mat[2]; resultMat[7] = mat[5]; resultMat[8] = mat[8]; } return resultMat; }; /** * Computes the inverse of mat0 storing the result into resultMat. If the * inverse is defined, this function returns true, false otherwise. * * @param {!goog.vec.mat3f.Type} mat0 The matrix to invert. * @param {!goog.vec.mat3f.Type} resultMat The matrix to receive * the result (may be mat0). * @return {boolean} True if the inverse is defined. If false is returned, * resultMat is not modified. */ goog.vec.mat3f.invert = function(mat0, resultMat) { var a00 = mat0[0], a10 = mat0[1], a20 = mat0[2]; var a01 = mat0[3], a11 = mat0[4], a21 = mat0[5]; var a02 = mat0[6], a12 = mat0[7], a22 = mat0[8]; var t00 = a11 * a22 - a12 * a21; var t10 = a12 * a20 - a10 * a22; var t20 = a10 * a21 - a11 * a20; var det = a00 * t00 + a01 * t10 + a02 * t20; if (det == 0) { return false; } var idet = 1 / det; resultMat[0] = t00 * idet; resultMat[3] = (a02 * a21 - a01 * a22) * idet; resultMat[6] = (a01 * a12 - a02 * a11) * idet; resultMat[1] = t10 * idet; resultMat[4] = (a00 * a22 - a02 * a20) * idet; resultMat[7] = (a02 * a10 - a00 * a12) * idet; resultMat[2] = t20 * idet; resultMat[5] = (a01 * a20 - a00 * a21) * idet; resultMat[8] = (a00 * a11 - a01 * a10) * idet; return true; }; /** * Returns true if the components of mat0 are equal to the components of mat1. * * @param {!goog.vec.mat3f.Type} mat0 The first matrix. * @param {!goog.vec.mat3f.Type} mat1 The second matrix. * @return {boolean} True if the the two matrices are equivalent. */ goog.vec.mat3f.equals = function(mat0, mat1) { return mat0.length == mat1.length && mat0[0] == mat1[0] && mat0[1] == mat1[1] && mat0[2] == mat1[2] && mat0[3] == mat1[3] && mat0[4] == mat1[4] && mat0[5] == mat1[5] && mat0[6] == mat1[6] && mat0[7] == mat1[7] && mat0[8] == mat1[8]; }; /** * Transforms the given vector with the given matrix storing the resulting, * transformed matrix into resultVec. * * @param {!goog.vec.mat3f.Type} mat The matrix supplying the transformation. * @param {!goog.vec.vec3f.Type} vec The vector to transform. * @param {!goog.vec.vec3f.Type} resultVec The vector to * receive the results (may be vec). * @return {!goog.vec.vec3f.Type} return resultVec so that operations can be * chained together. */ goog.vec.mat3f.multVec3 = function(mat, vec, resultVec) { var x = vec[0], y = vec[1], z = vec[2]; resultVec[0] = x * mat[0] + y * mat[3] + z * mat[6]; resultVec[1] = x * mat[1] + y * mat[4] + z * mat[7]; resultVec[2] = x * mat[2] + y * mat[5] + z * mat[8]; return resultVec; }; /** * Makes the given 3x3 matrix a translation matrix with x and y * translation values. * * @param {!goog.vec.mat3f.Type} mat The matrix. * @param {number} x The translation along the x axis. * @param {number} y The translation along the y axis. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained. */ goog.vec.mat3f.makeTranslate = function(mat, x, y) { mat[0] = 1; mat[1] = 0; mat[2] = 0; mat[3] = 0; mat[4] = 1; mat[5] = 0; mat[6] = x; mat[7] = y; mat[8] = 1; return mat; }; /** * Makes the given 3x3 matrix a scale matrix with x, y, and z scale factors. * * @param {!goog.vec.mat3f.Type} mat The 3x3 (9-element) matrix * array to receive the new scale matrix. * @param {number} x The scale along the x axis. * @param {number} y The scale along the y axis. * @param {number} z The scale along the z axis. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained. */ goog.vec.mat3f.makeScale = function(mat, x, y, z) { mat[0] = x; mat[1] = 0; mat[2] = 0; mat[3] = 0; mat[4] = y; mat[5] = 0; mat[6] = 0; mat[7] = 0; mat[8] = z; return mat; }; /** * Makes the given 3x3 matrix a rotation matrix with the given rotation * angle about the axis defined by the vector (ax, ay, az). * * @param {!goog.vec.mat3f.Type} mat The matrix. * @param {number} angle The rotation angle in radians. * @param {number} ax The x component of the rotation axis. * @param {number} ay The y component of the rotation axis. * @param {number} az The z component of the rotation axis. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained. */ goog.vec.mat3f.makeRotate = function(mat, angle, ax, ay, az) { var c = Math.cos(angle); var d = 1 - c; var s = Math.sin(angle); mat[0] = ax * ax * d + c; mat[1] = ax * ay * d + az * s; mat[2] = ax * az * d - ay * s; mat[3] = ax * ay * d - az * s; mat[4] = ay * ay * d + c; mat[5] = ay * az * d + ax * s; mat[6] = ax * az * d + ay * s; mat[7] = ay * az * d - ax * s; mat[8] = az * az * d + c; return mat; }; /** * Makes the given 3x3 matrix a rotation matrix with the given rotation * angle about the X axis. * * @param {!goog.vec.mat3f.Type} mat The matrix. * @param {number} angle The rotation angle in radians. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained. */ goog.vec.mat3f.makeRotateX = function(mat, angle) { var c = Math.cos(angle); var s = Math.sin(angle); mat[0] = 1; mat[1] = 0; mat[2] = 0; mat[3] = 0; mat[4] = c; mat[5] = s; mat[6] = 0; mat[7] = -s; mat[8] = c; return mat; }; /** * Makes the given 3x3 matrix a rotation matrix with the given rotation * angle about the Y axis. * * @param {!goog.vec.mat3f.Type} mat The matrix. * @param {number} angle The rotation angle in radians. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained. */ goog.vec.mat3f.makeRotateY = function(mat, angle) { var c = Math.cos(angle); var s = Math.sin(angle); mat[0] = c; mat[1] = 0; mat[2] = -s; mat[3] = 0; mat[4] = 1; mat[5] = 0; mat[6] = s; mat[7] = 0; mat[8] = c; return mat; }; /** * Makes the given 3x3 matrix a rotation matrix with the given rotation * angle about the Z axis. * * @param {!goog.vec.mat3f.Type} mat The matrix. * @param {number} angle The rotation angle in radians. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained. */ goog.vec.mat3f.makeRotateZ = function(mat, angle) { var c = Math.cos(angle); var s = Math.sin(angle); mat[0] = c; mat[1] = s; mat[2] = 0; mat[3] = -s; mat[4] = c; mat[5] = 0; mat[6] = 0; mat[7] = 0; mat[8] = 1; return mat; }; /** * Rotate the given matrix by angle about the x,y,z axis. Equivalent to: * goog.vec.mat3f.multMat( * mat, * goog.vec.mat3f.makeRotate(goog.vec.mat3f.create(), angle, x, y, z), * mat); * * @param {!goog.vec.mat3f.Type} mat The matrix. * @param {number} angle The angle in radians. * @param {number} x The x component of the rotation axis. * @param {number} y The y component of the rotation axis. * @param {number} z The z component of the rotation axis. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained. */ goog.vec.mat3f.rotate = function(mat, angle, x, y, z) { var m00 = mat[0], m10 = mat[1], m20 = mat[2]; var m01 = mat[3], m11 = mat[4], m21 = mat[5]; var m02 = mat[6], m12 = mat[7], m22 = mat[8]; var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); var diffCosAngle = 1 - cosAngle; var r00 = x * x * diffCosAngle + cosAngle; var r10 = x * y * diffCosAngle + z * sinAngle; var r20 = x * z * diffCosAngle - y * sinAngle; var r01 = x * y * diffCosAngle - z * sinAngle; var r11 = y * y * diffCosAngle + cosAngle; var r21 = y * z * diffCosAngle + x * sinAngle; var r02 = x * z * diffCosAngle + y * sinAngle; var r12 = y * z * diffCosAngle - x * sinAngle; var r22 = z * z * diffCosAngle + cosAngle; mat[0] = m00 * r00 + m01 * r10 + m02 * r20; mat[1] = m10 * r00 + m11 * r10 + m12 * r20; mat[2] = m20 * r00 + m21 * r10 + m22 * r20; mat[3] = m00 * r01 + m01 * r11 + m02 * r21; mat[4] = m10 * r01 + m11 * r11 + m12 * r21; mat[5] = m20 * r01 + m21 * r11 + m22 * r21; mat[6] = m00 * r02 + m01 * r12 + m02 * r22; mat[7] = m10 * r02 + m11 * r12 + m12 * r22; mat[8] = m20 * r02 + m21 * r12 + m22 * r22; return mat; }; /** * Rotate the given matrix by angle about the x axis. Equivalent to: * goog.vec.mat3f.multMat( * mat, * goog.vec.mat3f.makeRotateX(goog.vec.mat3f.create(), angle), * mat); * * @param {!goog.vec.mat3f.Type} mat The matrix. * @param {number} angle The angle in radians. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained. */ goog.vec.mat3f.rotateX = function(mat, angle) { var m01 = mat[3], m11 = mat[4], m21 = mat[5]; var m02 = mat[6], m12 = mat[7], m22 = mat[8]; var c = Math.cos(angle); var s = Math.sin(angle); mat[3] = m01 * c + m02 * s; mat[4] = m11 * c + m12 * s; mat[5] = m21 * c + m22 * s; mat[6] = m01 * -s + m02 * c; mat[7] = m11 * -s + m12 * c; mat[8] = m21 * -s + m22 * c; return mat; }; /** * Rotate the given matrix by angle about the y axis. Equivalent to: * goog.vec.mat3f.multMat( * mat, * goog.vec.mat3f.makeRotateY(goog.vec.mat3f.create(), angle), * mat); * * @param {!goog.vec.mat3f.Type} mat The matrix. * @param {number} angle The angle in radians. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained. */ goog.vec.mat3f.rotateY = function(mat, angle) { var m00 = mat[0], m10 = mat[1], m20 = mat[2]; var m02 = mat[6], m12 = mat[7], m22 = mat[8]; var c = Math.cos(angle); var s = Math.sin(angle); mat[0] = m00 * c + m02 * -s; mat[1] = m10 * c + m12 * -s; mat[2] = m20 * c + m22 * -s; mat[6] = m00 * s + m02 * c; mat[7] = m10 * s + m12 * c; mat[8] = m20 * s + m22 * c; return mat; }; /** * Rotate the given matrix by angle about the z axis. Equivalent to: * goog.vec.mat3f.multMat( * mat, * goog.vec.mat3f.makeRotateZ(goog.vec.mat3f.create(), angle), * mat); * * @param {!goog.vec.mat3f.Type} mat The matrix. * @param {number} angle The angle in radians. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained. */ goog.vec.mat3f.rotateZ = function(mat, angle) { var m00 = mat[0], m10 = mat[1], m20 = mat[2]; var m01 = mat[3], m11 = mat[4], m21 = mat[5]; var c = Math.cos(angle); var s = Math.sin(angle); mat[0] = m00 * c + m01 * s; mat[1] = m10 * c + m11 * s; mat[2] = m20 * c + m21 * s; mat[3] = m00 * -s + m01 * c; mat[4] = m10 * -s + m11 * c; mat[5] = m20 * -s + m21 * c; return mat; }; /** * Makes the given 3x3 matrix a rotation matrix given Euler angles using * the ZXZ convention. * Given the euler angles [theta1, theta2, theta3], the rotation is defined as * rotation = rotation_z(theta1) * rotation_x(theta2) * rotation_z(theta3), * with theta1 in [0, 2 * pi], theta2 in [0, pi] and theta3 in [0, 2 * pi]. * rotation_x(theta) means rotation around the X axis of theta radians. * * @param {!goog.vec.mat3f.Type} mat The matrix. * @param {number} theta1 The angle of rotation around the Z axis in radians. * @param {number} theta2 The angle of rotation around the X axis in radians. * @param {number} theta3 The angle of rotation around the Z axis in radians. * @return {!goog.vec.mat3f.Type} return mat so that operations can be * chained. */ goog.vec.mat3f.makeEulerZXZ = function(mat, theta1, theta2, theta3) { var c1 = Math.cos(theta1); var s1 = Math.sin(theta1); var c2 = Math.cos(theta2); var s2 = Math.sin(theta2); var c3 = Math.cos(theta3); var s3 = Math.sin(theta3); mat[0] = c1 * c3 - c2 * s1 * s3; mat[1] = c2 * c1 * s3 + c3 * s1; mat[2] = s3 * s2; mat[3] = -c1 * s3 - c3 * c2 * s1; mat[4] = c1 * c2 * c3 - s1 * s3; mat[5] = c3 * s2; mat[6] = s2 * s1; mat[7] = -c1 * s2; mat[8] = c2; return mat; }; /** * Decomposes a rotation matrix into Euler angles using the ZXZ convention so * that rotation = rotation_z(theta1) * rotation_x(theta2) * rotation_z(theta3), * with theta1 in [0, 2 * pi], theta2 in [0, pi] and theta3 in [0, 2 * pi]. * rotation_x(theta) means rotation around the X axis of theta radians. * * @param {!goog.vec.mat3f.Type} mat The matrix. * @param {!goog.vec.vec3f.Type} euler The ZXZ Euler angles in * radians as [theta1, theta2, theta3]. * @param {boolean=} opt_theta2IsNegative Whether theta2 is in [-pi, 0] instead * of the default [0, pi]. * @return {!goog.vec.vec3f.Type} return euler so that operations can be * chained together. */ goog.vec.mat3f.toEulerZXZ = function(mat, euler, opt_theta2IsNegative) { // There is an ambiguity in the sign of sinTheta2 because of the sqrt. var sinTheta2 = Math.sqrt(mat[2] * mat[2] + mat[5] * mat[5]); // By default we explicitely constrain theta2 to be in [0, pi], // so sinTheta2 is always positive. We can change the behavior and specify // theta2 to be negative in [-pi, 0] with opt_Theta2IsNegative. var signTheta2 = opt_theta2IsNegative ? -1 : 1; if (sinTheta2 > goog.vec.EPSILON) { euler[2] = Math.atan2(mat[2] * signTheta2, mat[5] * signTheta2); euler[1] = Math.atan2(sinTheta2 * signTheta2, mat[8]); euler[0] = Math.atan2(mat[6] * signTheta2, -mat[7] * signTheta2); } else { // There is also an arbitrary choice for theta1 = 0 or theta2 = 0 here. // We assume theta1 = 0 as some applications do not allow the camera to roll // (i.e. have theta1 != 0). euler[0] = 0; euler[1] = Math.atan2(sinTheta2 * signTheta2, mat[8]); euler[2] = Math.atan2(mat[1], mat[0]); } // Atan2 outputs angles in [-pi, pi] so we bring them back to [0, 2 * pi]. euler[0] = (euler[0] + Math.PI * 2) % (Math.PI * 2); euler[2] = (euler[2] + Math.PI * 2) % (Math.PI * 2); // For theta2 we want the angle to be in [0, pi] or [-pi, 0] depending on // signTheta2. euler[1] = ((euler[1] * signTheta2 + Math.PI * 2) % (Math.PI * 2)) * signTheta2; return euler; };
Airhogs777/sb3-theme
tests/closure-library/closure/goog/vec/mat3f.js
JavaScript
mit
31,567
/* ======================================================================== * SaRibe: eModal.js v1.2.65 * http://saribe.github.io/eModal * ======================================================================== * Copyright Samuel Ribeiro. * Licensed under MIT. * ======================================================================== */ /** * Easy Modal for bootstrap, is a simple way to create modal dialogs using javascript. * @params allowed elements: * buttons {array}: An array of objects to configure buttons to modal footer; only able if message == string * css {object}: CSS object try apply into message body; only able if message == string * loading {boolean}: Set loading progress as message. * message {string|object}: The body message string or the HTML element. e.g.: $(selector); * size {string}: sm || lg || xl -> define the modal size. * subtitle {string}: The header subtitle string. This appear in a smaller text. * title {string}: The header title string. * useBin {boolean}: Set message as recyclable. * </summary> * <param name="params" >Modal options parameters of string body message.</param> * <param name="title" >The string header title or a flag to set default parameters.</param> * <returns type="Promise">{ then, element }.</returns> */ ; (function (define) { define(['jquery'], function ($, root) { var $modal; var BIN = 'recycle-bin'; var DIV = '<div>'; var EMPTY = ''; var EVENT_CLICK = 'click'; var EVENT_HIDE = 'hide'; var EVENT_SHOW = 'shown.bs.modal'; var EVENT_SUBMIT = 'submit'; var FOOTER_ID = 'eFooter'; var HIDE = EVENT_HIDE + '.bs.modal'; var INPUT = 'input'; var KEY_DANGER = 'danger'; var LABEL = { OK: 'Cancel', True: 'False', Yes: 'No' }; var lastParams = {}; var MODAL_BODY = 'modal-body'; var MODAL_DIALOG = '.modal-dialog'; var options = {}; var REC_MODAL_CONTENT = 'modal-rec'; var SIZE = { sm: 'sm', lg: 'lg', xl: 'xl' }; var TMP_MODAL_CONTENT = 'modal-tmp'; var defaultSettings = { allowContentRecycle: true, confirmLabel: Object.keys(LABEL)[0], labels: LABEL, loadingHtml: '<h5>Loading...</h5><div class=progress><div class="progress-bar progress-bar-striped active" style="width: 100%"></div></div>', size: EMPTY, title: 'Attention' }; root.addLabel = addLabel; root.ajax = ajax; root.alert = alert; root.close = close; root.confirm = confirm; root.emptyBin = emptyBin; root.iframe = iframe; root.prompt = prompt; root.setId = setId; root.setEModalOptions = setEModalOptions; root.setModalOptions = setModalOptions; root.size = SIZE; root.version = '1.2.65'; return root; //#region /////////////////////////* Private Logic *///////////////////////// /** * Find modal body and append message to it. * @param {String | DOM} message */ function _build(message) { $modal .modal(options) .find('.modal-content') .append(message); } /** * Will find what Promises approach the developer is using. * Will use Promises A+ if Q.js is present, otherwise will use Promises A from jQuery. * @returns {Promise} */ function _createDeferred() { var defer; // try native promise //if (Promise) defer = Promise.defer(); var q; try { q = require('Q'); } // Load option Q by require if exist catch (e) { q = window.Q; } if (q) { // try Q defer = q.defer(); } else { // Use jQuery :( defer = $.Deferred(); defer.promise = defer.promise(); } defer.promise.element = _getModalInstance(true).find(MODAL_DIALOG); return defer; } /** * Will create modal DOM footer with all buttons. * @param {Array} buttons - all custom buttons, if none, will generate defaults * @returns {$DOM} footer DOM element */ function _getFooter(buttons) { if (buttons === false) { return EMPTY; } var messageFotter = $(DIV).addClass('modal-footer').prop('id', FOOTER_ID); if (buttons) { for (var i = 0, k = buttons.length; i < k; i++) { var btnOp = buttons[i]; var btn = $('<button>').addClass('btn btn-' + (btnOp.style || 'primary')); for (var index in btnOp) { if (btnOp.hasOwnProperty(index)) { switch (index) { case 'close': //add close event if (btnOp[index]) { btn.attr('data-dismiss', 'modal') .addClass('x'); } break; case EVENT_CLICK: //click event var fn = btnOp.click.bind(_getModalInstance(true).find('.modal-content')); btn.click(fn); break; case 'text': btn.html(btnOp[index]); break; default: //all other possible HTML attributes to button element btn.attr(index, btnOp[index]); } } } messageFotter.append(btn); } } else { //if no buttons defined by user, add a standard close button. messageFotter.append('<button class="x btn btn-primary" data-dismiss=modal type=button>Close</button>'); } return messageFotter; } /** * Extract message from arguments. * @param {Object | String} data - this can be the message string or the full detailed object * @returns {$DOM} */ function _getMessage(data) { var $message; var content = data.loading ? defaultSettings.loadingHtml : (data.message || data); if (content.on || content.onclick) { $message = data.clone === true ? $(content).clone() : $(content); $message.addClass(data.useBin && !data.loading ? REC_MODAL_CONTENT : TMP_MODAL_CONTENT); } else { $message = $(DIV) .attr('style', 'position:relative;word-wrap:break-word;') .addClass(MODAL_BODY) .html(content); } return data.css && (data.css !== $message.css && $message.css(data.css)), $message; } /** * Return a new modal object if is the first request or the already created model. * @param {boolean} skipEventChageIfExists * @returns {jQuery Object} */ function _getModalInstance(skipEventChageIfExists) { if (!$modal) { //add recycle bin container to document if (!$('#' + BIN).length) { $('body').append($(DIV).prop('id', BIN).hide()); } $modal = createModalElement(); } if (skipEventChageIfExists && $modal) { return $modal; } return $modal .on(EVENT_SHOW, function () { $(this).find(INPUT).first().focus(); }); function createModalElement() { return $('<div class="modal fade" tabindex="-1"><style>.modal-xl{width:96%;}.modal-body{max-height: calc(100vh - 145px);overflow-y: auto;}</style>' + '<div class=modal-dialog>' + '<div class=modal-content>' + ' <div class=modal-header><button type=button class="x close" data-dismiss=modal><span aria-hidden=true>&times;</span><span class=sr-only>Close</span></button><h4 class=modal-title></h4></div>' + '</div>' + '</div>' + '</div>') .on('hidden.bs.modal', _recycleModal) .on(EVENT_CLICK, 'button.x', function (ev) { var btn = $(ev.currentTarget); if (btn.prop('type') !== EVENT_SUBMIT) return $modal.modal(EVENT_HIDE); try { if (btn.closest('form')[0].checkValidity()) return close(); } catch (e) { return close(); } return $modal; }); } } /** * Move content to recycle bin if is a DOM object defined by user, * delete it if is a simple string message. * All modal messages can be deleted if default setting "allowContentRecycle" = false. */ function _recycleModal() { if (!$modal) return; var $content = $modal.find('.' + REC_MODAL_CONTENT).removeClass(REC_MODAL_CONTENT) .appendTo('#' + BIN); $modal .off(HIDE) .off(EVENT_SHOW) .find('.modal-content > div:not(:first-child)') .remove(); if (!defaultSettings.allowContentRecycle || lastParams.clone) { $content.remove(); } } /** * Handle default values and toggle between {Object | String}. * Create or get Modal element * @param {Object | String} data - this can be the message string or the full detailed object * @param {String} title - the string that will be shown in modal header * @returns {Promise} Promise with modal $DOM element */ function _setup(params, title) { if (!params) throw new Error('Invalid parameters!'); _recycleModal(); lastParams = params; // Lazy loading var $ref = _getModalInstance(); //#region change size $ref.find(MODAL_DIALOG) .removeClass('modal-sm modal-lg modal-xl') .addClass(params.size ? 'modal-' + params.size : defaultSettings.size); //#endregion //#region change title $ref.find('.modal-title') .html((params.title || title || defaultSettings.title) + ' ') .append($('<small>').html(params.subtitle || EMPTY)); //#endregion $ref.on(HIDE, params.onHide); } //#endregion //#region /////////////////////////* Public Methods *///////////////////////// function addLabel(yes, no) { LABEL[yes] = no; } /** * Gets data from URL to eModal body * @param {Object | String} data - this can be the message string or the full detailed object * @param {String} title - the string that will be shown in modal header * @returns {Promise} Promise with modal $DOM element */ function ajax(data, title) { var dfd = _createDeferred(); var params = { async: true, deferred: dfd, loading: true, title: data.title || title || defaultSettings.title, url: data.url || data, dataType: data.dataType || 'text' }; if (data.url) { $.extend(params, data); } $.ajax(params) .done(ok) .fail(error); return alert(params, title); function ok(html) { $modal .find('.' + MODAL_BODY) .html(data.success ? data.success(html) : html); return dfd.resolve($modal); } function error(responseText, textStatus) { var msg = data.error ? data.error(responseText, textStatus, params) : '<div class="alert alert-danger">' + '<strong>XHR Fail: </strong>URL [ ' + params.url + '] load fail.' + '</div>'; $modal .find('.' + MODAL_BODY) .html(msg); return dfd.reject(responseText); } } /** * Non blocking alert whit bootstrap. * @param {Object | String} data - this can be the message string or the full detailed object. * @param {String} title - the string that will be shown in modal header. * @returns {Promise} Promise with modal $DOM element */ function alert(data, title) { _setup(data, title); var dfd = data.deferred || _createDeferred(); var $message = $(DIV).append(_getMessage(data), _getFooter(data.buttons)); _build($message); if (!data.async) { $modal.on(EVENT_SHOW, dfd.resolve); } return dfd.promise; } /** * Non blocking confirm dialog with bootstrap. * @param {Object | String} data - this can be the message string or the full detailed object. * @param {String} title - the string that will be shown in modal header. * @returns {Promise} Promise with modal $DOM element */ function confirm(data, title) { var dfd = _createDeferred(); return alert({ async: true, buttons: [{ close: true, click: click, text: LABEL[data.label] ? LABEL[data.label] : LABEL[defaultSettings.confirmLabel], style: data.style && data.style[0] || KEY_DANGER }, { close: true, click: click, text: LABEL[data.label] ? data.label : defaultSettings.confirmLabel, style: data.style && data.style[1] }], deferred: dfd, message: data.message || data, onHide: click, size: data.size, title: data.title || title }); function click(ev) { close(); var key = $(ev.currentTarget).html(); return LABEL[key] ? dfd.resolve() : dfd.reject(); } } /** * Will load a URL in iFrame inside the modal body. * @param {Object | String} data - this can be the URL string or the full detailed object. * @param {String} title - the string that will be shown in modal header. * @returns {Promise} Promise with modal $DOM element */ function iframe(params, title) { var dfd = _createDeferred(); var html = ('<div class=modal-body style="position: absolute;width: 100%;background-color: rgba(255,255,255,0.8);height: 100%;">%1%</div>' + '<iframe class="embed-responsive-item" frameborder=0 src="%0%" style="width:100%;height:75vh;display:block;"/>') .replace('%0%', params.message || params.url || params) .replace('%1%', defaultSettings.loadingHtml); var message = $(html) .load(iframeReady); return alert({ async: true, buttons: params.buttons || false, deferred: dfd, message: message, size: params.size || SIZE.xl, title: params.title || title }); ////////// function iframeReady() { $(this) .parent() .find('div.' + TMP_MODAL_CONTENT) .fadeOut(function () { $(this).remove(); }); return dfd.resolve(); } } /** * Remove all Dom elements in recycle bin. * @returns {Array} All removed elements */ function emptyBin() { return $('#' + BIN + ' > *').remove(); } /** * Provides one value form. * @param {Object | String} data - this can be the value string label or the full detailed object. * @param {String} title - the string that will be shown in modal header. * @returns {Promise} Promise with modal $DOM element */ function prompt(data, title) { var dfd = _createDeferred(); var params = { deferred: dfd }; if (typeof data === 'object') { $.extend(params, data); } else { params.message = data; params.title = title; } params.async = true; if (params.buttons) { var btn; for (var i = 0, k = params.buttons.length; i < k; i++) { btn = params.buttons[i]; btn.style = (btn.style || 'default') + ' pull-left'; btn.type = btn.type || 'button'; } } var buttons = _getFooter([{ close: true, type: 'reset', text: LABEL.OK, style: KEY_DANGER }, { close: false, type: EVENT_SUBMIT, text: defaultSettings.confirmLabel }].concat(params.buttons || [])); params.buttons = false; params.onHide = submit; params.message = $('<form role=form style="margin-bottom:0;">' + '<div class=modal-body>' + '<label for=prompt-input class=control-label>' + (params.message || EMPTY) + '</label>' + '<input type=text class=form-control required autocomplete="on" value="' + (params.value || EMPTY) + (params.pattern ? '" pattern="' + params.pattern : EMPTY) + '">' + '</div></form>') .append(buttons) .on(EVENT_SUBMIT, submit); return alert(params); function submit(ev) { var value = $modal.find(INPUT).val(); close(); //TODO: ev.type !== EVENT_SUBMIT ? dfd.reject(value) : dfd.resolve(value); return false; } } function setId(id) { _getModalInstance(true) .find(MODAL_DIALOG) .prop('id', id); } /** * Set or change eModal options. * @param {Object} overrideOptions * @returns {Object} merged eModal options */ function setEModalOptions(overrideOptions) { return $.extend(defaultSettings, overrideOptions); } /** * Set or change bootstrap modal options. * @param {Object} overrideOptions * @returns {Object} merged eModal options */ function setModalOptions(overrideOptions) { $modal && $modal.remove(); return $.extend(options, overrideOptions); } /** * Close the current open eModal * @returns {$DOM} eModal DOM element */ function close() { if ($modal) { $modal.off(HIDE).modal(EVENT_HIDE); } return $modal; } //#endregion }); }(typeof define == 'function' && define.amd ? define : function (args, mName) { this.eModal = typeof module != 'undefined' && module.exports ? mName(require(args[0]), module.exports) : mName(window.$, {}); }));
nolsherry/cdnjs
ajax/libs/eModal/1.2.65/eModal.js
JavaScript
mit
21,508
var dics_data = { 'ar': require('../../i18n/ar.json'), 'da': require('../../i18n/da.json'), 'de': require('../../i18n/de.json'), 'en': require('../../i18n/en.json'), 'es': require('../../i18n/es.json'), 'fr': require('../../i18n/fr-FR.json'), 'fr-FR': require('../../i18n/fr-FR.json'), 'he': require('../../i18n/he.json'), 'it': require('../../i18n/it.json'), 'ja': require('../../i18n/ja.json'), 'nb-NO': require('../../i18n/nb-NO.json'), 'nl': require('../../i18n/nl-NL.json'), 'nl-NL': require('../../i18n/nl-NL.json'), 'pt': require('../../i18n/pt.json'), 'pt-BR': require('../../i18n/pt-BR.json'), 'ru': require('../../i18n/ru.json'), 'tlh': require('../../i18n/tlh.json'), 'tr': require('../../i18n/tr.json'), 'zh': require('../../i18n/zh.json') }; var default_dict = dics_data['en']; function findProp(o, s) { s = s.replace(/\[(\w+)\]/g, ':$1'); // convert indexes to properties s = s.replace(/^\:/, ''); // strip a leading dot var a = s.split(':'); while (a.length) { var n = a.shift(); if (n in o) { o = o[n]; } else { return; } } return o; } function Dictionary (data) { this._data = data; } Dictionary.prototype.t = function (key) { return findProp(this._data, key) || findProp(default_dict, key); }; module.exports.getDict = function ( langOrDict ) { if (!langOrDict) { return new Dictionary(default_dict); } if ( typeof langOrDict === 'string' ) { var dict = dics_data[langOrDict] || dics_data[langOrDict.split('-')[0]]; return new Dictionary(dict); } else { return new Dictionary(langOrDict); } };
tehsis/lock
lib/i18n/index.js
JavaScript
mit
1,677
/*! taucharts - v0.6.0 - 2015-10-14 * https://github.com/TargetProcess/tauCharts * Copyright (c) 2015 Taucraft Limited; Licensed Apache License 2.0 */ !function(a,b){if("function"==typeof define&&define.amd)define(["underscore","d3"],function(a,c){return b(a,c)});else if("object"==typeof module&&module.exports){var c=require("underscore"),d=require("d3");module.exports=b(c,d)}else a.tauCharts=b(a._,a.d3)}(this,function(a,b){var c,d,e;return function(a){function b(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(b,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(a,d.concat([b,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(c){if(b(r,c)){var d=r[c];delete r[c],t[c]=!0,m.apply(a,d)}if(!b(q,c)&&!b(t,c))throw new Error("No "+c);return q[c]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(c,d,e,f){var h,k,l,m,n,s,u=[],v=typeof e;if(f=f||c,"undefined"===v||"function"===v){for(d=!d.length&&e.length?["require","exports","module"]:d,n=0;n<d.length;n+=1)if(m=o(d[n],f),k=m.f,"require"===k)u[n]=p.require(c);else if("exports"===k)u[n]=p.exports(c),s=!0;else if("module"===k)h=u[n]=p.module(c);else if(b(q,k)||b(r,k)||b(t,k))u[n]=j(k);else{if(!m.p)throw new Error(c+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=e?e.apply(q[c],u):void 0,c&&(h&&h.exports!==a&&h.exports!==q[c]?q[c]=h.exports:l===a&&s||(q[c]=l))}else c&&(q[c]=e)},c=d=n=function(b,c,d,e,f){if("string"==typeof b)return p[b]?p[b](c):j(o(b,c).f);if(!b.splice){if(s=b,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(b=c,c=d,d=null):b=a}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(a,b,c,d):setTimeout(function(){m(a,b,c,d)},4),n},n.config=function(a){return n(a)},c._defined=q,e=function(a,c,d){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");c.splice||(d=c,c=[]),b(q,a)||b(r,a)||(r[a]=[a,c,d])},e.amd={jQuery:!0}}(),e("../node_modules/almond/almond",function(){}),e("utils/utils-dom",["exports"],function(c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=document.createElement("div"),e={appendTo:function(a,b){var c;return a instanceof Node?c=a:(d.insertAdjacentHTML("afterbegin",a),c=d.childNodes[0]),b.appendChild(c),c},getScrollbarWidth:function(){var a=document.createElement("div");a.style.overflow="scroll",a.style.visibility="hidden",a.style.position="absolute",a.style.width="100px",a.style.height="100px",document.body.appendChild(a);var b=a.offsetWidth-a.clientWidth;return document.body.removeChild(a),b},getStyle:function(a,b){return window.getComputedStyle(a,void 0).getPropertyValue(b)},getStyleAsNum:function(a,b){return parseInt(this.getStyle(a,b)||0,10)},getContainerSize:function(a){var b=this.getStyleAsNum(a,"padding-left"),c=this.getStyleAsNum(a,"padding-right"),d=this.getStyleAsNum(a,"padding-bottom"),e=this.getStyleAsNum(a,"padding-top"),f=this.getStyleAsNum(a,"border-top-width"),g=this.getStyleAsNum(a,"border-left-width"),h=this.getStyleAsNum(a,"border-right-width"),i=this.getStyleAsNum(a,"border-bottom-width"),j=f+g+h+i,k=a.getBoundingClientRect();return{width:k.width-b-c-2*j,height:k.height-d-e-2*j}},getAxisTickLabelSize:function(c){var d=['<svg class="graphical-report__svg">','<g class="graphical-report__cell cell">','<g class="x axis">','<g class="tick"><text><%= xTick %></text></g>',"</g>","</g>","</svg>"].join(""),e=a.template(d),f=document.createElement("div");f.style.position="absolute",f.style.visibility="hidden",f.style.width="100px",f.style.height="100px",f.style.border="1px solid green",document.body.appendChild(f),f.innerHTML=e({xTick:c});var g=b.select(f).selectAll(".x.axis .tick text")[0][0],h={width:0,height:0},i=g.getBoundingClientRect();h.width=i.right-i.left,h.height=i.bottom-i.top;var j=0!==c.length?h.width/c.length:0;return h.width=h.width+1.5*j,document.body.removeChild(f),h}};c.utilsDom=e}),e("const",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var b="graphical-report__";a.CSS_PREFIX=b}),e("event",["exports"],function(a){"use strict";function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function c(a){var b=f[a];return b||(b=function(){for(var b,c,d=this,e=0;d=d.handler;){if(c=d.callbacks[a],"function"==typeof c){if(!b)for(b=[this],e=0;e<arguments.length;e++)b.push(arguments[e]);c.apply(d.context,b)}if(c=d.callbacks["*"],"function"==typeof c){if(!b)for(b=[this],e=0;e<arguments.length;e++)b.push(arguments[e]);c.call(d.context,{sender:this,type:a,args:b})}}},f[a]=b),b}Object.defineProperty(a,"__esModule",{value:!0});var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),e={},f={},g=function(){function a(){b(this,a),this.handler=null,this.emit_destroy=c("destroy")}return d(a,[{key:"addHandler",value:function(a,b){b=b||this,this.handler={callbacks:a,context:b,handler:this.handler}}},{key:"on",value:function(a,b,c){var d={};return d[a]=b,this.addHandler(d,c),d}},{key:"fire",value:function(a,b){c.call(this,a).call(this,b)}},{key:"removeHandler",value:function(a,b){var c,d=this;for(b=b||this;c=d,d=d.handler;)if(d.callbacks===a&&d.context===b)return d.callbacks=e,void(c.handler=d.handler)}},{key:"destroy",value:function(){this.emit_destroy(),this.handler=null}}]),a}();a.Emitter=g}),e("elements/element",["exports","../event"],function(a,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(a,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},h=function(a){function c(a){d(this,c),g(Object.getPrototypeOf(c.prototype),"constructor",this).call(this,a),this._elementNameSpace=a.namespace||"default",this._elementScalesHub={}}return e(c,a),f(c,[{key:"regScale",value:function(a,b){return this._elementScalesHub[a]=b,this}},{key:"getScale",value:function(a){return this._elementScalesHub[a]||null}},{key:"fireNameSpaceEvent",value:function(a,b){var c=this._elementNameSpace;this.fire(a+"."+c,b)}},{key:"subscribe",value:function(a){var c=arguments.length<=1||void 0===arguments[1]?function(a){return a}:arguments[1],d=arguments.length<=2||void 0===arguments[2]?function(a){return a}:arguments[2],e=this;["mouseover","mouseout","click","mousemove"].forEach(function(f){a.on(f,function(a){var g={data:c.call(this,a),event:d.call(this,b.event,a)};e.fire(f,g),e.fireNameSpaceEvent(f,g)})})}}]),c}(c.Emitter);a.Element=h}),e("elements/element.point",["exports","../const","./element"],function(b,c,d){"use strict";function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0});var g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},i=function(b){function d(b){var c=this;e(this,d),h(Object.getPrototypeOf(d.prototype),"constructor",this).call(this,b),this.config=b,this.config.guide=this.config.guide||{},this.config.guide.x=this.config.guide.x||{},this.config.guide.x=a.defaults(this.config.guide.x,{tickFontHeight:0,density:20}),this.config.guide.y=this.config.guide.y||{},this.config.guide.y=a.defaults(this.config.guide.y,{tickFontHeight:0,density:20}),this.on("highlight",function(a,b){return c.highlight(b)})}return f(d,b),g(d,[{key:"createScales",value:function(b){var c=this.config;this.xScale=b("pos",c.x,[0,c.options.width]),this.yScale=b("pos",c.y,[c.options.height,0]),this.color=b("color",c.color,{});var d=function(a,b,c,d,e){var f=Math.min(a,b),g=f*c;return Math.max(e,Math.min(d,g))},e=c.options.width,f=c.options.height,g=c.guide,h=1,i=.035,j=function(a){return 0!==a},k=.5*a.min([g.x.tickFontHeight,g.y.tickFontHeight].filter(j)),l=.5*a.min([g.x.density,g.y.density].filter(j));return this.size=b("size",c.size,{min:d(e,f,i,2,h),max:d(e,f,i,l,h),mid:d(e,f,i,k,h)}),this.regScale("x",this.xScale).regScale("y",this.yScale).regScale("size",this.size).regScale("color",this.color)}},{key:"drawFrames",value:function(a){var b=this,d=this.config.options,e=c.CSS_PREFIX+"dot dot i-role-element i-role-datum",f=this.xScale,g=this.yScale,h=this.color,i=this.size,j=function(){return this.attr({r:function(a){var b=a.data;return i(b[i.dim])},cx:function(a){var b=a.data;return f(b[f.dim])},cy:function(a){var b=a.data;return g(b[g.dim])},"class":function(a){var b=a.data;return e+" "+h(b[h.dim])}}).transition().duration(500).attr("r",function(a){var b=a.data;return i(b[i.dim])})},k=function(){return this.attr({r:function(a){var b=a.data;return i(b[i.dim])},cx:function(a){var b=a.data;return f(b[f.dim])},cy:function(a){var b=a.data;return g(b[g.dim])},"class":function(a){var b=a.data;return e+" "+h(b[h.dim])}})},l=function(){this.attr("class",function(a){return"frame-id-"+d.uid+" frame-"+a.hash}).call(function(){var a=this.selectAll("circle").data(function(a){return a.data.map(function(a){return{data:a,uid:d.uid}})});a.exit().remove(),a.call(k),a.enter().append("circle").call(j),b.subscribe(a,function(a){var b=a.data;return b})})},m=function(a){return{tags:a.key||{},hash:a.hash(),data:a.part()}},n=d.container.selectAll(".frame-id-"+d.uid).data(a.map(m),function(a){return a.hash});return n.exit().remove(),n.call(l),n.enter().append("g").call(l),[]}},{key:"highlight",value:function(a){this.config.options.container.selectAll(".dot").classed({"graphical-report__highlighted":function(b){var c=b.data;return a(c)===!0},"graphical-report__dimmed":function(b){var c=b.data;return a(c)===!1}})}}]),d}(d.Element);b.Point=i}),e("elements/decorators/show-text",["exports"],function(a){"use strict";function b(a){var b=a.container,c=a.guide,d=a.xScale,e=a.yScale,f=a.textScale,g=d.domain(),h=e.domain(),i=function(a){return d(a[d.dim])===d(g[0])},j=function(a){return d(a[d.dim])===d(g[g.length-1])},k=function(a){return e(a[e.dim])===e(h[h.length-1])},l=function(a){return e(a[e.dim])===e(h[0])},m=function(a){return i(a)?"caption-left-edge":j(a)?"caption-right-edge":l(a)?"caption-bottom-edge":k(a)?"caption-top-edge":""},n=c.text.fontSize,o=function(){c.text.fontColor&&this.style("fill",c.text.fontColor),this.attr("class",function(a){return"caption "+m(a)}).attr("transform",function(a){var b=k(a),f=j(a),g=l(a),h=b?n:0,i=f||!b&&!g?0:2,m=d(a[d.dim])+i+c.text.paddingX,o=e(a[e.dim])+h+c.text.paddingY;return"translate("+[m,o]+")"}).text(function(a){return f(a[f.dim])})},p=b.selectAll(".caption").data(function(a){var b=a.data;return b.data.filter(function(a){return a[f.dim]})});return p.exit().remove(),p.call(o),p.enter().append("text").call(o),p}Object.defineProperty(a,"__esModule",{value:!0}),a.elementDecoratorShowText=b}),e("elements/decorators/show-anchors",["exports"],function(a){"use strict";function b(a){var b=a.container,c=a.guide,d=a.xScale,e=a.yScale,f=function(){return this.attr({r:c.anchorSize,cx:function(a){return d(a[d.dim])},cy:function(a){return e(a[e.dim])},"class":"i-data-anchor"})},g=b.selectAll("circle").data(function(a){var b=a.data;return b.data});return g.exit().remove(),g.call(f),g.enter().append("circle").call(f),g}Object.defineProperty(a,"__esModule",{value:!0}),a.elementDecoratorShowAnchors=b}),e("utils/css-class-map",["exports","../const"],function(a,b){"use strict";function c(a){return f[a-1]||f[4]}function d(a){var b=0;return a>=160&&320>a?b=1:a>=320&&480>a?b=2:a>=480&&640>a?b=3:a>=640&&(b=4),g[b]}Object.defineProperty(a,"__esModule",{value:!0});var e=[1,2,3,4,5],f=e.map(function(a){return b.CSS_PREFIX+"line-opacity-"+a}),g=e.map(function(a){return b.CSS_PREFIX+"line-width-"+a});a.getLineClassesByWidth=d,a.getLineClassesByCount=c}),e("elements/element.line",["exports","../const","./element","./decorators/show-text","./decorators/show-anchors","../utils/css-class-map"],function(c,d,e,f,g,h){"use strict";function i(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function j(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var k=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),l=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},m=function(c){function e(b){var c=this;i(this,e),l(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,b),this.config=b,this.config.guide=this.config.guide||{},this.config.guide=a.defaults(this.config.guide,{cssClass:"",widthCssClass:"",showAnchors:!0,anchorSize:.1,text:{}}),this.config.guide.text=a.defaults(this.config.guide.text,{fontSize:11,paddingX:0,paddingY:0}),this.config.guide.color=a.defaults(this.config.guide.color,{fill:null}),this.on("highlight",function(a,b){return c.highlight(b)}),this.on("highlight-data-points",function(a,b){return c.highlightDataPoints(b)}),this.config.guide.showAnchors&&(this.on("mouseover",function(a,b){return a.fire("highlight-data-points",function(a){return a===b.data})}),this.on("mouseout",function(a,b){return a.fire("highlight-data-points",function(a){return!1})}))}return j(e,c),k(e,[{key:"createScales",value:function(a){var b=this.config;return this.xScale=a("pos",b.x,[0,b.options.width]),this.yScale=a("pos",b.y,[b.options.height,0]),this.color=a("color",b.color,{}),this.size=a("size",b.size,{}),this.text=a("text",b.text,{}),this.regScale("x",this.xScale).regScale("y",this.yScale).regScale("size",this.size).regScale("color",this.color).regScale("text",this.text)}},{key:"drawFrames",value:function(a){var c=this,e=this.config.guide,i=this.config.options,j=this.xScale,k=this.yScale,l=this.color,m=this.size,n=this.text,o=e.widthCssClass||(0,h.getLineClassesByWidth)(i.width),p=(0,h.getLineClassesByCount)(a.length),q="i-role-datum",r=d.CSS_PREFIX+"dot-line dot-line i-role-element "+q+" "+d.CSS_PREFIX+"dot ",s=d.CSS_PREFIX+"line i-role-element line "+o+" "+p+" "+e.cssClass+" ",t=b.svg.line().x(function(a){return j(a[j.dim])}).y(function(a){return k(a[k.dim])});e.interpolate&&t.interpolate(e.interpolate);var u=function(){var a=this.selectAll("path").data(function(a){var b=a.data;return[b.data]});if(a.exit().remove(),a.attr("d",t).attr("class",q),a.enter().append("path").attr("d",t).attr("class",q),c.subscribe(a,function(a){var c=b.mouse(this),d=c[0],e=c[1],f=a.map(function(a){var b=j(a[j.dim]),c=k(a[k.dim]);return{x:b,y:c,dist:Math.sqrt(Math.pow(d-b,2)+Math.pow(e-c,2)),data:a}}).sort(function(a,b){return a.dist-b.dist})[0];return f.data}),e.showAnchors&&!this.empty()){var d=(0,g.elementDecoratorShowAnchors)({xScale:j,yScale:k,guide:e,container:this});c.subscribe(d)}n.dim&&!this.empty()&&(0,f.elementDecoratorShowText)({guide:e,xScale:j,yScale:k,textScale:n,container:this})},v=function(){var a=this.selectAll("circle").data(function(a){return a.data.data.map(function(a){return{data:a,uid:i.uid}})}),b={r:function(a){var b=a.data;return m(b[m.dim])},cx:function(a){var b=a.data;return j(b[j.dim])},cy:function(a){var b=a.data;return k(b[k.dim])},"class":function(a){var b=a.data;return r+" "+l(b[l.dim])}};a.exit().remove(),a.attr(b),a.enter().append("circle").attr(b),c.subscribe(a,function(a){var b=a.data;return b})},w=function(a,b){return function(){this.attr("class",function(b){var c=b.data;return s+" "+l(c.tags[l.dim])+" "+a+" frame-"+c.hash}).call(function(){b?(e.color.fill&&!l.dim&&this.style({fill:e.color.fill,stroke:e.color.fill}),u.call(this)):v.call(this)})}},x=function(a){return{data:{tags:a.key||{},hash:a.hash(),data:a.part()},uid:i.uid}},y=function(b,c,d){var e="line"===b,f=i.container.selectAll(".frame-"+c).data(a.map(x).filter(d),function(a){var b=a.data;return b.hash});f.exit().remove(),f.call(w("frame-"+c,e)),f.enter().append("g").call(w("frame-"+c,e))};y("line","line-"+i.uid,function(a){var b=a.data;return b.data.length>1}),y("anch","anch-"+i.uid,function(a){var b=a.data;return b.data.length<2})}},{key:"highlight",value:function(a){var b=this.config.options.container;b.selectAll(".line").classed({"graphical-report__highlighted":function(b){var c=b.data;return a(c.tags)===!0},"graphical-report__dimmed":function(b){var c=b.data;return a(c.tags)===!1}}),b.selectAll(".dot-line").classed({"graphical-report__highlighted":function(b){var c=b.data;return a(c)===!0},"graphical-report__dimmed":function(b){var c=b.data;return a(c)===!1}})}},{key:"highlightDataPoints",value:function(a){var b=this,c=this.color,d="i-data-anchor";this.config.options.container.selectAll("."+d).attr({r:function(c){return a(c)?3:b.config.guide.anchorSize},"class":function(a){return d+" "+c(a[c.dim])}})}}]),e}(e.Element);c.Line=m}),e("elements/element.interval",["exports","../const","./element"],function(b,c,d){"use strict";function e(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0});var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},j=function(b){function d(b){var c=this;f(this,d),i(Object.getPrototypeOf(d.prototype),"constructor",this).call(this,b),this.config=b,this.config.guide=a.defaults(this.config.guide||{},{prettify:!0}),this.on("highlight",function(a,b){return c.highlight(b)})}return g(d,b),h(d,[{key:"createScales",value:function(a){var b=this.config;return this.xScale=a("pos",b.x,[0,b.options.width]),this.yScale=a("pos",b.y,[b.options.height,0]),this.color=a("color",b.color,{}),this.size=a("size",b.size,{}),this.regScale("x",this.xScale).regScale("y",this.yScale).regScale("size",this.size).regScale("color",this.color)}},{key:"drawFrames",value:function(a){var b=this,c=this,d=this.config.options,e=this.config,f=this.xScale,g=this.yScale,h=this.color,i=h.domain(),j=function(a){var b=i.indexOf(a[h.dim]);return-1===b?0:b};j.koeff=1/((i.length||1)+1);var k={xScale:f,yScale:g,colorScale:h,colorIndexScale:j,width:e.options.width,height:e.options.height,prettify:e.guide.prettify},l=e.flip||e.guide.flip,m=l?this._buildHorizontalDrawMethod(k):this._buildVerticalDrawMethod(k),n=function(){return this.attr(m)},o=function(){this.attr("class","i-role-bar-group");var a=this.selectAll(".bar").data(function(a){return a.values.map(function(b){return{data:b,uid:a.uid}})});a.exit().remove(),a.call(n),a.enter().append("rect").call(n),c.subscribe(a,function(a){var b=a.data;return b})},p=d.container.selectAll(".i-role-bar-group").data(a.map(function(a){return{key:a.key,values:a.part(),uid:b.config.options.uid}}));p.exit().remove(),p.call(o),p.enter().append("g").call(o)}},{key:"_buildVerticalDrawMethod",value:function(a){var b=a.colorScale,d=a.xScale,e=a.yScale,f=a.colorIndexScale,g=(a.width,a.height),h=a.prettify,i=this._buildDrawMethod({baseScale:d,valsScale:e,colorIndexScale:f,defaultBaseAbsPosition:g}),j=i.calculateBarX,k=i.calculateBarY,l=i.calculateBarH,m=i.calculateBarW,n=1;return{x:function(a){var b=a.data;return j(b)},y:function o(a){var b=a.data,o=k(b);if(h){var c=l(b),d=n>c;return d&&b[e.dim]>0?o-n:o}return o},height:function(a){var b=a.data,c=l(b);if(h){var d=b[e.dim];return 0===d?c:Math.max(n,c)}return c},width:function(a){var b=a.data;return m(b)},"class":function(a){var d=a.data;return"i-role-element i-role-datum bar "+c.CSS_PREFIX+"bar "+b(d[b.dim])}}}},{key:"_buildHorizontalDrawMethod",value:function(a){var b=a.colorScale,d=a.xScale,e=a.yScale,f=a.colorIndexScale,g=(a.width,a.height,a.prettify),h=this._buildDrawMethod({baseScale:e,valsScale:d,colorIndexScale:f,defaultBaseAbsPosition:0}),i=h.calculateBarX,j=h.calculateBarY,k=h.calculateBarH,l=h.calculateBarW,m=1;return{y:function(a){var b=a.data;return i(b)},x:function n(a){var b=a.data,n=j(b);if(g){var c=k(b),e=b[d.dim],f=0;0===e&&(f=0),e>0&&(f=c),0>e&&(f=0-m);var h=m>c;return h?n+f:n}return n},height:function(a){var b=a.data;return l(b)},width:function(a){var b=a.data,c=k(b);if(g){var e=b[d.dim];return 0===e?c:Math.max(m,c)}return c},"class":function(a){var d=a.data;return"i-role-element i-role-datum bar "+c.CSS_PREFIX+"bar "+b(d[b.dim])}}}},{key:"_buildDrawMethod",value:function(a){var b=a.valsScale,c=a.baseScale,d=a.colorIndexScale,f=a.defaultBaseAbsPosition,g=5,h=1,i=function(){var a=Math.min.apply(Math,e(b.domain())),c=!isNaN(a);return c?b(0>=a?0:a):f}(),j=function(a){return c.stepSize(a[c.dim])*d.koeff||g},k=function(a){return a>2*h?h:0},l=function(a){return 0===c.stepSize(a[c.dim])?0:j(a)},m=function(a){var b=j(a),c=k(b);return b-2*c},n=function(a){return Math.abs(b(a[b.dim])-i)},o=function(a){var b=a[c.dim],e=c(b)-c.stepSize(b)/2,f=e-m(a)/2,g=(d(a)+1)*l(a);return f+g},p=function(a){return Math.min(i,b(a[b.dim]))};return{calculateBarX:o,calculateBarY:p,calculateBarH:n,calculateBarW:m}}},{key:"highlight",value:function(a){this.config.options.container.selectAll(".bar").classed({"graphical-report__highlighted":function(b){var c=b.data;return a(c)===!0},"graphical-report__dimmed":function(b){var c=b.data;return a(c)===!1}})}}]),d}(d.Element);b.Interval=j}),e("error",["exports"],function(a){"use strict";function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function c(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(a,"__esModule",{value:!0});var d=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},e=function(a){function e(a,c){b(this,e),d(Object.getPrototypeOf(e.prototype),"constructor",this).call(this),this.name="TauChartError",this.message=a,this.errorCode=c}return c(e,a),e}(Error),f={INVALID_DATA_TO_STACKED_BAR_CHART:"INVALID_DATA_TO_STACKED_BAR_CHART",NO_DATA:"NO_DATA",NOT_SUPPORTED_TYPE_CHART:"NOT_SUPPORTED_TYPE_CHART",UNKNOWN_UNIT_TYPE:"UNKNOWN_UNIT_TYPE"};a.TauChartError=e,a.errorCodes=f}),e("elements/element.interval.stacked",["exports","underscore","./../const","./element","./../error"],function(a,b,c,d,e){"use strict";function f(a){return a&&a.__esModule?a:{"default":a}}function g(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function i(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(a,"__esModule",{value:!0});var j=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),k=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},l=f(b),m=function(a){function b(a){var c=this;h(this,b),k(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,a),this.config=a,this.config.guide=l["default"].defaults(this.config.guide||{},{prettify:!0}),this.on("highlight",function(a,b){return c.highlight(b)})}return i(b,a),j(b,null,[{key:"embedUnitFrameToSpec",value:function(a,b){var c=a.flip,d=c?a.x:a.y,f=c?a.y:a.x,h=b.scales[d],i=b.scales[f],j=i.dim,k=h.dim,m=a.frames.reduce(function(a,b){var c=b.part(),d=c.some(function(a){return"number"!=typeof a[k]});if(d)throw new e.TauChartError("Stacked field ["+k+"] should be a number",e.errorCodes.INVALID_DATA_TO_STACKED_BAR_CHART);return c.reduce(function(a,b){var c=b[k],d=b[j],e=c>=0?a.positive:a.negative;return e[d]=e[d]||0,e[d]+=c,a},a),a},{negative:{},positive:{}}),n=Math.min.apply(Math,g(l["default"].values(m.negative).concat(0))),o=Math.max.apply(Math,g(l["default"].values(m.positive).concat(0)));(!h.hasOwnProperty("max")||h.max<o)&&(h.max=o),(!h.hasOwnProperty("min")||h.min>n)&&(h.min=n)}}]),j(b,[{key:"createScales",value:function(a){var b=this.config;this.xScale=a("pos",b.x,[0,b.options.width]),this.yScale=a("pos",b.y,[b.options.height,0]),this.color=a("color",b.color,{});var c=function(a,b,c,d,e){var f=Math.min(a,b),g=f*c;return Math.max(e,Math.min(d,g))},d=b.options.width,e=b.options.height,f=b.guide,g=1,h=1,i=function(a){return 0!==a},j=.5*l["default"].min([f.x.tickFontHeight,f.y.tickFontHeight].filter(i)),k=.5*l["default"].min([f.x.density,f.y.density].filter(i));return this.size=a("size",b.size,{normalize:!0,func:"linear",min:0,max:c(d,e,h,k,g),mid:c(d,e,h,j,g)}),this.regScale("x",this.xScale).regScale("y",this.yScale).regScale("size",this.size).regScale("color",this.color)}},{key:"drawFrames",value:function(a){var b,c=this,d=this.config,e=d.options,f=this.xScale,g=this.yScale,h=this.size,i=this.color,j=d.flip;b=j?function(a,b){var c=b[f.dim],d=b[g.dim],e={y:d,w:b[h.dim],c:b[i.dim]};if(c>=0)a.positive[d]=(a.positive[d]||0)+c,e.x=a.positive[d],e.h=c;else{var j=a.negative[d]||0;a.negative[d]=j+c,e.x=j,e.h=Math.abs(c)}return e}:function(a,b){var c=b[f.dim],d=b[g.dim],e={x:c,w:b[h.dim],c:b[i.dim]};if(d>=0)a.positive[c]=(a.positive[c]||0)+d,e.y=a.positive[c],e.h=d;else{var j=a.negative[c]||0;a.negative[c]=j+d,e.y=j,e.h=Math.abs(d)}return e};var k=this._buildDrawModel(j,{xScale:f,yScale:g,sizeScale:h,colorScale:i,prettify:d.guide.prettify}),l=function(){return this.attr(k)},m=e.uid,n={positive:{},negative:{}},o=function(){this.attr("class",function(a){return"frame-id-"+m+" frame-"+a.hash+" i-role-bar-group"}).call(function(){var a=this.selectAll(".bar-stack").data(function(a){return a.data.map(function(a){return{uid:m,data:a,view:b(n,a)}})});a.exit().remove(),a.call(l),a.enter().append("rect").call(l),c.subscribe(a,function(a){var b=a.data;return b},function(a,b){var c=b.view;return a.chartElementViewModel=c,a})})},p=function(a){return{tags:a.key||{},hash:a.hash(),data:a.part()}},q=e.container.selectAll(".frame-id-"+m).data(a.map(p),function(a){return a.hash});return q.exit().remove(),q.call(o),q.enter().append("g").call(o),[]}},{key:"_buildDrawModel",value:function(a,b){var d,e,f,g,h=b.xScale,i=b.yScale,j=b.sizeScale,k=b.colorScale,l=b.prettify,m=1,n=5,o=.5;return a?(e=function(a){var b=Math.abs(h(a.x)-h(a.x-a.h));return l&&(b=Math.max(m,b)),b},d=function(a){var b=(i.stepSize(a.y)||n)*o*j(a.w);return l&&(b=Math.max(m,b)),b},g=function(a){return h(a.x-a.h)},f=function(a){return i(a.y)-d(a)/2}):(e=function(a){var b=(h.stepSize(a.x)||n)*o*j(a.w);return l&&(b=Math.max(m,b)),b},d=function(a){var b=Math.abs(i(a.y)-i(a.y-a.h));return l&&(b=Math.max(m,b)),b},g=function(a){return h(a.x)-e(a)/2},f=function(a){return i(a.y)}),{x:function(a){var b=a.view;return g(b)},y:function(a){var b=a.view;return f(b)},height:function(a){var b=a.view;return d(b)},width:function(a){var b=a.view;return e(b)},"class":function(a){var b=a.view;return"i-role-element i-role-datum bar-stack "+c.CSS_PREFIX+"bar-stacked "+k(b.c)}}}},{key:"highlight",value:function(a){this.config.options.container.selectAll(".bar-stack").classed({"graphical-report__highlighted":function(b){var c=b.data;return a(c)===!0},"graphical-report__dimmed":function(b){var c=b.data;return a(c)===!1; }})}}]),b}(d.Element);a.StackedInterval=m}),e("utils/utils",["exports","../elements/element.point","../elements/element.line","../elements/element.interval","../elements/element.interval.stacked"],function(b,c,d,e,f){"use strict";Object.defineProperty(b,"__esModule",{value:!0});var g=function n(a,b,c,d){var e=d(c(a),a);return(e[b]||[]).forEach(function(a){return n(a,b,c,d)}),e},h=function o(a,b,c){var d=arguments.length<=3||void 0===arguments[3]?0:arguments[3],e=b(a,d);e&&(a.units||[]).map(function(a){return o(a,b,c,d+1)}),c(a,d)},i=0,j={},k=function(){function a(a){return"object"==typeof a?JSON.parse(JSON.stringify(a)):a}function b(a){for(var b in a)this[b]=a[b]}function c(){this.copiedObjects=[];var a=this;this.recursiveDeepCopy=function(b){return a.deepCopy(b)},this.depth=0}function d(a,b){var d=new c;return b&&(d.maxDepth=b),d.deepCopy(a)}var e=[];return b.prototype={constructor:b,canCopy:function(a){return!1},create:function(a){},populate:function(a,b,c){}},c.prototype={constructor:c,maxDepth:256,cacheResult:function(a,b){this.copiedObjects.push([a,b])},getCachedResult:function(a){for(var b=this.copiedObjects,c=b.length,d=0;c>d;d++)if(b[d][0]===a)return b[d][1];return void 0},deepCopy:function(a){if(null===a)return null;if("object"!=typeof a)return a;var b=this.getCachedResult(a);if(b)return b;for(var c=0;c<e.length;c++){var d=e[c];if(d.canCopy(a))return this.applyDeepCopier(d,a)}throw new Error("no DeepCopier is able to copy "+a)},applyDeepCopier:function(a,b){var c=a.create(b);if(this.cacheResult(b,c),this.depth++,this.depth>this.maxDepth)throw new Error("Exceeded max recursion depth in deep copy.");return a.populate(this.recursiveDeepCopy,b,c),this.depth--,c}},d.DeepCopier=b,d.deepCopiers=e,d.register=function(a){a instanceof b||(a=new b(a)),e.unshift(a)},d.register({canCopy:function(){return!0},create:function(b){return b instanceof b.constructor?a(b.constructor.prototype):{}},populate:function(a,b,c){for(var d in b)b.hasOwnProperty(d)&&(c[d]=a(b[d]));return c}}),d.register({canCopy:function(a){return a instanceof Array},create:function(a){return new a.constructor},populate:function(a,b,c){for(var d=0;d<b.length;d++)c.push(a(b[d]));return c}}),d.register({canCopy:function(a){return a instanceof Date},create:function(a){return new Date(a)}}),d}(),l=[e.Interval,c.Point,d.Line,f.StackedInterval],m={clone:function(a){return k(a)},isArray:function(a){return Array.isArray(a)},isChartElement:function(a){return l.some(function(b){return a instanceof b})},isLineElement:function(a){return a instanceof d.Line},autoScale:function(a){var b=10,c=Math.min.apply(null,a),d=Math.max.apply(null,a);if(c===d){var e=d>=0?-1:1,f=d||1;d-=e*f/b}for(var g=[c,d],h=g[1]-g[0],i=Math.pow(10,Math.floor(Math.log(h/b)/Math.LN10)),j=b/h*i,k=[[.15,10],[.35,5],[.75,2],[1,1],[2,1]],l=-1;j>k[++l][0];);i*=k[l][1],g[0]=Math.floor(g[0]/i)*i,g[1]=Math.ceil(g[1]/i)*i;var m=c-g[0],n=g[1]-d,o=i/2;if(c>=0)g[0]=0;else{var p=o>=m?i:0;g[0]=g[0]-p}if(0>=d)g[1]=0;else{var q=o>=n?i:0;g[1]=g[1]+q}return[parseFloat(g[0].toFixed(15)),parseFloat(g[1].toFixed(15))]},traverseJSON:g,generateHash:function(a){var b=btoa(encodeURIComponent(a)).replace(/=/g,"_");return j.hasOwnProperty(b)||(j[b]="H"+ ++i),j[b]},generateRatioFunction:function(b,c,d){var e=function(a){return a instanceof Date?a.getTime():a},f=0,g=null,h=a.memoize(function(b,c){return a(b).chain().map(function(a){return c.reduce(function(b,c){return b.concat(e(a[c]))},[])}).uniq(function(a){return JSON.stringify(a)}).reduce(function(a,b){var c=b[0];return a[c]=a[c]||0,a[c]+=1,a},{}).value()},function(a,b){var c=g===a?f:++f;return g=a,b.join("")+"-"+c});return function(e,f,g){var i=g.length,j=d.getSpec(),k=j.sources["/"].data,l=j.unit.units[0].guide||{};l.padding=l.padding||{l:0,r:0,t:0,b:0};var m=0;"x"===b?m=l.padding.l+l.padding.r:"y"===b&&(m=l.padding.t+l.padding.b);var n=function(b){return a.values(h(k,b)).reduce(function(a,b){return a+b},0)},o=function(a,b){return h(k,a)[b]},p=n(c),q=(f-i*m)/p,r=o(c,e);return(r*q+m)/f}},traverseSpec:h,isSpecRectCoordsOnly:function(a){var b=!0;try{m.traverseSpec(a,function(a){if(0===a.type.indexOf("COORDS.")&&"COORDS.RECT"!==a.type)throw new Error("Not applicable")},function(a){return a})}catch(c){"Not applicable"===c.message&&(b=!1)}return b}};b.utils=m}),e("unit-domain-period-generator",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var b={day:{cast:function(a){return new Date(a.setHours(0,0,0,0))},next:function(a){return new Date(a.setDate(a.getDate()+1))}},week:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(a.getDate()-a.getDay()))},next:function(a){return new Date(a.setDate(a.getDate()+7))}},month:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1))},next:function(a){return new Date(a.setMonth(a.getMonth()+1))}},quarter:{cast:function(a){a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1));var b=a.getMonth(),c=b-b%3;return new Date(a.setMonth(c))},next:function(a){return new Date(a.setMonth(a.getMonth()+3))}},year:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1)),a=new Date(a.setMonth(0))},next:function(a){return new Date(a.setFullYear(a.getFullYear()+1))}}},c={add:function(a,c){return b[a.toLowerCase()]=c,this},get:function(a){return b[a.toLowerCase()]},generate:function(a,c,d){var e=[],f=b[d.toLowerCase()];if(f){var g=f.cast(new Date(c)),h=f.cast(new Date(a));for(e.push(h);(h=f.next(new Date(h)))<=g;)e.push(h)}return e}};a.UnitDomainPeriodGenerator=c}),e("algebra",["exports","underscore","./unit-domain-period-generator"],function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}Object.defineProperty(a,"__esModule",{value:!0});var f=d(b),g=function(a){return a instanceof Date?a.getTime():a},h={cross:function(a,b,c){var d=a(),e=(0,f["default"])(d).chain().pluck(b).unique(g).value(),h=(0,f["default"])(d).chain().pluck(c).unique(g).value(),i=0===e.length?[null]:e,j=0===h.length?[null]:h;return(0,f["default"])(j).reduce(function(a,d){return a.concat((0,f["default"])(i).map(function(a){var e={};return b&&(e[b]=g(a)),c&&(e[c]=g(d)),e}))},[])},cross_period:function(a,b,d,e,h){var i=a(),j=(0,f["default"])(i).chain().pluck(b).unique(g).value(),k=(0,f["default"])(i).chain().pluck(d).unique(g).value(),l=0===j.length?[null]:j,m=0===k.length?[null]:k;return e&&(l=c.UnitDomainPeriodGenerator.generate(f["default"].min(j),f["default"].max(j),e)),h&&(m=c.UnitDomainPeriodGenerator.generate(f["default"].min(k),f["default"].max(k),h)),(0,f["default"])(m).reduce(function(a,c){return a.concat((0,f["default"])(l).map(function(a){var e={};return b&&(e[b]=g(a)),d&&(e[d]=g(c)),e}))},[])},groupBy:function(a,b){var c=a(),d=(0,f["default"])(c).chain().pluck(b).unique(g).value();return d.map(function(a){return e({},b,g(a))})},none:function(){return[null]}};a.FramesAlgebra=h}),e("data-frame",["exports","./utils/utils"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),e=function(){function a(b,d){var e=b.key,f=b.pipe,g=b.source,h=b.units,i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];c(this,a),this.key=e,this.pipe=f||[],this.source=g,this.units=h,this._frame={key:e,source:g,pipe:this.pipe},this._data=d,this._pipeReducer=function(a,b){return i[b.type](a,b.args)}}return d(a,[{key:"hash",value:function(){var a=[this._frame.pipe,this._frame.key,this._frame.source].map(JSON.stringify).join("");return b.utils.generateHash(a)}},{key:"full",value:function(){return this._data}},{key:"part",value:function(){var a=arguments.length<=0||void 0===arguments[0]?function(a){return a}:arguments[0];return this._frame.pipe.map(a).reduce(this._pipeReducer,this._data)}}]),a}();a.DataFrame=e}),e("charts/tau.gpl",["exports","../event","../utils/utils","../utils/utils-dom","../const","../algebra","../data-frame"],function(c,d,e,f,g,h,i){"use strict";function j(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function k(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var l=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),m=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},n=function(b){return a.isDate(b)?b.getTime():b},o=function(c){function d(b,c,e){j(this,d),m(Object.getPrototypeOf(d.prototype),"constructor",this).call(this),this.config=b,this.config.settings=this.config.settings||{},this.sources=b.sources,this.unitSet=e,this.scalesHub=c,this.scales=b.scales,this.transformations=a.extend(b.transformations||{},{where:function(b,c){var d=a.map(c,function(a,b){return function(c){return n(c[b])===a}});return a(b).filter(function(b){return a.every(d,function(a){return a(b)})})}}),this.onUnitDraw=b.onUnitDraw,this.onUnitsStructureExpanded=b.onUnitsStructureExpanded||function(a){return a}}return k(d,c),l(d,[{key:"renderTo",value:function(c,d){var e=b.select(c);this.config.settings.size=d||a.defaults(f.utilsDom.getContainerSize(e.node())),this.root=this._expandUnitsStructure(this.config.unit),this._adaptSpecToUnitsStructure(this.root,this.config),this.onUnitsStructureExpanded(this.config);var h=e.selectAll("svg").data([1]),i=this.config.settings.size,j={"class":g.CSS_PREFIX+"svg",width:i.width,height:i.height};h.attr(j),h.enter().append("svg").attr(j).append("g").attr("class",g.CSS_PREFIX+"cell cell frame-root"),this.root.options={container:e.select(".frame-root"),frameId:"root",left:0,top:0,width:i.width,height:i.height},this._drawUnitsStructure(this.root,this._datify({source:this.root.expression.source,pipe:[]}))}},{key:"_expandUnitsStructure",value:function(a){var b=this,c=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],d=this;if(a.expression.operator===!1)a.frames=a.frames.map(function(a){return d._datify(a)});else{var f=this._parseExpression(a.expression,c);a.transformation=a.transformation||[],a.frames=f.exec().map(function(b){var g=f.inherit?c:[],h=g.concat([{type:"where",args:b}]).concat(a.transformation);return d._datify({key:b,pipe:h,source:f.source,units:a.units?a.units.map(function(a){var b=e.utils.clone(a);return b.guide=a.guide,b}):[]})})}return a.frames.forEach(function(a){return a.units.forEach(function(c){return b._expandUnitsStructure(c,a.pipe)})}),a}},{key:"_adaptSpecToUnitsStructure",value:function(a,b){var c=this,d=this.unitSet.get(a.type);return d.embedUnitFrameToSpec&&d.embedUnitFrameToSpec(a,b),a.frames.forEach(function(a){return a.units.forEach(function(a){return c._adaptSpecToUnitsStructure(a,b)})}),a}},{key:"_drawUnitsStructure",value:function(a,b){var c=arguments.length<=2||void 0===arguments[2]?null:arguments[2],d=this,e=a.expression.inherit===!1?null:b,f=d.unitSet.get(a.type),g=new f(a);return g.parentUnit=c,g.createScales(function(a,b,c){var f=b||a+":default";return d.scalesHub.createScaleInfo(d.scales[f],e).create(c)}).drawFrames(a.frames,function(a){return function(b,c){d._drawUnitsStructure.bind(d)(b,c,a)}}(g)),d.onUnitDraw&&d.onUnitDraw(g),a}},{key:"_datify",value:function(a){return new i.DataFrame(a,this.sources[a.source].data,this.transformations)}},{key:"_parseExpression",value:function(a,b){var c=this,d=a.operator||"none",e=a.source,f=a.inherit!==!1,g=a.params,i={source:e,pipe:f?b:[]},j=function(){return c._datify(i).part()},k=h.FramesAlgebra[d];if(!k)throw new Error(d+" operator is not supported");return{source:e,inherit:f,func:k,args:g,exec:function(){return k.apply(null,[j].concat(g))}}}}]),d}(d.Emitter);c.GPL=o}),function(a,b){"function"==typeof e&&e.amd?e("tau-tooltip",[],b):"object"==typeof module&&module.exports?module.exports=b():"object"==typeof exports?exports.Tooltip=b():a.Tooltip=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b){"use strict";function c(a,b){for(var c in b)a[c]=b[c];return a}function d(a){return a&&null!=a.setInterval}function e(a){var b=k.pageYOffset||m.scrollTop,e=k.pageXOffset||m.scrollLeft,f={left:0,right:0,top:0,bottom:0,width:0,height:0};if(d(a))f.width=k.innerWidth||m.clientWidth,f.height=k.innerHeight||m.clientHeight;else{if(!m.contains(a)||null==a.getBoundingClientRect)return f;c(f,a.getBoundingClientRect()),f.width=f.right-f.left,f.height=f.bottom-f.top}return f.top=f.top+b-m.clientTop,f.left=f.left+e-m.clientLeft,f.right=f.left+f.width,f.bottom=f.top+f.height,f}function f(a){return 0|Math.round(String(a).replace(/[^\-0-9.]/g,""))}function g(a){var b=String(o(a,g.propName)),c=b.match(/([0-9.]+)([ms]{1,2})/);return c&&(b=Number(c[1]),"s"===c[2]&&(b*=1e3)),0|b}function h(a,b){return this instanceof h?(this.hidden=1,this.options=c(p(h.defaults),b),this._createElement(),void(a&&this.content(a))):new h(a,b)}Object.defineProperty(b,"__esModule",{value:!0});var i=function(a){return{add:function(b){a.classList.add(b)},remove:function(b){a.classList.remove(b)}}},j=function(a,b){return a.indexOf(b)},k=window,l=k.document,m=l.documentElement,n=["top","bottom"],o=k.getComputedStyle;g.propName=function(){for(var a=l.createElement("div"),b=["transitionDuration","webkitTransitionDuration"],c="1s",d=0;d<b.length;d++)if(a.style[b[d]]=c,a.style[b[d]]===c)return b[d]}();var p=Object.create;h.prototype._createElement=function(){this.element=l.createElement("div"),this.classes=i(this.element),this.classes.add(this.options.baseClass);for(var a,b=0;b<h.classTypes.length;b++)a=h.classTypes[b]+"Class",this.options[a]&&this.classes.add(this.options[a])},h.prototype.type=function(a){return this.changeClassType("type",a)},h.prototype.effect=function(a){return this.changeClassType("effect",a)},h.prototype.changeClassType=function(a,b){return a+="Class",this.options[a]&&this.classes.remove(this.options[a]),this.options[a]=b,b&&this.classes.add(b),this},h.prototype.updateSize=function(){return this.hidden&&(this.element.style.visibility="hidden",l.body.appendChild(this.element)),this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,null==this.spacing&&(this.spacing=null!=this.options.spacing?this.options.spacing:f(o(this.element,"top"))),this.hidden?(l.body.removeChild(this.element),this.element.style.visibility=""):this.position(),this},h.prototype.content=function(a){return"object"==typeof a?(this.element.innerHTML="",this.element.appendChild(a)):this.element.innerHTML=a,this.updateSize(),this},h.prototype.place=function(a){return this.options.place=a,this.hidden||this.position(),this},h.prototype.attach=function(a){return this.attachedTo=a,this.hidden||this.position(),this},h.prototype.detach=function(){return this.hide(),this.attachedTo=null,this},h.prototype._pickPlace=function(a){if(!this.options.auto)return this.options.place;var b=e(k),c=this.options.place.split("-"),d=this.spacing;if(-1!==j(n,c[0]))switch(a.top-this.height-d<=b.top?c[0]="bottom":a.bottom+this.height+d>=b.bottom&&(c[0]="top"),c[1]){case"left":a.right-this.width<=b.left&&(c[1]="right");break;case"right":a.left+this.width>=b.right&&(c[1]="left");break;default:a.left+a.width/2+this.width/2>=b.right?c[1]="left":a.right-a.width/2-this.width/2<=b.left&&(c[1]="right")}else switch(a.left-this.width-d<=b.left?c[0]="right":a.right+this.width+d>=b.right&&(c[0]="left"),c[1]){case"top":a.bottom-this.height<=b.top&&(c[1]="bottom");break;case"bottom":a.top+this.height>=b.bottom&&(c[1]="top");break;default:a.top+a.height/2+this.height/2>=b.bottom?c[1]="top":a.bottom-a.height/2-this.height/2<=b.top&&(c[1]="bottom")}return c.join("-")},h.prototype.position=function(a,b){this.attachedTo&&(a=this.attachedTo),null==a&&this._p?(a=this._p[0],b=this._p[1]):this._p=arguments;var c="number"==typeof a?{left:0|a,right:0|a,top:0|b,bottom:0|b,width:0,height:0}:e(a),d=this.spacing,f=this._pickPlace(c);f!==this.curPlace&&(this.curPlace&&this.classes.remove(this.curPlace),this.classes.add(f),this.curPlace=f);var g,h;switch(this.curPlace){case"top":g=c.top-this.height-d,h=c.left+c.width/2-this.width/2;break;case"top-left":g=c.top-this.height-d,h=c.right-this.width;break;case"top-right":g=c.top-this.height-d,h=c.left;break;case"bottom":g=c.bottom+d,h=c.left+c.width/2-this.width/2;break;case"bottom-left":g=c.bottom+d,h=c.right-this.width;break;case"bottom-right":g=c.bottom+d,h=c.left;break;case"left":g=c.top+c.height/2-this.height/2,h=c.left-this.width-d;break;case"left-top":g=c.bottom-this.height,h=c.left-this.width-d;break;case"left-bottom":g=c.top,h=c.left-this.width-d;break;case"right":g=c.top+c.height/2-this.height/2,h=c.right+d;break;case"right-top":g=c.bottom-this.height,h=c.right+d;break;case"right-bottom":g=c.top,h=c.right+d}return this.element.style.top=Math.round(g)+"px",this.element.style.left=Math.round(h)+"px",this},h.prototype.show=function(a,b){return a=this.attachedTo?this.attachedTo:a,clearTimeout(this.aIndex),null!=a&&this.position(a,b),this.hidden&&(this.hidden=0,l.body.appendChild(this.element)),this.attachedTo&&this._aware(),this.options.inClass&&(this.options.effectClass&&void this.element.clientHeight,this.classes.add(this.options.inClass)),this},h.prototype.getElement=function(){return this.element},h.prototype.hide=function(){if(!this.hidden){var a=this,b=0;return this.options.inClass&&(this.classes.remove(this.options.inClass),this.options.effectClass&&(b=g(this.element))),this.attachedTo&&this._unaware(),clearTimeout(this.aIndex),this.aIndex=setTimeout(function(){a.aIndex=0,l.body.removeChild(a.element),a.hidden=1},b),this}},h.prototype.toggle=function(a,b){return this[this.hidden?"show":"hide"](a,b)},h.prototype.destroy=function(){clearTimeout(this.aIndex),this._unaware(),this.hidden||l.body.removeChild(this.element),this.element=this.options=null},h.prototype._aware=function(){var a=j(h.winAware,this);-1===a&&h.winAware.push(this)},h.prototype._unaware=function(){var a=j(h.winAware,this);-1!==a&&h.winAware.splice(a,1)},h.reposition=function(){function a(){!c&&h.winAware.length&&(c=d(b))}function b(){c=0;for(var a,b=0,d=h.winAware.length;d>b;b++)a=h.winAware[b],a.position()}var c,d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return setTimeout(a,17)};return a}(),h.winAware=[],window.addEventListener("resize",h.reposition),window.addEventListener("scroll",h.reposition),h.classTypes=["type","effect"],h.defaults={baseClass:"tooltip",typeClass:null,effectClass:null,inClass:"in",place:"top",spacing:null,auto:0},b.Tooltip=h}])}),e("api/balloon",["exports","../const","tau-tooltip"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),c.Tooltip.defaults.baseClass=b.CSS_PREFIX+"tooltip",a.Tooltip=c.Tooltip}),e("plugins",["exports"],function(a){"use strict";function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var c=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),d=function(){function a(c,d){b(this,a),this.chart=d,this._plugins=c.map(this.initPlugin,this)}return c(a,[{key:"initPlugin",value:function(a){var b=this;a.init&&a.init(this.chart);var c=function(){};this.chart.on("destroy",a.destroy&&a.destroy.bind(a)||c),Object.keys(a).forEach(function(c){if(0===c.indexOf("on")){var d=c.substr(2);b.chart.on(d.toLowerCase(),a[c].bind(a))}})}}]),a}();a.Plugins=d}),e("units-registry",["exports","./error"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var c={},d={reg:function(a,b){return c[a]=b,this},get:function(a){if(!c.hasOwnProperty(a))throw new b.TauChartError("Unknown unit type: "+a,b.errorCodes.UNKNOWN_UNIT_TYPE);return c[a]}};a.unitsRegistry=d}),e("scales-registry",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var b={},c={reg:function(a,c){return b[a]=c,this},get:function(a){return b[a]}};a.scalesRegistry=c}),e("scales-factory",["exports","./data-frame"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),e=function(){function a(b,d,e){c(this,a),this.registry=b,this.sources=d,this.scales=e}return d(a,[{key:"createScaleInfo",value:function(a){var c=arguments.length<=1||void 0===arguments[1]?null:arguments[1],d=this.registry.get(a.type),e=a.dim,f=a.source,g=(this.sources[f].dims[e]||{}).type,h=this.sources[f].data,i=c||new b.DataFrame({source:f},h);return a.dimType=g,new d(i,a)}},{key:"createScaleInfoByName",value:function(a){var b=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return this.createScaleInfo(this.scales[a],b)}}]),a}();a.ScalesFactory=e}),e("data-processor",["exports","./utils/utils"],function(b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d=function(a){return a===Object(a)},e={isYFunctionOfX:function(a,b,c){var e=!0,f=null;try{a.reduce(function(a,e){var g=function(a,b){var c=e[b],f=d(c)?JSON.stringify(c):c;return a.push(f),a},h=b.reduce(g,[]).join("/"),i=c.reduce(g,[]).join("/");if(a.hasOwnProperty(h)){var j=a[h];if(j!==i)throw f={type:"RelationIsNotAFunction",keyX:b.join("/"),keyY:c.join("/"),valX:h,errY:[j,i]},new Error("RelationIsNotAFunction")}else a[h]=i;return a},{})}catch(g){if("RelationIsNotAFunction"!==g.message)throw g;e=!1}return{result:e,error:f}},excludeNullValues:function(a,b){var c=Object.keys(a).reduce(function(b,c){var d=a[c];return d.hasOwnProperty("hasNull")&&!d.hasNull||"measure"!==d.type&&"period"!==d.scale||b.push(c),b},[]);return function(a){var d=!c.some(function(b){return!(b in a)||null===a[b]});return d||b(a),d}},autoAssignScales:function(b){var c="category",d={category:"ordinal",order:"ordinal",measure:"linear"},e={};return Object.keys(b).forEach(function(f){var g=b[f],h=(g.type||c).toLowerCase();e[f]=a.extend({},g,{type:h,scale:g.scale||d[h],value:g.value})}),e},autoDetectDimTypes:function(b){var d={type:"category",scale:"ordinal"},e=function(b,c){var d=c;return a.isDate(b)?(d.type="measure",d.scale="time"):a.isObject(b)?(d.type="order",d.scale="ordinal"):a.isNumber(b)&&(d.type="measure",d.scale="linear"),d},f=function(a,b){return Object.keys(b).forEach(function(f){var g=b.hasOwnProperty(f)?b[f]:null;if(a[f]=a[f]||{type:null,hasNull:!1},null===g)a[f].hasNull=!0;else{var h=e(g,c.utils.clone(d)),i=h.type,j=h.scale,k=null!==a[f].type&&a[f].type!==i;a[f].type=k?d.type:i,a[f].scale=k?d.scale:j}}),a};return a.reduce(b,f,{})},sortByDim:function(b,c,d){var e=b;if("measure"===d.type||"period"===d.scale)e=a(b).sortBy(c);else if(d.order){var f=d.order.reduce(function(a,b,c){return a[b]=c,a},{}),g=d.order.length,h="(___"+c+"___)";e=b.map(function(a){var b=f[a[c]];return b=b>=0?b:g,a[h]=b,a}).sort(function(a,b){return a[h]-b[h]}).map(function(a){return delete a[h],a})}return e}};b.DataProcessor=e}),e("utils/layuot-template",["exports","../const"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var c=function(a,c){var d="div",e=document.createElement(d);return e.classList.add(b.CSS_PREFIX+a),c&&c.appendChild(e),e},d=function(){var a=c("layout"),b=c("layout__header",a),d=c("layout__container",a),e=c("layout__sidebar",d),f=c("layout__content",d),g=c("layout__content__wrap",f),h=c("layout__sidebar-right",d),i=c("layout__sidebar-right__wrap",h),j=c("layout__footer",a);return{layout:a,header:b,content:g,leftSidebar:e,rightSidebar:i,footer:j}};a.getLayout=d}),e("spec-converter",["exports","underscore","./utils/utils"],function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=d(b),h=function(){function a(b){e(this,a),this.spec=b,this.dist={sources:{"?":{dims:{},data:[{}]},"/":{dims:{},data:[]}},scales:{x_null:{type:"ordinal",source:"?"},y_null:{type:"ordinal",source:"?"},size_null:{type:"size",source:"?",mid:5},color_null:{type:"color",source:"?",brewer:null},"pos:default":{type:"ordinal",source:"?"},"size:default":{type:"size",source:"?",mid:5},"text:default":{type:"value",source:"?"},"color:default":{type:"color",source:"?",brewer:null}},settings:b.settings}}return f(a,[{key:"convert",value:function(){var a=this.spec,b=this.dist;return this.ruleAssignSourceDims(a,b),this.ruleAssignStructure(a,b),this.ruleAssignSourceData(a,b),this.ruleApplyDefaults(b),b}},{key:"ruleApplyDefaults",value:function(a){var b=function e(a,b,c){b(a,c),(a.units||[]).map(function(c){return e(c,b,a)})},d=function(a,b){if(a.namespace="chart",b&&!a.hasOwnProperty("units")){a=g["default"].defaults(a,g["default"].pick(b,"x","y"));var d=c.utils.clone(b.guide||{});a.guide=a.guide||{},a.guide.x=g["default"].defaults(a.guide.x||{},d.x),a.guide.y=g["default"].defaults(a.guide.y||{},d.y),a.expression.inherit=b.expression.inherit}return a};b(a.unit,d,null)}},{key:"ruleAssignSourceData",value:function(a,b){var c=a.spec.dimensions||{},d=b.sources["/"].dims,e=function(a,b){return g["default"].isObject(a[b])&&!g["default"].isDate(a[b])&&g["default"].each(a[b],function(c,d){return a[b+"."+d]=c}),a};b.sources["/"].data=a.data.map(function(a){var b=Object.keys(a).reduce(e,a);return Object.keys(d).reduce(function(a,b){return a.hasOwnProperty(b)||(a[b]=null),null!==a[b]&&c[b]&&["period","time"].indexOf(c[b].scale)>=0&&(a[b]=new Date(a[b])),a},b)})}},{key:"ruleAssignSourceDims",value:function(a,b){var c=a.spec.dimensions;b.sources["/"].dims=Object.keys(c).reduce(function(a,b){return a[b]={type:c[b].type},a},{})}},{key:"ruleAssignStructure",value:function(a,b){var d=this,e=function h(a){var b=c.utils.clone(g["default"].omit(a,"unit"));return b.expression=d.ruleInferExpression(a),d.ruleCreateScales(a,b),a.unit&&(b.units=a.unit.map(h)),b},f=e(a.spec.unit);f.expression.inherit=!1,b.unit=f}},{key:"ruleCreateScales",value:function(a,b){var c=this,d=a.guide||{};["color","size","text","x","y"].forEach(function(e){a.hasOwnProperty(e)&&(b[e]=c.scalesPool(e,a[e],d[e]||{}))})}},{key:"ruleInferDim",value:function(a,b){var c=a,d=this.spec.spec.dimensions;if(!d.hasOwnProperty(c))return c;b.hasOwnProperty("tickLabel")?c=a+"."+b.tickLabel:d[a].value&&(c=a+"."+d[a].value);var e=this.dist.sources["/"].dims;return e.hasOwnProperty(c)||(e[c]={type:e[a].type},delete e[a]),c}},{key:"scalesPool",value:function(a,b,c){var d=a+"_"+b;if(this.dist.scales.hasOwnProperty(d))return d;var e=this.spec.spec.dimensions,f={};return"color"===a&&null!==b&&(f={type:"color",source:"/",dim:this.ruleInferDim(b,c)},c.hasOwnProperty("brewer")&&(f.brewer=c.brewer),e[b]&&e[b].hasOwnProperty("order")&&(f.order=e[b].order)),"size"===a&&null!==b&&(f={type:"size",source:"/",dim:this.ruleInferDim(b,c),min:2,max:10,mid:5}),"text"===a&&null!==b&&(f={type:"value",source:"/",dim:this.ruleInferDim(b,c)}),!e.hasOwnProperty(b)||"x"!==a&&"y"!==a||(f={type:e[b].scale,source:"/",dim:this.ruleInferDim(b,c)},e[b].hasOwnProperty("order")&&(f.order=e[b].order),c.hasOwnProperty("min")&&(f.min=c.min),c.hasOwnProperty("max")&&(f.max=c.max),c.hasOwnProperty("autoScale")?f.autoScale=c.autoScale:f.autoScale=!0,c.hasOwnProperty("tickPeriod")&&(f.period=c.tickPeriod),f.fitToFrameByDims=c.fitToFrameByDims,f.ratio=c.ratio),this.dist.scales[d]=f,d}},{key:"ruleInferExpression",value:function(a){var b={operator:"none",params:[]},c=a.guide||{},d=c.x||{},e=c.y||{};return 0===a.type.indexOf("ELEMENT.")?a.color&&(b={operator:"groupBy",params:[this.ruleInferDim(a.color,c.color||{})]}):"COORDS.RECT"===a.type&&1===a.unit.length&&"COORDS.RECT"===a.unit[0].type&&(b=d.tickPeriod||e.tickPeriod?{operator:"cross_period",params:[this.ruleInferDim(a.x,d),this.ruleInferDim(a.y,e),d.tickPeriod,e.tickPeriod]}:{operator:"cross",params:[this.ruleInferDim(a.x,d),this.ruleInferDim(a.y,e)]}),g["default"].extend({inherit:!0,source:"/"},b)}}]),a}();a.SpecConverter=h}),e("utils/utils-draw",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var b={translate:function(a,b){return"translate("+a+","+b+")"},rotate:function(a){return"rotate("+a+")"},getOrientation:function(a){return["bottom","top"].indexOf(a.toLowerCase())>=0?"h":"v"},isIntersect:function(a,b,c,d,e,f,g,h){var i,j,k,l;i=c-a,j=d-b,k=g-e,l=h-f;var m,n;return m=(-j*(a-e)+i*(b-f))/(-k*j+i*l),n=(k*(b-f)-l*(a-e))/(-k*j+i*l),m>=0&&1>=m&&n>=0&&1>=n}};a.utilsDraw=b}),e("formatter-registry",["exports","d3"],function(b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(b,"__esModule",{value:!0});var e=d(c),f={"x-num-auto":function(a){var b=parseFloat(a.toFixed(2));return Math.abs(b)<1?b.toString():e["default"].format("s")(b)},percent:function(a){var b=parseFloat((100*a).toFixed(2));return b.toString()+"%"},day:e["default"].time.format("%d-%b-%Y"),"day-short":e["default"].time.format("%d-%b"),week:e["default"].time.format("%d-%b-%Y"),"week-short":e["default"].time.format("%d-%b"),month:function(a){var b=new Date(a),c=b.getMonth(),d=0===c?"%B, %Y":"%B";return e["default"].time.format(d)(a)},"month-short":function(a){var b=new Date(a),c=b.getMonth(),d=0===c?"%b '%y":"%b";return e["default"].time.format(d)(a)},"month-year":e["default"].time.format("%B, %Y"),quarter:function(a){var b=new Date(a),c=b.getMonth(),d=(c-c%3)/3;return"Q"+(d+1)+" "+b.getFullYear()},year:e["default"].time.format("%Y"),"x-time-auto":null},g={get:function(b,c){var d=c||"",g=function(a){return(null===a||"undefined"==typeof a?d:a).toString()},h=f.hasOwnProperty(b),i=h?f[b]:g;return h&&(i=f[b]),!h&&b&&(i=function(c){var d=a.isDate(c)?e["default"].time.format(b):e["default"].format(b);return d(c)}),h||b||(i=g),i},add:function(a,b){f[a]=b}};b.FormatterRegistry=g}),e("spec-transform-auto-layout",["exports","underscore","./utils/utils","./utils/utils-draw","./formatter-registry","./utils/utils-dom"],function(a,b,c,d,e,f){"use strict";function g(a){return a&&a.__esModule?a:{"default":a}}function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function i(a,b,c,d){var e=a.hasOwnProperty(c)?a[c]:{};e=e||{},k["default"].each(d,function(a){k["default"].extend(b.guide[c][a],e[a])}),k["default"].extend(b.guide[c],k["default"].omit.apply(k["default"],[e].concat[d]))}Object.defineProperty(a,"__esModule",{value:!0});var j=function(){ function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),k=g(b),l=function(a,b){var c=b.guide||{},d={x:["label"],y:["label"],size:["label"],color:["label"],padding:[]};return k["default"].each(d,function(b,d){i(c,a,d,b)}),k["default"].extend(a.guide,k["default"].omit.apply(k["default"],[c].concat(k["default"].keys(d)))),a},m=function(a,b,c){return a[b]=k["default"].defaults(a[b]||{},{label:""}),a[b].label=k["default"].isObject(a[b].label)?a[b].label:{text:a[b].label},a[b].label=k["default"].defaults(a[b].label,c||{},{padding:32,rotate:0,textAnchor:"middle",cssClass:"label",dock:null}),a[b]},n=function(a,b,c){return a[b]=k["default"].defaults(a[b],c||{},{padding:0,density:30,rotate:0,tickPeriod:null,tickFormat:null,autoScale:!0}),a[b].tickFormat=a[b].tickFormat||a[b].tickPeriod,a[b]},o=function(a){return a.options=a.options||{},a.guide=a.guide||{},a.guide.padding=k["default"].defaults(a.guide.padding||{},{l:0,b:0,r:0,t:0}),a.guide.x=m(a.guide,"x"),a.guide.x=n(a.guide,"x",{cssClass:"x axis",scaleOrient:"bottom",textAnchor:"middle"}),a.guide.y=m(a.guide,"y",{rotate:-90}),a.guide.y=n(a.guide,"y",{cssClass:"y axis",scaleOrient:"left",textAnchor:"end"}),a.guide.size=m(a.guide,"size"),a.guide.color=m(a.guide,"color"),a},p=function(a,b){return a.guide=a.guide||{},a.guide.padding=a.guide.padding||{l:0,t:0,r:0,b:0},a.hasOwnProperty("units")||(a=k["default"].defaults(a,b),a.guide=k["default"].defaults(a.guide,c.utils.clone(b.guide)),a.guide.x=k["default"].defaults(a.guide.x,c.utils.clone(b.guide.x)),a.guide.y=k["default"].defaults(a.guide.y,c.utils.clone(b.guide.y))),a},q=function(a){var b=a.units||[],c=!a.hasOwnProperty("units"),d=!b.some(function(a){return a.hasOwnProperty("units")});return{type:a.type,isLeaf:c,isLeafParent:!c&&d}},r=function(a,b,c,d){if(0===a.length)return{width:0,height:0};if(null===b){var e=c("TauChart Library");return e.width=.625*d,e}var f=k["default"].max(a,function(a){return b(a).toString().length}),g=k["default"].isNumber(f)?".00":"";return c(b(f)+g)},s=function(a,b){var c=a.dimType,d=a.scaleType,e="*",f=[c,d,e].join(":"),g=[c,d].join(":");return b[f]||b[g]||b[c]||null},t=function(a,b,c,d,f,g){var h=b.dimension(a.x),i=b.dimension(a.y),j="measure"===h.dimType,k="measure"===i.dimType,l=c.hasOwnProperty("xDensityPadding:"+h.dimType)?c["xDensityPadding:"+h.dimType]:c.xDensityPadding,m=c.hasOwnProperty("yDensityPadding:"+i.dimType)?c["yDensityPadding:"+i.dimType]:c.yDensityPadding,n=b.scaleMeta(a.x,a.guide.x),o=n.values,p=b.scaleMeta(a.y,a.guide.y),q=p.values;a.guide.x.tickFormat=a.guide.x.tickFormat||s(h,c.defaultFormats),a.guide.y.tickFormat=a.guide.y.tickFormat||s(i,c.defaultFormats),["day","week","month"].indexOf(a.guide.x.tickFormat)>=0&&(a.guide.x.tickFormat+="-short"),["day","week","month"].indexOf(a.guide.y.tickFormat)>=0&&(a.guide.y.tickFormat+="-short");var t=0===o.length,u=0===q.length,v=r(o,e.FormatterRegistry.get(a.guide.x.tickFormat,a.guide.x.tickFormatNullAlias),c.getAxisTickLabelSize,c.xAxisTickLabelLimit),w=r(q,e.FormatterRegistry.get(a.guide.y.tickFormat,a.guide.y.tickFormatNullAlias),c.getAxisTickLabelSize,c.yAxisTickLabelLimit),x=c.xAxisPadding,y=c.yAxisPadding,z=d?!j:!1,A=f?!k:!1;a.guide.x.padding=t?0:x,a.guide.y.padding=u?0:y,a.guide.x.rotate=z?90:0,a.guide.x.textAnchor=z?"start":a.guide.x.textAnchor,a.guide.y.rotate=A?-90:0,a.guide.y.textAnchor=A?"middle":a.guide.y.textAnchor;var B=t?0:c.xTickWidth,C=u?0:c.yTickWidth;a.guide.x.tickFormatWordWrapLimit=c.xAxisTickLabelLimit,a.guide.y.tickFormatWordWrapLimit=c.yAxisTickLabelLimit;var D=z?{w:v.height,h:v.width}:{h:v.height,w:v.width};if(v.width>c.xAxisTickLabelLimit){a.guide.x.tickFormatWordWrap=!0,a.guide.x.tickFormatWordWrapLines=c.xTickWordWrapLinesLimit;var E=Math.ceil(v.width/c.xAxisTickLabelLimit),F=Math.min(E,c.xTickWordWrapLinesLimit),G=F*v.height;z?(D.h=c.xAxisTickLabelLimit,D.w=G):(D.h=G,D.w=c.xAxisTickLabelLimit)}var H=A?{w:w.height,h:w.width}:{h:w.height,w:w.width};if(w.width>c.yAxisTickLabelLimit){a.guide.y.tickFormatWordWrap=!0,a.guide.y.tickFormatWordWrapLines=c.yTickWordWrapLinesLimit;var E=Math.ceil(w.width/c.yAxisTickLabelLimit),F=Math.min(E,c.yTickWordWrapLinesLimit),G=F*w.height;A?(H.w=G,H.h=c.yAxisTickLabelLimit):(H.w=c.yAxisTickLabelLimit,H.h=G)}var I=B+D.h,J=C+H.w,K=c.xFontLabelHeight,L=c.yFontLabelHeight,M=c.distToXAxisLabel,N=c.distToYAxisLabel;if(a.guide.x.density=D.w+2*l,a.guide.y.density=H.h+2*m,g){var O=(x-K)/2;a.guide.x.label.padding=0+K-M+O,a.guide.y.label.padding=0-N+O,a.guide.x.label.cssClass+=" inline",a.guide.x.label.dock="right",a.guide.x.label.textAnchor="end",a.guide.y.label.cssClass+=" inline",a.guide.y.label.dock="right",a.guide.y.label.textAnchor="end",a.guide.padding.b=x+I,a.guide.padding.l=y+J,a.guide.padding.b=a.guide.x.hide?0:a.guide.padding.b,a.guide.padding.l=a.guide.y.hide?0:a.guide.padding.l}else{a.guide.x.label.padding=K+(a.guide.x.label.text?I+M:0),a.guide.y.label.padding=-K+(a.guide.y.label.text?J+N:0);var P=a.guide.x.label.text?a.guide.x.label.padding+K:I,Q=a.guide.y.label.text?a.guide.y.label.padding+L:J;a.guide.padding.b=x+P-B,a.guide.padding.l=y+Q,a.guide.padding.b=a.guide.x.hide?0:a.guide.padding.b,a.guide.padding.l=a.guide.y.hide?0:a.guide.padding.l}return a.guide.x.tickFontHeight=v.height,a.guide.y.tickFontHeight=w.height,a.guide.x.$minimalDomain=o.length,a.guide.y.$minimalDomain=q.length,a.guide.x.$maxTickTextW=v.width,a.guide.x.$maxTickTextH=v.height,a.guide.y.$maxTickTextW=w.width,a.guide.y.$maxTickTextH=w.height,a},u={NONE:function(a,b,d){var e=c.utils.clone(a);return v(c.utils.clone(e.unit),e.unit,function(a,b){return b.guide.x.tickFontHeight=d.getAxisTickLabelSize("X").height,b.guide.y.tickFontHeight=d.getAxisTickLabelSize("Y").height,b.guide.x.tickFormatWordWrapLimit=d.xAxisTickLabelLimit,b.guide.y.tickFormatWordWrapLimit=d.yAxisTickLabelLimit,b}),e},"BUILD-LABELS":function(a,b,d){var e=c.utils.clone(a),f=[],g=[],h=null,i=null;c.utils.traverseJSON(e.unit,"units",q,function(a,c){if(a.isLeaf)return c;!h&&c.x&&(h=c),!i&&c.y&&(i=c),c.guide=c.guide||{},c.guide.x=c.guide.x||{label:""},c.guide.y=c.guide.y||{label:""},c.guide.x.label=k["default"].isObject(c.guide.x.label)?c.guide.x.label:{text:c.guide.x.label},c.guide.y.label=k["default"].isObject(c.guide.y.label)?c.guide.y.label:{text:c.guide.y.label},c.x&&(c.guide.x.label.text=c.guide.x.label.text||b.dimension(c.x).dimName),c.y&&(c.guide.y.label.text=c.guide.y.label.text||b.dimension(c.y).dimName);var d=c.guide.x.label.text;d&&(f.push(d),c.guide.x.tickFormatNullAlias=c.guide.x.hasOwnProperty("tickFormatNullAlias")?c.guide.x.tickFormatNullAlias:"No "+d,c.guide.x.label.text="",c.guide.x.label._original_text=d);var e=c.guide.y.label.text;return e&&(g.push(e),c.guide.y.tickFormatNullAlias=c.guide.y.hasOwnProperty("tickFormatNullAlias")?c.guide.y.tickFormatNullAlias:"No "+e,c.guide.y.label.text="",c.guide.y.label._original_text=e),c});var j=" β†’ ";return h&&(h.guide.x.label.text=f.join(j)),i&&(i.guide.y.label.text=g.join(j)),e},"BUILD-GUIDE":function(a,b,d){var f=c.utils.clone(a);return v(c.utils.clone(f.unit),f.unit,function(a,c){if(a.isLeaf)return c;c.guide.hasOwnProperty("showGridLines")||(c.guide.showGridLines=a.isLeafParent?"xy":"");var f=!a.isLeaf&&!a.isLeafParent;f&&(c.guide.x.cssClass+=" facet-axis",c.guide.x.avoidCollisions=!0,c.guide.y.cssClass+=" facet-axis",c.guide.y.avoidCollisions=!1);var g=b.dimension(c.x),h=b.dimension(c.y),i="measure"===g.dimType,j="measure"===h.dimType,k=d.hasOwnProperty("xDensityPadding:"+g.dimType)?d["xDensityPadding:"+g.dimType]:d.xDensityPadding,l=d.hasOwnProperty("yDensityPadding:"+h.dimType)?d["yDensityPadding:"+h.dimType]:d.yDensityPadding,m=b.scaleMeta(c.x,c.guide.x),n=m.values,o=b.scaleMeta(c.y,c.guide.y),p=o.values;c.guide.x.tickFormat=c.guide.x.tickFormat||s(g,d.defaultFormats),c.guide.y.tickFormat=c.guide.y.tickFormat||s(h,d.defaultFormats);var q=0===n.length,t=0===p.length,u=r(n,e.FormatterRegistry.get(c.guide.x.tickFormat,c.guide.x.tickFormatNullAlias),d.getAxisTickLabelSize,d.xAxisTickLabelLimit),v=r(p,e.FormatterRegistry.get(c.guide.y.tickFormat,c.guide.y.tickFormatNullAlias),d.getAxisTickLabelSize,d.yAxisTickLabelLimit),w=a.isLeafParent?d.xAxisPadding:0,x=a.isLeafParent?d.yAxisPadding:0,y=!f&&Boolean(g.dimType)&&"measure"!==g.dimType;c.guide.x.padding=q?0:w,c.guide.y.padding=t?0:x,c.guide.x.rotate=y?90:0,c.guide.x.textAnchor=y?"start":c.guide.x.textAnchor;var z=q?0:d.xTickWidth,A=t?0:d.yTickWidth;c.guide.x.tickFormatWordWrapLimit=d.xAxisTickLabelLimit,c.guide.y.tickFormatWordWrapLimit=d.yAxisTickLabelLimit;var B=y?u.width:u.height;!i&&B>d.xAxisTickLabelLimit&&(B=d.xAxisTickLabelLimit),!y&&u.width>d.xAxisTickLabelLimit&&(c.guide.x.tickFormatWordWrap=!0,c.guide.x.tickFormatWordWrapLines=d.xTickWordWrapLinesLimit,B=d.xTickWordWrapLinesLimit*u.height);var C=v.width;!j&&C>d.yAxisTickLabelLimit&&(C=d.yAxisTickLabelLimit,c.guide.y.tickFormatWordWrap=!0,c.guide.y.tickFormatWordWrapLines=d.yTickWordWrapLinesLimit);var D=z+B,E=A+C,F=d.xFontLabelHeight,G=d.yFontLabelHeight,H=d.distToXAxisLabel,I=d.distToYAxisLabel,J=Math.min(d.xAxisTickLabelLimit,y?u.height:u.width);c.guide.x.density=J+2*k;var K=Math.ceil(v.width/d.yAxisTickLabelLimit),L=Math.min(K,d.yTickWordWrapLinesLimit),M=Math.min(d.yAxisTickLabelLimit,L*v.height);c.guide.y.density=M+2*l,c.guide.x.label.padding=c.guide.x.label.text?D+H:0,c.guide.y.label.padding=c.guide.y.label.text?E+I:0;var N=c.guide.x.label.text?c.guide.x.label.padding+F:D,O=c.guide.y.label.text?c.guide.y.label.padding+G:E;return c.guide.padding.b=w+N,c.guide.padding.l=x+O,c.guide.padding.b=c.guide.x.hide?0:c.guide.padding.b,c.guide.padding.l=c.guide.y.hide?0:c.guide.padding.l,c.guide.x.tickFontHeight=u.height,c.guide.y.tickFontHeight=v.height,c.guide.x.$minimalDomain=n.length,c.guide.y.$minimalDomain=p.length,c.guide.x.$maxTickTextW=u.width,c.guide.x.$maxTickTextH=u.height,c.guide.y.$maxTickTextW=v.width,c.guide.y.$maxTickTextH=v.height,c}),f},"BUILD-COMPACT":function(a,b,d){var e=c.utils.clone(a);return v(c.utils.clone(e.unit),e.unit,function(a,c){return a.isLeaf?c:(c.guide.hasOwnProperty("showGridLines")||(c.guide.showGridLines=a.isLeafParent?"xy":""),a.isLeafParent?t(c,b,k["default"].defaults({xTickWordWrapLinesLimit:1,yTickWordWrapLinesLimit:1},d),!0,!1,!0):(c.guide.x.cssClass+=" facet-axis compact",c.guide.x.avoidCollisions=!0,c.guide.y.cssClass+=" facet-axis compact",c.guide.y.avoidCollisions=!0,t(c,b,k["default"].defaults({xAxisPadding:0,yAxisPadding:0,distToXAxisLabel:0,distToYAxisLabel:0,xTickWordWrapLinesLimit:1,yTickWordWrapLinesLimit:1},d),!1,!0,!1)))}),e}};u.AUTO=function(a,b,c){return["BUILD-LABELS","BUILD-GUIDE"].reduce(function(a,d){return u[d](a,b,c)},a)},u.COMPACT=function(a,b,c){return["BUILD-LABELS","BUILD-COMPACT"].reduce(function(a,d){return u[d](a,b,c)},a)};var v=function y(a,b,d){var e=o(b);e=d(q(e),e),e=l(e,a);var f=k["default"].omit(e,"units");return(e.units||[]).forEach(function(a){return y(c.utils.clone(a),p(a,f),d)}),e},w={get:function(a,b,d,e){var f=u[a]||u.NONE,g={dimension:function(a){var b=d.scales[a],c=d.sources[b.source].dims[b.dim]||{};return{dimName:b.dim,dimType:c.type,scaleType:b.type}},scaleMeta:function(a){var b=e("pos",a);return{values:b.domain()}}},h={unit:c.utils.clone(d.unit)},i=f(h,g,b);return d.unit=i.unit,d}},x=function(){function a(b){h(this,a),this.spec=b,this.isApplicable=c.utils.isSpecRectCoordsOnly(b.unit)}return j(a,[{key:"transform",value:function(a){var b=this.spec;if(!this.isApplicable)return b;var c=b.settings.size,d=k["default"].find(b.settings.specEngine,function(a){return c.width<=a.width});return w.get(d.name,b.settings,b,function(b,c){return a.getScaleInfo(c||b+":default")})}}]),a}();a.SpecTransformAutoLayout=x}),e("spec-transform-calc-size",["exports","./scales-factory","./utils/utils"],function(a,b,c){"use strict";function d(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=function l(a,b){if(a.guide.x.hide!==!0&&0!==a.guide.x.rotate){a.guide.x.rotate=0,a.guide.x.textAnchor="middle";var c=Math.min(b.xAxisTickLabelLimit,a.guide.x.$maxTickTextW),d=0-c+a.guide.x.$maxTickTextH;a.guide.padding.b+=a.guide.padding.b>0?d:0,a.guide.x.label.padding>c+b.xAxisPadding&&(a.guide.x.label.padding+=d)}(a.units||[]).filter(function(a){return"COORDS.RECT"===a.type}).forEach(function(a){return l(a,b)})},h=function(a){return a.$maxTickTextW},i=function(a){return a.density},j={"entire-view":function(a,b,c){var d=b("x",c.unit,h);d<=a.width&&g(c.unit,c.settings);var e=a.width,f=a.height;return{newW:e,newH:f}},minimal:function(a,b,c){var d=b("x",c.unit,i),e=b("y",c.unit,i);return{newW:d,newH:e}},normal:function(a,b,c){var d,e=b("x",c.unit,h),f=a.width;f>=e?(g(c.unit,c.settings),d=Math.max(f,e)):d=Math.max(f,Math.max(a.width,b("x",c.unit,i)));var j=Math.max(a.height,b("y",c.unit,i));return{newW:d,newH:j}},"fit-width":function(a,b,c){var d=b("x",c.unit,h);d<=a.width&&g(c.unit,c.settings);var e=a.width,f=b("y",c.unit,i);return{newW:e,newH:f}},"fit-height":function(a,b,c){var d=b("x",c.unit,i),e=a.height;return{newW:d,newH:e}}},k=function(){function a(b){e(this,a),this.spec=b,this.isApplicable=c.utils.isSpecRectCoordsOnly(b.unit)}return f(a,[{key:"transform",value:function(a){var b=this.spec;if(!this.isApplicable)return b;var c=b.settings.fitModel;if(!c)return b;var e=b.scales,f=function(a,b){return a.reduce(function(a,c){var d=c.key||{},e=d[b];return a[e]=a[e]||[],a[e].push(c),a},{})},g=function(a,b){var c=0,d=["ordinal","period"].indexOf(a.scaleType)>=0;return c=d?b*a.domain().length:4*b},h=function p(b,c,h){var i=arguments.length<=3||void 0===arguments[3]?null:arguments[3],j="x"===b?c.x:c.y,k="x"===b?c.y:c.x,l=c.guide,m=h("x"===b?l.x:l.y),n="x"===b?l.padding.l+l.padding.r:l.padding.b+l.padding.t;if("COORDS.RECT"!==c.units[0].type){var o=a.getScaleInfo(j,i);return n+g(o,m)}var q=f(c.frames,e[k].dim),r=Object.keys(q).map(function(a){return q[a].map(function(a){return p(b,a.units[0],h,a)}).reduce(function(a,b){return a+b},0)}),s=Math.max.apply(Math,d(r));return n+s},i=b.settings.size,k=i.width,l=i.height,m=j[c];if(m){var n=m(i,h,b);k=n.newW,l=n.newH}var o=function(a,c){var d=b.settings.getScrollBarWidth(),e=c.width,f=c.height,g=a.width-e,h=a.height-f,i=h>=0?0:d,j=g>=0?0:d;return{height:f-j,width:e-i}};return b.settings.size=o(i,{width:k,height:l}),b}}]),a}();a.SpecTransformCalcSize=k}),e("spec-transform-apply-ratio",["exports","underscore","./utils/utils"],function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=(d(b),function(){function a(b){e(this,a),this.spec=b,this.isApplicable=b.settings.autoRatio&&c.utils.isSpecRectCoordsOnly(b.unit)}return f(a,[{key:"transform",value:function(a){var b=this.spec;if(!this.isApplicable)return b;try{this.ruleApplyRatio(b,a)}catch(c){if("Not applicable"!==c.message)throw c}return b}},{key:"ruleApplyRatio",value:function(a,b){var d=function(a){return"COORDS.RECT"===a.type||"RECT"===a.type},e=function(a){return 0===a.type.indexOf("ELEMENT.")},f=function p(a,b,c){var d=arguments.length<=3||void 0===arguments[3]?0:arguments[3],e=b(a,d);e&&(a.units||[]).map(function(a){return p(a,b,c,d+1)}),c(a,d)},g=[],h=[],i=function(a,b){if(b>1||!d(a))throw new Error("Not applicable");g.push(a.x),h.push(a.y);var c=a.units||[],f=c.map(function(a){if(!d(a)&&!e(a))throw new Error("Not applicable");return a}).filter(d);return 1===f.length};f(a.unit,i,function(a,b){return 0});var j=function(b){return a.scales[b]},k=function(a){return"/"===a.source&&!a.ratio&&!a.fitToFrameByDims},l=function(a){return"ordinal"===a.type||"period"===a.type&&!a.period},m=g.map(j).filter(k),n=h.map(j).filter(k),o=2;[m.length,n.length].some(function(a){return a===o})&&!function(){var a=function(a){return a.dim},d=function(b,c,d){return b.fitToFrameByDims=d.slice(0,c).map(a)},e=function(e,f){f.filter(l).length===o&&(f.forEach(d),f[0].ratio=c.utils.generateRatioFunction(e,f.map(a),b))};e("x",m),e("y",n)}()}}]),a}());a.SpecTransformApplyRatio=g}),e("spec-transform-extract-axes",["exports","underscore","./utils/utils"],function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=(d(b),function(){function a(b){e(this,a),this.spec=b,this.isApplicable="EXTRACT"===b.settings.layoutEngine&&c.utils.isSpecRectCoordsOnly(b.unit)}return f(a,[{key:"transform",value:function(){var a=this.spec;if(!this.isApplicable)return a;try{this.ruleExtractAxes(a)}catch(b){if("Not applicable"!==b.message)throw b;console.log("[TauCharts]: can't extract axes for the given chart specification",a)}return a}},{key:"ruleExtractAxes",value:function(a){var b=function(a){return"COORDS.RECT"===a.type||"RECT"===a.type},d=function(a){return 0===a.type.indexOf("ELEMENT.")},e={l:0,r:10,t:10,b:0},f=[],g=function(a,c){if(c>1||!b(a))throw new Error("Not applicable");a.guide=a.guide||{};var g=a.guide,h=g.padding||{l:0,r:0,t:0,b:0};e.l+=h.l,e.r+=h.r,e.t+=h.t,e.b+=h.b,f.push({l:e.l,r:e.r,t:e.t,b:e.b});var i=a.units||[],j=i.map(function(a){if(!b(a)&&!d(a))throw new Error("Not applicable");return a}).filter(b);return 1===j.length},h=function(a){return a?10:0},i=function(a){var b=f.pop(),c=a.guide||{};c.x=c.x||{},c.x.padding=c.x.padding||0,c.y=c.y||{},c.y.padding=c.y.padding||0,c.padding={l:h(a.y),r:h(1),t:h(1),b:h(a.x)},c.autoLayout="extract-axes",c.x.padding+=e.b-b.b,c.y.padding+=e.l-b.l};c.utils.traverseSpec(a.unit,g,i),a.unit.guide.padding=e,a.unit.guide.autoLayout=""}}]),a}());a.SpecTransformExtractAxes=g}),e("charts/tau.plot",["exports","../api/balloon","../event","../plugins","../utils/utils","../utils/utils-dom","../data-frame","../const","../units-registry","../scales-registry","../scales-factory","../data-processor","../utils/layuot-template","../spec-converter","../spec-transform-auto-layout","../spec-transform-calc-size","../spec-transform-apply-ratio","../spec-transform-extract-axes","./tau.gpl"],function(c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u){"use strict";function v(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function w(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var x=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),y=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},z=function(c){function e(b){v(this,e),y(Object.getPrototypeOf(e.prototype),"constructor",this).call(this),this._nodes=[],this._svg=null,this._filtersStore={filters:{},tick:0},this._layout=(0,o.getLayout)(),2===["sources","scales"].filter(function(a){return b.hasOwnProperty(a)}).length?(this.config=b,this.configGPL=b):(this.config=this.setupConfig(b),this.configGPL=new p.SpecConverter(this.config).convert()),this.configGPL=e.setupPeriodData(this.configGPL),this.config.plugins=this.config.plugins||[],this.configGPL.settings=e.setupSettings(this.configGPL.settings),this.transformers=[s.SpecTransformApplyRatio,q.SpecTransformAutoLayout],this.onUnitsStructureExpandedTransformers=[r.SpecTransformCalcSize,t.SpecTransformExtractAxes],this._originData=a.clone(this.configGPL.sources),this._liveSpec=this.configGPL,this._plugins=new f.Plugins(this.config.plugins,this)}return w(e,c),x(e,[{key:"setupConfig",value:function(b){if(!b.spec||!b.spec.unit)throw new Error("Provide spec for plot");this.config=a.defaults(b,{spec:{},data:[],plugins:[],settings:{}}),this._emptyContainer=b.emptyContainer||"",this.config.settings.specEngine=b.specEngine||b.settings.specEngine,this.config.settings.layoutEngine=b.layoutEngine||b.settings.layoutEngine,this.config.settings=e.setupSettings(this.config.settings),this.config.spec.dimensions=e.setupMetaInfo(this.config.spec.dimensions,this.config.data);var c=this.config.settings.log;return this.config.settings.excludeNull&&this.addFilter({tag:"default",src:"/",predicate:n.DataProcessor.excludeNullValues(this.config.spec.dimensions,function(a){return c([a,"point was excluded, because it has undefined values."],"WARN")})}),this.config}},{key:"getConfig",value:function(a){return a?this.config:this.configGPL||this.config}},{key:"insertToRightSidebar",value:function(a){return h.utilsDom.appendTo(a,this._layout.rightSidebar)}},{key:"insertToHeader",value:function(a){return h.utilsDom.appendTo(a,this._layout.header)}},{key:"addBalloon",value:function(a){return new d.Tooltip("",a||{})}},{key:"renderTo",value:function(c,d){var e=this;this._svg=null,this._target=c,this._defaultSize=a.clone(d);var f=b.select(c).node();if(null===f)throw new Error("Target element not found");f.appendChild(this._layout.layout);var i=this._layout.content,j=a.clone(d)||{};if(j.width&&j.height||(i.style.display="none",j=a.defaults(j,h.utilsDom.getContainerSize(i.parentNode)),i.style.display="",j.height||(j.height=h.utilsDom.getContainerSize(this._layout.layout).height)),this.configGPL.settings.size=j,this._liveSpec=g.utils.clone(a.omit(this.configGPL,"plugins")),this._liveSpec.sources=this.getDataSources(),this._liveSpec.settings=this.configGPL.settings,this.isEmptySources(this._liveSpec.sources))return void(i.innerHTML=this._emptyContainer);this._liveSpec=this.transformers.reduce(function(a,b){return new b(a).transform(e)},this._liveSpec),this._nodes=[],this._liveSpec.onUnitDraw=function(a){e._nodes.push(a),e.fire("unitdraw",a),["click","mouseover","mouseout"].forEach(function(b){return a.on(b,function(a,c){e.fire("element"+b,{element:a,data:c.data,event:c.event})})})},this._liveSpec.onUnitsStructureExpanded=function(a){e.onUnitsStructureExpandedTransformers.forEach(function(b){return new b(a).transform(e)}),e.fire(["units","structure","expanded"].join(""),a)},this.fire("specready",this._liveSpec),new u.GPL(this._liveSpec,this.getScaleFactory(),k.unitsRegistry).renderTo(i,this._liveSpec.settings.size);var l=b.select(i).select("svg");this._svg=l.node(),this._layout.rightSidebar.style.maxHeight=this._liveSpec.settings.size.height+"px",this.fire("render",this._svg)}},{key:"getScaleFactory",value:function(){var a=arguments.length<=0||void 0===arguments[0]?null:arguments[0];return new m.ScalesFactory(l.scalesRegistry,a||this._liveSpec.sources,this._liveSpec.scales)}},{key:"getScaleInfo",value:function(a){var b=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return this.getScaleFactory().createScaleInfoByName(a,b)}},{key:"getSourceFiltersIterator",value:function(b){var c=a(this._filtersStore.filters).chain().values().flatten().reject(function(a){return b(a)}).pluck("predicate").value();return function(a){return c.reduce(function(b,c){return b&&c(a)},!0)}}},{key:"getDataSources",value:function(){var b=this,c=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],d=function(b){return function(d){return a.contains(c.excludeFilter,d.tag)||d.src!==b}};return Object.keys(this._originData).filter(function(a){return"?"!==a}).reduce(function(a,c){var e=b._originData[c],f=b.getSourceFiltersIterator(d(c));return a[c]={dims:e.dims,data:e.data.filter(f)},a},{"?":this._originData["?"]})}},{key:"isEmptySources",value:function(a){return!Object.keys(a).filter(function(a){return"?"!==a}).filter(function(b){return a[b].data.length>0}).length}},{key:"getData",value:function(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],b=arguments.length<=1||void 0===arguments[1]?"/":arguments[1],c=this.getDataSources(a);return c[b].data}},{key:"setData",value:function(b){var c=arguments.length<=1||void 0===arguments[1]?"/":arguments[1];this.config.data=b,this.configGPL.sources[c].data=b,this._originData=a.clone(this.configGPL.sources),this.refresh()}},{key:"getSVG",value:function(){return this._svg}},{key:"addFilter",value:function(a){a.src=a.src||"/";var b=a.tag,c=this._filtersStore.filters[b]=this._filtersStore.filters[b]||[],d=this._filtersStore.tick++;return a.id=d,c.push(a),d}},{key:"removeFilter",value:function(b){var c=this;return a.each(this._filtersStore.filters,function(d,e){c._filtersStore.filters[e]=a.reject(d,function(a){return a.id===b})}),this}},{key:"refresh",value:function(){this._target&&this.renderTo(this._target,this._defaultSize)}},{key:"resize",value:function(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.renderTo(this._target,a)}},{key:"select",value:function(a){return this._nodes.filter(a)}},{key:"traverseSpec",value:function(a,b){var c=function d(a,b,c){b(a,c),(a.units||[]).map(function(c){return d(c,b,a)})};c(a.unit,b,null)}},{key:"getSpec",value:function(){return this._liveSpec}}],[{key:"setupPeriodData",value:function(a){var b=e.__api__.tickPeriod,c=Object.keys(a.scales).map(function(b){return a.scales[b]}).filter(function(a){return"period"===a.type}).map(function(a){return{source:a.source,dim:a.dim,period:a.period}}),d=function(a){return null===a||"undefined"==typeof a},f=function(a,c){return a[c.source].data=a[c.source].data.map(function(a){var e=a[c.dim];return!d(e)&&c.period&&(a[c.dim]=b.get(c.period).cast(e)),a}),a};return a.sources=c.reduce(f,a.sources),a}},{key:"setupMetaInfo",value:function(a,b){var c=a?a:n.DataProcessor.autoDetectDimTypes(b);return n.DataProcessor.autoAssignScales(c)}},{key:"setupSettings",value:function(b){var c=e.globalSettings,d={};Object.keys(c).forEach(function(b){d[b]=a.isFunction(c[b])?c[b]:g.utils.clone(c[b])});var f=a.defaults(b||{},d);return g.utils.isArray(f.specEngine)||(f.specEngine=[{width:Number.MAX_VALUE,name:f.specEngine}]),f}}]),e}(e.Emitter);c.Plot=z}),e("chart-alias-registry",["exports","d3","./utils/utils","./data-processor","./error"],function(b,c,d,e,f){"use strict";function g(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(b,"__esModule",{value:!0});var h=(g(c),{}),i={},j=function(b){var c="Chart type "+b+" is not supported.";throw console.log(c),console.log("Use one of "+a.keys(h).join(", ")+"."),new f.TauChartError(c,f.errorCodes.NOT_SUPPORTED_TYPE_CHART)},k={validate:function(a,b){return i.hasOwnProperty(a)||j(a),i[a].reduce(function(a,c){return a.concat(c(b)||[])},[])},get:function(b){var c=h[b];return a.isFunction(c)||j(b),c},add:function(a,b){var c=arguments.length<=2||void 0===arguments[2]?[]:arguments[2];return h[a]=b,i[a]=c,this},getAllRegisteredTypes:function(){return h}};b.chartTypesRegistry=k}),e("charts/tau.chart",["exports","./tau.plot","../chart-alias-registry"],function(b,c,d){"use strict";function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0});var g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},i=function(b){function i(b){e(this,i);var f=d.chartTypesRegistry.validate(b.type,b);if(f.length>0)throw new Error(f[0]);var g=d.chartTypesRegistry.get(b.type);b=a.defaults(b,{autoResize:!0}),b.settings=c.Plot.setupSettings(b.settings),b.dimensions=c.Plot.setupMetaInfo(b.dimensions,b.data),h(Object.getPrototypeOf(i.prototype),"constructor",this).call(this,g(b)),b.autoResize&&i.winAware.push(this)}return f(i,b),g(i,[{key:"destroy",value:function(){var a=i.winAware.indexOf(this);-1!==a&&i.winAware.splice(a,1),h(Object.getPrototypeOf(i.prototype),"destroy",this).call(this)}}]),i}(c.Plot);i.resizeOnWindowEvent=function(){function a(){!c&&i.winAware.length&&(c=d(b))}function b(){c=0;for(var a,b=0,d=i.winAware.length;d>b;b++)a=i.winAware[b],a.resize()}var c,d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return setTimeout(a,17)};return a}(),i.winAware=[],window.addEventListener("resize",i.resizeOnWindowEvent),b.Chart=i}),e("utils/d3-decorators",["exports","../utils/utils-draw","underscore","d3"],function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(a,"__esModule",{value:!0});var f=e(c),g=e(d),h=f["default"].memoize(function(a){return a.node().getComputedTextLength()},function(a){return a.node().textContent.length}),i=function(a,b,c){c=c||h,a.each(function(){var a=g["default"].select(this),d=a.text().split(/\s+/),e=!1,f=d.reduce(function(d,f,g){if(e)return d;var h=g>0?[d,f].join(" "):f,i=c(a.text(h));if(b>i)d=h;else{var j=Math.floor(b/i*h.length);d=h.substr(0,j-4)+"...",e=!0}return d},"");a.text(f)})},j=function(a,b,c,d,e,f){f=f||h;var i=function(a,b,c,d,e,f,g){var h=g*c+f;return a.append("tspan").attr("x",d).attr("y",e).attr("dy",h+"em").text(b)};a.each(function(){var a=g["default"].select(this),h=a.text().split(/\s+/),j=1.1,k=a.attr("x"),l=a.attr("y"),m=parseFloat(a.attr("dy"));a.text(null);var n=i(a,null,j,k,l,m,0),o=!1,p=h.length-1,q=h.reduce(function(a,d,e){if(o)return a;var g=a.length===c||e===p,h=a[a.length-1],i=""!==h?h+" "+d:d,j=f(n.text(i)),k=j>b;if(k&&g){var l=Math.floor(b/j*i.length);a[a.length-1]=i.substr(0,l-4)+"...",o=!0}return k&&!g&&a.push(d),k||(a[a.length-1]=i),a},[""]).filter(function(a){return a.length>0});l=e?-1*(q.length-1)*Math.floor(.5*d):l,q.forEach(function(b,c){return i(a,b,j,k,l,m,c)}),n.remove()})},k=function(a,b,c){a.selectAll(".tick line").empty()||a.selectAll(".tick")[0].forEach(function(a){var d=g["default"].select(a),e=d.data()[0],f=b(e),h=c?f:0,i=c?0:f;d.attr("transform","translate("+h+","+i+")");var j=.5*b.stepSize(e),k=c?"x":"y",l=c?j:-j;d.select("line").attr(k+"1",l).attr(k+"2",l)})},l=function(a){var b=a.selectAll(".tick")[0];if(!(b.length<2)){var c=parseFloat(b[0].attributes.transform.value.replace("translate(","")),d=parseFloat(b[1].attributes.transform.value.replace("translate(","")),e=d-c,f=0,g=-1,h=a.selectAll(".tick text")[0]; if(h.forEach(function(a,b){var c=a.textContent||"",d=c.length;d>f&&(f=d,g=b)}),g>=0){var i=h[g].getBoundingClientRect();e-i.width<8&&a.classed({"graphical-report__d3-time-overflown":!0})}}},m=function(a,c,d){var e=a.selectAll(".tick line");if(!e.empty()){var f=-1;if(d)f=0;else{var g=c/e[0].length,h=g/2;f=-h}var i=a.select(".tick").node().cloneNode(!0);a.append(function(){return i}).attr("transform",b.utilsDraw.translate(0,c-f))}},n=function(a,c,d){var e=d?1:-1,f=a.append("text").attr("transform",b.utilsDraw.rotate(c.rotate)).attr("class",c.cssClass).attr("x",e*c.size*.5).attr("y",e*c.padding).style("text-anchor",c.textAnchor),g=" β†’ ",h=c.text.split(g),i=h.length;if(h.forEach(function(a,b){f.append("tspan").attr("class","label-token label-token-"+b).text(a),i-1>b&&f.append("tspan").attr("class","label-token-delimiter label-token-delimiter-"+b).text(g)}),"right"===c.dock){var j=a.selectAll("path.domain").node().getBBox();f.attr("x",d?j.width:0)}else if("left"===c.dock){var j=a.selectAll("path.domain").node().getBBox();f.attr("x",d?0:-j.height)}},o=function(a,c,d){var e=c.rotate,f=a.selectAll(".tick text");if(f.attr("transform",b.utilsDraw.rotate(e)).style("text-anchor",c.textAnchor),90===e){var g=parseFloat(f.attr("dy"))/2;f.attr("x",9).attr("y",0).attr("dy",g+"em")}c.tickFormatWordWrap?f.call(j,c.tickFormatWordWrapLimit,c.tickFormatWordWrapLines,c.$maxTickTextH,!d):f.call(i,c.tickFormatWordWrapLimit)},p=function(a,b){var c=11,d=b?-10:20,e=b?0:1,f=b?1:-1,h=[];a.selectAll(".tick").each(function(a,b){var c=g["default"].select(this),d=(c.text(),c.attr("transform").replace("translate(","").replace(" ",",").split(",")[e]),i=f*parseFloat(d),j=c.selectAll("text"),k=j.node().getBBox().width,l=k/2,m=i-l,n=i+l;h.push({c:i,s:m,e:n,l:0,textRef:j,tickRef:c})});var i=function(a,b){return a.map(function(a,c,d){return b(d[c-1]||{e:-(1/0),s:-(1/0),l:0},a,d[c+1]||{e:1/0,s:1/0,l:0})})},j=function(a,b){var c={"[T][1]":-1,"[T][-1]":0,"[T][0]":1,"[F][0]":-1},d="["+b.toString().toUpperCase().charAt(0)+"]["+a+"]";return c.hasOwnProperty(d)?c[d]:0},k=h.sort(function(a,b){return a.c-b.c});i(k,function(a,e,f){var g=a.e>e.s,h=f.s<e.e;if(g||h){e.l=j(a.l,g);var i=e.textRef[0].length,k=e.textRef.text();i>1&&(k=k.replace(/([\.]*$)/gi,"")+"...");var l=parseFloat(e.textRef.attr("y")),m=l+e.l*c;e.textRef.text(function(a,b){return 0===b?k:""}).attr("y",m);var n={x1:0,x2:0,y1:m+(b?-1:5),y2:d};b||(n.transform="rotate(-90)"),e.tickRef.append("line").attr("class","label-ref").attr(n)}return e})};a.d3_decorator_wrap_tick_label=o,a.d3_decorator_prettify_axis_label=n,a.d3_decorator_fix_axis_bottom_line=m,a.d3_decorator_fix_horizontal_axis_ticks_overflow=l,a.d3_decorator_prettify_categorical_axis_ticks=k,a.d3_decorator_avoid_labels_collisions=p,a.wrapText=j,a.cutText=i}),e("elements/coords.cartesian",["exports","d3","underscore","./element","../utils/utils-draw","../const","../formatter-registry","../utils/d3-decorators"],function(a,b,c,d,e,f,g,h){"use strict";function i(a){return a&&a.__esModule?a:{"default":a}}function j(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function l(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(a,"__esModule",{value:!0});var m=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),n=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},o=i(b),p=i(c),q=function(a){function b(a){k(this,b),n(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,a),this.config=a,this.config.guide=p["default"].defaults(this.config.guide||{},{showGridLines:"xy",padding:{l:50,r:0,t:0,b:50}}),this.config.guide.x=this.config.guide.x||{},this.config.guide.x=p["default"].defaults(this.config.guide.x,{cssClass:"x axis",textAnchor:"middle",padding:10,hide:!1,scaleOrient:"bottom",rotate:0,density:20,label:{},tickFormatWordWrapLimit:100}),p["default"].isString(this.config.guide.x.label)&&(this.config.guide.x.label={text:this.config.guide.x.label}),this.config.guide.x.label=p["default"].defaults(this.config.guide.x.label,{text:"X",rotate:0,padding:40,textAnchor:"middle"}),this.config.guide.y=this.config.guide.y||{},this.config.guide.y=p["default"].defaults(this.config.guide.y,{cssClass:"y axis",textAnchor:"start",padding:10,hide:!1,scaleOrient:"left",rotate:0,density:20,label:{},tickFormatWordWrapLimit:100}),p["default"].isString(this.config.guide.y.label)&&(this.config.guide.y.label={text:this.config.guide.y.label}),this.config.guide.y.label=p["default"].defaults(this.config.guide.y.label,{text:"Y",rotate:-90,padding:20,textAnchor:"middle"});var c=this.config,d=c.guide;if("extract-axes"===d.autoLayout){var e=c.options.containerHeight,f=e-(c.options.top+c.options.height);d.x.hide=Math.floor(f)>0,d.y.hide=Math.floor(c.options.left)>0}}return l(b,a),m(b,[{key:"createScales",value:function(a){var b=this.config,c=b.options,d=b.guide.padding,e=c.width-(d.l+d.r),f=c.height-(d.t+d.b);return this.xScale=a("pos",b.x,[0,e]),this.yScale=a("pos",b.y,[f,0]),this.W=e,this.H=f,this.regScale("x",this.xScale).regScale("y",this.yScale)}},{key:"drawFrames",value:function(a,b){var c=p["default"].extend({},this.config),d=c.options,g=c.guide.padding,h=d.left+g.l,i=d.top+g.t,j=this.W,k=this.H;c.x=this.xScale,c.y=this.yScale,c.x.scaleObj=this.xScale,c.y.scaleObj=this.yScale,c.x.guide=c.guide.x,c.y.guide=c.guide.y,c.x.guide.label.size=j,c.y.guide.label.size=k,d.container.attr("transform",e.utilsDraw.translate(h,i));var l=c.x.getHash()+k,m=c.y.getHash()+j;c.x.guide.hide||this._fnDrawDimAxis(d.container,c.x,[0,k+c.guide.x.padding],j,d.frameId+"x",l),c.y.guide.hide||this._fnDrawDimAxis(d.container,c.y,[0-c.guide.y.padding,0],k,d.frameId+"y",m);var n=function(a,d,e){var f,g=e.hash();if(e.key){var h=e.key[c.x.dim],i=e.key[c.y.dim],l=c.x(h),m=c.y(i),n=c.x.stepSize(h),p=c.y.stepSize(i);f=function(a,b){return a.options={uid:g+b,frameId:g,container:d,containerWidth:j,containerHeight:k,left:l-n/2,top:m-p/2,width:n,height:p},a}}else f=function(a,b){return a.options={uid:g+b,frameId:g,container:d,containerWidth:j,containerHeight:k,left:0,top:0,width:j,height:k},a};var q=function(a){a.options.container=o["default"].select(this),b(a,e)},r=d.selectAll(".layer_"+a).data(e.units.map(f),function(a){return a.options.uid+a.type});r.exit().remove(),r.each(q),r.enter().append("g").attr("class","layer_"+a).each(q)},q=function(a){n(d.frameId,o["default"].select(this),a)},r=this._fnDrawGrid(d.container,c,k,j,d.frameId,l+m).selectAll(".parent-frame-"+d.frameId).data(a,function(a){return a.hash()});r.exit().remove(),r.each(q),r.enter().append("g").attr("class",function(a){return f.CSS_PREFIX+"cell cell parent-frame-"+d.frameId+" frame-"+a.hash()}).each(q)}},{key:"_fnDrawDimAxis",value:function(a,b,c,d,f,i){var k=o["default"].svg.axis().scale(b.scaleObj).orient(b.guide.scaleOrient),l=g.FormatterRegistry.get(b.guide.tickFormat,b.guide.tickFormatNullAlias);null!==l&&(k.ticks(Math.round(d/b.guide.density)),k.tickFormat(l));var m=a.selectAll(".axis_"+f).data([i],function(a){return a});m.exit().remove(),m.enter().append("g").attr("class",b.guide.cssClass+" axis_"+f).attr("transform",e.utilsDraw.translate.apply(e.utilsDraw,j(c))).call(function(a){if(!a.empty()){k.call(this,a);var c="h"===e.utilsDraw.getOrientation(b.guide.scaleOrient),d="ordinal"===b.scaleType||"period"===b.scaleType;d&&(0,h.d3_decorator_prettify_categorical_axis_ticks)(a,b,c),(0,h.d3_decorator_wrap_tick_label)(a,b.guide,c),d&&b.guide.avoidCollisions&&(0,h.d3_decorator_avoid_labels_collisions)(a,c),(0,h.d3_decorator_prettify_axis_label)(a,b.guide.label,c),c&&"time"===b.scaleType&&(0,h.d3_decorator_fix_horizontal_axis_ticks_overflow)(a)}})}},{key:"_fnDrawGrid",value:function(a,b,c,d,f,i){var j=a.selectAll(".grid_"+f).data([i],function(a){return a});return j.exit().remove(),j.enter().append("g").attr("class","grid grid_"+f).attr("transform",e.utilsDraw.translate(0,0)).call(function(a){if(!a.empty()){var f=a,i=(b.guide.showGridLines||"").toLowerCase();if(i.length>0){var j=f.append("g").attr("class","grid-lines");if(i.indexOf("x")>-1){var k=b.x,l=o["default"].svg.axis().scale(k.scaleObj).orient(k.guide.scaleOrient).tickSize(c),m=g.FormatterRegistry.get(k.guide.tickFormat);null!==m&&(l.ticks(Math.round(d/k.guide.density)),l.tickFormat(m));var n=j.append("g").attr("class","grid-lines-x").call(l),q="h"===e.utilsDraw.getOrientation(k.guide.scaleOrient),r="ordinal"===k.scaleType||"period"===k.scaleType;r&&(0,h.d3_decorator_prettify_categorical_axis_ticks)(n,k,q);var s=n.select("g.tick");if(s.node()&&"translate(0,0)"!==s.attr("transform")){var t=s.node().cloneNode(!0);j.node().appendChild(t),o["default"].select(t).attr("class","border").attr("transform",e.utilsDraw.translate(0,0)).select("line").attr("x1",0).attr("x2",0)}}if(i.indexOf("y")>-1){var u=b.y,v=o["default"].svg.axis().scale(u.scaleObj).orient(u.guide.scaleOrient).tickSize(-d),m=g.FormatterRegistry.get(u.guide.tickFormat);null!==m&&(v.ticks(Math.round(c/u.guide.density)),v.tickFormat(m));var w=j.append("g").attr("class","grid-lines-y").call(v),q="h"===e.utilsDraw.getOrientation(u.guide.scaleOrient),r="ordinal"===u.scaleType||"period"===u.scaleType;r&&(0,h.d3_decorator_prettify_categorical_axis_ticks)(w,u,q);var x=["time","ordinal","period"],y=p["default"].contains(x,u.scaleType);y&&(0,h.d3_decorator_fix_axis_bottom_line)(w,c,"time"===u.scaleType)}j.selectAll("text").remove()}}}),j}}]),b}(d.Element);a.Cartesian=q}),e("elements/coords.parallel",["exports","d3","underscore","./element","../utils/utils-draw","../utils/utils","../const","../formatter-registry"],function(a,b,c,d,e,f,g,h){"use strict";function i(a){return a&&a.__esModule?a:{"default":a}}function j(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function l(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(a,"__esModule",{value:!0});var m=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),n=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},o=i(b),p=i(c),q=function(a){function b(a){var c=this;k(this,b),n(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,a),this.config=a,this.config.guide=p["default"].defaults(this.config.guide||{},{padding:{l:50,r:50,t:50,b:50},enableBrushing:!1}),this.columnsBrushes={},this.on("force-brush",function(a,b){return c._forceBrushing(b)})}return l(b,a),m(b,[{key:"createScales",value:function(a){var b=this.config,c=b.options,d=b.guide.padding,e=c.width-(d.l+d.r),f=c.height-(d.t+d.b);this.W=e,this.H=f,this.columnsScalesMap=b.columns.reduce(function(b,c){return b[c]=a("pos",c,[f,0]),b},{});var g=e/(b.columns.length-1),h=b.columns.reduce(function(a,b,c){return a[b]=c*g,a},{});return this.xBase=function(a){return h[a]},this.regScale("columns",this.columnsScalesMap)}},{key:"drawFrames",value:function(a,b){var c=this,d=p["default"].extend({},this.config),e=d.options,f=d.guide.padding,h=e.width-(f.l+f.r),i=e.height-(f.t+f.b),j=function(a,c,d){var e=d.hash(),f=function(a,b){return a.options={uid:e+b,frameId:e,container:c,containerWidth:h,containerHeight:i,left:0,top:0,width:h,height:i},a},g=function(a){a.options.container=o["default"].select(this),b(a,d)},j=c.selectAll(".layer_"+a).data(d.units.map(f),function(a){return a.options.uid+a.type});j.exit().remove(),j.each(g),j.enter().append("g").attr("class","layer_"+a).each(g)},k=function(a){j(e.frameId,o["default"].select(this),a)},l=this._fnDrawGrid(e.container,d,e.frameId,Object.keys(this.columnsScalesMap).reduce(function(a,b){return a.concat([c.columnsScalesMap[b].getHash()])},[]).join("_")),m=l.selectAll(".parent-frame-"+e.frameId).data(a,function(a){return a.hash()});m.exit().remove(),m.each(k),m.enter().append("g").attr("class",function(a){return g.CSS_PREFIX+"cell cell parent-frame-"+e.frameId+" frame-"+a.hash()}).each(k);var n=this._fnDrawColumns(l,d);d.guide.enableBrushing&&this._enableBrushing(n)}},{key:"_fnDrawGrid",value:function(a,b,c,d){var f=b.options,g=b.guide.padding,h=f.left+g.l,i=f.top+g.t,j=a.selectAll(".grid_"+c).data([d],p["default"].identity);return j.exit().remove(),j.enter().append("g").attr("class","grid grid_"+c).attr("transform",e.utilsDraw.translate(h,i)),j}},{key:"_fnDrawColumns",value:function(a,b){var c=b.guide.columns||{},d=this.xBase,f=this.columnsScalesMap,g=o["default"].svg.axis().orient("left"),i=a.selectAll(".column").data(b.columns,p["default"].identity);return i.exit().remove(),i.enter().append("g").attr("class","column").attr("transform",function(a){return e.utilsDraw.translate(d(a),0)}).call(function(){this.append("g").attr("class","y axis").each(function(a){var b=f[a].dim,d=g.scale(f[a]),e=c[b]||{},i=h.FormatterRegistry.get(e.tickFormat,e.tickFormatNullAlias);null!==i&&d.tickFormat(i),o["default"].select(this).call(d)}).append("text").attr("class","label").attr("text-anchor","middle").attr("y",-9).text(function(a){return((c[a]||{}).label||{}).text||f[a].dim})}),i}},{key:"_enableBrushing",value:function(a){var b=this,c=16,d=this.columnsScalesMap,e=this.columnsBrushes,g=function(a){return a},h=function(a){return a},i=function(a){var c=Object.keys(e).filter(function(a){return!e[a].empty()}).map(function(a){var b=e[a].extent(),c=[];return c=d[a].discrete?d[a].domain().filter(function(c){var e=d[a](c);return b[0]<=e&&b[1]>=e}):[b[0],b[1]],{dim:d[a].dim,func:d[a].discrete?"inset":"between",args:c}});b.fire("brush",c)};return a.selectAll(".brush").remove(),a.append("g").attr("class","brush").each(function(a){e[a]=o["default"].svg.brush().y(d[a]).on("brushstart",g).on("brush",i).on("brushend",h),o["default"].select(this).classed("brush-"+f.utils.generateHash(a),!0).call(e[a])}).selectAll("rect").attr("x",c/2*-1).attr("width",c),a}},{key:"_forceBrushing",value:function(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],b=this.columnsBrushes,c=this.columnsScalesMap;Object.keys(a).filter(function(d){return b[d]&&c[d]&&a[d]}).forEach(function(d){var e=a[d],g=[];if(c[d].discrete){var h=e.map(c[d]).filter(function(a){return a>=0}),i=c[d].stepSize()/2;g=[Math.min.apply(Math,j(h))-i,Math.max.apply(Math,j(h))+i]}else g=[e[0],e[1]];var k=f.utils.generateHash(d);b[d].extent(g),b[d](o["default"].select(".brush-"+k)),b[d].event(o["default"].select(".brush-"+k))})}}]),b}(d.Element);a.Parallel=q}),!function(){function a(a,b){function c(b){var c,d=a.arcs[0>b?~b:b],e=d[0];return a.transform?(c=[0,0],d.forEach(function(a){c[0]+=a[0],c[1]+=a[1]})):c=d[d.length-1],0>b?[c,e]:[e,c]}function d(a,b){for(var c in a){var d=a[c];delete b[d.start],delete d.start,delete d.end,d.forEach(function(a){e[0>a?~a:a]=1}),h.push(d)}}var e={},f={},g={},h=[],i=-1;return b.forEach(function(c,d){var e,f=a.arcs[0>c?~c:c];f.length<3&&!f[1][0]&&!f[1][1]&&(e=b[++i],b[i]=c,b[d]=e)}),b.forEach(function(a){var b,d,e=c(a),h=e[0],i=e[1];if(b=g[h])if(delete g[b.end],b.push(a),b.end=i,d=f[i]){delete f[d.start];var j=d===b?b:b.concat(d);f[j.start=b.start]=g[j.end=d.end]=j}else f[b.start]=g[b.end]=b;else if(b=f[i])if(delete f[b.start],b.unshift(a),b.start=h,d=g[h]){delete g[d.end];var k=d===b?b:d.concat(b);f[k.start=d.start]=g[k.end=b.end]=k}else f[b.start]=g[b.end]=b;else b=[a],f[b.start=h]=g[b.end=i]=b}),d(g,f),d(f,g),b.forEach(function(a){e[0>a?~a:a]||h.push([a])}),h}function b(b,c,d){function e(a){var b=0>a?~a:a;(k[b]||(k[b]=[])).push({i:a,g:j})}function f(a){a.forEach(e)}function g(a){a.forEach(f)}function h(a){"GeometryCollection"===a.type?a.geometries.forEach(h):a.type in l&&(j=a,l[a.type](a.arcs))}var i=[];if(arguments.length>1){var j,k=[],l={LineString:f,MultiLineString:g,Polygon:g,MultiPolygon:function(a){a.forEach(g)}};h(c),k.forEach(arguments.length<3?function(a){i.push(a[0].i)}:function(a){d(a[0].g,a[a.length-1].g)&&i.push(a[0].i)})}else for(var m=0,n=b.arcs.length;n>m;++m)i.push(m);return{type:"MultiLineString",arcs:a(b,i)}}function c(b,c){function d(a){a.forEach(function(b){b.forEach(function(b){(f[b=0>b?~b:b]||(f[b]=[])).push(a)})}),h.push(a)}function e(a){return l(g(b,{type:"Polygon",arcs:[a]}).coordinates[0])>0}var f={},h=[],i=[];return c.forEach(function(a){"Polygon"===a.type?d(a.arcs):"MultiPolygon"===a.type&&a.arcs.forEach(d)}),h.forEach(function(a){if(!a._){var b=[],c=[a];for(a._=1,i.push(b);a=c.pop();)b.push(a),a.forEach(function(a){a.forEach(function(a){f[0>a?~a:a].forEach(function(a){a._||(a._=1,c.push(a))})})})}}),h.forEach(function(a){delete a._}),{type:"MultiPolygon",arcs:i.map(function(c){var d=[];if(c.forEach(function(a){a.forEach(function(a){a.forEach(function(a){f[0>a?~a:a].length<2&&d.push(a)})})}),d=a(b,d),(n=d.length)>1)for(var g,h=e(c[0][0]),i=0;i<n;++i)if(h===e(d[i])){g=d[0],d[0]=d[i],d[i]=g;break}return d})}}function d(a,b){return"GeometryCollection"===b.type?{type:"FeatureCollection",features:b.geometries.map(function(b){return f(a,b)})}:f(a,b)}function f(a,b){var c={type:"Feature",id:b.id,properties:b.properties||{},geometry:g(a,b)};return null==b.id&&delete c.id,c}function g(a,b){function c(a,b){b.length&&b.pop();for(var c,d=k[0>a?~a:a],e=0,f=d.length;f>e;++e)b.push(c=d[e].slice()),j(c,e);0>a&&h(b,f)}function d(a){return a=a.slice(),j(a,0),a}function e(a){for(var b=[],d=0,e=a.length;e>d;++d)c(a[d],b);return b.length<2&&b.push(b[0].slice()),b}function f(a){for(var b=e(a);b.length<4;)b.push(b[0].slice());return b}function g(a){return a.map(f)}function i(a){var b=a.type;return"GeometryCollection"===b?{type:b,geometries:a.geometries.map(i)}:b in l?{type:b,coordinates:l[b](a)}:null}var j=q(a.transform),k=a.arcs,l={Point:function(a){return d(a.coordinates)},MultiPoint:function(a){return a.coordinates.map(d)},LineString:function(a){return e(a.arcs)},MultiLineString:function(a){return a.arcs.map(e)},Polygon:function(a){return g(a.arcs)},MultiPolygon:function(a){return a.arcs.map(g)}};return i(b)}function h(a,b){for(var c,d=a.length,e=d-b;e<--d;)c=a[e],a[e++]=a[d],a[d]=c}function i(a,b){for(var c=0,d=a.length;d>c;){var e=c+d>>>1;a[e]<b?c=e+1:d=e}return c}function j(a){function b(a,b){a.forEach(function(a){0>a&&(a=~a);var c=e[a];c?c.push(b):e[a]=[b]})}function c(a,c){a.forEach(function(a){b(a,c)})}function d(a,b){"GeometryCollection"===a.type?a.geometries.forEach(function(a){d(a,b)}):a.type in g&&g[a.type](a.arcs,b)}var e={},f=a.map(function(){return[]}),g={LineString:b,MultiLineString:c,Polygon:c,MultiPolygon:function(a,b){a.forEach(function(a){c(a,b)})}};a.forEach(d);for(var h in e)for(var j=e[h],k=j.length,l=0;k>l;++l)for(var m=l+1;k>m;++m){var n,o=j[l],p=j[m];(n=f[o])[h=i(n,p)]!==p&&n.splice(h,0,p),(n=f[p])[h=i(n,o)]!==o&&n.splice(h,0,o)}return f}function k(a,b){function c(a){f.remove(a),a[1][2]=b(a),f.push(a)}var d=q(a.transform),e=r(a.transform),f=p();return b||(b=m),a.arcs.forEach(function(a){for(var g,h,i=[],j=0,k=0,l=a.length;l>k;++k)h=a[k],d(a[k]=[h[0],h[1],1/0],k);for(var k=1,l=a.length-1;l>k;++k)g=a.slice(k-1,k+2),g[1][2]=b(g),i.push(g),f.push(g);for(var k=0,l=i.length;l>k;++k)g=i[k],g.previous=i[k-1],g.next=i[k+1];for(;g=f.pop();){var m=g.previous,n=g.next;g[1][2]<j?g[1][2]=j:j=g[1][2],m&&(m.next=n,m[2]=g[2],c(m)),n&&(n.previous=m,n[0]=g[0],c(n))}a.forEach(e)}),a}function l(a){for(var b,c=-1,d=a.length,e=a[d-1],f=0;++c<d;)b=e,e=a[c],f+=b[0]*e[1]-b[1]*e[0];return.5*f}function m(a){var b=a[0],c=a[1],d=a[2];return Math.abs((b[0]-d[0])*(c[1]-b[1])-(b[0]-c[0])*(d[1]-b[1]))}function o(a,b){return a[1][2]-b[1][2]}function p(){function a(a,b){for(;b>0;){var c=(b+1>>1)-1,e=d[c];if(o(a,e)>=0)break;d[e._=b]=e,d[a._=b=c]=a}}function b(a,b){for(;;){var c=b+1<<1,f=c-1,g=b,h=d[g];if(e>f&&o(d[f],h)<0&&(h=d[g=f]),e>c&&o(d[c],h)<0&&(h=d[g=c]),g===b)break;d[h._=b]=h,d[a._=b=g]=a}}var c={},d=[],e=0;return c.push=function(b){return a(d[b._=e]=b,e++),e},c.pop=function(){if(!(0>=e)){var a,c=d[0];return--e>0&&(a=d[e],b(d[a._=0]=a,0)),c}},c.remove=function(c){var f,g=c._;if(d[g]===c)return g!==--e&&(f=d[e],(o(f,c)<0?a:b)(d[f._=g]=f,g)),g},c}function q(a){if(!a)return s;var b,c,d=a.scale[0],e=a.scale[1],f=a.translate[0],g=a.translate[1];return function(a,h){h||(b=c=0),a[0]=(b+=a[0])*d+f,a[1]=(c+=a[1])*e+g}}function r(a){if(!a)return s;var b,c,d=a.scale[0],e=a.scale[1],f=a.translate[0],g=a.translate[1];return function(a,h){h||(b=c=0);var i=(a[0]-f)/d|0,j=(a[1]-g)/e|0;a[0]=i-b,a[1]=j-c,b=i,c=j}}function s(){}var t={version:"1.6.19",mesh:function(a){return g(a,b.apply(this,arguments))},meshArcs:b,merge:function(a){return g(a,c.apply(this,arguments))},mergeArcs:c,feature:d,neighbors:j,presimplify:k};"function"==typeof e&&e.amd?e("topojson",t):"object"==typeof module&&module.exports?module.exports=t:this.topojson=t}(),e("utils/d3-labeler",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var b=function(){var a,b,c=[],d=[],e=1,f=1,g={},h=5,i=.5,j=0,k=0,l=.2,m=1,n=30,o=30,p=3,q=!1,r=!1,s=function(a){var b=c.length,e=0,f=c[a].x-d[a].x,g=d[a].y-c[a].y,h=Math.sqrt(f*f+g*g),i=!0;h>0&&(e+=h*l),f/=h,g/=h,e+=f>0&&g>0?0*p:0>f&&g>0?1*p:0>f&&0>g?2*p:3*p;for(var j,k,q,r,s,t,u,w=c[a].x,x=c[a].y-c[a].height+2,y=c[a].x+c[a].width,z=c[a].y+2,A=0;b>A;A++)A!=a&&(i=v(d[a].x,c[a].x,d[A].x,c[A].x,d[a].y,c[a].y,d[A].y,c[A].y),i&&(e+=m),j=c[A].x,q=c[A].y-c[A].height+2,k=c[A].x+c[A].width,r=c[A].y+2,s=Math.max(0,Math.min(k,y)-Math.max(j,w)),t=Math.max(0,Math.min(r,z)-Math.max(q,x)),u=s*t,e+=u*n),j=d[A].x-d[A].r,q=d[A].y-d[A].r,k=d[A].x+d[A].r,r=d[A].y+d[A].r,s=Math.max(0,Math.min(k,y)-Math.max(j,w)),t=Math.max(0,Math.min(r,z)-Math.max(q,x)),u=s*t,e+=u*o;return e},t=function(b){var g,i=Math.floor(Math.random()*c.length),l=c[i].x,m=c[i].y;g=q?a(i,c,d):s(i),c[i].x+=(Math.random()-.5)*h,c[i].y+=(Math.random()-.5)*h,c[i].x>e&&(c[i].x=l),c[i].x<0&&(c[i].x=l),c[i].y>f&&(c[i].y=m),c[i].y<0&&(c[i].y=m);var n;n=q?a(i,c,d):s(i);var o=n-g;Math.random()<Math.exp(-o/b)?j+=1:(c[i].x=l,c[i].y=m,k+=1)},u=function(b){var g,h=Math.floor(Math.random()*c.length),l=c[h].x,m=c[h].y;g=q?a(h,c,d):s(h);var n=(Math.random()-.5)*i,o=Math.sin(n),p=Math.cos(n);c[h].x-=d[h].x,c[h].y-=d[h].y;var r=c[h].x*p-c[h].y*o,t=c[h].x*o+c[h].y*p;c[h].x=r+d[h].x,c[h].y=t+d[h].y,c[h].x>e&&(c[h].x=l),c[h].x<0&&(c[h].x=l),c[h].y>f&&(c[h].y=m),c[h].y<0&&(c[h].y=m);var u;u=q?a(h,c,d):s(h);var v=u-g;Math.random()<Math.exp(-v/b)?j+=1:(c[h].x=l,c[h].y=m,k+=1)},v=function(a,b,c,d,e,f,g,h){var i,j,k,l,m;return k=(h-g)*(b-a)-(d-c)*(f-e),l=(d-c)*(e-g)-(h-g)*(a-c),m=(b-a)*(e-g)-(f-e)*(a-c),i=l/k,j=m/k,0>i||i>1||0>j||j>1?!1:!0},w=function(a,b,c){return a-b/c};return g.start=function(a){for(var b=c.length,d=1,e=1,f=0;a>f;f++){for(var g=0;b>g;g++)Math.random()<.5?t(d):u(d);d=w(d,e,a)}},g.width=function(a){return arguments.length?(e=a,g):e},g.height=function(a){return arguments.length?(f=a,g):f},g.label=function(a){return arguments.length?(c=a,g):c},g.anchor=function(a){return arguments.length?(d=a,g):d},g.alt_energy=function(b){return arguments.length?(a=b,q=!0,g):s},g.alt_schedule=function(a){return arguments.length?(b=a,r=!0,g):w},g};a.d3Labeler=b}),e("elements/coords.geomap",["exports","d3","underscore","topojson","../utils/utils-draw","../utils/d3-labeler","../const","../formatter-registry","./element"],function(a,b,c,d,e,f,g,h,i){"use strict";function j(a){return a&&a.__esModule?a:{"default":a}}function k(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function l(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(a,"__esModule",{value:!0});var m=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),n=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},o=j(b),p=j(c),q=j(d);o["default"].labeler=f.d3Labeler;var r=5.5,s=10,t=.5,u=["land","continents","georegions","countries","regions","subunits","states","counties"],v=function(a){function b(a){var c=this;k(this,b),n(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,a),this.config=a,this.config.guide=p["default"].defaults(this.config.guide||{},{defaultFill:"rgba(128,128,128,0.25)",padding:{l:0,r:0,t:0,b:0},showNames:!0}),this.contourToFill=null,this.on("highlight-area",function(a,b){return c._highlightArea(b)}),this.on("highlight-point",function(a,b){return c._highlightPoint(b)}),this.on("highlight",function(a,b){return c._highlightPoint(b)})}return l(b,a),m(b,[{key:"createScales",value:function(a){var b=this.config,c=b.options,d=b.guide.padding,e=c.width-(d.l+d.r),f=c.height-(d.t+d.b);return this.latScale=a("pos",b.latitude,[0,f]),this.lonScale=a("pos",b.longitude,[e,0]),this.sizeScale=a("size",b.size),this.colorScale=a("color",b.color),this.codeScale=a("value",b.code),this.fillScale=a("fill",b.fill),this.W=e,this.H=f,this.regScale("latitude",this.latScale).regScale("longitude",this.lonScale).regScale("size",this.sizeScale).regScale("color",this.colorScale).regScale("code",this.codeScale).regScale("fill",this.fillScale)}},{key:"drawFrames",value:function(a){var b=this,c=this.config.guide;"string"==typeof c.sourcemap?o["default"].json(c.sourcemap,function(c,d){if(c)throw c;b._drawMap(a,d)}):this._drawMap(a,c.sourcemap)}},{key:"_calcLabels",value:function(a,b,c){var d=this.W,e=this.H,f={};return b.forEach(function(b){var g=q["default"].feature(a,a.objects[b]).features||[],h=g.map(function(a){var e=a.properties||{},f=c.centroid(a),g=c.bounds(a),h=f[0],i=f[1],j=g[1][0],k=g[0][0],l=j-k,m=e.name||"",n=e.abbr||m,o=l<m.length*r,p=o?n:m,q=2.5*r>l,s=q?d-h-3*r:0;return{id:b+"-"+a.id,sx:h,sy:i,x:h+s,y:i,width:p.length*r,height:10,name:p,r:s,isRef:q}}).filter(function(a){return!isNaN(a.x)&&!isNaN(a.y)}),i=h.map(function(a){return{x:a.sx,y:a.sy,r:a.r}});o["default"].labeler().label(h).anchor(i).width(d).height(e).start(s),h.filter(function(a){return!a.isRef}).map(function(a){return a.x=a.sx,a.y=a.sy,a}).reduce(function(a,b){return a[b.id]=b,a},f);var j=h.filter(function(a){return a.isRef});j.length<6&&j.reduce(function(a,b){return a[b.id]=b,a},f)}),f}},{key:"_drawMap",value:function(a,b){var c=this,d=this,e=this.config.guide,f=this.config.options,g=this.config.options.container,h=this.latScale,i=this.lonScale,j=this.sizeScale,k=this.colorScale,l=this.codeScale,m=this.fillScale,n=this.W,s=this.H,v=u.filter(function(a){return(b.objects||{}).hasOwnProperty(a)});if(0===v.length)throw new Error("Invalid map: should contain some contours");var w;if(m.dim){if(!l.georole)throw console.log("Specify [georole] for code scale"),new Error("[georole] is missing");if(-1===v.indexOf(l.georole))throw console.log('There is no contour for georole "'+l.georole+'"'),console.log("Available contours are: "+v.join(" | ")),new Error("Invalid [georole]");w=l.georole}else w=v[v.length-1];this.contourToFill=w;var x;if(h.dim&&i.dim){var y=o["default"].extent(h.domain()),z=o["default"].extent(i.domain());x=[(z[1]+z[0])/2,(y[1]+y[0])/2]}var A=this._createProjection(b,v[0],x),B=o["default"].geo.path().projection(A),C=g.selectAll(".map-container").data([""+n+s+x+v.join("-")],p["default"].identity);C.exit().remove(),C.enter().append("g").call(function(){var a=this;a.attr("class","map-container");var c={},f=v.reduceRight(function(a,b){return a.concat(b)},[]);if(e.showNames&&(c=d._calcLabels(b,f,B)),f.forEach(function(d,e){var f=function(a){return c[d+"-"+a.id]};a.selectAll(".map-contour-"+d).data(q["default"].feature(b,b.objects[d]).features||[]).enter().append("g").call(function(){var a=this;a.attr("class","map-contour-"+d+" map-contour-level map-contour-level-"+e).attr("fill","none"),a.append("title").text(function(a){return(a.properties||{}).name}),a.append("path").attr("d",B),a.append("text").attr("class","place-label-"+d).attr("transform",function(a){var b=f(a);return b?"translate("+[b.x,b.y]+")":""}).text(function(a){var b=f(a);return b?b.name:""}),a.append("line").attr("class","place-label-link-"+d).attr("stroke","gray").attr("stroke-width",.25).attr("x1",function(a){var b=f(a);return b&&b.isRef?b.sx:0}).attr("y1",function(a){var b=f(a);return b&&b.isRef?b.sy:0}).attr("x2",function(a){var b=f(a);return b&&b.isRef?b.x-.6*b.name.length*r:0}).attr("y2",function(a){var b=f(a);return b&&b.isRef?b.y-3.5:0})})}),b.objects.hasOwnProperty("places")){var g=q["default"].feature(b,b.objects.places),h=g.features.map(function(a){var b=A(a.geometry.coordinates);return{x:b[0]+3.5,y:b[1]+3.5,width:a.properties.name.length*r,height:12,name:a.properties.name}}),i=g.features.map(function(a){var b=A(a.geometry.coordinates);return{x:b[0],y:b[1],r:2.5}});o["default"].labeler().label(h).anchor(i).width(n).height(s).start(100),a.selectAll(".place").data(i).enter().append("circle").attr("class","place").attr("transform",function(a){return"translate("+a.x+","+a.y+")"}).attr("r",function(a){return a.r+"px"}),a.selectAll(".place-label").data(h).enter().append("text").attr("class","place-label").attr("transform",function(a){return"translate("+a.x+","+a.y+")"}).text(function(a){return a.name})}}),this.groupByCode=a.reduce(function(a,b){return b.part().reduce(function(a,b){var c=(b[l.dim]||"").toLowerCase();return a[c]=b,a},a)},{});var D=this._resolveFeature.bind(this);if(C.selectAll(".map-contour-"+w).data(q["default"].feature(b,b.objects[w]).features).call(function(){this.classed("map-contour",!0).attr("fill",function(a){var b=D(a);return null===b?e.defaultFill:m(b[m.dim])})}).on("mouseover",function(a){return c.fire("area-mouseover",{data:D(a),event:o["default"].event})}).on("mouseout",function(a){return c.fire("area-mouseout",{data:D(a),event:o["default"].event})}).on("click",function(a){return c.fire("area-click",{data:D(a),event:o["default"].event})}),!h.dim||!i.dim)return[];var E=function(){return this.attr({r:function(a){var b=a.data;return j(b[j.dim])},transform:function(a){var b=a.data;return"translate("+A([b[i.dim],b[h.dim]])+")"},"class":function(a){var b=a.data;return k(b[k.dim])},opacity:t}).on("mouseover",function(a){var b=a.data;return d.fire("point-mouseover",{data:b,event:o["default"].event})}).on("mouseout",function(a){var b=a.data;return d.fire("point-mouseout",{data:b, event:o["default"].event})}).on("click",function(a){var b=a.data;return d.fire("point-click",{data:b,event:o["default"].event})})},F=function(){this.attr("class",function(a){return"frame-id-"+f.uid+" frame-"+a.hash}).call(function(){var a=this.selectAll("circle").data(function(a){return a.data.map(function(a){return{data:a,uid:f.uid}})});a.exit().remove(),a.call(E),a.enter().append("circle").call(E)})},G=function(a){return{tags:a.key||{},hash:a.hash(),data:a.part()}},H=C.selectAll(".frame-id-"+f.uid).data(a.map(G),function(a){return a.hash});return H.exit().remove(),H.call(F),H.enter().append("g").call(F),[]}},{key:"_resolveFeature",value:function(a){var b,c=this.groupByCode,d=a.properties,e=["c1","c2","c3","abbr","name"].filter(function(a){return d.hasOwnProperty(a)&&d[a]&&c.hasOwnProperty(d[a].toLowerCase())});if(0===e.length)b=null;else if(e.length>0){var f=d[e[0]].toLowerCase();b=c[f]}return b}},{key:"_highlightArea",value:function(a){var b=this,c=this.config.options.container,d=this.contourToFill;c.selectAll(".map-contour-"+d).classed("map-contour-highlighted",function(c){return a(b._resolveFeature(c))})}},{key:"_highlightPoint",value:function(a){this.config.options.container.selectAll("circle").classed("map-point-highlighted",function(b){var c=b.data;return a(c)}).attr("opacity",function(b){var c=b.data;return a(c)?t:.1})}},{key:"_createProjection",value:function(a,b,c){var d=this.W,e=this.H,f=this.config.guide,g=100,h=[d/2,e/2],i=c||a.center,j=f.projection||a.projection||"mercator",k=this._createD3Projection(j,i,g,h),l=o["default"].geo.path().projection(k),m=l.bounds(q["default"].feature(a,a.objects[b])),n=g*d/(m[1][0]-m[0][0]),p=g*e/(m[1][1]-m[0][1]);return g=p>n?n:p,h=[d-(m[0][0]+m[1][0])/2,e-(m[0][1]+m[1][1])/2],this._createD3Projection(j,i,g,h)}},{key:"_createD3Projection",value:function(a,b,c,d){var e=o["default"].geo[a];if(!e)throw console.log('Unknown projection "'+a+'"'),console.log("See available projection types here: https://github.com/mbostock/d3/wiki/Geo-Projections"),new Error('Invalid map: unknown projection "'+a+'"');var f=e(),g=[{method:"scale",args:c},{method:"center",args:b},{method:"translate",args:d}].filter(function(a){return a.args});return g.reduce(function(a,b){return a[b.method]&&(a=a[b.method](b.args)),a},f)}}]),b}(i.Element);a.GeoMap=v}),e("elements/element.path",["exports","../const","./element","./decorators/show-text","./decorators/show-anchors","../utils/css-class-map"],function(c,d,e,f,g,h){"use strict";function i(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function j(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var k=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),l=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},m=function(c){function e(b){var c=this;i(this,e),l(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,b),this.config=b,this.config.guide=this.config.guide||{},this.config.guide=a.defaults(this.config.guide,{cssClass:"",showAnchors:!0,anchorSize:.1,color:{},text:{}}),this.config.guide.text=a.defaults(this.config.guide.text,{fontSize:11,paddingX:0,paddingY:0}),this.config.guide.color=a.defaults(this.config.guide.color,{fill:null}),this.on("highlight",function(a,b){return c.highlight(b)}),this.on("highlight-data-points",function(a,b){return c.highlightDataPoints(b)}),this.config.guide.showAnchors&&(this.on("mouseover",function(a,b){return a.fire("highlight-data-points",function(a){return a===b.data})}),this.on("mousemove",function(a,b){return a.fire("highlight-data-points",function(a){return a===b.data})}),this.on("mouseout",function(a,b){a.fire("highlight-data-points",function(a){return!1})}))}return j(e,c),k(e,[{key:"createScales",value:function(a){var b=this.config;return this.xScale=a("pos",b.x,[0,b.options.width]),this.yScale=a("pos",b.y,[b.options.height,0]),this.color=a("color",b.color,{}),this.size=a("size",b.size,{}),this.text=a("text",b.text,{}),this.regScale("x",this.xScale).regScale("y",this.yScale).regScale("size",this.size).regScale("color",this.color).regScale("text",this.text)}},{key:"packFrameData",value:function(a){return a}},{key:"unpackFrameData",value:function(a){return a}},{key:"getDistance",value:function(a,b,c,d){return Math.sqrt(Math.pow(a-c,2)+Math.pow(b-d,2))}},{key:"drawFrames",value:function(a){var c=this,e=this.config.guide,i=this.config.options,j=this.xScale,k=this.yScale,l=this.color,m=this.text,n=(0,h.getLineClassesByCount)(a.length),o=d.CSS_PREFIX+"area i-role-element area "+n+" "+e.cssClass+" ",p=function(a){return a.map(function(a){return[j(a[j.dim]),k(a[k.dim])].join(",")}).join(" ")},q=function(){var a=this.selectAll("polygon").data(function(a){var b=a.data;return[c.packFrameData(b.data)]});if(a.exit().remove(),a.attr("points",p),a.enter().append("polygon").attr("points",p),c.subscribe(a,function(a){var d=b.mouse(this),e=d[0],f=d[1],g=c.unpackFrameData(a).map(function(a){var b=j(a[j.dim]),d=k(a[k.dim]);return{x:b,y:d,dist:c.getDistance(e,f,b,d),data:a}}).sort(function(a,b){return a.dist-b.dist})[0];return g.data}),e.showAnchors&&!this.empty()){var d=(0,g.elementDecoratorShowAnchors)({xScale:j,yScale:k,guide:e,container:this});c.subscribe(d)}m.dim&&!this.empty()&&(0,f.elementDecoratorShowText)({guide:e,xScale:j,yScale:k,textScale:m,container:this})},r=function(a){return function(){this.attr("class",function(b){var c=b.data;return o+" "+l(c.tags[l.dim])+" "+a+" frame-"+c.hash}).call(function(){e.color.fill&&!l.dim&&this.style({fill:e.color.fill,stroke:e.color.fill}),q.call(this)})}},s=function(a){return{data:{tags:a.key||{},hash:a.hash(),data:a.part()},uid:i.uid}},t=function(b){var c=i.container.selectAll(".frame-"+b).data(a.map(s),function(a){var b=a.data;return b.hash});c.exit().remove(),c.call(r("frame-"+b)),c.enter().append("g").call(r("frame-"+b))};t("area-"+i.uid)}},{key:"highlight",value:function(a){this.config.options.container.selectAll(".area").classed({"graphical-report__highlighted":function(b){var c=b.data;return a(c.tags)===!0},"graphical-report__dimmed":function(b){var c=b.data;return a(c.tags)===!1}})}},{key:"highlightDataPoints",value:function(a){var b=this,c=this.color,d="i-data-anchor";this.config.options.container.selectAll("."+d).attr({r:function(c){return a(c)?3:b.config.guide.anchorSize},"class":function(a){return d+" "+c(a[c.dim])}})}}]),e}(e.Element);c.Path=m}),e("elements/element.area",["exports","./element.path","../utils/utils"],function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(a,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},h=function(a){function b(a){d(this,b),g(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,a)}return e(b,a),f(b,[{key:"_assignBase",value:function(a,b){var d=a.domain(),e=a.dim,f=d[0],g=d[d.length-1],h=c.utils.clone(b[0]),i=c.utils.clone(b[b.length-1]),j=a.discrete?f:0>f?Math.min(0,g):f;return h[e]=j,i[e]=j,[h].concat(b).concat(i)}},{key:"packFrameData",value:function(a){var b=this.config.guide,c=b.flip?this.xScale:this.yScale;return this._assignBase(c,a)}},{key:"unpackFrameData",value:function(a){var b=a.length-1;return a.filter(function(a,c){return c>0&&b>c})}},{key:"getDistance",value:function(a,b,c,d){var e=this.config.guide;return e.flip?Math.abs(b-d):Math.abs(a-c)}}]),b}(b.Path);a.Area=h}),e("elements/element.parallel.line",["exports","../const","./element"],function(c,d,e){"use strict";function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},j=function(c){function e(b){var c=this;f(this,e),i(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,b),this.config=b,this.config.guide=a.defaults(this.config.guide||{},{}),this.on("highlight",function(a,b){return c.highlight(b)})}return g(e,c),h(e,[{key:"createScales",value:function(a){var b=this.config,c=b.options;this.color=a("color",b.color,{}),this.scalesMap=b.columns.reduce(function(b,d){return b[d]=a("pos",d,[c.height,0]),b},{});var d=c.width/(b.columns.length-1),e=b.columns.reduce(function(a,b,c){return a[b]=c*d,a},{});return this.xBase=function(a){return e[a]},this.regScale("columns",this.scalesMap).regScale("color",this.color)}},{key:"drawFrames",value:function(a){var c=this.config,e=this.config.options,f=this.scalesMap,g=this.xBase,h=this.color,i=b.svg.line(),j=function(){this.attr("d",function(a){return i(c.columns.map(function(b){return[g(b),f[b](a[f[b].dim])]}))})},k=function(){this.attr("class",function(a){return d.CSS_PREFIX+"__line line "+h(a[h.dim])+" foreground"})},l=function(){var a=this.selectAll(".background").data(function(a){return a.part()});a.exit().remove(),a.call(j),a.enter().append("path").attr("class","background line").call(j);var b=this.selectAll(".foreground").data(function(a){return a.part()});b.exit().remove(),b.call(function(){j.call(this),k.call(this)}),b.enter().append("path").call(function(){j.call(this),k.call(this)})},m=e.container.selectAll(".lines-frame").data(a,function(a){return a.hash()});m.exit().remove(),m.call(l),m.enter().append("g").attr("class","lines-frame").call(l),this.subscribe(e.container.selectAll(".lines-frame .foreground"))}},{key:"highlight",value:function(a){this.config.options.container.selectAll(".lines-frame .foreground").style("visibility",function(b){return a(b)?"":"hidden"})}}]),e}(e.Element);c.ParallelLine=j}),e("scales/base",["exports","../utils/utils","underscore"],function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=d(c),h=function(a){return"date"===a?function(a){return new Date(a).getTime()}:function(a){return a}},i=function(a,c){return b.utils.generateHash([a,c].map(JSON.stringify).join(""))},j=function(){function a(b,c){var d=this;e(this,a),this._fields={};var f;if(g["default"].isArray(c.fitToFrameByDims)&&c.fitToFrameByDims.length){var h=function(a){var b={};return"where"===a.type&&a.args?(b.type=a.type,b.args=c.fitToFrameByDims.reduce(function(b,c){return a.args.hasOwnProperty(c)&&(b[c]=a.args[c]),b},{})):b=a,b};f=b.part(h)}else f=b.full();var i=this.getVarSet(f,c);c.order&&(i=g["default"].union(g["default"].intersection(c.order,i),i)),this.vars=i,this.scaleConfig=c,this.addField("dim",this.scaleConfig.dim).addField("scaleDim",this.scaleConfig.dim).addField("scaleType",this.scaleConfig.type).addField("source",this.scaleConfig.source).addField("domain",function(){return d.vars})}return f(a,[{key:"domain",value:function(){return this.vars}},{key:"addField",value:function(a,b){return this._fields[a]=b,this[a]=b,this}},{key:"getField",value:function(a){return this._fields[a]}},{key:"toBaseScale",value:function(a){var b=this,c=arguments.length<=1||void 0===arguments[1]?null:arguments[1],d=Object.keys(this._fields).reduce(function(a,c){return a[c]=b._fields[c],a},a);return d.getHash=function(){return i(b.vars,c)},d}},{key:"getVarSet",value:function(a,b){return(0,g["default"])(a).chain().pluck(b.dim).uniq(h(b.dimType)).value()}}]),a}();a.BaseScale=j}),e("scales/color",["exports","./base","underscore","d3"],function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(a,"__esModule",{value:!0});var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},j=e(c),k=e(d),l=function(a){function b(a,c){f(this,b),i(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,a,c),this.defaultColorClass=j["default"].constant("color-default");var d=this.scaleConfig.brewer||j["default"].times(20,function(a){return"color20-"+(1+a)});this.addField("scaleType","color").addField("brewer",d)}return g(b,a),h(b,[{key:"create",value:function(){var a,b=this,c=this.vars,d=this.getField("brewer"),e=function(a,c){if(0===a.length||1===a.length&&null===a[0])return b.defaultColorClass;var d=a.map(function(a){return String(a).toString()});return k["default"].scale.ordinal().range(c).domain(d)},f=function(a,b){var c=j["default"].keys(a),d=j["default"].values(a),e=k["default"].scale.ordinal().range(d).domain(c);return function(c){return a.hasOwnProperty(c)?e(c):b(c)}},g=function(a){return function(b){return a(String(b).toString())}};if(j["default"].isArray(d))a=g(e(c,d));else if(j["default"].isFunction(d))a=function(a){return d(a,g(e(c,j["default"].times(20,function(a){return"color20-"+(1+a)}))))};else{if(!j["default"].isObject(d))throw new Error("This brewer is not supported");a=f(d,this.defaultColorClass)}return this.toBaseScale(a)}}]),b}(b.BaseScale);a.ColorScale=l}),e("scales/size",["exports","./base","underscore","d3"],function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}function f(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(a,"__esModule",{value:!0});var i=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),j=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},k=e(c),l=(e(d),{sqrt:function(a){return Math.sqrt(a)},linear:function(a){return a}}),m=function(a){function b(a,c){g(this,b),j(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,a,c),this.addField("scaleType","size")}return h(b,a),i(b,[{key:"create",value:function(){var a,b=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],c=this.scaleConfig,d=this.vars,e=k["default"].defaults({},b,c,{func:"sqrt",normalize:!1}),g=e.func,h=e.min,i=e.max,j=e.mid,m=l[g],n=k["default"].filter(d,k["default"].isFinite),o=c.normalize||b.normalize,p=o?function(a,b){return a/b}:function(a){return a};if(0===n.length)a=function(a){return p(j,j)};else{var q=1,r=0,s=Math.min.apply(Math,f(n)),t=Math.max.apply(Math,f(n)),u=m(Math.max(Math.abs(s),Math.abs(t),t-s));r=0>s?s:0,q=0===u?1:(i-h)/u,a=function(a){var b=null!==a?parseFloat(a):0;if(!k["default"].isFinite(b))return p(i,i);var c=b-r;return p(h+m(c)*q,i)}}return this.toBaseScale(a,b)}}]),b}(b.BaseScale);a.SizeScale=m}),e("scales/ordinal",["exports","./base","underscore","d3"],function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}function f(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(a,"__esModule",{value:!0});var i=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),j=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},k=(e(c),e(d)),l=function(a){function b(a,c){g(this,b),j(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,a,c),this.addField("scaleType","ordinal").addField("discrete",!0)}return h(b,a),i(b,[{key:"create",value:function(a){var b=this.scaleConfig,c=this.vars,d=k["default"].scale.ordinal().domain(c),e=d.rangePoints(a,1),g=Math.max.apply(Math,f(a)),h=function(a){var d=typeof b.ratio;return"function"===d?b.ratio(a,g,c):"object"===d?b.ratio[a]:1/c.length},i=function(a){var d;return d=b.ratio?g-c.slice(c.indexOf(a)+1).reduce(function(a,b){return a+g*h(b)},g*h(a)*.5):e(a)};return Object.keys(e).forEach(function(a){return i[a]=e[a]}),i.stepSize=function(a){return h(a)*g},this.toBaseScale(i,a)}}]),b}(b.BaseScale);a.OrdinalScale=l}),e("scales/period",["exports","./base","../unit-domain-period-generator","underscore","d3"],function(a,b,c,d,e){"use strict";function f(a){return a&&a.__esModule?a:{"default":a}}function g(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function i(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(a,"__esModule",{value:!0});var j=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),k=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},l=f(d),m=f(e),n=function(a){function b(a,d){h(this,b),k(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,a,d);var e=this.scaleConfig,f=this.vars,g=m["default"].extent(f),i=l["default"].isNull(e.min)||l["default"].isUndefined(e.min)?g[0]:new Date(e.min).getTime(),j=l["default"].isNull(e.max)||l["default"].isUndefined(e.max)?g[1]:new Date(e.max).getTime(),n=[new Date(Math.min(i,g[0])),new Date(Math.max(j,g[1]))];e.fitToFrameByDims?this.vars=(0,l["default"])(f).chain().uniq(function(a){return new Date(a).getTime()}).map(function(a){return new Date(a)}).sortBy(function(a){return-a}).value():this.vars=c.UnitDomainPeriodGenerator.generate(n[0],n[1],e.period),this.addField("scaleType","period").addField("discrete",!0)}return i(b,a),j(b,[{key:"create",value:function(a){var b=this.vars,c=this.vars.map(function(a){return a.getTime()}),d=this.scaleConfig,e=m["default"].scale.ordinal().domain(b),f=e.rangePoints(a,1),h=Math.max.apply(Math,g(a)),i=function(a){var e=new Date(a).getTime(),f=typeof d.ratio;return"function"===f?d.ratio(e,h,c):"object"===f?d.ratio[e]:1/b.length},j=function(a){var b,e=new Date(a),g=e.getTime();return b=d.ratio?h-c.slice(c.indexOf(g)+1).reduce(function(a,b){return a+h*i(b)},h*i(a)*.5):f(e)};return Object.keys(f).forEach(function(a){return j[a]=f[a]}),j.stepSize=function(a){return i(a)*h},this.toBaseScale(j,a)}}]),b}(b.BaseScale);a.PeriodScale=n}),e("scales/time",["exports","./base","underscore","d3"],function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(a,"__esModule",{value:!0});var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},j=e(c),k=e(d),l=function(a){function b(a,c){f(this,b),i(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,a,c);var d=this.scaleConfig,e=this.vars,g=k["default"].extent(e).map(function(a){return new Date(a)}),h=j["default"].isNull(d.min)||j["default"].isUndefined(d.min)?g[0]:new Date(d.min).getTime(),l=j["default"].isNull(d.max)||j["default"].isUndefined(d.max)?g[1]:new Date(d.max).getTime();this.vars=[new Date(Math.min(h,g[0])),new Date(Math.max(l,g[1]))],this.addField("scaleType","time")}return g(b,a),h(b,[{key:"create",value:function(a){var b=this.vars,c=k["default"].time.scale().domain(b),d=c.range(a),e=function(a){var c=b[0],e=b[1];return a>e&&(a=e),c>a&&(a=c),d(new Date(a))};return Object.keys(d).forEach(function(a){return e[a]=d[a]}),e.stepSize=function(){return 0},this.toBaseScale(e,a)}}]),b}(b.BaseScale);a.TimeScale=l}),e("scales/linear",["exports","./base","../utils/utils","underscore","d3"],function(a,b,c,d,e){"use strict";function f(a){return a&&a.__esModule?a:{"default":a}}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(a,"__esModule",{value:!0});var i=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),j=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},k=f(d),l=f(e),m=function(a){function b(a,d){g(this,b),j(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,a,d);var e=this.scaleConfig,f=l["default"].extent(this.vars),h=k["default"].isNumber(e.min)?e.min:f[0],i=k["default"].isNumber(e.max)?e.max:f[1];f=[Math.min(h,f[0]),Math.max(i,f[1])],this.vars=e.autoScale?c.utils.autoScale(f):l["default"].extent(f),this.addField("scaleType","linear").addField("discrete",!1)}return h(b,a),i(b,[{key:"create",value:function(a){var b=this.vars,c=l["default"].scale.linear().domain(b),d=c.rangeRound(a,1),e=function(a){var c=b[0],e=b[1],f=a;return f>e&&(f=e),c>f&&(f=c),d(f)};return Object.keys(d).forEach(function(a){return e[a]=d[a]}),e.stepSize=function(){return 0},this.toBaseScale(e,a)}}]),b}(b.BaseScale);a.LinearScale=m}),e("scales/value",["exports","./base","underscore","d3"],function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(a,"__esModule",{value:!0});var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},j=(e(c),e(d),function(a){function b(a,c){f(this,b),i(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,a,c),this.addField("scaleType","value").addField("georole",c.georole)}return g(b,a),h(b,[{key:"create",value:function(){return this.toBaseScale(function(a){return a})}}]),b}(b.BaseScale));a.ValueScale=j}),e("scales/fill",["exports","./base","../utils/utils","underscore","d3"],function(a,b,c,d,e){"use strict";function f(a){return a&&a.__esModule?a:{"default":a}}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(a,"__esModule",{value:!0});var i=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),j=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},k=f(d),l=f(e),m=function(a){function b(a,d){g(this,b),j(Object.getPrototypeOf(b.prototype),"constructor",this).call(this,a,d);var e=this.scaleConfig,f=l["default"].extent(this.vars),h=k["default"].isNumber(e.min)?e.min:f[0],i=k["default"].isNumber(e.max)?e.max:f[1];f=[Math.min(h,f[0]),Math.max(i,f[1])],this.vars=e.autoScale?c.utils.autoScale(f):l["default"].extent(f);var m=.8/9,n=k["default"].times(10,function(a){return"rgba(90,180,90,"+(.2+a*m).toFixed(2)+")"}),o=e.brewer||n;this.addField("scaleType","fill").addField("brewer",o)}return h(b,a),i(b,[{key:"create",value:function(){var a=this.vars,b=this.getField("brewer");if(!k["default"].isArray(b))throw new Error("This brewer is not supported");var c=b.length,d=(a[1]-a[0])/c,e=k["default"].times(c-1,function(a){return a+1}).reduce(function(b,c){return b.concat([a[0]+c*d])},[]),f=l["default"].scale.threshold().domain(e).range(b);return this.toBaseScale(f)}}]),b}(b.BaseScale);a.FillScale=m}),e("api/chart-map",["exports"],function(b){"use strict";Object.defineProperty(b,"__esModule",{value:!0});var c=function(b){var c=a.extend({sourcemap:b.settings.defaultSourceMap},b.guide||{});c.size=a.defaults(c.size||{},{min:1,max:10}),c.code=a.defaults(c.code||{},{georole:"countries"});var d={},e=function(b,c){var e,f,g=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],h=c;return c?(e=b+"_"+c,f="/"):(e=b+":default",f="?"),d.hasOwnProperty(e)||(d[e]=a.extend({type:b,source:f,dim:h},g)),e};return{sources:{"?":{dims:{},data:[{}]},"/":{dims:Object.keys(b.dimensions).reduce(function(a,c){return a[c]={type:b.dimensions[c].type},a},{}),data:b.data}},scales:d,unit:{type:"COORDS.MAP",expression:{operator:"none",source:"/"},code:e("value",b.code,c.code),fill:e("fill",b.fill,c.fill),size:e("size",b.size,c.size),color:e("color",b.color,c.color),latitude:e("linear",b.latitude,{autoScale:!1}),longitude:e("linear",b.longitude,{autoScale:!1}),guide:c},plugins:b.plugins||[]}};b.ChartMap=c}),e("api/converter-helpers",["exports","d3","../utils/utils"],function(b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b,c){ return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function g(a,b,c){return b.reduce(function(b,d,e){var f=a[d];return f?b.status!=n.FAIL&&("measure"===f.type&&(b.countMeasureAxis++,b.indexMeasureAxis.push(e)),"measure"!==f.type&&1===b.countMeasureAxis?b.status=n.WARNING:b.countMeasureAxis>1&&(b.status=n.FAIL,b.messages.push('There is more than one measure dimension for "'+c+'" axis'))):(b.status=n.FAIL,d?b.messages.push('"'+d+'" dimension is undefined for "'+c+'" axis'):b.messages.push('"'+c+'" axis should be specified')),b},{status:n.SUCCESS,countMeasureAxis:0,indexMeasureAxis:[],messages:[],axis:c})}function h(b){var c=l(b.x),d=l(b.y),e=Math.max(c.length,d.length),f=l(b.guide,{});a.times(e-f.length,function(){return f.push({})}),f=f.slice(0,e);var h=g(b.dimensions,c,"x"),i=g(b.dimensions,d,"y");return c=o[h.status](c,h,f),d=o[i.status](d,i,f),a.extend({},b,{x:c,y:d,guide:f})}function i(b,c){for(var d=c.x,e=c.y,f=c.guide,g=Math.max(d.length,e.length),h={type:"COORDS.RECT",unit:[]},i=[].concat(d),j=[].concat(e),l=[].concat(f),n=g;n>0;n--){var o=i.pop(),p=j.pop(),q=l.pop()||{};n===g?(h.x=o,h.y=p,h.unit.push(m(b,{x:k(o),y:k(p),color:c.color,size:c.size,flip:c.flip,colorGuide:q.color,sizeGuide:q.size})),h.guide=a.defaults(q,{x:{label:o},y:{label:p}})):h={type:"COORDS.RECT",x:k(o),y:k(p),unit:[h],guide:a.defaults(q,{x:{label:o},y:{label:p}})}}return c.spec={dimensions:c.dimensions,unit:h},c}Object.defineProperty(b,"__esModule",{value:!0});var j,k=(e(c),function(a){return a?a:null}),l=function(a){var b=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return d.utils.isArray(a)?0===a.length?[b]:a:[a]},m=function(a,b){return{type:a,x:b.x,y:b.y,color:b.color,guide:{color:b.colorGuide,size:b.sizeGuide,flip:b.flip},flip:b.flip,size:b.size}},n={SUCCESS:"SUCCESS",WARNING:"WARNING",FAIL:"FAIL"},o=(j={},f(j,n.SUCCESS,function(a){return a}),f(j,n.FAIL,function(a,b){throw new Error((b.messages||[]).join("\n")||"This configuration is not supported, See http://api.taucharts.com/basic/facet.html#easy-approach-for-creating-facet-chart")}),f(j,n.WARNING,function(b,c,d){var e=c.axis,f=c.indexMeasureAxis[0],g=b[f],h=a.without(b,g);h.push(g);var i=d[f][e]||{},j=d[d.length-1][e]||{};return d[d.length-1][e]=i,d[f][e]=j,h}),j);b.normalizeConfig=h,b.transformConfig=i}),e("api/chart-interval",["exports","./converter-helpers"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var c=function(a){var c=(0,b.normalizeConfig)(a);return(0,b.transformConfig)("ELEMENT.INTERVAL",c)};a.ChartInterval=c}),e("api/chart-scatterplot",["exports","./converter-helpers"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var c=function(a){var c=(0,b.normalizeConfig)(a);return(0,b.transformConfig)("ELEMENT.POINT",c)};a.ChartScatterplot=c}),e("api/chart-line",["exports","../data-processor","./converter-helpers"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var d=function(a){var d=(0,c.normalizeConfig)(a),e=d.data,f=d.settings.log,g={none:function(a){return null},horizontal:function(a){return a.x[a.x.length-1]},vertical:function(a){return a.y[a.y.length-1]},auto:function(a){var c,d=a.x,g=a.y,h=d[d.length-1],i=d.slice(0,d.length-1),j=g[g.length-1],k=g.slice(0,g.length-1),l=a.color,m=i.concat(k).concat([l]).filter(function(a){return null!==a}),n=-1,o=[[[h].concat(m),j],[[j].concat(m),h]],p=o.some(function(a,c){var d=a[0],g=a[1],h=b.DataProcessor.isYFunctionOfX(e,d,[g]);return h.result?n=c:f(["Attempt to find a functional relation between",a[0]+" and "+a[1]+" is failed.","There are several "+h.error.keyY+" values (e.g. "+h.error.errY.join(",")+")","for ("+h.error.keyX+" = "+h.error.valX+")."].join(" ")),h.result});return p?c=o[n][0][0]:(f(["All attempts are failed.","Will orient line horizontally by default.","NOTE: the [scatterplot] chart is more convenient for that data."].join(" ")),c=h),c}},h=(d.lineOrientation||"").toLowerCase(),i=g.hasOwnProperty(h)?g[h]:g.auto,j=i(d);return null!==j&&(d.data=b.DataProcessor.sortByDim(e,j,d.dimensions[j])),(0,c.transformConfig)("ELEMENT.LINE",d)};a.ChartLine=d}),e("api/chart-area",["exports","../data-processor","./converter-helpers"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var d=function(a){var d=(0,c.normalizeConfig)(a),e=d.data,f=d.settings.log,g={horizontal:function(a){return{prop:a.x[a.x.length-1],flip:!1}},vertical:function(a){return{prop:a.y[a.y.length-1],flip:!0}},auto:function(a){var c,d=a.x,g=a.y,h=d[d.length-1],i=d.slice(0,d.length-1),j=g[g.length-1],k=g.slice(0,g.length-1),l=a.color,m=i.concat(k).concat([l]).filter(function(a){return null!==a}),n=-1,o=[[[h].concat(m),j],[[j].concat(m),h]],p=o.some(function(a,c){var d=a[0],g=a[1],h=b.DataProcessor.isYFunctionOfX(e,d,[g]);return h.result?n=c:f(["Attempt to find a functional relation between",a[0]+" and "+a[1]+" is failed.","There are several "+h.error.keyY+" values (e.g. "+h.error.errY.join(",")+")","for ("+h.error.keyX+" = "+h.error.valX+")."].join(" ")),h.result}),q=null;return p?(c=o[n][0][0],q=0!==n):(f("All attempts are failed. Gonna transform AREA to general PATH."),c=null),{prop:c,flip:q}}},h="boolean"!=typeof d.flip?"auto":d.flip?"vertical":"horizontal",i=g[h],j=i(d),k="ELEMENT.AREA";return null!==j.prop?(d.data=b.DataProcessor.sortByDim(e,j.prop,d.dimensions[j.prop]),d.flip=j.flip):k="ELEMENT.PATH",(0,c.transformConfig)(k,d)};a.ChartArea=d}),e("api/chart-interval-stacked",["exports","./converter-helpers"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var c=function(a){var c=(0,b.normalizeConfig)(a);return(0,b.transformConfig)("ELEMENT.INTERVAL.STACKED",c)};a.ChartIntervalStacked=c}),e("api/chart-parallel",["exports"],function(b){"use strict";Object.defineProperty(b,"__esModule",{value:!0});var c=function(b){var c=a.extend({columns:{}},b.guide||{}),d={},e=function(b,c){var e,f,g=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],h=c;return c?(e=b+"_"+c,f="/"):(e=b+":default",f="?"),d.hasOwnProperty(e)||(d[e]=a.extend({type:b,source:f,dim:h},g)),e},f=b.columns.map(function(a){return e(b.dimensions[a].scale,a,c.columns[a])});return{sources:{"?":{dims:{},data:[{}]},"/":{dims:Object.keys(b.dimensions).reduce(function(a,c){return a[c]={type:b.dimensions[c].type},a},{}),data:b.data}},scales:d,unit:{type:"COORDS.PARALLEL",expression:{operator:"none",source:"/"},columns:f,guide:c,units:[{type:"PARALLEL/ELEMENT.LINE",color:e("color",b.color,c.color),columns:f,expression:{operator:"none",source:"/"}}]},plugins:b.plugins||[]}};b.ChartParallel=c}),e("plugins-sdk",["exports","underscore","./formatter-registry"],function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=d(b),h=function(){function a(){e(this,a)}return f(a,null,[{key:"depthFirstSearch",value:function(b,c){if(c(b))return b;var d,e,f,g=b.units||[];for(d=0;d<g.length;d+=1)if(e=g[d],f=a.depthFirstSearch(e,c))return f}},{key:"traverseSpec",value:function(a,b){var c=function d(a,b,c){b(a,c),(a.units||[]).map(function(c){return d(c,b,a)})};c(a.unit,b,null)}},{key:"extractFieldsFormatInfo",value:function(b){var d=b.scales,e=function(a){return!d[a].dim},f=function(a,b,c){var e=b.guide||{},f=d[b[c]],h=e[c]||{};a[f.dim]=a[f.dim]||{label:[],format:[],nullAlias:[],tickLabel:[]};var i=h.label,j=h.label||{};a[f.dim].label.push(g["default"].isString(i)?i:j._original_text||j.text);var k=h.tickFormat||h.tickPeriod;a[f.dim].format.push(k),a[f.dim].nullAlias.push(h.tickFormatNullAlias),a[f.dim].tickLabel.push(h.tickLabel)},h=[];a.traverseSpec(b,function(a){h.push(a)});var i=h.reduce(function(a,b){return"COORDS.RECT"===b.type&&b.hasOwnProperty("x")&&!e(b.x)&&f(a,b,"x"),"COORDS.RECT"===b.type&&b.hasOwnProperty("y")&&!e(b.y)&&f(a,b,"y"),b.hasOwnProperty("color")&&!e(b.color)&&f(a,b,"color"),b.hasOwnProperty("size")&&!e(b.size)&&f(a,b,"size"),a},{}),j=function(a,b){var c=(0,g["default"])(a).chain().filter(g["default"].identity).uniq().first().value();return c||b};return Object.keys(i).reduce(function(a,b){a[b].label=j(a[b].label,b),a[b].format=j(a[b].format,null),a[b].nullAlias=j(a[b].nullAlias,"No "+a[b].label),a[b].tickLabel=j(a[b].tickLabel,null);var d="x-time-auto"===a[b].format?"day":a[b].format,e=a[b].nullAlias,f=d?c.FormatterRegistry.get(d,e):function(a){return null===a?e:a};if(a[b].format=f,a[b].tickLabel){var g=b.replace("."+a[b].tickLabel,"");a[g]={label:a[b].label,nullAlias:a[b].nullAlias,tickLabel:a[b].tickLabel,format:function(b){return f(b&&b[a[g].tickLabel])},isComplexField:!0},a[b].parentField=g}return a},i)}}]),a}();a.PluginsSDK=h}),e("tau.charts",["exports","./utils/utils-dom","./utils/utils","./charts/tau.gpl","./charts/tau.plot","./charts/tau.chart","./unit-domain-period-generator","./formatter-registry","./units-registry","./scales-registry","./elements/coords.cartesian","./elements/coords.parallel","./elements/coords.geomap","./elements/element.point","./elements/element.area","./elements/element.path","./elements/element.line","./elements/element.interval","./elements/element.interval.stacked","./elements/element.parallel.line","./scales/color","./scales/size","./scales/ordinal","./scales/period","./scales/time","./scales/linear","./scales/value","./scales/fill","./chart-alias-registry","./api/chart-map","./api/chart-interval","./api/chart-scatterplot","./api/chart-line","./api/chart-area","./api/chart-interval-stacked","./api/chart-parallel","./error","./plugins-sdk"],function(c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var O={},P={},Q={UnitDomainPeriodGenerator:i.UnitDomainPeriodGenerator},R={errorCodes:M.errorCodes,unitsRegistry:k.unitsRegistry,scalesRegistry:l.scalesRegistry,tickFormat:j.FormatterRegistry,isChartElement:e.utils.isChartElement,isLineElement:e.utils.isLineElement,d3:b,_:a,tickPeriod:i.UnitDomainPeriodGenerator,colorBrewers:{add:function(a,b){a in O||(O[a]=b)},get:function(a){return O[a]}},pluginsSDK:N.PluginsSDK,plugins:{add:function(a,b){if(a in P)throw new Error("Plugin is already registered.");P[a]=b},get:function(a){return P[a]||function(a){throw new Error(a+" plugin is not defined")}}},globalSettings:{log:function(a,b){b=b||"INFO",Array.isArray(a)||(a=[a]),console[b.toLowerCase()].apply(console,a)},excludeNull:!0,specEngine:[{name:"COMPACT",width:600},{name:"AUTO",width:Number.MAX_VALUE}],fitModel:"normal",optimizeGuideBySize:!0,layoutEngine:"EXTRACT",autoRatio:!0,defaultSourceMap:["https://raw.githubusercontent.com","TargetProcess/tauCharts/master/src/addons","world-countries.json"].join("/"),getAxisTickLabelSize:a.memoize(d.utilsDom.getAxisTickLabelSize,function(a){return(a||"").length}),getScrollBarWidth:a.memoize(d.utilsDom.getScrollbarWidth),xAxisTickLabelLimit:100,yAxisTickLabelLimit:100,xTickWordWrapLinesLimit:2,yTickWordWrapLinesLimit:2,xTickWidth:9,yTickWidth:9,distToXAxisLabel:20,distToYAxisLabel:20,xAxisPadding:20,yAxisPadding:20,xFontLabelHeight:10,yFontLabelHeight:10,xDensityPadding:4,yDensityPadding:4,"xDensityPadding:measure":8,"yDensityPadding:measure":8,defaultFormats:{measure:"x-num-auto","measure:time":"x-time-auto"}}};g.Plot.__api__=R,g.Plot.globalSettings=R.globalSettings,[["COORDS.RECT",m.Cartesian],["COORDS.MAP",o.GeoMap],["COORDS.PARALLEL",n.Parallel],["ELEMENT.POINT",p.Point],["ELEMENT.LINE",s.Line],["ELEMENT.PATH",r.Path],["ELEMENT.AREA",q.Area],["ELEMENT.INTERVAL",t.Interval],["ELEMENT.INTERVAL.STACKED",u.StackedInterval],["PARALLEL/ELEMENT.LINE",v.ParallelLine]].reduce(function(a,b){return a.reg(b[0],b[1])},R.unitsRegistry),[["color",w.ColorScale],["fill",D.FillScale],["size",x.SizeScale],["ordinal",y.OrdinalScale],["period",z.PeriodScale],["time",A.TimeScale],["linear",B.LinearScale],["value",C.ValueScale]].reduce(function(a,b){return a.reg(b[0],b[1])},R.scalesRegistry);var S=[function(a){return a.data?[]:["[data] must be specified"]}];R.chartTypesRegistry=E.chartTypesRegistry.add("scatterplot",H.ChartScatterplot,S).add("line",I.ChartLine,S).add("area",J.ChartArea,S).add("bar",function(b){return(0,G.ChartInterval)(a.defaults({flip:!1},b))},S).add("horizontalBar",function(b){return(0,G.ChartInterval)(a.defaults({flip:!0},b))},S).add("horizontal-bar",function(b){return(0,G.ChartInterval)(a.defaults({flip:!0},b))},S).add("map",F.ChartMap,S.concat([function(a){var b=a.fill&&a.code;return a.fill&&!b?"[code] must be specified when using [fill]":void 0},function(a){var b=a.latitude&&a.longitude;return!a.latitude&&!a.longitude||b?void 0:"[latitude] and [longitude] both must be specified"}])).add("stacked-bar",function(b){return(0,K.ChartIntervalStacked)(a.defaults({flip:!1},b))},S).add("horizontal-stacked-bar",function(b){return(0,K.ChartIntervalStacked)(a.defaults({flip:!0},b))},S).add("parallel",L.ChartParallel,S.concat([function(a){var b=a.columns&&a.columns.length>1;return b?void 0:"[columns] property must contain at least 2 dimensions"}])),c.GPL=f.GPL,c.Plot=g.Plot,c.Chart=h.Chart,c.__api__=Q,c.api=R}),e("underscore",function(){return a}),e("d3",function(){return b}),d("tau.charts")}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){var b={YlGn:{3:["#f7fcb9","#addd8e","#31a354"],4:["#ffffcc","#c2e699","#78c679","#238443"],5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]},YlGnBu:{3:["#edf8b1","#7fcdbb","#2c7fb8"],4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]},GnBu:{3:["#e0f3db","#a8ddb5","#43a2ca"],4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"]},BuGn:{3:["#e5f5f9","#99d8c9","#2ca25f"],4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"]},PuBuGn:{3:["#ece2f0","#a6bddb","#1c9099"],4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"]},PuBu:{3:["#ece7f2","#a6bddb","#2b8cbe"],4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"]},BuPu:{3:["#e0ecf4","#9ebcda","#8856a7"],4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"]},RdPu:{3:["#fde0dd","#fa9fb5","#c51b8a"],4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"]},PuRd:{3:["#e7e1ef","#c994c7","#dd1c77"],4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"]},OrRd:{3:["#fee8c8","#fdbb84","#e34a33"],4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"]},YlOrRd:{3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},YlOrBr:{3:["#fff7bc","#fec44f","#d95f0e"],4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"]},Purples:{3:["#efedf5","#bcbddc","#756bb1"],4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]},Blues:{3:["#deebf7","#9ecae1","#3182bd"],4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]},Greens:{3:["#e5f5e0","#a1d99b","#31a354"],4:["#edf8e9","#bae4b3","#74c476","#238b45"],5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]},Oranges:{3:["#fee6ce","#fdae6b","#e6550d"],4:["#feedde","#fdbe85","#fd8d3c","#d94701"],5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],9:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]},Reds:{3:["#fee0d2","#fc9272","#de2d26"],4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]},Greys:{3:["#f0f0f0","#bdbdbd","#636363"],4:["#f7f7f7","#cccccc","#969696","#525252"],5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]},PuOr:{3:["#f1a340","#f7f7f7","#998ec3"],4:["#e66101","#fdb863","#b2abd2","#5e3c99"],5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"]},BrBG:{3:["#d8b365","#f5f5f5","#5ab4ac"],4:["#a6611a","#dfc27d","#80cdc1","#018571"],5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]},PRGn:{3:["#af8dc3","#f7f7f7","#7fbf7b"],4:["#7b3294","#c2a5cf","#a6dba0","#008837"],5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]},PiYG:{3:["#e9a3c9","#f7f7f7","#a1d76a"],4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]},RdBu:{3:["#ef8a62","#f7f7f7","#67a9cf"],4:["#ca0020","#f4a582","#92c5de","#0571b0"],5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]},RdGy:{3:["#ef8a62","#ffffff","#999999"],4:["#ca0020","#f4a582","#bababa","#404040"],5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"]},RdYlBu:{3:["#fc8d59","#ffffbf","#91bfdb"],4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},Spectral:{3:["#fc8d59","#ffffbf","#99d594"],4:["#d7191c","#fdae61","#abdda4","#2b83ba"],5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],6:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]},RdYlGn:{3:["#fc8d59","#ffffbf","#91cf60"],4:["#d7191c","#fdae61","#a6d96a","#1a9641"],5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]},Accent:{3:["#7fc97f","#beaed4","#fdc086"],4:["#7fc97f","#beaed4","#fdc086","#ffff99"],5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"]},Dark2:{3:["#1b9e77","#d95f02","#7570b3"],4:["#1b9e77","#d95f02","#7570b3","#e7298a"],5:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],6:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],7:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],8:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"]},Paired:{3:["#a6cee3","#1f78b4","#b2df8a"],4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]},Pastel1:{3:["#fbb4ae","#b3cde3","#ccebc5"],4:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],5:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],6:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],7:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],8:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],9:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Pastel2:{3:["#b3e2cd","#fdcdac","#cbd5e8"],4:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],5:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],6:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],7:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],8:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]},Set1:{3:["#e41a1c","#377eb8","#4daf4a"],4:["#e41a1c","#377eb8","#4daf4a","#984ea3"],5:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],6:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],7:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],8:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],9:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},Set2:{3:["#66c2a5","#fc8d62","#8da0cb"],4:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],5:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],6:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],7:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],8:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]},Set3:{3:["#8dd3c7","#ffffb3","#bebada"],4:["#8dd3c7","#ffffb3","#bebada","#fb8072"],5:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],6:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],7:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],8:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],9:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],10:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],11:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],12:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"] }},c=function(a,c){return b[a][c].map(function(b,d){return a+" q"+d+"-"+c})};return a.api.colorBrewers.add("tauBrewer",c),c}),function(a,b){if("function"==typeof define&&define.amd)define(["tauCharts"],function(a){return b(a)});else if("object"==typeof module&&module.exports){require("tauCharts");module.exports=b(tauCharts)}else b(a.tauCharts)}(this,function(a){var b,c,d;return function(a){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(b,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(a,d.concat([b,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(b){if(e(r,b)){var c=r[b];delete r[b],t[b]=!0,m.apply(a,c)}if(!e(q,b)&&!e(t,b))throw new Error("No "+b);return q[b]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(b,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||b,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(b);else if("exports"===k)u[n]=p.exports(b),s=!0;else if("module"===k)h=u[n]=p.module(b);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(b+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[b],u):void 0,b&&(h&&h.exports!==a&&h.exports!==q[b]?q[b]=h.exports:l===a&&s||(q[b]=l))}else b&&(q[b]=d)},b=c=n=function(b,c,d,e,f){if("string"==typeof b)return p[b]?p[b](c):j(o(b,c).f);if(!b.splice){if(s=b,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(b=c,c=d,d=null):b=a}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(a,b,c,d):setTimeout(function(){m(a,b,c,d)},4),n},n.config=function(a){return n(a)},b._defined=q,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),d("../node_modules/almond/almond",function(){}),function(a){function b(a){this.ok=!1,"#"==a.charAt(0)&&(a=a.substr(1,6)),a=a.replace(/ /g,""),a=a.toLowerCase();var c={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};for(var d in c)a==d&&(a=c[d]);for(var e=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(a){return[parseInt(a[1]),parseInt(a[2]),parseInt(a[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}}],f=0;f<e.length;f++){var g=e[f].re,h=e[f].process,i=g.exec(a);i&&(channels=h(i),this.r=channels[0],this.g=channels[1],this.b=channels[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var a=this.r.toString(16),b=this.g.toString(16),c=this.b.toString(16);return 1==a.length&&(a="0"+a),1==b.length&&(b="0"+b),1==c.length&&(c="0"+c),"#"+a+b+c},this.getHelpXML=function(){for(var a=new Array,d=0;d<e.length;d++)for(var f=e[d].example,g=0;g<f.length;g++)a[a.length]=f[g];for(var h in c)a[a.length]=h;var i=document.createElement("ul");i.setAttribute("id","rgbcolor-examples");for(var d=0;d<a.length;d++)try{var j=document.createElement("li"),k=new b(a[d]),l=document.createElement("div");l.style.cssText="margin: 3px; border: 1px solid black; background:"+k.toHex()+"; color:"+k.toHex(),l.appendChild(document.createTextNode("test"));var m=document.createTextNode(" "+a[d]+" -> "+k.toRGB()+" -> "+k.toHex());j.appendChild(l),j.appendChild(m),i.appendChild(j)}catch(n){}return i}}"undefined"!=typeof d&&d.amd?d("../bower_components/canvg/rgbcolor",[],function(){return b}):"undefined"!=typeof module&&module.exports&&(module.exports=b),a.RGBColor=b}("undefined"!=typeof window?window:this),function(a){function b(a){for(var b=a.data,c=a.width*a.height*4,d=0;c>d;d+=4){var e=b[d+3]/255;b[d]*=e,b[d+1]*=e,b[d+2]*=e}}function c(a){for(var b=a.data,c=a.width*a.height*4,d=0;c>d;d+=4){var e=b[d+3];0!=e&&(e=255/e,b[d]*=e,b[d+1]*=e,b[d+2]*=e)}}function e(a,b,c,d){var e=document.getElementById(a),h=e.naturalWidth,i=e.naturalHeight,j=document.getElementById(b);j.style.width=h+"px",j.style.height=i+"px",j.width=h,j.height=i;var k=j.getContext("2d");k.clearRect(0,0,h,i),k.drawImage(e,0,0),isNaN(c)||1>c||(d?f(b,0,0,h,i,c):g(b,0,0,h,i,c))}function f(a,d,e,f,g,k){if(!(isNaN(k)||1>k)){k|=0;var l,m=document.getElementById(a),n=m.getContext("2d");try{try{l=n.getImageData(d,e,f,g)}catch(o){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"),l=n.getImageData(d,e,f,g)}catch(o){throw alert("Cannot access local image"),new Error("unable to access local image data: "+o)}}}catch(o){throw alert("Cannot access image"),new Error("unable to access image data: "+o)}b(l);var p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N=l.data,O=k+k+1,P=f-1,Q=g-1,R=k+1,S=R*(R+1)/2,T=new h,U=T;for(r=1;O>r;r++)if(U=U.next=new h,r==R)var V=U;U.next=T;var W=null,X=null;v=u=0;var Y=i[k],Z=j[k];for(q=0;g>q;q++){for(E=F=G=H=w=x=y=z=0,A=R*(I=N[u]),B=R*(J=N[u+1]),C=R*(K=N[u+2]),D=R*(L=N[u+3]),w+=S*I,x+=S*J,y+=S*K,z+=S*L,U=T,r=0;R>r;r++)U.r=I,U.g=J,U.b=K,U.a=L,U=U.next;for(r=1;R>r;r++)s=u+((r>P?P:r)<<2),w+=(U.r=I=N[s])*(M=R-r),x+=(U.g=J=N[s+1])*M,y+=(U.b=K=N[s+2])*M,z+=(U.a=L=N[s+3])*M,E+=I,F+=J,G+=K,H+=L,U=U.next;for(W=T,X=V,p=0;f>p;p++)N[u]=w*Y>>Z,N[u+1]=x*Y>>Z,N[u+2]=y*Y>>Z,N[u+3]=z*Y>>Z,w-=A,x-=B,y-=C,z-=D,A-=W.r,B-=W.g,C-=W.b,D-=W.a,s=v+((s=p+k+1)<P?s:P)<<2,E+=W.r=N[s],F+=W.g=N[s+1],G+=W.b=N[s+2],H+=W.a=N[s+3],w+=E,x+=F,y+=G,z+=H,W=W.next,A+=I=X.r,B+=J=X.g,C+=K=X.b,D+=L=X.a,E-=I,F-=J,G-=K,H-=L,X=X.next,u+=4;v+=f}for(p=0;f>p;p++){for(F=G=H=E=x=y=z=w=0,u=p<<2,A=R*(I=N[u]),B=R*(J=N[u+1]),C=R*(K=N[u+2]),D=R*(L=N[u+3]),w+=S*I,x+=S*J,y+=S*K,z+=S*L,U=T,r=0;R>r;r++)U.r=I,U.g=J,U.b=K,U.a=L,U=U.next;for(t=f,r=1;k>=r;r++)u=t+p<<2,w+=(U.r=I=N[u])*(M=R-r),x+=(U.g=J=N[u+1])*M,y+=(U.b=K=N[u+2])*M,z+=(U.a=L=N[u+3])*M,E+=I,F+=J,G+=K,H+=L,U=U.next,Q>r&&(t+=f);for(u=p,W=T,X=V,q=0;g>q;q++)s=u<<2,N[s]=w*Y>>Z,N[s+1]=x*Y>>Z,N[s+2]=y*Y>>Z,N[s+3]=z*Y>>Z,w-=A,x-=B,y-=C,z-=D,A-=W.r,B-=W.g,C-=W.b,D-=W.a,s=p+((s=q+R)<Q?s:Q)*f<<2,w+=E+=W.r=N[s],x+=F+=W.g=N[s+1],y+=G+=W.b=N[s+2],z+=H+=W.a=N[s+3],W=W.next,A+=I=X.r,B+=J=X.g,C+=K=X.b,D+=L=X.a,E-=I,F-=J,G-=K,H-=L,X=X.next,u+=f}c(l),n.putImageData(l,d,e)}}function g(a,b,c,d,e,f){if(!(isNaN(f)||1>f)){f|=0;var g,k=document.getElementById(a),l=k.getContext("2d");try{try{g=l.getImageData(b,c,d,e)}catch(m){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"),g=l.getImageData(b,c,d,e)}catch(m){throw alert("Cannot access local image"),new Error("unable to access local image data: "+m)}}}catch(m){throw alert("Cannot access image"),new Error("unable to access image data: "+m)}var n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H=g.data,I=f+f+1,J=d-1,K=e-1,L=f+1,M=L*(L+1)/2,N=new h,O=N;for(p=1;I>p;p++)if(O=O.next=new h,p==L)var P=O;O.next=N;var Q=null,R=null;t=s=0;var S=i[f],T=j[f];for(o=0;e>o;o++){for(A=B=C=u=v=w=0,x=L*(D=H[s]),y=L*(E=H[s+1]),z=L*(F=H[s+2]),u+=M*D,v+=M*E,w+=M*F,O=N,p=0;L>p;p++)O.r=D,O.g=E,O.b=F,O=O.next;for(p=1;L>p;p++)q=s+((p>J?J:p)<<2),u+=(O.r=D=H[q])*(G=L-p),v+=(O.g=E=H[q+1])*G,w+=(O.b=F=H[q+2])*G,A+=D,B+=E,C+=F,O=O.next;for(Q=N,R=P,n=0;d>n;n++)H[s]=u*S>>T,H[s+1]=v*S>>T,H[s+2]=w*S>>T,u-=x,v-=y,w-=z,x-=Q.r,y-=Q.g,z-=Q.b,q=t+((q=n+f+1)<J?q:J)<<2,A+=Q.r=H[q],B+=Q.g=H[q+1],C+=Q.b=H[q+2],u+=A,v+=B,w+=C,Q=Q.next,x+=D=R.r,y+=E=R.g,z+=F=R.b,A-=D,B-=E,C-=F,R=R.next,s+=4;t+=d}for(n=0;d>n;n++){for(B=C=A=v=w=u=0,s=n<<2,x=L*(D=H[s]),y=L*(E=H[s+1]),z=L*(F=H[s+2]),u+=M*D,v+=M*E,w+=M*F,O=N,p=0;L>p;p++)O.r=D,O.g=E,O.b=F,O=O.next;for(r=d,p=1;f>=p;p++)s=r+n<<2,u+=(O.r=D=H[s])*(G=L-p),v+=(O.g=E=H[s+1])*G,w+=(O.b=F=H[s+2])*G,A+=D,B+=E,C+=F,O=O.next,K>p&&(r+=d);for(s=n,Q=N,R=P,o=0;e>o;o++)q=s<<2,H[q]=u*S>>T,H[q+1]=v*S>>T,H[q+2]=w*S>>T,u-=x,v-=y,w-=z,x-=Q.r,y-=Q.g,z-=Q.b,q=n+((q=o+L)<K?q:K)*d<<2,u+=A+=Q.r=H[q],v+=B+=Q.g=H[q+1],w+=C+=Q.b=H[q+2],Q=Q.next,x+=D=R.r,y+=E=R.g,z+=F=R.b,A-=D,B-=E,C-=F,R=R.next,s+=d}l.putImageData(g,b,c)}}function h(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var i=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],j=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24],k={image:e,canvasRGBA:f,canvasRGB:g};"undefined"!=typeof d&&d.amd?d("../bower_components/canvg/StackBlur",[],function(){return k}):"undefined"!=typeof module&&module.exports&&(module.exports=k),a.stackBlur=k}("undefined"!=typeof window?window:this),function(a,b){"use strict";"undefined"!=typeof d&&d.amd?d("canvgModule",["rgbcolor","stackblur"],b):"undefined"!=typeof module&&module.exports&&(module.exports=b(c("rgbcolor"),c("stackblur"))),a.canvg=b(a.RGBColor,a.stackBlur)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b=[0,0,0],c=function(c,d){var e=a.match(c);null!=e&&(b[d]+=e.length,a=a.replace(c," "))};return a=a.replace(/:not\(([^\)]*)\)/g," $1 "),a=a.replace(/{[^]*/gm," "),c(g,1),c(h,0),c(j,1),c(k,2),c(l,1),c(m,1),a=a.replace(/[\*\s\+>~]/g," "),a=a.replace(/[#\.]/g," "),c(n,2),b.join("")}function d(d){var f={opts:d};f.FRAMERATE=30,f.MAX_VIRTUAL_PIXELS=3e4,f.log=function(a){},1==f.opts.log&&"undefined"!=typeof console&&(f.log=function(a){console.log(a)}),f.init=function(a){var b=0;f.UniqueId=function(){return b++,"canvg"+b},f.Definitions={},f.Styles={},f.StylesSpecificity={},f.Animations=[],f.Images=[],f.ctx=a,f.ViewPort=new function(){this.viewPorts=[],this.Clear=function(){this.viewPorts=[]},this.SetCurrent=function(a,b){this.viewPorts.push({width:a,height:b})},this.RemoveCurrent=function(){this.viewPorts.pop()},this.Current=function(){return this.viewPorts[this.viewPorts.length-1]},this.width=function(){return this.Current().width},this.height=function(){return this.Current().height},this.ComputeSize=function(a){return null!=a&&"number"==typeof a?a:"x"==a?this.width():"y"==a?this.height():Math.sqrt(Math.pow(this.width(),2)+Math.pow(this.height(),2))/Math.sqrt(2)}}},f.init(),f.ImagesLoaded=function(){for(var a=0;a<f.Images.length;a++)if(!f.Images[a].loaded)return!1;return!0},f.trim=function(a){return a.replace(/^\s+|\s+$/g,"")},f.compressSpaces=function(a){return a.replace(/[\s\r\t\n]+/gm," ")},f.ajax=function(a){var b;return b=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),b?(b.open("GET",a,!1),b.send(null),b.responseText):null},f.parseXml=function(a){if("undefined"!=typeof Windows&&"undefined"!=typeof Windows.Data&&"undefined"!=typeof Windows.Data.Xml){var b=new Windows.Data.Xml.Dom.XmlDocument,c=new Windows.Data.Xml.Dom.XmlLoadSettings;return c.prohibitDtd=!1,b.loadXml(a,c),b}if(window.DOMParser){var d=new DOMParser;return d.parseFromString(a,"text/xml")}a=a.replace(/<!DOCTYPE svg[^>]*>/,"");var b=new ActiveXObject("Microsoft.XMLDOM");return b.async="false",b.loadXML(a),b},f.Property=function(a,b){this.name=a,this.value=b},f.Property.prototype.getValue=function(){return this.value},f.Property.prototype.hasValue=function(){return null!=this.value&&""!==this.value},f.Property.prototype.numValue=function(){if(!this.hasValue())return 0;var a=parseFloat(this.value);return(this.value+"").match(/%$/)&&(a/=100),a},f.Property.prototype.valueOrDefault=function(a){return this.hasValue()?this.value:a},f.Property.prototype.numValueOrDefault=function(a){return this.hasValue()?this.numValue():a},f.Property.prototype.addOpacity=function(b){var c=this.value;if(null!=b.value&&""!=b.value&&"string"==typeof this.value){var d=new a(this.value);d.ok&&(c="rgba("+d.r+", "+d.g+", "+d.b+", "+b.numValue()+")")}return new f.Property(this.name,c)},f.Property.prototype.getDefinition=function(){var a=this.value.match(/#([^\)'"]+)/);return a&&(a=a[1]),a||(a=this.value),f.Definitions[a]},f.Property.prototype.isUrlDefinition=function(){return 0==this.value.indexOf("url(")},f.Property.prototype.getFillStyleDefinition=function(a,b){var c=this.getDefinition();if(null!=c&&c.createGradient)return c.createGradient(f.ctx,a,b);if(null!=c&&c.createPattern){if(c.getHrefAttribute().hasValue()){var d=c.attribute("patternTransform");c=c.getHrefAttribute().getDefinition(),d.hasValue()&&(c.attribute("patternTransform",!0).value=d.value)}return c.createPattern(f.ctx,a)}return null},f.Property.prototype.getDPI=function(a){return 96},f.Property.prototype.getEM=function(a){var b=12,c=new f.Property("fontSize",f.Font.Parse(f.ctx.font).fontSize);return c.hasValue()&&(b=c.toPixels(a)),b},f.Property.prototype.getUnits=function(){var a=this.value+"";return a.replace(/[0-9\.\-]/g,"")},f.Property.prototype.toPixels=function(a,b){if(!this.hasValue())return 0;var c=this.value+"";if(c.match(/em$/))return this.numValue()*this.getEM(a);if(c.match(/ex$/))return this.numValue()*this.getEM(a)/2;if(c.match(/px$/))return this.numValue();if(c.match(/pt$/))return this.numValue()*this.getDPI(a)*(1/72);if(c.match(/pc$/))return 15*this.numValue();if(c.match(/cm$/))return this.numValue()*this.getDPI(a)/2.54;if(c.match(/mm$/))return this.numValue()*this.getDPI(a)/25.4;if(c.match(/in$/))return this.numValue()*this.getDPI(a);if(c.match(/%$/))return this.numValue()*f.ViewPort.ComputeSize(a);var d=this.numValue();return b&&1>d?d*f.ViewPort.ComputeSize(a):d},f.Property.prototype.toMilliseconds=function(){if(!this.hasValue())return 0;var a=this.value+"";return a.match(/s$/)?1e3*this.numValue():a.match(/ms$/)?this.numValue():this.numValue()},f.Property.prototype.toRadians=function(){if(!this.hasValue())return 0;var a=this.value+"";return a.match(/deg$/)?this.numValue()*(Math.PI/180):a.match(/grad$/)?this.numValue()*(Math.PI/200):a.match(/rad$/)?this.numValue():this.numValue()*(Math.PI/180)};var g={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};return f.Property.prototype.toTextBaseline=function(){return this.hasValue()?g[this.value]:null},f.Font=new function(){this.Styles="normal|italic|oblique|inherit",this.Variants="normal|small-caps|inherit",this.Weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit",this.CreateFont=function(a,b,c,d,e,g){var h=null!=g?this.Parse(g):this.CreateFont("","","","","",f.ctx.font);return{fontFamily:e||h.fontFamily,fontSize:d||h.fontSize,fontStyle:a||h.fontStyle,fontWeight:c||h.fontWeight,fontVariant:b||h.fontVariant,toString:function(){return[this.fontStyle,this.fontVariant,this.fontWeight,this.fontSize,this.fontFamily].join(" ")}}};var a=this;this.Parse=function(b){for(var c={},d=f.trim(f.compressSpaces(b||"")).split(" "),e={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1},g="",h=0;h<d.length;h++)e.fontStyle||-1==a.Styles.indexOf(d[h])?e.fontVariant||-1==a.Variants.indexOf(d[h])?e.fontWeight||-1==a.Weights.indexOf(d[h])?e.fontSize?"inherit"!=d[h]&&(g+=d[h]):("inherit"!=d[h]&&(c.fontSize=d[h].split("/")[0]),e.fontStyle=e.fontVariant=e.fontWeight=e.fontSize=!0):("inherit"!=d[h]&&(c.fontWeight=d[h]),e.fontStyle=e.fontVariant=e.fontWeight=!0):("inherit"!=d[h]&&(c.fontVariant=d[h]),e.fontStyle=e.fontVariant=!0):("inherit"!=d[h]&&(c.fontStyle=d[h]),e.fontStyle=!0);return""!=g&&(c.fontFamily=g),c}},f.ToNumberArray=function(a){for(var b=f.trim(f.compressSpaces((a||"").replace(/,/g," "))).split(" "),c=0;c<b.length;c++)b[c]=parseFloat(b[c]);return b},f.Point=function(a,b){this.x=a,this.y=b},f.Point.prototype.angleTo=function(a){return Math.atan2(a.y-this.y,a.x-this.x)},f.Point.prototype.applyTransform=function(a){var b=this.x*a[0]+this.y*a[2]+a[4],c=this.x*a[1]+this.y*a[3]+a[5];this.x=b,this.y=c},f.CreatePoint=function(a){var b=f.ToNumberArray(a);return new f.Point(b[0],b[1])},f.CreatePath=function(a){for(var b=f.ToNumberArray(a),c=[],d=0;d<b.length;d+=2)c.push(new f.Point(b[d],b[d+1]));return c},f.BoundingBox=function(a,b,c,d){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN,this.x=function(){return this.x1},this.y=function(){return this.y1},this.width=function(){return this.x2-this.x1},this.height=function(){return this.y2-this.y1},this.addPoint=function(a,b){null!=a&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=a,this.x2=a),a<this.x1&&(this.x1=a),a>this.x2&&(this.x2=a)),null!=b&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=b,this.y2=b),b<this.y1&&(this.y1=b),b>this.y2&&(this.y2=b))},this.addX=function(a){this.addPoint(a,null)},this.addY=function(a){this.addPoint(null,a)},this.addBoundingBox=function(a){this.addPoint(a.x1,a.y1),this.addPoint(a.x2,a.y2)},this.addQuadraticCurve=function(a,b,c,d,e,f){var g=a+2/3*(c-a),h=b+2/3*(d-b),i=g+1/3*(e-a),j=h+1/3*(f-b);this.addBezierCurve(a,b,g,i,h,j,e,f)},this.addBezierCurve=function(a,b,c,d,e,f,g,h){var j=[a,b],k=[c,d],l=[e,f],m=[g,h];for(this.addPoint(j[0],j[1]),this.addPoint(m[0],m[1]),i=0;i<=1;i++){var n=function(a){return Math.pow(1-a,3)*j[i]+3*Math.pow(1-a,2)*a*k[i]+3*(1-a)*Math.pow(a,2)*l[i]+Math.pow(a,3)*m[i]},o=6*j[i]-12*k[i]+6*l[i],p=-3*j[i]+9*k[i]-9*l[i]+3*m[i],q=3*k[i]-3*j[i];if(0!=p){var r=Math.pow(o,2)-4*q*p;if(!(0>r)){var s=(-o+Math.sqrt(r))/(2*p);s>0&&1>s&&(0==i&&this.addX(n(s)),1==i&&this.addY(n(s)));var t=(-o-Math.sqrt(r))/(2*p);t>0&&1>t&&(0==i&&this.addX(n(t)),1==i&&this.addY(n(t)))}}else{if(0==o)continue;var u=-q/o;u>0&&1>u&&(0==i&&this.addX(n(u)),1==i&&this.addY(n(u)))}}},this.isPointInBox=function(a,b){return this.x1<=a&&a<=this.x2&&this.y1<=b&&b<=this.y2},this.addPoint(a,b),this.addPoint(c,d)},f.Transform=function(a){var b=this;this.Type={},this.Type.translate=function(a){this.p=f.CreatePoint(a),this.apply=function(a){a.translate(this.p.x||0,this.p.y||0)},this.unapply=function(a){a.translate(-1*this.p.x||0,-1*this.p.y||0)},this.applyToPoint=function(a){a.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0])}},this.Type.rotate=function(a){var b=f.ToNumberArray(a);this.angle=new f.Property("angle",b[0]),this.cx=b[1]||0,this.cy=b[2]||0,this.apply=function(a){a.translate(this.cx,this.cy),a.rotate(this.angle.toRadians()),a.translate(-this.cx,-this.cy)},this.unapply=function(a){a.translate(this.cx,this.cy),a.rotate(-1*this.angle.toRadians()),a.translate(-this.cx,-this.cy)},this.applyToPoint=function(a){var b=this.angle.toRadians();a.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0]),a.applyTransform([Math.cos(b),Math.sin(b),-Math.sin(b),Math.cos(b),0,0]),a.applyTransform([1,0,0,1,-this.p.x||0,-this.p.y||0])}},this.Type.scale=function(a){this.p=f.CreatePoint(a),this.apply=function(a){a.scale(this.p.x||1,this.p.y||this.p.x||1)},this.unapply=function(a){a.scale(1/this.p.x||1,1/this.p.y||this.p.x||1)},this.applyToPoint=function(a){a.applyTransform([this.p.x||0,0,0,this.p.y||0,0,0])}},this.Type.matrix=function(a){this.m=f.ToNumberArray(a),this.apply=function(a){a.transform(this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5])},this.unapply=function(a){var b=this.m[0],c=this.m[2],d=this.m[4],e=this.m[1],f=this.m[3],g=this.m[5],h=0,i=0,j=1,k=1/(b*(f*j-g*i)-c*(e*j-g*h)+d*(e*i-f*h));a.transform(k*(f*j-g*i),k*(g*h-e*j),k*(d*i-c*j),k*(b*j-d*h),k*(c*g-d*f),k*(d*e-b*g))},this.applyToPoint=function(a){a.applyTransform(this.m)}},this.Type.SkewBase=function(a){this.base=b.Type.matrix,this.base(a),this.angle=new f.Property("angle",a)},this.Type.SkewBase.prototype=new this.Type.matrix,this.Type.skewX=function(a){this.base=b.Type.SkewBase,this.base(a),this.m=[1,0,Math.tan(this.angle.toRadians()),1,0,0]},this.Type.skewX.prototype=new this.Type.SkewBase,this.Type.skewY=function(a){this.base=b.Type.SkewBase,this.base(a),this.m=[1,Math.tan(this.angle.toRadians()),0,1,0,0]},this.Type.skewY.prototype=new this.Type.SkewBase,this.transforms=[],this.apply=function(a){for(var b=0;b<this.transforms.length;b++)this.transforms[b].apply(a)},this.unapply=function(a){for(var b=this.transforms.length-1;b>=0;b--)this.transforms[b].unapply(a)},this.applyToPoint=function(a){for(var b=0;b<this.transforms.length;b++)this.transforms[b].applyToPoint(a)};for(var c=f.trim(f.compressSpaces(a)).replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/),d=0;d<c.length;d++){var e=f.trim(c[d].split("(")[0]),g=c[d].split("(")[1].replace(")",""),h=new this.Type[e](g);h.type=e,this.transforms.push(h)}},f.AspectRatio=function(a,b,c,d,e,g,h,i,j,k){b=f.compressSpaces(b),b=b.replace(/^defer\s/,"");var l=b.split(" ")[0]||"xMidYMid",m=b.split(" ")[1]||"meet",n=c/d,o=e/g,p=Math.min(n,o),q=Math.max(n,o);"meet"==m&&(d*=p,g*=p),"slice"==m&&(d*=q,g*=q),j=new f.Property("refX",j),k=new f.Property("refY",k),j.hasValue()&&k.hasValue()?a.translate(-p*j.toPixels("x"),-p*k.toPixels("y")):(l.match(/^xMid/)&&("meet"==m&&p==o||"slice"==m&&q==o)&&a.translate(c/2-d/2,0),l.match(/YMid$/)&&("meet"==m&&p==n||"slice"==m&&q==n)&&a.translate(0,e/2-g/2),l.match(/^xMax/)&&("meet"==m&&p==o||"slice"==m&&q==o)&&a.translate(c-d,0),l.match(/YMax$/)&&("meet"==m&&p==n||"slice"==m&&q==n)&&a.translate(0,e-g)),"none"==l?a.scale(n,o):"meet"==m?a.scale(p,p):"slice"==m&&a.scale(q,q),a.translate(null==h?0:-h,null==i?0:-i)},f.Element={},f.EmptyProperty=new f.Property("EMPTY",""),f.Element.ElementBase=function(a){if(this.attributes={},this.styles={},this.stylesSpecificity={},this.children=[],this.attribute=function(a,b){var c=this.attributes[a];return null!=c?c:(1==b&&(c=new f.Property(a,""),this.attributes[a]=c),c||f.EmptyProperty)},this.getHrefAttribute=function(){for(var a in this.attributes)if("href"==a||a.match(/:href$/))return this.attributes[a];return f.EmptyProperty},this.style=function(a,b,c){var d=this.styles[a];if(null!=d)return d;var e=this.attribute(a);if(null!=e&&e.hasValue())return this.styles[a]=e,e;if(1!=c){var g=this.parent;if(null!=g){var h=g.style(a);if(null!=h&&h.hasValue())return h}}return 1==b&&(d=new f.Property(a,""),this.styles[a]=d),d||f.EmptyProperty},this.render=function(a){if("none"!=this.style("display").value&&"hidden"!=this.style("visibility").value){if(a.save(),this.style("mask").hasValue()){var b=this.style("mask").getDefinition();null!=b&&b.apply(a,this)}else if(this.style("filter").hasValue()){var c=this.style("filter").getDefinition();null!=c&&c.apply(a,this)}else this.setContext(a),this.renderChildren(a),this.clearContext(a);a.restore()}},this.setContext=function(a){},this.clearContext=function(a){},this.renderChildren=function(a){for(var b=0;b<this.children.length;b++)this.children[b].render(a)},this.addChild=function(a,b){var c=a;b&&(c=f.CreateElement(a)),c.parent=this,"title"!=c.type&&this.children.push(c)},this.addStylesFromStyleDefinition=function(){for(var b in f.Styles)if("@"!=b[0]&&e(a,b)){var c=f.Styles[b],d=f.StylesSpecificity[b];if(null!=c)for(var g in c){var h=this.stylesSpecificity[g];"undefined"==typeof h&&(h="000"),d>h&&(this.styles[g]=c[g],this.stylesSpecificity[g]=d)}}},null!=a&&1==a.nodeType){for(var b=0;b<a.attributes.length;b++){var c=a.attributes[b];this.attributes[c.nodeName]=new f.Property(c.nodeName,c.value)}if(this.addStylesFromStyleDefinition(),this.attribute("style").hasValue())for(var d=this.attribute("style").value.split(";"),b=0;b<d.length;b++)if(""!=f.trim(d[b])){var g=d[b].split(":"),h=f.trim(g[0]),i=f.trim(g[1]);this.styles[h]=new f.Property(h,i)}this.attribute("id").hasValue()&&null==f.Definitions[this.attribute("id").value]&&(f.Definitions[this.attribute("id").value]=this);for(var b=0;b<a.childNodes.length;b++){var j=a.childNodes[b];if(1==j.nodeType&&this.addChild(j,!0),this.captureTextNodes&&(3==j.nodeType||4==j.nodeType)){var k=j.value||j.text||j.textContent||"";""!=f.compressSpaces(k)&&this.addChild(new f.Element.tspan(j),!1)}}}},f.Element.RenderedElementBase=function(a){this.base=f.Element.ElementBase,this.base(a),this.setContext=function(a){if(this.style("fill").isUrlDefinition()){var b=this.style("fill").getFillStyleDefinition(this,this.style("fill-opacity"));null!=b&&(a.fillStyle=b)}else if(this.style("fill").hasValue()){var c=this.style("fill");"currentColor"==c.value&&(c.value=this.style("color").value),"inherit"!=c.value&&(a.fillStyle="none"==c.value?"rgba(0,0,0,0)":c.value)}if(this.style("fill-opacity").hasValue()){var c=new f.Property("fill",a.fillStyle);c=c.addOpacity(this.style("fill-opacity")),a.fillStyle=c.value}if(this.style("stroke").isUrlDefinition()){var b=this.style("stroke").getFillStyleDefinition(this,this.style("stroke-opacity"));null!=b&&(a.strokeStyle=b)}else if(this.style("stroke").hasValue()){var d=this.style("stroke");"currentColor"==d.value&&(d.value=this.style("color").value),"inherit"!=d.value&&(a.strokeStyle="none"==d.value?"rgba(0,0,0,0)":d.value)}if(this.style("stroke-opacity").hasValue()){var d=new f.Property("stroke",a.strokeStyle);d=d.addOpacity(this.style("stroke-opacity")),a.strokeStyle=d.value}if(this.style("stroke-width").hasValue()){var e=this.style("stroke-width").toPixels();a.lineWidth=0==e?.001:e}if(this.style("stroke-linecap").hasValue()&&(a.lineCap=this.style("stroke-linecap").value),this.style("stroke-linejoin").hasValue()&&(a.lineJoin=this.style("stroke-linejoin").value),this.style("stroke-miterlimit").hasValue()&&(a.miterLimit=this.style("stroke-miterlimit").value),this.style("stroke-dasharray").hasValue()&&"none"!=this.style("stroke-dasharray").value){var g=f.ToNumberArray(this.style("stroke-dasharray").value);"undefined"!=typeof a.setLineDash?a.setLineDash(g):"undefined"!=typeof a.webkitLineDash?a.webkitLineDash=g:"undefined"==typeof a.mozDash||1==g.length&&0==g[0]||(a.mozDash=g);var h=this.style("stroke-dashoffset").numValueOrDefault(1);"undefined"!=typeof a.lineDashOffset?a.lineDashOffset=h:"undefined"!=typeof a.webkitLineDashOffset?a.webkitLineDashOffset=h:"undefined"!=typeof a.mozDashOffset&&(a.mozDashOffset=h)}if("undefined"!=typeof a.font&&(a.font=f.Font.CreateFont(this.style("font-style").value,this.style("font-variant").value,this.style("font-weight").value,this.style("font-size").hasValue()?this.style("font-size").toPixels()+"px":"",this.style("font-family").value).toString()),this.style("transform",!1,!0).hasValue()){var i=new f.Transform(this.style("transform",!1,!0).value);i.apply(a)}if(this.style("clip-path",!1,!0).hasValue()){var j=this.style("clip-path",!1,!0).getDefinition();null!=j&&j.apply(a)}this.style("opacity").hasValue()&&(a.globalAlpha=this.style("opacity").numValue())}},f.Element.RenderedElementBase.prototype=new f.Element.ElementBase, f.Element.PathElementBase=function(a){this.base=f.Element.RenderedElementBase,this.base(a),this.path=function(a){return null!=a&&a.beginPath(),new f.BoundingBox},this.renderChildren=function(a){this.path(a),f.Mouse.checkPath(this,a),""!=a.fillStyle&&("inherit"!=this.style("fill-rule").valueOrDefault("inherit")?a.fill(this.style("fill-rule").value):a.fill()),""!=a.strokeStyle&&a.stroke();var b=this.getMarkers();if(null!=b){if(this.style("marker-start").isUrlDefinition()){var c=this.style("marker-start").getDefinition();c.render(a,b[0][0],b[0][1])}if(this.style("marker-mid").isUrlDefinition())for(var c=this.style("marker-mid").getDefinition(),d=1;d<b.length-1;d++)c.render(a,b[d][0],b[d][1]);if(this.style("marker-end").isUrlDefinition()){var c=this.style("marker-end").getDefinition();c.render(a,b[b.length-1][0],b[b.length-1][1])}}},this.getBoundingBox=function(){return this.path()},this.getMarkers=function(){return null}},f.Element.PathElementBase.prototype=new f.Element.RenderedElementBase,f.Element.svg=function(a){this.base=f.Element.RenderedElementBase,this.base(a),this.baseClearContext=this.clearContext,this.clearContext=function(a){this.baseClearContext(a),f.ViewPort.RemoveCurrent()},this.baseSetContext=this.setContext,this.setContext=function(a){a.strokeStyle="rgba(0,0,0,0)",a.lineCap="butt",a.lineJoin="miter",a.miterLimit=4,"undefined"!=typeof a.font&&"undefined"!=typeof window.getComputedStyle&&(a.font=window.getComputedStyle(a.canvas).getPropertyValue("font")),this.baseSetContext(a),this.attribute("x").hasValue()||(this.attribute("x",!0).value=0),this.attribute("y").hasValue()||(this.attribute("y",!0).value=0),a.translate(this.attribute("x").toPixels("x"),this.attribute("y").toPixels("y"));var b=f.ViewPort.width(),c=f.ViewPort.height();if(this.attribute("width").hasValue()||(this.attribute("width",!0).value="100%"),this.attribute("height").hasValue()||(this.attribute("height",!0).value="100%"),"undefined"==typeof this.root){b=this.attribute("width").toPixels("x"),c=this.attribute("height").toPixels("y");var d=0,e=0;this.attribute("refX").hasValue()&&this.attribute("refY").hasValue()&&(d=-this.attribute("refX").toPixels("x"),e=-this.attribute("refY").toPixels("y")),"visible"!=this.attribute("overflow").valueOrDefault("hidden")&&(a.beginPath(),a.moveTo(d,e),a.lineTo(b,e),a.lineTo(b,c),a.lineTo(d,c),a.closePath(),a.clip())}if(f.ViewPort.SetCurrent(b,c),this.attribute("viewBox").hasValue()){var g=f.ToNumberArray(this.attribute("viewBox").value),h=g[0],i=g[1];b=g[2],c=g[3],f.AspectRatio(a,this.attribute("preserveAspectRatio").value,f.ViewPort.width(),b,f.ViewPort.height(),c,h,i,this.attribute("refX").value,this.attribute("refY").value),f.ViewPort.RemoveCurrent(),f.ViewPort.SetCurrent(g[2],g[3])}}},f.Element.svg.prototype=new f.Element.RenderedElementBase,f.Element.rect=function(a){this.base=f.Element.PathElementBase,this.base(a),this.path=function(a){var b=this.attribute("x").toPixels("x"),c=this.attribute("y").toPixels("y"),d=this.attribute("width").toPixels("x"),e=this.attribute("height").toPixels("y"),g=this.attribute("rx").toPixels("x"),h=this.attribute("ry").toPixels("y");return this.attribute("rx").hasValue()&&!this.attribute("ry").hasValue()&&(h=g),this.attribute("ry").hasValue()&&!this.attribute("rx").hasValue()&&(g=h),g=Math.min(g,d/2),h=Math.min(h,e/2),null!=a&&(a.beginPath(),a.moveTo(b+g,c),a.lineTo(b+d-g,c),a.quadraticCurveTo(b+d,c,b+d,c+h),a.lineTo(b+d,c+e-h),a.quadraticCurveTo(b+d,c+e,b+d-g,c+e),a.lineTo(b+g,c+e),a.quadraticCurveTo(b,c+e,b,c+e-h),a.lineTo(b,c+h),a.quadraticCurveTo(b,c,b+g,c),a.closePath()),new f.BoundingBox(b,c,b+d,c+e)}},f.Element.rect.prototype=new f.Element.PathElementBase,f.Element.circle=function(a){this.base=f.Element.PathElementBase,this.base(a),this.path=function(a){var b=this.attribute("cx").toPixels("x"),c=this.attribute("cy").toPixels("y"),d=this.attribute("r").toPixels();return null!=a&&(a.beginPath(),a.arc(b,c,d,0,2*Math.PI,!0),a.closePath()),new f.BoundingBox(b-d,c-d,b+d,c+d)}},f.Element.circle.prototype=new f.Element.PathElementBase,f.Element.ellipse=function(a){this.base=f.Element.PathElementBase,this.base(a),this.path=function(a){var b=4*((Math.sqrt(2)-1)/3),c=this.attribute("rx").toPixels("x"),d=this.attribute("ry").toPixels("y"),e=this.attribute("cx").toPixels("x"),g=this.attribute("cy").toPixels("y");return null!=a&&(a.beginPath(),a.moveTo(e,g-d),a.bezierCurveTo(e+b*c,g-d,e+c,g-b*d,e+c,g),a.bezierCurveTo(e+c,g+b*d,e+b*c,g+d,e,g+d),a.bezierCurveTo(e-b*c,g+d,e-c,g+b*d,e-c,g),a.bezierCurveTo(e-c,g-b*d,e-b*c,g-d,e,g-d),a.closePath()),new f.BoundingBox(e-c,g-d,e+c,g+d)}},f.Element.ellipse.prototype=new f.Element.PathElementBase,f.Element.line=function(a){this.base=f.Element.PathElementBase,this.base(a),this.getPoints=function(){return[new f.Point(this.attribute("x1").toPixels("x"),this.attribute("y1").toPixels("y")),new f.Point(this.attribute("x2").toPixels("x"),this.attribute("y2").toPixels("y"))]},this.path=function(a){var b=this.getPoints();return null!=a&&(a.beginPath(),a.moveTo(b[0].x,b[0].y),a.lineTo(b[1].x,b[1].y)),new f.BoundingBox(b[0].x,b[0].y,b[1].x,b[1].y)},this.getMarkers=function(){var a=this.getPoints(),b=a[0].angleTo(a[1]);return[[a[0],b],[a[1],b]]}},f.Element.line.prototype=new f.Element.PathElementBase,f.Element.polyline=function(a){this.base=f.Element.PathElementBase,this.base(a),this.points=f.CreatePath(this.attribute("points").value),this.path=function(a){var b=new f.BoundingBox(this.points[0].x,this.points[0].y);null!=a&&(a.beginPath(),a.moveTo(this.points[0].x,this.points[0].y));for(var c=1;c<this.points.length;c++)b.addPoint(this.points[c].x,this.points[c].y),null!=a&&a.lineTo(this.points[c].x,this.points[c].y);return b},this.getMarkers=function(){for(var a=[],b=0;b<this.points.length-1;b++)a.push([this.points[b],this.points[b].angleTo(this.points[b+1])]);return a.push([this.points[this.points.length-1],a[a.length-1][1]]),a}},f.Element.polyline.prototype=new f.Element.PathElementBase,f.Element.polygon=function(a){this.base=f.Element.polyline,this.base(a),this.basePath=this.path,this.path=function(a){var b=this.basePath(a);return null!=a&&(a.lineTo(this.points[0].x,this.points[0].y),a.closePath()),b}},f.Element.polygon.prototype=new f.Element.polyline,f.Element.path=function(a){this.base=f.Element.PathElementBase,this.base(a);var b=this.attribute("d").value;b=b.replace(/,/gm," ");for(var c=0;2>c;c++)b=b.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2");b=b.replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2"),b=b.replace(/([0-9])([+\-])/gm,"$1 $2");for(var c=0;2>c;c++)b=b.replace(/(\.[0-9]*)(\.)/gm,"$1 $2");b=b.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 "),b=f.compressSpaces(b),b=f.trim(b),this.PathParser=new function(a){this.tokens=a.split(" "),this.reset=function(){this.i=-1,this.command="",this.previousCommand="",this.start=new f.Point(0,0),this.control=new f.Point(0,0),this.current=new f.Point(0,0),this.points=[],this.angles=[]},this.isEnd=function(){return this.i>=this.tokens.length-1},this.isCommandOrEnd=function(){return this.isEnd()?!0:null!=this.tokens[this.i+1].match(/^[A-Za-z]$/)},this.isRelativeCommand=function(){switch(this.command){case"m":case"l":case"h":case"v":case"c":case"s":case"q":case"t":case"a":case"z":return!0}return!1},this.getToken=function(){return this.i++,this.tokens[this.i]},this.getScalar=function(){return parseFloat(this.getToken())},this.nextCommand=function(){this.previousCommand=this.command,this.command=this.getToken()},this.getPoint=function(){var a=new f.Point(this.getScalar(),this.getScalar());return this.makeAbsolute(a)},this.getAsControlPoint=function(){var a=this.getPoint();return this.control=a,a},this.getAsCurrentPoint=function(){var a=this.getPoint();return this.current=a,a},this.getReflectedControlPoint=function(){if("c"!=this.previousCommand.toLowerCase()&&"s"!=this.previousCommand.toLowerCase()&&"q"!=this.previousCommand.toLowerCase()&&"t"!=this.previousCommand.toLowerCase())return this.current;var a=new f.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y);return a},this.makeAbsolute=function(a){return this.isRelativeCommand()&&(a.x+=this.current.x,a.y+=this.current.y),a},this.addMarker=function(a,b,c){null!=c&&this.angles.length>0&&null==this.angles[this.angles.length-1]&&(this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(c)),this.addMarkerAngle(a,null==b?null:b.angleTo(a))},this.addMarkerAngle=function(a,b){this.points.push(a),this.angles.push(b)},this.getMarkerPoints=function(){return this.points},this.getMarkerAngles=function(){for(var a=0;a<this.angles.length;a++)if(null==this.angles[a])for(var b=a+1;b<this.angles.length;b++)if(null!=this.angles[b]){this.angles[a]=this.angles[b];break}return this.angles}}(b),this.path=function(a){var b=this.PathParser;b.reset();var c=new f.BoundingBox;for(null!=a&&a.beginPath();!b.isEnd();)switch(b.nextCommand(),b.command){case"M":case"m":var d=b.getAsCurrentPoint();for(b.addMarker(d),c.addPoint(d.x,d.y),null!=a&&a.moveTo(d.x,d.y),b.start=b.current;!b.isCommandOrEnd();){var d=b.getAsCurrentPoint();b.addMarker(d,b.start),c.addPoint(d.x,d.y),null!=a&&a.lineTo(d.x,d.y)}break;case"L":case"l":for(;!b.isCommandOrEnd();){var e=b.current,d=b.getAsCurrentPoint();b.addMarker(d,e),c.addPoint(d.x,d.y),null!=a&&a.lineTo(d.x,d.y)}break;case"H":case"h":for(;!b.isCommandOrEnd();){var g=new f.Point((b.isRelativeCommand()?b.current.x:0)+b.getScalar(),b.current.y);b.addMarker(g,b.current),b.current=g,c.addPoint(b.current.x,b.current.y),null!=a&&a.lineTo(b.current.x,b.current.y)}break;case"V":case"v":for(;!b.isCommandOrEnd();){var g=new f.Point(b.current.x,(b.isRelativeCommand()?b.current.y:0)+b.getScalar());b.addMarker(g,b.current),b.current=g,c.addPoint(b.current.x,b.current.y),null!=a&&a.lineTo(b.current.x,b.current.y)}break;case"C":case"c":for(;!b.isCommandOrEnd();){var h=b.current,i=b.getPoint(),j=b.getAsControlPoint(),k=b.getAsCurrentPoint();b.addMarker(k,j,i),c.addBezierCurve(h.x,h.y,i.x,i.y,j.x,j.y,k.x,k.y),null!=a&&a.bezierCurveTo(i.x,i.y,j.x,j.y,k.x,k.y)}break;case"S":case"s":for(;!b.isCommandOrEnd();){var h=b.current,i=b.getReflectedControlPoint(),j=b.getAsControlPoint(),k=b.getAsCurrentPoint();b.addMarker(k,j,i),c.addBezierCurve(h.x,h.y,i.x,i.y,j.x,j.y,k.x,k.y),null!=a&&a.bezierCurveTo(i.x,i.y,j.x,j.y,k.x,k.y)}break;case"Q":case"q":for(;!b.isCommandOrEnd();){var h=b.current,j=b.getAsControlPoint(),k=b.getAsCurrentPoint();b.addMarker(k,j,j),c.addQuadraticCurve(h.x,h.y,j.x,j.y,k.x,k.y),null!=a&&a.quadraticCurveTo(j.x,j.y,k.x,k.y)}break;case"T":case"t":for(;!b.isCommandOrEnd();){var h=b.current,j=b.getReflectedControlPoint();b.control=j;var k=b.getAsCurrentPoint();b.addMarker(k,j,j),c.addQuadraticCurve(h.x,h.y,j.x,j.y,k.x,k.y),null!=a&&a.quadraticCurveTo(j.x,j.y,k.x,k.y)}break;case"A":case"a":for(;!b.isCommandOrEnd();){var h=b.current,l=b.getScalar(),m=b.getScalar(),n=b.getScalar()*(Math.PI/180),o=b.getScalar(),p=b.getScalar(),k=b.getAsCurrentPoint(),q=new f.Point(Math.cos(n)*(h.x-k.x)/2+Math.sin(n)*(h.y-k.y)/2,-Math.sin(n)*(h.x-k.x)/2+Math.cos(n)*(h.y-k.y)/2),r=Math.pow(q.x,2)/Math.pow(l,2)+Math.pow(q.y,2)/Math.pow(m,2);r>1&&(l*=Math.sqrt(r),m*=Math.sqrt(r));var s=(o==p?-1:1)*Math.sqrt((Math.pow(l,2)*Math.pow(m,2)-Math.pow(l,2)*Math.pow(q.y,2)-Math.pow(m,2)*Math.pow(q.x,2))/(Math.pow(l,2)*Math.pow(q.y,2)+Math.pow(m,2)*Math.pow(q.x,2)));isNaN(s)&&(s=0);var t=new f.Point(s*l*q.y/m,s*-m*q.x/l),u=new f.Point((h.x+k.x)/2+Math.cos(n)*t.x-Math.sin(n)*t.y,(h.y+k.y)/2+Math.sin(n)*t.x+Math.cos(n)*t.y),v=function(a){return Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2))},w=function(a,b){return(a[0]*b[0]+a[1]*b[1])/(v(a)*v(b))},x=function(a,b){return(a[0]*b[1]<a[1]*b[0]?-1:1)*Math.acos(w(a,b))},y=x([1,0],[(q.x-t.x)/l,(q.y-t.y)/m]),z=[(q.x-t.x)/l,(q.y-t.y)/m],A=[(-q.x-t.x)/l,(-q.y-t.y)/m],B=x(z,A);w(z,A)<=-1&&(B=Math.PI),w(z,A)>=1&&(B=0);var C=1-p?1:-1,D=y+C*(B/2),E=new f.Point(u.x+l*Math.cos(D),u.y+m*Math.sin(D));if(b.addMarkerAngle(E,D-C*Math.PI/2),b.addMarkerAngle(k,D-C*Math.PI),c.addPoint(k.x,k.y),null!=a){var w=l>m?l:m,F=l>m?1:l/m,G=l>m?m/l:1;a.translate(u.x,u.y),a.rotate(n),a.scale(F,G),a.arc(0,0,w,y,y+B,1-p),a.scale(1/F,1/G),a.rotate(-n),a.translate(-u.x,-u.y)}}break;case"Z":case"z":null!=a&&a.closePath(),b.current=b.start}return c},this.getMarkers=function(){for(var a=this.PathParser.getMarkerPoints(),b=this.PathParser.getMarkerAngles(),c=[],d=0;d<a.length;d++)c.push([a[d],b[d]]);return c}},f.Element.path.prototype=new f.Element.PathElementBase,f.Element.pattern=function(a){this.base=f.Element.ElementBase,this.base(a),this.createPattern=function(a,b){var c=this.attribute("width").toPixels("x",!0),d=this.attribute("height").toPixels("y",!0),e=new f.Element.svg;e.attributes.viewBox=new f.Property("viewBox",this.attribute("viewBox").value),e.attributes.width=new f.Property("width",c+"px"),e.attributes.height=new f.Property("height",d+"px"),e.attributes.transform=new f.Property("transform",this.attribute("patternTransform").value),e.children=this.children;var g=document.createElement("canvas");g.width=c,g.height=d;var h=g.getContext("2d");this.attribute("x").hasValue()&&this.attribute("y").hasValue()&&h.translate(this.attribute("x").toPixels("x",!0),this.attribute("y").toPixels("y",!0));for(var i=-1;1>=i;i++)for(var j=-1;1>=j;j++)h.save(),e.attributes.x=new f.Property("x",i*g.width),e.attributes.y=new f.Property("y",j*g.height),e.render(h),h.restore();var k=a.createPattern(g,"repeat");return k}},f.Element.pattern.prototype=new f.Element.ElementBase,f.Element.marker=function(a){this.base=f.Element.ElementBase,this.base(a),this.baseRender=this.render,this.render=function(a,b,c){a.translate(b.x,b.y),"auto"==this.attribute("orient").valueOrDefault("auto")&&a.rotate(c),"strokeWidth"==this.attribute("markerUnits").valueOrDefault("strokeWidth")&&a.scale(a.lineWidth,a.lineWidth),a.save();var d=new f.Element.svg;d.attributes.viewBox=new f.Property("viewBox",this.attribute("viewBox").value),d.attributes.refX=new f.Property("refX",this.attribute("refX").value),d.attributes.refY=new f.Property("refY",this.attribute("refY").value),d.attributes.width=new f.Property("width",this.attribute("markerWidth").value),d.attributes.height=new f.Property("height",this.attribute("markerHeight").value),d.attributes.fill=new f.Property("fill",this.attribute("fill").valueOrDefault("black")),d.attributes.stroke=new f.Property("stroke",this.attribute("stroke").valueOrDefault("none")),d.children=this.children,d.render(a),a.restore(),"strokeWidth"==this.attribute("markerUnits").valueOrDefault("strokeWidth")&&a.scale(1/a.lineWidth,1/a.lineWidth),"auto"==this.attribute("orient").valueOrDefault("auto")&&a.rotate(-c),a.translate(-b.x,-b.y)}},f.Element.marker.prototype=new f.Element.ElementBase,f.Element.defs=function(a){this.base=f.Element.ElementBase,this.base(a),this.render=function(a){}},f.Element.defs.prototype=new f.Element.ElementBase,f.Element.GradientBase=function(a){this.base=f.Element.ElementBase,this.base(a),this.stops=[];for(var b=0;b<this.children.length;b++){var c=this.children[b];"stop"==c.type&&this.stops.push(c)}this.getGradient=function(){},this.gradientUnits=function(){return this.attribute("gradientUnits").valueOrDefault("objectBoundingBox")},this.attributesToInherit=["gradientUnits"],this.inheritStopContainer=function(a){for(var b=0;b<this.attributesToInherit.length;b++){var c=this.attributesToInherit[b];!this.attribute(c).hasValue()&&a.attribute(c).hasValue()&&(this.attribute(c,!0).value=a.attribute(c).value)}},this.createGradient=function(a,b,c){var d=this;this.getHrefAttribute().hasValue()&&(d=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(d));var e=function(a){if(c.hasValue()){var b=new f.Property("color",a);return b.addOpacity(c).value}return a},g=this.getGradient(a,b);if(null==g)return e(d.stops[d.stops.length-1].color);for(var h=0;h<d.stops.length;h++)g.addColorStop(d.stops[h].offset,e(d.stops[h].color));if(this.attribute("gradientTransform").hasValue()){var i=f.ViewPort.viewPorts[0],j=new f.Element.rect;j.attributes.x=new f.Property("x",-f.MAX_VIRTUAL_PIXELS/3),j.attributes.y=new f.Property("y",-f.MAX_VIRTUAL_PIXELS/3),j.attributes.width=new f.Property("width",f.MAX_VIRTUAL_PIXELS),j.attributes.height=new f.Property("height",f.MAX_VIRTUAL_PIXELS);var k=new f.Element.g;k.attributes.transform=new f.Property("transform",this.attribute("gradientTransform").value),k.children=[j];var l=new f.Element.svg;l.attributes.x=new f.Property("x",0),l.attributes.y=new f.Property("y",0),l.attributes.width=new f.Property("width",i.width),l.attributes.height=new f.Property("height",i.height),l.children=[k];var m=document.createElement("canvas");m.width=i.width,m.height=i.height;var n=m.getContext("2d");return n.fillStyle=g,l.render(n),n.createPattern(m,"no-repeat")}return g}},f.Element.GradientBase.prototype=new f.Element.ElementBase,f.Element.linearGradient=function(a){this.base=f.Element.GradientBase,this.base(a),this.attributesToInherit.push("x1"),this.attributesToInherit.push("y1"),this.attributesToInherit.push("x2"),this.attributesToInherit.push("y2"),this.getGradient=function(a,b){var c="objectBoundingBox"==this.gradientUnits()?b.getBoundingBox():null;this.attribute("x1").hasValue()||this.attribute("y1").hasValue()||this.attribute("x2").hasValue()||this.attribute("y2").hasValue()||(this.attribute("x1",!0).value=0,this.attribute("y1",!0).value=0,this.attribute("x2",!0).value=1,this.attribute("y2",!0).value=0);var d="objectBoundingBox"==this.gradientUnits()?c.x()+c.width()*this.attribute("x1").numValue():this.attribute("x1").toPixels("x"),e="objectBoundingBox"==this.gradientUnits()?c.y()+c.height()*this.attribute("y1").numValue():this.attribute("y1").toPixels("y"),f="objectBoundingBox"==this.gradientUnits()?c.x()+c.width()*this.attribute("x2").numValue():this.attribute("x2").toPixels("x"),g="objectBoundingBox"==this.gradientUnits()?c.y()+c.height()*this.attribute("y2").numValue():this.attribute("y2").toPixels("y");return d==f&&e==g?null:a.createLinearGradient(d,e,f,g)}},f.Element.linearGradient.prototype=new f.Element.GradientBase,f.Element.radialGradient=function(a){this.base=f.Element.GradientBase,this.base(a),this.attributesToInherit.push("cx"),this.attributesToInherit.push("cy"),this.attributesToInherit.push("r"),this.attributesToInherit.push("fx"),this.attributesToInherit.push("fy"),this.getGradient=function(a,b){var c=b.getBoundingBox();this.attribute("cx").hasValue()||(this.attribute("cx",!0).value="50%"),this.attribute("cy").hasValue()||(this.attribute("cy",!0).value="50%"),this.attribute("r").hasValue()||(this.attribute("r",!0).value="50%");var d="objectBoundingBox"==this.gradientUnits()?c.x()+c.width()*this.attribute("cx").numValue():this.attribute("cx").toPixels("x"),e="objectBoundingBox"==this.gradientUnits()?c.y()+c.height()*this.attribute("cy").numValue():this.attribute("cy").toPixels("y"),f=d,g=e;this.attribute("fx").hasValue()&&(f="objectBoundingBox"==this.gradientUnits()?c.x()+c.width()*this.attribute("fx").numValue():this.attribute("fx").toPixels("x")),this.attribute("fy").hasValue()&&(g="objectBoundingBox"==this.gradientUnits()?c.y()+c.height()*this.attribute("fy").numValue():this.attribute("fy").toPixels("y"));var h="objectBoundingBox"==this.gradientUnits()?(c.width()+c.height())/2*this.attribute("r").numValue():this.attribute("r").toPixels();return a.createRadialGradient(f,g,0,d,e,h)}},f.Element.radialGradient.prototype=new f.Element.GradientBase,f.Element.stop=function(a){this.base=f.Element.ElementBase,this.base(a),this.offset=this.attribute("offset").numValue(),this.offset<0&&(this.offset=0),this.offset>1&&(this.offset=1);var b=this.style("stop-color",!0);""===b.value&&(b.value="#000"),this.style("stop-opacity").hasValue()&&(b=b.addOpacity(this.style("stop-opacity"))),this.color=b.value},f.Element.stop.prototype=new f.Element.ElementBase,f.Element.AnimateBase=function(a){this.base=f.Element.ElementBase,this.base(a),f.Animations.push(this),this.duration=0,this.begin=this.attribute("begin").toMilliseconds(),this.maxDuration=this.begin+this.attribute("dur").toMilliseconds(),this.getProperty=function(){var a=this.attribute("attributeType").value,b=this.attribute("attributeName").value;return"CSS"==a?this.parent.style(b,!0):this.parent.attribute(b,!0)},this.initialValue=null,this.initialUnits="",this.removed=!1,this.calcValue=function(){return""},this.update=function(a){if(null==this.initialValue&&(this.initialValue=this.getProperty().value,this.initialUnits=this.getProperty().getUnits()),this.duration>this.maxDuration){if("indefinite"==this.attribute("repeatCount").value||"indefinite"==this.attribute("repeatDur").value)this.duration=0;else if("freeze"!=this.attribute("fill").valueOrDefault("remove")||this.frozen){if("remove"==this.attribute("fill").valueOrDefault("remove")&&!this.removed)return this.removed=!0,this.getProperty().value=this.parent.animationFrozen?this.parent.animationFrozenValue:this.initialValue,!0}else this.frozen=!0,this.parent.animationFrozen=!0,this.parent.animationFrozenValue=this.getProperty().value;return!1}this.duration=this.duration+a;var b=!1;if(this.begin<this.duration){var c=this.calcValue();if(this.attribute("type").hasValue()){var d=this.attribute("type").value;c=d+"("+c+")"}this.getProperty().value=c,b=!0}return b},this.from=this.attribute("from"),this.to=this.attribute("to"),this.values=this.attribute("values"),this.values.hasValue()&&(this.values.value=this.values.value.split(";")),this.progress=function(){var a={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(this.values.hasValue()){var b=a.progress*(this.values.value.length-1),c=Math.floor(b),d=Math.ceil(b);a.from=new f.Property("from",parseFloat(this.values.value[c])),a.to=new f.Property("to",parseFloat(this.values.value[d])),a.progress=(b-c)/(d-c)}else a.from=this.from,a.to=this.to;return a}},f.Element.AnimateBase.prototype=new f.Element.ElementBase,f.Element.animate=function(a){this.base=f.Element.AnimateBase,this.base(a),this.calcValue=function(){var a=this.progress(),b=a.from.numValue()+(a.to.numValue()-a.from.numValue())*a.progress;return b+this.initialUnits}},f.Element.animate.prototype=new f.Element.AnimateBase,f.Element.animateColor=function(b){this.base=f.Element.AnimateBase,this.base(b),this.calcValue=function(){var b=this.progress(),c=new a(b.from.value),d=new a(b.to.value);if(c.ok&&d.ok){var e=c.r+(d.r-c.r)*b.progress,f=c.g+(d.g-c.g)*b.progress,g=c.b+(d.b-c.b)*b.progress;return"rgb("+parseInt(e,10)+","+parseInt(f,10)+","+parseInt(g,10)+")"}return this.attribute("from").value}},f.Element.animateColor.prototype=new f.Element.AnimateBase,f.Element.animateTransform=function(a){this.base=f.Element.AnimateBase,this.base(a),this.calcValue=function(){for(var a=this.progress(),b=f.ToNumberArray(a.from.value),c=f.ToNumberArray(a.to.value),d="",e=0;e<b.length;e++)d+=b[e]+(c[e]-b[e])*a.progress+" ";return d}},f.Element.animateTransform.prototype=new f.Element.animate,f.Element.font=function(a){this.base=f.Element.ElementBase,this.base(a),this.horizAdvX=this.attribute("horiz-adv-x").numValue(),this.isRTL=!1,this.isArabic=!1,this.fontFace=null,this.missingGlyph=null,this.glyphs=[];for(var b=0;b<this.children.length;b++){var c=this.children[b];"font-face"==c.type?(this.fontFace=c,c.style("font-family").hasValue()&&(f.Definitions[c.style("font-family").value]=this)):"missing-glyph"==c.type?this.missingGlyph=c:"glyph"==c.type&&(""!=c.arabicForm?(this.isRTL=!0,this.isArabic=!0,"undefined"==typeof this.glyphs[c.unicode]&&(this.glyphs[c.unicode]=[]),this.glyphs[c.unicode][c.arabicForm]=c):this.glyphs[c.unicode]=c)}},f.Element.font.prototype=new f.Element.ElementBase,f.Element.fontface=function(a){this.base=f.Element.ElementBase,this.base(a),this.ascent=this.attribute("ascent").value,this.descent=this.attribute("descent").value,this.unitsPerEm=this.attribute("units-per-em").numValue()},f.Element.fontface.prototype=new f.Element.ElementBase,f.Element.missingglyph=function(a){this.base=f.Element.path,this.base(a),this.horizAdvX=0},f.Element.missingglyph.prototype=new f.Element.path,f.Element.glyph=function(a){this.base=f.Element.path,this.base(a),this.horizAdvX=this.attribute("horiz-adv-x").numValue(),this.unicode=this.attribute("unicode").value,this.arabicForm=this.attribute("arabic-form").value},f.Element.glyph.prototype=new f.Element.path,f.Element.text=function(a){this.captureTextNodes=!0,this.base=f.Element.RenderedElementBase,this.base(a),this.baseSetContext=this.setContext,this.setContext=function(a){this.baseSetContext(a);var b=this.style("dominant-baseline").toTextBaseline();null==b&&(b=this.style("alignment-baseline").toTextBaseline()),null!=b&&(a.textBaseline=b)},this.getBoundingBox=function(){var a=this.attribute("x").toPixels("x"),b=this.attribute("y").toPixels("y"),c=this.parent.style("font-size").numValueOrDefault(f.Font.Parse(f.ctx.font).fontSize);return new f.BoundingBox(a,b-c,a+Math.floor(2*c/3)*this.children[0].getText().length,b)},this.renderChildren=function(a){this.x=this.attribute("x").toPixels("x"),this.y=this.attribute("y").toPixels("y"),this.attribute("dx").hasValue()&&(this.x+=this.attribute("dx").toPixels("x")),this.attribute("dy").hasValue()&&(this.y+=this.attribute("dy").toPixels("y")),this.x+=this.getAnchorDelta(a,this,0);for(var b=0;b<this.children.length;b++)this.renderChild(a,this,b)},this.getAnchorDelta=function(a,b,c){var d=this.style("text-anchor").valueOrDefault("start");if("start"!=d){for(var e=0,f=c;f<b.children.length;f++){var g=b.children[f];if(f>c&&g.attribute("x").hasValue())break;e+=g.measureTextRecursive(a)}return-1*("end"==d?e:e/2)}return 0},this.renderChild=function(a,b,c){var d=b.children[c];d.attribute("x").hasValue()?(d.x=d.attribute("x").toPixels("x")+b.getAnchorDelta(a,b,c),d.attribute("dx").hasValue()&&(d.x+=d.attribute("dx").toPixels("x"))):(d.attribute("dx").hasValue()&&(b.x+=d.attribute("dx").toPixels("x")),d.x=b.x),b.x=d.x+d.measureText(a),d.attribute("y").hasValue()?(d.y=d.attribute("y").toPixels("y"),d.attribute("dy").hasValue()&&(d.y+=d.attribute("dy").toPixels("y"))):(d.attribute("dy").hasValue()&&(b.y+=d.attribute("dy").toPixels("y")),d.y=b.y),b.y=d.y,d.render(a);for(var c=0;c<d.children.length;c++)b.renderChild(a,d,c)}},f.Element.text.prototype=new f.Element.RenderedElementBase,f.Element.TextElementBase=function(a){this.base=f.Element.RenderedElementBase,this.base(a),this.getGlyph=function(a,b,c){var d=b[c],e=null;if(a.isArabic){var f="isolated";(0==c||" "==b[c-1])&&c<b.length-2&&" "!=b[c+1]&&(f="terminal"),c>0&&" "!=b[c-1]&&c<b.length-2&&" "!=b[c+1]&&(f="medial"),c>0&&" "!=b[c-1]&&(c==b.length-1||" "==b[c+1])&&(f="initial"),"undefined"!=typeof a.glyphs[d]&&(e=a.glyphs[d][f],null==e&&"glyph"==a.glyphs[d].type&&(e=a.glyphs[d]))}else e=a.glyphs[d];return null==e&&(e=a.missingGlyph),e},this.renderChildren=function(a){var b=this.parent.style("font-family").getDefinition();if(null==b)""!=a.fillStyle&&a.fillText(f.compressSpaces(this.getText()),this.x,this.y),""!=a.strokeStyle&&a.strokeText(f.compressSpaces(this.getText()),this.x,this.y);else{var c=this.parent.style("font-size").numValueOrDefault(f.Font.Parse(f.ctx.font).fontSize),d=this.parent.style("font-style").valueOrDefault(f.Font.Parse(f.ctx.font).fontStyle),e=this.getText();b.isRTL&&(e=e.split("").reverse().join(""));for(var g=f.ToNumberArray(this.parent.attribute("dx").value),h=0;h<e.length;h++){var i=this.getGlyph(b,e,h),j=c/b.fontFace.unitsPerEm;a.translate(this.x,this.y),a.scale(j,-j);var k=a.lineWidth;a.lineWidth=a.lineWidth*b.fontFace.unitsPerEm/c,"italic"==d&&a.transform(1,0,.4,1,0,0),i.render(a),"italic"==d&&a.transform(1,0,-.4,1,0,0),a.lineWidth=k,a.scale(1/j,-1/j),a.translate(-this.x,-this.y),this.x+=c*(i.horizAdvX||b.horizAdvX)/b.fontFace.unitsPerEm,"undefined"==typeof g[h]||isNaN(g[h])||(this.x+=g[h])}}},this.getText=function(){},this.measureTextRecursive=function(a){for(var b=this.measureText(a),c=0;c<this.children.length;c++)b+=this.children[c].measureTextRecursive(a);return b},this.measureText=function(a){var b=this.parent.style("font-family").getDefinition();if(null!=b){var c=this.parent.style("font-size").numValueOrDefault(f.Font.Parse(f.ctx.font).fontSize),d=0,e=this.getText();b.isRTL&&(e=e.split("").reverse().join(""));for(var g=f.ToNumberArray(this.parent.attribute("dx").value),h=0;h<e.length;h++){var i=this.getGlyph(b,e,h);d+=(i.horizAdvX||b.horizAdvX)*c/b.fontFace.unitsPerEm,"undefined"==typeof g[h]||isNaN(g[h])||(d+=g[h])}return d}var j=f.compressSpaces(this.getText());if(!a.measureText)return 10*j.length;a.save(),this.setContext(a);var k=a.measureText(j).width;return a.restore(),k}},f.Element.TextElementBase.prototype=new f.Element.RenderedElementBase,f.Element.tspan=function(a){this.captureTextNodes=!0,this.base=f.Element.TextElementBase,this.base(a),this.text=f.compressSpaces(a.value||a.text||a.textContent||""),this.getText=function(){return this.children.length>0?"":this.text}},f.Element.tspan.prototype=new f.Element.TextElementBase,f.Element.tref=function(a){this.base=f.Element.TextElementBase,this.base(a),this.getText=function(){var a=this.getHrefAttribute().getDefinition();return null!=a?a.children[0].getText():void 0}},f.Element.tref.prototype=new f.Element.TextElementBase,f.Element.a=function(a){this.base=f.Element.TextElementBase,this.base(a),this.hasText=a.childNodes.length>0;for(var b=0;b<a.childNodes.length;b++)3!=a.childNodes[b].nodeType&&(this.hasText=!1);this.text=this.hasText?a.childNodes[0].value:"",this.getText=function(){return this.text},this.baseRenderChildren=this.renderChildren,this.renderChildren=function(a){if(this.hasText){this.baseRenderChildren(a);var b=new f.Property("fontSize",f.Font.Parse(f.ctx.font).fontSize);f.Mouse.checkBoundingBox(this,new f.BoundingBox(this.x,this.y-b.toPixels("y"),this.x+this.measureText(a),this.y))}else if(this.children.length>0){var c=new f.Element.g;c.children=this.children,c.parent=this,c.render(a)}},this.onclick=function(){window.open(this.getHrefAttribute().value)},this.onmousemove=function(){f.ctx.canvas.style.cursor="pointer"}},f.Element.a.prototype=new f.Element.TextElementBase,f.Element.image=function(a){this.base=f.Element.RenderedElementBase,this.base(a);var b=this.getHrefAttribute().value;if(""!=b){var c=b.match(/\.svg$/);if(f.Images.push(this),this.loaded=!1,c)this.img=f.ajax(b),this.loaded=!0;else{this.img=document.createElement("img"),1==f.opts.useCORS&&(this.img.crossOrigin="Anonymous");var d=this;this.img.onload=function(){d.loaded=!0},this.img.onerror=function(){f.log('ERROR: image "'+b+'" not found'),d.loaded=!0},this.img.src=b}this.renderChildren=function(a){var b=this.attribute("x").toPixels("x"),d=this.attribute("y").toPixels("y"),e=this.attribute("width").toPixels("x"),g=this.attribute("height").toPixels("y");0!=e&&0!=g&&(a.save(),c?a.drawSvg(this.img,b,d,e,g):(a.translate(b,d),f.AspectRatio(a,this.attribute("preserveAspectRatio").value,e,this.img.width,g,this.img.height,0,0),a.drawImage(this.img,0,0)),a.restore())},this.getBoundingBox=function(){var a=this.attribute("x").toPixels("x"),b=this.attribute("y").toPixels("y"),c=this.attribute("width").toPixels("x"),d=this.attribute("height").toPixels("y");return new f.BoundingBox(a,b,a+c,b+d)}}},f.Element.image.prototype=new f.Element.RenderedElementBase,f.Element.g=function(a){this.base=f.Element.RenderedElementBase,this.base(a),this.getBoundingBox=function(){for(var a=new f.BoundingBox,b=0;b<this.children.length;b++)a.addBoundingBox(this.children[b].getBoundingBox());return a}},f.Element.g.prototype=new f.Element.RenderedElementBase,f.Element.symbol=function(a){this.base=f.Element.RenderedElementBase,this.base(a),this.render=function(a){}},f.Element.symbol.prototype=new f.Element.RenderedElementBase,f.Element.style=function(a){this.base=f.Element.ElementBase,this.base(a);for(var b="",d=0;d<a.childNodes.length;d++)b+=a.childNodes[d].data;b=b.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,""),b=f.compressSpaces(b);for(var e=b.split("}"),d=0;d<e.length;d++)if(""!=f.trim(e[d]))for(var g=e[d].split("{"),h=g[0].split(","),i=g[1].split(";"),j=0;j<h.length;j++){ var k=f.trim(h[j]);if(""!=k){for(var l=f.Styles[k]||{},m=0;m<i.length;m++){var n=i[m].indexOf(":"),o=i[m].substr(0,n),p=i[m].substr(n+1,i[m].length-n);null!=o&&null!=p&&(l[f.trim(o)]=new f.Property(f.trim(o),f.trim(p)))}if(f.Styles[k]=l,f.StylesSpecificity[k]=c(k),"@font-face"==k)for(var q=l["font-family"].value.replace(/"/g,""),r=l.src.value.split(","),s=0;s<r.length;s++)if(r[s].indexOf('format("svg")')>0)for(var t=r[s].indexOf("url"),u=r[s].indexOf(")",t),v=r[s].substr(t+5,u-t-6),w=f.parseXml(f.ajax(v)),x=w.getElementsByTagName("font"),y=0;y<x.length;y++){var z=f.CreateElement(x[y]);f.Definitions[q]=z}}}},f.Element.style.prototype=new f.Element.ElementBase,f.Element.use=function(a){this.base=f.Element.RenderedElementBase,this.base(a),this.baseSetContext=this.setContext,this.setContext=function(a){this.baseSetContext(a),this.attribute("x").hasValue()&&a.translate(this.attribute("x").toPixels("x"),0),this.attribute("y").hasValue()&&a.translate(0,this.attribute("y").toPixels("y"))};var b=this.getHrefAttribute().getDefinition();this.path=function(a){null!=b&&b.path(a)},this.getBoundingBox=function(){return null!=b?b.getBoundingBox():void 0},this.renderChildren=function(a){if(null!=b){var c=b;"symbol"==b.type&&(c=new f.Element.svg,c.type="svg",c.attributes.viewBox=new f.Property("viewBox",b.attribute("viewBox").value),c.attributes.preserveAspectRatio=new f.Property("preserveAspectRatio",b.attribute("preserveAspectRatio").value),c.attributes.overflow=new f.Property("overflow",b.attribute("overflow").value),c.children=b.children),"svg"==c.type&&(this.attribute("width").hasValue()&&(c.attributes.width=new f.Property("width",this.attribute("width").value)),this.attribute("height").hasValue()&&(c.attributes.height=new f.Property("height",this.attribute("height").value)));var d=c.parent;c.parent=null,c.render(a),c.parent=d}}},f.Element.use.prototype=new f.Element.RenderedElementBase,f.Element.mask=function(a){this.base=f.Element.ElementBase,this.base(a),this.apply=function(a,b){var c=this.attribute("x").toPixels("x"),d=this.attribute("y").toPixels("y"),e=this.attribute("width").toPixels("x"),g=this.attribute("height").toPixels("y");if(0==e&&0==g){for(var h=new f.BoundingBox,i=0;i<this.children.length;i++)h.addBoundingBox(this.children[i].getBoundingBox());var c=Math.floor(h.x1),d=Math.floor(h.y1),e=Math.floor(h.width()),g=Math.floor(h.height())}var j=b.attribute("mask").value;b.attribute("mask").value="";var k=document.createElement("canvas");k.width=c+e,k.height=d+g;var l=k.getContext("2d");this.renderChildren(l);var m=document.createElement("canvas");m.width=c+e,m.height=d+g;var n=m.getContext("2d");b.render(n),n.globalCompositeOperation="destination-in",n.fillStyle=l.createPattern(k,"no-repeat"),n.fillRect(0,0,c+e,d+g),a.fillStyle=n.createPattern(m,"no-repeat"),a.fillRect(0,0,c+e,d+g),b.attribute("mask").value=j},this.render=function(a){}},f.Element.mask.prototype=new f.Element.ElementBase,f.Element.clipPath=function(a){this.base=f.Element.ElementBase,this.base(a),this.apply=function(a){var b=CanvasRenderingContext2D.prototype.beginPath;CanvasRenderingContext2D.prototype.beginPath=function(){};var c=CanvasRenderingContext2D.prototype.closePath;CanvasRenderingContext2D.prototype.closePath=function(){},b.call(a);for(var d=0;d<this.children.length;d++){var e=this.children[d];if("undefined"!=typeof e.path){var g=null;e.style("transform",!1,!0).hasValue()&&(g=new f.Transform(e.style("transform",!1,!0).value),g.apply(a)),e.path(a),CanvasRenderingContext2D.prototype.closePath=c,g&&g.unapply(a)}}c.call(a),a.clip(),CanvasRenderingContext2D.prototype.beginPath=b,CanvasRenderingContext2D.prototype.closePath=c},this.render=function(a){}},f.Element.clipPath.prototype=new f.Element.ElementBase,f.Element.filter=function(a){this.base=f.Element.ElementBase,this.base(a),this.apply=function(a,b){var c=b.getBoundingBox(),d=Math.floor(c.x1),e=Math.floor(c.y1),f=Math.floor(c.width()),g=Math.floor(c.height()),h=b.style("filter").value;b.style("filter").value="";for(var i=0,j=0,k=0;k<this.children.length;k++){var l=this.children[k].extraFilterDistance||0;i=Math.max(i,l),j=Math.max(j,l)}var m=document.createElement("canvas");m.width=f+2*i,m.height=g+2*j;var n=m.getContext("2d");n.translate(-d+i,-e+j),b.render(n);for(var k=0;k<this.children.length;k++)"function"==typeof this.children[k].apply&&this.children[k].apply(n,0,0,f+2*i,g+2*j);a.drawImage(m,0,0,f+2*i,g+2*j,d-i,e-j,f+2*i,g+2*j),b.style("filter",!0).value=h},this.render=function(a){}},f.Element.filter.prototype=new f.Element.ElementBase,f.Element.feMorphology=function(a){this.base=f.Element.ElementBase,this.base(a),this.apply=function(a,b,c,d,e){}},f.Element.feMorphology.prototype=new f.Element.ElementBase,f.Element.feComposite=function(a){this.base=f.Element.ElementBase,this.base(a),this.apply=function(a,b,c,d,e){}},f.Element.feComposite.prototype=new f.Element.ElementBase,f.Element.feColorMatrix=function(a){function b(a,b,c,d,e,f){return a[c*d*4+4*b+f]}function c(a,b,c,d,e,f,g){a[c*d*4+4*b+f]=g}function d(a,b){var c=e[a];return c*(0>c?b-255:b)}this.base=f.Element.ElementBase,this.base(a);var e=f.ToNumberArray(this.attribute("values").value);switch(this.attribute("type").valueOrDefault("matrix")){case"saturate":var g=e[0];e=[.213+.787*g,.715-.715*g,.072-.072*g,0,0,.213-.213*g,.715+.285*g,.072-.072*g,0,0,.213-.213*g,.715-.715*g,.072+.928*g,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var h=e[0]*Math.PI/180,i=function(a,b,c){return a+Math.cos(h)*b+Math.sin(h)*c};e=[i(.213,.787,-.213),i(.715,-.715,-.715),i(.072,-.072,.928),0,0,i(.213,-.213,.143),i(.715,.285,.14),i(.072,-.072,-.283),0,0,i(.213,-.213,-.787),i(.715,-.715,.715),i(.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}this.apply=function(a,e,f,g,h){for(var i=a.getImageData(0,0,g,h),f=0;h>f;f++)for(var e=0;g>e;e++){var j=b(i.data,e,f,g,h,0),k=b(i.data,e,f,g,h,1),l=b(i.data,e,f,g,h,2),m=b(i.data,e,f,g,h,3);c(i.data,e,f,g,h,0,d(0,j)+d(1,k)+d(2,l)+d(3,m)+d(4,1)),c(i.data,e,f,g,h,1,d(5,j)+d(6,k)+d(7,l)+d(8,m)+d(9,1)),c(i.data,e,f,g,h,2,d(10,j)+d(11,k)+d(12,l)+d(13,m)+d(14,1)),c(i.data,e,f,g,h,3,d(15,j)+d(16,k)+d(17,l)+d(18,m)+d(19,1))}a.clearRect(0,0,g,h),a.putImageData(i,0,0)}},f.Element.feColorMatrix.prototype=new f.Element.ElementBase,f.Element.feGaussianBlur=function(a){this.base=f.Element.ElementBase,this.base(a),this.blurRadius=Math.floor(this.attribute("stdDeviation").numValue()),this.extraFilterDistance=this.blurRadius,this.apply=function(a,c,d,e,g){return"undefined"==typeof b.canvasRGBA?void f.log("ERROR: StackBlur.js must be included for blur to work"):(a.canvas.id=f.UniqueId(),a.canvas.style.display="none",document.body.appendChild(a.canvas),b.canvasRGBA(a.canvas.id,c,d,e,g,this.blurRadius),void document.body.removeChild(a.canvas))}},f.Element.feGaussianBlur.prototype=new f.Element.ElementBase,f.Element.title=function(a){},f.Element.title.prototype=new f.Element.ElementBase,f.Element.desc=function(a){},f.Element.desc.prototype=new f.Element.ElementBase,f.Element.MISSING=function(a){f.log("ERROR: Element '"+a.nodeName+"' not yet implemented.")},f.Element.MISSING.prototype=new f.Element.ElementBase,f.CreateElement=function(a){var b=a.nodeName.replace(/^[^:]+:/,"");b=b.replace(/\-/g,"");var c=null;return c="undefined"!=typeof f.Element[b]?new f.Element[b](a):new f.Element.MISSING(a),c.type=a.nodeName,c},f.load=function(a,b){f.loadXml(a,f.ajax(b))},f.loadXml=function(a,b){f.loadXmlDoc(a,f.parseXml(b))},f.loadXmlDoc=function(a,b){f.init(a);var c=function(b){for(var c=a.canvas;c;)b.x-=c.offsetLeft,b.y-=c.offsetTop,c=c.offsetParent;return window.scrollX&&(b.x+=window.scrollX),window.scrollY&&(b.y+=window.scrollY),b};1!=f.opts.ignoreMouse&&(a.canvas.onclick=function(a){var b=c(new f.Point(null!=a?a.clientX:event.clientX,null!=a?a.clientY:event.clientY));f.Mouse.onclick(b.x,b.y)},a.canvas.onmousemove=function(a){var b=c(new f.Point(null!=a?a.clientX:event.clientX,null!=a?a.clientY:event.clientY));f.Mouse.onmousemove(b.x,b.y)});var d=f.CreateElement(b.documentElement);d.root=!0,d.addStylesFromStyleDefinition();var e=!0,g=function(){f.ViewPort.Clear(),a.canvas.parentNode&&f.ViewPort.SetCurrent(a.canvas.parentNode.clientWidth,a.canvas.parentNode.clientHeight),1!=f.opts.ignoreDimensions&&(d.style("width").hasValue()&&(a.canvas.width=d.style("width").toPixels("x"),a.canvas.style.width=a.canvas.width+"px"),d.style("height").hasValue()&&(a.canvas.height=d.style("height").toPixels("y"),a.canvas.style.height=a.canvas.height+"px"));var c=a.canvas.clientWidth||a.canvas.width,g=a.canvas.clientHeight||a.canvas.height;if(1==f.opts.ignoreDimensions&&d.style("width").hasValue()&&d.style("height").hasValue()&&(c=d.style("width").toPixels("x"),g=d.style("height").toPixels("y")),f.ViewPort.SetCurrent(c,g),null!=f.opts.offsetX&&(d.attribute("x",!0).value=f.opts.offsetX),null!=f.opts.offsetY&&(d.attribute("y",!0).value=f.opts.offsetY),null!=f.opts.scaleWidth||null!=f.opts.scaleHeight){var h=null,i=null,j=f.ToNumberArray(d.attribute("viewBox").value);null!=f.opts.scaleWidth&&(d.attribute("width").hasValue()?h=d.attribute("width").toPixels("x")/f.opts.scaleWidth:isNaN(j[2])||(h=j[2]/f.opts.scaleWidth)),null!=f.opts.scaleHeight&&(d.attribute("height").hasValue()?i=d.attribute("height").toPixels("y")/f.opts.scaleHeight:isNaN(j[3])||(i=j[3]/f.opts.scaleHeight)),null==h&&(h=i),null==i&&(i=h),d.attribute("width",!0).value=f.opts.scaleWidth,d.attribute("height",!0).value=f.opts.scaleHeight,d.style("transform",!0,!0).value+=" scale("+1/h+","+1/i+")"}1!=f.opts.ignoreClear&&a.clearRect(0,0,c,g),d.render(a),e&&(e=!1,"function"==typeof f.opts.renderCallback&&f.opts.renderCallback(b))},h=!0;f.ImagesLoaded()&&(h=!1,g()),f.intervalID=setInterval(function(){var a=!1;if(h&&f.ImagesLoaded()&&(h=!1,a=!0),1!=f.opts.ignoreMouse&&(a|=f.Mouse.hasEvents()),1!=f.opts.ignoreAnimation)for(var b=0;b<f.Animations.length;b++)a|=f.Animations[b].update(1e3/f.FRAMERATE);"function"==typeof f.opts.forceRedraw&&1==f.opts.forceRedraw()&&(a=!0),a&&(g(),f.Mouse.runEvents())},1e3/f.FRAMERATE)},f.stop=function(){f.intervalID&&clearInterval(f.intervalID)},f.Mouse=new function(){this.events=[],this.hasEvents=function(){return 0!=this.events.length},this.onclick=function(a,b){this.events.push({type:"onclick",x:a,y:b,run:function(a){a.onclick&&a.onclick()}})},this.onmousemove=function(a,b){this.events.push({type:"onmousemove",x:a,y:b,run:function(a){a.onmousemove&&a.onmousemove()}})},this.eventElements=[],this.checkPath=function(a,b){for(var c=0;c<this.events.length;c++){var d=this.events[c];b.isPointInPath&&b.isPointInPath(d.x,d.y)&&(this.eventElements[c]=a)}},this.checkBoundingBox=function(a,b){for(var c=0;c<this.events.length;c++){var d=this.events[c];b.isPointInBox(d.x,d.y)&&(this.eventElements[c]=a)}},this.runEvents=function(){f.ctx.canvas.style.cursor="";for(var a=0;a<this.events.length;a++)for(var b=this.events[a],c=this.eventElements[a];c;)b.run(c),c=c.parent;this.events=[],this.eventElements=[]}},f}var e,f=function(a,b,c){if(null!=a||null!=b||null!=c){"string"==typeof a&&(a=document.getElementById(a)),null!=a.svg&&a.svg.stop();var e=d(c||{});(1!=a.childNodes.length||"OBJECT"!=a.childNodes[0].nodeName)&&(a.svg=e);var g=a.getContext("2d");"undefined"!=typeof b.documentElement?e.loadXmlDoc(g,b):"<"==b.substr(0,1)?e.loadXml(g,b):e.load(g,b)}else for(var h=document.querySelectorAll("svg"),i=0;i<h.length;i++){var j=h[i],k=document.createElement("canvas");k.width=j.clientWidth,k.height=j.clientHeight,j.parentNode.insertBefore(k,j),j.parentNode.removeChild(j);var l=document.createElement("div");l.appendChild(j),f(k,l.innerHTML)}};"undefined"!=typeof Element.prototype.matches?e=function(a,b){return a.matches(b)}:"undefined"!=typeof Element.prototype.webkitMatchesSelector?e=function(a,b){return a.webkitMatchesSelector(b)}:"undefined"!=typeof Element.prototype.mozMatchesSelector?e=function(a,b){return a.mozMatchesSelector(b)}:"undefined"!=typeof Element.prototype.msMatchesSelector?e=function(a,b){return a.msMatchesSelector(b)}:"undefined"!=typeof Element.prototype.oMatchesSelector?e=function(a,b){return a.oMatchesSelector(b)}:(("function"==typeof jQuery||"function"==typeof Zepto)&&(e=function(a,b){return $(a).is(b)}),"undefined"==typeof e&&(e=Sizzle.matchesSelector));var g=/(\[[^\]]+\])/g,h=/(#[^\s\+>~\.\[:]+)/g,j=/(\.[^\s\+>~\.\[:]+)/g,k=/(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi,l=/(:[\w-]+\([^\)]*\))/gi,m=/(:[^\s\+>~\.\[:]+)/g,n=/([^\s\+>~\.\[:]+)/g;return"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.drawSvg=function(a,b,c,d,e){f(this.canvas,a,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:b,offsetY:c,scaleWidth:d,scaleHeight:e})}),f}),d("../bower_components/FileSaver.js/FileSaver",[],function(){return window.saveAs||"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(a){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var b=a.document,c=function(){return a.URL||a.webkitURL||a},d=b.createElementNS("http://www.w3.org/1999/xhtml","a"),e="download"in d,f=function(c){var d=b.createEvent("MouseEvents");d.initMouseEvent("click",!0,!1,a,0,0,0,0,0,!1,!1,!1,!1,0,null),c.dispatchEvent(d)},g=a.webkitRequestFileSystem,h=a.requestFileSystem||g||a.mozRequestFileSystem,i=function(b){(a.setImmediate||a.setTimeout)(function(){throw b},0)},j="application/octet-stream",k=0,l=500,m=function(b){var d=function(){"string"==typeof b?c().revokeObjectURL(b):b.remove()};a.chrome?d():setTimeout(d,l)},n=function(a,b,c){b=[].concat(b);for(var d=b.length;d--;){var e=a["on"+b[d]];if("function"==typeof e)try{e.call(a,c||a)}catch(f){i(f)}}},o=function(b,i){var l,o,p,q=this,r=b.type,s=!1,t=function(){n(q,"writestart progress write writeend".split(" "))},u=function(){if((s||!l)&&(l=c().createObjectURL(b)),o)o.location.href=l;else{var d=a.open(l,"_blank");void 0==d&&"undefined"!=typeof safari&&(a.location.href=l)}q.readyState=q.DONE,t(),m(l)},v=function(a){return function(){return q.readyState!==q.DONE?a.apply(this,arguments):void 0}},w={create:!0,exclusive:!1};return q.readyState=q.INIT,i||(i="download"),e?(l=c().createObjectURL(b),d.href=l,d.download=i,f(d),q.readyState=q.DONE,t(),void m(l)):(a.chrome&&r&&r!==j&&(p=b.slice||b.webkitSlice,b=p.call(b,0,b.size,j),s=!0),g&&"download"!==i&&(i+=".download"),(r===j||g)&&(o=a),h?(k+=b.size,void h(a.TEMPORARY,k,v(function(a){a.root.getDirectory("saved",w,v(function(a){var c=function(){a.getFile(i,w,v(function(a){a.createWriter(v(function(c){c.onwriteend=function(b){o.location.href=a.toURL(),q.readyState=q.DONE,n(q,"writeend",b),m(a)},c.onerror=function(){var a=c.error;a.code!==a.ABORT_ERR&&u()},"writestart progress write abort".split(" ").forEach(function(a){c["on"+a]=q["on"+a]}),c.write(b),q.abort=function(){c.abort(),q.readyState=q.DONE},q.readyState=q.WRITING}),u)}),u)};a.getFile(i,{create:!1},v(function(a){a.remove(),c()}),v(function(a){a.code===a.NOT_FOUND_ERR?c():u()}))}),u)}),u)):void u())},p=o.prototype,q=function(a,b){return new o(a,b)};return p.abort=function(){var a=this;a.readyState=a.DONE,n(a,"abort")},p.readyState=p.INIT=0,p.WRITING=1,p.DONE=2,p.error=p.onwritestart=p.onprogress=p.onwrite=p.onabort=p.onerror=p.onwriteend=null,q}}(window)}),function(){"use strict";function a(a){return"function"==typeof a||"object"==typeof a&&null!==a}function b(a){return"function"==typeof a}function c(a){return"object"==typeof a&&null!==a}function e(){}function f(){return function(){process.nextTick(j)}}function g(){var a=0,b=new M(j),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function h(){var a=new MessageChannel;return a.port1.onmessage=j,function(){a.port2.postMessage(0)}}function i(){return function(){setTimeout(j,1)}}function j(){for(var a=0;J>a;a+=2){var b=O[a],c=O[a+1];b(c),O[a]=void 0,O[a+1]=void 0}J=0}function k(){}function l(){return new TypeError("You cannot resolve a promise with itself")}function m(){return new TypeError("A promises callback cannot return that same promise.")}function n(a){try{return a.then}catch(b){return S.error=b,S}}function o(a,b,c,d){try{a.call(b,c,d)}catch(e){return e}}function p(a,b,c){K(function(a){var d=!1,e=o(c,b,function(c){d||(d=!0,b!==c?s(a,c):u(a,c))},function(b){d||(d=!0,v(a,b))},"Settle: "+(a._label||" unknown promise"));!d&&e&&(d=!0,v(a,e))},a)}function q(a,b){b._state===Q?u(a,b._result):a._state===R?v(a,b._result):w(b,void 0,function(b){s(a,b)},function(b){v(a,b)})}function r(a,c){if(c.constructor===a.constructor)q(a,c);else{var d=n(c);d===S?v(a,S.error):void 0===d?u(a,c):b(d)?p(a,c,d):u(a,c)}}function s(b,c){b===c?v(b,l()):a(c)?r(b,c):u(b,c)}function t(a){a._onerror&&a._onerror(a._result),x(a)}function u(a,b){a._state===P&&(a._result=b,a._state=Q,0===a._subscribers.length||K(x,a))}function v(a,b){a._state===P&&(a._state=R,a._result=b,K(t,a))}function w(a,b,c,d){var e=a._subscribers,f=e.length;a._onerror=null,e[f]=b,e[f+Q]=c,e[f+R]=d,0===f&&a._state&&K(x,a)}function x(a){var b=a._subscribers,c=a._state;if(0!==b.length){for(var d,e,f=a._result,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?A(c,d,e,f):e(f);a._subscribers.length=0}}function y(){this.error=null}function z(a,b){try{return a(b)}catch(c){return T.error=c,T}}function A(a,c,d,e){var f,g,h,i,j=b(d);if(j){if(f=z(d,e),f===T?(i=!0,g=f.error,f=null):h=!0,c===f)return void v(c,m())}else f=e,h=!0;c._state!==P||(j&&h?s(c,f):i?v(c,g):a===Q?u(c,f):a===R&&v(c,f))}function B(a,b){try{b(function(b){s(a,b)},function(b){v(a,b)})}catch(c){v(a,c)}}function C(a,b,c,d){this._instanceConstructor=a,this.promise=new a(k,d),this._abortOnReject=c,this._validateInput(b)?(this._input=b,this.length=b.length,this._remaining=b.length,this._init(),0===this.length?u(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&u(this.promise,this._result))):v(this.promise,this._validationError())}function D(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function E(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function F(a){this._id=Z++,this._state=void 0,this._result=void 0,this._subscribers=[],k!==a&&(b(a)||D(),this instanceof F||E(),B(this,a))}var G;G=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)};var H,I=G,J=(Date.now||function(){return(new Date).getTime()},Object.create||function(a){if(arguments.length>1)throw new Error("Second argument not supported");if("object"!=typeof a)throw new TypeError("Argument must be an object");return e.prototype=a,new e},0),K=function(a,b){O[J]=a,O[J+1]=b,J+=2,2===J&&H()},L="undefined"!=typeof window?window:{},M=L.MutationObserver||L.WebKitMutationObserver,N="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,O=new Array(1e3);H="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)?f():M?g():N?h():i();var P=void 0,Q=1,R=2,S=new y,T=new y;C.prototype._validateInput=function(a){return I(a)},C.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},C.prototype._init=function(){this._result=new Array(this.length)};var U=C;C.prototype._enumerate=function(){for(var a=this.length,b=this.promise,c=this._input,d=0;b._state===P&&a>d;d++)this._eachEntry(c[d],d)},C.prototype._eachEntry=function(a,b){var d=this._instanceConstructor;c(a)?a.constructor===d&&a._state!==P?(a._onerror=null,this._settledAt(a._state,b,a._result)):this._willSettleAt(d.resolve(a),b):(this._remaining--,this._result[b]=this._makeResult(Q,b,a))},C.prototype._settledAt=function(a,b,c){var d=this.promise;d._state===P&&(this._remaining--,this._abortOnReject&&a===R?v(d,c):this._result[b]=this._makeResult(a,b,c)),0===this._remaining&&u(d,this._result)},C.prototype._makeResult=function(a,b,c){return c},C.prototype._willSettleAt=function(a,b){var c=this;w(a,void 0,function(a){c._settledAt(Q,b,a)},function(a){c._settledAt(R,b,a)})};var V=function(a,b){return new U(this,a,!0,b).promise},W=function(a,b){function c(a){s(f,a)}function d(a){v(f,a)}var e=this,f=new e(k,b);if(!I(a))return v(f,new TypeError("You must pass an array to race.")),f;for(var g=a.length,h=0;f._state===P&&g>h;h++)w(e.resolve(a[h]),void 0,c,d);return f},X=function(a,b){var c=this;if(a&&"object"==typeof a&&a.constructor===c)return a;var d=new c(k,b);return s(d,a),d},Y=function(a,b){var c=this,d=new c(k,b);return v(d,a),d},Z=0,$=F;F.all=V,F.race=W,F.resolve=X,F.reject=Y,F.prototype={constructor:F,then:function(a,b){var c=this,d=c._state;if(d===Q&&!a||d===R&&!b)return this;var e=new this.constructor(k),f=c._result;if(d){var g=arguments[d-1];K(function(){A(d,e,g,f)})}else w(c,e,a,b);return e},"catch":function(a){return this.then(null,a)}};var _=function(){var a;a="undefined"!=typeof global?global:"undefined"!=typeof window&&window.document?window:self;var c="Promise"in a&&"resolve"in a.Promise&&"reject"in a.Promise&&"all"in a.Promise&&"race"in a.Promise&&function(){var c;return new a.Promise(function(a){c=a}),b(c)}();c||(a.Promise=$)},aa={Promise:$,polyfill:_};"function"==typeof d&&d.amd?d("../bower_components/es6-promise/promise",[],function(){return aa}):"undefined"!=typeof module&&module.exports?module.exports=aa:"undefined"!=typeof this&&(this.ES6Promise=aa)}.call(this),d("../node_modules/requirejs-text/text",["module"],function(a){"use strict";var b,d,e,f,g,h=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],i=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,j=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,k="undefined"!=typeof location&&location.href,l=k&&location.protocol&&location.protocol.replace(/\:/,""),m=k&&location.hostname,n=k&&(location.port||void 0),o={},p=a.config&&a.config()||{};return b={version:"2.0.12",strip:function(a){if(a){a=a.replace(i,"");var b=a.match(j);b&&(a=b[1])}else a="";return a},jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:p.createXhr||function(){var a,b,c;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(b=0;3>b;b+=1){c=h[b];try{a=new ActiveXObject(c)}catch(d){}if(a){h=[c];break}}return a},parseName:function(a){var b,c,d,e=!1,f=a.indexOf("."),g=0===a.indexOf("./")||0===a.indexOf("../");return-1!==f&&(!g||f>1)?(b=a.substring(0,f),c=a.substring(f+1,a.length)):b=a,d=c||b,f=d.indexOf("!"),-1!==f&&(e="strip"===d.substring(f+1),d=d.substring(0,f),c?c=d:b=d),{moduleName:b,ext:c,strip:e}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,c,d,e){var f,g,h,i=b.xdRegExp.exec(a);return i?(f=i[2],g=i[3],g=g.split(":"),h=g[1],g=g[0],!(f&&f!==c||g&&g.toLowerCase()!==d.toLowerCase()||(h||g)&&h!==e)):!0},finishLoad:function(a,c,d,e){d=c?b.strip(d):d,p.isBuild&&(o[a]=d),e(d)},load:function(a,c,d,e){if(e&&e.isBuild&&!e.inlineText)return void d();p.isBuild=e&&e.isBuild;var f=b.parseName(a),g=f.moduleName+(f.ext?"."+f.ext:""),h=c.toUrl(g),i=p.useXhr||b.useXhr;return 0===h.indexOf("empty:")?void d():void(!k||i(h,l,m,n)?b.get(h,function(c){b.finishLoad(a,f.strip,c,d)},function(a){d.error&&d.error(a)}):c([g],function(a){b.finishLoad(f.moduleName+"."+f.ext,f.strip,a,d)}))},write:function(a,c,d,e){if(o.hasOwnProperty(c)){var f=b.jsEscape(o[c]);d.asModule(a+"!"+c,"define(function () { return '"+f+"';});\n")}},writeFile:function(a,c,d,e,f){var g=b.parseName(c),h=g.ext?"."+g.ext:"",i=g.moduleName+h,j=d.toUrl(g.moduleName+h)+".js";b.load(i,d,function(c){var d=function(a){return e(j,a)};d.asModule=function(a,b){return e.asModule(a,j,b)},b.write(a,i,d,f)},f)}},"node"===p.env||!p.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(d=c.nodeRequire("fs"),b.get=function(a,b,c){try{var e=d.readFileSync(a,"utf8");0===e.indexOf("\ufeff")&&(e=e.substring(1)),b(e)}catch(f){c&&c(f)}}):"xhr"===p.env||!p.env&&b.createXhr()?b.get=function(a,c,d,e){var f,g=b.createXhr();if(g.open("GET",a,!0),e)for(f in e)e.hasOwnProperty(f)&&g.setRequestHeader(f.toLowerCase(),e[f]);p.onXhr&&p.onXhr(g,a),g.onreadystatechange=function(b){var e,f;4===g.readyState&&(e=g.status||0,e>399&&600>e?(f=new Error(a+" HTTP status: "+e),f.xhr=g,d&&d(f)):c(g.responseText),p.onXhrComplete&&p.onXhrComplete(g,a))},g.send(null)}:"rhino"===p.env||!p.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?b.get=function(a,b){var c,d,e="utf-8",f=new java.io.File(a),g=java.lang.System.getProperty("line.separator"),h=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(f),e)),i="";try{for(c=new java.lang.StringBuffer,d=h.readLine(),d&&d.length()&&65279===d.charAt(0)&&(d=d.substring(1)),null!==d&&c.append(d);null!==(d=h.readLine());)c.append(g),c.append(d);i=String(c.toString())}finally{h.close()}b(i)}:("xpconnect"===p.env||!p.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(e=Components.classes,f=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),g="@mozilla.org/windows-registry-key;1"in e,b.get=function(a,b){var c,d,h,i={};g&&(a=a.replace(/\//g,"\\")),h=new FileUtils.File(a);try{c=e["@mozilla.org/network/file-input-stream;1"].createInstance(f.nsIFileInputStream),c.init(h,1,0,!1),d=e["@mozilla.org/intl/converter-input-stream;1"].createInstance(f.nsIConverterInputStream),d.init(c,"utf-8",c.available(),f.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),d.readString(c.available(),i),d.close(),c.close(),b(i.value)}catch(j){throw new Error((h&&h.path||"")+": "+j)}}),b}),d("../node_modules/requirejs-text/text!print.style.css",[],function(){return"body > * {\r\n visibility: hidden;\r\n}\r\nbody {\r\n overflow: hidden;\r\n}\r\nbody * {\r\n visibility: hidden !important;\r\n}\r\n\r\n.graphical-report__print-block {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n visibility: visible !important;\r\n display: block !important;\r\n width: 100%;\r\n /*height: 100%;*/\r\n}\r\n"}),function(){"use strict";function a(b){this.map={};var c=this;b instanceof a?b.forEach(function(a,b){b.forEach(function(b){c.append(a,b)})}):b&&Object.getOwnPropertyNames(b).forEach(function(a){c.append(a,b[a])})}function b(a){return a.bodyUsed?Promise.reject(new TypeError("Already read")):void(a.bodyUsed=!0)}function c(a){return new Promise(function(b,c){a.onload=function(){b(a.result)},a.onerror=function(){c(a.error)}})}function d(a){var b=new FileReader;return b.readAsArrayBuffer(a),c(b)}function e(a){var b=new FileReader;return b.readAsText(a),c(b)}function f(){return this.bodyUsed=!1,l?(this.blob=function(){var a=b(this);return a?a:Promise.resolve(this._bodyBlob)},this.arrayBuffer=function(){return this.blob().then(d)},this.text=function(){return this.blob().then(e)}):this.text=function(){var a=b(this);return a?a:Promise.resolve(this._bodyText)},"FormData"in self&&(this.formData=function(){return this.text().then(i)}),this.json=function(){return this.text().then(JSON.parse)},this}function g(a){var b=a.toUpperCase();return m.indexOf(b)>-1?b:a}function h(b,c){c=c||{},this.url=b,this._body=c.body,this.credentials=c.credentials||"omit",this.headers=new a(c.headers),this.method=g(c.method||"GET"),this.mode=c.mode||null,this.referrer=null}function i(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function j(b){var c=new a,d=b.getAllResponseHeaders().trim().split("\n");return d.forEach(function(a){var b=a.trim().split(":"),d=b.shift().trim(),e=b.join(":").trim();c.append(d,e)}),c}function k(a,b){b||(b={}),l?"string"==typeof a?this._bodyBlob=new Blob([a]):this._bodyBlob=a:this._bodyText=a,this.type="default",this.url=null,this.status=b.status,this.statusText=b.statusText,this.headers=b.headers,this.url=b.url||""}if(!self.fetch){a.prototype.append=function(a,b){a=a.toLowerCase();var c=this.map[a];c||(c=[],this.map[a]=c),c.push(b)},a.prototype["delete"]=function(a){delete this.map[a.toLowerCase()]},a.prototype.get=function(a){var b=this.map[a.toLowerCase()];return b?b[0]:null},a.prototype.getAll=function(a){return this.map[a.toLowerCase()]||[]},a.prototype.has=function(a){return this.map.hasOwnProperty(a.toLowerCase())},a.prototype.set=function(a,b){this.map[a.toLowerCase()]=[b]},a.prototype.forEach=function(a){var b=this;Object.getOwnPropertyNames(this.map).forEach(function(c){a(c,b.map[c])})};var l="FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(a){return!1}}(),m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.fetch=function(){var a=this;return new Promise(function(b,c){function d(){return"responseURL"in e?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):void 0}var e=new XMLHttpRequest;e.onload=function(){var a=1223===e.status?204:e.status;if(100>a||a>599)return void c(new TypeError("Network request failed"));var f={status:a,statusText:e.statusText,headers:j(e),url:d()},g="response"in e?e.response:e.responseText;b(new k(g,f))},e.onerror=function(){c(new TypeError("Network request failed"))},e.open(a.method,a.url),"responseType"in e&&l&&(e.responseType="blob"),a.headers.forEach(function(a,b){b.forEach(function(b){e.setRequestHeader(a,b)})}),e.send(void 0===a._body?null:a._body)})},f.call(h.prototype),f.call(k.prototype),self.Headers=a,self.Request=h,self.Response=k,self.fetch=function(a,b){return new h(a,b).fetch()},self.fetch.polyfill=!0}}(),d("../bower_components/fetch/fetch",function(){}),function(a){"function"==typeof d&&d.amd?d("export",["tauCharts","canvgModule","FileSaver","promise","print.style.css","fetch"],function(b,c,d,e,f){return window.Promise=window.Promise||e.Promise,a(b,c,d,window.Promise,f)}):a(this.tauCharts,this.canvg,this.saveAs)}(function(a,b,c,d,e){function f(a){return Math.log(a)/Math.LN10}function g(e){return{onRender:function(){this._info=k.extractFieldsFormatInfo(this._chart.getSpec())},_normalizeExportFields:function(a){var b=this._info;return a.map(function(a){var c=a;return j.isString(a)&&(c={field:a,title:b[a].label}),j.isFunction(c.value)||(c.value=function(a){return a[this.field]}),c})},_createDataUrl:function(a){var c=this._cssPaths.map(function(a){return fetch(a).then(function(a){return a.text()})});return d.all(c).then(function(a){return a.join(" ")}).then(function(c){var d=p(c),e=document.createElement("div"),f=a.getSVG().cloneNode(!0);e.appendChild(f),i.select(f).attr("version",1.1).attr("xmlns","http://www.w3.org/2000/svg"),f.insertBefore(d,f.firstChild),this._renderAdditionalInfo(f,a);var g=document.createElement("canvas");return g.height=f.getAttribute("height"),g.width=f.getAttribute("width"),b(g,f.parentNode.innerHTML),g.toDataURL("image/png")}.bind(this))},_findUnit:function(a){var b=a.getConfig(),c=a.getConfig(),d=function(a){var b=c.scales[a];return b&&b.dim&&b.source&&c.sources[b.source].dims[b.dim]};return k.depthFirstSearch(b.unit,function(a){if(d(a.color))return!0;if(d(a.size)){var b=c.scales[a.size];return"measure"===c.sources[b.source].dims[b.dim].type}})},_toPng:function(a){this._createDataUrl(a).then(function(a){for(var b=atob(a.substring("data:image/png;base64,".length)),d=new Uint8Array(b.length),e=0,f=b.length;f>e;++e)d[e]=b.charCodeAt(e);var g=new Blob([d.buffer],{type:"image/png"});c(g,(this._fileName||"export")+".png")}.bind(this))},_toPrint:function(a){this._createDataUrl(a).then(function(a){h=document.createElement("img"),h.classList.add("graphical-report__print-block");var b=h;document.body.appendChild(b),b.src=a,document.head.appendChild(q),b.onload=function(){window.print()}})}, _toJson:function(a){for(var b=this._exportFields,d=a.getSpec(),e=d.sources["/"],f=b.length?b:Object.keys(e.dims),g=this._normalizeExportFields(f.concat(this._appendFields)),h=e.data.map(function(a){return g.reduce(function(b,c){return b[c.title]=c.value(a),b},{})}),i=JSON.stringify(h,null,2),j=new Uint8Array(i.length),k=0,l=i.length;l>k;++k)j[k]=i.charCodeAt(k);var m=new Blob([j.buffer],{type:"application/json"});c(m,(this._fileName||"export")+".json")},_toCsv:function(a){for(var b=this._csvSeparator,d=this._exportFields,e=a.getSpec(),f=e.sources["/"],g=f.data,h=d.length?d:Object.keys(f.dims),i=this._normalizeExportFields(h.concat(this._appendFields)),j=g.reduce(function(a,c){return a.concat(i.reduce(function(a,b){var d=l(JSON.stringify(b.value(c)),'"');return a.concat(d)},[]).join(b))},[i.map(function(a){return a.title}).join(b)]).join("\r\n"),k=new Uint8Array(j.length),m=0,n=j.length;n>m;++m)k[m]=j.charCodeAt(m);var o=new Blob([k.buffer],{type:"text/csv"});c(o,(this._fileName||"export")+".csv")},_renderColorLegend:function(a,b,c,d){var f=this._unit.color,g=this._unit.color.dim;a.guide=a.guide||{},a.guide.color=a.guide.color||{};var h=j.isObject(a.guide.color.label)?a.guide.color.label.text:a.guide.color.label,i=h||f.dim,k=this._getColorMap(c.getData({excludeFilter:["legend"]}),f,g).values,l=function(){this.attr("transform",function(a,b){return"translate(5,"+20*(b+1)+")"}),this.append("circle").attr("r",6).attr("class",function(a){return a.color}),this.append("text").attr("x",12).attr("y",5).text(function(a){return j.escape(n(a.label)?"No "+i:a.label)}).style({"font-size":e.fontSize+"px"})},m=b.append("g").attr("class","legend").attr("transform","translate("+(d+10)+","+e.paddingTop+")");return m.append("text").text(i.toUpperCase()).style({"text-transform":"uppercase","font-weight":"600","font-size":e.fontSize+"px"}),m.selectAll("g").data(k).enter().append("g").call(l),{h:20*k.length+20,w:0}},_renderSizeLegend:function(a,b,c,d,g){var h=this._unit.size,i=this._unit.size.scaleDim;a.guide=a.guide||{},a.guide.size=this._unit.config.guide.size;var k,l=a.guide.size.label.text||i,n=j.sortBy(c.getData(),function(a){return h(a[i])}),o=n.length,p=n[0][i],q=n[o-1][i];if(q-p){var r=f(q-p),s=0>4-r?0:Math.round(4-r),t=Math.pow(10,s),u=(q-p)/5;k=j([p,p+u,p+2*u,p+3*u,q]).chain().map(function(a){return a===q||a===p?a:Math.round(a*t)/t}).unique().value()}else k=[p];var v=k.map(function(b){var c=h(b);return{diameter:m(2*c+2),radius:c,value:b,className:a.color?"color-definite":""}}.bind(this)).reverse(),w=Math.max.apply(null,j.pluck(v,"diameter")),x=e.fontSize,y=0,z=function(){this.attr("transform",function(a){y+=w;var b="translate(5,"+y+")";return y+=10,b}),this.append("circle").attr("r",function(a){return a.radius}).attr("class",function(a){return a.className}).style({opacity:.4}),this.append("g").attr("transform",function(a){return"translate("+w+","+x/2+")"}).append("text").attr("x",function(a){return 0}).attr("y",function(a){return 0}).text(function(a){return a.value}).style({"font-size":x+"px"})},A=b.append("g").attr("class","legend").attr("transform","translate("+(d+10)+","+(e.paddingTop+g.h+20)+")");A.append("text").text(l.toUpperCase()).style({"text-transform":"uppercase","font-weight":"600","font-size":x+"px"}),A.selectAll("g").data(v).enter().append("g").call(z)},_renderAdditionalInfo:function(a,b){var c=this._findUnit(b);if(c){var d={h:0,w:0},e=b.getConfig();a=i.select(a);var f=parseInt(a.attr("width"),10);a.attr("height");a.attr("width",f+160);var g=function(a){var b=e.scales[a];return b&&b.dim&&b.source&&e.sources[b.source].dims[b.dim]};if(g(c.color)){var h=this._renderColorLegend(c,a,b,f);d.h=h.h,d.w=h.w}var e=b.getConfig(),j=e.scales[c.size];c.size&&j.dim&&"measure"===e.sources[j.source].dims[j.dim].type&&this._renderSizeLegend(c,a,b,f,d)}},onUnitDraw:function(b,c){a.api.isChartElement(c)&&(this._unit=c)},_getColorMap:function(a,b,c){return j(a).chain().map(function(a){var d=a[c];return{color:b(d),value:d,label:d}}).uniq(function(a){return a.value}).value().reduce(function(a,b){return a.brewer[b.value]=b.color,a.values.push(b),a},{brewer:{},values:[]})},_select:function(a,b){a=a||"";var c=this["_to"+a.charAt(0).toUpperCase()+a.slice(1)];c&&c.call(this,b)},_handleMenu:function(a,b,c){a.addEventListener("click",function(a){if("a"===a.target.tagName.toLowerCase()){var d=a.target.getAttribute("data-value");this._select(d,b),c.hide()}}.bind(this)),a.addEventListener("mouseover",function(a){"a"===a.target.tagName.toLowerCase()&&a.target.focus()}.bind(this)),a.addEventListener("keydown",function(a){if(a.keyCode===o.ESCAPE&&c.hide(),a.keyCode===o.DOWN&&(a.target.parentNode.nextSibling?a.target.parentNode.nextSibling.childNodes[0].focus():a.target.parentNode.parentNode.firstChild.childNodes[0].focus()),a.keyCode===o.UP&&(a.target.parentNode.previousSibling?a.target.parentNode.previousSibling.childNodes[0].focus():a.target.parentNode.parentNode.lastChild.childNodes[0].focus()),a.keyCode===o.ENTER){var d=a.target.getAttribute("data-value");this._select(d,b)}a.preventDefault()}.bind(this));var d=null,e=u(),f=e?"focusin":"focus",g=e?"focusout":"blur";a.addEventListener(g,function(){d=setTimeout(function(){c.hide()},100)},!e),a.addEventListener(f,function(){clearTimeout(d)},!e),this._container.addEventListener("click",function(){c.toggle(),c.hidden||a.querySelectorAll("a")[0].focus()})},init:function(b){e=e||{},this._chart=b,this._info={},this._cssPaths=e.cssPaths,this._fileName=e.fileName,this._csvSeparator=e.csvSeparator||",",this._exportFields=e.exportFields||[],this._appendFields=e.appendFields||[],this._cssPaths||(this._cssPaths=[],a.api.globalSettings.log('[export plugin]: the "cssPath" parameter should be specified for correct operation',"warn")),e=j.defaults(e,{visible:!0,fontSize:13,paddingTop:30});var c=e.visible?"":"display:none";this._container=b.insertToHeader('<a class="graphical-report__export" style="'+c+'">Export</a>');var d=b.addBalloon({place:"bottom-left"});this._popup=d,d.content(['<ul class="graphical-report__export__list">','<li class="graphical-report__export__item"><a href="#" data-value="print" tabindex="1">Print</a></li>','<li class="graphical-report__export__item"><a href="#" data-value="png" tabindex="2">Export to png</a></li>','<li class="graphical-report__export__item"><a href="#" data-value="csv" tabindex="2">Export to CSV</a></li>','<li class="graphical-report__export__item"><a href="#" data-value="json" tabindex="2">Export to JSON</a></li>',"</ul>"].join("")),d.attach(this._container);var f=d.getElement();f.setAttribute("tabindex","-1"),this._handleMenu(f,b,d),b.on("exportTo",function(a,b){this._select(b,a)}.bind(this))},destroy:function(){this._popup&&this._popup.destroy()}}}var h,i=a.api.d3,j=a.api._,k=a.api.pluginsSDK,l=function(a,b){return a.replace(new RegExp("^"+b+"+|"+b+"+$","g"),"")},m=function(a){return a=Math.round(a),a%2?a+1:a},n=function(a){return null===a||""===a||"undefined"==typeof a},o={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},p=function(a,b){b=b||"all";var c=document.createElement("style");return c.setAttribute("media",b),c.innerHTML=a,c},q=p(e,"print"),r=function(){q&&q.parentNode&&q.parentNode.removeChild(q),h&&h.parentNode&&h.parentNode.removeChild(h)},s=/PhantomJS/.test(navigator.userAgent);s||("onafterprint"in window?window.addEventListener("afterprint",r):window.matchMedia("screen").addListener(function(a){a.matches&&r()}));var t,u=function(){function a(){b=!0}if(t)return t;var b=!1,c=document.createElement("a");return c.href="#",c.addEventListener("focusin",a,!1),document.body.appendChild(c),c.focus(),document.body.removeChild(c),t=b,b};return a.api.plugins.add("exportTo",g),g}),d("tauCharts",function(){return a}),c.config({paths:{canvgModule:"../bower_components/canvg/canvg"},map:{"*":{FileSaver:"../bower_components/FileSaver.js/FileSaver",rgbcolor:"../bower_components/canvg/rgbcolor",stackblur:"../bower_components/canvg/StackBlur",fetch:"../bower_components/fetch/fetch",promise:"../bower_components/es6-promise/promise","print.style.css":"../node_modules/requirejs-text/text!print.style.css"}}}),c("export")}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){function b(a){var b=(c.defaults(a||{},{}),function(a){return Math.log(a)/Math.LN10}),d=function(a){return a=Math.round(a),a%2?a+1:a},e=function(a){return null===a||""===a||"undefined"==typeof a},f=function(a,b){return function(c){var d=c[a],f=JSON.stringify(e(d)?null:d);return b===f}},g=function(a,b,c,d){a.addEventListener(b,function(a){for(var b=a.target;b!==a.currentTarget&&null!==b;)b.classList.contains(c)&&d(a,b),b=b.parentNode})},h={init:function(a){this._chart=a,this._currentFilters={},this._legendColorByScaleId={};var b=this._chart.getSpec(),c=function(a){return function(c,d){var e=b.scales[d];return e.type===a&&e.dim&&c.push(d),c}};this._color=Object.keys(b.scales).reduce(c("color"),[]),this._fill=Object.keys(b.scales).reduce(c("fill"),[]),this._size=Object.keys(b.scales).reduce(c("size"),[]);var d=this._color.length>0,e=this._fill.length>0,f=this._size.length>0;(d||e||f)&&(this._container=this._chart.insertToRightSidebar(this._containerTemplate),d&&(g(this._container,"click","graphical-report__legend__item-color",function(a,b){this._toggleLegendItem(b)}.bind(this)),g(this._container,"mouseover","graphical-report__legend__item-color",function(a,b){this._highlightToggle(b,!0)}.bind(this)),g(this._container,"mouseout","graphical-report__legend__item-color",function(a,b){this._highlightToggle(b,!1)}.bind(this))))},onSpecReady:function(){this._assignStaticBrewersOrEx()},onRender:function(){this._clearPanel(),this._drawColorLegend(),this._drawSizeLegend()},_containerTemplate:'<div class="graphical-report__legend"></div>',_template:c.template('<div class="graphical-report__legend"><div class="graphical-report__legend__title"><%=name%></div><%=items%></div>'),_itemTemplate:c.template(["<div data-scale-id='<%= scaleId %>' data-dim='<%= dim %>' data-value='<%= value %>' class=\"graphical-report__legend__item graphical-report__legend__item-color <%=classDisabled%>\">",'<div class="graphical-report__legend__guide__wrap">','<div class="graphical-report__legend__guide <%=color%>"></div>',"</div>","<%=label%>","</div>"].join("")),_itemFillTemplate:c.template(['<div data-value=\'<%=value%>\' class="graphical-report__legend__item graphical-report__legend__item-color" style="padding: 6px 0px 10px 40px;margin-left:10px;">','<div class="graphical-report__legend__guide__wrap" style="top:0;left:0;">',' <span class="graphical-report__legend__guide" style="background-color:<%=color%>;border-radius:0"></span>',' <span style="padding-left: 20px"><%=label%></span>',"</div>","</div>"].join("")),_itemSizeTemplate:c.template(['<div class="graphical-report__legend__item graphical-report__legend__item--size">','<div class="graphical-report__legend__guide__wrap">','<svg class="graphical-report__legend__guide graphical-report__legend__guide--size <%=className%>" style="width: <%=diameter%>px;height: <%=diameter%>px;"><circle cx="<%=radius%>" cy="<%=radius%>" class="graphical-report__dot" r="<%=radius%>"></circle></svg>',"</div><%=value%>","</div>"].join("")),_clearPanel:function(){this._container&&(this._container.innerHTML="")},_drawSizeLegend:function(){var a=this;a._size.forEach(function(e){var f=a._chart.select(function(a){return a.config.size===e})[0];if(f){var g=f.config.guide||{},h=f.getScale("size"),i=h.domain(),j=((g.size||{}).label||{}).text||h.dim,k=i[0],l=i[i.length-1],m=[k];if(l-k){var n=b(l-k),o=Math.round(4-n),p=Math.pow(10,o),q=(l-k)/5,r=[k,k+q,k+2*q,k+3*q,l];m=c(r).chain().map(function(a){return a===l||a===k?a:Math.round(a*p)/p}).unique().value()}a._container.insertAdjacentHTML("beforeend",a._template({name:j,items:m.map(function(b){var c=h(b);return a._itemSizeTemplate({diameter:d(2*c+2),radius:c,value:b,className:f.config.color?"color-definite":"color-default-size"})}).reverse().join("")}))}})},_drawColorLegend:function(){var a=this;a._color.forEach(function(b){var d=a._chart.select(function(a){return a.config.color===b})[0];if(d){var f=d.config.guide||{},g=d.getScale("color"),h=a._chart.getDataSources({excludeFilter:["legend"]}),i=c(h[g.source].data).chain().pluck(g.dim).uniq().value(),j=a._chart.getSpec().scales[b];j.order&&(i=c.union(c.intersection(j.order,i),i));var k=((f.color||{}).label||{}).text||g.dim,l=(f.color||{}).tickFormatNullAlias||"No "+k,m=i.map(function(c){var d=JSON.stringify(e(c)?null:c),f=g.dim+d;return{scaleId:b,dim:g.dim,color:g(c),disabled:a._currentFilters.hasOwnProperty(f),label:c,value:d}});a._legendColorByScaleId[b]=m,a._container.insertAdjacentHTML("beforeend",a._template({name:k,items:m.map(function(b){return a._itemTemplate({scaleId:b.scaleId,dim:c.escape(b.dim),color:b.color,classDisabled:b.disabled?"disabled":"",label:c.escape(e(b.label)?l:b.label),value:c.escape(b.value)})}).join("")}))}})},_toggleLegendItem:function(a){var b=a.getAttribute("data-scale-id"),c=a.getAttribute("data-dim"),d=a.getAttribute("data-value"),e=c+d,g=this._legendColorByScaleId[b],h=g.filter(function(a){return!a.disabled});if(1!==h.length||b!==h[0].scaleId||d!==h[0].value){var i=this._currentFilters;if(i.hasOwnProperty(e)){var j=i[e];delete i[e],a.classList.remove("disabled"),this._chart.removeFilter(j)}else{a.classList.add("disabled");var k=f(c,d);i[e]=this._chart.addFilter({tag:"legend",predicate:function(a){return!k(a)}})}this._chart.refresh()}},_highlightToggle:function(a,b){if(!a.classList.contains("disabled")){var c=a.getAttribute("data-scale-id"),d=a.getAttribute("data-dim"),e=a.getAttribute("data-value"),g=b?f(d,e):function(a){return null};this._chart.select(function(a){return a.config.color===c}).forEach(function(a){a.fire("highlight",g)})}},_generateColorMap:function(a){var b=20,d=c.times(b,function(a){return"color20-"+(1+a)});return a.reduce(function(a,c,e){return a[c]=d[e%b],a},{})},_assignStaticBrewersOrEx:function(){var a=this;a._color.forEach(function(b){var c=a._chart.getSpec().scales[b],d=a._chart.getDataSources({excludeFilter:["legend"]}),e=a._chart.getScaleFactory(d).createScaleInfoByName(b).domain();c.brewer||(c.brewer=a._generateColorMap(e))})}};return h}var c=a.api._;return a.api.plugins.add("legend",b),b}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){function b(a){function b(a){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,f=window.pageXOffset||d.scrollLeft||c.scrollLeft,g=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-g,j=b.left+f-h;return{top:Math.round(i),left:Math.round(j)}}var e=c.defaults(a||{},{fields:null,dockToData:!1,aggregationGroupFields:[],onRevealAggregation:function(a,b){console.log("Setup [onRevealAggregation] callback and filter original data by the following criteria: ",JSON.stringify(a,null,2))}}),f={init:function(a){this._currentData=null,this._currentUnit=null,this._chart=a,this._metaInfo={},this._skipInfo={},c.extend(this,c.omit(e,"fields","getFields")),this._tooltip=this._chart.addBalloon({spacing:3,auto:!0,effectClass:"fade"});var b=e.aggregationGroupFields.length>0?this.templateRevealAggregation:"",d=c.template(this.template);this._tooltip.content(d({revealTemplate:b,excludeTemplate:this.templateExclude})),this._tooltip.getElement().addEventListener("click",function(a){for(var b=a.target;b!==a.currentTarget&&null!==b;)b.classList.contains("i-role-exclude")&&g._exclude(),b.classList.contains("i-role-reveal")&&g._reveal(),b=b.parentNode;g._tooltip.hide()},!1);var f,g=this;this.showTooltip=function(a,b){clearTimeout(f),g._currentData=a;var d=g._tooltip.getElement().querySelectorAll(".i-role-content");if(d[0]){var h=e.fields||c.isFunction(e.getFields)&&e.getFields(g._chart)||Object.keys(a);d[0].innerHTML=this.render(a,h)}g._tooltip.show(b.x,b.y).updateSize()},this.hideTooltip=function(a){f=setTimeout(function(){g._tooltip.hide(),g._removeFocus()},300)},this._tooltip.getElement().addEventListener("mouseover",function(a){clearTimeout(f),g._accentFocus()},!1),this._tooltip.getElement().addEventListener("mouseleave",function(a){g._tooltip.hide(),g._removeFocus()},!1),this.afterInit(this._tooltip.getElement())},destroy:function(){this._removeFocus(),this._tooltip.destroy()},afterInit:function(a){},render:function(a,b){var c=this;return b.filter(function(a){var b=a.split("."),d=2===b.length&&c._skipInfo[b[0]];return!d}).map(function(b){var d=b,e=a[b];return c.renderItem(c._getLabel(d),c._getFormat(d)(e),d,e)}).join("")},renderItem:function(a,b,c,d){return this.itemTemplate({label:a,value:b})},_getFormat:function(a){var b=this._metaInfo[a]||{format:c.identity};return b.format},_getLabel:function(a){var b=this._metaInfo[a]||{label:a};return b.label},_appendFocus:function(a,b,c){return this.circle&&this.circle.remove(),this.circle=d3.select(a).append("circle").attr({r:0,cx:b,cy:c}),this.circle},_removeFocus:function(){return this.circle&&this.circle.remove(),this._currentUnit&&this._currentUnit.fire("highlight-data-points",function(a){return!1}),this},_accentFocus:function(){var a=this;return a._currentUnit&&a._currentData&&a._currentUnit.fire("highlight-data-points",function(b){return b===a._currentData}),this},_reveal:function(){var a=this._currentData,b=e.aggregationGroupFields||[],c=b.reduce(function(b,c){return a.hasOwnProperty(c)&&(b[c]=a[c]),b},{});e.onRevealAggregation(c,a)},_exclude:function(){this._chart.addFilter({tag:"exclude",predicate:function(a){return function(b){return JSON.stringify(b)!==JSON.stringify(a)}}(this._currentData)}),this._chart.refresh()},onRender:function(){var a=this._getFormatters();this._metaInfo=a.meta,this._skipInfo=a.skip,this._subscribeToHover()},templateRevealAggregation:['<div class="i-role-reveal graphical-report__tooltip__vertical">',' <div class="graphical-report__tooltip__vertical__wrap">'," Reveal"," </div>","</div>"].join(""),templateExclude:['<div class="i-role-exclude graphical-report__tooltip__exclude">',' <div class="graphical-report__tooltip__exclude__wrap">',' <span class="tau-icon-close-gray"></span>'," Exclude"," </div>","</div>"].join(""),template:['<div class="i-role-content graphical-report__tooltip__content"></div>',"<%= revealTemplate %>","<%= excludeTemplate %>"].join(""),itemTemplate:c.template(['<div class="graphical-report__tooltip__list__item">','<div class="graphical-report__tooltip__list__elem"><%=label%></div>','<div class="graphical-report__tooltip__list__elem"><%=value%></div>',"</div>"].join("")),_subscribeToHover:function(){var a=this;this._chart.select(function(a){return!0}).forEach(function(b){b.on("mouseout.chart",function(b,c){a.hideTooltip(c)});var c=function(b,c){var d=c.data,f=e.dockToData?a._getNearestDataCoordinates(b,c):a._getMouseCoordinates(b,c);a._currentUnit=b,a.showTooltip(d,{x:f.left,y:f.top})};b.on("mouseover.chart",c),("ELEMENT.AREA"===b.config.type||"ELEMENT.PATH"===b.config.type)&&b.on("mousemove.chart",c)})},_getNearestDataCoordinates:function(a,c){var d,e,f=c.data,g=a.getScale("x"),h=a.getScale("y");if("ELEMENT.INTERVAL.STACKED"===a.config.type){var i=c.event.chartElementViewModel;d=g(i.x),e=h(i.y)}else d=g(f[g.dim]),e=h(f[h.dim]);var j=c.event.target.parentNode,k=this._appendFocus(j,d,e);return b(k.node())},_getMouseCoordinates:function(a,b){var c=b.event.pageX,d=b.event.pageY;return{left:c,top:d}},_getFormatters:function(){var a=d.extractFieldsFormatInfo(this._chart.getSpec()),b={};return Object.keys(a).forEach(function(c){a[c].isComplexField&&(b[c]=!0),a[c].parentField&&delete a[c]}),{meta:a,skip:b}}};return f}var c=a.api._,d=a.api.pluginsSDK;return a.api.plugins.add("tooltip",b),b}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){function b(b){var f=d.defaults(b||{},{type:"linear",hideError:!1,showPanel:!0,showTrend:!0,models:["linear","exponential","logarithmic"]});return{init:function(a){if(this._chart=a,this._applicableElements=["ELEMENT.POINT","ELEMENT.LINE","ELEMENT.AREA","ELEMENT.INTERVAL"],this._isApplicable=this.checkIfApplicable(a),f.showPanel){this._container=a.insertToRightSidebar(this.containerTemplate);var b="applicable-true";this._isApplicable||(b="applicable-false",this._error=["Trend line can't be computed for categorical data.","Each axis should be either a measure or a date."].join(" ")),this._container.classList.add(b),f.hideError&&this._container.classList.add("hide-trendline-error"),this.uiChangeEventsDispatcher=function(a){var b=a.target,c=b.classList;c.contains("i-role-show-trend")&&(f.showTrend=b.checked),c.contains("i-role-change-model")&&(f.type=b.value),this._chart.refresh()}.bind(this),this._container.addEventListener("change",this.uiChangeEventsDispatcher,!1)}},checkIfApplicable:function(a){var b=this,c=a.getConfig(),d=!1;return a.traverseSpec(c,function(a,e){b.predicateIsApplicable(c,a,e)&&(d=!0)}),d},predicateIsApplicable:function(a,b,c){if(c&&"COORDS.RECT"!==c.type)return!1;if(-1===this._applicableElements.indexOf(b.type))return!1;var d=a.scales[b.x],e=a.scales[b.y];return!("ordinal"===d.type||"ordinal"===e.type)},onSpecReady:function(b,e){var g=this;if(f.showTrend){var h=a.api.tickPeriod,i=function(a){var b=h.get(a);return function(a){return b.cast(new Date(a))}};e.transformations=e.transformations||{},e.transformations.regression=function(a,b){var e=b.x.dim,f=b.y.dim,g="period"===b.x.type&&b.x.period,h="period"===b.y.type&&b.y.period,j=g?i(b.x.period):d.identity,k=h?i(b.y.period):d.identity,l=a.map(function(a){var b=d.isDate(a[e])?a[e].getTime():a[e],c=d.isDate(a[f])?a[f].getTime():a[f];return[b,c]}),m=c(b.type,l),n=d(m.points).chain().filter(function(a){return null!==a[0]&&null!==a[1]}).sortBy(function(a){return a[0]}).map(function(a){var b={};return b[e]=j(a[0]),b[f]=k(a[1]),b}).value();return n.length>1&&(g||h)&&(n=[n[0],n[n.length-1]]),n.length>1?n:[]},b.traverseSpec(e,function(a,b){if(g.predicateIsApplicable(e,a,b)){var c=e.scales[a.x],d=e.scales[a.y],h=JSON.parse(JSON.stringify(a));h.type="ELEMENT.LINE",h.namespace="trendline",h.transformation=h.transformation||[],h.transformation.push({type:"regression",args:{type:f.type,x:c,y:d}}),h.guide=h.guide||{},h.guide.showAnchors=!1,h.guide.cssClass="graphical-report__trendline",h.guide.widthCssClass="graphical-report__line-width-1",b.units.push(h)}})}},containerTemplate:'<div class="graphical-report__trendlinepanel"></div>',template:d.template(['<label class="graphical-report__trendlinepanel__title graphical-report__checkbox">','<input type="checkbox" class="graphical-report__checkbox__input i-role-show-trend" <%= showTrend %> />','<span class="graphical-report__checkbox__icon"></span>','<span class="graphical-report__checkbox__text">',"<%= title %>","</span>","</label>","<div>",'<select class="i-role-change-model graphical-report__select graphical-report__trendlinepanel__control">',"<%= models %>","</select>","</div>",'<div class="graphical-report__trendlinepanel__error-message"><%= error %></div>'].join("")),onRender:function(a){if(this._container){this._container.innerHTML=this.template({title:"Trend line",error:this._error,showTrend:f.showTrend&&this._isApplicable?"checked":"",models:f.models.map(function(a){var b=f.type===a?"selected":"";return"<option "+b+' value="'+a+'">'+a+"</option>"})});var b=function(a){return function(){e.select(this).classed({active:a,"graphical-report__line-width-1":!a,"graphical-report__line-width-3":a})}},c=e.select(a.getSVG());c.selectAll(".graphical-report__trendline").on("mouseenter",b(!0)).on("mouseleave",b(!1))}}}}var c=function(){"use strict";var a=function(a,b){var c=0,d=0,e=0,f=0,g=0,h=a.length-1,i=new Array(b);for(c=0;h>c;c++){for(f=c,d=c+1;h>d;d++)Math.abs(a[c][d])>Math.abs(a[c][f])&&(f=d);for(e=c;h+1>e;e++)g=a[e][c],a[e][c]=a[e][f],a[e][f]=g;for(d=c+1;h>d;d++)for(e=h;e>=c;e--)a[e][d]-=a[e][c]*a[c][d]/a[c][c]}for(d=h-1;d>=0;d--){for(g=0,e=d+1;h>e;e++)g+=a[e][d]*i[e];i[d]=(a[h][d]-g)/a[d][d]}return i},b={linear:function(a){for(var b=[0,0,0,0,0],c=0,d=[];c<a.length;c++)a[c][1]&&(b[0]+=a[c][0],b[1]+=a[c][1],b[2]+=a[c][0]*a[c][0],b[3]+=a[c][0]*a[c][1],b[4]+=a[c][1]*a[c][1]);var e=(c*b[3]-b[0]*b[1])/(c*b[2]-b[0]*b[0]);e=isNaN(e)?0:e;for(var f=b[1]/c-e*b[0]/c,g=0,h=a.length;h>g;g++){var i=[a[g][0],a[g][0]*e+f];d.push(i)}var j="y = "+Math.round(100*e)/100+"x + "+Math.round(100*f)/100;return{equation:[e,f],points:d,string:j}},exponential:function(a){var b=[0,0,0,0,0,0],c=0,d=[];for(i=a.length;i>c;c++)a[c][1]&&(b[0]+=a[c][0],b[1]+=a[c][1],b[2]+=a[c][0]*a[c][0]*a[c][1],b[3]+=a[c][1]*Math.log(a[c][1]),b[4]+=a[c][0]*a[c][1]*Math.log(a[c][1]),b[5]+=a[c][0]*a[c][1]);for(var e=b[1]*b[2]-b[5]*b[5],f=Math.pow(Math.E,(b[2]*b[3]-b[5]*b[4])/e),g=(b[1]*b[4]-b[5]*b[3])/e,h=0,i=a.length;i>h;h++){var j=[a[h][0],f*Math.pow(Math.E,g*a[h][0])];d.push(j)}var k="y = "+Math.round(100*f)/100+"e^("+Math.round(100*g)/100+"x)";return{equation:[f,g],points:d,string:k}},logarithmic:function(a){var b=[0,0,0,0],c=0,d=[];for(h=a.length;h>c;c++)a[c][1]&&(b[0]+=Math.log(a[c][0]),b[1]+=a[c][1]*Math.log(a[c][0]),b[2]+=a[c][1],b[3]+=Math.pow(Math.log(a[c][0]),2));for(var e=(c*b[1]-b[2]*b[0])/(c*b[3]-b[0]*b[0]),f=(b[2]-e*b[0])/c,g=0,h=a.length;h>g;g++){var i=[a[g][0],f+e*Math.log(a[g][0])];d.push(i)}var j="y = "+Math.round(100*f)/100+" + "+Math.round(100*e)/100+" ln(x)";return{equation:[f,e],points:d,string:j}},power:function(a){var b=[0,0,0,0],c=0,d=[];for(h=a.length;h>c;c++)a[c][1]&&(b[0]+=Math.log(a[c][0]),b[1]+=Math.log(a[c][1])*Math.log(a[c][0]),b[2]+=Math.log(a[c][1]),b[3]+=Math.pow(Math.log(a[c][0]),2));for(var e=(c*b[1]-b[2]*b[0])/(c*b[3]-b[0]*b[0]),f=Math.pow(Math.E,(b[2]-e*b[0])/c),g=0,h=a.length;h>g;g++){var i=[a[g][0],f*Math.pow(a[g][0],e)];d.push(i)}var j="y = "+Math.round(100*f)/100+"x^"+Math.round(100*e)/100;return{equation:[f,e],points:d,string:j}},polynomial:function(b,c){"undefined"==typeof c&&(c=2);for(var d=[],e=[],f=[],g=0,h=0,i=0,j=c+1;j>i;i++){for(var k=0,l=b.length;l>k;k++)b[k][1]&&(g+=Math.pow(b[k][0],i)*b[k][1]);d.push(g),g=0;for(var m=[],n=0;j>n;n++){for(var k=0,l=b.length;l>k;k++)b[k][1]&&(h+=Math.pow(b[k][0],i+n));m.push(h),h=0}e.push(m)}e.push(d);for(var o=a(e,j),i=0,l=b.length;l>i;i++){for(var p=0,q=0;q<o.length;q++)p+=o[q]*Math.pow(b[i][0],q);f.push([b[i][0],p])}for(var r="y = ",i=o.length-1;i>=0;i--)r+=i>1?Math.round(100*o[i])/100+"x^"+i+" + ":1==i?Math.round(100*o[i])/100+"x + ":Math.round(100*o[i])/100;return{equation:o,points:f,string:r}},lastvalue:function(a){for(var b=[],c=null,d=0;d<a.length;d++)a[d][1]?(c=a[d][1],b.push([a[d][0],a[d][1]])):b.push([a[d][0],c]);return{equation:[c],points:b,string:""+c}},loess:function(a){function b(a,b){var d=a.map(function(a){return a[0]}),e=a.map(function(a){return a[1]}),f=c(d,e,b);return d.map(function(a,b){return[a,f[b]]})}function c(a,b,c){function d(a){var b=1-a*a*a;return b*b*b}for(var e=[],f=0,g=Math.floor(c*a.length)-1,h=0;h<a.length;h++){var i=a[h];h>0&&g<a.length-1&&a[g+1]-a[h]<a[h]-a[f]&&(f++,g++);var j;j=a[h]-a[f]>a[g]-a[h]?f:g;for(var k=Math.abs(1/(a[j]-i)),l=0,m=0,n=0,o=0,p=0,q=f;g>=q;){var r,s=a[q],t=b[q];r=h>q?i-s:s-i;var u=d(r*k),v=s*u;l+=u,m+=v,n+=s*v,o+=t*u,p+=t*v,q++}var w,x=m/l,y=o/l,z=p/l,A=n/l;w=A==x*x?0:(z-x*y)/(A-x*x);var B=y-w*x;e[h]=w*i+B}return e}return{equation:"loess",points:b(a,.5),string:"loess"}}};return function(a,c,d){return"string"==typeof a?b[a](c,d):void 0}}(),d=a.api._,e=a.api.d3;return a.api.plugins.add("trendline",b),b});
Asaf-S/jsdelivr
files/taucharts/0.6.0/tauCharts.min.js
JavaScript
mit
316,355
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["TWEEN"] = factory(); else root["TWEEN"] = factory(); })(this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // identity function for calling harmony imports with the correct context /******/ __webpack_require__.i = function(value) { return value; }; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 11); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Easing = { Linear: { None: function None(k) { return k; } }, Quadratic: { In: function In(k) { return k * k; }, Out: function Out(k) { return k * (2 - k); }, InOut: function InOut(k) { if ((k *= 2) < 1) { return 0.5 * k * k; } return -0.5 * (--k * (k - 2) - 1); } }, Cubic: { In: function In(k) { return k * k * k; }, Out: function Out(k) { return --k * k * k + 1; }, InOut: function InOut(k) { if ((k *= 2) < 1) { return 0.5 * k * k * k; } return 0.5 * ((k -= 2) * k * k + 2); } }, Quartic: { In: function In(k) { return k * k * k * k; }, Out: function Out(k) { return 1 - --k * k * k * k; }, InOut: function InOut(k) { if ((k *= 2) < 1) { return 0.5 * k * k * k * k; } return -0.5 * ((k -= 2) * k * k * k - 2); } }, Quintic: { In: function In(k) { return k * k * k * k * k; }, Out: function Out(k) { return --k * k * k * k * k + 1; }, InOut: function InOut(k) { if ((k *= 2) < 1) { return 0.5 * k * k * k * k * k; } return 0.5 * ((k -= 2) * k * k * k * k + 2); } }, Sinusoidal: { In: function In(k) { return 1 - Math.cos(k * Math.PI / 2); }, Out: function Out(k) { return Math.sin(k * Math.PI / 2); }, InOut: function InOut(k) { return 0.5 * (1 - Math.cos(Math.PI * k)); } }, Exponential: { In: function In(k) { return k === 0 ? 0 : Math.pow(1024, k - 1); }, Out: function Out(k) { return k === 1 ? 1 : 1 - Math.pow(-10 * k, 2); }, InOut: function InOut(k) { if (k === 0) { return 0; } if (k === 1) { return 1; } if ((k *= 2) < 1) { return 0.5 * Math.pow(1024, k - 1); } return 0.5 * (-Math.pow(-10 * (k - 1), 2) + 2); } }, Circular: { In: function In(k) { return 1 - Math.sqrt(1 - k * k); }, Out: function Out(k) { return Math.sqrt(1 - --k * k); }, InOut: function InOut(k) { if ((k *= 2) < 1) { return -0.5 * (Math.sqrt(1 - k * k) - 1); } return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1); } }, Elastic: { In: function In(k) { if (k === 0) { return 0; } if (k === 1) { return 1; } return -Math.pow(10 * (k - 1), 2) * Math.sin((k - 1.1) * 5 * Math.PI); }, Out: function Out(k) { if (k === 0) { return 0; } if (k === 1) { return 1; } return Math.pow(-10 * k, 2) * Math.sin((k - 0.1) * 5 * Math.PI) + 1; }, InOut: function InOut(k) { if (k === 0) { return 0; } if (k === 1) { return 1; } k *= 2; if (k < 1) { return -0.5 * Math.pow(10 * (k - 1), 2) * Math.sin((k - 1.1) * 5 * Math.PI); } return 0.5 * Math.pow(-10 * (k - 1), 2) * Math.sin((k - 1.1) * 5 * Math.PI) + 1; } }, Back: { In: function In(k) { var s = 1.70158; return k * k * ((s + 1) * k - s); }, Out: function Out(k) { var s = 1.70158; return --k * k * ((s + 1) * k + s) + 1; }, InOut: function InOut(k) { var s = 1.70158 * 1.525; if ((k *= 2) < 1) { return 0.5 * (k * k * ((s + 1) * k - s)); } return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2); } }, Bounce: { In: function In(k) { return 1 - Easing.Bounce.Out(1 - k); }, Out: function Out(k) { if (k < 1 / 2.75) { return 7.5625 * k * k; } else if (k < 2 / 2.75) { return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75; } else if (k < 2.5 / 2.75) { return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375; } else { return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375; } }, InOut: function InOut(k) { if (k < 0.5) { return Easing.Bounce.In(k * 2) * 0.5; } return Easing.Bounce.Out(k * 2 - 1) * 0.5 + 0.5; } }, Stepped: function Stepped(steps) { return function (k) { return Math.floor(k * steps) / steps; }; }, Noisy: function Noisy(randomProportion, easingFunction) { var normalProportion = 1.0 - randomProportion; return function (k) { return randomProportion * Math.random() + normalProportion * easingFunction(k); }; }, // Credits: // @michaelvillar for dynamics.js easing/physics // Adapted by @dalisoft get bezier() { var b, d; b = function b(_b, d, g, f, h) { var k = Math.pow(1 - _b, 3), l = 3 * Math.pow(1 - _b, 2) * _b, m = 3 * (1 - _b) * Math.pow(_b, 2); _b = Math.pow(_b, 3); return { x: k * d.x + l * g.x + m * f.x + _b * h.x, y: k * d.y + l * g.y + m * f.y + _b * h.y }; }; d = function d(b, _d) { var g, f, h = 0, k = 0, l = _d.length, m = 0, q = 1, w = (q + m) / 2; for (g = null; k < l;) { f = _d[k]; b >= f(0).x && b <= f(1).x && (g = f); if (null !== g) break; k++; } if (!g) return 1; for (f = g(w).x; 1E-4 < Math.abs(b - f) && 100 > h;) { b > f ? m = w : q = w, w = (q + m) / 2, f = g(w).x, h++; }return g(w).y; }; return function (c) { null == c && (c = {}); var e = c.points, g = function () { var c, d = 0, k = e.length; g = []; for (c = function c(d, _c) { return g.push(function (e) { return b(e, d, d.cp[d.cp.length - 1], _c.cp[0], _c); }); }; d < k && !(d >= e.length - 1);) { c(e[d], e[d + 1]), d++; }return g; }(); return function (b) { return d(b, g); }; }; }, easeInOut: function easeInOut(b) { var d, c; null == b && (b = {}); d = null != (c = b.friction) ? c : Easing.easeInOut.defaults.friction; return Easing.bezier({ points: [{ x: 0, y: 0, cp: [{ x: .92 - d / 1E3, y: 0 }] }, { x: 1, y: 1, cp: [{ x: .08 + d / 1E3, y: 1 }] }] }); }, easeIn: function easeIn(b) { var d, c; null == b && (b = {}); d = null != (c = b.friction) ? c : Easing.easeIn.defaults.friction; return Easing.bezier({ points: [{ x: 0, y: 0, cp: [{ x: .92 - d / 1E3, y: 0 }] }, { x: 1, y: 1, cp: [{ x: 1, y: 1 }] }] }); }, easeOut: function easeOut(b) { var d, c; null == b && (b = {}); d = null != (c = b.friction) ? c : Easing.easeOut.defaults.friction; return Easing.bezier({ points: [{ x: 0, y: 0, cp: [{ x: 0, y: 0 }] }, { x: 1, y: 1, cp: [{ x: .08 + d / 1E3, y: 1 }] }] }); }, spring: function spring(b) { var d, c, e, g, f; null == b && (b = {}); Tools.extend(b, Easing.spring.defaults, true); e = Math.max(1, b.frequency / 20); g = Math.pow(20, b.friction / 100); f = b.anticipationSize / 1E3; d = function d(_d2) { var c, e; e = f / (1 - f); c = (e - 0) / (e - 0); return (.8 - c) / e * _d2 * b.anticipationStrength / 100 + c; }; c = function c(b) { return Math.pow(g / 10, -b) * (1 - b); }; return function (b) { var g, l, m, q; q = b / (1 - f) - f / (1 - f); b < f ? (m = f / (1 - f) - f / (1 - f), g = 0 / (1 - f) - f / (1 - f), m = Math.acos(1 / d(m)), l = (Math.acos(1 / d(g)) - m) / (e * -f), g = d) : (g = c, m = 0, l = 1); return 1 - g(q) * Math.cos(e * (b - f) * l + m); }; }, bounce: function bounce(b) { var d, c, e, g; null == b && (b = {}); Tools.extend(b, Easing.bounce.defaults); e = Math.max(1, b.frequency / 20); g = Math.pow(20, b.friction / 100); d = function d(b) { return Math.pow(g / 10, -b) * (1 - b); }; c = function c(b) { return d(b) * Math.cos(e * b * 1 + -1.57); }; c.initialForce = !0; return c; }, gravity: function gravity(b) { var d, c, e, g, f, h; null == b && (b = {}); Tools.extend(b, Easing.gravity.defaults); c = Math.min(b.bounciness / 1250, .8); g = b.elasticity / 1E3; e = []; d = function () { var e; e = Math.sqrt(.02); e = { a: -e, b: e, H: 1 }; b.initialForce && (e.a = 0, e.b *= 2); for (; .001 < e.H;) { d = e.b - e.a, e = { a: e.b, b: e.b + d * c, H: e.H * c * c }; }return e.b; }(); h = function h(c, e, f, g) { d = e - c; c = 2 / d * g - 1 - 2 * c / d; f = c * c * f - f + 1; b.initialForce && (f = 1 - f); return f; }; (function () { var f, h, m; f = Math.sqrt(2 / (100 * d * d)); h = { a: -f, b: f, H: 1 }; b.initialForce && (h.a = 0, h.b *= 2); e.push(h); for (m = []; 1 > h.b && .001 < h.H;) { f = h.b - h.a, h = { a: h.b, b: h.b + f * c, H: h.H * g }, m.push(e.push(h)); }return m; })(); f = function f(c) { var d, f; f = 0; for (d = e[f]; !(c >= d.a && c <= d.b) && (f += 1, d = e[f], d);) {} return d ? h(d.a, d.b, d.H, c) : b.initialForce ? 0 : 1; }; f.initialForce = b.initialForce; return f; }, forceWithGravity: function forceWithGravity(b) { null == b && (b = {}); Tools.extend(b, Easing.forceWithGravity.defaults); b.initialForce = !0; return Easing.gravity(b); } }; Easing.spring.defaults = { frequency: 300, friction: 200, anticipationSize: 0, anticipationStrength: 0 }; Easing.bounce.defaults = { frequency: 300, friction: 200 }; Easing.forceWithGravity.defaults = Easing.gravity.defaults = { bounciness: 400, elasticity: 200 }; Easing.easeInOut.defaults = Easing.easeIn.defaults = Easing.easeOut.defaults = { friction: 500 }; exports.default = Easing; /***/ }), /* 1 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Interpolation = { Linear: function Linear(v, k) { var m = v.length - 1; var f = m * k; var i = Math.floor(f); var fn = Interpolation.Utils.Linear; if (k < 0) { return fn(v[0], v[1], f); } if (k > 1) { return fn(v[m], v[m - 1], m - f); } return fn(v[i], v[i + 1 > m ? m : i + 1], f - i); }, Bezier: function Bezier(v, k) { var b = 0; var n = v.length - 1; var pw = Math.pow; var bn = Interpolation.Utils.Bernstein; for (var i = 0; i <= n; i++) { b += pw(1 - k, n - i) * pw(k, i) * v[i] * bn(n, i); } return b; }, CatmullRom: function CatmullRom(v, k) { var m = v.length - 1; var f = m * k; var i = Math.floor(f); var fn = Interpolation.Utils.CatmullRom; if (v[0] === v[m]) { if (k < 0) { i = Math.floor(f = m * (1 + k)); } return fn(v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m], f - i); } else { if (k < 0) { return v[0] - (fn(v[0], v[0], v[1], v[1], -f) - v[0]); } if (k > 1) { return v[m] - (fn(v[m], v[m], v[m - 1], v[m - 1], f - m) - v[m]); } return fn(v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2], f - i); } }, Utils: { Linear: function Linear(p0, p1, t) { return (p1 - p0) * t + p0; }, Bernstein: function Bernstein(n, i) { var fc = Interpolation.Utils.Factorial; return fc(n) / fc(i) / fc(n - i); }, Factorial: function () { var a = [1]; return function (n) { var s = 1; if (a[n]) { return a[n]; } for (var i = n; i > 1; i--) { s *= i; } a[n] = s; return s; }; }(), CatmullRom: function CatmullRom(p0, p1, p2, p3, t) { var v0 = (p2 - p0) * 0.5; var v1 = (p3 - p1) * 0.5; var t2 = t * t; var t3 = t * t2; return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1; } } }; exports.default = Interpolation; /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _core = __webpack_require__(4); var _Easing = __webpack_require__(0); var _Easing2 = _interopRequireDefault(_Easing); var _Interpolation = __webpack_require__(1); var _Interpolation2 = _interopRequireDefault(_Interpolation); var _clone = __webpack_require__(3); var _clone2 = _interopRequireDefault(_clone); var _joinToString = __webpack_require__(9); var _joinToString2 = _interopRequireDefault(_joinToString); var _toNumber = __webpack_require__(10); var _toNumber2 = _interopRequireDefault(_toNumber); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } // Credits: // @jkroso for string parse library // Optimized, Extended by @dalisoft var Number_Match_RegEx = /\s+|([A-Za-z?().,{}:""\[\]#]+)|([-+\/*%]+=)?([-+*\/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/gi; var Tween = function () { function Tween() { var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, Tween); this.object = object; this._valuesStart = Tween.createEmptyConst(object); this._valuesEnd = Tween.createEmptyConst(object); this._chainedTweens = []; this._duration = 1000; this._easingFunction = _Easing2.default.Linear.None; this._interpolationFunction = _Interpolation2.default.None; this._startTime = 0; this._delayTime = 0; this._repeat = 0; this._r = 0; this._isPlaying = false; this._yoyo = false; this._reversed = false; this._onStartCallbackFired = false; this._events = {}; this._pausedTime = 0; return this; } _createClass(Tween, [{ key: 'isPlaying', value: function isPlaying() { return this._isPlaying; } }, { key: 'isStarted', value: function isStarted() { return this._onStartCallbackFired; } }, { key: 'reverse', value: function reverse() { /*let { _valuesEnd , _valuesStart , _reversed } = this; // Reassign starting values, restart by making startTime = now for ( let property in _valuesEnd ) { let tmp = _valuesStart[ property ]; this._valuesStart[ property ] = _valuesEnd[ property ]; this._valuesEnd[ property ] = tmp; }*/ var _reversed = this._reversed; this._reversed = !_reversed; return this; } }, { key: 'off', value: function off(name, fn) { if (this._events[name] === undefined) { return this; } if (name !== undefined && fn !== undefined) { var eventsList = this._events[name], i = 0; while (i < eventsList.length) { if (eventsList[i] === fn) { eventsList.splice(i, 1); } i++; } } else if (name !== undefined && fn === undefined) { this._events[name] = []; } return this; } }, { key: 'on', value: function on(name, fn) { if (this._events[name] === undefined) { this._events[name] = []; } this._events[name].push(fn); return this; } }, { key: 'once', value: function once(name, fn) { var _this = this; if (this._events[name] === undefined) { this._events[name] = []; } return this.on(name, function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } fn.call.apply(fn, [_this].concat(args)); _this.off(name); }); } }, { key: 'emit', value: function emit(name) { var _events = this._events; var eventFn = _events[name]; if (!eventFn) { return this; } var i = eventFn.length; for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } while (i--) { var _eventFn$i; (_eventFn$i = eventFn[i]).call.apply(_eventFn$i, [this].concat(args)); } return this; } }, { key: 'pause', value: function pause() { if (!this._isPlaying) { return this; } this._isPlaying = false; (0, _core.remove)(this); this._pausedTime = (0, _core.now)(); return this.emit('pause', this.object); } }, { key: 'play', value: function play() { if (this._isPlaying) { return this; } this._isPlaying = true; this._startTime += (0, _core.now)() - this._pausedTime; (0, _core.add)(this); this._pausedTime = (0, _core.now)(); return this.emit('play', this.object); } }, { key: 'restart', value: function restart(noDelay) { this._repeat = this._r; this._startTime = (0, _core.now)() + (noDelay ? 0 : this._delayTime); if (!this._isPlaying) { (0, _core.add)(this); } return this.emit('restart', this._object); } }, { key: 'seek', value: function seek(time, keepPlaying) { this._startTime = (0, _core.now)() + Math.max(0, Math.min(time, this._duration)); this.emit('seek', time, this._object); return keepPlaying ? this : this.pause(); } }, { key: 'duration', value: function duration(amount) { this._duration = typeof amount === "function" ? amount(this._duration) : amount; return this; } }, { key: 'to', value: function to() { var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000; if (typeof properties === "number") { var _vE = { Number: properties }; this._valuesEnd = _vE; } else { this._valuesEnd = properties; } if (typeof duration === "number") { this._duration = duration; } else if ((typeof duration === 'undefined' ? 'undefined' : _typeof(duration)) === "object") { for (var prop in duration) { this[prop](duration[prop]); } } return this; } }, { key: 'start', value: function start(time) { var _startTime = this._startTime, _delayTime = this._delayTime, _valuesEnd = this._valuesEnd, _valuesStart = this._valuesStart, object = this.object; _startTime = time !== undefined ? time : (0, _core.now)(); _startTime += _delayTime; this._startTime = _startTime; for (var property in _valuesEnd) { if (_typeof(_valuesEnd[property]) === "object") { if (Array.isArray(_valuesEnd[property])) { if (typeof object[property] === "number") { this._valuesEnd[property] = [object[property]].concat(_valuesEnd[property]); } else { var clonedTween = (0, _clone2.default)(this, { object: object[property], _valuesEnd: _valuesEnd[property] }).start().stop(); this._valuesEnd[property] = clonedTween; } } else { var _clonedTween = (0, _clone2.default)(this, { object: object[property], _valuesEnd: _valuesEnd[property] }).start().stop(); this._valuesEnd[property] = _clonedTween; } } else if (typeof _valuesEnd[property] === "string" && typeof object[property] === "string" && Number_Match_RegEx.test(object[property]) && Number_Match_RegEx.test(_valuesEnd[property])) { var __get__Start = object[property].match(Number_Match_RegEx); __get__Start = __get__Start.map(_toNumber2.default); var __get__End = _valuesEnd[property].match(Number_Match_RegEx); __get__End = __get__End.map(_toNumber2.default); var _clonedTween2 = (0, _clone2.default)(this, { object: __get__Start, _valuesEnd: __get__End }).start().stop(); _clonedTween2.join = true; // For string tweening this._valuesEnd[property] = _clonedTween2; } // If `to()` specifies a property that doesn't exist in the source object, // we should not set that property in the object if (Tween.checkValidness(object[property]) === false) { continue; } // If duplicate or non-tweening numerics matched, // we should delete from _valuesEnd if (object[property] === _valuesEnd[property]) { continue; } this._valuesStart[property] = object[property]; } (0, _core.add)(this); this._isPlaying = true; return this; } }, { key: 'stop', value: function stop() { var _isPlaying = this._isPlaying, object = this.object; if (!_isPlaying) { return this; } (0, _core.remove)(this); this._isPlaying = false; this.stopChainedTweens(); return this.emit('stop', object); } }, { key: 'end', value: function end() { var _startTime = this._startTime, _duration = this._duration; return this.update(_startTime + _duration); } }, { key: 'stopChainedTweens', value: function stopChainedTweens() { var _chainedTweens = this._chainedTweens; _chainedTweens.map(function (item) { return item.stop(); }); return this; } }, { key: 'delay', value: function delay(amount) { this._delayTime = amount; return this; } }, { key: 'repeat', value: function repeat(times) { this._repeat = times; this._r = times; return this; } }, { key: 'repeatDelay', value: function repeatDelay(amount) { this._repeatDelayTime = amount; return this; } }, { key: 'reverseDelay', value: function reverseDelay(amount) { this._reverseDelayTime = amount; return this; } }, { key: 'yoyo', value: function yoyo(state) { this._yoyo = state; return this; } }, { key: 'easing', value: function easing(fn) { this._easingFunction = fn; return this; } }, { key: 'interpolation', value: function interpolation(fn) { this._interpolationFunction = fn; return this; } }, { key: 'chain', value: function chain() { for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } this._chainedTweens = args; return this; } }, { key: 'get', value: function get(time) { this.update(time); return this.object; } }, { key: 'update', value: function update(time) { var _onStartCallbackFired = this._onStartCallbackFired, _chainedTweens = this._chainedTweens, _easingFunction = this._easingFunction, _interpolationFunction = this._interpolationFunction, _repeat = this._repeat, _repeatDelayTime = this._repeatDelayTime, _reverseDelayTime = this._reverseDelayTime, _delayTime = this._delayTime, _yoyo = this._yoyo, _reversed = this._reversed, _startTime = this._startTime, _duration = this._duration, _valuesStart = this._valuesStart, _valuesEnd = this._valuesEnd, object = this.object; var property = void 0; var elapsed = void 0; var value = void 0; time = time !== undefined ? time : (0, _core.now)(); if (time < _startTime) { return true; } if (!_onStartCallbackFired) { this.emit('start', object); this._onStartCallbackFired = true; } elapsed = (time - _startTime) / _duration; elapsed = elapsed > 1 ? 1 : elapsed; elapsed = _reversed ? 1 - elapsed : elapsed; value = _easingFunction(elapsed); for (property in _valuesEnd) { // Don't update properties that do not exist in the source object if (_valuesStart[property] === undefined) { continue; } var start = _valuesStart[property]; var end = _valuesEnd[property]; if (end instanceof Tween) { var getValue = end.get(time); if (end.join) { object[property] = (0, _joinToString2.default)(getValue); } else { object[property] = getValue; } } else if (Array.isArray(end)) { object[property] = _interpolationFunction(end, value); } else { // Parses relative end values with start as base (e.g.: +10, -3) if (typeof end === 'string') { if (end.charAt(0) === '+' || end.charAt(0) === '-') { end = start + parseFloat(end); } else { end = parseFloat(end); } } // Protect against non numeric properties. if (typeof end === 'number') { object[property] = start + (end - start) * value; } } } this.emit('update', object, elapsed); if (elapsed === 1 || _reversed && elapsed === 0) { if (_repeat) { if (isFinite(_repeat)) { this._repeat--; } for (property in _valuesEnd) { if (typeof _valuesEnd[property] === 'string') { this._valuesStart[property] = _valuesStart[property] + parseFloat(_valuesEnd[property]); } } // Reassign starting values, restart by making startTime = now this.emit(_reversed ? 'reverse' : 'repeat', object); if (_yoyo) { this.reverse(); } if (!_reversed && _repeatDelayTime) { this._startTime += _duration + _repeatDelayTime; } else if (_reversed && _reverseDelayTime) { this._startTime += _duration + _reverseDelayTime; } else { this._startTime += _duration + _delayTime; } return true; } else { this.emit('complete', object); _chainedTweens.map(function (tween) { return tween.start(_startTime + _duration); }); return false; } } return true; } }], [{ key: 'createEmptyConst', value: function createEmptyConst(oldObject) { return typeof oldObject === "number" ? 0 : Array.isArray(oldObject) ? [] : (typeof oldObject === 'undefined' ? 'undefined' : _typeof(oldObject)) === "object" ? {} : ''; } }, { key: 'checkValidness', value: function checkValidness(valid) { return valid !== undefined && valid !== null && valid !== '' && valid !== NaN && valid !== Infinity; } }]); return Tween; }(); exports.default = Tween; /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = cloneTween; var _Tween = __webpack_require__(2); var _Tween2 = _interopRequireDefault(_Tween); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function cloneTween() { var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var copyTween = new _Tween2.default({ x: 0 }); for (var config in obj) { if (configs[config] !== undefined) { copyTween[config] = configs[config]; } else { copyTween[config] = obj[config]; } } return copyTween; } /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global) { Object.defineProperty(exports, "__esModule", { value: true }); // TWEEN.js var _tweens = []; var isStarted = false; var _autoPlay = false; var _tick = void 0; var _events = {}; var root = typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : undefined; var getAll = function getAll() { return _tweens; }; var autoPlay = function autoPlay(state) { _autoPlay = state; }; var removeAll = function removeAll() { _tweens = []; }; var emit = function emit(name) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var eventFn = _events[name]; if (!eventFn) { return; } var i = eventFn.length; while (i--) { var _eventFn$i; (_eventFn$i = eventFn[i]).call.apply(_eventFn$i, [undefined].concat(args)); } }; var off = function off(ev, fn) { if (ev === undefined || _events[ev] === undefined) { return; } if (fn !== undefined) { var eventsList = _events[name], i = 0; while (i < eventsList.length) { if (eventsList[i] === fn) { eventsList.splice(i, 1); } i++; } } else { _events[name] = []; } }; var add = function add(tween) { _tweens.push(tween); if (_autoPlay && !isStarted) { autoStart(now()); isStarted = true; emit('start'); } emit('add', tween, _tweens); }; var on = function on(ev, fn) { if (_events[ev] === undefined) { _events[ev] = []; } _events[ev].push(fn); }; var once = function once(ev, fn) { if (_events[ev] === undefined) { _events[ev] = []; } on(ev, function () { fn.apply(undefined, arguments); off(ev); }); }; var remove = function remove(tween) { _tweens.filter(function (tweens) { return tweens !== tween; }); var i = 0, tweenFind = void 0; while (i < _tweens.length) { tweenFind = _tweens[i]; if (tweenFind === tween) { emit('remove', tween, _tweens); _tweens.splice(i, 1); } i++; } }; var now = function now() { return root.performance !== undefined && root.performance.now ? root.performance.now() : Date.now(); }; var update = function update(time, preserve) { time = time !== undefined ? time : now(); emit('update', time, _tweens); if (_tweens.length === 0) { return false; } var i = 0; while (i < _tweens.length) { if (_tweens[i].update(time) || preserve) { i++; } else { _tweens.splice(i, 1); } } return true; }; function autoStart(time) { if (update(time)) { _tick = requestAnimationFrame(autoStart); } else { isStarted = false; cancelAnimationFrame(_tick); emit('stop', time); } } exports.getAll = getAll; exports.removeAll = removeAll; exports.remove = remove; exports.add = add; exports.now = now; exports.update = update; exports.autoPlay = autoPlay; exports.on = on; exports.once = once; exports.off = off; exports.emit = emit; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var g; // This works in non-strict mode g = function () { return this; }(); try { // This works if eval is allowed (see CSP) g = g || Function("return this")() || (1, eval)("this"); } catch (e) { // This works if the window reference is available if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window; } // g can still be undefined, but nothing to do about it... // We return undefined, instead of nothing here, so it's // easier to handle this case. if(!global) { ...} module.exports = g; /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; if (Array.isArray === undefined) { Array.isArray = function (arrayLike) { return arrayLike !== undefined && (typeof arrayLike === "undefined" ? "undefined" : _typeof(arrayLike)) === "object" && arrayLike.length && arrayLike.push !== undefined && arrayLike.splice !== undefined; }; } /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; if (Object.assign === undefined) { Object.assign = function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var first = args.shift(); args.map(function (obj) { for (var p in obj) { first[p] = obj[p]; } }); return first; }; } /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global) { var ROOT = typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : undefined; var _vendor = ['webkit', 'moz', 'ms', 'o']; var animFrame = 'AnimationFrame'; var rafSuffixForVendor = 'Request' + animFrame; var cafSuffixForVendor = 'Cancel' + animFrame; var cafSuffixForVendor2 = 'CancelRequest' + animFrame; var _timeout = setTimeout; var _clearTimeout = clearTimeout; if (ROOT.requestAnimationFrame === undefined) { var _raf = void 0, now = void 0, lastTime = Date.now(), frameMs = 50 / 3, fpsSec = frameMs; _vendor.map(function (vendor) { if ((_raf = ROOT[vendor + rafSuffixForVendor]) === undefined) { _raf = function _raf(fn) { return _timeout(function () { now = Date.now(); fn(now - lastTime); fpsSec = frameMs + (Date.now() - now); }, fpsSec); }; } }); if (_raf !== undefined) { ROOT.requestAnimationFrame = _raf; } } if (ROOT.cancelAnimationFrame === undefined && (ROOT.cancelAnimationFrame = ROOT.cancelRequestAnimationFrame) === undefined) { var _caf = void 0; _vendor.map(function (vendor) { if ((_caf = ROOT[vendor + cafSuffixForVendor]) === undefined && (_caf = ROOT[vendor + cafSuffixForVendor2]) === undefined) { _caf = function _caf(fn) { return _clearTimeout(fn); }; } }); if (_caf !== undefined) { ROOT.cancelAnimationFrame = _caf; } } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = joinToString; function joinToString(__array__like) { var str = ''; for (var i = 0, len = __array__like.length; i < len; i++) { str += __array__like[i]; } return str; } /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = toNumber; function toNumber(val) { var floatedVal = parseFloat(val); return typeof floatedVal === "number" && !isNaN(floatedVal) ? floatedVal : val; } /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Interpolation = exports.Easing = exports.Tween = exports.emit = exports.off = exports.once = exports.on = exports.autoPlay = exports.update = exports.now = exports.add = exports.remove = exports.removeAll = exports.getAll = undefined; __webpack_require__(7); __webpack_require__(8); __webpack_require__(6); var _core = __webpack_require__(4); var _Easing = __webpack_require__(0); var _Easing2 = _interopRequireDefault(_Easing); var _Tween = __webpack_require__(2); var _Tween2 = _interopRequireDefault(_Tween); var _Interpolation = __webpack_require__(1); var _Interpolation2 = _interopRequireDefault(_Interpolation); var _clone = __webpack_require__(3); var _clone2 = _interopRequireDefault(_clone); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.getAll = _core.getAll; exports.removeAll = _core.removeAll; exports.remove = _core.remove; exports.add = _core.add; exports.now = _core.now; exports.update = _core.update; exports.autoPlay = _core.autoPlay; exports.on = _core.on; exports.once = _core.once; exports.off = _core.off; exports.emit = _core.emit; exports.Tween = _Tween2.default; exports.Easing = _Easing2.default; exports.Interpolation = _Interpolation2.default; /***/ }) /******/ ]); }); //# sourceMappingURL=Tween.js.map
Asaf-S/jsdelivr
files/es6-tween/1.2.2/Tween.js
JavaScript
mit
38,501
/*! * OOjs UI v0.19.4 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2017 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * * Date: 2017-02-28T23:19:44Z */ /* stylelint-disable selector-no-vendor-prefix, at-rule-no-unknown */ /* stylelint-enable selector-no-vendor-prefix, at-rule-no-unknown */ .oo-ui-icon-indent { background-image: url('themes/mediawiki/images/icons/indent-ltr.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/indent-ltr.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/indent-ltr.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/indent-ltr.png'); } .oo-ui-image-invert.oo-ui-icon-indent { background-image: url('themes/mediawiki/images/icons/indent-ltr-invert.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/indent-ltr-invert.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/indent-ltr-invert.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/indent-ltr-invert.png'); } .oo-ui-image-progressive.oo-ui-icon-indent { background-image: url('themes/mediawiki/images/icons/indent-ltr-progressive.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/indent-ltr-progressive.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/indent-ltr-progressive.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/indent-ltr-progressive.png'); } .oo-ui-icon-listBullet { background-image: url('themes/mediawiki/images/icons/listBullet-ltr.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/listBullet-ltr.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/listBullet-ltr.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/listBullet-ltr.png'); } .oo-ui-image-invert.oo-ui-icon-listBullet { background-image: url('themes/mediawiki/images/icons/listBullet-ltr-invert.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/listBullet-ltr-invert.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/listBullet-ltr-invert.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/listBullet-ltr-invert.png'); } .oo-ui-image-progressive.oo-ui-icon-listBullet { background-image: url('themes/mediawiki/images/icons/listBullet-ltr-progressive.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/listBullet-ltr-progressive.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/listBullet-ltr-progressive.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/listBullet-ltr-progressive.png'); } .oo-ui-icon-listNumbered { background-image: url('themes/mediawiki/images/icons/listNumbered-ltr.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/listNumbered-ltr.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/listNumbered-ltr.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/listNumbered-ltr.png'); } .oo-ui-image-invert.oo-ui-icon-listNumbered { background-image: url('themes/mediawiki/images/icons/listNumbered-ltr-invert.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/listNumbered-ltr-invert.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/listNumbered-ltr-invert.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/listNumbered-ltr-invert.png'); } .oo-ui-image-progressive.oo-ui-icon-listNumbered { background-image: url('themes/mediawiki/images/icons/listNumbered-ltr-progressive.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/listNumbered-ltr-progressive.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/listNumbered-ltr-progressive.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/listNumbered-ltr-progressive.png'); } .oo-ui-icon-outdent { background-image: url('themes/mediawiki/images/icons/outdent-ltr.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/outdent-ltr.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/outdent-ltr.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/outdent-ltr.png'); } .oo-ui-image-invert.oo-ui-icon-outdent { background-image: url('themes/mediawiki/images/icons/outdent-ltr-invert.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/outdent-ltr-invert.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/outdent-ltr-invert.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/outdent-ltr-invert.png'); } .oo-ui-image-progressive.oo-ui-icon-outdent { background-image: url('themes/mediawiki/images/icons/outdent-ltr-progressive.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/outdent-ltr-progressive.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/outdent-ltr-progressive.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/outdent-ltr-progressive.png'); }
jdh8/cdnjs
ajax/libs/oojs-ui/0.19.4/oojs-ui-mediawiki-icons-editing-list.css
CSS
mit
6,940
// // Copyright (c) 2014-2015 Actor LLC. <https://actor.im> // import Foundation class CocoaHttpRuntime: NSObject, ARHttpRuntime { let queue:NSOperationQueue = NSOperationQueue() func getMethodWithUrl(url: String!, withStartOffset startOffset: jint, withSize size: jint, withTotalSize totalSize: jint, withCallback callback: ARFileDownloadCallback!) { var header = "bytes=\(startOffset)-\(min(startOffset + size, totalSize))" var request = NSMutableURLRequest(URL: NSURL(string: url)!) request.HTTPShouldHandleCookies = false request.cachePolicy = NSURLRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData request.setValue(header, forHTTPHeaderField: "Range") request.HTTPMethod = "GET" NSURLConnection.sendAsynchronousRequest(request, queue: queue, completionHandler:{ (response: NSURLResponse!, data: NSData!, error: NSError!) -> Void in if (error != nil) { callback.onDownloadFailure() } else { callback.onDownloadedWithByteArray(data.toJavaBytes()) } }) } func putMethodWithUrl(url: String!, withContents contents: IOSByteArray!, withCallback callback: ARFileUploadCallback!) { var request = NSMutableURLRequest(URL: NSURL(string: url)!) request.HTTPShouldHandleCookies = false request.cachePolicy = NSURLRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData request.HTTPMethod = "PUT" request.HTTPBody = contents.toNSData() request.setValue("application/octet-stream", forHTTPHeaderField: "Content-Type") NSURLConnection.sendAsynchronousRequest(request, queue: queue, completionHandler:{ (response: NSURLResponse!, data: NSData!, error: NSError!) -> Void in if (error != nil) { callback.onUploadFailure() } else { callback.onUploaded() } }) } }
ONode/actor-platform
actor-apps/app-ios/ActorCore/Providers/CocoaHttpRuntime.swift
Swift
mit
1,975
/** * Throbber.js * * Copyright, Moxiecode Systems AB * Released under LGPL License. * * License: http://www.tinymce.com/license * Contributing: http://www.tinymce.com/contributing */ /** * This class enables you to display a Throbber for any element. * * @-x-less Throbber.less * @class tinymce.ui.Throbber */ define("tinymce/ui/Throbber", [ "tinymce/ui/DomUtils" ], function(DomUtils) { "use strict"; /** * Constructs a new throbber. * * @constructor * @param {Element} elm DOM Html element to display throbber in. */ return function(elm) { var self = this, state; /** * Shows the throbber. * * @method show * @param {Number} [time] Time to wait before showing. * @return {tinymce.ui.Throbber} Current throbber instance. */ self.show = function(time) { self.hide(); state = true; window.setTimeout(function() { if (state) { elm.appendChild(DomUtils.createFragment('<div class="mce-throbber"></div>')); } }, time || 0); return self; }; /** * Hides the throbber. * * @method hide * @return {tinymce.ui.Throbber} Current throbber instance. */ self.hide = function() { var child = elm.lastChild; if (child && child.className.indexOf('throbber') != -1) { child.parentNode.removeChild(child); } state = false; return self; }; }; });
CondeMonteCristo/biblioteca
web/bundles/genemuform/tinymcenew/js/tinymce/classes/ui/Throbber.js
JavaScript
mit
1,360
/* angular-moment.js / v0.6.0 / (c) 2013 Uri Shaked / MIT Licence */ angular.module('angularMoment', []) .constant('amTimeAgoConfig', { withoutSuffix: false}) .directive('amTimeAgo', ['$window', 'amTimeAgoConfig', function ($window, amTimeAgoConfig) { 'use strict'; return function (scope, element, attr) { var activeTimeout = null; var currentValue; var currentFormat; var withoutSuffix = amTimeAgoConfig.withoutSuffix; function cancelTimer() { if (activeTimeout) { $window.clearTimeout(activeTimeout); activeTimeout = null; } } function updateTime(momentInstance) { element.text(momentInstance.fromNow(withoutSuffix)); var howOld = $window.moment().diff(momentInstance, 'minute'); var secondsUntilUpdate = 3600; if (howOld < 1) { secondsUntilUpdate = 1; } else if (howOld < 60) { secondsUntilUpdate = 30; } else if (howOld < 180) { secondsUntilUpdate = 300; } activeTimeout = $window.setTimeout(function () { updateTime(momentInstance); }, secondsUntilUpdate * 1000); } function updateMoment() { cancelTimer(); updateTime($window.moment(currentValue, currentFormat)); } scope.$watch(attr.amTimeAgo, function (value) { if ((typeof value === 'undefined') || (value === null) || (value === '')) { cancelTimer(); if (currentValue) { element.text(''); currentValue = null; } return; } if (angular.isNumber(value)) { // Milliseconds since the epoch value = new Date(value); } // else assume the given value is already a date currentValue = value; updateMoment(); }); if (angular.isDefined(attr.amWithoutSuffix)) { scope.$watch(attr.amWithoutSuffix, function (value) { if (typeof value === 'boolean') { withoutSuffix = value; updateMoment(); } else { withoutSuffix = amTimeAgoConfig.withoutSuffix; } }); } attr.$observe('amFormat', function (format) { currentFormat = format; if (currentValue) { updateMoment(); } }); scope.$on('$destroy', function () { cancelTimer(); }); }; }]) .filter('amCalendar', ['$window', function ($window) { 'use strict'; return function (value) { if (typeof value === 'undefined' || value === null) { return ''; } if (!isNaN(parseFloat(value)) && isFinite(value)) { // Milliseconds since the epoch value = new Date(parseInt(value, 10)); } // else assume the given value is already a date return $window.moment(value).calendar(); }; }]) .filter('amDateFormat', ['$window', function ($window) { 'use strict'; return function (value, format) { if (typeof value === 'undefined' || value === null) { return ''; } if (!isNaN(parseFloat(value)) && isFinite(value)) { // Milliseconds since the epoch value = new Date(parseInt(value, 10)); } // else assume the given value is already a date return $window.moment(value).format(format); }; }]) .filter('amDurationFormat', ['$window', function ($window) { 'use strict'; return function (value, format, suffix) { if (typeof value === 'undefined' || value === null) { return ''; } // else assume the given value is already a duration in a format (miliseconds, etc) return $window.moment.duration(value, format).humanize(suffix); }; }]);
chrisharrington/cdnjs
ajax/libs/angular-moment/0.6.0/angular-moment.js
JavaScript
mit
3,525
CREATE TABLE country (id NVARCHAR(2) NOT NULL, name NVARCHAR(64) NOT NULL, PRIMARY KEY (id)); INSERT INTO [country] ([id], [name]) VALUES ('AF', 'Afghanistan'); INSERT INTO [country] ([id], [name]) VALUES ('AL', 'Albania'); INSERT INTO [country] ([id], [name]) VALUES ('DZ', 'Algeria'); INSERT INTO [country] ([id], [name]) VALUES ('AS', 'American Samoa'); INSERT INTO [country] ([id], [name]) VALUES ('AD', 'Andorra'); INSERT INTO [country] ([id], [name]) VALUES ('AO', 'Angola'); INSERT INTO [country] ([id], [name]) VALUES ('AI', 'Anguilla'); INSERT INTO [country] ([id], [name]) VALUES ('AQ', 'Antarctica'); INSERT INTO [country] ([id], [name]) VALUES ('AG', 'Antigua and Barbuda'); INSERT INTO [country] ([id], [name]) VALUES ('AR', 'Argentina'); INSERT INTO [country] ([id], [name]) VALUES ('AM', 'Armenia'); INSERT INTO [country] ([id], [name]) VALUES ('AW', 'Aruba'); INSERT INTO [country] ([id], [name]) VALUES ('AC', 'Ascension Island'); INSERT INTO [country] ([id], [name]) VALUES ('AU', 'Australia'); INSERT INTO [country] ([id], [name]) VALUES ('AT', 'Austria'); INSERT INTO [country] ([id], [name]) VALUES ('AZ', 'Azerbaijan'); INSERT INTO [country] ([id], [name]) VALUES ('BS', 'Bahamas'); INSERT INTO [country] ([id], [name]) VALUES ('BH', 'Bahrain'); INSERT INTO [country] ([id], [name]) VALUES ('BD', 'Bangladesh'); INSERT INTO [country] ([id], [name]) VALUES ('BB', 'Barbados'); INSERT INTO [country] ([id], [name]) VALUES ('BY', 'Belarus'); INSERT INTO [country] ([id], [name]) VALUES ('BE', 'Belgium'); INSERT INTO [country] ([id], [name]) VALUES ('BZ', 'Belize'); INSERT INTO [country] ([id], [name]) VALUES ('BJ', 'Benin'); INSERT INTO [country] ([id], [name]) VALUES ('BM', 'Bermuda'); INSERT INTO [country] ([id], [name]) VALUES ('BT', 'Bhutan'); INSERT INTO [country] ([id], [name]) VALUES ('BO', 'Bolivia'); INSERT INTO [country] ([id], [name]) VALUES ('BA', 'Bosnia and Herzegovina'); INSERT INTO [country] ([id], [name]) VALUES ('BW', 'Botswana'); INSERT INTO [country] ([id], [name]) VALUES ('BV', 'Bouvet Island'); INSERT INTO [country] ([id], [name]) VALUES ('BR', 'Brazil'); INSERT INTO [country] ([id], [name]) VALUES ('IO', 'British Indian Ocean Territory'); INSERT INTO [country] ([id], [name]) VALUES ('VG', 'British Virgin Islands'); INSERT INTO [country] ([id], [name]) VALUES ('BN', 'Brunei'); INSERT INTO [country] ([id], [name]) VALUES ('BG', 'Bulgaria'); INSERT INTO [country] ([id], [name]) VALUES ('BF', 'Burkina Faso'); INSERT INTO [country] ([id], [name]) VALUES ('BI', 'Burundi'); INSERT INTO [country] ([id], [name]) VALUES ('KH', 'Cambodia'); INSERT INTO [country] ([id], [name]) VALUES ('CM', 'Cameroon'); INSERT INTO [country] ([id], [name]) VALUES ('CA', 'Canada'); INSERT INTO [country] ([id], [name]) VALUES ('IC', 'Canary Islands'); INSERT INTO [country] ([id], [name]) VALUES ('CV', 'Cape Verde'); INSERT INTO [country] ([id], [name]) VALUES ('BQ', 'Caribbean Netherlands'); INSERT INTO [country] ([id], [name]) VALUES ('KY', 'Cayman Islands'); INSERT INTO [country] ([id], [name]) VALUES ('CF', 'Central African Republic'); INSERT INTO [country] ([id], [name]) VALUES ('EA', 'Ceuta and Melilla'); INSERT INTO [country] ([id], [name]) VALUES ('TD', 'Chad'); INSERT INTO [country] ([id], [name]) VALUES ('CL', 'Chile'); INSERT INTO [country] ([id], [name]) VALUES ('CN', 'China'); INSERT INTO [country] ([id], [name]) VALUES ('CX', 'Christmas Island'); INSERT INTO [country] ([id], [name]) VALUES ('CP', 'Clipperton Island'); INSERT INTO [country] ([id], [name]) VALUES ('CC', 'Cocos (Keeling) Islands'); INSERT INTO [country] ([id], [name]) VALUES ('CO', 'Colombia'); INSERT INTO [country] ([id], [name]) VALUES ('KM', 'Comoros'); INSERT INTO [country] ([id], [name]) VALUES ('CG', 'Congo - Brazzaville'); INSERT INTO [country] ([id], [name]) VALUES ('CD', 'Congo - Kinshasa'); INSERT INTO [country] ([id], [name]) VALUES ('CK', 'Cook Islands'); INSERT INTO [country] ([id], [name]) VALUES ('CR', 'Costa Rica'); INSERT INTO [country] ([id], [name]) VALUES ('HR', 'Croatia'); INSERT INTO [country] ([id], [name]) VALUES ('CU', 'Cuba'); INSERT INTO [country] ([id], [name]) VALUES ('CW', 'CuraΓ§ao'); INSERT INTO [country] ([id], [name]) VALUES ('CY', 'Cyprus'); INSERT INTO [country] ([id], [name]) VALUES ('CZ', 'Czech Republic'); INSERT INTO [country] ([id], [name]) VALUES ('CI', 'CΓ΄te d’Ivoire'); INSERT INTO [country] ([id], [name]) VALUES ('DK', 'Denmark'); INSERT INTO [country] ([id], [name]) VALUES ('DG', 'Diego Garcia'); INSERT INTO [country] ([id], [name]) VALUES ('DJ', 'Djibouti'); INSERT INTO [country] ([id], [name]) VALUES ('DM', 'Dominica'); INSERT INTO [country] ([id], [name]) VALUES ('DO', 'Dominican Republic'); INSERT INTO [country] ([id], [name]) VALUES ('EC', 'Ecuador'); INSERT INTO [country] ([id], [name]) VALUES ('EG', 'Egypt'); INSERT INTO [country] ([id], [name]) VALUES ('SV', 'El Salvador'); INSERT INTO [country] ([id], [name]) VALUES ('GQ', 'Equatorial Guinea'); INSERT INTO [country] ([id], [name]) VALUES ('ER', 'Eritrea'); INSERT INTO [country] ([id], [name]) VALUES ('EE', 'Estonia'); INSERT INTO [country] ([id], [name]) VALUES ('ET', 'Ethiopia'); INSERT INTO [country] ([id], [name]) VALUES ('FK', 'Falkland Islands'); INSERT INTO [country] ([id], [name]) VALUES ('FO', 'Faroe Islands'); INSERT INTO [country] ([id], [name]) VALUES ('FJ', 'Fiji'); INSERT INTO [country] ([id], [name]) VALUES ('FI', 'Finland'); INSERT INTO [country] ([id], [name]) VALUES ('FR', 'France'); INSERT INTO [country] ([id], [name]) VALUES ('GF', 'French Guiana'); INSERT INTO [country] ([id], [name]) VALUES ('PF', 'French Polynesia'); INSERT INTO [country] ([id], [name]) VALUES ('TF', 'French Southern Territories'); INSERT INTO [country] ([id], [name]) VALUES ('GA', 'Gabon'); INSERT INTO [country] ([id], [name]) VALUES ('GM', 'Gambia'); INSERT INTO [country] ([id], [name]) VALUES ('GE', 'Georgia'); INSERT INTO [country] ([id], [name]) VALUES ('DE', 'Germany'); INSERT INTO [country] ([id], [name]) VALUES ('GH', 'Ghana'); INSERT INTO [country] ([id], [name]) VALUES ('GI', 'Gibraltar'); INSERT INTO [country] ([id], [name]) VALUES ('GR', 'Greece'); INSERT INTO [country] ([id], [name]) VALUES ('GL', 'Greenland'); INSERT INTO [country] ([id], [name]) VALUES ('GD', 'Grenada'); INSERT INTO [country] ([id], [name]) VALUES ('GP', 'Guadeloupe'); INSERT INTO [country] ([id], [name]) VALUES ('GU', 'Guam'); INSERT INTO [country] ([id], [name]) VALUES ('GT', 'Guatemala'); INSERT INTO [country] ([id], [name]) VALUES ('GG', 'Guernsey'); INSERT INTO [country] ([id], [name]) VALUES ('GN', 'Guinea'); INSERT INTO [country] ([id], [name]) VALUES ('GW', 'Guinea-Bissau'); INSERT INTO [country] ([id], [name]) VALUES ('GY', 'Guyana'); INSERT INTO [country] ([id], [name]) VALUES ('HT', 'Haiti'); INSERT INTO [country] ([id], [name]) VALUES ('HM', 'Heard & McDonald Islands'); INSERT INTO [country] ([id], [name]) VALUES ('HN', 'Honduras'); INSERT INTO [country] ([id], [name]) VALUES ('HK', 'Hong Kong SAR China'); INSERT INTO [country] ([id], [name]) VALUES ('HU', 'Hungary'); INSERT INTO [country] ([id], [name]) VALUES ('IS', 'Iceland'); INSERT INTO [country] ([id], [name]) VALUES ('IN', 'India'); INSERT INTO [country] ([id], [name]) VALUES ('ID', 'Indonesia'); INSERT INTO [country] ([id], [name]) VALUES ('IR', 'Iran'); INSERT INTO [country] ([id], [name]) VALUES ('IQ', 'Iraq'); INSERT INTO [country] ([id], [name]) VALUES ('IE', 'Ireland'); INSERT INTO [country] ([id], [name]) VALUES ('IM', 'Isle of Man'); INSERT INTO [country] ([id], [name]) VALUES ('IL', 'Israel'); INSERT INTO [country] ([id], [name]) VALUES ('IT', 'Italy'); INSERT INTO [country] ([id], [name]) VALUES ('JM', 'Jamaica'); INSERT INTO [country] ([id], [name]) VALUES ('JP', 'Japan'); INSERT INTO [country] ([id], [name]) VALUES ('JE', 'Jersey'); INSERT INTO [country] ([id], [name]) VALUES ('JO', 'Jordan'); INSERT INTO [country] ([id], [name]) VALUES ('KZ', 'Kazakhstan'); INSERT INTO [country] ([id], [name]) VALUES ('KE', 'Kenya'); INSERT INTO [country] ([id], [name]) VALUES ('KI', 'Kiribati'); INSERT INTO [country] ([id], [name]) VALUES ('XK', 'Kosovo'); INSERT INTO [country] ([id], [name]) VALUES ('KW', 'Kuwait'); INSERT INTO [country] ([id], [name]) VALUES ('KG', 'Kyrgyzstan'); INSERT INTO [country] ([id], [name]) VALUES ('LA', 'Laos'); INSERT INTO [country] ([id], [name]) VALUES ('LV', 'Latvia'); INSERT INTO [country] ([id], [name]) VALUES ('LB', 'Lebanon'); INSERT INTO [country] ([id], [name]) VALUES ('LS', 'Lesotho'); INSERT INTO [country] ([id], [name]) VALUES ('LR', 'Liberia'); INSERT INTO [country] ([id], [name]) VALUES ('LY', 'Libya'); INSERT INTO [country] ([id], [name]) VALUES ('LI', 'Liechtenstein'); INSERT INTO [country] ([id], [name]) VALUES ('LT', 'Lithuania'); INSERT INTO [country] ([id], [name]) VALUES ('LU', 'Luxembourg'); INSERT INTO [country] ([id], [name]) VALUES ('MO', 'Macau SAR China'); INSERT INTO [country] ([id], [name]) VALUES ('MK', 'Macedonia'); INSERT INTO [country] ([id], [name]) VALUES ('MG', 'Madagascar'); INSERT INTO [country] ([id], [name]) VALUES ('MW', 'Malawi'); INSERT INTO [country] ([id], [name]) VALUES ('MY', 'Malaysia'); INSERT INTO [country] ([id], [name]) VALUES ('MV', 'Maldives'); INSERT INTO [country] ([id], [name]) VALUES ('ML', 'Mali'); INSERT INTO [country] ([id], [name]) VALUES ('MT', 'Malta'); INSERT INTO [country] ([id], [name]) VALUES ('MH', 'Marshall Islands'); INSERT INTO [country] ([id], [name]) VALUES ('MQ', 'Martinique'); INSERT INTO [country] ([id], [name]) VALUES ('MR', 'Mauritania'); INSERT INTO [country] ([id], [name]) VALUES ('MU', 'Mauritius'); INSERT INTO [country] ([id], [name]) VALUES ('YT', 'Mayotte'); INSERT INTO [country] ([id], [name]) VALUES ('MX', 'Mexico'); INSERT INTO [country] ([id], [name]) VALUES ('FM', 'Micronesia'); INSERT INTO [country] ([id], [name]) VALUES ('MD', 'Moldova'); INSERT INTO [country] ([id], [name]) VALUES ('MC', 'Monaco'); INSERT INTO [country] ([id], [name]) VALUES ('MN', 'Mongolia'); INSERT INTO [country] ([id], [name]) VALUES ('ME', 'Montenegro'); INSERT INTO [country] ([id], [name]) VALUES ('MS', 'Montserrat'); INSERT INTO [country] ([id], [name]) VALUES ('MA', 'Morocco'); INSERT INTO [country] ([id], [name]) VALUES ('MZ', 'Mozambique'); INSERT INTO [country] ([id], [name]) VALUES ('MM', 'Myanmar (Burma)'); INSERT INTO [country] ([id], [name]) VALUES ('NA', 'Namibia'); INSERT INTO [country] ([id], [name]) VALUES ('NR', 'Nauru'); INSERT INTO [country] ([id], [name]) VALUES ('NP', 'Nepal'); INSERT INTO [country] ([id], [name]) VALUES ('NL', 'Netherlands'); INSERT INTO [country] ([id], [name]) VALUES ('AN', 'Netherlands Antilles'); INSERT INTO [country] ([id], [name]) VALUES ('NC', 'New Caledonia'); INSERT INTO [country] ([id], [name]) VALUES ('NZ', 'New Zealand'); INSERT INTO [country] ([id], [name]) VALUES ('NI', 'Nicaragua'); INSERT INTO [country] ([id], [name]) VALUES ('NE', 'Niger'); INSERT INTO [country] ([id], [name]) VALUES ('NG', 'Nigeria'); INSERT INTO [country] ([id], [name]) VALUES ('NU', 'Niue'); INSERT INTO [country] ([id], [name]) VALUES ('NF', 'Norfolk Island'); INSERT INTO [country] ([id], [name]) VALUES ('KP', 'North Korea'); INSERT INTO [country] ([id], [name]) VALUES ('MP', 'Northern Mariana Islands'); INSERT INTO [country] ([id], [name]) VALUES ('NO', 'Norway'); INSERT INTO [country] ([id], [name]) VALUES ('OM', 'Oman'); INSERT INTO [country] ([id], [name]) VALUES ('PK', 'Pakistan'); INSERT INTO [country] ([id], [name]) VALUES ('PW', 'Palau'); INSERT INTO [country] ([id], [name]) VALUES ('PS', 'Palestinian Territories'); INSERT INTO [country] ([id], [name]) VALUES ('PA', 'Panama'); INSERT INTO [country] ([id], [name]) VALUES ('PG', 'Papua New Guinea'); INSERT INTO [country] ([id], [name]) VALUES ('PY', 'Paraguay'); INSERT INTO [country] ([id], [name]) VALUES ('PE', 'Peru'); INSERT INTO [country] ([id], [name]) VALUES ('PH', 'Philippines'); INSERT INTO [country] ([id], [name]) VALUES ('PN', 'Pitcairn Islands'); INSERT INTO [country] ([id], [name]) VALUES ('PL', 'Poland'); INSERT INTO [country] ([id], [name]) VALUES ('PT', 'Portugal'); INSERT INTO [country] ([id], [name]) VALUES ('PR', 'Puerto Rico'); INSERT INTO [country] ([id], [name]) VALUES ('QA', 'Qatar'); INSERT INTO [country] ([id], [name]) VALUES ('RO', 'Romania'); INSERT INTO [country] ([id], [name]) VALUES ('RU', 'Russia'); INSERT INTO [country] ([id], [name]) VALUES ('RW', 'Rwanda'); INSERT INTO [country] ([id], [name]) VALUES ('RE', 'RΓ©union'); INSERT INTO [country] ([id], [name]) VALUES ('BL', 'Saint BarthΓ©lemy'); INSERT INTO [country] ([id], [name]) VALUES ('SH', 'Saint Helena'); INSERT INTO [country] ([id], [name]) VALUES ('KN', 'Saint Kitts and Nevis'); INSERT INTO [country] ([id], [name]) VALUES ('LC', 'Saint Lucia'); INSERT INTO [country] ([id], [name]) VALUES ('MF', 'Saint Martin'); INSERT INTO [country] ([id], [name]) VALUES ('PM', 'Saint Pierre and Miquelon'); INSERT INTO [country] ([id], [name]) VALUES ('WS', 'Samoa'); INSERT INTO [country] ([id], [name]) VALUES ('SM', 'San Marino'); INSERT INTO [country] ([id], [name]) VALUES ('SA', 'Saudi Arabia'); INSERT INTO [country] ([id], [name]) VALUES ('SN', 'Senegal'); INSERT INTO [country] ([id], [name]) VALUES ('RS', 'Serbia'); INSERT INTO [country] ([id], [name]) VALUES ('SC', 'Seychelles'); INSERT INTO [country] ([id], [name]) VALUES ('SL', 'Sierra Leone'); INSERT INTO [country] ([id], [name]) VALUES ('SG', 'Singapore'); INSERT INTO [country] ([id], [name]) VALUES ('SX', 'Sint Maarten'); INSERT INTO [country] ([id], [name]) VALUES ('SK', 'Slovakia'); INSERT INTO [country] ([id], [name]) VALUES ('SI', 'Slovenia'); INSERT INTO [country] ([id], [name]) VALUES ('SB', 'Solomon Islands'); INSERT INTO [country] ([id], [name]) VALUES ('SO', 'Somalia'); INSERT INTO [country] ([id], [name]) VALUES ('ZA', 'South Africa'); INSERT INTO [country] ([id], [name]) VALUES ('GS', 'South Georgia & South Sandwich Islands'); INSERT INTO [country] ([id], [name]) VALUES ('KR', 'South Korea'); INSERT INTO [country] ([id], [name]) VALUES ('SS', 'South Sudan'); INSERT INTO [country] ([id], [name]) VALUES ('ES', 'Spain'); INSERT INTO [country] ([id], [name]) VALUES ('LK', 'Sri Lanka'); INSERT INTO [country] ([id], [name]) VALUES ('VC', 'St. Vincent & Grenadines'); INSERT INTO [country] ([id], [name]) VALUES ('SD', 'Sudan'); INSERT INTO [country] ([id], [name]) VALUES ('SR', 'Suriname'); INSERT INTO [country] ([id], [name]) VALUES ('SJ', 'Svalbard and Jan Mayen'); INSERT INTO [country] ([id], [name]) VALUES ('SZ', 'Swaziland'); INSERT INTO [country] ([id], [name]) VALUES ('SE', 'Sweden'); INSERT INTO [country] ([id], [name]) VALUES ('CH', 'Switzerland'); INSERT INTO [country] ([id], [name]) VALUES ('SY', 'Syria'); INSERT INTO [country] ([id], [name]) VALUES ('ST', 'SΓ£o TomΓ© and PrΓ­ncipe'); INSERT INTO [country] ([id], [name]) VALUES ('TW', 'Taiwan'); INSERT INTO [country] ([id], [name]) VALUES ('TJ', 'Tajikistan'); INSERT INTO [country] ([id], [name]) VALUES ('TZ', 'Tanzania'); INSERT INTO [country] ([id], [name]) VALUES ('TH', 'Thailand'); INSERT INTO [country] ([id], [name]) VALUES ('TL', 'Timor-Leste'); INSERT INTO [country] ([id], [name]) VALUES ('TG', 'Togo'); INSERT INTO [country] ([id], [name]) VALUES ('TK', 'Tokelau'); INSERT INTO [country] ([id], [name]) VALUES ('TO', 'Tonga'); INSERT INTO [country] ([id], [name]) VALUES ('TT', 'Trinidad and Tobago'); INSERT INTO [country] ([id], [name]) VALUES ('TA', 'Tristan da Cunha'); INSERT INTO [country] ([id], [name]) VALUES ('TN', 'Tunisia'); INSERT INTO [country] ([id], [name]) VALUES ('TR', 'Turkey'); INSERT INTO [country] ([id], [name]) VALUES ('TM', 'Turkmenistan'); INSERT INTO [country] ([id], [name]) VALUES ('TC', 'Turks and Caicos Islands'); INSERT INTO [country] ([id], [name]) VALUES ('TV', 'Tuvalu'); INSERT INTO [country] ([id], [name]) VALUES ('UM', 'U.S. Outlying Islands'); INSERT INTO [country] ([id], [name]) VALUES ('VI', 'U.S. Virgin Islands'); INSERT INTO [country] ([id], [name]) VALUES ('UG', 'Uganda'); INSERT INTO [country] ([id], [name]) VALUES ('UA', 'Ukraine'); INSERT INTO [country] ([id], [name]) VALUES ('AE', 'United Arab Emirates'); INSERT INTO [country] ([id], [name]) VALUES ('GB', 'United Kingdom'); INSERT INTO [country] ([id], [name]) VALUES ('US', 'United States'); INSERT INTO [country] ([id], [name]) VALUES ('ZZ', 'Unknown Region'); INSERT INTO [country] ([id], [name]) VALUES ('UY', 'Uruguay'); INSERT INTO [country] ([id], [name]) VALUES ('UZ', 'Uzbekistan'); INSERT INTO [country] ([id], [name]) VALUES ('VU', 'Vanuatu'); INSERT INTO [country] ([id], [name]) VALUES ('VA', 'Vatican City'); INSERT INTO [country] ([id], [name]) VALUES ('VE', 'Venezuela'); INSERT INTO [country] ([id], [name]) VALUES ('VN', 'Vietnam'); INSERT INTO [country] ([id], [name]) VALUES ('WF', 'Wallis and Futuna'); INSERT INTO [country] ([id], [name]) VALUES ('EH', 'Western Sahara'); INSERT INTO [country] ([id], [name]) VALUES ('YE', 'Yemen'); INSERT INTO [country] ([id], [name]) VALUES ('ZM', 'Zambia'); INSERT INTO [country] ([id], [name]) VALUES ('ZW', 'Zimbabwe'); INSERT INTO [country] ([id], [name]) VALUES ('AX', 'Γ…land Islands');
rozehnal/country-list
country/cldr/en_VC/country.sqlserver.sql
SQL
mit
17,131
(function(){var f,k,q,l,m,s,o;"undefined"!==typeof require?(f=require("underscore"),k=require("backbone"),exports=module.exports=k):(f=window._,k=window.Backbone);q=k.Model;l=k.Collection;m=q.prototype;s="change add remove reset destroy sync error sort request".split(" ");k.Many="Many";k.One="One";o=k.AssociatedModel=q.extend({relations:void 0,_proxyCalls:void 0,get:function(d){return this.getAttr.apply(this,arguments)},set:function(d,a,c){var b,e,j,n,i=this;if(f.isObject(d)||d==null){b=d;c=a}else{b= {};b[d]=a}if(!b)return this;for(e in b){var a=r(e),d=f.initial(a),a=f.last(a),g=this,h=this.get(d);j||(j={});if(!(!h&&f.size(d)>0||h instanceof l)){h instanceof o&&(g=h);d=j[g.cid]||(j[g.cid]={model:g,data:{}});d.data[a]=b[e]}}if(j)for(n in j){d=j[n];this.setAttr.call(d.model,d.data,c)||(i=false)}else i=this.setAttr.call(this,b,c);return i},setAttr:function(d,a){var c,b,e;a||(a={});if(a.unset)for(e in d)d[e]=void 0;this.relations&&f.each(this.relations,function(b){var e=b.key,i=b.relatedModel,g=b.collectionType, h,p;if(d[e]){h=f.result(d,e);i&&f.isString(i)&&(i=eval(i));g&&f.isString(g)&&(g=eval(g));p=b.options?f.extend({},b.options,a):a;if(b.type===k.Many){if(g&&!g.prototype instanceof l)throw Error("collectionType must inherit from Backbone.Collection");if(h instanceof l)m.set.call(this,e,h,p);else if(this.attributes[e])this.attributes[e].reset(h,p);else{b=g?new g:this._createCollection(i);b.add(h,p);m.set.call(this,e,b,p)}}else if(b.type===k.One&&i){b=h instanceof o?h:new i(h);m.set.call(this,e,b,p)}if((h= this.attributes[e])&&!h._proxyCallback){h._proxyCallback=function(){return this._bubbleEvent.call(this,e,arguments)};h.on("all",h._proxyCallback,this)}!c&&(c=[]);f.indexOf(c,e)===-1&&c.push(e)}},this);if(c){b={};for(e in d)f.indexOf(c,e)===-1&&(b[e]=d[e])}else b=d;return m.set.call(this,b,a)},_bubbleEvent:function(d,a){var c=a[0].split(":"),b=c[0],e=a[1],j=-1,n=this.attributes[d],i=n._proxyCalls,g;if(f.contains(s,b)){f.size(c)>1&&(g=c[1]);if(n instanceof l&&"change"===b&&e){var h=r(g),k=f.initial(h); (c=n.find(function(b){var a=b.get(h);return e===(a instanceof o||a instanceof l)?a:b.get(k)||b}))&&(j=n.indexOf(c))}g=d+(j!==-1?"["+j+"]":"")+(g?"."+g:"");a[0]=b+":"+g;if(i){if(b=f.find(i,function(b,a){return g.indexOf(a,g.length-a.length)!==-1}))return this}else i=n._proxyCalls={};i[g]=true}this.trigger.apply(this,a);g&&i&&delete i[g];return this},_createCollection:function(d){var a=d;f.isString(a)&&(a=eval(a));if(a&&a.prototype instanceof o){d=new l;d.model=a}else throw Error("type must inherit from Backbone.AssociatedModel"); return d},hasChanged:function(d){var a,c,b;if(!this.visitedHC){this.visitedHC=true;a=m.hasChanged.apply(this,arguments);if(!a&&this.relations)for(b=0;b<this.relations.length;++b){c=this.relations[b];if(c=this.attributes[c.key]){if(c instanceof l){c=c.filter(function(a){return a.hasChanged()===true});f.size(c)>0&&(a=true)}else a=c.hasChanged&&c.hasChanged();if(a)break}}delete this.visitedHC}return!!a},changedAttributes:function(d){var a,c,b,e;if(!this.visited){this.visited=true;a=m.changedAttributes.apply(this, arguments);if(this.relations)for(e=0;e<this.relations.length;++e){c=this.relations[e];if(b=this.attributes[c.key])if(b instanceof l){b=f.filter(b.map(function(a){return a.changedAttributes()}),function(a){return!!a});f.size(b)>0&&(a[c.key]=b)}else b instanceof o&&b.hasChanged()&&(a[c.key]=b.toJSON())}delete this.visited}return!a?false:a},previousAttributes:function(){var d,a,c,b;if(!this.visited){this.visited=true;d=m.previousAttributes.apply(this,arguments);this.relations&&f.each(this.relations, function(e){a=this.attributes[e.key];b=(c=d[e.key])?c.toJSON():void 0;c&&c==a?a instanceof o?d[e.key]=a.previousAttributes():a instanceof l&&(d[e.key]=a.map(function(a){return a.previousAttributes()})):c&&(d[e.key]=b)},this);delete this.visited}return d},previous:function(d){return this.previousAttributes()[d]},toJSON:function(d){var a,c;if(!this.visited){this.visited=true;a=m.toJSON.apply(this,arguments);this.relations&&f.each(this.relations,function(b){var e=this.attributes[b.key];if(e){c=e.toJSON(d); a[b.key]=f.isArray(c)?f.compact(c):c}},this);delete this.visited}return a},clone:function(){return new this.constructor(this.toJSON())},getAttr:function(d,a){var c=this,b=r(d),e,j;if(!(f.size(b)<1)){a||(a=function(a,b){return a instanceof l&&f.isNumber(b)?a.at(b):a.attributes[b]});for(j=0;j<b.length;j++){e=b[j];if(!c)break;c=a.call(this,c,e,b)}return c}}});var t=/^\d+$/,u=/[^\.\[\]]+/g,r=function(d,a,c){if(f.isString(d)){a||(a=function(a){return a.match(t)?parseInt(a,10):a});return f.map(d.match(u)|| [""],a,c)}return d||[""]}})();
wallin/cdnjs
ajax/libs/backbone-associations/0.4.0/backbone-associations-min.js
JavaScript
mit
4,636
#loading-bar,#loading-bar-spinner{pointer-events:none;-webkit-pointer-events:none;-webkit-transition:350ms linear all;-moz-transition:350ms linear all;-o-transition:350ms linear all;transition:350ms linear all}#loading-bar-spinner.ng-enter,#loading-bar-spinner.ng-leave.ng-leave-active,#loading-bar.ng-enter,#loading-bar.ng-leave.ng-leave-active{opacity:0}#loading-bar-spinner.ng-enter.ng-enter-active,#loading-bar-spinner.ng-leave,#loading-bar.ng-enter.ng-enter-active,#loading-bar.ng-leave{opacity:1}#loading-bar .bar{-webkit-transition:width 350ms;-moz-transition:width 350ms;-o-transition:width 350ms;transition:width 350ms;background:#29d;position:fixed;z-index:10002;top:0;left:0;width:100%;height:2px;border-bottom-right-radius:1px;border-top-right-radius:1px}#loading-bar .peg{position:absolute;width:70px;right:0;top:0;height:2px;opacity:.45;-moz-box-shadow:#29d 1px 0 6px 1px;-ms-box-shadow:#29d 1px 0 6px 1px;-webkit-box-shadow:#29d 1px 0 6px 1px;box-shadow:#29d 1px 0 6px 1px;-moz-border-radius:100%;-webkit-border-radius:100%;border-radius:100%}#loading-bar-spinner{display:block;position:fixed;z-index:10002;top:10px;left:10px}#loading-bar-spinner .spinner-icon{width:14px;height:14px;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:loading-bar-spinner 400ms linear infinite;-moz-animation:loading-bar-spinner 400ms linear infinite;-ms-animation:loading-bar-spinner 400ms linear infinite;-o-animation:loading-bar-spinner 400ms linear infinite;animation:loading-bar-spinner 400ms linear infinite}@-webkit-keyframes loading-bar-spinner{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes loading-bar-spinner{0%{-moz-transform:rotate(0);transform:rotate(0)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes loading-bar-spinner{0%{-o-transform:rotate(0);transform:rotate(0)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes loading-bar-spinner{0%{-ms-transform:rotate(0);transform:rotate(0)}100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes loading-bar-spinner{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}
acomerci/SalesManagement
src/main/webapp/resources/css/loading-bar.min.css
CSS
mit
2,236
/** * Drawing mode */ .amcharts-export-canvas { position: absolute; display: none; z-index: 1; top: 0; right: 0; bottom: 0; left: 0; background-color: #fff; } .amcharts-export-canvas.active { display: block; } /** * Menu; Rest state */ .amcharts-export-menu { position: absolute; z-index: 2; opacity: 0.5; color: #000; } .amcharts-main-div:hover .amcharts-export-menu, .amcharts-stock-div:hover .amcharts-export-menu, .amcharts-export-menu.active { opacity: 1; } .amcharts-export-menu-top-left > ul > li > ul:after { content: ""; position: absolute; top: 13px; right: 100%; z-index: 1000; border-top: 7px solid transparent; border-left: 7px solid transparent; border-right: 7px solid #fff; border-bottom: 7px solid transparent; } .amcharts-export-menu-top-left > ul > li > ul > li:first-child > a:after { content: ""; position: absolute; top: 12px; right: 100%; z-index: 1001; border-top: 8px solid transparent; border-left: 8px solid transparent; border-right: 8px solid #e2e2e2; border-bottom: 8px solid transparent; } .amcharts-export-menu-top-right > ul > li > ul:after { content: ""; position: absolute; top: 13px; left: 100%; z-index: 1000; border-top: 7px solid transparent; border-left: 7px solid #fff; border-right: 7px solid transparent; border-bottom: 7px solid transparent; } .amcharts-export-menu-top-right > ul > li > ul > li:first-child > a:after { content: ""; position: absolute; top: 12px; left: 100%; z-index: 1001; border-top: 8px solid transparent; border-left: 8px solid #e2e2e2; border-right: 8px solid transparent; border-bottom: 8px solid transparent; } .amcharts-export-menu-bottom-left > ul > li > ul:after { content: ""; position: absolute; bottom: 13px; right: 100%; z-index: 1000; border-top: 7px solid transparent; border-left: 7px solid transparent; border-right: 7px solid #fff; border-bottom: 7px solid transparent; } .amcharts-export-menu-bottom-left > ul > li > ul > li:last-child > a:after { content: ""; position: absolute; bottom: 12px; right: 100%; z-index: 1001; border-top: 8px solid transparent; border-left: 8px solid transparent; border-right: 8px solid #e2e2e2; border-bottom: 8px solid transparent; } .amcharts-export-menu-bottom-right > ul > li > ul:after { content: ""; position: absolute; bottom: 13px; left: 100%; z-index: 1000; border-top: 7px solid transparent; border-left: 7px solid #fff; border-right: 7px solid transparent; border-bottom: 7px solid transparent; } .amcharts-export-menu-bottom-right > ul > li > ul > li:last-child > a:after { content: ""; position: absolute; bottom: 12px; left: 100%; z-index: 1001; border-top: 8px solid transparent; border-left: 8px solid #e2e2e2; border-right: 8px solid transparent; border-bottom: 8px solid transparent; } .amcharts-export-menu ul { list-style: none; margin: 0; padding: 0; } .amcharts-export-menu li { position: relative; display: block; z-index: 1; } .amcharts-export-menu li > ul { position: absolute; display: none; border: 1px solid #e2e2e2; margin-top: -1px; background: #fff; } .amcharts-export-menu li > a { position: relative; display: block; color: #000; text-decoration: none; padding: 12px 12px; z-index: 2; white-space: nowrap; border-bottom: 1px solid #f2f2f2; } .amcharts-export-menu li:last-child > a { border-bottom: none; } .amcharts-export-menu li > a > img { border: none; } .amcharts-export-menu-top-left { top: 0; left: 0; } .amcharts-export-menu-bottom-left { bottom: 0; left: 0; } .amcharts-export-menu-top-right { top: 0; right: 0; } .amcharts-export-menu-bottom-right { bottom: 0; right: 0; } /** * Menu; Hover state */ .amcharts-export-menu li:hover > ul, .amcharts-export-menu li.active > ul { display: block; } .amcharts-export-menu li:hover > a, .amcharts-export-menu li.active > a { color: #fff; background-color: #636363; } .amcharts-export-menu-top-left li:hover > ul, .amcharts-export-menu-top-left li.active > ul { left: 100%; top: 0; } .amcharts-export-menu-bottom-left li:hover > ul, .amcharts-export-menu-bottom-left li.active > ul { left: 100%; bottom: 0; } .amcharts-export-menu-top-right li:hover > ul, .amcharts-export-menu-top-right li.active > ul { top: 0; right: 100%; } .amcharts-export-menu-bottom-right li:hover > ul, .amcharts-export-menu-bottom-right li.active > ul { bottom: 0; right: 100%; } /** * Menu; custom class */ .amcharts-export-menu .export-main > a, .amcharts-export-menu .export-drawing > a, .amcharts-export-menu .export-delayed-capturing > a { display: block; overflow: hidden; text-indent: -13333337px; width: 36px; height: 36px; padding: 0; background-repeat: no-repeat; background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%2211px%22%20height%3D%2214px%22%3E%3Cpath%20d%3D%22M3%2C0%20L8%2C0%20L8%2C5%20L11%2C5%20L5.5%2C10%20L0%2C5%20L3%2C5%20L03%2C0%22%20fill%3D%22%23888%22%2F%3E%3Crect%20x%3D%220%22%20y%3D%2212%22%20fill%3D%22%23888%22%20width%3D%2211%22%20height%3D%222%22%2F%3E%3C%2Fsvg%3E'); background-color: #fff; background-position: center; -webkit-box-shadow: 1px 1px 3px 0px rgba(0,0,0,0.5); -moz-box-shadow: 1px 1px 3px 0px rgba(0,0,0,0.5); box-shadow: 1px 1px 3px 0px rgba(0,0,0,0.5); border-radius: 18px; margin: 8px 8px 0 10px; } .amcharts-export-menu .export-drawing > a { background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20width%3D%2216px%22%20height%3D%2217px%22%3E%3Crect%20x%3D%220%22%20y%3D%2216%22%20fill%3D%22%23888%22%20width%3D%2214%22%20height%3D%221%22%2F%3E%3Cpath%20transform%3D%22translate(-12%2C-10)%22%20fill%3D%22%23888%22%20d%3D%22M17.098%2C20.305c-0.142%2C0.146%2C0.101%2C0.04%2C0.137%2C0.004c0.027-0.028%2C0.204-0.09%2C0.484-0.09c0.338%2C0%2C0.626%2C0.092%2C0.787%2C0.255%20c0.473%2C0.472%2C0.424%2C0.932%2C0.393%2C1.078l-2.521%2C1.055l-1.577-1.577l1.054-2.52c0.039-0.009%2C0.105-0.018%2C0.188-0.018%20c0.219%2C0%2C0.555%2C0.069%2C0.893%2C0.407c0.378%2C0.378%2C0.246%2C1.188%2C0.166%2C1.271C17.062%2C20.207%2C17.062%2C20.269%2C17.098%2C20.305z%20M26.984%2C14.472c-0.008-0.674-0.61-1.257-1.31-1.933c-0.134-0.129-0.679-0.673-0.809-0.808c-0.679-0.702-1.266-1.31-1.943-1.31%20c-0.37%2C0-0.734%2C0.207-1.114%2C0.587l-6.852%2C6.847c-0.012%2C0.016-2.877%2C7.354-2.877%2C7.354c-0.012%2C0.032%2C0%2C0.063%2C0.022%2C0.091%20c0.021%2C0.021%2C0.044%2C0.029%2C0.067%2C0.029c0.01%2C0%2C0.018-0.003%2C0.028-0.007c0%2C0%2C7.357-2.864%2C7.369-2.877l6.854-6.847%20C26.803%2C15.216%2C26.988%2C14.848%2C26.984%2C14.472z%22%2F%3E%3C%2Fsvg%3E'); } .amcharts-export-menu .export-main:hover, .amcharts-export-menu .export-drawing:hover, .amcharts-export-menu .export-main.active, .amcharts-export-menu .export-drawing.active { padding-bottom: 100px; } .amcharts-export-menu.amcharts-export-menu-bottom-left .export-main:hover, .amcharts-export-menu.amcharts-export-menu-bottom-left .export-drawing:hover, .amcharts-export-menu.amcharts-export-menu-bottom-right .export-main:hover, .amcharts-export-menu.amcharts-export-menu-bottom-right .export-drawing:hover, .amcharts-export-menu.amcharts-export-menu-bottom-left .export-main.active, .amcharts-export-menu.amcharts-export-menu-bottom-left .export-drawing.active, .amcharts-export-menu.amcharts-export-menu-bottom-right .export-main.active, .amcharts-export-menu.amcharts-export-menu-bottom-right .export-drawing.active { padding-bottom: 0; padding-top: 100px; } .amcharts-export-menu .export-main:hover > a, .amcharts-export-menu .export-main.active > a { background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%2211px%22%20height%3D%2214px%22%3E%3Cpath%20d%3D%22M3%2C0%20L8%2C0%20L8%2C5%20L11%2C5%20L5.5%2C10%20L0%2C5%20L3%2C5%20L03%2C0%22%20fill%3D%22%23fff%22%2F%3E%3Crect%20x%3D%220%22%20y%3D%2212%22%20fill%3D%22%23fff%22%20width%3D%2211%22%20height%3D%222%22%2F%3E%3C%2Fsvg%3E'); } .amcharts-export-menu .export-drawing:hover > a, .amcharts-export-menu .export-drawing.active > a { background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20width%3D%2216px%22%20height%3D%2217px%22%3E%3Crect%20x%3D%220%22%20y%3D%2216%22%20fill%3D%22%23FFF%22%20width%3D%2214%22%20height%3D%221%22%2F%3E%3Cpath%20transform%3D%22translate(-12%2C-10)%22%20fill%3D%22%23FFF%22%20d%3D%22M17.098%2C20.305c-0.142%2C0.146%2C0.101%2C0.04%2C0.137%2C0.004c0.027-0.028%2C0.204-0.09%2C0.484-0.09c0.338%2C0%2C0.626%2C0.092%2C0.787%2C0.255%20c0.473%2C0.472%2C0.424%2C0.932%2C0.393%2C1.078l-2.521%2C1.055l-1.577-1.577l1.054-2.52c0.039-0.009%2C0.105-0.018%2C0.188-0.018%20c0.219%2C0%2C0.555%2C0.069%2C0.893%2C0.407c0.378%2C0.378%2C0.246%2C1.188%2C0.166%2C1.271C17.062%2C20.207%2C17.062%2C20.269%2C17.098%2C20.305z%20M26.984%2C14.472c-0.008-0.674-0.61-1.257-1.31-1.933c-0.134-0.129-0.679-0.673-0.809-0.808c-0.679-0.702-1.266-1.31-1.943-1.31%20c-0.37%2C0-0.734%2C0.207-1.114%2C0.587l-6.852%2C6.847c-0.012%2C0.016-2.877%2C7.354-2.877%2C7.354c-0.012%2C0.032%2C0%2C0.063%2C0.022%2C0.091%20c0.021%2C0.021%2C0.044%2C0.029%2C0.067%2C0.029c0.01%2C0%2C0.018-0.003%2C0.028-0.007c0%2C0%2C7.357-2.864%2C7.369-2.877l6.854-6.847%20C26.803%2C15.216%2C26.988%2C14.848%2C26.984%2C14.472z%22%2F%3E%3C%2Fsvg%3E'); } .amcharts-export-menu .export-close > a, .amcharts-export-menu .export-close:hover > a, .amcharts-export-menu .export-close.active > a { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAQCAYAAADNo/U5AAAACXBIWXMAAAsTAAALEwEAmpwYAABBsGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS41LWMwMjEgNzkuMTU1NzcyLCAyMDE0LzAxLzEzLTE5OjQ0OjAwICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgICAgICAgICB4bWxuczpwaG90b3Nob3A9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGhvdG9zaG9wLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIgogICAgICAgICAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyI+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDo4M2Q5NDllYS1lMjE3LTQ3Y2QtYTU1Ni04MTQ3NmRjNWEwYWQ8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkRvY3VtZW50SUQ+YWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjZhMTQ5MTc1LTNiODItMTE3OC05ZjZmLWY0MWMwNTYyYzQxYTwveG1wTU06RG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDpkZGFhNTJkMi1mZDRiLTRkMmMtODEzOC01ZTEzNmQ4NGFjMDE8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEZXJpdmVkRnJvbSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgIDxzdFJlZjppbnN0YW5jZUlEPnhtcC5paWQ6MDdhZmI1Y2UtYzQ1OS00YzQxLWJkMjItMTllMDJlMGE5YzVjPC9zdFJlZjppbnN0YW5jZUlEPgogICAgICAgICAgICA8c3RSZWY6ZG9jdW1lbnRJRD54bXAuZGlkOjA3YWZiNWNlLWM0NTktNGM0MS1iZDIyLTE5ZTAyZTBhOWM1Yzwvc3RSZWY6ZG9jdW1lbnRJRD4KICAgICAgICAgICAgPHN0UmVmOm9yaWdpbmFsRG9jdW1lbnRJRD54bXAuZGlkOjgzZDk0OWVhLWUyMTctNDdjZC1hNTU2LTgxNDc2ZGM1YTBhZDwvc3RSZWY6b3JpZ2luYWxEb2N1bWVudElEPgogICAgICAgICA8L3htcE1NOkRlcml2ZWRGcm9tPgogICAgICAgICA8eG1wTU06SGlzdG9yeT4KICAgICAgICAgICAgPHJkZjpTZXE+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6YmY3ZmRlNGYtZDk2MS00Njk4LWI0ZjAtMDJlYjEwOWE4OTA4PC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA1LTE1VDEzOjE3OjQ5KzAyOjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAyMSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNvbnZlcnRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5mcm9tIGltYWdlL3BuZyB0byBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wPC9zdEV2dDpwYXJhbWV0ZXJzPgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ZGVyaXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5jb252ZXJ0ZWQgZnJvbSBpbWFnZS9wbmcgdG8gYXBwbGljYXRpb24vdm5kLmFkb2JlLnBob3Rvc2hvcDwvc3RFdnQ6cGFyYW1ldGVycz4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MDdhZmI1Y2UtYzQ1OS00YzQxLWJkMjItMTllMDJlMGE5YzVjPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA1LTE1VDEzOjE3OjQ5KzAyOjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAyMSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmRlcml2ZWQ8L3N0RXZ0OmFjdGlvbj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OnBhcmFtZXRlcnM+Y29udmVydGVkIGZyb20gYXBwbGljYXRpb24vdm5kLmFkb2JlLnBob3Rvc2hvcCB0byBpbWFnZS9wbmc8L3N0RXZ0OnBhcmFtZXRlcnM+CiAgICAgICAgICAgICAgIDwvcmRmOmxpPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5zYXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6aW5zdGFuY2VJRD54bXAuaWlkOmRkYWE1MmQyLWZkNGItNGQyYy04MTM4LTVlMTM2ZDg0YWMwMTwvc3RFdnQ6aW5zdGFuY2VJRD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OndoZW4+MjAxNS0wNS0xNVQxMzoyMToyMSswMjowMDwvc3RFdnQ6d2hlbj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OnNvZnR3YXJlQWdlbnQ+QWRvYmUgUGhvdG9zaG9wIENDIDIwMjEgKE1hY2ludG9zaCk8L3N0RXZ0OnNvZnR3YXJlQWdlbnQ+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDpjaGFuZ2VkPi88L3N0RXZ0OmNoYW5nZWQ+CiAgICAgICAgICAgICAgIDwvcmRmOmxpPgogICAgICAgICAgICA8L3JkZjpTZXE+CiAgICAgICAgIDwveG1wTU06SGlzdG9yeT4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNCAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNS0xNVQxMzoxMzoxNyswMjowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA1LTE1VDEzOjIxOjIxKzAyOjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPHhtcDpNZXRhZGF0YURhdGU+MjAxNS0wNS0xNVQxMzoyMToyMSswMjowMDwveG1wOk1ldGFkYXRhRGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHBob3Rvc2hvcDpUZXh0TGF5ZXJzPgogICAgICAgICAgICA8cmRmOkJhZz4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxwaG90b3Nob3A6TGF5ZXJOYW1lPlg8L3Bob3Rvc2hvcDpMYXllck5hbWU+CiAgICAgICAgICAgICAgICAgIDxwaG90b3Nob3A6TGF5ZXJUZXh0Plg8L3Bob3Rvc2hvcDpMYXllclRleHQ+CiAgICAgICAgICAgICAgIDwvcmRmOmxpPgogICAgICAgICAgICA8L3JkZjpCYWc+CiAgICAgICAgIDwvcGhvdG9zaG9wOlRleHRMYXllcnM+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOlhSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpYUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6WVJlc29sdXRpb24+NzIwMDAwLzEwMDAwPC90aWZmOllSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4yPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8ZXhpZjpDb2xvclNwYWNlPjY1NTM1PC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4xMzwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4xNjwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIAo8P3hwYWNrZXQgZW5kPSJ3Ij8+HyMp+AAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAA3UlEQVR42rSSXZECQQyEPygMrIVFAidhkQASQEIjYVsCSOAksBJAAlhAwvKSWcJBUQVVl6fM5Ke7k4z6vudTG/OFTQAktcAs/ja2TyVBUgVsgQq42F5PItYBCn8PTFNjAYvw5wM92x3gCNSSFCh1araLvAdNBi53VgMtgCuweRqE7RyogAPQxHsdcQBGf0cuaZ80APzaXn468urtniQ1CaXoayStct5AL4QfgToKfoBzIF2BadGVkVZRkIU7UdQDkqRZoDwJl3ROzea2u4LUvtpHOavkty9H/m9XfhsA0l9VuzQDWrIAAAAASUVORK5CYII=); } /** * Menu; Color picker */ .amcharts-export-menu .export-drawing-color { background: #000; width: 35px; } .amcharts-export-menu .export-drawing-color > a { display: block; overflow: hidden; text-indent: -13333337px; } .amcharts-export-menu .export-drawing-color-red { background: #f00; } .amcharts-export-menu .export-drawing-color-green { background: #0f0; } .amcharts-export-menu .export-drawing-color-blue { background: #00f; } .amcharts-export-menu .export-drawing-color-white { background: #fff; } /* ** Fallback */ .amcharts-export-fallback { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background-color: #fff; } .amcharts-export-fallback textarea { border: none; outline: none; position: absolute; overflow: hidden; width: 100%; height: 100%; padding: 20px; } .amcharts-export-fallback-message { position: absolute; z-index: 1; padding: 20px; width: 100%; background-color: #fff; } /* ** DELAYED CAPTURING */ .amcharts-export-menu .export-delayed-capturing > a { text-indent: 0px; line-height: 36px; vertical-align: middle; text-align: center; background-image: none; } /* ** TRANSITION; OPACITY */ .amcharts-export-menu, .amcharts-export-canvas .canvas-container { -webkit-transition: opacity 0.5s ease-out; -moz-transition: opacity 0.5s ease-out; -ms-transition: opacity 0.5s ease-out; -o-transition: opacity 0.5s ease-out; transition: opacity 0.5s ease-out; } .amcharts-export-canvas.dropbox .canvas-container { opacity: 0.5; } /* ** SHAPE */ .amcharts-export-menu .export-drawing-shape a { font: 0/0 a; text-shadow: none; color: transparent; } .amcharts-export-menu li img { height: 20px; } /* ** BRUSH */ .amcharts-export-menu .export-drawing-width a { text-align: center; } .amcharts-export-menu .export-drawing-width span { display: block; margin: 0 auto; } .amcharts-export-menu .export-drawing-width span > span { display: block; background: #000; border-radius: 100%; } .amcharts-export-menu .export-drawing-shape a:hover img, .amcharts-export-menu .export-drawing-shape.active a img { -webkit-filter: invert(100%); filter: invert(100%); }
him2him2/cdnjs
ajax/libs/amcharts/3.20.17/plugins/export/export.css
CSS
mit
34,849
"no use strict";(function(e){if(typeof e.window!="undefined"&&e.document)return;e.console=function(){var e=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:e})},e.console.error=e.console.warn=e.console.log=e.console.trace=e.console,e.window=e,e.ace=e,e.onerror=function(e,t,n,r,i){console.error("Worker "+(i?i.stack:e))},e.normalizeModule=function(t,n){if(n.indexOf("!")!==-1){var r=n.split("!");return e.normalizeModule(t,r[0])+"!"+e.normalizeModule(t,r[1])}if(n.charAt(0)=="."){var i=t.split("/").slice(0,-1).join("/");n=(i?i+"/":"")+n;while(n.indexOf(".")!==-1&&s!=n){var s=n;n=n.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return n},e.require=function(t,n){n||(n=t,t=null);if(!n.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");n=e.normalizeModule(t,n);var r=e.require.modules[n];if(r)return r.initialized||(r.initialized=!0,r.exports=r.factory().exports),r.exports;var i=n.split("/");if(!e.require.tlns)return console.log("unable to load "+n);i[0]=e.require.tlns[i[0]]||i[0];var s=i.join("/")+".js";return e.require.id=n,importScripts(s),e.require(t,n)},e.require.modules={},e.require.tlns={},e.define=function(t,n,r){arguments.length==2?(r=n,typeof t!="string"&&(n=t,t=e.require.id)):arguments.length==1&&(r=t,n=[],t=e.require.id),n.length||(n=["require","exports","module"]);if(t.indexOf("text!")===0)return;var i=function(n){return e.require(t,n)};e.require.modules[t]={exports:{},factory:function(){var e=this,t=r.apply(this,n.map(function(t){switch(t){case"require":return i;case"exports":return e.exports;case"module":return e;default:return i(t)}}));return t&&(e.exports=t),e}}},e.define.amd={},e.initBaseUrls=function(e){require.tlns=e},e.initSender=function(){var t=e.require("ace/lib/event_emitter").EventEmitter,n=e.require("ace/lib/oop"),r=function(){};return function(){n.implement(this,t),this.callback=function(e,t){postMessage({type:"call",id:t,data:e})},this.emit=function(e,t){postMessage({type:"event",name:e,data:t})}}.call(r.prototype),new r};var t=e.main=null,n=e.sender=null;e.onmessage=function(r){var i=r.data;if(i.command){if(!t[i.command])throw new Error("Unknown command:"+i.command);t[i.command].apply(t,i.args)}else if(i.init){initBaseUrls(i.tlns),require("ace/lib/es5-shim"),n=e.sender=initSender();var s=require(i.module)[i.classname];t=e.main=new s(n)}else i.event&&n&&n._signal(i.event,i.data)}})(this),ace.define("ace/mode/lua_worker",["require","exports","module","ace/lib/oop","ace/worker/mirror","ace/mode/lua/luaparse"],function(e,t,n){var r=e("../lib/oop"),i=e("../worker/mirror").Mirror,s=e("../mode/lua/luaparse"),o=t.Worker=function(e){i.call(this,e),this.setTimeout(500)};r.inherits(o,i),function(){this.onUpdate=function(){var e=this.doc.getValue();try{s.parse(e)}catch(t){t instanceof SyntaxError&&this.sender.emit("error",{row:t.line-1,column:t.column,text:t.message,type:"error"});return}this.sender.emit("ok")}}.call(o.prototype)}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t,n){t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/worker/mirror",["require","exports","module","ace/document","ace/lib/lang"],function(e,t,n){var r=e("../document").Document,i=e("../lib/lang"),s=t.Mirror=function(e){this.sender=e;var t=this.doc=new r(""),n=this.deferredUpdate=i.delayedCall(this.onUpdate.bind(this)),s=this;e.on("change",function(e){t.applyDeltas(e.data);if(s.$timeout)return n.schedule(s.$timeout);s.onUpdate()})};(function(){this.$timeout=500,this.setTimeout=function(e){this.$timeout=e},this.setValue=function(e){this.doc.setValue(e),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(e){this.sender.callback(this.doc.getValue(),e)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(s.prototype)}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}function i(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(t){}}function s(e){return e=+e,e!==e?e=0:e!==0&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}function o(e){var t=typeof e;return e===null||t==="undefined"||t==="boolean"||t==="number"||t==="string"}function u(e){var t,n,r;if(o(e))return e;n=e.valueOf;if(typeof n=="function"){t=n.call(e);if(o(t))return t}r=e.toString;if(typeof r=="function"){t=r.call(e);if(o(t))return t}throw new TypeError}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if(typeof t!="function")throw new TypeError("Function.prototype.bind called on incompatible "+t);var n=c.call(arguments,1),i=function(){if(this instanceof i){var r=t.apply(this,n.concat(c.call(arguments)));return Object(r)===r?r:this}return t.apply(e,n.concat(c.call(arguments)))};return t.prototype&&(r.prototype=t.prototype,i.prototype=new r,r.prototype=null),i});var a=Function.prototype.call,f=Array.prototype,l=Object.prototype,c=f.slice,h=a.bind(l.toString),p=a.bind(l.hasOwnProperty),d,v,m,g,y;if(y=p(l,"__defineGetter__"))d=a.bind(l.__defineGetter__),v=a.bind(l.__defineSetter__),m=a.bind(l.__lookupGetter__),g=a.bind(l.__lookupSetter__);if([1,2].splice(0).length!=2)if(!function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t=[],n;t.splice.apply(t,e(20)),t.splice.apply(t,e(26)),n=t.length,t.splice(5,0,"XXX"),n+1==t.length;if(n+1==t.length)return!0}())Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):e==void 0?e=0:e<0&&(e=Math.max(n+e,0)),e+t<n||(t=n-e);var r=this.slice(e,e+t),i=c.call(arguments,2),s=i.length;if(e===n)s&&this.push.apply(this,i);else{var o=Math.min(t,n-e),u=e+o,a=u+s-o,f=n-u,l=n-o;if(a<u)for(var h=0;h<f;++h)this[a+h]=this[u+h];else if(a>u)for(h=f;h--;)this[a+h]=this[u+h];if(s&&e===l)this.length=l,this.push.apply(this,i);else{this.length=l+s;for(h=0;h<s;++h)this[e+h]=i[h]}}return r};else{var b=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?b.apply(this,[e===void 0?0:e,t===void 0?this.length-e:t].concat(c.call(arguments,2))):[]}}Array.isArray||(Array.isArray=function(e){return h(e)=="[object Array]"});var w=Object("a"),E=w[0]!="a"||!(0 in w);Array.prototype.forEach||(Array.prototype.forEach=function(e){var t=F(this),n=E&&h(this)=="[object String]"?this.split(""):t,r=arguments[1],i=-1,s=n.length>>>0;if(h(e)!="[object Function]")throw new TypeError;while(++i<s)i in n&&e.call(r,n[i],i,t)}),Array.prototype.map||(Array.prototype.map=function(e){var t=F(this),n=E&&h(this)=="[object String]"?this.split(""):t,r=n.length>>>0,i=Array(r),s=arguments[1];if(h(e)!="[object Function]")throw new TypeError(e+" is not a function");for(var o=0;o<r;o++)o in n&&(i[o]=e.call(s,n[o],o,t));return i}),Array.prototype.filter||(Array.prototype.filter=function(e){var t=F(this),n=E&&h(this)=="[object String]"?this.split(""):t,r=n.length>>>0,i=[],s,o=arguments[1];if(h(e)!="[object Function]")throw new TypeError(e+" is not a function");for(var u=0;u<r;u++)u in n&&(s=n[u],e.call(o,s,u,t)&&i.push(s));return i}),Array.prototype.every||(Array.prototype.every=function(e){var t=F(this),n=E&&h(this)=="[object String]"?this.split(""):t,r=n.length>>>0,i=arguments[1];if(h(e)!="[object Function]")throw new TypeError(e+" is not a function");for(var s=0;s<r;s++)if(s in n&&!e.call(i,n[s],s,t))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(e){var t=F(this),n=E&&h(this)=="[object String]"?this.split(""):t,r=n.length>>>0,i=arguments[1];if(h(e)!="[object Function]")throw new TypeError(e+" is not a function");for(var s=0;s<r;s++)if(s in n&&e.call(i,n[s],s,t))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(e){var t=F(this),n=E&&h(this)=="[object String]"?this.split(""):t,r=n.length>>>0;if(h(e)!="[object Function]")throw new TypeError(e+" is not a function");if(!r&&arguments.length==1)throw new TypeError("reduce of empty array with no initial value");var i=0,s;if(arguments.length>=2)s=arguments[1];else do{if(i in n){s=n[i++];break}if(++i>=r)throw new TypeError("reduce of empty array with no initial value")}while(!0);for(;i<r;i++)i in n&&(s=e.call(void 0,s,n[i],i,t));return s}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(e){var t=F(this),n=E&&h(this)=="[object String]"?this.split(""):t,r=n.length>>>0;if(h(e)!="[object Function]")throw new TypeError(e+" is not a function");if(!r&&arguments.length==1)throw new TypeError("reduceRight of empty array with no initial value");var i,s=r-1;if(arguments.length>=2)i=arguments[1];else do{if(s in n){i=n[s--];break}if(--s<0)throw new TypeError("reduceRight of empty array with no initial value")}while(!0);do s in this&&(i=e.call(void 0,i,n[s],s,t));while(s--);return i});if(!Array.prototype.indexOf||[0,1].indexOf(1,2)!=-1)Array.prototype.indexOf=function(e){var t=E&&h(this)=="[object String]"?this.split(""):F(this),n=t.length>>>0;if(!n)return-1;var r=0;arguments.length>1&&(r=s(arguments[1])),r=r>=0?r:Math.max(0,n+r);for(;r<n;r++)if(r in t&&t[r]===e)return r;return-1};if(!Array.prototype.lastIndexOf||[0,1].lastIndexOf(0,-3)!=-1)Array.prototype.lastIndexOf=function(e){var t=E&&h(this)=="[object String]"?this.split(""):F(this),n=t.length>>>0;if(!n)return-1;var r=n-1;arguments.length>1&&(r=Math.min(r,s(arguments[1]))),r=r>=0?r:n-Math.abs(r);for(;r>=0;r--)if(r in t&&e===t[r])return r;return-1};Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:l)});if(!Object.getOwnPropertyDescriptor){var S="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(e,t){if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError(S+e);if(!p(e,t))return;var n,r,i;n={enumerable:!0,configurable:!0};if(y){var s=e.__proto__;e.__proto__=l;var r=m(e,t),i=g(e,t);e.__proto__=s;if(r||i)return r&&(n.get=r),i&&(n.set=i),n}return n.value=e[t],n}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)});if(!Object.create){var x;Object.prototype.__proto__===null?x=function(){return{__proto__:null}}:x=function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(e===null)n=x();else{if(typeof e!="object")throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,n=new r,n.__proto__=e}return t!==void 0&&Object.defineProperties(n,t),n}}if(Object.defineProperty){var T=i({}),N=typeof document=="undefined"||i(document.createElement("div"));if(!T||!N)var C=Object.defineProperty}if(!Object.defineProperty||C){var k="Property description must be an object: ",L="Object.defineProperty called on non-object: ",A="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(e,t,n){if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError(L+e);if(typeof n!="object"&&typeof n!="function"||n===null)throw new TypeError(k+n);if(C)try{return C.call(Object,e,t,n)}catch(r){}if(p(n,"value"))if(y&&(m(e,t)||g(e,t))){var i=e.__proto__;e.__proto__=l,delete e[t],e[t]=n.value,e.__proto__=i}else e[t]=n.value;else{if(!y)throw new TypeError(A);p(n,"get")&&d(e,t,n.get),p(n,"set")&&v(e,t,n.set)}return e}}Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)p(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(O){Object.freeze=function(e){return function(t){return typeof t=="function"?t:e(t)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;var t="";while(p(e,t))t+="?";e[t]=!0;var n=p(e,t);return delete e[t],n});if(!Object.keys){var M=!0,_=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],D=_.length;for(var P in{toString:null})M=!1;Object.keys=function I(e){if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError("Object.keys called on a non-object");var I=[];for(var t in e)p(e,t)&&I.push(t);if(M)for(var n=0,r=D;n<r;n++){var i=_[n];p(e,i)&&I.push(i)}return I}}Date.now||(Date.now=function(){return(new Date).getTime()});var H=" \n \f\r Β αš€α Žβ€€β€β€‚β€ƒβ€„β€…β€†β€‡β€ˆβ€‰β€Šβ€―βŸγ€€\u2028\u2029ο»Ώ";if(!String.prototype.trim||H.trim()){H="["+H+"]";var B=new RegExp("^"+H+H+"*"),j=new RegExp(H+H+"*$");String.prototype.trim=function(){return String(this).replace(B,"").replace(j,"")}}var F=function(e){if(e==null)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(e,t,n){var r={},i=function(){this.propagationStopped=!0},s=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!n.length&&!r)return;if(typeof t!="object"||!t)t={};t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=i),t.preventDefault||(t.preventDefault=s),n=n.slice();for(var o=0;o<n.length;o++){n[o](t,this);if(t.propagationStopped)break}if(r&&!t.defaultPrevented)return r(t,this)},r._signal=function(e,t){var n=(this._eventRegistry||{})[e];if(!n)return;n=n.slice();for(var r=0;r<n.length;r++)n[r](t,this)},r.once=function(e,t){var n=this;t&&this.addEventListener(e,function r(){n.removeEventListener(e,r),t.apply(null,arguments)})},r.setDefaultHandler=function(e,t){var n=this._defaultHandlers;n||(n=this._defaultHandlers={_disabled_:{}});if(n[e]){var r=n[e],i=n._disabled_[e];i||(n._disabled_[e]=i=[]),i.push(r);var s=i.indexOf(t);s!=-1&&i.splice(s,1)}n[e]=t},r.removeDefaultHandler=function(e,t){var n=this._defaultHandlers;if(!n)return;var r=n._disabled_[e];if(n[e]==t){var i=n[e];r&&this.setDefaultHandler(e,r.pop())}else if(r){var s=r.indexOf(t);s!=-1&&r.splice(s,1)}},r.on=r.addEventListener=function(e,t,n){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[e];return r||(r=this._eventRegistry[e]=[]),r.indexOf(t)==-1&&r[n?"unshift":"push"](t),t},r.off=r.removeListener=r.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(!n)return;var r=n.indexOf(t);r!==-1&&n.splice(r,1)},r.removeAllListeners=function(e){this._eventRegistry&&(this._eventRegistry[e]=[])},t.EventEmitter=r}),ace.define("ace/range",["require","exports","module"],function(e,t,n){var r=function(e,t){return e.row-t.row||e.column-t.column},i=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return this.compare(e,t)==0},this.compareRange=function(e){var t,n=e.end,r=e.start;return t=this.compare(n.row,n.column),t==1?(t=this.compare(r.row,r.column),t==1?2:t==0?1:0):t==-1?-2:(t=this.compare(r.row,r.column),t==-1?-1:t==1?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){return!this.isMultiLine()&&e===this.start.row?t<this.start.column?-1:t>this.end.column?1:0:e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else if(this.end.row<e)var n={row:e,column:0};if(this.start.row>t)var r={row:t+1,column:0};else if(this.start.row<e)var r={row:e,column:0};return i.fromPoints(r||this.start,n||this.end)},this.extend=function(e,t){var n=this.compare(e,t);if(n==0)return this;if(n==-1)var r={row:e,column:t};else var s={row:e,column:t};return i.fromPoints(r||this.start,s||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return i.fromPoints(this.start,this.end)},this.collapseRows=function(){return this.end.column==0?new i(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new i(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start),n=e.documentToScreenPosition(this.end);return new i(t.row,t.column,n.row,n.column)},this.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t}}).call(i.prototype),i.fromPoints=function(e,t){return new i(e.row,e.column,t.row,t.column)},i.comparePoints=r,i.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=i}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,n){var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=t.Anchor=function(e,t,n){this.$onChange=this.onChange.bind(this),this.attach(e),typeof n=="undefined"?this.setPosition(t.row,t.column):this.setPosition(t,n)};(function(){r.implement(this,i),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(e){var t=e.data,n=t.range;if(n.start.row==n.end.row&&n.start.row!=this.row)return;if(n.start.row>this.row)return;if(n.start.row==this.row&&n.start.column>this.column)return;var r=this.row,i=this.column,s=n.start,o=n.end;if(t.action==="insertText")if(s.row===r&&s.column<=i){if(s.column!==i||!this.$insertRight)s.row===o.row?i+=o.column-s.column:(i-=s.column,r+=o.row-s.row)}else s.row!==o.row&&s.row<r&&(r+=o.row-s.row);else t.action==="insertLines"?s.row<=r&&(r+=o.row-s.row):t.action==="removeText"?s.row===r&&s.column<i?o.column>=i?i=s.column:i=Math.max(0,i-(o.column-s.column)):s.row!==o.row&&s.row<r?(o.row===r&&(i=Math.max(0,i-o.column)+s.column),r-=o.row-s.row):o.row===r&&(r-=o.row-s.row,i=Math.max(0,i-o.column)+s.column):t.action=="removeLines"&&s.row<=r&&(o.row<=r?r-=o.row-s.row:(r=s.row,i=0));this.setPosition(r,i,!0)},this.setPosition=function(e,t,n){var r;n?r={row:e,column:t}:r=this.$clipPositionToDocument(e,t);if(this.row==r.row&&this.column==r.column)return;var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/lib/lang",["require","exports","module"],function(e,t,n){t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){var n="";while(t>0){t&1&&(n+=e);if(t>>=1)e+=e}return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){var t=[];for(var n=0,r=e.length;n<r;n++)e[n]&&typeof e[n]=="object"?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=function(e){if(typeof e!="object"||!e)return e;var n=e.constructor;if(n===RegExp)return e;var r=n();for(var i in e)typeof e[i]=="object"?r[i]=t.deepCopy(e[i]):r[i]=e[i];return r},t.arrayToMap=function(e){var t={};for(var n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return e.replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,function(e){n.push({offset:arguments[arguments.length-2],length:e.length})}),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},r=function(e){return r.cancel(),t=setTimeout(n,e||0),r};return r.schedule=r,r.call=function(){return this.cancel(),e(),r},r.cancel=function(){return clearTimeout(t),t=null,r},r.isPending=function(){return t},r},t.delayedCall=function(e,t){var n=null,r=function(){n=null,e()},i=function(e){n==null&&(n=setTimeout(r,e||t))};return i.delay=function(e){n&&clearTimeout(n),n=setTimeout(r,e||t)},i.schedule=i,i.call=function(){this.cancel(),e()},i.cancel=function(){n&&clearTimeout(n),n=null},i.isPending=function(){return n},i}}),ace.define("ace/mode/lua/luaparse",["require","exports","module"],function(e,t,n){(function(e,n,r){r(t)})(this,"luaparse",function(e){function t(e){if(Jt){var t=$t.pop();t.complete(),bt.locations&&(e.loc=t.loc),bt.ranges&&(e.range=t.range)}return e}function n(e,t,n){for(var r=0,i=e.length;r<i;r++)if(e[r][t]===n)return r;return-1}function r(e){var t=Dt.call(arguments,1);return e=e.replace(/%(\d)/g,function(e,n){return""+t[n-1]||""}),e}function i(){var e=Dt.call(arguments),t={},n,r;for(var i=0,s=e.length;i<s;i++){n=e[i];for(r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}return t}function s(e){var t=r.apply(null,Dt.call(arguments,1)),n,i;throw"undefined"!=typeof e.line?(i=e.range[0]-e.lineStart,n=new SyntaxError(r("[%1:%2] %3",e.line,i,t)),n.line=e.line,n.index=e.range[0],n.column=i):(i=Bt-zt+1,n=new SyntaxError(r("[%1:%2] %3",Ut,i,t)),n.index=Bt,n.line=Ut,n.column=i),n}function o(e,t){s(t,Mt.expectedToken,e,t.value)}function u(e,t){"undefined"==typeof t&&(t=It.value);if("undefined"!=typeof e.type){var n;switch(e.type){case xt:n="string";break;case Tt:n="keyword";break;case Nt:n="identifier";break;case Ct:n="number";break;case kt:n="symbol";break;case Lt:n="boolean";break;case At:return s(e,Mt.unexpected,"symbol","nil",t)}return s(e,Mt.unexpected,n,e.value,t)}return s(e,Mt.unexpected,"symbol",e,t)}function a(){f();while(45===yt.charCodeAt(Bt)&&45===yt.charCodeAt(Bt+1))b(),f();if(Bt>=wt)return{type:St,value:"<eof>",line:Ut,lineStart:zt,range:[Bt,Bt]};var e=yt.charCodeAt(Bt),t=yt.charCodeAt(Bt+1);Rt=Bt;if(L(e))return l();switch(e){case 39:case 34:return p();case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return v();case 46:if(C(t))return v();if(46===t)return 46===yt.charCodeAt(Bt+2)?h():c("..");return c(".");case 61:if(61===t)return c("==");return c("=");case 62:if(61===t)return c(">=");return c(">");case 60:if(61===t)return c("<=");return c("<");case 126:if(61===t)return c("~=");return s({},Mt.expected,"=","~");case 58:if(58===t)return c("::");return c(":");case 91:if(91===t||61===t)return d();return c("[");case 42:case 47:case 94:case 37:case 44:case 123:case 125:case 93:case 40:case 41:case 59:case 35:case 45:case 43:return c(yt.charAt(Bt))}return u(yt.charAt(Bt))}function f(){while(Bt<wt){var e=yt.charCodeAt(Bt);if(T(e))Bt++;else{if(!N(e))break;Ut++,zt=++Bt}}}function l(){var e,t;while(A(yt.charCodeAt(++Bt)));return e=yt.slice(Rt,Bt),O(e)?t=Tt:"true"===e||"false"===e?(t=Lt,e="true"===e):"nil"===e?(t=At,e=null):t=Nt,{type:t,value:e,line:Ut,lineStart:zt,range:[Rt,Bt]}}function c(e){return Bt+=e.length,{type:kt,value:e,line:Ut,lineStart:zt,range:[Rt,Bt]}}function h(){return Bt+=3,{type:Ot,value:"...",line:Ut,lineStart:zt,range:[Rt,Bt]}}function p(){var e=yt.charCodeAt(Bt++),t=Bt,n="",r;while(Bt<wt){r=yt.charCodeAt(Bt++);if(e===r)break;if(92===r)n+=yt.slice(t,Bt-1)+y(),t=Bt;else if(Bt>=wt||N(r))n+=yt.slice(t,Bt-1),s({},Mt.unfinishedString,n+String.fromCharCode(r))}return n+=yt.slice(t,Bt-1),{type:xt,value:n,line:Ut,lineStart:zt,range:[Rt,Bt]}}function d(){var e=w();return!1===e&&s(jt,Mt.expected,"[",jt.value),{type:xt,value:e,line:Ut,lineStart:zt,range:[Rt,Bt]}}function v(){var e=yt.charAt(Bt),t=yt.charAt(Bt+1),n="0"===e&&"xX".indexOf(t||null)>=0?m():g();return{type:Ct,value:n,line:Ut,lineStart:zt,range:[Rt,Bt]}}function m(){var e=0,t=1,n=1,r,i,o,u;u=Bt+=2,k(yt.charCodeAt(Bt))||s({},Mt.malformedNumber,yt.slice(Rt,Bt));while(k(yt.charCodeAt(Bt)))Bt++;r=parseInt(yt.slice(u,Bt),16);if("."===yt.charAt(Bt)){i=++Bt;while(k(yt.charCodeAt(Bt)))Bt++;e=yt.slice(i,Bt),e=i===Bt?0:parseInt(e,16)/Math.pow(16,Bt-i)}if("pP".indexOf(yt.charAt(Bt)||null)>=0){Bt++,"+-".indexOf(yt.charAt(Bt)||null)>=0&&(n="+"===yt.charAt(Bt++)?1:-1),o=Bt,C(yt.charCodeAt(Bt))||s({},Mt.malformedNumber,yt.slice(Rt,Bt));while(C(yt.charCodeAt(Bt)))Bt++;t=yt.slice(o,Bt),t=Math.pow(2,t*n)}return(r+e)*t}function g(){while(C(yt.charCodeAt(Bt)))Bt++;if("."===yt.charAt(Bt)){Bt++;while(C(yt.charCodeAt(Bt)))Bt++}if("eE".indexOf(yt.charAt(Bt)||null)>=0){Bt++,"+-".indexOf(yt.charAt(Bt)||null)>=0&&Bt++,C(yt.charCodeAt(Bt))||s({},Mt.malformedNumber,yt.slice(Rt,Bt));while(C(yt.charCodeAt(Bt)))Bt++}return parseFloat(yt.slice(Rt,Bt))}function y(){var e=Bt;switch(yt.charAt(Bt)){case"n":return Bt++,"\n";case"r":return Bt++,"\r";case"t":return Bt++," ";case"v":return Bt++," ";case"b":return Bt++,"\b";case"f":return Bt++,"\f";case"z":return Bt++,f(),"";case"x":if(k(yt.charCodeAt(Bt+1))&&k(yt.charCodeAt(Bt+2)))return Bt+=3,"\\"+yt.slice(e,Bt);return"\\"+yt.charAt(Bt++);default:if(C(yt.charCodeAt(Bt))){while(C(yt.charCodeAt(++Bt)));return"\\"+yt.slice(e,Bt)}return yt.charAt(Bt++)}}function b(){Rt=Bt,Bt+=2;var e=yt.charAt(Bt),t="",n=!1,r=Bt,i=zt,s=Ut;"["===e&&(t=w(),!1===t?t=e:n=!0);if(!n){while(Bt<wt){if(N(yt.charCodeAt(Bt)))break;Bt++}bt.comments&&(t=yt.slice(r,Bt))}if(bt.comments){var o=_t.comment(t,yt.slice(Rt,Bt));bt.locations&&(o.loc={start:{line:s,column:Rt-i},end:{line:Ut,column:Bt-zt}}),bt.ranges&&(o.range=[Rt,Bt]),qt.push(o)}}function w(){var e=0,t="",n=!1,r,i;Bt++;while("="===yt.charAt(Bt+e))e++;if("["!==yt.charAt(Bt+e))return!1;Bt+=e+1,N(yt.charCodeAt(Bt))&&(Ut++,zt=Bt++),i=Bt;while(Bt<wt){r=yt.charAt(Bt++),N(r.charCodeAt(0))&&(Ut++,zt=Bt);if("]"===r){n=!0;for(var s=0;s<e;s++)"="!==yt.charAt(Bt+s)&&(n=!1);"]"!==yt.charAt(Bt+e)&&(n=!1)}if(n)break}return t+=yt.slice(i,Bt-1),Bt+=e+1,t}function E(){Ft=jt,jt=It,It=a()}function S(e){return e===jt.value?(E(),!0):!1}function x(e){e===jt.value?E():s(jt,Mt.expected,e,jt.value)}function T(e){return 9===e||32===e||11===e||12===e}function N(e){return 10===e||13===e}function C(e){return e>=48&&e<=57}function k(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function L(e){return e>=65&&e<=90||e>=97&&e<=122||95===e}function A(e){return e>=65&&e<=90||e>=97&&e<=122||95===e||e>=48&&e<=57}function O(e){switch(e.length){case 2:return"do"===e||"if"===e||"in"===e||"or"===e;case 3:return"and"===e||"end"===e||"for"===e||"not"===e;case 4:return"else"===e||"goto"===e||"then"===e;case 5:return"break"===e||"local"===e||"until"===e||"while"===e;case 6:return"elseif"===e||"repeat"===e||"return"===e;case 8:return"function"===e}return!1}function M(e){return kt===e.type?"#-".indexOf(e.value)>=0:Tt===e.type?"not"===e.value:!1}function _(e){switch(e.type){case"CallExpression":case"TableCallExpression":case"StringCallExpression":return!0}return!1}function D(e){if(St===e.type)return!0;if(Tt!==e.type)return!1;switch(e.value){case"else":case"elseif":case"end":case"until":return!0;default:return!1}}function P(){Wt.push(Array.apply(null,Wt[Xt++]))}function H(){Wt.pop(),Xt--}function B(e){if(-1!==Ht(Wt[Xt],e))return;Wt[Xt].push(e)}function j(e){B(e.name),F(e,!0)}function F(e,t){!t&&-1===n(Vt,"name",e.name)&&Vt.push(e),e.isLocal=t}function I(e){return-1!==Ht(Wt[Xt],e)}function q(){return new R(jt)}function R(e){bt.locations&&(this.loc={start:{line:e.line,column:e.range[0]-e.lineStart},end:{line:0,column:0}}),bt.ranges&&(this.range=[e.range[0],0])}function U(){Jt&&$t.push(q())}function z(e){Jt&&$t.push(e)}function W(){E(),U();var e=X();return St!==jt.type&&u(jt),Jt&&!e.length&&(Ft=jt),t(_t.chunk(e))}function X(e){var t=[],n;bt.scope&&P();while(!D(jt)){if("return"===jt.value){t.push(V());break}n=V(),n&&t.push(n)}return bt.scope&&H(),t}function V(){U();if(Tt===jt.type)switch(jt.value){case"local":return E(),nt();case"if":return E(),et();case"return":return E(),Z();case"function":E();var e=ot();return st(e);case"while":return E(),G();case"for":return E(),tt();case"repeat":return E(),Y();case"break":return E(),J();case"do":return E(),Q();case"goto":return E(),K()}if(kt===jt.type&&S("::"))return $();Jt&&$t.pop();if(S(";"))return;return rt()}function $(){var e=jt.value,n=it();return bt.scope&&(B("::"+e+"::"),F(n,!0)),x("::"),t(_t.labelStatement(n))}function J(){return t(_t.breakStatement())}function K(){var e=jt.value,n=it();return bt.scope&&(n.isLabel=I("::"+e+"::")),t(_t.gotoStatement(n))}function Q(){var e=X();return x("end"),t(_t.doStatement(e))}function G(){var e=ft();x("do");var n=X();return x("end"),t(_t.whileStatement(e,n))}function Y(){var e=X();x("until");var n=ft();return t(_t.repeatStatement(n,e))}function Z(){var e=[];if("end"!==jt.value){var n=at();null!=n&&e.push(n);while(S(","))n=ft(),e.push(n);S(";")}return t(_t.returnStatement(e))}function et(){var e=[],n,r,i;Jt&&(i=$t[$t.length-1],$t.push(i)),n=ft(),x("then"),r=X(),e.push(t(_t.ifClause(n,r))),Jt&&(i=q());while(S("elseif"))z(i),n=ft(),x("then"),r=X(),e.push(t(_t.elseifClause(n,r))),Jt&&(i=q());return S("else")&&(Jt&&(i=new R(Ft),$t.push(i)),r=X(),e.push(t(_t.elseClause(r)))),x("end"),t(_t.ifStatement(e))}function tt(){var e=it(),n;bt.scope&&j(e);if(S("=")){var r=ft();x(",");var i=ft(),s=S(",")?ft():null;return x("do"),n=X(),x("end"),t(_t.forNumericStatement(e,r,i,s,n))}var o=[e];while(S(","))e=it(),bt.scope&&j(e),o.push(e);x("in");var u=[];do{var a=ft();u.push(a)}while(S(","));return x("do"),n=X(),x("end"),t(_t.forGenericStatement(o,u,n))}function nt(){var e;if(Nt===jt.type){var n=[],r=[];do e=it(),n.push(e);while(S(","));if(S("="))do{var i=ft();r.push(i)}while(S(","));if(bt.scope)for(var s=0,u=n.length;s<u;s++)j(n[s]);return t(_t.localStatement(n,r))}if(S("function"))return e=it(),bt.scope&&j(e),st(e,!0);o("<name>",jt)}function rt(){var e=jt,n,r;Jt&&(r=q()),n=ht();if(null==n)return u(jt);if(",=".indexOf(jt.value)>=0){var i=[n],s=[],a;while(S(","))a=ht(),null==a&&o("<expression>",jt),i.push(a);x("=");do a=ft(),s.push(a);while(S(","));return z(r),t(_t.assignmentStatement(i,s))}return _(n)?(z(r),t(_t.callStatement(n))):u(e)}function it(){U();var e=jt.value;return Nt!==jt.type&&o("<name>",jt),E(),t(_t.identifier(e))}function st(e,n){var r=[];x("(");if(!S(")"))for(;;)if(Nt===jt.type){var i=it();bt.scope&&j(i),r.push(i);if(S(","))continue;if(S(")"))break}else{if(Ot===jt.type){r.push(dt()),x(")");break}o("<name> or '...'",jt)}var s=X();return x("end"),n=n||!1,t(_t.functionStatement(e,r,n,s))}function ot(){var e,n,r;Jt&&(r=q()),e=it(),bt.scope&&F(e,!1);while(S("."))z(r),n=it(),bt.scope&&F(n,!1),e=t(_t.memberExpression(e,".",n));return S(":")&&(z(r),n=it(),bt.scope&&F(n,!1),e=t(_t.memberExpression(e,":",n))),e}function ut(){var e=[],n,r;for(;;){U();if(kt===jt.type&&S("["))n=ft(),x("]"),x("="),r=ft(),e.push(t(_t.tableKey(n,r)));else if(Nt===jt.type)n=ft(),S("=")?(r=ft(),e.push(t(_t.tableKeyString(n,r)))):e.push(t(_t.tableValue(n)));else{if(null==(r=at())){$t.pop();break}e.push(t(_t.tableValue(r)))}if(",;".indexOf(jt.value)>=0){E();continue}if("}"===jt.value)break}return x("}"),t(_t.tableConstructorExpression(e))}function at(){var e=ct(0);return e}function ft(){var e=at();if(null!=e)return e;o("<expression>",jt)}function lt(e){var t=e.charCodeAt(0),n=e.length;if(1===n)switch(t){case 94:return 10;case 42:case 47:case 37:return 7;case 43:case 45:return 6;case 60:case 62:return 3}else if(2===n)switch(t){case 46:return 5;case 60:case 62:case 61:case 126:return 3;case 111:return 1}else if(97===t&&"and"===e)return 2;return 0}function ct(e){var n=jt.value,r,i;Jt&&(i=q());if(M(jt)){U(),E();var s=ct(8);s==null&&o("<expression>",jt),r=t(_t.unaryExpression(n,s))}null==r&&(r=dt(),null==r&&(r=ht()));if(null==r)return null;var u;for(;;){n=jt.value,u=kt===jt.type||Tt===jt.type?lt(n):0;if(u===0||u<=e)break;("^"===n||".."===n)&&u--,E();var a=ct(u);null==a&&o("<expression>",jt),Jt&&$t.push(i),r=t(_t.binaryExpression(n,r,a))}return r}function ht(){var e,n,r,i;Jt&&(r=q());if(Nt===jt.type)n=jt.value,e=it(),bt.scope&&F(e,i=I(n));else{if(!S("("))return null;e=ft(),x(")"),bt.scope&&(i=e.isLocal)}var s,o;for(;;)if(kt===jt.type)switch(jt.value){case"[":z(r),E(),s=ft(),e=t(_t.indexExpression(e,s)),x("]");break;case".":z(r),E(),o=it(),bt.scope&&F(o,i),e=t(_t.memberExpression(e,".",o));break;case":":z(r),E(),o=it(),bt.scope&&F(o,i),e=t(_t.memberExpression(e,":",o)),z(r),e=pt(e);break;case"(":case"{":z(r),e=pt(e);break;default:return e}else{if(xt!==jt.type)break;z(r),e=pt(e)}return e}function pt(e){if(kt===jt.type)switch(jt.value){case"(":E();var n=[],r=at();null!=r&&n.push(r);while(S(","))r=ft(),n.push(r);return x(")"),t(_t.callExpression(e,n));case"{":U(),E();var i=ut();return t(_t.tableCallExpression(e,i))}else if(xt===jt.type)return t(_t.stringCallExpression(e,dt()));o("function arguments",jt)}function dt(){var e=xt|Ct|Lt|At|Ot,n=jt.value,r=jt.type,i;Jt&&(i=q());if(r&e){z(i);var s=yt.slice(jt.range[0],jt.range[1]);return E(),t(_t.literal(r,n,s))}if(Tt===r&&"function"===n)return z(i),E(),st(null);if(S("{"))return z(i),ut()}function vt(t,n){return"undefined"==typeof n&&"object"==typeof t&&(n=t,t=undefined),n||(n={}),yt=t||"",bt=i(Et,n),Bt=0,Ut=1,zt=0,wt=yt.length,Wt=[[]],Xt=0,Vt=[],$t=[],bt.comments&&(qt=[]),bt.wait?e:gt()}function mt(t){return yt+=String(t),wt=yt.length,e}function gt(e){"undefined"!=typeof e&&mt(e),wt=yt.length,Jt=bt.locations||bt.ranges,It=a();var t=W();bt.comments&&(t.comments=qt),bt.scope&&(t.globals=Vt);if($t.length>0)throw new Error("Location tracking failed. This is most likely a bug in luaparse");return t}e.version="0.1.4";var yt,bt,wt,Et=e.defaultOptions={wait:!1,comments:!0,scope:!1,locations:!1,ranges:!1},St=1,xt=2,Tt=4,Nt=8,Ct=16,kt=32,Lt=64,At=128,Ot=256;e.tokenTypes={EOF:St,StringLiteral:xt,Keyword:Tt,Identifier:Nt,NumericLiteral:Ct,Punctuator:kt,BooleanLiteral:Lt,NilLiteral:At,VarargLiteral:Ot};var Mt=e.errors={unexpected:"Unexpected %1 '%2' near '%3'",expected:"'%1' expected near '%2'",expectedToken:"%1 expected near '%2'",unfinishedString:"unfinished string near '%1'",malformedNumber:"malformed number near '%1'"},_t=e.ast={labelStatement:function(e){return{type:"LabelStatement",label:e}},breakStatement:function(){return{type:"BreakStatement"}},gotoStatement:function(e){return{type:"GotoStatement",label:e}},returnStatement:function(e){return{type:"ReturnStatement",arguments:e}},ifStatement:function(e){return{type:"IfStatement",clauses:e}},ifClause:function(e,t){return{type:"IfClause",condition:e,body:t}},elseifClause:function(e,t){return{type:"ElseifClause",condition:e,body:t}},elseClause:function(e){return{type:"ElseClause",body:e}},whileStatement:function(e,t){return{type:"WhileStatement",condition:e,body:t}},doStatement:function(e){return{type:"DoStatement",body:e}},repeatStatement:function(e,t){return{type:"RepeatStatement",condition:e,body:t}},localStatement:function(e,t){return{type:"LocalStatement",variables:e,init:t}},assignmentStatement:function(e,t){return{type:"AssignmentStatement",variables:e,init:t}},callStatement:function(e){return{type:"CallStatement",expression:e}},functionStatement:function(e,t,n,r){return{type:"FunctionDeclaration",identifier:e,isLocal:n,parameters:t,body:r}},forNumericStatement:function(e,t,n,r,i){return{type:"ForNumericStatement",variable:e,start:t,end:n,step:r,body:i}},forGenericStatement:function(e,t,n){return{type:"ForGenericStatement",variables:e,iterators:t,body:n}},chunk:function(e){return{type:"Chunk",body:e}},identifier:function(e){return{type:"Identifier",name:e}},literal:function(e,t,n){return e=e===xt?"StringLiteral":e===Ct?"NumericLiteral":e===Lt?"BooleanLiteral":e===At?"NilLiteral":"VarargLiteral",{type:e,value:t,raw:n}},tableKey:function(e,t){return{type:"TableKey",key:e,value:t}},tableKeyString:function(e,t){return{type:"TableKeyString",key:e,value:t}},tableValue:function(e){return{type:"TableValue",value:e}},tableConstructorExpression:function(e){return{type:"TableConstructorExpression",fields:e}},binaryExpression:function(e,t,n){var r="and"===e||"or"===e?"LogicalExpression":"BinaryExpression";return{type:r,operator:e,left:t,right:n}},unaryExpression:function(e,t){return{type:"UnaryExpression",operator:e,argument:t}},memberExpression:function(e,t,n){return{type:"MemberExpression",indexer:t,identifier:n,base:e}},indexExpression:function(e,t){return{type:"IndexExpression",base:e,index:t}},callExpression:function(e,t){return{type:"CallExpression",base:e,arguments:t}},tableCallExpression:function(e,t){return{type:"TableCallExpression",base:e,arguments:t}},stringCallExpression:function(e,t){return{type:"StringCallExpression",base:e,argument:t}},comment:function(e,t){return{type:"Comment",value:e,raw:t}}},Dt=Array.prototype.slice,Pt=Object.prototype.toString,Ht=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},Bt,jt,Ft,It,qt,Rt,Ut,zt;e.lex=a;var Wt,Xt,Vt,$t=[],Jt;R.prototype.complete=function(){bt.locations&&(this.loc.end.line=Ft.line,this.loc.end.column=Ft.range[1]-Ft.lineStart),bt.ranges&&(this.range[1]=Ft.range[1])},e.parse=vt,e.write=mt,e.end=gt})}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=e("./range").Range,o=e("./anchor").Anchor,u=function(e){this.$lines=[],e.length===0?this.$lines=[""]:Array.isArray(e)?this._insertLines(0,e):this.insert({row:0,column:0},e)};(function(){r.implement(this,i),this.setValue=function(e){var t=this.getLength();this.remove(new s(0,0,t,this.getLine(t-1).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new o(this,e,t)},"aaa".split(/a/).length===0?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e,this._signal("changeNewLineMode")},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){if(e.start.row==e.end.row)return this.getLine(e.start.row).substring(e.start.column,e.end.column);var t=this.getLines(e.start.row,e.end.row);t[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;return e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column)),t.join(this.getNewLineCharacter())},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):e.row<0&&(e.row=0),e},this.insert=function(e,t){if(!t||t.length===0)return e;e=this.$clipPosition(e),this.getLength()<=1&&this.$detectNewLine(t);var n=this.$split(t),r=n.splice(0,1)[0],i=n.length==0?null:n.splice(n.length-1,1)[0];return e=this.insertInLine(e,r),i!==null&&(e=this.insertNewLine(e),e=this._insertLines(e.row,n),e=this.insertInLine(e,i||"")),e},this.insertLines=function(e,t){return e>=this.getLength()?this.insert({row:e,column:0},"\n"+t.join("\n")):this._insertLines(Math.max(e,0),t)},this._insertLines=function(e,t){if(t.length==0)return{row:e,column:0};while(t.length>61440){var n=this._insertLines(e,t.slice(0,61440));t=t.slice(61440),e=n.row}var r=[e,0];r.push.apply(r,t),this.$lines.splice.apply(this.$lines,r);var i=new s(e,0,e+t.length,0),o={action:"insertLines",range:i,lines:t};return this._signal("change",{data:o}),i.end},this.insertNewLine=function(e){e=this.$clipPosition(e);var t=this.$lines[e.row]||"";this.$lines[e.row]=t.substring(0,e.column),this.$lines.splice(e.row+1,0,t.substring(e.column,t.length));var n={row:e.row+1,column:0},r={action:"insertText",range:s.fromPoints(e,n),text:this.getNewLineCharacter()};return this._signal("change",{data:r}),n},this.insertInLine=function(e,t){if(t.length==0)return e;var n=this.$lines[e.row]||"";this.$lines[e.row]=n.substring(0,e.column)+t+n.substring(e.column);var r={row:e.row,column:e.column+t.length},i={action:"insertText",range:s.fromPoints(e,r),text:t};return this._signal("change",{data:i}),r},this.remove=function(e){e instanceof s||(e=s.fromPoints(e.start,e.end)),e.start=this.$clipPosition(e.start),e.end=this.$clipPosition(e.end);if(e.isEmpty())return e.start;var t=e.start.row,n=e.end.row;if(e.isMultiLine()){var r=e.start.column==0?t:t+1,i=n-1;e.end.column>0&&this.removeInLine(n,0,e.end.column),i>=r&&this._removeLines(r,i),r!=t&&(this.removeInLine(t,e.start.column,this.getLine(t).length),this.removeNewLine(e.start.row))}else this.removeInLine(t,e.start.column,e.end.column);return e.start},this.removeInLine=function(e,t,n){if(t==n)return;var r=new s(e,t,e,n),i=this.getLine(e),o=i.substring(t,n),u=i.substring(0,t)+i.substring(n,i.length);this.$lines.splice(e,1,u);var a={action:"removeText",range:r,text:o};return this._signal("change",{data:a}),r.start},this.removeLines=function(e,t){return e<0||t>=this.getLength()?this.remove(new s(e,0,t+1,0)):this._removeLines(e,t)},this._removeLines=function(e,t){var n=new s(e,0,t+1,0),r=this.$lines.splice(e,t-e+1),i={action:"removeLines",range:n,nl:this.getNewLineCharacter(),lines:r};return this._signal("change",{data:i}),r},this.removeNewLine=function(e){var t=this.getLine(e),n=this.getLine(e+1),r=new s(e,t.length,e+1,0),i=t+n;this.$lines.splice(e,2,i);var o={action:"removeText",range:r,text:this.getNewLineCharacter()};this._signal("change",{data:o})},this.replace=function(e,t){e instanceof s||(e=s.fromPoints(e.start,e.end));if(t.length==0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);if(t)var n=this.insert(e.start,t);else n=e.start;return n},this.applyDeltas=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=s.fromPoints(n.range.start,n.range.end);n.action=="insertLines"?this.insertLines(r.start.row,n.lines):n.action=="insertText"?this.insert(r.start,n.text):n.action=="removeLines"?this._removeLines(r.start.row,r.end.row-1):n.action=="removeText"&&this.remove(r)}},this.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--){var n=e[t],r=s.fromPoints(n.range.start,n.range.end);n.action=="insertLines"?this._removeLines(r.start.row,r.end.row-1):n.action=="insertText"?this.remove(r):n.action=="removeLines"?this._insertLines(r.start.row,n.lines):n.action=="removeText"&&this.insert(r.start,n.text)}},this.indexToPosition=function(e,t){var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length;for(var i=t||0,s=n.length;i<s;i++){e-=n[i].length+r;if(e<0)return{row:i,column:e+n[i].length+r}}return{row:s-1,column:n[s-1].length}},this.positionToIndex=function(e,t){var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,i=0,s=Math.min(e.row,n.length);for(var o=t||0;o<s;++o)i+=n[o].length+r;return i+e.column}}).call(u.prototype),t.Document=u})
amoyeh/cdnjs
ajax/libs/ace/1.1.3/worker-lua.js
JavaScript
mit
45,315
<?php /** * Customize Panel Class. * * A UI container for sections, managed by the WP_Customize_Manager. * * @package WordPress * @subpackage Customize * @since 4.0.0 */ class WP_Customize_Panel { /** * WP_Customize_Manager instance. * * @since 4.0.0 * @access public * @var WP_Customize_Manager */ public $manager; /** * Unique identifier. * * @since 4.0.0 * @access public * @var string */ public $id; /** * Priority of the panel, defining the display order of panels and sections. * * @since 4.0.0 * @access public * @var integer */ public $priority = 160; /** * Capability required for the panel. * * @since 4.0.0 * @access public * @var string */ public $capability = 'edit_theme_options'; /** * Theme feature support for the panel. * * @since 4.0.0 * @access public * @var string|array */ public $theme_supports = ''; /** * Title of the panel to show in UI. * * @since 4.0.0 * @access public * @var string */ public $title = ''; /** * Description to show in the UI. * * @since 4.0.0 * @access public * @var string */ public $description = ''; /** * Customizer sections for this panel. * * @since 4.0.0 * @access public * @var array */ public $sections; /** * Constructor. * * Any supplied $args override class property defaults. * * @since 4.0.0 * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id An specific ID for the panel. * @param array $args Panel arguments. */ public function __construct( $manager, $id, $args = array() ) { $keys = array_keys( get_object_vars( $this ) ); foreach ( $keys as $key ) { if ( isset( $args[ $key ] ) ) { $this->$key = $args[ $key ]; } } $this->manager = $manager; $this->id = $id; $this->sections = array(); // Users cannot customize the $sections array. return $this; } /** * Checks required user capabilities and whether the theme has the * feature support required by the panel. * * @since 4.0.0 * * @return bool False if theme doesn't support the panel or the user doesn't have the capability. */ public final function check_capabilities() { if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) { return false; } if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) ) { return false; } return true; } /** * Check capabilities and render the panel. * * @since 4.0.0 */ public final function maybe_render() { if ( ! $this->check_capabilities() ) { return; } /** * Fires before rendering a Customizer panel. * * @since 4.0.0 * * @param WP_Customize_Panel $this WP_Customize_Panel instance. */ do_action( 'customize_render_panel', $this ); /** * Fires before rendering a specific Customizer panel. * * The dynamic portion of the hook name, $this->id, refers to the ID * of the specific Customizer panel to be rendered. * * @since 4.0.0 */ do_action( "customize_render_panel_{$this->id}" ); $this->render(); } /** * Render the panel, and the sections that have been added to it. * * @since 4.0.0 * @access protected */ protected function render() { ?> <li id="accordion-panel-<?php echo esc_attr( $this->id ); ?>" class="control-section control-panel accordion-section"> <h3 class="accordion-section-title" tabindex="0"> <?php echo esc_html( $this->title ); ?> <span class="screen-reader-text"><?php _e( 'Press return or enter to open this panel' ); ?></span> </h3> <ul class="accordion-sub-container control-panel-content"> <li class="accordion-section control-section<?php if ( empty( $this->description ) ) echo ' cannot-expand'; ?>"> <div class="accordion-section-title" tabindex="0"> <span class="preview-notice"><?php /* translators: %s is the site/panel title in the Customizer */ echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title">' . esc_html( $this->title ) . '</strong>' ); ?></span> </div> <?php if ( ! empty( $this->description ) ) : ?> <div class="accordion-section-content description"> <?php echo $this->description; ?> </div> <?php endif; ?> </li> <?php foreach ( $this->sections as $section ) { $section->maybe_render(); } ?> </ul> </li> <?php } }
the-unnamed-ones/fix-it-yourself
www-root/wordpress/wp-includes/class-wp-customize-panel.php
PHP
mit
4,536
<?php /** * CodeIgniter * * An open source application development framework for PHP * * This content is released under the MIT License (MIT) * * Copyright (c) 2014 - 2016, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com * @since Version 1.0.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); /** * MySQL Database Adapter Class * * Note: _DB is an extender class that the app controller * creates dynamically based on whether the query builder * class is being used or not. * * @package CodeIgniter * @subpackage Drivers * @category Database * @author EllisLab Dev Team * @link https://codeigniter.com/user_guide/database/ */ class CI_DB_mysql_driver extends CI_DB { /** * Database driver * * @var string */ public $dbdriver = 'mysql'; /** * Compression flag * * @var bool */ public $compress = FALSE; /** * DELETE hack flag * * Whether to use the MySQL "delete hack" which allows the number * of affected rows to be shown. Uses a preg_replace when enabled, * adding a bit more processing to all queries. * * @var bool */ public $delete_hack = TRUE; /** * Strict ON flag * * Whether we're running in strict SQL mode. * * @var bool */ public $stricton; // -------------------------------------------------------------------- /** * Identifier escape character * * @var string */ protected $_escape_char = '`'; // -------------------------------------------------------------------- /** * Class constructor * * @param array $params * @return void */ public function __construct($params) { parent::__construct($params); if ( ! empty($this->port)) { $this->hostname .= ':'.$this->port; } } // -------------------------------------------------------------------- /** * Non-persistent database connection * * @param bool $persistent * @return resource */ public function db_connect($persistent = FALSE) { $client_flags = ($this->compress === FALSE) ? 0 : MYSQL_CLIENT_COMPRESS; if ($this->encrypt === TRUE) { $client_flags = $client_flags | MYSQL_CLIENT_SSL; } // Error suppression is necessary mostly due to PHP 5.5+ issuing E_DEPRECATED messages $this->conn_id = ($persistent === TRUE) ? mysql_pconnect($this->hostname, $this->username, $this->password, $client_flags) : mysql_connect($this->hostname, $this->username, $this->password, TRUE, $client_flags); // ---------------------------------------------------------------- // Select the DB... assuming a database name is specified in the config file if ($this->database !== '' && ! $this->db_select()) { log_message('error', 'Unable to select database: '.$this->database); return ($this->db_debug === TRUE) ? $this->display_error('db_unable_to_select', $this->database) : FALSE; } if (isset($this->stricton) && is_resource($this->conn_id)) { if ($this->stricton) { $this->simple_query('SET SESSION sql_mode = CONCAT(@@sql_mode, ",", "STRICT_ALL_TABLES")'); } else { $this->simple_query( 'SET SESSION sql_mode = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( @@sql_mode, "STRICT_ALL_TABLES,", ""), ",STRICT_ALL_TABLES", ""), "STRICT_ALL_TABLES", ""), "STRICT_TRANS_TABLES,", ""), ",STRICT_TRANS_TABLES", ""), "STRICT_TRANS_TABLES", "")' ); } } return $this->conn_id; } // -------------------------------------------------------------------- /** * Reconnect * * Keep / reestablish the db connection if no queries have been * sent for a length of time exceeding the server's idle timeout * * @return void */ public function reconnect() { if (mysql_ping($this->conn_id) === FALSE) { $this->conn_id = FALSE; } } // -------------------------------------------------------------------- /** * Select the database * * @param string $database * @return bool */ public function db_select($database = '') { if ($database === '') { $database = $this->database; } if (mysql_select_db($database, $this->conn_id)) { $this->database = $database; return TRUE; } return FALSE; } // -------------------------------------------------------------------- /** * Set client character set * * @param string $charset * @return bool */ protected function _db_set_charset($charset) { return mysql_set_charset($charset, $this->conn_id); } // -------------------------------------------------------------------- /** * Database version number * * @return string */ public function version() { if (isset($this->data_cache['version'])) { return $this->data_cache['version']; } if ( ! $this->conn_id OR ($version = mysql_get_server_info($this->conn_id)) === FALSE) { return FALSE; } return $this->data_cache['version'] = $version; } // -------------------------------------------------------------------- /** * Execute the query * * @param string $sql an SQL query * @return mixed */ protected function _execute($sql) { return mysql_query($this->_prep_query($sql), $this->conn_id); } // -------------------------------------------------------------------- /** * Prep the query * * If needed, each database adapter can prep the query string * * @param string $sql an SQL query * @return string */ protected function _prep_query($sql) { // mysql_affected_rows() returns 0 for "DELETE FROM TABLE" queries. This hack // modifies the query so that it a proper number of affected rows is returned. if ($this->delete_hack === TRUE && preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) { return trim($sql).' WHERE 1=1'; } return $sql; } // -------------------------------------------------------------------- /** * Begin Transaction * * @return bool */ protected function _trans_begin() { $this->simple_query('SET AUTOCOMMIT=0'); return $this->simple_query('START TRANSACTION'); // can also be BEGIN or BEGIN WORK } // -------------------------------------------------------------------- /** * Commit Transaction * * @return bool */ protected function _trans_commit() { if ($this->simple_query('COMMIT')) { $this->simple_query('SET AUTOCOMMIT=1'); return TRUE; } return FALSE; } // -------------------------------------------------------------------- /** * Rollback Transaction * * @return bool */ protected function _trans_rollback() { if ($this->simple_query('ROLLBACK')) { $this->simple_query('SET AUTOCOMMIT=1'); return TRUE; } return FALSE; } // -------------------------------------------------------------------- /** * Platform-dependant string escape * * @param string * @return string */ protected function _escape_str($str) { return mysql_real_escape_string($str, $this->conn_id); } // -------------------------------------------------------------------- /** * Affected Rows * * @return int */ public function affected_rows() { return mysql_affected_rows($this->conn_id); } // -------------------------------------------------------------------- /** * Insert ID * * @return int */ public function insert_id() { return mysql_insert_id($this->conn_id); } // -------------------------------------------------------------------- /** * List table query * * Generates a platform-specific query string so that the table names can be fetched * * @param bool $prefix_limit * @return string */ protected function _list_tables($prefix_limit = FALSE) { $sql = 'SHOW TABLES FROM '.$this->escape_identifiers($this->database); if ($prefix_limit !== FALSE && $this->dbprefix !== '') { return $sql." LIKE '".$this->escape_like_str($this->dbprefix)."%'"; } return $sql; } // -------------------------------------------------------------------- /** * Show column query * * Generates a platform-specific query string so that the column names can be fetched * * @param string $table * @return string */ protected function _list_columns($table = '') { return 'SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE); } // -------------------------------------------------------------------- /** * Returns an object with field data * * @param string $table * @return array */ public function field_data($table) { if (($query = $this->query('SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE))) === FALSE) { return FALSE; } $query = $query->result_object(); $retval = array(); for ($i = 0, $c = count($query); $i < $c; $i++) { $retval[$i] = new stdClass(); $retval[$i]->name = $query[$i]->Field; sscanf($query[$i]->Type, '%[a-z](%d)', $retval[$i]->type, $retval[$i]->max_length ); $retval[$i]->default = $query[$i]->Default; $retval[$i]->primary_key = (int) ($query[$i]->Key === 'PRI'); } return $retval; } // -------------------------------------------------------------------- /** * Error * * Returns an array containing code and message of the last * database error that has occured. * * @return array */ public function error() { return array('code' => mysql_errno($this->conn_id), 'message' => mysql_error($this->conn_id)); } // -------------------------------------------------------------------- /** * FROM tables * * Groups tables in FROM clauses if needed, so there is no confusion * about operator precedence. * * @return string */ protected function _from_tables() { if ( ! empty($this->qb_join) && count($this->qb_from) > 1) { return '('.implode(', ', $this->qb_from).')'; } return implode(', ', $this->qb_from); } // -------------------------------------------------------------------- /** * Close DB Connection * * @return void */ protected function _close() { // Error suppression to avoid annoying E_WARNINGs in cases // where the connection has already been closed for some reason. @mysql_close($this->conn_id); } }
timmaters/SMARTBiKE
system/database/drivers/mysql/mysql_driver.php
PHP
mit
11,499
YUI.add('dom-screen', function(Y) { (function(Y) { /** * Adds position and region management functionality to DOM. * @module dom * @submodule dom-screen * @for DOM */ var DOCUMENT_ELEMENT = 'documentElement', COMPAT_MODE = 'compatMode', POSITION = 'position', FIXED = 'fixed', RELATIVE = 'relative', LEFT = 'left', TOP = 'top', _BACK_COMPAT = 'BackCompat', MEDIUM = 'medium', BORDER_LEFT_WIDTH = 'borderLeftWidth', BORDER_TOP_WIDTH = 'borderTopWidth', GET_BOUNDING_CLIENT_RECT = 'getBoundingClientRect', GET_COMPUTED_STYLE = 'getComputedStyle', Y_DOM = Y.DOM, // TODO: how about thead/tbody/tfoot/tr? // TODO: does caption matter? RE_TABLE = /^t(?:able|d|h)$/i, SCROLL_NODE; if (Y.UA.ie) { if (Y.config.doc[COMPAT_MODE] !== 'BackCompat') { SCROLL_NODE = DOCUMENT_ELEMENT; } else { SCROLL_NODE = 'body'; } } Y.mix(Y_DOM, { /** * Returns the inner height of the viewport (exludes scrollbar). * @method winHeight * @return {Number} The current height of the viewport. */ winHeight: function(node) { var h = Y_DOM._getWinSize(node).height; return h; }, /** * Returns the inner width of the viewport (exludes scrollbar). * @method winWidth * @return {Number} The current width of the viewport. */ winWidth: function(node) { var w = Y_DOM._getWinSize(node).width; return w; }, /** * Document height * @method docHeight * @return {Number} The current height of the document. */ docHeight: function(node) { var h = Y_DOM._getDocSize(node).height; return Math.max(h, Y_DOM._getWinSize(node).height); }, /** * Document width * @method docWidth * @return {Number} The current width of the document. */ docWidth: function(node) { var w = Y_DOM._getDocSize(node).width; return Math.max(w, Y_DOM._getWinSize(node).width); }, /** * Amount page has been scroll horizontally * @method docScrollX * @return {Number} The current amount the screen is scrolled horizontally. */ docScrollX: function(node, doc) { doc = doc || (node) ? Y_DOM._getDoc(node) : Y.config.doc; // perf optimization var dv = doc.defaultView, pageOffset = (dv) ? dv.pageXOffset : 0; return Math.max(doc[DOCUMENT_ELEMENT].scrollLeft, doc.body.scrollLeft, pageOffset); }, /** * Amount page has been scroll vertically * @method docScrollY * @return {Number} The current amount the screen is scrolled vertically. */ docScrollY: function(node, doc) { doc = doc || (node) ? Y_DOM._getDoc(node) : Y.config.doc; // perf optimization var dv = doc.defaultView, pageOffset = (dv) ? dv.pageYOffset : 0; return Math.max(doc[DOCUMENT_ELEMENT].scrollTop, doc.body.scrollTop, pageOffset); }, /** * Gets the current position of an element based on page coordinates. * Element must be part of the DOM tree to have page coordinates * (display:none or elements not appended return false). * @method getXY * @param element The target element * @return {Array} The XY position of the element TODO: test inDocument/display? */ getXY: function() { if (Y.config.doc[DOCUMENT_ELEMENT][GET_BOUNDING_CLIENT_RECT]) { return function(node) { var xy = null, scrollLeft, scrollTop, mode, box, offX, offY, doc, win, inDoc, rootNode; if (node && node.tagName) { doc = node.ownerDocument; mode = doc[COMPAT_MODE]; if (mode !== _BACK_COMPAT) { rootNode = doc[DOCUMENT_ELEMENT]; } else { rootNode = doc.body; } // inline inDoc check for perf if (rootNode.contains) { inDoc = rootNode.contains(node); } else { inDoc = Y.DOM.contains(rootNode, node); } if (inDoc) { win = doc.defaultView; // inline scroll calc for perf if (win && 'pageXOffset' in win) { scrollLeft = win.pageXOffset; scrollTop = win.pageYOffset; } else { scrollLeft = (SCROLL_NODE) ? doc[SCROLL_NODE].scrollLeft : Y_DOM.docScrollX(node, doc); scrollTop = (SCROLL_NODE) ? doc[SCROLL_NODE].scrollTop : Y_DOM.docScrollY(node, doc); } if (Y.UA.ie) { // IE < 8, quirks, or compatMode if (!doc.documentMode || doc.documentMode < 8 || mode === _BACK_COMPAT) { offX = rootNode.clientLeft; offY = rootNode.clientTop; } } box = node[GET_BOUNDING_CLIENT_RECT](); xy = [box.left, box.top]; if (offX || offY) { xy[0] -= offX; xy[1] -= offY; } if ((scrollTop || scrollLeft)) { if (!Y.UA.ios || (Y.UA.ios >= 4.2)) { xy[0] += scrollLeft; xy[1] += scrollTop; } } } else { xy = Y_DOM._getOffset(node); } } return xy; }; } else { return function(node) { // manually calculate by crawling up offsetParents //Calculate the Top and Left border sizes (assumes pixels) var xy = null, doc, parentNode, bCheck, scrollTop, scrollLeft; if (node) { if (Y_DOM.inDoc(node)) { xy = [node.offsetLeft, node.offsetTop]; doc = node.ownerDocument; parentNode = node; // TODO: refactor with !! or just falsey bCheck = ((Y.UA.gecko || Y.UA.webkit > 519) ? true : false); // TODO: worth refactoring for TOP/LEFT only? while ((parentNode = parentNode.offsetParent)) { xy[0] += parentNode.offsetLeft; xy[1] += parentNode.offsetTop; if (bCheck) { xy = Y_DOM._calcBorders(parentNode, xy); } } // account for any scrolled ancestors if (Y_DOM.getStyle(node, POSITION) != FIXED) { parentNode = node; while ((parentNode = parentNode.parentNode)) { scrollTop = parentNode.scrollTop; scrollLeft = parentNode.scrollLeft; //Firefox does something funky with borders when overflow is not visible. if (Y.UA.gecko && (Y_DOM.getStyle(parentNode, 'overflow') !== 'visible')) { xy = Y_DOM._calcBorders(parentNode, xy); } if (scrollTop || scrollLeft) { xy[0] -= scrollLeft; xy[1] -= scrollTop; } } xy[0] += Y_DOM.docScrollX(node, doc); xy[1] += Y_DOM.docScrollY(node, doc); } else { //Fix FIXED position -- add scrollbars xy[0] += Y_DOM.docScrollX(node, doc); xy[1] += Y_DOM.docScrollY(node, doc); } } else { xy = Y_DOM._getOffset(node); } } return xy; }; } }(),// NOTE: Executing for loadtime branching /** Gets the width of vertical scrollbars on overflowed containers in the body content. @method getScrollbarWidth @return {Number} Pixel width of a scrollbar in the current browser **/ getScrollbarWidth: Y.cached(function () { var doc = Y.config.doc, testNode = doc.createElement('div'), body = doc.getElementsByTagName('body')[0], // 0.1 because cached doesn't support falsy refetch values width = 0.1; if (body) { testNode.style.cssText = "position:absolute;visibility:hidden;overflow:scroll;width:20px;"; testNode.appendChild(doc.createElement('p')).style.height = '1px'; body.insertBefore(testNode, body.firstChild); width = testNode.offsetWidth - testNode.clientWidth; body.removeChild(testNode); } return width; }, null, 0.1), /** * Gets the current X position of an element based on page coordinates. * Element must be part of the DOM tree to have page coordinates * (display:none or elements not appended return false). * @method getX * @param element The target element * @return {Number} The X position of the element */ getX: function(node) { return Y_DOM.getXY(node)[0]; }, /** * Gets the current Y position of an element based on page coordinates. * Element must be part of the DOM tree to have page coordinates * (display:none or elements not appended return false). * @method getY * @param element The target element * @return {Number} The Y position of the element */ getY: function(node) { return Y_DOM.getXY(node)[1]; }, /** * Set the position of an html element in page coordinates. * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). * @method setXY * @param element The target element * @param {Array} xy Contains X & Y values for new position (coordinates are page-based) * @param {Boolean} noRetry By default we try and set the position a second time if the first fails */ setXY: function(node, xy, noRetry) { var setStyle = Y_DOM.setStyle, pos, delta, newXY, currentXY; if (node && xy) { pos = Y_DOM.getStyle(node, POSITION); delta = Y_DOM._getOffset(node); if (pos == 'static') { // default to relative pos = RELATIVE; setStyle(node, POSITION, pos); } currentXY = Y_DOM.getXY(node); if (xy[0] !== null) { setStyle(node, LEFT, xy[0] - currentXY[0] + delta[0] + 'px'); } if (xy[1] !== null) { setStyle(node, TOP, xy[1] - currentXY[1] + delta[1] + 'px'); } if (!noRetry) { newXY = Y_DOM.getXY(node); if (newXY[0] !== xy[0] || newXY[1] !== xy[1]) { Y_DOM.setXY(node, xy, true); } } } else { } }, /** * Set the X position of an html element in page coordinates, regardless of how the element is positioned. * The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). * @method setX * @param element The target element * @param {Number} x The X values for new position (coordinates are page-based) */ setX: function(node, x) { return Y_DOM.setXY(node, [x, null]); }, /** * Set the Y position of an html element in page coordinates, regardless of how the element is positioned. * The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). * @method setY * @param element The target element * @param {Number} y The Y values for new position (coordinates are page-based) */ setY: function(node, y) { return Y_DOM.setXY(node, [null, y]); }, /** * @method swapXY * @description Swap the xy position with another node * @param {Node} node The node to swap with * @param {Node} otherNode The other node to swap with * @return {Node} */ swapXY: function(node, otherNode) { var xy = Y_DOM.getXY(node); Y_DOM.setXY(node, Y_DOM.getXY(otherNode)); Y_DOM.setXY(otherNode, xy); }, _calcBorders: function(node, xy2) { var t = parseInt(Y_DOM[GET_COMPUTED_STYLE](node, BORDER_TOP_WIDTH), 10) || 0, l = parseInt(Y_DOM[GET_COMPUTED_STYLE](node, BORDER_LEFT_WIDTH), 10) || 0; if (Y.UA.gecko) { if (RE_TABLE.test(node.tagName)) { t = 0; l = 0; } } xy2[0] += l; xy2[1] += t; return xy2; }, _getWinSize: function(node, doc) { doc = doc || (node) ? Y_DOM._getDoc(node) : Y.config.doc; var win = doc.defaultView || doc.parentWindow, mode = doc[COMPAT_MODE], h = win.innerHeight, w = win.innerWidth, root = doc[DOCUMENT_ELEMENT]; if ( mode && !Y.UA.opera ) { // IE, Gecko if (mode != 'CSS1Compat') { // Quirks root = doc.body; } h = root.clientHeight; w = root.clientWidth; } return { height: h, width: w }; }, _getDocSize: function(node) { var doc = (node) ? Y_DOM._getDoc(node) : Y.config.doc, root = doc[DOCUMENT_ELEMENT]; if (doc[COMPAT_MODE] != 'CSS1Compat') { root = doc.body; } return { height: root.scrollHeight, width: root.scrollWidth }; } }); })(Y); (function(Y) { var TOP = 'top', RIGHT = 'right', BOTTOM = 'bottom', LEFT = 'left', getOffsets = function(r1, r2) { var t = Math.max(r1[TOP], r2[TOP]), r = Math.min(r1[RIGHT], r2[RIGHT]), b = Math.min(r1[BOTTOM], r2[BOTTOM]), l = Math.max(r1[LEFT], r2[LEFT]), ret = {}; ret[TOP] = t; ret[RIGHT] = r; ret[BOTTOM] = b; ret[LEFT] = l; return ret; }, DOM = Y.DOM; Y.mix(DOM, { /** * Returns an Object literal containing the following about this element: (top, right, bottom, left) * @for DOM * @method region * @param {HTMLElement} element The DOM element. * @return {Object} Object literal containing the following about this element: (top, right, bottom, left) */ region: function(node) { var xy = DOM.getXY(node), ret = false; if (node && xy) { ret = DOM._getRegion( xy[1], // top xy[0] + node.offsetWidth, // right xy[1] + node.offsetHeight, // bottom xy[0] // left ); } return ret; }, /** * Find the intersect information for the passed nodes. * @method intersect * @for DOM * @param {HTMLElement} element The first element * @param {HTMLElement | Object} element2 The element or region to check the interect with * @param {Object} altRegion An object literal containing the region for the first element if we already have the data (for performance e.g. DragDrop) * @return {Object} Object literal containing the following intersection data: (top, right, bottom, left, area, yoff, xoff, inRegion) */ intersect: function(node, node2, altRegion) { var r = altRegion || DOM.region(node), region = {}, n = node2, off; if (n.tagName) { region = DOM.region(n); } else if (Y.Lang.isObject(node2)) { region = node2; } else { return false; } off = getOffsets(region, r); return { top: off[TOP], right: off[RIGHT], bottom: off[BOTTOM], left: off[LEFT], area: ((off[BOTTOM] - off[TOP]) * (off[RIGHT] - off[LEFT])), yoff: ((off[BOTTOM] - off[TOP])), xoff: (off[RIGHT] - off[LEFT]), inRegion: DOM.inRegion(node, node2, false, altRegion) }; }, /** * Check if any part of this node is in the passed region * @method inRegion * @for DOM * @param {Object} node The node to get the region from * @param {Object} node2 The second node to get the region from or an Object literal of the region * @param {Boolean} all Should all of the node be inside the region * @param {Object} altRegion An object literal containing the region for this node if we already have the data (for performance e.g. DragDrop) * @return {Boolean} True if in region, false if not. */ inRegion: function(node, node2, all, altRegion) { var region = {}, r = altRegion || DOM.region(node), n = node2, off; if (n.tagName) { region = DOM.region(n); } else if (Y.Lang.isObject(node2)) { region = node2; } else { return false; } if (all) { return ( r[LEFT] >= region[LEFT] && r[RIGHT] <= region[RIGHT] && r[TOP] >= region[TOP] && r[BOTTOM] <= region[BOTTOM] ); } else { off = getOffsets(region, r); if (off[BOTTOM] >= off[TOP] && off[RIGHT] >= off[LEFT]) { return true; } else { return false; } } }, /** * Check if any part of this element is in the viewport * @method inViewportRegion * @for DOM * @param {HTMLElement} element The DOM element. * @param {Boolean} all Should all of the node be inside the region * @param {Object} altRegion An object literal containing the region for this node if we already have the data (for performance e.g. DragDrop) * @return {Boolean} True if in region, false if not. */ inViewportRegion: function(node, all, altRegion) { return DOM.inRegion(node, DOM.viewportRegion(node), all, altRegion); }, _getRegion: function(t, r, b, l) { var region = {}; region[TOP] = region[1] = t; region[LEFT] = region[0] = l; region[BOTTOM] = b; region[RIGHT] = r; region.width = region[RIGHT] - region[LEFT]; region.height = region[BOTTOM] - region[TOP]; return region; }, /** * Returns an Object literal containing the following about the visible region of viewport: (top, right, bottom, left) * @method viewportRegion * @for DOM * @return {Object} Object literal containing the following about the visible region of the viewport: (top, right, bottom, left) */ viewportRegion: function(node) { node = node || Y.config.doc.documentElement; var ret = false, scrollX, scrollY; if (node) { scrollX = DOM.docScrollX(node); scrollY = DOM.docScrollY(node); ret = DOM._getRegion(scrollY, // top DOM.winWidth(node) + scrollX, // right scrollY + DOM.winHeight(node), // bottom scrollX); // left } return ret; } }); })(Y); }, '@VERSION@' ,{requires:['dom-base', 'dom-style']});
Download/cdnjs
ajax/libs/yui/3.6.0/dom-screen/dom-screen.js
JavaScript
mit
20,651
YUI.add('resize-base', function(Y) { /** * The Resize Utility allows you to make an HTML element resizable. * @module resize * @main resize */ var Lang = Y.Lang, isArray = Lang.isArray, isBoolean = Lang.isBoolean, isNumber = Lang.isNumber, isString = Lang.isString, YArray = Y.Array, trim = Lang.trim, indexOf = YArray.indexOf, COMMA = ',', DOT = '.', EMPTY_STR = '', HANDLE_SUB = '{handle}', SPACE = ' ', ACTIVE = 'active', ACTIVE_HANDLE = 'activeHandle', ACTIVE_HANDLE_NODE = 'activeHandleNode', ALL = 'all', AUTO_HIDE = 'autoHide', BORDER = 'border', BOTTOM = 'bottom', CLASS_NAME = 'className', COLOR = 'color', DEF_MIN_HEIGHT = 'defMinHeight', DEF_MIN_WIDTH = 'defMinWidth', HANDLE = 'handle', HANDLES = 'handles', HANDLES_WRAPPER = 'handlesWrapper', HIDDEN = 'hidden', INNER = 'inner', LEFT = 'left', MARGIN = 'margin', NODE = 'node', NODE_NAME = 'nodeName', NONE = 'none', OFFSET_HEIGHT = 'offsetHeight', OFFSET_WIDTH = 'offsetWidth', PADDING = 'padding', PARENT_NODE = 'parentNode', POSITION = 'position', RELATIVE = 'relative', RESIZE = 'resize', RESIZING = 'resizing', RIGHT = 'right', STATIC = 'static', STYLE = 'style', TOP = 'top', WIDTH = 'width', WRAP = 'wrap', WRAPPER = 'wrapper', WRAP_TYPES = 'wrapTypes', EV_MOUSE_UP = 'resize:mouseUp', EV_RESIZE = 'resize:resize', EV_RESIZE_ALIGN = 'resize:align', EV_RESIZE_END = 'resize:end', EV_RESIZE_START = 'resize:start', T = 't', TR = 'tr', R = 'r', BR = 'br', B = 'b', BL = 'bl', L = 'l', TL = 'tl', concat = function() { return Array.prototype.slice.call(arguments).join(SPACE); }, // round the passed number to get rid of pixel-flickering toRoundNumber = function(num) { return Math.round(parseFloat(num)) || 0; }, getCompStyle = function(node, val) { return node.getComputedStyle(val); }, handleAttrName = function(handle) { return HANDLE + handle.toUpperCase(); }, isNode = function(v) { return (v instanceof Y.Node); }, toInitialCap = Y.cached( function(str) { return str.substring(0, 1).toUpperCase() + str.substring(1); } ), capitalize = Y.cached(function() { var out = [], args = YArray(arguments, 0, true); YArray.each(args, function(part, i) { if (i > 0) { part = toInitialCap(part); } out.push(part); }); return out.join(EMPTY_STR); }), getCN = Y.ClassNameManager.getClassName, CSS_RESIZE = getCN(RESIZE), CSS_RESIZE_HANDLE = getCN(RESIZE, HANDLE), CSS_RESIZE_HANDLE_ACTIVE = getCN(RESIZE, HANDLE, ACTIVE), CSS_RESIZE_HANDLE_INNER = getCN(RESIZE, HANDLE, INNER), CSS_RESIZE_HANDLE_INNER_PLACEHOLDER = getCN(RESIZE, HANDLE, INNER, HANDLE_SUB), CSS_RESIZE_HANDLE_PLACEHOLDER = getCN(RESIZE, HANDLE, HANDLE_SUB), CSS_RESIZE_HIDDEN_HANDLES = getCN(RESIZE, HIDDEN, HANDLES), CSS_RESIZE_HANDLES_WRAPPER = getCN(RESIZE, HANDLES, WRAPPER), CSS_RESIZE_WRAPPER = getCN(RESIZE, WRAPPER); /** A base class for Resize, providing: * Basic Lifecycle (initializer, renderUI, bindUI, syncUI, destructor) * Applies drag handles to an element to make it resizable * Here is the list of valid resize handles: `[ 't', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl' ]`. You can read this list as top, top-right, right, bottom-right, bottom, bottom-left, left, top-left. * The drag handles are inserted into the element and positioned absolute. Some elements, such as a textarea or image, don't support children. To overcome that, set wrap:true in your config and the element willbe wrapped for you automatically. Quick Example: var instance = new Y.Resize({ node: '#resize1', preserveRatio: true, wrap: true, maxHeight: 170, maxWidth: 400, handles: 't, tr, r, br, b, bl, l, tl' }); Check the list of <a href="Resize.html#configattributes">Configuration Attributes</a> available for Resize. @class Resize @param config {Object} Object literal specifying widget configuration properties. @constructor @extends Base */ function Resize() { Resize.superclass.constructor.apply(this, arguments); } Y.mix(Resize, { /** * Static property provides a string to identify the class. * * @property NAME * @type String * @static */ NAME: RESIZE, /** * Static property used to define the default attribute * configuration for the Resize. * * @property ATTRS * @type Object * @static */ ATTRS: { /** * Stores the active handle during the resize. * * @attribute activeHandle * @default null * @private * @type String */ activeHandle: { value: null, validator: function(v) { return Y.Lang.isString(v) || Y.Lang.isNull(v); } }, /** * Stores the active handle element during the resize. * * @attribute activeHandleNode * @default null * @private * @type Node */ activeHandleNode: { value: null, validator: isNode }, /** * False to ensure that the resize handles are always visible, true to * display them only when the user mouses over the resizable borders. * * @attribute autoHide * @default false * @type boolean */ autoHide: { value: false, validator: isBoolean }, /** * The default minimum height of the element. Only used when * ResizeConstrained is not plugged. * * @attribute defMinHeight * @default 15 * @type Number */ defMinHeight: { value: 15, validator: isNumber }, /** * The default minimum width of the element. Only used when * ResizeConstrained is not plugged. * * @attribute defMinWidth * @default 15 * @type Number */ defMinWidth: { value: 15, validator: isNumber }, /** * The handles to use (any combination of): 't', 'b', 'r', 'l', 'bl', * 'br', 'tl', 'tr'. Can use a shortcut of All. * * @attribute handles * @default all * @type Array | String */ handles: { setter: '_setHandles', value: ALL }, /** * Node to wrap the resize handles. * * @attribute handlesWrapper * @type Node */ handlesWrapper: { readOnly: true, setter: Y.one, valueFn: '_valueHandlesWrapper' }, /** * The selector or element to resize. Required. * * @attribute node * @type Node */ node: { setter: Y.one }, /** * True when the element is being Resized. * * @attribute resizing * @default false * @type boolean */ resizing: { value: false, validator: isBoolean }, /** * True to wrap an element with a div if needed (required for textareas * and images, defaults to false) in favor of the handles config option. * The wrapper element type (default div) could be over-riden passing the * <code>wrapper</code> attribute. * * @attribute wrap * @default false * @type boolean */ wrap: { setter: '_setWrap', value: false, validator: isBoolean }, /** * Elements that requires a wrapper by default. Normally are elements * which cannot have children elements. * * @attribute wrapTypes * @default /canvas|textarea|input|select|button|img/i * @readOnly * @type Regex */ wrapTypes: { readOnly: true, value: /^canvas|textarea|input|select|button|img|iframe|table|embed$/i }, /** * Element to wrap the <code>wrapTypes</code>. This element will house * the handles elements. * * @attribute wrapper * @default div * @type String | Node * @writeOnce */ wrapper: { readOnly: true, valueFn: '_valueWrapper', writeOnce: true } }, RULES: { b: function(instance, dx, dy) { var info = instance.info, originalInfo = instance.originalInfo; info.offsetHeight = originalInfo.offsetHeight + dy; }, l: function(instance, dx, dy) { var info = instance.info, originalInfo = instance.originalInfo; info.left = originalInfo.left + dx; info.offsetWidth = originalInfo.offsetWidth - dx; }, r: function(instance, dx, dy) { var info = instance.info, originalInfo = instance.originalInfo; info.offsetWidth = originalInfo.offsetWidth + dx; }, t: function(instance, dx, dy) { var info = instance.info, originalInfo = instance.originalInfo; info.top = originalInfo.top + dy; info.offsetHeight = originalInfo.offsetHeight - dy; }, tr: function(instance, dx, dy) { this.t.apply(this, arguments); this.r.apply(this, arguments); }, bl: function(instance, dx, dy) { this.b.apply(this, arguments); this.l.apply(this, arguments); }, br: function(instance, dx, dy) { this.b.apply(this, arguments); this.r.apply(this, arguments); }, tl: function(instance, dx, dy) { this.t.apply(this, arguments); this.l.apply(this, arguments); } }, capitalize: capitalize }); Y.Resize = Y.extend( Resize, Y.Base, { /** * Array containing all possible resizable handles. * * @property ALL_HANDLES * @type {String} */ ALL_HANDLES: [ T, TR, R, BR, B, BL, L, TL ], /** * Regex which matches with the handles that could change the height of * the resizable element. * * @property REGEX_CHANGE_HEIGHT * @type {String} */ REGEX_CHANGE_HEIGHT: /^(t|tr|b|bl|br|tl)$/i, /** * Regex which matches with the handles that could change the left of * the resizable element. * * @property REGEX_CHANGE_LEFT * @type {String} */ REGEX_CHANGE_LEFT: /^(tl|l|bl)$/i, /** * Regex which matches with the handles that could change the top of * the resizable element. * * @property REGEX_CHANGE_TOP * @type {String} */ REGEX_CHANGE_TOP: /^(tl|t|tr)$/i, /** * Regex which matches with the handles that could change the width of * the resizable element. * * @property REGEX_CHANGE_WIDTH * @type {String} */ REGEX_CHANGE_WIDTH: /^(bl|br|l|r|tl|tr)$/i, /** * Template used to create the resize wrapper for the handles. * * @property HANDLES_WRAP_TEMPLATE * @type {String} */ HANDLES_WRAP_TEMPLATE: '<div class="'+CSS_RESIZE_HANDLES_WRAPPER+'"></div>', /** * Template used to create the resize wrapper node when needed. * * @property WRAP_TEMPLATE * @type {String} */ WRAP_TEMPLATE: '<div class="'+CSS_RESIZE_WRAPPER+'"></div>', /** * Template used to create each resize handle. * * @property HANDLE_TEMPLATE * @type {String} */ HANDLE_TEMPLATE: '<div class="'+concat(CSS_RESIZE_HANDLE, CSS_RESIZE_HANDLE_PLACEHOLDER)+'">' + '<div class="'+concat(CSS_RESIZE_HANDLE_INNER, CSS_RESIZE_HANDLE_INNER_PLACEHOLDER)+'">&nbsp;</div>' + '</div>', /** * Each box has a content area and optional surrounding padding and * border areas. This property stores the sum of all horizontal * surrounding * information needed to adjust the node height. * * @property totalHSurrounding * @default 0 * @type number */ totalHSurrounding: 0, /** * Each box has a content area and optional surrounding padding and * border areas. This property stores the sum of all vertical * surrounding * information needed to adjust the node height. * * @property totalVSurrounding * @default 0 * @type number */ totalVSurrounding: 0, /** * Stores the <a href="Resize.html#config_node">node</a> * surrounding information retrieved from * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>. * * @property nodeSurrounding * @type Object * @default null */ nodeSurrounding: null, /** * Stores the <a href="Resize.html#config_wrapper">wrapper</a> * surrounding information retrieved from * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>. * * @property wrapperSurrounding * @type Object * @default null */ wrapperSurrounding: null, /** * Whether the handle being dragged can change the height. * * @property changeHeightHandles * @default false * @type boolean */ changeHeightHandles: false, /** * Whether the handle being dragged can change the left. * * @property changeLeftHandles * @default false * @type boolean */ changeLeftHandles: false, /** * Whether the handle being dragged can change the top. * * @property changeTopHandles * @default false * @type boolean */ changeTopHandles: false, /** * Whether the handle being dragged can change the width. * * @property changeWidthHandles * @default false * @type boolean */ changeWidthHandles: false, /** * Store DD.Delegate reference for the respective Resize instance. * * @property delegate * @default null * @type Object */ delegate: null, /** * Stores the current values for the height, width, top and left. You are * able to manipulate these values on resize in order to change the resize * behavior. * * @property info * @type Object * @protected */ info: null, /** * Stores the last values for the height, width, top and left. * * @property lastInfo * @type Object * @protected */ lastInfo: null, /** * Stores the original values for the height, width, top and left, stored * on resize start. * * @property originalInfo * @type Object * @protected */ originalInfo: null, /** * Construction logic executed during Resize instantiation. Lifecycle. * * @method initializer * @protected */ initializer: function() { this.renderer(); }, /** * Create the DOM structure for the Resize. Lifecycle. * * @method renderUI * @protected */ renderUI: function() { var instance = this; instance._renderHandles(); }, /** * Bind the events on the Resize UI. Lifecycle. * * @method bindUI * @protected */ bindUI: function() { var instance = this; instance._createEvents(); instance._bindDD(); instance._bindHandle(); }, /** * Sync the Resize UI. * * @method syncUI * @protected */ syncUI: function() { var instance = this; this.get(NODE).addClass(CSS_RESIZE); // hide handles if AUTO_HIDE is true instance._setHideHandlesUI( instance.get(AUTO_HIDE) ); }, /** * Descructor lifecycle implementation for the Resize class. Purges events attached * to the node (and all child nodes) and removes the Resize handles. * * @method destructor * @protected */ destructor: function() { var instance = this, node = instance.get(NODE), wrapper = instance.get(WRAPPER), pNode = wrapper.get(PARENT_NODE); // purgeElements on boundingBox Y.Event.purgeElement(wrapper, true); // destroy handles dd and remove them from the dom instance.eachHandle(function(handleEl) { instance.delegate.dd.destroy(); // remove handle handleEl.remove(true); }); // unwrap node if (instance.get(WRAP)) { instance._copyStyles(wrapper, node); if (pNode) { pNode.insertBefore(node, wrapper); } wrapper.remove(true); } node.removeClass(CSS_RESIZE); node.removeClass(CSS_RESIZE_HIDDEN_HANDLES); }, /** * Creates DOM (or manipulates DOM for progressive enhancement) * This method is invoked by initializer(). It's chained automatically for * subclasses if required. * * @method renderer * @protected */ renderer: function() { this.renderUI(); this.bindUI(); this.syncUI(); }, /** * <p>Loop through each handle which is being used and executes a callback.</p> * <p>Example:</p> * <pre><code>instance.eachHandle( * function(handleName, index) { ... } * );</code></pre> * * @method eachHandle * @param {function} fn Callback function to be executed for each handle. */ eachHandle: function(fn) { var instance = this; Y.each( instance.get(HANDLES), function(handle, i) { var handleEl = instance.get( handleAttrName(handle) ); fn.apply(instance, [handleEl, handle, i]); } ); }, /** * Bind the handles DragDrop events to the Resize instance. * * @method _bindDD * @private */ _bindDD: function() { var instance = this; instance.delegate = new Y.DD.Delegate( { bubbleTargets: instance, container: instance.get(HANDLES_WRAPPER), dragConfig: { clickPixelThresh: 0, clickTimeThresh: 0, useShim: true, move: false }, nodes: DOT+CSS_RESIZE_HANDLE, target: false } ); instance.on('drag:drag', instance._handleResizeEvent); instance.on('drag:dropmiss', instance._handleMouseUpEvent); instance.on('drag:end', instance._handleResizeEndEvent); instance.on('drag:start', instance._handleResizeStartEvent); }, /** * Bind the events related to the handles (_onHandleMouseEnter, _onHandleMouseLeave). * * @method _bindHandle * @private */ _bindHandle: function() { var instance = this, wrapper = instance.get(WRAPPER); wrapper.on('mouseenter', Y.bind(instance._onWrapperMouseEnter, instance)); wrapper.on('mouseleave', Y.bind(instance._onWrapperMouseLeave, instance)); wrapper.delegate('mouseenter', Y.bind(instance._onHandleMouseEnter, instance), DOT+CSS_RESIZE_HANDLE); wrapper.delegate('mouseleave', Y.bind(instance._onHandleMouseLeave, instance), DOT+CSS_RESIZE_HANDLE); }, /** * Create the custom events used on the Resize. * * @method _createEvents * @private */ _createEvents: function() { var instance = this, // create publish function for kweight optimization publish = function(name, fn) { instance.publish(name, { defaultFn: fn, queuable: false, emitFacade: true, bubbles: true, prefix: RESIZE }); }; /** * Handles the resize start event. Fired when a handle starts to be * dragged. * * @event resize:start * @preventable _defResizeStartFn * @param {Event.Facade} event The resize start event. * @bubbles Resize * @type {Event.Custom} */ publish(EV_RESIZE_START, this._defResizeStartFn); /** * Handles the resize event. Fired on each pixel when the handle is * being dragged. * * @event resize:resize * @preventable _defResizeFn * @param {Event.Facade} event The resize event. * @bubbles Resize * @type {Event.Custom} */ publish(EV_RESIZE, this._defResizeFn); /** * Handles the resize align event. * * @event resize:align * @preventable _defResizeAlignFn * @param {Event.Facade} event The resize align event. * @bubbles Resize * @type {Event.Custom} */ publish(EV_RESIZE_ALIGN, this._defResizeAlignFn); /** * Handles the resize end event. Fired when a handle stop to be * dragged. * * @event resize:end * @preventable _defResizeEndFn * @param {Event.Facade} event The resize end event. * @bubbles Resize * @type {Event.Custom} */ publish(EV_RESIZE_END, this._defResizeEndFn); /** * Handles the resize mouseUp event. Fired when a mouseUp event happens on a * handle. * * @event resize:mouseUp * @preventable _defMouseUpFn * @param {Event.Facade} event The resize mouseUp event. * @bubbles Resize * @type {Event.Custom} */ publish(EV_MOUSE_UP, this._defMouseUpFn); }, /** * Responsible for loop each handle element and append to the wrapper. * * @method _renderHandles * @protected */ _renderHandles: function() { var instance = this, wrapper = instance.get(WRAPPER), handlesWrapper = instance.get(HANDLES_WRAPPER); instance.eachHandle(function(handleEl) { handlesWrapper.append(handleEl); }); wrapper.append(handlesWrapper); }, /** * Creates the handle element based on the handle name and initialize the * DragDrop on it. * * @method _buildHandle * @param {String} handle Handle name ('t', 'tr', 'b', ...). * @protected */ _buildHandle: function(handle) { var instance = this; return Y.Node.create( Y.substitute(instance.HANDLE_TEMPLATE, { handle: handle }) ); }, /** * Basic resize calculations. * * @method _calcResize * @protected */ _calcResize: function() { var instance = this, handle = instance.handle, info = instance.info, originalInfo = instance.originalInfo, dx = info.actXY[0] - originalInfo.actXY[0], dy = info.actXY[1] - originalInfo.actXY[1]; if (handle && Y.Resize.RULES[handle]) { Y.Resize.RULES[handle](instance, dx, dy); } else { } }, /** * Helper method to update the current size value on * <a href="Resize.html#property_info">info</a> to respect the * min/max values and fix the top/left calculations. * * @method _checkSize * @param {String} offset 'offsetHeight' or 'offsetWidth' * @param {number} size Size to restrict the offset * @protected */ _checkSize: function(offset, size) { var instance = this, info = instance.info, originalInfo = instance.originalInfo, axis = (offset == OFFSET_HEIGHT) ? TOP : LEFT; // forcing the offsetHeight/offsetWidth to be the passed size info[offset] = size; // predicting, based on the original information, the last left valid in case of reach the min/max dimension // this calculation avoid browser event leaks when user interact very fast if (((axis == LEFT) && instance.changeLeftHandles) || ((axis == TOP) && instance.changeTopHandles)) { info[axis] = originalInfo[axis] + originalInfo[offset] - size; } }, /** * Copy relevant styles of the <a href="Resize.html#config_node">node</a> * to the <a href="Resize.html#config_wrapper">wrapper</a>. * * @method _copyStyles * @param {Node} node Node from. * @param {Node} wrapper Node to. * @protected */ _copyStyles: function(node, wrapper) { var position = node.getStyle(POSITION).toLowerCase(), surrounding = this._getBoxSurroundingInfo(node), wrapperStyle; // resizable wrapper should be positioned if (position == STATIC) { position = RELATIVE; } wrapperStyle = { position: position, left: getCompStyle(node, LEFT), top: getCompStyle(node, TOP) }; Y.mix(wrapperStyle, surrounding.margin); Y.mix(wrapperStyle, surrounding.border); wrapper.setStyles(wrapperStyle); // remove margin and border from the internal node node.setStyles({ border: 0, margin: 0 }); wrapper.sizeTo( node.get(OFFSET_WIDTH) + surrounding.totalHBorder, node.get(OFFSET_HEIGHT) + surrounding.totalVBorder ); }, // extract handle name from a string // using Y.cached to memoize the function for performance _extractHandleName: Y.cached( function(node) { var className = node.get(CLASS_NAME), match = className.match( new RegExp( getCN(RESIZE, HANDLE, '(\\w{1,2})\\b') ) ); return match ? match[1] : null; } ), /** * <p>Generates metadata to the <a href="Resize.html#property_info">info</a> * and <a href="Resize.html#property_originalInfo">originalInfo</a></p> * <pre><code>bottom, actXY, left, top, offsetHeight, offsetWidth, right</code></pre> * * @method _getInfo * @param {Node} node * @param {EventFacade} event * @private */ _getInfo: function(node, event) { var actXY = [0,0], drag = event.dragEvent.target, nodeXY = node.getXY(), nodeX = nodeXY[0], nodeY = nodeXY[1], offsetHeight = node.get(OFFSET_HEIGHT), offsetWidth = node.get(OFFSET_WIDTH); if (event) { // the xy that the node will be set to. Changing this will alter the position as it's dragged. actXY = (drag.actXY.length ? drag.actXY : drag.lastXY); } return { actXY: actXY, bottom: (nodeY + offsetHeight), left: nodeX, offsetHeight: offsetHeight, offsetWidth: offsetWidth, right: (nodeX + offsetWidth), top: nodeY }; }, /** * Each box has a content area and optional surrounding margin, * padding and * border areas. This method get all this information from * the passed node. For more reference see * <a href="http://www.w3.org/TR/CSS21/box.html#box-dimensions"> * http://www.w3.org/TR/CSS21/box.html#box-dimensions</a>. * * @method _getBoxSurroundingInfo * @param {Node} node * @private * @return {Object} */ _getBoxSurroundingInfo: function(node) { var info = { padding: {}, margin: {}, border: {} }; if (isNode(node)) { Y.each([ TOP, RIGHT, BOTTOM, LEFT ], function(dir) { var paddingProperty = capitalize(PADDING, dir), marginProperty = capitalize(MARGIN, dir), borderWidthProperty = capitalize(BORDER, dir, WIDTH), borderColorProperty = capitalize(BORDER, dir, COLOR), borderStyleProperty = capitalize(BORDER, dir, STYLE); info.border[borderColorProperty] = getCompStyle(node, borderColorProperty); info.border[borderStyleProperty] = getCompStyle(node, borderStyleProperty); info.border[borderWidthProperty] = getCompStyle(node, borderWidthProperty); info.margin[marginProperty] = getCompStyle(node, marginProperty); info.padding[paddingProperty] = getCompStyle(node, paddingProperty); }); } info.totalHBorder = (toRoundNumber(info.border.borderLeftWidth) + toRoundNumber(info.border.borderRightWidth)); info.totalHPadding = (toRoundNumber(info.padding.paddingLeft) + toRoundNumber(info.padding.paddingRight)); info.totalVBorder = (toRoundNumber(info.border.borderBottomWidth) + toRoundNumber(info.border.borderTopWidth)); info.totalVPadding = (toRoundNumber(info.padding.paddingBottom) + toRoundNumber(info.padding.paddingTop)); return info; }, /** * Sync the Resize UI with internal values from * <a href="Resize.html#property_info">info</a>. * * @method _syncUI * @protected */ _syncUI: function() { var instance = this, info = instance.info, wrapperSurrounding = instance.wrapperSurrounding, wrapper = instance.get(WRAPPER), node = instance.get(NODE); wrapper.sizeTo(info.offsetWidth, info.offsetHeight); if (instance.changeLeftHandles || instance.changeTopHandles) { wrapper.setXY([info.left, info.top]); } // if a wrap node is being used if (!wrapper.compareTo(node)) { // the original internal node borders were copied to the wrapper on _copyStyles, to compensate that subtract the borders from the internal node node.sizeTo( info.offsetWidth - wrapperSurrounding.totalHBorder, info.offsetHeight - wrapperSurrounding.totalVBorder ); } // prevent webkit textarea resize if (Y.UA.webkit) { node.setStyle(RESIZE, NONE); } }, /** * Update <code>instance.changeHeightHandles, * instance.changeLeftHandles, instance.changeTopHandles, * instance.changeWidthHandles</code> information. * * @method _updateChangeHandleInfo * @private */ _updateChangeHandleInfo: function(handle) { var instance = this; instance.changeHeightHandles = instance.REGEX_CHANGE_HEIGHT.test(handle); instance.changeLeftHandles = instance.REGEX_CHANGE_LEFT.test(handle); instance.changeTopHandles = instance.REGEX_CHANGE_TOP.test(handle); instance.changeWidthHandles = instance.REGEX_CHANGE_WIDTH.test(handle); }, /** * Update <a href="Resize.html#property_info">info</a> values (bottom, actXY, left, top, offsetHeight, offsetWidth, right). * * @method _updateInfo * @private */ _updateInfo: function(event) { var instance = this; instance.info = instance._getInfo(instance.get(WRAPPER), event); }, /** * Update properties * <a href="Resize.html#property_nodeSurrounding">nodeSurrounding</a>, * <a href="Resize.html#property_nodeSurrounding">wrapperSurrounding</a>, * <a href="Resize.html#property_nodeSurrounding">totalVSurrounding</a>, * <a href="Resize.html#property_nodeSurrounding">totalHSurrounding</a>. * * @method _updateSurroundingInfo * @private */ _updateSurroundingInfo: function() { var instance = this, node = instance.get(NODE), wrapper = instance.get(WRAPPER), nodeSurrounding = instance._getBoxSurroundingInfo(node), wrapperSurrounding = instance._getBoxSurroundingInfo(wrapper); instance.nodeSurrounding = nodeSurrounding; instance.wrapperSurrounding = wrapperSurrounding; instance.totalVSurrounding = (nodeSurrounding.totalVPadding + wrapperSurrounding.totalVBorder); instance.totalHSurrounding = (nodeSurrounding.totalHPadding + wrapperSurrounding.totalHBorder); }, /** * Set the active state of the handles. * * @method _setActiveHandlesUI * @param {boolean} val True to activate the handles, false to deactivate. * @protected */ _setActiveHandlesUI: function(val) { var instance = this, activeHandleNode = instance.get(ACTIVE_HANDLE_NODE); if (activeHandleNode) { if (val) { // remove CSS_RESIZE_HANDLE_ACTIVE from all handles before addClass on the active instance.eachHandle( function(handleEl) { handleEl.removeClass(CSS_RESIZE_HANDLE_ACTIVE); } ); activeHandleNode.addClass(CSS_RESIZE_HANDLE_ACTIVE); } else { activeHandleNode.removeClass(CSS_RESIZE_HANDLE_ACTIVE); } } }, /** * Setter for the handles attribute * * @method _setHandles * @protected * @param {String} val */ _setHandles: function(val) { var instance = this, handles = []; // handles attr accepts both array or string if (isArray(val)) { handles = val; } else if (isString(val)) { // if the handles attr passed in is an ALL string... if (val.toLowerCase() == ALL) { handles = instance.ALL_HANDLES; } // otherwise, split the string to extract the handles else { Y.each( val.split(COMMA), function(node, i) { var handle = trim(node); // if its a valid handle, add it to the handles output if (indexOf(instance.ALL_HANDLES, handle) > -1) { handles.push(handle); } } ); } } return handles; }, /** * Set the visibility of the handles. * * @method _setHideHandlesUI * @param {boolean} val True to hide the handles, false to show. * @protected */ _setHideHandlesUI: function(val) { var instance = this, wrapper = instance.get(WRAPPER); if (!instance.get(RESIZING)) { if (val) { wrapper.addClass(CSS_RESIZE_HIDDEN_HANDLES); } else { wrapper.removeClass(CSS_RESIZE_HIDDEN_HANDLES); } } }, /** * Setter for the wrap attribute * * @method _setWrap * @protected * @param {boolean} val */ _setWrap: function(val) { var instance = this, node = instance.get(NODE), nodeName = node.get(NODE_NAME), typeRegex = instance.get(WRAP_TYPES); // if nodeName is listed on WRAP_TYPES force use the wrapper if (typeRegex.test(nodeName)) { val = true; } return val; }, /** * Default resize:mouseUp handler * * @method _defMouseUpFn * @param {EventFacade} event The Event object * @protected */ _defMouseUpFn: function(event) { var instance = this; instance.set(RESIZING, false); }, /** * Default resize:resize handler * * @method _defResizeFn * @param {EventFacade} event The Event object * @protected */ _defResizeFn: function(event) { var instance = this; instance._resize(event); }, /** * Logic method for _defResizeFn. Allow AOP. * * @method _resize * @param {EventFacade} event The Event object * @protected */ _resize: function(event) { var instance = this; instance._handleResizeAlignEvent(event.dragEvent); // _syncUI of the wrapper, not using proxy instance._syncUI(); }, /** * Default resize:align handler * * @method _defResizeAlignFn * @param {EventFacade} event The Event object * @protected */ _defResizeAlignFn: function(event) { var instance = this; instance._resizeAlign(event); }, /** * Logic method for _defResizeAlignFn. Allow AOP. * * @method _resizeAlign * @param {EventFacade} event The Event object * @protected */ _resizeAlign: function(event) { var instance = this, info, defMinHeight, defMinWidth; instance.lastInfo = instance.info; // update the instance.info values instance._updateInfo(event); info = instance.info; // basic resize calculations instance._calcResize(); // if Y.Plugin.ResizeConstrained is not plugged, check for min dimension if (!instance.con) { defMinHeight = (instance.get(DEF_MIN_HEIGHT) + instance.totalVSurrounding); defMinWidth = (instance.get(DEF_MIN_WIDTH) + instance.totalHSurrounding); if (info.offsetHeight <= defMinHeight) { instance._checkSize(OFFSET_HEIGHT, defMinHeight); } if (info.offsetWidth <= defMinWidth) { instance._checkSize(OFFSET_WIDTH, defMinWidth); } } }, /** * Default resize:end handler * * @method _defResizeEndFn * @param {EventFacade} event The Event object * @protected */ _defResizeEndFn: function(event) { var instance = this; instance._resizeEnd(event); }, /** * Logic method for _defResizeEndFn. Allow AOP. * * @method _resizeEnd * @param {EventFacade} event The Event object * @protected */ _resizeEnd: function(event) { var instance = this, drag = event.dragEvent.target; // reseting actXY from drag when drag end drag.actXY = []; // syncUI when resize end instance._syncUI(); instance._setActiveHandlesUI(false); instance.set(ACTIVE_HANDLE, null); instance.set(ACTIVE_HANDLE_NODE, null); instance.handle = null; }, /** * Default resize:start handler * * @method _defResizeStartFn * @param {EventFacade} event The Event object * @protected */ _defResizeStartFn: function(event) { var instance = this; instance._resizeStart(event); }, /** * Logic method for _defResizeStartFn. Allow AOP. * * @method _resizeStart * @param {EventFacade} event The Event object * @protected */ _resizeStart: function(event) { var instance = this, wrapper = instance.get(WRAPPER); instance.handle = instance.get(ACTIVE_HANDLE); instance.set(RESIZING, true); instance._updateSurroundingInfo(); // create an originalInfo information for reference instance.originalInfo = instance._getInfo(wrapper, event); instance._updateInfo(event); }, /** * Fires the resize:mouseUp event. * * @method _handleMouseUpEvent * @param {EventFacade} event resize:mouseUp event facade * @protected */ _handleMouseUpEvent: function(event) { this.fire(EV_MOUSE_UP, { dragEvent: event, info: this.info }); }, /** * Fires the resize:resize event. * * @method _handleResizeEvent * @param {EventFacade} event resize:resize event facade * @protected */ _handleResizeEvent: function(event) { this.fire(EV_RESIZE, { dragEvent: event, info: this.info }); }, /** * Fires the resize:align event. * * @method _handleResizeAlignEvent * @param {EventFacade} event resize:resize event facade * @protected */ _handleResizeAlignEvent: function(event) { this.fire(EV_RESIZE_ALIGN, { dragEvent: event, info: this.info }); }, /** * Fires the resize:end event. * * @method _handleResizeEndEvent * @param {EventFacade} event resize:end event facade * @protected */ _handleResizeEndEvent: function(event) { this.fire(EV_RESIZE_END, { dragEvent: event, info: this.info }); }, /** * Fires the resize:start event. * * @method _handleResizeStartEvent * @param {EventFacade} event resize:start event facade * @protected */ _handleResizeStartEvent: function(event) { if (!this.get(ACTIVE_HANDLE)) { //This handles the "touch" case this._setHandleFromNode(event.target.get('node')); } this.fire(EV_RESIZE_START, { dragEvent: event, info: this.info }); }, /** * Mouseenter event handler for the <a href="Resize.html#config_wrapper">wrapper</a>. * * @method _onWrapperMouseEnter * @param {EventFacade} event * @protected */ _onWrapperMouseEnter: function(event) { var instance = this; if (instance.get(AUTO_HIDE)) { instance._setHideHandlesUI(false); } }, /** * Mouseleave event handler for the <a href="Resize.html#config_wrapper">wrapper</a>. * * @method _onWrapperMouseLeave * @param {EventFacade} event * @protected */ _onWrapperMouseLeave: function(event) { var instance = this; if (instance.get(AUTO_HIDE)) { instance._setHideHandlesUI(true); } }, /** * Handles setting the activeHandle from a node, used from startDrag (for touch) and mouseenter (for mouse). * * @method _setHandleFromNode * @param {Node} node * @protected */ _setHandleFromNode: function(node) { var instance = this, handle = instance._extractHandleName(node); if (!instance.get(RESIZING)) { instance.set(ACTIVE_HANDLE, handle); instance.set(ACTIVE_HANDLE_NODE, node); instance._setActiveHandlesUI(true); instance._updateChangeHandleInfo(handle); } }, /** * Mouseenter event handler for the handles. * * @method _onHandleMouseEnter * @param {EventFacade} event * @protected */ _onHandleMouseEnter: function(event) { this._setHandleFromNode(event.currentTarget); }, /** * Mouseout event handler for the handles. * * @method _onHandleMouseLeave * @param {EventFacade} event * @protected */ _onHandleMouseLeave: function(event) { var instance = this; if (!instance.get(RESIZING)) { instance._setActiveHandlesUI(false); } }, /** * Default value for the wrapper handles node attribute * * @method _valueHandlesWrapper * @protected * @readOnly */ _valueHandlesWrapper: function() { return Y.Node.create(this.HANDLES_WRAP_TEMPLATE); }, /** * Default value for the wrapper attribute * * @method _valueWrapper * @protected * @readOnly */ _valueWrapper: function() { var instance = this, node = instance.get(NODE), pNode = node.get(PARENT_NODE), // by deafult the wrapper is always the node wrapper = node; // if the node is listed on the wrapTypes or wrap is set to true, create another wrapper if (instance.get(WRAP)) { wrapper = Y.Node.create(instance.WRAP_TEMPLATE); if (pNode) { pNode.insertBefore(wrapper, node); } wrapper.append(node); instance._copyStyles(node, wrapper); // remove positioning of wrapped node, the WRAPPER take care about positioning node.setStyles({ position: STATIC, left: 0, top: 0 }); } return wrapper; } } ); Y.each(Y.Resize.prototype.ALL_HANDLES, function(handle, i) { // creating ATTRS with the handles elements Y.Resize.ATTRS[handleAttrName(handle)] = { setter: function() { return this._buildHandle(handle); }, value: null, writeOnce: true }; }); }, '@VERSION@' ,{requires:['base', 'widget', 'substitute', 'event', 'oop', 'dd-drag', 'dd-delegate', 'dd-drop'], skinnable:true});
keicheng/cdnjs
ajax/libs/yui/3.5.0/resize-base/resize-base.js
JavaScript
mit
40,843
// removeSubsets // Given an array of nodes, remove any member that is contained by another. exports.removeSubsets = function(nodes) { var idx = nodes.length, node, ancestor, replace; // Check if each node (or one of its ancestors) is already contained in the // array. while (--idx > -1) { node = ancestor = nodes[idx]; // Temporarily remove the node under consideration nodes[idx] = null; replace = true; while (ancestor) { if (nodes.indexOf(ancestor) > -1) { replace = false; nodes.splice(idx, 1); break; } ancestor = ancestor.parent; } // If the node has been found to be unique, re-insert it. if (replace) { nodes[idx] = node; } } return nodes; }; // Source: http://dom.spec.whatwg.org/#dom-node-comparedocumentposition var POSITION = { DISCONNECTED: 1, PRECEDING: 2, FOLLOWING: 4, CONTAINS: 8, CONTAINED_BY: 16 }; // Compare the position of one node against another node in any other document. // The return value is a bitmask with the following values: // // document order: // > There is an ordering, document order, defined on all the nodes in the // > document corresponding to the order in which the first character of the // > XML representation of each node occurs in the XML representation of the // > document after expansion of general entities. Thus, the document element // > node will be the first node. Element nodes occur before their children. // > Thus, document order orders element nodes in order of the occurrence of // > their start-tag in the XML (after expansion of entities). The attribute // > nodes of an element occur after the element and before its children. The // > relative order of attribute nodes is implementation-dependent./ // Source: // http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order // // @argument {Node} nodaA The first node to use in the comparison // @argument {Node} nodeB The second node to use in the comparison // // @return {Number} A bitmask describing the input nodes' relative position. // See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for // a description of these values. var comparePos = exports.compareDocumentPosition = function(nodeA, nodeB) { var aParents = []; var bParents = []; var current, sharedParent, siblings, aSibling, bSibling, idx; if (nodeA === nodeB) { return 0; } current = nodeA; while (current) { aParents.unshift(current); current = current.parent; } current = nodeB; while (current) { bParents.unshift(current); current = current.parent; } idx = 0; while (aParents[idx] === bParents[idx]) { idx++; } if (idx === 0) { return POSITION.DISCONNECTED; } sharedParent = aParents[idx - 1]; siblings = sharedParent.children; aSibling = aParents[idx]; bSibling = bParents[idx]; if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) { if (sharedParent === nodeB) { return POSITION.FOLLOWING | POSITION.CONTAINED_BY; } return POSITION.FOLLOWING; } else { if (sharedParent === nodeA) { return POSITION.PRECEDING | POSITION.CONTAINS; } return POSITION.PRECEDING; } }; // Sort an array of nodes based on their relative position in the document and // remove any duplicate nodes. If the array contains nodes that do not belong // to the same document, sort order is unspecified. // // @argument {Array} nodes Array of DOM nodes // // @returns {Array} collection of unique nodes, sorted in document order exports.uniqueSort = function(nodes) { var idx = nodes.length, node, position; nodes = nodes.slice(); while (--idx > -1) { node = nodes[idx]; position = nodes.indexOf(node); if (position > -1 && position < idx) { nodes.splice(idx, 1); } } nodes.sort(function(a, b) { var relative = comparePos(a, b); if (relative & POSITION.PRECEDING) { return -1; } else if (relative & POSITION.FOLLOWING) { return 1; } return 0; }); return nodes; };
natewscott/rb-redesign
node_modules/domutils/lib/helpers.js
JavaScript
mit
3,930
var parse = require('../'); var test = require('tape'); test('flag boolean default false', function (t) { var argv = parse(['moo'], { boolean: ['t', 'verbose'], default: { verbose: false, t: false } }); t.deepEqual(argv, { verbose: false, t: false, _: ['moo'] }); t.deepEqual(typeof argv.verbose, 'boolean'); t.deepEqual(typeof argv.t, 'boolean'); t.end(); }); test('boolean groups', function (t) { var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { boolean: ['x','y','z'] }); t.deepEqual(argv, { x : true, y : false, z : true, _ : [ 'one', 'two', 'three' ] }); t.deepEqual(typeof argv.x, 'boolean'); t.deepEqual(typeof argv.y, 'boolean'); t.deepEqual(typeof argv.z, 'boolean'); t.end(); }); test('boolean and alias with chainable api', function (t) { var aliased = [ '-h', 'derp' ]; var regular = [ '--herp', 'derp' ]; var opts = { herp: { alias: 'h', boolean: true } }; var aliasedArgv = parse(aliased, { boolean: 'herp', alias: { h: 'herp' } }); var propertyArgv = parse(regular, { boolean: 'herp', alias: { h: 'herp' } }); var expected = { herp: true, h: true, '_': [ 'derp' ] }; t.same(aliasedArgv, expected); t.same(propertyArgv, expected); t.end(); }); test('boolean and alias with options hash', function (t) { var aliased = [ '-h', 'derp' ]; var regular = [ '--herp', 'derp' ]; var opts = { alias: { 'h': 'herp' }, boolean: 'herp' }; var aliasedArgv = parse(aliased, opts); var propertyArgv = parse(regular, opts); var expected = { herp: true, h: true, '_': [ 'derp' ] }; t.same(aliasedArgv, expected); t.same(propertyArgv, expected); t.end(); }); test('boolean and alias using explicit true', function (t) { var aliased = [ '-h', 'true' ]; var regular = [ '--herp', 'true' ]; var opts = { alias: { h: 'herp' }, boolean: 'h' }; var aliasedArgv = parse(aliased, opts); var propertyArgv = parse(regular, opts); var expected = { herp: true, h: true, '_': [ ] }; t.same(aliasedArgv, expected); t.same(propertyArgv, expected); t.end(); }); // regression, see https://github.com/substack/node-optimist/issues/71 test('boolean and --x=true', function(t) { var parsed = parse(['--boool', '--other=true'], { boolean: 'boool' }); t.same(parsed.boool, true); t.same(parsed.other, 'true'); parsed = parse(['--boool', '--other=false'], { boolean: 'boool' }); t.same(parsed.boool, true); t.same(parsed.other, 'false'); t.end(); });
jasondecamp/mememe
node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/minimist/test/bool.js
JavaScript
mit
2,853
var LoaderLoadingError = require("./LoaderLoadingError"); module.exports = function loadLoader(loader, callback) { if(typeof System === "object" && typeof System.import === "function") { System.import(loader.path).catch(callback).then(function(module) { loader.normal = typeof module === "function" ? module : module.default; loader.pitch = module.pitch; loader.raw = module.raw; if(typeof loader.normal !== "function" && typeof loader.pitch !== "function") { return callback(new LoaderLoadingError( "Module '" + loader.path + "' is not a loader (must have normal or pitch function)" )); } callback(); }); } else { try { var module = require(loader.path); } catch(e) { // it is possible for node to choke on a require if the FD descriptor // limit has been reached. give it a chance to recover. if(e instanceof Error && e.code === "EMFILE") { var retry = loadLoader.bind(null, loader, callback); if(typeof setImmediate === "function") { // node >= 0.9.0 return setImmediate(retry); } else { // node < 0.9.0 return process.nextTick(retry); } } return callback(e); } if(typeof module !== "function" && typeof module !== "object") { return callback(new LoaderLoadingError( "Module '" + loader.path + "' is not a loader (export function or es6 module)" )); } loader.normal = typeof module === "function" ? module : module.default; loader.pitch = module.pitch; loader.raw = module.raw; if(typeof loader.normal !== "function" && typeof loader.pitch !== "function") { return callback(new LoaderLoadingError( "Module '" + loader.path + "' is not a loader (must have normal or pitch function)" )); } callback(); } };
jpoeng/jpoeng.github.io
node_modules/loader-runner/lib/loadLoader.js
JavaScript
mit
1,743
var kunstmaanbundles = kunstmaanbundles || {}; kunstmaanbundles.bulkActions = (function($, window, undefined) { var init, setAllCheckbox, updateBulkCheckboxes, bulkAction; var $form = $('#bulk-form'), $SelectAllCheckbox = $('#select-all-bulk-checkbox'), $bulkCheckboxes = $('.js-bulk-checkbox'), $bulkActionButtons = $('.js-bulk-action-button'); init = function() { if($form.length) { setAllCheckbox(); $bulkCheckboxes.on('change', updateBulkCheckboxes); $bulkActionButtons.on('click', function() { bulkAction($(this)); }); } }; // All setAllCheckbox = function() { $SelectAllCheckbox.on('change', function() { if (this.checked === true) { $bulkCheckboxes.prop('checked', true); $bulkActionButtons.removeClass('disabled').removeAttr('disabled'); } else { $bulkCheckboxes.prop('checked', false); $bulkActionButtons.addClass('disabled').attr('disabled', 'true'); } }); }; // Update updateBulkCheckboxes = function() { var allChecked = true, oneChecked = false; // Check if all is checked $bulkCheckboxes.each(function() { if(this.checked === true) { oneChecked = true; } else { allChecked = false; } }); $SelectAllCheckbox.prop('checked', allChecked); // Check if one or more is checked if (oneChecked) { $bulkActionButtons.removeClass('disabled').removeAttr('disabled'); } else { $bulkActionButtons.addClass('disabled').attr('disabled', 'true'); } }; // Action buttons bulkAction = function($btn) { var formAction = $btn.data('action'); $form.attr('action', formAction); $form.submit(); }; return { init: init }; })(jQuery, window);
iBenito/KunstmaanBundlesCMS
src/Kunstmaan/AdminBundle/Resources/ui/js/_bulk-actions.js
JavaScript
mit
2,048
/* All of the code within the ZingChart software is developed and copyrighted by PINT, Inc., and may not be copied, replicated, or used in any other software or application without prior permission from PINT. All usage must coincide with the ZingChart End User License Agreement which can be requested by email at support@zingchart.com. Build 0.140806 */ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('cx.cq.cg("m-r");(bH(){8U(!u.m.r){u.m.r={}}8U(!u.m.2r.r){u.m.2r.r={}}cA a={4A:[[-75.4l,-48.2V],[-75.2O,-48.56],[-75.8s,-48.d3],[-75.1p,-48.bE],[-75.bQ,-48.1S],[-75.6w,-48.5K],[-75.4l,-48.2V],d,[-74.T,-48.8T],[-74.4G,-48.6E],[-74.U,-48.4j],[-74.T,-48.8T],d,[-74.7b,-48.p],[-74.5I,-48.cT],[-74.8l,-48.8Y],[-74.cV,-48.3N],[-74.8Q,-48.1S],[-74.3Z,-48.9a],[-74.1r,-48.4k],[-74.8t,-48.9p],[-74.7b,-48.p],d,[-74.2c,-48.4g],[-74.31,-48.3p],[-74.3M,-48.cU],[-74.2c,-48.4g],d,[-75.2M,-48.5d],[-74.9x,-48.9A],[-74.1N,-48.ac],[-74.8V,-48.2w],[-74.1r,-48.6D],[-74.cO,-48.5n],[-74.ai,-48.2k],[-75.6P,-48.2],[-75.2M,-48.5d],d,[-75.1W,-48.4z],[-75.1W,-48.4z],[-75.4T,-48.1V],[-75.6x,-48.2s],[-75.7z,-48.5v],[-75.1v,-48.b2],[-75.5C,-48.6m],[-75.3m,-48.5u],[-75.2a,-48.cI],[-75.9c,-47.cX],[-75.2F,-48.2D],[-75.d9,-48.1O],[-75.1W,-48.4z],d,[-74.5a,-47.79],[-74.1g,-47.o],[-74.L,-48.8e],[-74.9H,-48.2H],[-74.1y,-48.C],[-75.2f,-48.d4],[-74.9y,-47.6T],[-74.5a,-47.79],d,[-74.7J,-47.4a],[-73.4V,-47.3D],[-73.5J,-47.2y],[-74.4l,-47.4V],[-74.a3,-47.89],[-74.7J,-47.4a],d,[-73.5S,-45.7a],[-73.d0,-46.dc],[-73.8V,-46.21],[-73.3n,-46.5G],[-73.5S,-45.7a],d,[-73.1N,-45.X],[-73.cp,-45.k],[-73.Q,-46.l],[-73.7H,-45.95],[-73.1N,-45.X],d,[-74.4s,-45.6N],[-74.58,-45.76],[-74.2d,-45.7v],[-74.4s,-45.6N],d,[-73.1Y,-45.1M],[-73.9o,-45.at],[-73.I,-45.ca],[-74.bv,-45.2B],[-74.ce,-45.6],[-73.1Y,-45.1M],d,[-74.3K,-45.4F],[-74.5T,-45.2W],[-74.7J,-45.1V],[-74.2P,-45.7x],[-74.5C,-45.1K],[-74.3K,-45.4F],d,[-73.Q,-45.8k],[-73.1Z,-45.1h],[-73.5q,-45.bL],[-73.1c,-45.2U],[-73.Q,-45.8k],d,[-74.6R,-45.2F],[-73.8K,-45.8S],[-73.9U,-45.a7],[-73.4D,-45.ch],[-73.cz,-45.5v],[-73.1b,-45.9f],[-74.3i,-45.1v],[-74.6R,-45.2F],d,[-74.4x,-45.2H],[-74.5z,-45.2I],[-74.22,-45.8s],[-74.8g,-45.3g],[-74.4x,-45.2H],d,[-73.o,-44.1A],[-73.K,-45.7p],[-73.7t,-45.bJ],[-73.z,-45.4t],[-73.8O,-45.cB],[-73.8X,-45.6x],[-74.6B,-45.8i],[-74.3W,-45.6c],[-74.4G,-45.3c],[-73.o,-44.1A],d,[-74.2l,-44.3S],[-73.cy,-44.4J],[-73.j,-44.5b],[-74.4X,-45.l],[-74.1o,-45.bB],[-74.2l,-44.3S],d,[-73.q,-44.4D],[-73.2B,-44.16],[-73.I,-44.2y],[-73.q,-44.4D],d,[-75.2z,-44.1g],[-75.7R,-44.85],[-75.ab,-44.c3],[-75.3I,-44.o],[-75.2z,-44.1g],d,[-74.p,-44.8m],[-73.1J,-44.cv],[-73.93,-44.7],[-74.2O,-44.6O],[-74.4H,-44.2h],[-74.6m,-44.3z],[-74.p,-44.8m],d,[-73.2j,-44.3G],[-73.d6,-44.2u],[-73.es,-44.n],[-73.1z,-44.e3],[-73.88,-44.e2],[-73.2j,-44.3G],d,[-74.4C,-44.D],[-74.e7,-44.e0],[-74.6s,-44.6d],[-74.3X,-44.4W],[-74.1q,-44.8Y],[-74.4C,-44.D],d,[-74.4B,-44.5c],[-73.1U,-44.33],[-74.5M,-44.2A],[-74.4g,-44.5z],[-74.4B,-44.5c],d,[-73.3P,-43.77],[-73.7F,-43.6q],[-74.8p,-43.88],[-74.dW,-43.4N],[-73.3P,-43.77],d,[-74.8P,-48.Q],[-74.8s,-48.3R],[-74.1P,-48.5e],[-74.bK,-48.4v],[-73.8X,-48.2o],[-74.6j,-48.1v],[-74.3p,-48.6A],[-74.6K,-48.10],[-74.8l,-47.8B],[-74.2t,-47.dY],[-74.e9,-48],[-74.eo,-47.97],[-73.S,-48.w],[-73.ed,-48.2p],[-73.2s,-48.6M],[-73.9k,-47.W],[-73.ei,-47.1r],[-73.j,-47.eh],[-74.s,-47.77],[-74.6C,-47.4a],[-74.1V,-47.9Z],[-74.dR,-47.1l],[-74.9B,-47.4Y],[-74.1R,-46.dQ],[-74.8M,-46.dk],[-74.dx,-46.L],[-74.7j,-46.1T],[-74.3l,-46.dO],[-74.7d,-46.dH],[-75.1t,-46.1S],[-75.dz,-46.2U],[-75.2C,-46.7l],[-75.44,-46.e1],[-75.4U,-46.5F],[-75.9L,-46.dE],[-75.2H,-46.U],[-75.C,-46.9I],[-74.92,-46.9S],[-74.1T,-46.4Y],[-75.7X,-46.1t],[-75.6B,-45.9t],[-74.96,-45.dF],[-74.4O,-45.bZ],[-74.6I,-45.dG],[-74.9n,-45.4N],[-73.ad,-46.8c],[-73.dD,-46.7V],[-73.F,-46.7A],[-73.2N,-45.97],[-73.1q,-45.bG],[-73.4t,-45.1v],[-73.dC,-45.8p],[-73.1L,-45.7g],[-73.6l,-44.2q],[-73.dA,-44.1j],[-73.8S,-44.8l],[-73.dB,-44.8J],[-73.3i,-44.34],[-73.2C,-44.2Q],[-73.3e,-44.3k],[-73.ah,-43.5k],[-72.7K,-43.8L],[-72.5O,-43.1V],[-72.5r,-43.2J],[-72.2o,-43.k],[-72.4h,-43.S],[-72.7f,-43.9X],[-71.1A,-43.9Y],[-71.2h,-44.10],[-71.5U,-44.2V],[-71.cd,-44.2L],[-71.3W,-44.8k],[-71.11,-44.3X],[-71.21,-44.1K],[-71.8M,-44.dI],[-71.7S,-44.8L],[-71.1q,-44.dP],[-71.8O,-44.3w],[-72.7e,-44.a6],[-72.C,-44.E],[-71.8Q,-44.7h],[-71.56,-44.98],[-71.9w,-45.3],[-71.6f,-45.8g],[-71.5e,-45.7i],[-71.2i,-45.8Z],[-71.4D,-45.1i],[-71.6w,-45.dJ],[-71.9J,-46.4Z],[-71.dK,-46.6P],[-71.X,-46.6j],[-71.6i,-46.7D],[-71.3u,-46.5f],[-71.3B,-46.o],[-71.E,-47.24],[-72.5Z,-47.5l],[-72.dL,-47.9N],[-72.3r,-47.dy],[-72.2g,-47.59],[-72.3X,-47.1U],[-72.4S,-48.7P],[-72.6r,-48.1l],[-72.6H,-48.dl],[-72.55,-48.9l],[-72.2B,-48.1U],[-72.dm,-48.4L],[-73.17,-49.2f],[-73.1o,-49.2G],[-73.n,-48.t],[-74.1D,-48.5E],[-74.8P,-48.Q]],4b:[[-68.4i,-25.2K],[-68.2X,-25.9g],[-68.2m,-25.D],[-69.6J,-25.2N],[-69.9h,-25.2d],[-69.3R,-25.Z],[-69.3A,-25.75],[-70.1D,-25.72],[-70.7B,-25.k],[-70.9m,-25.8],[-70.3s,-25.6T],[-70.Z,-25.1s],[-70.a4,-25.4a],[-70.5B,-25.df],[-70.63,-25.7D],[-70.53,-25.9e],[-70.2k,-25.7y],[-70.bq,-25.9M],[-70.4n,-25.6M],[-70.47,-24.1A],[-70.dg,-24.2i],[-70.6e,-24.3m],[-70.6f,-23.8],[-70.5x,-23.6i],[-70.4,-23.8u],[-70.dh,-23.5e],[-70.3z,-23.4n],[-70.dn,-23.9P],[-70.9i,-23.do],[-70.4t,-22.8y],[-70.du,-22.6O],[-70.8q,-22.4w],[-70.6A,-22.a0],[-70.dv,-21.bO],[-70.3e,-21.dw],[-70.C,-21.ax],[-69.8r,-21.1a],[-69.8b,-21.2L],[-69.35,-21.2c],[-69.7N,-21.3r],[-68.1g,-21.N],[-68.J,-21.3c],[-68.1f,-20.t],[-68.4,-20.4R],[-68.6G,-21.au],[-68.8f,-21.1p],[-68.dt,-21.76],[-68.C,-21.1w],[-67.9z,-22.4Z],[-67.ds,-22.32],[-67.3P,-22.4y],[-67.dp,-22.83],[-67.1E,-22.8z],[-67.av,-22.6O],[-66.1s,-22.af],[-67.4C,-23.96],[-67.6v,-24.l],[-68.6I,-24.dr],[-68.4i,-24.S],[-68.6N,-24.7W],[-68.eg,-24.7k],[-68.1l,-25.6M],[-68.3R,-25.2D],[-68.4i,-25.2K]],3Y:[[-71.s,-38.7o],[-71.ef,-38.25],[-71.60,-38.41],[-70.5t,-38.ee],[-70.eb,-38.z],[-71.7s,-38.74],[-71.aW,-38.a8],[-71.D,-39.9d],[-71.2s,-39.6Y],[-71.H,-39.1E],[-71.3E,-39.2W],[-71.4L,-39.4O],[-72.5c,-39.am],[-72.D,-39.K],[-72.1f,-39.3N],[-72.2e,-39.1u],[-72.1Y,-39.4P],[-72.6t,-39.7m],[-73.1B,-39.4c],[-73.2w,-39.6p],[-73.32,-38.8K],[-73.2t,-38.7T],[-73.4s,-38.1O],[-73.5Q,-38.8x],[-73.2K,-38.2a],[-73.2v,-38.8w],[-73.8F,-38.A],[-73.p,-38.4Q],[-73.4h,-38.8C],[-73.C,-37.78],[-73.7A,-37.8D],[-72.8v,-37.8G],[-72.1j,-37.1j],[-72.4j,-37.5N],[-72.3U,-37.2j],[-72.10,-37.3O],[-71.2n,-38.2Y],[-71.68,-38.7s],[-71.M,-38.1X],[-71.3,-38.7p],[-71.1n,-38.V],[-71.s,-38.7o]],3V:[[-69.I,-29.H],[-70.8h,-29.7c],[-70.as,-29.56],[-70.53,-29.1L],[-70.90,-29.1n],[-70.8A,-29.4E],[-70.5V,-29.p],[-71.8H,-29.28],[-71.2I,-29.8E],[-71.2t,-29.8f],[-71.1C,-29.ec],[-71.4v,-28.7l],[-71.3L,-28.3w],[-71.3f,-28.5B],[-71.bI,-28.9i],[-71.ej,-28.4g],[-71.aD,-27.ek],[-70.9,-27.9k],[-70.er,-27.aT],[-70.9l,-26.bX],[-70.o,-26.q],[-70.4O,-26.1E],[-70.7,-26.4x],[-70.Z,-25.1s],[-70.3s,-25.6T],[-70.9m,-25.8],[-70.7B,-25.k],[-70.1D,-25.72],[-69.3A,-25.75],[-69.3R,-25.Z],[-69.9h,-25.2d],[-69.6J,-25.2N],[-68.2m,-25.D],[-68.2X,-25.9g],[-68.4i,-25.2K],[-68.P,-25.em],[-68.3G,-25.en],[-68.2u,-25.6h],[-68.9a,-25.2j],[-68.4x,-26.dX],[-68.57,-26.1H],[-68.8b,-26.4n],[-68.9c,-26.t],[-68.a1,-27.6a],[-68.J,-27.4d],[-68.5o,-27.1t],[-68.al,-27.9d],[-69,-27.dV],[-69.5A,-27.j],[-69.A,-28.4d],[-69.dS,-28.8c],[-69.9E,-28.3I],[-69.Y,-28.2A],[-69.4U,-28.3L],[-69.65,-28.8I],[-69.2i,-28.br],[-69.8r,-28.5F],[-69.aK,-29.1x],[-69.7l,-29.2v],[-70.s,-29.dT],[-69.I,-29.H]],4m:[[-71.s,-36.1h],[-71.7R,-36.65],[-71.2v,-36.80],[-71.1D,-36.4L],[-71.dU,-37.a2],[-71.7f,-37.4C],[-71.2p,-37.9e],[-71.2F,-37.68],[-71.s,-38.7o],[-71.1n,-38.V],[-71.3,-38.7p],[-71.M,-38.1X],[-71.68,-38.7s],[-71.2n,-38.2Y],[-72.10,-37.3O],[-72.3U,-37.2j],[-72.4j,-37.5N],[-72.1j,-37.1j],[-72.8v,-37.8G],[-73.7A,-37.8D],[-73.C,-37.78],[-73.4h,-38.8C],[-73.p,-38.4Q],[-73.8F,-38.A],[-73.2v,-38.8w],[-73.2K,-38.2a],[-73.5Q,-38.8x],[-73.4s,-38.1O],[-73.1C,-38.3x],[-73.cr,-38.cs],[-73.6S,-37.9b],[-73.3H,-37.cD],[-73.6Q,-37.3J],[-73.8I,-37.9r],[-73.8J,-37.8q],[-73.19,-37.8i],[-73.6c,-36.8t],[-72.7a,-36.cF],[-72.aO,-36.a9],[-72.7K,-36.4l],[-72.b0,-35.1I],[-72.5h,-36.3q],[-72.1o,-36.13],[-72.3h,-36.5G],[-71.5x,-36.v],[-71.b3,-36.2Z],[-71.l,-36.3a],[-71.s,-36.1h]],4p:[[-69.I,-29.H],[-69.87,-29.5H],[-69.94,-30.G],[-69.cf,-30.2Q],[-69.4R,-30.1a],[-70.4Z,-30.7m],[-70.22,-30.1S],[-70.U,-31.1],[-70.cj,-31.aG],[-70.1Z,-31.56],[-70.cn,-31.K],[-70.2k,-31.5P],[-70.cl,-31.8z],[-70.5g,-31.99],[-70.4X,-32.8W],[-70.7r,-32.2O],[-70.77,-32.bd],[-70.4V,-31.3O],[-71.4T,-31.1y],[-71.A,-32.1B],[-71.1F,-32.bb],[-71.ci,-31.3n],[-71.8u,-31.5a],[-71.7L,-31.Y],[-71.2U,-31.1P],[-71.65,-30.R],[-71.n,-30.72],[-71.c9,-30.6D],[-71.2x,-30.4t],[-71.6b,-30.2H],[-71.D,-29.2m],[-71.6u,-29.6q],[-71.4r,-29.5L],[-71.d1,-29.77],[-71.6r,-29.F],[-71.33,-29.1d],[-71.2t,-29.8f],[-71.2I,-29.8E],[-71.8H,-29.28],[-70.5V,-29.p],[-70.8A,-29.4E],[-70.90,-29.1n],[-70.53,-29.1L],[-70.as,-29.56],[-70.8h,-29.7c],[-69.I,-29.H]],3T:[[-70.3o,-34.36],[-70.5R,-34.5J],[-70.a7,-34.1c],[-70.U,-35],[-70.3j,-34.91],[-70.1u,-34.97],[-70.L,-34.aZ],[-70.q,-34.7U],[-70.R,-34.3l],[-71.7V,-34.1G],[-71.2o,-34.7W],[-71.1C,-34.8a],[-71.7t,-34.2q],[-71.z,-34.1b],[-71.aY,-34.5o],[-72.3k,-34.7],[-71.7Z,-34.1d],[-72.5Z,-34.13],[-71.k,-33.3y],[-71.k,-33.j],[-71.7,-33.1w],[-71.F,-34.V],[-71.Y,-34.3d],[-71.43,-34.7O],[-71.32,-34.7P],[-71.3f,-34.3e],[-71.7Q,-34.3b],[-70.7M,-33.1y],[-70.7H,-33.aB],[-70.aA,-33.2X],[-70.2S,-34.2Y],[-70.v,-34.1B],[-70.22,-34.7I],[-70.G,-34.3g],[-70.3o,-34.36]],4M:[[-74.1z,-43.4v],[-74.P,-43.Z],[-74.a6,-43.2d],[-74.d7,-43.9C],[-74.1z,-43.4v],d,[-73.1a,-42.aa],[-73.9j,-42.6L],[-73.1u,-42.5n],[-73.7x,-42.9D],[-73.3s,-42.cN],[-73.T,-42.I],[-73.cK,-42.j],[-73.M,-43.5d],[-73.8R,-43.3b],[-73.a8,-43.a5],[-74.3F,-43.9R],[-74.5j,-43.2C],[-74.4S,-43.2E],[-74.7z,-43.1e],[-74.cJ,-42.7j],[-74.cP,-42.2k],[-74.cS,-42.2C],[-74.4E,-42.8p],[-74.1e,-42.3d],[-74.V,-41.cc],[-73.1Q,-41.aw],[-73.c6,-41.8],[-73.4j,-41.3v],[-73.a9,-41.5b],[-73.c7,-42.ar],[-73.aV,-42.ab],[-73.1a,-42.aa],d,[-71.H,-39.1E],[-71.n,-39.5i],[-71.7b,-39.3P],[-71.5q,-39.t],[-71.cQ,-40.cH],[-71.83,-40.3x],[-71.6h,-40.a5],[-71.2n,-40.4K],[-71.5L,-40.6y],[-71.7d,-40.73],[-71.k,-41.1n],[-71.E,-41.aq],[-71.3D,-41.7L],[-71.j,-41.J],[-71.1g,-41.6n],[-71.a4,-42.4Y],[-71.5H,-42.2Q],[-72.64,-42.2z],[-72.1R,-42.7r],[-72.3d,-42.Y],[-72.3C,-42.da],[-72.1D,-42.d5],[-72.3i,-43.3q],[-72.1e,-43.aj],[-71.74,-43.2M],[-71.73,-43.5R],[-71.cG,-43.v],[-71.3B,-43.d2],[-71.9Z,-43.63],[-71.b4,-43.3w],[-71.2e,-43.7d],[-71.2h,-44.10],[-71.1A,-43.9Y],[-72.7f,-43.9X],[-72.4h,-43.S],[-72.2o,-43.k],[-72.5r,-43.2J],[-72.5O,-43.1V],[-72.1I,-43.5f],[-73.a0,-43.7q],[-73.4E,-43.32],[-72.3n,-43.2O],[-72.ff,-43.9W],[-72.5E,-42.2y],[-72.5P,-42.1N],[-72.4N,-42.5h],[-72.bo,-42.5Y],[-72.79,-42.a1],[-72.77,-42.5u],[-72.a3,-42.ak],[-72.5I,-42.6R],[-72.o,-41.1w],[-72.1N,-41.6W],[-72.Z,-41.7E],[-72.ga,-41.g6],[-72.R,-41.1q],[-73.a2,-41.59],[-73.l,-41.fr],[-73.an,-41.3E],[-73.6E,-41.fD],[-73.fM,-41.9v],[-73.68,-41.6H],[-73.1r,-41.2T],[-73.83,-41.4S],[-73.91,-41.ac],[-73.ad,-40.fR],[-73.5a,-40.fJ],[-73.fH,-40.o],[-73.fF,-40.M],[-73.75,-40.7B],[-73.2R,-40.an],[-73.fO,-40.3q],[-73.7q,-39.1Q],[-73.2w,-39.6p],[-73.1B,-39.4c],[-72.6t,-39.7m],[-72.1Y,-39.4P],[-72.2e,-39.1u],[-72.1f,-39.3N],[-72.D,-39.K],[-72.5c,-39.am],[-71.4L,-39.4O],[-71.3E,-39.2W],[-71.H,-39.1E]],4q:[[-68.7v,-55.4I],[-68.5X,-55.6o],[-68.3p,-55.A],[-68.7S,-55.7i],[-68.2u,-55.2Z],[-68.78,-55.4W],[-68.9F,-55.2k],[-68.9o,-55.1d],[-69.5T,-55.2w],[-69.aI,-55.4S],[-69.ar,-55.3U],[-69.aq,-55.fw],[-69.8N,-55.38],[-69.al,-55.2g],[-70.ae,-55.2l],[-69.6z,-55.2E],[-69.ak,-54.af],[-69.4B,-55.9u],[-68.52,-54.3t],[-68.2g,-55.ae],[-68.7v,-55.4I],d,[-70.7y,-54.8j],[-70.bN,-54.fA],[-70.7D,-55.ah],[-70.6b,-55.2p],[-70.6e,-55.2v],[-70.82,-55.g4],[-71.g8,-55.3k],[-71.64,-54.ai],[-70.3S,-54.g9],[-70.1j,-54.1A],[-70.7y,-54.8j],d,[-67.R,-54.3y],[-67.N,-54.g5],[-67.w,-55.4Q],[-67.7z,-55.6L],[-67.3m,-55.1v],[-67.c1,-55.5g],[-68.9W,-55.2F],[-68.2Q,-54.t],[-67.R,-54.3y],d,[-69.Q,-54.E],[-69.A,-54.7F],[-69.9s,-55.l],[-69.82,-55.1W],[-69.9z,-54.3t],[-69.Q,-54.E],d,[-71.3H,-53.3B],[-71.1X,-54],[-71.3g,-54.3C],[-71.1n,-54.fZ],[-70.g2,-54.9B],[-70.9x,-54.9w],[-71.ft,-54.4],[-71.1d,-54.6s],[-71.T,-54.4H],[-71.6g,-54.6P],[-71.1p,-54.5W],[-71.3H,-53.3B],d,[-71.1U,-53.9q],[-71.1S,-54.10],[-71.93,-54.24],[-72.eJ,-54.4d],[-72.3f,-53.6z],[-72.1,-53.eK],[-71.1U,-53.9q],d,[-70.3M,-53.2T],[-70.5K,-53.E],[-70.c8,-54.9V],[-70.fq,-54.6k],[-70.N,-54.6X],[-70.9O,-54.9p],[-70.9s,-54.9T],[-70.9G,-54.12],[-70.16,-53.9t],[-70.eR,-53.2h],[-70.3M,-53.2T],d,[-73.8e,-53.5y],[-72.2i,-53.Y],[-72.9v,-53.ag],[-72.2x,-53.86],[-72.1P,-53.1c],[-72.eI,-53.9F],[-72.2A,-54.ey],[-72.7u,-54.6k],[-72.3w,-54.11],[-72.16,-53.8j],[-73.9P,-53.1r],[-73.5A,-53.6y],[-73.9S,-53.5D],[-73.43,-53.1h],[-73.13,-53.4w],[-73.8i,-53.c4],[-73.8e,-53.5y],d,[-74.w,-52.3Z],[-73.8g,-53.2M],[-73.9N,-53.aS],[-73.2c,-53.1l],[-73.3H,-53.8q],[-73.3v,-53.9I],[-74.s,-53.8c],[-74.bp,-53.2p],[-74.eB,-52.1s],[-74.7L,-52.96],[-74.K,-52.2h],[-74.7T,-52.2B],[-74.1a,-52.eG],[-74.w,-52.3Z],d,[-72.1b,-53.9K],[-72.1b,-52.9G],[-72.2J,-52.eC],[-72.7w,-52.9J],[-72.1C,-52.80],[-72.19,-52.68],[-71.5b,-52.bY],[-71.eD,-52.eW],[-71.9Q,-52.3u],[-71.6C,-52.5t],[-71.16,-53.bR],[-72.7R,-53.fh],[-72.5Y,-53.7S],[-72.6d,-53.52],[-73.2D,-53.22],[-72.2J,-53.3F],[-72.1b,-53.9K],d,[-70.X,-54.4o],[-71.3i,-54.7T],[-71.9M,-54.fo],[-71.fn,-54.9L],[-71.5r,-54.2R],[-71.7Z,-54.F],[-71.2m,-54.1O],[-71.n,-54.2s],[-71.6l,-54.4k],[-70.95,-54.2s],[-70.4R,-54.5n],[-70.P,-54.1d],[-70.2g,-54.2a],[-70.3p,-54.2W],[-70.52,-54.1H],[-70.5t,-54.27],[-70.4J,-54.5g],[-70.9H,-54.2l],[-70.1p,-54.6F],[-70.3I,-54.6l],[-70.fb,-54.9O],[-69.J,-54.ap],[-69.3G,-54.9T],[-70.f0,-54.5s],[-70.6G,-53.3E],[-69.16,-53.6Z],[-69.67,-53.6y],[-69.eZ,-53.3M],[-69.2b,-53.9R],[-69.1J,-53.3L],[-70.N,-53.9Q],[-70.9E,-53.4k],[-70.42,-53.7X],[-70.aU,-53.9u],[-70.6k,-52.3y],[-70.5T,-52.5S],[-70.5Q,-52.1z],[-70.9r,-52.73],[-70,-52.84],[-69.f6,-52.S],[-69.F,-52.4y],[-69.43,-52.1O],[-69.23,-52.65],[-69.2E,-52.f7],[-68.5U,-52.9C],[-68.9D,-52.2R],[-68.5N,-53.1t],[-68.61,-54.f5],[-68.3N,-54.eY],[-69.9A,-54.9y],[-69.5w,-54.5P],[-70.3W,-54.1T],[-70.6f,-54.2n],[-70.fk,-54.k],[-70.X,-54.4o],d,[-74.4r,-52.2E],[-73.9,-52.34],[-74.4T,-52.fm],[-74.4r,-52.2E],d,[-73.2q,-52.1i],[-74.9V,-52.6h],[-74.60,-52.fi],[-73.5p,-52.6Y],[-73.fd,-52.2A],[-74.6c,-52.aj],[-74.7O,-52.G],[-73.S,-52.28],[-73.n,-52.3u],[-73.2q,-52.1i],d,[-74.L,-52.6a],[-74.3D,-52.60],[-74.K,-51.79],[-74.ag,-51.5k],[-74.4z,-51.99],[-74.L,-52.6a],d,[-74.ao,-51.6g],[-74.eE,-51.74],[-73.eF,-52.64],[-73.4o,-52.N],[-74.ap,-51.9],[-74.ao,-51.6g],d,[-75.5M,-52.5W],[-75.5d,-52.eu],[-74.5b,-51.5L],[-74.1z,-51.79],[-74.q,-52.4Z],[-75.5M,-52.5W],d,[-74.w,-51.M],[-73.2y,-51.5U],[-73.1Y,-51.82],[-74.6j,-51.1i],[-74.w,-51.M],d,[-75.1R,-51.6F],[-74.7M,-51.eT],[-75.2z,-51.6C],[-75.6A,-51.1u],[-75.6v,-51.eV],[-75.cb,-51.6E],[-75.1R,-51.6F],d,[-74.71,-51.6o],[-74.eL,-51.6I],[-74.eM,-51.eN],[-74.8y,-51.1o],[-74.98,-51.2A],[-74.71,-51.6o],d,[-74.5i,-51.5s],[-74.j,-51.g1],[-74.W,-50.8B],[-74.c5,-50.6t],[-74.fW,-50.3t],[-74.5q,-50.1i],[-74.2b,-50.1Q],[-74.U,-51.4I],[-74.5,-51.2G],[-74.5i,-51.5s],d,[-74.q,-50.71],[-74.n,-50.4o],[-74.5D,-50.81],[-74.2y,-50.aN],[-74.q,-50.71],d,[-75.5j,-50.T],[-75.9n,-50.3j],[-75.bU,-50.fy],[-75.6X,-50.L],[-75.4k,-50.1c],[-75.4n,-50.6Q],[-75.5j,-50.T],d,[-74.5w,-50.35],[-74.bM,-50.bT],[-74.4c,-50.1C],[-74.2l,-50.fE],[-74.v,-50.84],[-74.9f,-50.1z],[-74.2x,-50.2i],[-74.6,-50.9b],[-74.9j,-50.8Z],[-74.8N,-50.4w],[-74.8R,-50.2x],[-74.1r,-50.5v],[-74.5w,-50.35],d,[-75.5l,-50],[-74.77,-50.1P],[-74.fB,-50.2L],[-75.15,-50.bn],[-75.5C,-50.42],[-75.41,-50.bz],[-75.5l,-50],d,[-75.1F,-49.P],[-75.3a,-49.bF],[-75.1x,-49.5p],[-75.6u,-49.88],[-75.1M,-49.1G],[-75.1F,-49.P],d,[-72.W,-52.aR],[-72.W,-52.8W],[-72.4U,-51.83],[-72.9U,-51.75],[-72.bW,-51.5k],[-73.2p,-51.4R],[-73.4Q,-52.ce],[-73.2L,-52.3h],[-73.86,-52.fU],[-73.4U,-51.5m],[-73.4N,-51.7E],[-73.5H,-51.J],[-73.6n,-51.55],[-73.g7,-51.c7],[-73.ca,-51.5y],[-73.c5,-51.N],[-73.j,-51.fC],[-74.5A,-51.5z],[-74.5u,-50.fG],[-74.w,-50.5p],[-74.26,-50.1f],[-74.3x,-50.45],[-74.5e,-50.4c],[-74.6V,-50.2D],[-74.fK,-50.4d],[-74.3J,-49.2m],[-74.2g,-49.5D],[-74.fL,-49.5I],[-74.5X,-49.3r],[-74.4K,-48.3Z],[-74.v,-48.1G],[-74.1D,-48.5E],[-73.n,-48.t],[-73.1o,-49.2G],[-73.17,-49.2f],[-73.3F,-49.31],[-73.2S,-49.31],[-73.1E,-49.M],[-73.3X,-49.fP],[-73.fN,-49.5F],[-73.bQ,-49.7h],[-73.45,-50.bR],[-73.53,-50.15],[-73.3a,-50.1X],[-73.bN,-50.fs],[-73.bI,-50.3l],[-73.bK,-50.S],[-72.bL,-50.3z],[-72.at,-50.fz],[-72.bM,-50.F],[-72.4r,-50.6Z],[-72.7Y,-50.z],[-72.bU,-50.fX],[-72.25,-51.3o],[-72.fY,-51.3C],[-72.26,-51.4G],[-72.6s,-51.6u],[-72.6v,-51.6w],[-72.6r,-51.5m],[-71.6q,-51.6n],[-71.bW,-51.bX],[-70.4B,-51.3A],[-69.2I,-52.fp],[-69.6p,-52.6x],[-69.4y,-52.5K],[-69.6V,-52.4y],[-69.7U,-52.4w],[-70.6G,-52.6H],[-70.3W,-52.bY],[-70.3U,-52.66],[-70.eP,-52.eU],[-70.3S,-52.6z],[-70.bZ,-53.eH],[-70.1s,-53.c4],[-70.c3,-53.P],[-70.5V,-53.78],[-71.5R,-53.t],[-71.c1,-53.bS],[-72.1t,-53.7w],[-72.bT,-53.2Z],[-72.4F,-53.v],[-72.A,-53.25],[-71.1K,-53.bJ],[-71.4H,-53.ev],[-71.4Y,-52.4J],[-71.7I,-52.5O],[-71.5X,-52.81],[-71.aP,-52.7C],[-71.6K,-52.2u],[-72.1x,-52.5Y],[-72.eA,-52.4P],[-72.4F,-52.6i],[-72.c6,-52.2d],[-72.bO,-52.2n],[-73.5Z,-52.bS],[-72.1s,-53.3c],[-73.cb,-53.1t],[-73.6b,-53.7e],[-73.cd,-52.1w],[-73.1i,-52.q],[-73.1F,-52.1c],[-73.1v,-52.cc],[-73.c8,-52.c9],[-73.6d,-52.2B],[-73.2U,-52.62],[-73.2T,-52.fj],[-73.J,-52.bG],[-73.6e,-52.aS],[-73.P,-52.1P],[-73.2P,-52.aT],[-73.aU,-52.3h],[-72.W,-52.aR],d,[-74.E,-50],[-74.aN,-49.1Z],[-74.aO,-49.54],[-74.94,-49.3v],[-74.3A,-49.92],[-75.1R,-49.f8],[-75.aP,-49.aV],[-75.7n,-49.f9],[-75.1X,-49.3x],[-74.fa,-49.23],[-74.1Q,-49.6D],[-74.1c,-49.6B],[-74.3t,-48.98],[-74.1y,-48.X],[-74.68,-48.2e],[-74.45,-49.6J],[-74.3K,-49.31],[-74.48,-49.2x],[-74.3K,-49.6S],[-74.2V,-49.f4],[-74.2N,-50.V],[-74.E,-50]],3Q:[[-70.U,-35],[-70.3J,-35.3F],[-70.7u,-35.f1],[-70.f3,-35.f2],[-70.fc,-35.7Y],[-70.6m,-35.2N],[-70.v,-35.o],[-70.aW,-35.91],[-70.2b,-36.l],[-70.3s,-36.2M],[-70.6K,-36.7Q],[-70.5m,-36.fl],[-70.5f,-36.bt],[-70.1J,-36.b2],[-71.s,-36.1h],[-71.l,-36.3a],[-71.b3,-36.2Z],[-71.5x,-36.v],[-72.3h,-36.5G],[-72.1o,-36.13],[-72.5h,-36.3q],[-72.b0,-35.1I],[-72.2u,-35.5J],[-72.5B,-35.1K],[-72.2t,-35.T],[-72.3j,-35.39],[-72.2P,-35.3b],[-72.2G,-35.p],[-72.7N,-34.6W],[-72.3k,-34.7],[-71.aY,-34.5o],[-71.z,-34.1b],[-71.7t,-34.2q],[-71.1C,-34.8a],[-71.2o,-34.7W],[-71.7V,-34.1G],[-70.R,-34.3l],[-70.q,-34.7U],[-70.L,-34.aZ],[-70.1u,-34.97],[-70.3j,-34.91],[-70.U,-35]],4u:[[-70.G,-33.l],[-70.7X,-33.7Y],[-69.8a,-33.2f],[-69.fe,-33.3m],[-69.3n,-33.86],[-69.j,-33.8],[-69.80,-33.7Z],[-69.fg,-34.eX],[-69.7K,-34.2f],[-70.3o,-34.36],[-70.G,-34.3g],[-70.22,-34.7I],[-70.v,-34.1B],[-70.2S,-34.2Y],[-70.aA,-33.2X],[-70.7H,-33.aB],[-70.7M,-33.1y],[-71.7Q,-34.3b],[-71.3f,-34.3e],[-71.32,-34.7P],[-71.43,-34.7O],[-71.Y,-34.3d],[-71.F,-34.V],[-71.7,-33.1w],[-71.1Z,-33.1T],[-71.1M,-33.7C],[-71.2b,-33.1q],[-71.7n,-33.1L],[-71.1H,-33.18],[-71.b6,-33.1x],[-71.b9,-32.1I],[-70.z,-32.1J],[-70.1p,-32.7k],[-70.4W,-33.ba],[-70.4K,-33.1e],[-70.4X,-33.14],[-70.G,-33.l]],4e:[[-68.1f,-20.t],[-68.J,-21.3c],[-68.1g,-21.N],[-69.7N,-21.3r],[-69.35,-21.2c],[-69.8b,-21.2L],[-69.8r,-21.1a],[-70.C,-21.ax],[-70.7g,-21.au],[-70.av,-21.1e],[-70.6U,-20.aw],[-70.2G,-20.ew],[-70.6U,-20.6L],[-70.8h,-20.aD],[-70.1x,-19.n],[-70.3I,-19.8m],[-70.2C,-19.2D],[-70.3J,-18.ex],[-70.1H,-18.44],[-70.3L,-18.1l],[-69.bu,-18.ez],[-69.3D,-18.3C],[-69.75,-17.7F],[-69.aK,-17.1Q],[-69.3v,-17.3u],[-69.6Z,-17.eS],[-69.1h,-17.1K],[-69.1d,-17.7c],[-69.aI,-17.7h],[-69.7g,-18.1W],[-69.eQ,-18.aG],[-69.7e,-18.6X],[-68.R,-18.b4],[-68.16,-18.eO],[-68.W,-18.bu],[-68.6W,-19.bv],[-68.67,-19.g0],[-68.3z,-19.27],[-68.41,-19.bt],[-68.6Q,-19.z],[-68.2a,-19.84],[-68.56,-20.w],[-68.6V,-20.6U],[-68.fT,-20.bp],[-68.1G,-20.2P],[-68.6S,-20.7i],[-68.bq,-20.7j],[-68.fV,-20.br],[-68.1f,-20.t]],4f:[[-71.k,-33.j],[-71.2J,-33.7x],[-71.7w,-33.bE],[-71.bF,-33.gb],[-71.7E,-33.2S],[-71.2e,-33.1l],[-71.fS,-33.2w],[-71.2R,-33.bz],[-71.55,-33.bB],[-71.7u,-32.81],[-71.fx,-32.bo],[-71.bn,-32.1F],[-71.41,-32.fu],[-71.4P,-32.fv],[-71.1F,-32.bb],[-71.A,-32.1B],[-71.4T,-31.1y],[-70.4V,-31.3O],[-70.77,-32.bd],[-70.7r,-32.2O],[-70.2I,-32.4H],[-70.4G,-32.7q],[-70.2z,-32.6Y],[-70.4I,-32.K],[-70,-32.4J],[-70.G,-33.l],[-70.4X,-33.14],[-70.4K,-33.1e],[-70.4W,-33.ba],[-70.1p,-32.7k],[-70.z,-32.1J],[-71.b9,-32.1I],[-71.b6,-33.1x],[-71.1H,-33.18],[-71.7n,-33.1L],[-71.2b,-33.1q],[-71.1M,-33.7C],[-71.1Z,-33.1T],[-71.7,-33.1w],[-71.k,-33.j]]};u.m.2r.r={et:{},bf:u.m.bf,4M:{h:a.4M,f:{e:"fI fQ"},g:{x:"-72.bk",y:"-40.bg"},i:{e:"4M",x:"-72.bk",y:"-40.bg"}},4b:{h:a.4b,f:{e:"g3"},g:{x:"-69.bi",y:"-23.b1"},i:{e:"4b",x:"-69.bi",y:"-23.b1"}},4e:{h:a.4e,f:{e:"cw\\bA"},g:{x:"-69.bh",y:"-19.bj"},i:{e:"4e",x:"-69.bh",y:"-19.bj"}},3Y:{h:a.3Y,f:{e:"co\\ck"},g:{x:"-72.bm",y:"-38.bl"},i:{e:"3Y",x:"-72.bm",y:"-38.bl"}},3Q:{h:a.3Q,f:{e:"cW"},g:{x:"-71.be",y:"-35.b8"},i:{e:"3Q",x:"-71.be",y:"-35.b8"}},3V:{h:a.3V,f:{e:"cR"},g:{x:"-69.b7",y:"-27.bc"},i:{e:"3V",x:"-69.b7",y:"-27.bc"}},4A:{h:a.4A,f:{e:"cL\\cM bC ay d8 db\\bA\\cZ bC cY"},g:{x:"-73.bD",y:"-46.by"},i:{e:"4A",x:"-73.bD",y:"-46.by"}},4m:{h:a.4m,f:{e:"B\\bx-B\\bx"},g:{x:"-72.bs",y:"-37.bw"},i:{e:"4m",x:"-72.bs",y:"-37.bw"}},4q:{h:a.4q,f:{e:"cC y cE\\ct cu"},g:{x:"-73.b5",y:"-51.aF"},i:{e:"4q",x:"-73.b5",y:"-51.aF"}},4p:{h:a.4p,f:{e:"e4"},g:{x:"-70.aE",y:"-30.aH"},i:{e:"4p",x:"-70.aE",y:"-30.aH"}},4u:{h:a.4u,f:{e:"e5\\e6 e8 de dd"},g:{x:"-70.aJ",y:"-33.aC"},i:{e:"4u",x:"-70.aJ",y:"-33.aC"}},3T:{h:a.3T,f:{e:"dZ ay ea O\'el"},g:{x:"-71.az",y:"-34.aL"},i:{e:"3T",x:"-71.az",y:"-34.aL"}},4f:{h:a.4f,f:{e:"ep\\eq"},g:{x:"-70.aM",y:"-32.aX"},i:{e:"4f",x:"-70.aM",y:"-32.aX"}}}})();u.m.r=bH(b,a,c){dq u.m.di({dj:dM,dN:a||{},7G:((1k(b.7G)=="1m")?0:b.7G),2r:c,aQ:b.aQ||"r",x:((1k(b.x)=="1m")?0:b.x),y:((1k(b.y)=="1m")?0:b.y),8d:((1k(b.8d)=="1m")?1:b.8d),8o:((1k(b.8o)=="1m")?1:b.8o),8n:((1k(b.8n)=="1m")?1:b.8n),c0:b.c0||[],bV:b.bV||[],c2:b.c2||[],bP:b.bP||d,cm:u.m.2r.r})};',62,1004,'|||||||||||||null|text|tooltip|cpoint|coords|label|892|828|037|maps|716|811|114|866|chl|007|897|zingchart|326|045|||745|289||064|388|879|603|09|673|884|625|722|754|532|217||585|671|978|748|463|355|059|954|764|501|631|089||||||909||||374|905|793|345|025|538|762|462|737|639|typeof|352|undefined|061|385|597|487|785|988|113|629|319|973|156|991|743|983|048|464|102|572|525|742|307|966|881|606|363|534|834|453|147|859|124|618|876|913|687|069|273|984|553|||||||||||529|373|554|681|655|224|306|776|733|734|447|143|994|805|407|118|865|data|467|489|563|167|202|516|916|141|337|725|269|204|093|203|208|159|222|802|267|395|171|633|233|364|187|657|427|564|668|406|492|817|058|425|||||||||||315|205|076|031|151|281|246|127|134|499|066|759|426|871|026|254|016|323|472|923|646|797|794|226|893|616|998|931|119|819|775|133|528|594|207|358|389|379|479|611|957|848|ML|587|862|LI|515|AT|211|523|AR|971|||||||||||778|AN|354|063|TA|VS|104|235|567|539|377|291|BI|509|689|CO|MA|279|522|288|RM|517|488|391|544|634|AI|019|298|772|055|445|234|339|149|895|412|943|LL|813|684|541|154|935|334|184|641|956|514|278|115|088|||||||||||845|961|136|065|466|682|212|508|647|401|853|263|699|367|801|839|589|679|101|832|243|413|688|404|375|194|112|636|485|642|714|803|095|919|535|769|455|841|012|609|809|837|328|311|867|261|786|974|092|344|521|008|002||||028||||||042|376|174|573|543|505|706|654|665|228|108|335|403|868|183|441|955|293|321|907|304|342|598|257|645|915|214|085|465|287|473|247|172|593|282|051|559|322|094|577|806|152|666|043|678|889|139|704|898|236|484|662|||||||||||996|685|717|946|07|213|067|941|496|635|926|904|386|456|107|05|432|313|054|677|548|703|683|774|368|223|057|286|721|507|707|944|graphid|922|176|193|815|571|989|181|098|074|126|022|303|656|854|232|818|014|327|975|833||||||566||||903|588|137|width|038|177|399|123|168|899|428|595|591|level|height|148|241|698|359|766|547|782|491|435|908|896|632|982|08|626|173|314|555|121|584|437|987|808|219|602|836|229|877|751|262|372|if|729|044|976|417|546|526||||||||||477|623|305|296|481|454|383|338|362|442|619|791|429|073|858|284|843|145|493|887|015|727|297|986|964|942|081|196|592|614|451|932|844|829|244|723|077|628|188|414|252|106|478|357|227|253|885|01|129|861|921|693|091|325|097|469|728|369|768|264|924|531|245|146|166|937|027|992|574|033|977|122|125|852|752|157|506|353|371|071|421|615|294|178|883|423|General|0669lon|565|995|5132lat|087|8686lon|1234lat|163|6078lat|299|6771lon|798|4303lat|8896lon|864|938|384|id|199|332|221|142|486|422|5188lat|953|857|773|4569lat|382|277|747|1842lon|179|9084lon|5734lat|079|04|075|3656lat|009|4213lon|_DEFAULTS_|6663lat|4590lon|1017lon|7144lat|7592lon|6963lat|2861lon|476|621|317|439|724|1219lon|398|936|032|0737lat|u00EDo|8892lat|029|u00E1|004|del|0992lon|731|605|459|function|164|201|001|738|474|251|847|bbox|537|003|849|468|231|items|911|999|652|816|groups|418|ignore|925|396|784|672|415|331|659|708|216|826|416|099|807|push|285|502|511|u00EDa|268|map|458|Araucan|676|ST|461|034|u00E1rtica|Chilena|638|Tarapac|ZC|952|787|var|242|Magallanes|444|Ant|736|888|078|084|117|617|Ais|u00E9n|814|842|192|788|Atacama|175|381|336|503|Maule|997|Campo|u00F1ez|643|341|448|715|011|779|607|831|Carlos|024|562|Ib|083|Santiago||644|579|513|convert|loader|822|471|917|583|047|872|return|419|945|056|316|144|651|324|434|343|452|248|275|726|648|901|838|755|739|965|891|153|this|loaderdata|761|735|993|446|283|356|096|497|116|191|928|Libertador|561|967|596|753|Coquimbo|Regi|u00F3n|138|Metropolitana|259|Bernardo|948|105|624|558|036|457|821|576|182|789|Higgins|443|581|049|Valpara|u00EDso|947|586|_GROUPS_|023|111|812|796|035|237|347|438|825|667|361|804|934|006|397|271|972|498|613|409|873|718|135|713|658|329|749|599|697|131|894|309|03|206|272|578|902|265|695|696|856|274|985|068|436|827|744|914|878|132|536|552|851|255|411|512|701|198|545|705|569|155|392|197|504|433|622|675|981|951|258|799|846|712|969|869|Los|912|557|215|719|424|686|702|Lagos|963|709|664|018|549|608|855|402|062|189|06|962|Antofagasta|072|949|494|959|017|939|824|527'.split('|'),0,{}))
kennynaoh/cdnjs
ajax/libs/zingchart/0.0.1/modules/zingchart-html5-maps-chl-min.js
JavaScript
mit
26,266
/* * This code was entirely written by Nathan Wagner * and is in the public domain. */ #include <math.h> #include <stdio.h> #include <stdlib.h> #include <float.h> #ifndef M_PI # define M_PI 3.14159265358979323846 #endif /* * Proj 4 provides its own entry points into * the code, so none of the library functions * need to be global */ #define ISEA_STATIC static #ifndef ISEA_STATIC #define ISEA_STATIC #endif struct hex { int iso; int x, y, z; }; /* y *must* be positive down as the xy /iso conversion assumes this */ ISEA_STATIC int hex_xy(struct hex *h) { if (!h->iso) return 1; if (h->x >= 0) { h->y = -h->y - (h->x+1)/2; } else { /* need to round toward -inf, not toward zero, so x-1 */ h->y = -h->y - h->x/2; } h->iso = 0; return 1; } ISEA_STATIC int hex_iso(struct hex *h) { if (h->iso) return 1; if (h->x >= 0) { h->y = (-h->y - (h->x+1)/2); } else { /* need to round toward -inf, not toward zero, so x-1 */ h->y = (-h->y - (h->x)/2); } h->z = -h->x - h->y; h->iso = 1; return 1; } ISEA_STATIC int hexbin2(int horizontal, double width, double x, double y, int *i, int *j) { double z, rx, ry, rz; double abs_dx, abs_dy, abs_dz; int ix, iy, iz, s; struct hex h; x = x / cos(30 * M_PI / 180.0); /* rotated X coord */ y = y - x / 2.0; /* adjustment for rotated X */ /* adjust for actual hexwidth */ x /= width; y /= width; z = -x - y; ix = rx = floor(x + 0.5); iy = ry = floor(y + 0.5); iz = rz = floor(z + 0.5); s = ix + iy + iz; if (s) { abs_dx = fabs(rx - x); abs_dy = fabs(ry - y); abs_dz = fabs(rz - z); if (abs_dx >= abs_dy && abs_dx >= abs_dz) { ix -= s; } else if (abs_dy >= abs_dx && abs_dy >= abs_dz) { iy -= s; } else { iz -= s; } } h.x = ix; h.y = iy; h.z = iz; h.iso = 1; hex_xy(&h); *i = h.x; *j = h.y; return ix * 100 + iy; } #ifndef ISEA_STATIC #define ISEA_STATIC #endif enum isea_poly { ISEA_NONE, ISEA_ICOSAHEDRON = 20 }; enum isea_topology { ISEA_HEXAGON=6, ISEA_TRIANGLE=3, ISEA_DIAMOND=4 }; enum isea_address_form { ISEA_GEO, ISEA_Q2DI, ISEA_SEQNUM, ISEA_INTERLEAVE, ISEA_PLANE, ISEA_Q2DD, ISEA_PROJTRI, ISEA_VERTEX2DD, ISEA_HEX }; struct isea_dgg { int polyhedron; /* ignored, icosahedron */ double o_lat, o_lon, o_az; /* orientation, radians */ int pole; /* true if standard snyder */ int topology; /* ignored, hexagon */ int aperture; /* valid values depend on partitioning method */ int resolution; double radius; /* radius of the earth in meters, ignored 1.0 */ int output; /* an isea_address_form */ int triangle; /* triangle of last transformed point */ int quad; /* quad of last transformed point */ unsigned long serial; }; struct isea_pt { double x, y; }; struct isea_geo { double lon, lat; }; struct isea_address { int type; /* enum isea_address_form */ int number; double x,y; /* or i,j or lon,lat depending on type */ }; /* ENDINC */ enum snyder_polyhedron { SNYDER_POLY_HEXAGON, SNYDER_POLY_PENTAGON, SNYDER_POLY_TETRAHEDRON, SNYDER_POLY_CUBE, SNYDER_POLY_OCTAHEDRON, SNYDER_POLY_DODECAHEDRON, SNYDER_POLY_ICOSAHEDRON }; struct snyder_constants { double g, G, theta, ea_w, ea_a, ea_b, g_w, g_a, g_b; }; /* TODO put these in radians to avoid a later conversion */ ISEA_STATIC struct snyder_constants constants[] = { {23.80018260, 62.15458023, 60.0, 3.75, 1.033, 0.968, 5.09, 1.195, 1.0}, {20.07675127, 55.69063953, 54.0, 2.65, 1.030, 0.983, 3.59, 1.141, 1.027}, {0.0}, {0.0}, {0.0}, {0.0}, {37.37736814, 36.0, 30.0, 17.27, 1.163, 0.860, 13.14, 1.584, 1.0}, }; #define E 52.62263186 #define F 10.81231696 #define DEG60 1.04719755119659774614 #define DEG120 2.09439510239319549229 #define DEG72 1.25663706143591729537 #define DEG90 1.57079632679489661922 #define DEG144 2.51327412287183459075 #define DEG36 0.62831853071795864768 #define DEG108 1.88495559215387594306 #define DEG180 M_PI /* sqrt(5)/M_PI */ #define ISEA_SCALE 0.8301572857837594396028083 /* 26.565051177 degrees */ #define V_LAT 0.46364760899944494524 #define RAD2DEG (180.0/M_PI) #define DEG2RAD (M_PI/180.0) ISEA_STATIC struct isea_geo vertex[] = { {0.0, DEG90}, {DEG180, V_LAT}, {-DEG108, V_LAT}, {-DEG36, V_LAT}, {DEG36, V_LAT}, {DEG108, V_LAT}, {-DEG144, -V_LAT}, {-DEG72, -V_LAT}, {0.0, -V_LAT}, {DEG72, -V_LAT}, {DEG144, -V_LAT}, {0.0, -DEG90} }; /* TODO make an isea_pt array of the vertices as well */ static int tri_v1[] = {0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 10, 2, 3, 4, 5, 1, 11, 11, 11, 11, 11}; /* 52.62263186 */ #define E_RAD 0.91843818702186776133 /* 10.81231696 */ #define F_RAD 0.18871053072122403508 /* triangle Centers */ struct isea_geo icostriangles[] = { {0.0, 0.0}, {-DEG144, E_RAD}, {-DEG72, E_RAD}, {0.0, E_RAD}, {DEG72, E_RAD}, {DEG144, E_RAD}, {-DEG144, F_RAD}, {-DEG72, F_RAD}, {0.0, F_RAD}, {DEG72, F_RAD}, {DEG144, F_RAD}, {-DEG108, -F_RAD}, {-DEG36, -F_RAD}, {DEG36, -F_RAD}, {DEG108, -F_RAD}, {DEG180, -F_RAD}, {-DEG108, -E_RAD}, {-DEG36, -E_RAD}, {DEG36, -E_RAD}, {DEG108, -E_RAD}, {DEG180, -E_RAD}, }; static double az_adjustment(int triangle) { double adj; struct isea_geo v; struct isea_geo c; v = vertex[tri_v1[triangle]]; c = icostriangles[triangle]; /* TODO looks like the adjustment is always either 0 or 180 */ /* at least if you pick your vertex carefully */ adj = atan2(cos(v.lat) * sin(v.lon - c.lon), cos(c.lat) * sin(v.lat) - sin(c.lat) * cos(v.lat) * cos(v.lon - c.lon)); return adj; } /* R tan(g) sin(60) */ #define TABLE_G 0.6615845383 /* H = 0.25 R tan g = */ #define TABLE_H 0.1909830056 #define RPRIME 0.91038328153090290025 ISEA_STATIC struct isea_pt isea_triangle_xy(int triangle) { struct isea_pt c; double Rprime = 0.91038328153090290025; triangle = (triangle - 1) % 20; c.x = TABLE_G * ((triangle % 5) - 2) * 2.0; if (triangle > 9) { c.x += TABLE_G; } switch (triangle / 5) { case 0: c.y = 5.0 * TABLE_H; break; case 1: c.y = TABLE_H; break; case 2: c.y = -TABLE_H; break; case 3: c.y = -5.0 * TABLE_H; break; default: /* should be impossible */ exit(EXIT_FAILURE); }; c.x *= Rprime; c.y *= Rprime; return c; } /* snyder eq 14 */ static double sph_azimuth(double f_lon, double f_lat, double t_lon, double t_lat) { double az; az = atan2(cos(t_lat) * sin(t_lon - f_lon), cos(f_lat) * sin(t_lat) - sin(f_lat) * cos(t_lat) * cos(t_lon - f_lon) ); return az; } /* coord needs to be in radians */ ISEA_STATIC int isea_snyder_forward(struct isea_geo * ll, struct isea_pt * out) { int i; /* * spherical distance from center of polygon face to any of its * vertexes on the globe */ double g; /* * spherical angle between radius vector to center and adjacent edge * of spherical polygon on the globe */ double G; /* * plane angle between radius vector to center and adjacent edge of * plane polygon */ double theta; /* additional variables from snyder */ double q, Rprime, H, Ag, Azprime, Az, dprime, f, rho, x, y; /* variables used to store intermediate results */ double cot_theta, tan_g, az_offset; /* how many multiples of 60 degrees we adjust the azimuth */ int Az_adjust_multiples; struct snyder_constants c; /* * TODO by locality of reference, start by trying the same triangle * as last time */ /* TODO put these constants in as radians to begin with */ c = constants[SNYDER_POLY_ICOSAHEDRON]; theta = c.theta * DEG2RAD; g = c.g * DEG2RAD; G = c.G * DEG2RAD; for (i = 1; i <= 20; i++) { double z; struct isea_geo center; center = icostriangles[i]; /* step 1 */ #if 0 z = sph_distance(center.lon, center.lat, ll->lon, ll->lat); #else z = acos(sin(center.lat) * sin(ll->lat) + cos(center.lat) * cos(ll->lat) * cos(ll->lon - center.lon)); #endif /* not on this triangle */ if (z > g + 0.000005) { /* TODO DBL_EPSILON */ continue; } Az = sph_azimuth(ll->lon, ll->lat, center.lon, center.lat); Az = atan2(cos(ll->lat) * sin(ll->lon - center.lon), cos(center.lat) * sin(ll->lat) - sin(center.lat) * cos(ll->lat) * cos(ll->lon - center.lon) ); /* step 2 */ /* This calculates "some" vertex coordinate */ az_offset = az_adjustment(i); Az -= az_offset; /* TODO I don't know why we do this. It's not in snyder */ /* maybe because we should have picked a better vertex */ if (Az < 0.0) { Az += 2.0 * M_PI; } /* * adjust Az for the point to fall within the range of 0 to * 2(90 - theta) or 60 degrees for the hexagon, by * and therefore 120 degrees for the triangle * of the icosahedron * subtracting or adding multiples of 60 degrees to Az and * recording the amount of adjustment */ Az_adjust_multiples = 0; while (Az < 0.0) { Az += DEG120; Az_adjust_multiples--; } while (Az > DEG120 + DBL_EPSILON) { Az -= DEG120; Az_adjust_multiples++; } /* step 3 */ cot_theta = 1.0 / tan(theta); tan_g = tan(g); /* TODO this is a constant */ /* Calculate q from eq 9. */ /* TODO cot_theta is cot(30) */ q = atan2(tan_g, cos(Az) + sin(Az) * cot_theta); /* not in this triangle */ if (z > q + 0.000005) { continue; } /* step 4 */ /* Apply equations 5-8 and 10-12 in order */ /* eq 5 */ /* Rprime = 0.9449322893 * R; */ /* R' in the paper is for the truncated */ Rprime = 0.91038328153090290025; /* eq 6 */ H = acos(sin(Az) * sin(G) * cos(g) - cos(Az) * cos(G)); /* eq 7 */ /* Ag = (Az + G + H - DEG180) * M_PI * R * R / DEG180; */ Ag = Az + G + H - DEG180; /* eq 8 */ Azprime = atan2(2.0 * Ag, Rprime * Rprime * tan_g * tan_g - 2.0 * Ag * cot_theta); /* eq 10 */ /* cot(theta) = 1.73205080756887729355 */ dprime = Rprime * tan_g / (cos(Azprime) + sin(Azprime) * cot_theta); /* eq 11 */ f = dprime / (2.0 * Rprime * sin(q / 2.0)); /* eq 12 */ rho = 2.0 * Rprime * f * sin(z / 2.0); /* * add back the same 60 degree multiple adjustment from step * 2 to Azprime */ Azprime += DEG120 * Az_adjust_multiples; /* calculate rectangular coordinates */ x = rho * sin(Azprime); y = rho * cos(Azprime); /* * TODO * translate coordinates to the origin for the particular * hexagon on the flattened polyhedral map plot */ out->x = x; out->y = y; return i; } /* * should be impossible, this implies that the coordinate is not on * any triangle */ fprintf(stderr, "impossible transform: %f %f is not on any triangle\n", ll->lon * RAD2DEG, ll->lat * RAD2DEG); exit(EXIT_FAILURE); /* not reached */ return 0; /* supresses a warning */ } /* * return the new coordinates of any point in orginal coordinate system. * Define a point (newNPold) in orginal coordinate system as the North Pole in * new coordinate system, and the great circle connect the original and new * North Pole as the lon0 longitude in new coordinate system, given any point * in orginal coordinate system, this function return the new coordinates. */ #define PRECISION 0.0000000000005 /* formula from Snyder, Map Projections: A working manual, p31 */ /* * old north pole at np in new coordinates * could be simplified a bit with fewer intermediates * * TODO take a result pointer */ ISEA_STATIC struct isea_geo snyder_ctran(struct isea_geo * np, struct isea_geo * pt) { struct isea_geo npt; double alpha, phi, lambda, lambda0, beta, lambdap, phip; double sin_phip; double lp_b; /* lambda prime minus beta */ double cos_p, sin_a; phi = pt->lat; lambda = pt->lon; alpha = np->lat; beta = np->lon; lambda0 = beta; cos_p = cos(phi); sin_a = sin(alpha); /* mpawm 5-7 */ sin_phip = sin_a * sin(phi) - cos(alpha) * cos_p * cos(lambda - lambda0); /* mpawm 5-8b */ /* use the two argument form so we end up in the right quadrant */ lp_b = atan2(cos_p * sin(lambda - lambda0), (sin_a * cos_p * cos(lambda - lambda0) + cos(alpha) * sin(phi))); lambdap = lp_b + beta; /* normalize longitude */ /* TODO can we just do a modulus ? */ lambdap = fmod(lambdap, 2 * M_PI); while (lambdap > M_PI) lambdap -= 2 * M_PI; while (lambdap < -M_PI) lambdap += 2 * M_PI; phip = asin(sin_phip); npt.lat = phip; npt.lon = lambdap; return npt; } ISEA_STATIC struct isea_geo isea_ctran(struct isea_geo * np, struct isea_geo * pt, double lon0) { struct isea_geo npt; np->lon += M_PI; npt = snyder_ctran(np, pt); np->lon -= M_PI; npt.lon -= (M_PI - lon0 + np->lon); /* * snyder is down tri 3, isea is along side of tri1 from vertex 0 to * vertex 1 these are 180 degrees apart */ npt.lon += M_PI; /* normalize longitude */ npt.lon = fmod(npt.lon, 2 * M_PI); while (npt.lon > M_PI) npt.lon -= 2 * M_PI; while (npt.lon < -M_PI) npt.lon += 2 * M_PI; return npt; } /* in radians */ #define ISEA_STD_LAT 1.01722196792335072101 #define ISEA_STD_LON .19634954084936207740 /* fuller's at 5.2454 west, 2.3009 N, adjacent at 7.46658 deg */ ISEA_STATIC int isea_grid_init(struct isea_dgg * g) { if (!g) return 0; g->polyhedron = 20; g->o_lat = ISEA_STD_LAT; g->o_lon = ISEA_STD_LON; g->o_az = 0.0; g->aperture = 4; g->resolution = 6; g->radius = 1.0; g->topology = 6; return 1; } ISEA_STATIC int isea_orient_isea(struct isea_dgg * g) { if (!g) return 0; g->o_lat = ISEA_STD_LAT; g->o_lon = ISEA_STD_LON; g->o_az = 0.0; return 1; } ISEA_STATIC int isea_orient_pole(struct isea_dgg * g) { if (!g) return 0; g->o_lat = M_PI / 2.0; g->o_lon = 0.0; g->o_az = 0; return 1; } ISEA_STATIC int isea_transform(struct isea_dgg * g, struct isea_geo * in, struct isea_pt * out) { struct isea_geo i, pole; int tri; pole.lat = g->o_lat; pole.lon = g->o_lon; i = isea_ctran(&pole, in, g->o_az); tri = isea_snyder_forward(&i, out); out->x *= g->radius; out->y *= g->radius; g->triangle = tri; return tri; } #define DOWNTRI(tri) (((tri - 1) / 5) % 2 == 1) ISEA_STATIC void isea_rotate(struct isea_pt * pt, double degrees) { double rad; double x, y; rad = -degrees * M_PI / 180.0; while (rad >= 2.0 * M_PI) rad -= 2.0 * M_PI; while (rad <= -2.0 * M_PI) rad += 2.0 * M_PI; x = pt->x * cos(rad) + pt->y * sin(rad); y = -pt->x * sin(rad) + pt->y * cos(rad); pt->x = x; pt->y = y; } ISEA_STATIC int isea_tri_plane(int tri, struct isea_pt *pt, double radius) { struct isea_pt tc; /* center of triangle */ if (DOWNTRI(tri)) { isea_rotate(pt, 180.0); } tc = isea_triangle_xy(tri); tc.x *= radius; tc.y *= radius; pt->x += tc.x; pt->y += tc.y; return tri; } /* convert projected triangle coords to quad xy coords, return quad number */ ISEA_STATIC int isea_ptdd(int tri, struct isea_pt *pt) { int downtri, quad; downtri = (((tri - 1) / 5) % 2 == 1); quad = ((tri - 1) % 5) + ((tri - 1) / 10) * 5 + 1; isea_rotate(pt, downtri ? 240.0 : 60.0); if (downtri) { pt->x += 0.5; /* pt->y += cos(30.0 * M_PI / 180.0); */ pt->y += .86602540378443864672; } return quad; } ISEA_STATIC int isea_dddi_ap3odd(struct isea_dgg *g, int quad, struct isea_pt *pt, struct isea_pt *di) { struct isea_pt v; double hexwidth; double sidelength; /* in hexes */ int d, i; int maxcoord; struct hex h; /* This is the number of hexes from apex to base of a triangle */ sidelength = (pow(2.0, g->resolution) + 1.0) / 2.0; /* apex to base is cos(30deg) */ hexwidth = cos(M_PI / 6.0) / sidelength; /* TODO I think sidelength is always x.5, so * (int)sidelength * 2 + 1 might be just as good */ maxcoord = (int) (sidelength * 2.0 + 0.5); v = *pt; hexbin2(0, hexwidth, v.x, v.y, &h.x, &h.y); h.iso = 0; hex_iso(&h); d = h.x - h.z; i = h.x + h.y + h.y; /* * you want to test for max coords for the next quad in the same * "row" first to get the case where both are max */ if (quad <= 5) { if (d == 0 && i == maxcoord) { /* north pole */ quad = 0; d = 0; i = 0; } else if (i == maxcoord) { /* upper right in next quad */ quad += 1; if (quad == 6) quad = 1; i = maxcoord - d; d = 0; } else if (d == maxcoord) { /* lower right in quad to lower right */ quad += 5; d = 0; } } else if (quad >= 6) { if (i == 0 && d == maxcoord) { /* south pole */ quad = 11; d = 0; i = 0; } else if (d == maxcoord) { /* lower right in next quad */ quad += 1; if (quad == 11) quad = 6; d = maxcoord - i; i = 0; } else if (i == maxcoord) { /* upper right in quad to upper right */ quad = (quad - 4) % 5; i = 0; } } di->x = d; di->y = i; g->quad = quad; return quad; } ISEA_STATIC int isea_dddi(struct isea_dgg *g, int quad, struct isea_pt *pt, struct isea_pt *di) { struct isea_pt v; double hexwidth; int sidelength; /* in hexes */ struct hex h; if (g->aperture == 3 && g->resolution % 2 != 0) { return isea_dddi_ap3odd(g, quad, pt, di); } /* todo might want to do this as an iterated loop */ if (g->aperture >0) { sidelength = (int) (pow(g->aperture, g->resolution / 2.0) + 0.5); } else { sidelength = g->resolution; } hexwidth = 1.0 / sidelength; v = *pt; isea_rotate(&v, -30.0); hexbin2(0, hexwidth, v.x, v.y, &h.x, &h.y); h.iso = 0; hex_iso(&h); /* we may actually be on another quad */ if (quad <= 5) { if (h.x == 0 && h.z == -sidelength) { /* north pole */ quad = 0; h.z = 0; h.y = 0; h.x = 0; } else if (h.z == -sidelength) { quad = quad + 1; if (quad == 6) quad = 1; h.y = sidelength - h.x; h.z = h.x - sidelength; h.x = 0; } else if (h.x == sidelength) { quad += 5; h.y = -h.z; h.x = 0; } } else if (quad >= 6) { if (h.z == 0 && h.x == sidelength) { /* south pole */ quad = 11; h.x = 0; h.y = 0; h.z = 0; } else if (h.x == sidelength) { quad = quad + 1; if (quad == 11) quad = 6; h.x = h.y + sidelength; h.y = 0; h.z = -h.x; } else if (h.y == -sidelength) { quad -= 4; h.y = 0; h.z = -h.x; } } di->x = h.x; di->y = -h.z; g->quad = quad; return quad; } ISEA_STATIC int isea_ptdi(struct isea_dgg *g, int tri, struct isea_pt *pt, struct isea_pt *di) { struct isea_pt v; int quad; v = *pt; quad = isea_ptdd(tri, &v); quad = isea_dddi(g, quad, &v, di); return quad; } /* q2di to seqnum */ ISEA_STATIC int isea_disn(struct isea_dgg *g, int quad, struct isea_pt *di) { int sidelength; int sn, height; int hexes; if (quad == 0) { g->serial = 1; return g->serial; } /* hexes in a quad */ hexes = (int) (pow(g->aperture, g->resolution) + 0.5); if (quad == 11) { g->serial = 1 + 10 * hexes + 1; return g->serial; } if (g->aperture == 3 && g->resolution % 2 == 1) { height = (int) (pow(g->aperture, (g->resolution - 1) / 2.0)); sn = ((int) di->x) * height; sn += ((int) di->y) / height; sn += (quad - 1) * hexes; sn += 2; } else { sidelength = (int) (pow(g->aperture, g->resolution / 2.0) + 0.5); sn = (quad - 1) * hexes + sidelength * di->x + di->y + 2; } g->serial = sn; return sn; } /* TODO just encode the quad in the d or i coordinate * quad is 0-11, which can be four bits. * d' = d << 4 + q, d = d' >> 4, q = d' & 0xf */ /* convert a q2di to global hex coord */ ISEA_STATIC int isea_hex(struct isea_dgg *g, int tri, struct isea_pt *pt, struct isea_pt *hex) { struct isea_pt v; int sidelength; int d, i, x, y, quad; double oddsl; quad = isea_ptdi(g, tri, pt, &v); hex->x = ((int)v.x << 4) + quad; hex->y = v.y; return 1; d = v.x; i = v.y; /* Aperture 3 odd resolutions */ if (g->aperture == 3 && g->resolution % 2 != 0) { int offset = (int)(pow(3.0, g->resolution - 1) + 0.5); oddsl = (pow(2.0, g->resolution) + 1.0) / 2.0; d += offset * ((g->quad-1) % 5); i += offset * ((g->quad-1) % 5); if (quad == 0) { d = 0; i = offset; } else if (quad == 11) { d = 2 * offset; i = 0; } else if (quad > 5) { d += offset; } x = (2*d - i) /3; y = (2*i - d) /3; hex->x = x + offset / 3; hex->y = y + 2 * offset / 3; return 1; } /* aperture 3 even resolutions and aperture 4 */ sidelength = (int) (pow(g->aperture, g->resolution / 2.0) + 0.5); if (g->quad == 0) { hex->x = 0; hex->y = sidelength; } else if (g->quad == 11) { hex->x = sidelength * 2; hex->y = 0; } else { hex->x = d + sidelength * ((g->quad-1) % 5); if (g->quad > 5) hex->x += sidelength; hex->y = i + sidelength * ((g->quad-1) % 5); } return 1; } ISEA_STATIC struct isea_pt isea_forward(struct isea_dgg *g, struct isea_geo *in) { int tri, downtri, quad; struct isea_pt out, coord; tri = isea_transform(g, in, &out); downtri = (((tri - 1) / 5) % 2 == 1); quad = ((tri - 1) % 5) + ((tri - 1) / 10) * 5 + 1; if (g->output == ISEA_PLANE) { isea_tri_plane(tri, &out, g->radius); return out; } /* convert to isea standard triangle size */ out.x = out.x / g->radius * ISEA_SCALE; out.y = out.y / g->radius * ISEA_SCALE; out.x += 0.5; out.y += 2.0 * .14433756729740644112; switch (g->output) { case ISEA_PROJTRI: /* nothing to do, already in projected triangle */ break; case ISEA_VERTEX2DD: g->quad = isea_ptdd(tri, &out); break; case ISEA_Q2DD: /* Same as above, we just don't print as much */ g->quad = isea_ptdd(tri, &out); break; case ISEA_Q2DI: g->quad = isea_ptdi(g, tri, &out, &coord); return coord; break; case ISEA_SEQNUM: isea_ptdi(g, tri, &out, &coord); /* disn will set g->serial */ isea_disn(g, g->quad, &coord); return coord; break; case ISEA_HEX: isea_hex(g, tri, &out, &coord); return coord; break; } return out; } /* * Proj 4 integration code follows */ #define PROJ_PARMS__ \ struct isea_dgg dgg; #define PJ_LIB__ #include <projects.h> PROJ_HEAD(isea, "Icosahedral Snyder Equal Area") "\n\tSph"; FORWARD(s_forward); struct isea_pt out; struct isea_geo in; in.lon = lp.lam; in.lat = lp.phi; out = isea_forward(&P->dgg, &in); xy.x = out.x; xy.y = out.y; return xy; } FREEUP; if (P) pj_dalloc(P); } ENTRY0(isea) char *opt; P->fwd = s_forward; isea_grid_init(&P->dgg); P->dgg.output = ISEA_PLANE; /* P->dgg.radius = P->a; / * otherwise defaults to 1 */ /* calling library will scale, I think */ opt = pj_param(P->ctx,P->params, "sorient").s; if (opt) { if (!strcmp(opt, "isea")) { isea_orient_isea(&P->dgg); } else if (!strcmp(opt, "pole")) { isea_orient_pole(&P->dgg); } else { E_ERROR(-34); } } if (pj_param(P->ctx,P->params, "tazi").i) { P->dgg.o_az = pj_param(P->ctx,P->params, "razi").f; } if (pj_param(P->ctx,P->params, "tlon_0").i) { P->dgg.o_lon = pj_param(P->ctx,P->params, "rlon_0").f; } if (pj_param(P->ctx,P->params, "tlat_0").i) { P->dgg.o_lat = pj_param(P->ctx,P->params, "rlat_0").f; } if (pj_param(P->ctx,P->params, "taperture").i) { P->dgg.aperture = pj_param(P->ctx,P->params, "iaperture").i; } if (pj_param(P->ctx,P->params, "tresolution").i) { P->dgg.resolution = pj_param(P->ctx,P->params, "iresolution").i; } opt = pj_param(P->ctx,P->params, "smode").s; if (opt) { if (!strcmp(opt, "plane")) { P->dgg.output = ISEA_PLANE; } else if (!strcmp(opt, "di")) { P->dgg.output = ISEA_Q2DI; } else if (!strcmp(opt, "dd")) { P->dgg.output = ISEA_Q2DD; } else if (!strcmp(opt, "hex")) { P->dgg.output = ISEA_HEX; } else { /* TODO verify error code. Possibly eliminate magic */ E_ERROR(-34); } } if (pj_param(P->ctx,P->params, "trescale").i) { P->dgg.radius = ISEA_SCALE; } if (pj_param(P->ctx,P->params, "tresolution").i) { P->dgg.resolution = pj_param(P->ctx,P->params, "iresolution").i; } else { P->dgg.resolution = 4; } if (pj_param(P->ctx,P->params, "taperture").i) { P->dgg.aperture = pj_param(P->ctx,P->params, "iaperture").i; } else { P->dgg.aperture = 3; } ENDENTRY(P)
tilemapjp/OSGeo.GDAL.Xamarin
proj-4.8.0/src/PJ_isea.c
C
mit
23,995
def pytest_configure(): import django from django.conf import settings settings.configure( DEBUG_PROPAGATE_EXCEPTIONS=True, DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:' } }, SITE_ID=1, SECRET_KEY='not very secret in tests', USE_I18N=True, USE_L10N=True, STATIC_URL='/static/', ROOT_URLCONF='tests.urls', TEMPLATE_LOADERS=( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', ), MIDDLEWARE_CLASSES=( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', ), INSTALLED_APPS=( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'tests', ), PASSWORD_HASHERS=( 'django.contrib.auth.hashers.MD5PasswordHasher', ), ) try: import oauth_provider # NOQA import oauth2 # NOQA except ImportError: pass else: settings.INSTALLED_APPS += ( 'oauth_provider', ) try: if django.VERSION >= (1, 8): # django-oauth2-provider does not support Django1.8 raise ImportError import provider # NOQA except ImportError: pass else: settings.INSTALLED_APPS += ( 'provider', 'provider.oauth2', ) try: import django django.setup() except AttributeError: pass
orf/django-rest-framework-jwt
tests/conftest.py
Python
mit
2,018
/*!----------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.9.0(630109944f54bcdfc2dbaaff5f090c0843af6c66) * Released under the MIT license * https://github.com/Microsoft/vscode/blob/master/LICENSE.txt *-----------------------------------------------------------*/ define("vs/editor/editor.main.nls.pt-br",{"vs/base/browser/ui/actionbar/actionbar":["{0} ({1})"],"vs/base/browser/ui/aria/aria":["{0} (ocorreu novamente)"],"vs/base/browser/ui/findinput/findInput":["entrada"],"vs/base/browser/ui/findinput/findInputCheckboxes":["Diferenciar MaiΓΊsculas de MinΓΊsculas","Coincidir Palavra Inteira","Usar ExpressΓ£o Regular"],"vs/base/browser/ui/inputbox/inputBox":["Erro: {0}","Aviso: {0}","InformaΓ§Γ΅es: {0}"],"vs/base/common/keybindingLabels":["Ctrl","Shift","Alt","Windows","Controle","Shift","Alt","Comando","Controle","Shift","Alt","Windows"],"vs/base/common/severity":["Erro","Aviso","InformaΓ§Γ΅es"],"vs/base/parts/quickopen/browser/quickOpenModel":["{0}, seletor","seletor"],"vs/base/parts/quickopen/browser/quickOpenWidget":["Seletor rΓ‘pido. Digite para filtrar resultados.","Seletor rΓ‘pido"],"vs/base/parts/tree/browser/treeDefaults":["Recolher"],"vs/editor/browser/widget/diffReview":["Fechar","DiferenΓ§a {0} de {1}: original {2}, {3} linhas, modificado {4}, {5} linhas","em branco","original {0}, {1} modificados: {2}","+ modificado {0}: {1}","-original {0}: {1}","Ir para a prΓ³xima diferenΓ§a","Ir para a diferenΓ§a anterior"],"vs/editor/common/config/commonEditorConfig":["Editor","Controla a famΓ­lia de fontes.","Controla o peso da fonte.","Controla o tamanho da fonte em pixels.","Controla a altura da linha. Use 0 para computar a altura da linha a partir do tamanho da fonte.","Controla o espaΓ§amento da letra em pixels.","Controla a exibiΓ§Γ£o de nΓΊmeros de linha. Valores possΓ­veis sΓ£o 'on', 'off' e 'relative'. 'relative' mostra a contagem de linhas a partir da posiΓ§Γ£o atual do cursor.","Colunas nas quais mostrar rΓ©guas verticais","Caracteres que serΓ£o usados como separadores de palavras ao fazer navegaΓ§Γ£o relacionada a palavras ou operaΓ§Γ΅es","O nΓΊmero de espaΓ§os equivalentes a uma tabulaΓ§Γ£o. Esta configuraΓ§Γ£o Γ© sobreposta no conteΓΊdo do arquivo quando `editor.detectIndentation` estΓ‘ ligado.","Esperado 'nΓΊmero'. Note que o valor \"auto\" foi alterado pela configuraΓ§Γ£o 'editor.detectIndentation'.","Insere espaΓ§os quanto pressionado Tab. Esta configuraΓ§Γ£o Γ© sobrescrita com base no conteΓΊdo do arquivo quando 'editor.detectIndentation' estΓ‘ habilitado.","Esperado 'booleano'. Note que o valor \"auto\" foi alterado pela configuraΓ§Γ£o 'editor.detectIndentation'.","Quando um arquivo estΓ‘ sendo aberto, 'editor.tabSize' e 'editor.insertSpace' serΓ‘ detectado com base no conteΓΊdo do arquivo.","Controla se as seleΓ§Γ΅es tΓͺm cantos arredondados","Controla se o editor rolarΓ‘ alΓ©m da ΓΊltima linha","Controla se o mini mapa Γ© exibido","Controla se o controle deslizante minimap Γ© oculto automaticamente.","Renderizar os caracteres em uma linha (em oposiΓ§Γ£o a blocos de caracteres)","Limitar o tamanho de um mini-mapa para renderizar no mΓ‘ximo um nΓΊmero determinado de colunas","Controla se nΓ³s inicializamos a string de pesquisa na Ferramenta de Pesquisa a partir da seleΓ§Γ£o do editor","Controla se a configuraΓ§Γ£o Find in Selection deve estar ativada quando vΓ‘rios caracteres ou linhas de texto estΓ£o selecionados no editor","As linhas nunca serΓ£o quebradas.","As linhas serΓ£o quebradas na largura de visualizaΓ§Γ£o","As linhas serΓ£o quebradas em `editor.wordWrapColumn`.","As linhas serΓ£o quebradas no mΓ­nimo entre a largura de visualizaΓ§Γ£o e `editor.wordWrapColumn`.","Controla como as linhas devem ser quebradas automaticamente. Pode ser:\n- 'off' (quebra automΓ‘tica de linha desabilitada)\n- 'on' (quebra automΓ‘tica de linha na largura da janela)\n- 'wordWrapColumn' (quebra automΓ‘tica no numero de colunas definido em `editor.wordWrapColumn`) ou\n- 'bounded' (quebra automΓ‘tica em uma dimensΓ£o minima da janela e na largura configurada)","Controla a coluna de quebra de linha do editor quando editor.wordWrap` Γ© 'wordWrapColumn' ou 'bounded'.",'Controla o recuo de linhas quebradas. Pode ser "none", "same" ou "indent".','Um multiplicador a ser usado em "deltaX" e "deltaY" dos eventos de rolagem do botΓ£o de rolagem do mouse',"Mapeia para 'Control' no Windows e Linux e 'Command' no OSX.","Mapeia para 'Alt' em Windows e Linux e 'Option' em OSX.","O modificador a ser usado para adicionar vΓ‘rios cursores com o mouse. `ctrlCmd` mapeia 'Control' no Windows e Linux e 'Command' no OSX. Os gestos do mouse Ir para definiΓ§Γ£o e Abrir Link irΓ£o adaptar-se tal maneira que eles nΓ£o entrem em conflito com o modificador multicursor.","Habilitar sugestΓ΅es rΓ‘pidas dentro de strings.","Habilitar sugestΓ΅es rΓ‘pidas dentro de comentΓ‘rios.","Habilitar sugestΓ΅es rΓ‘pidas fora de strings e comentΓ‘rios.","Controlar se sugestΓ΅es devem aparecer automaticamente ao digitar","Controla o atraso em ms apΓ³s o qual sugestΓ΅es rΓ‘pidas serΓ£o exibidas","Habilita pop-up que mostra documentaΓ§Γ£o de parΓ’metros e o tipo deΒ informaΓ§Γ£o conforme vocΓͺ digita","Controla se o editor deve fechar colchetes automaticamente depois de abri-los","Controla se o editor deve formatar automaticamente a linha apΓ³s a digitaΓ§Γ£o","Controla se o editor deve formatar automaticamente o conteΓΊdo colado. Um formatador deve estar disponΓ­vel e o formatador deve ser capaz de formatar apenas uma parte do documento.","Controles se o editor deve ajustar automaticamente o recuo, quando os usuΓ‘rios digitam, colam ou movem linhas. Regras de recuo da lΓ­ngua devem estar disponΓ­veis. ","Controla se as sugestΓ΅es devem aparecer automaticamente ao digitar caracteres de gatilho","Controla se as sugestΓ΅es devem ser aceitas com 'Enter' - em adiΓ§Γ£o a 'Tab'. Ajuda a evitar a ambiguidade entre a inserΓ§Γ£o de novas linhas ou aceitar sugestΓ΅es. O valor 'smart' significa apenas aceitar uma sugestΓ£o com Enter quando ela fizer uma mudanΓ§a textual","Controla se as sugestΓ΅es devem ser aceitas em caracteres de confirmaΓ§Γ£o. Por exemplo, em JavaScript, o ponto-e-vΓ­rgula (';') pode ser um caractere de confirmaΓ§Γ£o que aceita uma sugestΓ£o e digita esse caractere.","Controla se os snippets sΓ£o exibidos juntamente com as outras sugestΓ΅es e como eles sΓ£o ordenados.","Controla se a cΓ³pia sem nenhuma seleΓ§Γ£o copia a linha atual.","Controla se o auto-completar deve ser calculado baseado nas palavras no documento.","Tamanho da fonte para a ferramenta de sugestΓ£o","Altura de linha para a ferramenta de sugestΓ£o","Controla se o editor deve realΓ§ar correspondΓͺncias semelhantes Γ  seleΓ§Γ£o","Controla se o editor deve realΓ§ar ocorrΓͺncias de sΓ­mbolos semΓ’nticos.","Controla o nΓΊmero de decoraΓ§Γ΅es que podem ser exibidas na mesma posiΓ§Γ£o na rΓ©gua de visΓ£o geral","Controla se deve desenhar uma borda ao redor da rΓ©gua de visΓ£o geral.","Controla o estilo de animaΓ§Γ£o do cursor, os valores possΓ­veis sΓ£o 'blink', 'smooth', 'phase', 'expand' e 'solid'","Alterar o zoom da fonte editor quando utilizada a roda do mouse e pressionando Ctrl","Controla o estilo do cursor, os valores aceitos sΓ£o 'block', 'block-outline', 'line', 'line-thin', 'underline' e 'underline-thin'","Habilita ligaduras de fontes","Controla se o cursor deve ficar oculto na rΓ©gua de visΓ£o geral.","Controla como o editor deve rendenizar caracteres de espaΓ§os em branco, possibilidades sΓ£o 'none', 'boundary' e 'all'. A opΓ§Γ£o 'boundary' nΓ£o rendeniza espaΓ§os simples entre palavras.","Controla se o editor deve renderizar caracteres de controle","Controla se o editor deve renderizar guias de identaΓ§Γ£o","Controla como o editor deve renderizar a linha atual, as possibilidades sΓ£o 'none', 'gutter', 'line' e 'all'.","Controla se o editor exibirΓ‘ a lente de cΓ³digos.","Controla se o editor tem codigo colapsΓ­vel hablitado","Controla se os controles de desdobramento na divisΓ£o sΓ£o ocultas automaticamente.","RealΓ§a colchetes correspondente quando um deles estiver selecionado.","Controla se o editor deve renderizar a margem vertical de Γ­cones. A margem vertical de Γ­cones Γ© usada primordialmente na depuraΓ§Γ£o","InserΓ§Γ£o e deleΓ§Γ£o de espaΓ§o em branco seguem a tabulaΓ§Γ£o","Remove espaΓ§os em branco inseridos automaticamente no fim da linha","MantΓ©m os editores de visualizaΓ§Γ£o abertos mesmo quando clicando seu conteΓΊdo ou teclando Escape.","Controla se o editor deve permitir mover seleΓ§Γ΅es via arrastar e soltar.","O editor irΓ‘ utilizar a plataforma da API para detectar quando um leitor de tela estΓ‘ conectado.","O editor serΓ‘ permanentemente otimizado para o uso de um leitor de tela.","O editor nunca serΓ‘ otimizado para o uso de um leitor de tela.","Controla quando o editor deve executar em modo otimizado para leitores de tela.","Controla se o editor deve detectar links e tornΓ‘-los clicΓ‘veis","Controla se o editor de diff mostra as diff lado a lado ou inline.","Controla se o editor de diff mostra alteraΓ§Γ΅es nos espaΓ§os iniciais ou finais como diferenΓ§as","Controla se o editor de diff mostra indicadores +/- para alteraΓ§Γ΅es adicionadas/removidas","Controla se a Γ‘rea primΓ‘ria de transferΓͺncia Linux deve ser suportada."],"vs/editor/common/config/editorOptions":["O editor nΓ£o estΓ‘ acessΓ­vel neste momento. Por favor pressione Alt+F1 para opΓ§Γ΅es.","ConteΓΊdo do editor"],"vs/editor/common/controller/cursor":["ExceΓ§Γ£o inesperada ao executar o comando."],"vs/editor/common/model/textModelWithTokens":["O modo falhou ao gerar token da entrada."],"vs/editor/common/modes/modesRegistry":["Texto sem formataΓ§Γ£o"],"vs/editor/common/services/bulkEdit":["Estes arquivos foram alterados nesse meio tempo: {0}","NΓ£o foram feitas ediΓ§Γ΅es","Feitas {0} ediΓ§Γ΅es de texto em {1} arquivos","Feitas {0} ediΓ§Γ΅es de texto em um arquivo"],"vs/editor/common/services/modelServiceImpl":["[{0}] {1}","[{0}] {1}"],"vs/editor/common/view/editorColorRegistry":["Cor de fundo para a posiΓ§Γ£o do cursor na seleΓ§Γ£o de linhas.","Cor de fundo para a borda em volta da linha na posiΓ§Γ£o do cursor","Cor de fundo dos ranges selecionados, assim como abertura instantΓ’nea e descoberta de recursos ","Cor do cursor no editor.","Cor dos caracteres em branco no editor","Cor das guias de indentaΓ§Γ£o do editor.","Cor dos nΓΊmeros de linha do editor.","Cor das rΓ©guas do editor.","Cor do primeiro plano das lentes de cΓ³digo do editor","Cor de fundo atrΓ‘s do colchetes correspondentes","Cor para as caixas de colchetes correspondentes","Cor da borda da rΓ©gua de visΓ£o geral.","Cor de fundo da separaΓ§Γ£o do editor.O separador contΓ©m os glifos das margens e os nΓΊmeros de linha.","Cor do primeiro plano das linhas onduladas de erro no editor.","Cor da borda das linhas onduladas de erro no editor.","Cor do primeiro plano de linhas onduladas de aviso no editor.","Cor da borda das linhas onduladas de aviso no editor."],"vs/editor/contrib/bracketMatching/common/bracketMatching":["Ir para colchete"],"vs/editor/contrib/caretOperations/common/caretOperations":["Mover cursor para a esquerda","Mover cursor para a direita"],"vs/editor/contrib/caretOperations/common/transpose":["Transport letras"],"vs/editor/contrib/clipboard/browser/clipboard":["Recortar","Copiar","Colar","Copiar com realce de sintaxe"],"vs/editor/contrib/comment/common/comment":["Alternar ComentΓ‘rio de Linha","Adicionar ComentΓ‘rio de Linha","Remover ComentΓ‘rio de Linha","Alternar ComentΓ‘rio de Bloco"],"vs/editor/contrib/contextmenu/browser/contextmenu":["Mostrar o menu de contexto do editor"],"vs/editor/contrib/find/browser/findWidget":["Localizar","Localizar","CorrespondΓͺncia anterior","PrΓ³xima correspondΓͺncia","Localizar na seleΓ§Γ£o","Fechar","Substituir","Substituir","Substituir","Substituir Tudo","Ativar/desativar modo Substituir","Somente os primeiros 999 resultados sΓ£o realΓ§ados, mas todas as operaΓ§Γ΅es de pesquisa funcionam em todo o texto.","{0} de {1}","Nenhum resultado"],"vs/editor/contrib/find/common/findController":["Localizar","Localizar PrΓ³ximo","Localizar anterior","Localizar PrΓ³xima SeleΓ§Γ£o","Localizar SeleΓ§Γ£o Anterior","Substituir","Adicionar SeleΓ§Γ£o ao PrΓ³ximo Localizar CorrespondΓͺncia","Adicionar SeleΓ§Γ£o Γ  CorrespondΓͺncia de LocalizaΓ§Γ£o Anterior","Mover Última SeleΓ§Γ£o para PrΓ³ximo Localizar CorrespondΓͺncia","Mover Última SeleΓ§Γ£o para CorrespondΓͺncia de LocalizaΓ§Γ£o Anterior","Selecionar Todas as OcorrΓͺncias de Localizar CorrespondΓͺncia","Alterar todas as ocorrΓͺncias"],"vs/editor/contrib/folding/browser/folding":["Abrir","Abrir recursivamente","Colapsar","Colapsar recursivamente","Colapsar tudo","Abrir tudo","NΓ­vel de colapsamento {0}"],"vs/editor/contrib/format/browser/formatActions":["1 ediΓ§Γ£o de formataΓ§Γ£o feita na linha {0}","{0} ediΓ§Γ΅es de formataΓ§Γ£o feitas na linha {1}","Feita 1 ediΓ§Γ£o de formataΓ§Γ£o entre as linhas {0} e {1}","Feitas {0} ediΓ§Γ΅es de formataΓ§Γ£o entre as linhas {1} e {2}","Formatar Documento","Formatar SeleΓ§Γ£o"],"vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands":["NΓ£o foi encontrada definiΓ§Γ£o para '{0}'","Nenhuma definiΓ§Γ£o encontrada","- {0} definiΓ§Γ΅es","Ir para DefiniΓ§Γ£o","Abrir definiΓ§Γ£o ao lado","Inspecionar definiΓ§Γ£o","Nenhuma implementaΓ§Γ£o encontrada para '{0}'","Nenhuma implementaΓ§Γ£o encontrada","– {0} implementaΓ§Γ΅es","Ir para a implementaΓ§Γ£o","Inspecionar implementaΓ§Γ£o","Nenhuma definiΓ§Γ£o encontrada para '{0}'","Nenhuma definiΓ§Γ£o de tipo encontrada","– {0} definiΓ§Γ΅es de tipos","Ir para a definiΓ§Γ£o de tipo","Inspecionar definiΓ§Γ£o de tipo"],"vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse":["Clique para mostrar {0} definiΓ§Γ΅es."],"vs/editor/contrib/gotoError/browser/gotoError":["({0}/{1})","Ir para o PrΓ³ximo Erro ou Aviso","Ir para o Erro ou Aviso Anterior","Ferramenta de marcaΓ§Γ£o de ediΓ§Γ£o apresentando error na cor ","Ferramenta de marcaΓ§Γ£o de ediΓ§Γ£o apresentando adventΓͺncia na cor","Cor de fundo da ferramenta de marcaΓ§Γ£o de navegaΓ§Γ£o do editor."],"vs/editor/contrib/hover/browser/hover":["Mostrar Item Flutuante"],"vs/editor/contrib/hover/browser/modesContentHover":["Carregando..."],"vs/editor/contrib/inPlaceReplace/common/inPlaceReplace":["Substituir pelo valor anterior","Substituir pelo prΓ³ximo valor"],"vs/editor/contrib/linesOperations/common/linesOperations":["Copiar linha acima","Copiar linha abaixo","Mover linha para cima","Mover linha para baixo","Classificar Linhas Ascendentemente","Classificar Linhas Descendentemente","Cortar EspaΓ§o em Branco Γ  Direita","Excluir linha","Recuar linha","Recuar linha para a esquerda","Inserir linha acima","Inserir linha abaixo","Excluir tudo Γ  Esquerda","Excluir Tudo Γ  Direita","Unir Linhas","Transpor caracteres ao redor do cursor","Transformar para maiΓΊsculas","Transformar para minΓΊsculas"],"vs/editor/contrib/links/browser/links":["Cmd + clique para seguir o link","Ctrl + clique para seguir o link","Alt + clique para seguir o link","Desculpe, falha ao abrir este link porque ele nΓ£o estΓ‘ bem formatado: {0}","Desculpe, falha ao abrir este link porque seu destino estΓ‘ faltando.","Abrir link"],"vs/editor/contrib/multicursor/common/multicursor":["Inserir cursor acima","Inserir cursor abaixo","Adicionar Cursores ao Final das Linhas"],"vs/editor/contrib/parameterHints/browser/parameterHints":["Dicas de parΓ’metro de gatilho"],"vs/editor/contrib/parameterHints/browser/parameterHintsWidget":["{0}, dica"],"vs/editor/contrib/quickFix/browser/quickFixCommands":["Mostrar correΓ§Γ΅es ({0})","Mostrar correΓ§Γ΅es","CorreΓ§Γ£o RΓ‘pida"],"vs/editor/contrib/referenceSearch/browser/referenceSearch":["- {0} referΓͺncias","Localizar Todas as ReferΓͺncias"],"vs/editor/contrib/referenceSearch/browser/referencesController":["Carregando..."],"vs/editor/contrib/referenceSearch/browser/referencesModel":["sΓ­mbolo em {0} na linha {1} e coluna {2}","1 sΓ­mbolo em {0}, caminho completo {1}","{0} sΓ­mbolosΒ em {1}, caminho completo {2}","Nenhum resultado encontrado","Encontrado 1 sΓ­mbolo em {0}","Encontrados {0} sΓ­mbolos em {1}","Encontrados {0} sΓ­mbolos em {1} arquivos"],"vs/editor/contrib/referenceSearch/browser/referencesWidget":["Falha ao resolver arquivo.","{0} referΓͺncias","{0} referΓͺncia","nenhuma visualizaΓ§Γ£o disponΓ­vel","ReferΓͺncias","Nenhum resultado","ReferΓͺncias","Cor de fundo da Γ‘rea de visualizaΓ§Γ£o do tΓ­tulo.","Cor de visualizaΓ§Γ£o do tΓ­tulo.","Cor da visualizaΓ§Γ£o de informaΓ§Γ΅es do tΓ­tulo.","Cor das bordas e seta da Γ‘rea de visualizaΓ§Γ£o","Cor de fundo da Γ‘rea de visualizaΓ§Γ£o da lista de resultados.","Cor de primeiro plano para nΓ³s de linha na lista de resultados visualizados.","Cor de primeiro plano para nΓ³s de arquivos na lista de resultados visualizados.","Cor de fundo da entrada selecionada na visualizaΓ§Γ£o da lista de resultados.","Cor da entrada selecionada na visualizaΓ§Γ£o da lista de resultados.","Cor de fundo da visualizaΓ§Γ£o do editor.","Cor de fundo da separaΓ§Γ£o na visualizaΓ§Γ£o rΓ‘pida do editor.","Corresponder cor de realce com visualizaΓ§Γ£o da lista de resultados.","Corresponder cor de realce com visualizaΓ§Γ£o do editor."],"vs/editor/contrib/rename/browser/rename":["Nenhum resultado.","Renomeado '{0}' para '{1}'com sucesso. Resumo: {2}","Desculpe, falha na execuΓ§Γ£o de renomear.","Renomear SΓ­mbolo"],"vs/editor/contrib/rename/browser/renameInputField":["Renomear entrada. Digite o novo nome e tecle Enter para gravar."],"vs/editor/contrib/smartSelect/common/smartSelect":["Expandir seleΓ§Γ£o","Reduzir seleΓ§Γ£o"],"vs/editor/contrib/suggest/browser/suggestController":["Ao aceitar '{0}' foi inserido o seguinte texto: {1}","SugestΓ£o de gatilho"],"vs/editor/contrib/suggest/browser/suggestWidget":["Cor de fundo para a ferramenta de sugestΓ£o.","Cor da borda para a ferramenta de sugestΓ£o.","Cor de primeiro plano para a ferramenta de sugestΓ£o.","Cor de fundo da entrada selecionada da ferramenta de sugestΓ΅es.","Cor de realce da correspondΓͺncia na ferramenta de sugestΓ£o.","Ler Mais...{0}","{0}, sugestΓ£o, tem detalhes","{0}, sugestΓ£o","Ler menos... {0}","Carregando...","Nenhuma sugestΓ£o.","{0}, aceito","{0}, sugestΓ£o, tem detalhes","{0}, sugestΓ£o"],"vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode":["Alterne o uso da tecla Tab para mover o foco"],"vs/editor/contrib/wordHighlighter/common/wordHighlighter":["Cor de fundo de um sΓ­mbolo durante acesso de leitura, como ao ler uma variΓ‘vel.","Cor de fundo de um sΓ­mbolo durante acesso de escrita, como ao escrever uma variΓ‘vel."],"vs/editor/contrib/zoneWidget/browser/peekViewWidget":["Fechar"],"vs/editor/standalone/browser/inspectTokens/inspectTokens":["Developer: Inspect Tokens"],"vs/editor/standalone/browser/quickOpen/gotoLine":["Go to line {0} and character {1}","Go to line {0}","Type a line number between 1 and {0} to navigate to","Type a character between 1 and {0} to navigate to","Go to line {0}","Type a line number, followed by an optional colon and a character number to navigate to","Go to Line..."],"vs/editor/standalone/browser/quickOpen/quickCommand":["{0}, commands","Type the name of an action you want to execute","Command Palette"],"vs/editor/standalone/browser/quickOpen/quickOutline":["{0}, symbols","Type the name of an identifier you wish to navigate to","Go to Symbol...","symbols ({0})","modules ({0})","classes ({0})","interfaces ({0})","methods ({0})","functions ({0})","properties ({0})","variables ({0})","variables ({0})","constructors ({0})","calls ({0})"],"vs/editor/standalone/browser/standaloneCodeEditor":["Editor content","Press Ctrl+F1 for Accessibility Options.","Press Alt+F1 for Accessibility Options."],"vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast":["Toggle High Contrast Theme"],"vs/platform/configuration/common/configurationRegistry":["SobreposiΓ§Γ΅es da ConfiguraΓ§Γ£o PadrΓ£o","Definir que configuraΓ§Γ΅es do editor sejam substituΓ­das para idioma {0}.","Definir que configuraΓ§Γ΅es do editor sejam substituΓ­das para um idioma.","NΓ£o Γ© possΓ­vel registrar '{0}'. Isto corresponde a propriedade padrΓ£o '\\\\[.*\\\\]$' para descrever configuraΓ§Γ΅es do editor especΓ­fico de linguagem. Use a contribuiΓ§Γ£o 'configurationDefaults'.","NΓ£o Γ© possΓ­vel registrar '{0}'. Esta propriedade jΓ‘ estΓ‘ registrada."],"vs/platform/keybinding/common/abstractKeybindingService":["({0}) foi pressionado. Aguardando segunda tecla de pressionamento simultΓ’neo...","A combinaΓ§Γ£o de chave ({0}, {1}) nΓ£o Γ© um comando."],"vs/platform/message/common/message":["Fechar","Mais tarde","Cancelar"],"vs/platform/theme/common/colorRegistry":["Formato invΓ‘lido de cor. Use #RGB, #RGBA, #RRGGBB ou #RRGGBBAA","Cores usadas no workbench.","Cor de primeiro plano geral. Essa cor Γ© sΓ³ usada se nΓ£o for substituΓ­da por um componente.","Cor de primeiro plano geral para mensagens de erro. Essa cor Γ© sΓ³ usada se nΓ£o for substituΓ­da por um componente.","Cor de primeiro plano para a descriΓ§Γ£o do texto provendo informaΓ§Γ£o adicional, por exemplo para uma etiqueta.","Cor geral da borda para elementos focalizados. Essa cor Γ© usada somente se nΓ£o for substituΓ­da por um componente.","Uma borda extra em torno de elementos para separΓ‘-los dos outros de maior contraste.","Uma borda extra em torno de elementos ativos para separΓ‘-los dos outros de maior contraste.","A cor de fundo das seleΓ§Γ΅es de texto na Γ‘rea de trabalho (por exemplo, para campos de entrada ou Γ‘reas de texto). Note que isto nΓ£o se aplica a seleΓ§Γ΅es dentro do editor.","Cor para separadores de texto.","Cor de primeiro plano para links no texto.","Cor de primeiro plano para links ativos no texto.","Cor de primeiro plano para segmentos de texto prΓ©-formatados.","Cor de fundo para blocos de citaΓ§Γ΅es no texto.","Cor da borda para blocos de citaΓ§Γ΅es no texto.","Cor de fundo para blocos de cΓ³digo no texto.","Cor de sombra ferramentas como localizar/substituir dentro do editor.","Cor de fundo da caixa de entrada.","Cor de primeiro plano da caixa de entrada.","Borda da caixa de entrada.","Cor da borda das opΓ§Γ΅es ativas em campos de entrada.","Cor de primeiro plano da caixa de entrada para o texto de espaΓ§o reservado.","Cor de fundo de validaΓ§Γ£o de entrada para a severidade de informaΓ§Γ΅es.","Cor da borda de validaΓ§Γ£o de entrada para a severidade de informaΓ§Γ΅es.","Cor de fundo de validaΓ§Γ£o de entrada para avisos.","Cor da borda de validaΓ§Γ£o para a severidade de avisos.","Cor de fundo de validaΓ§Γ£o de entrada para a severidade do erro.","Cor da borda de validaΓ§Γ£o de entrada para a severidade do erro.","Cor de fundo do menu suspenso.","Cor de primeiro plano do menu suspenso.","Borda do menu suspenso.","Cor de fundo para o item focalizado de Lista/Γ‘rvore quando a lista/Γ‘rvore estΓ‘ ativa. Uma Γ‘rvore/lista de ativa tem o foco do teclado, uma inativa nΓ£o.","Cor de fundo da Lista/Γ‘rvore para o item focalizado quando a lista/Γ‘rvore estΓ‘ ativa. Uma Γ‘rvore/lista ativa tem o foco do teclado, uma inativa nΓ£o.","Cor de fundo para o item selecionado de Lista/Γ‘rvore quando a lista/Γ‘rvore estΓ‘ ativa. Uma lista/Γ‘rvore ativa tem o foco do teclado, uma inativa nΓ£o.","Cor de primeiro plano para o item selecionado de Lista/Γ‘rvore quando a lista/Γ‘rvore estΓ‘ ativa. Uma lista/Γ‘rvore ativa tem o foco do teclado, uma inativa nΓ£o.","Cor de fundo para o item selecionado de Lista/Γ‘rvore quando a lista/Γ‘rvore estΓ‘ inativa. Uma lista/Γ‘rvore ativa tem o foco do teclado, uma inativa nΓ£o.","Cor de primeiro plano para Lista/Γ‘rvore para o item selecionado quando a lista/Γ‘rvore estΓ‘ inativa. Uma Γ‘rvore/lista ativa tem o foco do teclado, um inativo nΓ£o.","Cor de fundo de Lista/Γ‘rvore quando pairando sobre itens usando o mouse.","Primeiro plano da Lista/Árvoce quando passar sobre itens usando o mouse.","Cor de fundo ao arrastar e soltar de Lista/Γ‘rvore quando movendo itens usando o mouse.","Cor de primeiro plano de Lista/Γ‘rvore de destaques de correspondΓͺncias ao pesquisar na Γ‘rvore/lista.","Seletor rΓ‘pido de cor para rΓ³tulos de agrupamento.","Seletor rΓ‘pido de cor para bordas de agrupamentos.","Cor de primeiro plano do botΓ£o.","Cor de fundo do botΓ£o.","Cor de fundo de botΓ£o quando flutuar sobre ele.","Cor de fundo do distintivo. Distintivos sΓ£o rΓ³tulos de pequenas informaΓ§Γ΅es, por exemplo, para a contagem de resultados de pesquisa.","Cor de primeiro plano do distintivo. Distintivos sΓ£o rΓ³tulos de pequenas informaΓ§Γ΅es, por exemplo, para a contagem de resultados de pesquisa.","Sombra da barra de rolagem para indicar que a visualizaΓ§Γ£o estΓ‘ sendo rolada.","Cor de fundo do controle deslizante.","Cor de fundo de controle deslizante quando estiver flutuando sobre ele.","Cor de fundo de controle deslizante quando ativo.","Cor de fundo da barra de progresso que pode ser mostrada em operaΓ§Γ΅es de execuΓ§Γ£o demorada.","Cor de plano de fundo do editor.","Cor de primeiro plano padrΓ£o do editor.","Cor de plano de fundo das ferramentas de ediΓ§Γ£o, como pesquisar/substituir.","Cor da borda das ferramentas do editor. A cor Γ© usada somente se a ferramenta escolhe ter uma borda e a cor nΓ£o Γ© substituΓ­da por uma ferramenta.","Cor de seleΓ§Γ£o do editor.","Cor do texto selecionado para alto contraste.","Cor de seleΓ§Γ£o em um editor inativo.","Cor de regiΓ΅es com o mesmo conteΓΊdo da seleΓ§Γ£o.","Cor da correspondΓͺncia de pesquisa atual.","Cor dos outros resultados de pesquisa.","Cor da faixa que limita a pesquisa.","RealΓ§ar abaixo da palavra onde Γ© mostrado item flutuante","Cor de fundo para o item flutuante do editor","Cor da borda para o item flutuante do editor.","Cor dos links ativos.","Cor de fundo para texto que foi inserido.","Cor de fundo para texto que foi removido.","Cor de contorno para o texto que foi inserido.","Cor de contorno para o texto que foi removido.","Cor de fundo de cabeΓ§alho atual em conflito de mesclagem em linha.","Cor de fundo de conteΓΊdo atual em conflito de mesclagem em linha.","Cor de fundo de cabeΓ§alho de entrada em conflito de mesclagem em linha.","Cor de fundo de conteΓΊdo de entrada em conflito de mesclagem em linha.","Ancestral comum da cor de fundo do cabeΓ§alho em conflitos de mesclagem inline.","Ancestral comum da cor de fundo do conteΓΊdo em conflitos de mesclagem inline. ","Cor da borda dos cabeΓ§alhos e separadores estΓ£o em conflito de mesclagem em linha.","Cor de fundo de rΓ©gua de visuaizaΓ§Γ£o atual em conflito de mesclagem em linha.","Cor de fundo de rΓ©gua de visuaizaΓ§Γ£o de entrada em conflito de mesclagem em linha.","Ancestral comum da cor da rΓ©gua deΒ visΓ£o geral para conflitos de mesclagem inline."]}); //# sourceMappingURL=../../../min-maps/vs/editor/editor.main.nls.pt-br.js.map
Ref12/Codex
src/Codex.Web.Monaco/node_modules/monaco-editor/min/vs/editor/editor.main.nls.pt-br.js
JavaScript
mit
26,832
jQuery(function(){ // Track downloads $('#download-master').click(function(){ _trackEvent('Downloads', 'master'); }); }); jQuery(document).ready(function($) { /* Docs scrollspy */ $('body').scrollspy({ target: '.bs-sidebar', offset: 0 }) $(window).on('load', function () { $('body').scrollspy('refresh') }) // back to top setTimeout(function () { var $sideBar = $('.bs-sidebar') $sideBar.affix({ offset: { top: function () { var offsetTop = $sideBar.offset().top var sideBarMargin = parseInt($sideBar.children(0).css('margin-top'), 10) return (this.top = offsetTop - sideBarMargin) } , bottom: function () { return (this.bottom = $('.bs-footer').outerHeight(true)) } } }) }, 100) /* Run examples */ $('.token-example-field').tokenfield(); $('#tokenfield-1').tokenfield({ autocomplete: { source: ['red','blue','green','yellow','violet','brown','purple','black','white'], delay: 100 }, showAutocompleteOnFocus: true, delimiter: [',',' ', '-', '_'] }); var engine = new Bloodhound({ local: [{value: 'red'}, {value: 'blue'}, {value: 'green'} , {value: 'yellow'}, {value: 'violet'}, {value: 'brown'}, {value: 'purple'}, {value: 'black'}, {value: 'white'}], datumTokenizer: function(d) { return Bloodhound.tokenizers.whitespace(d.value); }, queryTokenizer: Bloodhound.tokenizers.whitespace }); engine.initialize(); $('#tokenfield-typeahead').tokenfield({ typeahead: [null, { source: engine.ttAdapter() }] }); $('#tokenfield-2') .on('tokenfield:createtoken', function (e) { var data = e.attrs.value.split('|') e.attrs.value = data[1] || data[0] e.attrs.label = data[1] ? data[0] + ' (' + data[1] + ')' : data[0] }) .on('tokenfield:createdtoken', function (e) { // Über-simplistic e-mail validation var re = /\S+@\S+\.\S+/ var valid = re.test(e.attrs.value) if (!valid) { $(e.relatedTarget).addClass('invalid') } }) .on('tokenfield:edittoken', function (e) { if (e.attrs.label !== e.attrs.value) { var label = e.attrs.label.split(' (') e.attrs.value = label[0] + '|' + e.attrs.value } }) .on('tokenfield:removedtoken', function (e) { if (e.attrs.length > 1) { var values = $.map(e.attrs, function (attrs) { return attrs.value }); alert(e.attrs.length + ' tokens removed! Token values were: ' + values.join(', ')) } else { alert('Token removed! Token value was: ' + e.attrs.value) } }) .tokenfield() });
Efiware/bootstrap-tokenfield
docs-assets/js/docs.js
JavaScript
mit
2,681
package hudson.model; import hudson.model.Descriptor.FormException; import hudson.model.LoadStatistics.LoadStatisticsUpdater; import hudson.model.MultiStageTimeSeries.TimeScale; import hudson.model.Node.Mode; import hudson.model.Queue.WaitingItem; import hudson.model.labels.LabelAssignmentAction; import hudson.model.queue.SubTask; import hudson.slaves.DumbSlave; import hudson.slaves.NodeProperty; import hudson.slaves.RetentionStrategy; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; import java.io.IOException; import java.util.Collections; import static org.hamcrest.Matchers.greaterThan; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; /** * Test that a {@link Label}'s {@link LoadStatistics#queueLength} correctly * reflects the queued builds. */ public class LabelLoadStatisticsQueueLengthTest { private static final String LABEL_STRING = LabelLoadStatisticsQueueLengthTest.class .getSimpleName(); private static final String ALT_LABEL_STRING = LABEL_STRING + "alt"; private static final String PROJECT_NAME = LabelLoadStatisticsQueueLengthTest.class .getSimpleName(); private static final String PARAMETER_NAME = "parameter"; private static final Cause CAUSE = new Cause() { @Override public String getShortDescription() { return "Build caused by test."; } }; @Rule public JenkinsRule j = new JenkinsRule(); /** * Setup */ @Before public void createNodeWithLabels() throws IOException, FormException { // Node with this test's labels is required in order for the labels to // be considered valid. DumbSlave node = new DumbSlave( LabelLoadStatisticsQueueLengthTest.class.getSimpleName(), "", "", "1", Mode.NORMAL, LABEL_STRING + " " + ALT_LABEL_STRING, null, RetentionStrategy.NOOP, Collections.<NodeProperty<?>> emptyList()); j.getInstance().addNode(node); } /** * Teardown */ @After public void clearQueue() { j.getInstance().getQueue().clear(); } /** * Verify that when a {@link Label} is assigned to a queued build using a * {@link LabelAssignmentAction}, that label's * {@link LoadStatistics#queueLength} reflects the number of items in the * queue, and continues to do so if the {@link Project}'s label is changed. */ @Test public void queueLengthReflectsBuildableItemsAssignedLabel() throws Exception { final Label label = Label.get(LABEL_STRING); final Label altLabel = Label.get(ALT_LABEL_STRING); FreeStyleProject project = createTestProject(); // Before queueing the builds the rolling queue length should be 0. assertTrue( "Initially the rolling queue length for the label is 0.", label.loadStatistics.queueLength.getLatest(TimeScale.SEC10) == 0f); // Add the job to the build queue several times with an assigned label. for (int i = 0; i < 3; i++) { project.scheduleBuild(0, CAUSE, new LabelAssignmentActionImpl(), new ParametersAction(new StringParameterValue( PARAMETER_NAME, String.valueOf(i)))); } // Verify that the real queue length is 3. assertEquals("The job is queued as often as it was scheduled.", 3, j .getInstance().getQueue().getItems(project).size()); maintainQueueAndForceRunOfLoadStatisticsUpdater(project); assertEquals("The job is still queued as often as it was scheduled.", 3, j .getInstance().getQueue().getItems(project).size()); float labelQueueLength = label.loadStatistics.queueLength .getLatest(TimeScale.SEC10); assertThat("After LoadStatisticsUpdater runs, the queue length load statistic for the label is greater than 0.", labelQueueLength, greaterThan(0f)); // Assign an alternate label to the project and update the load stats. project.setAssignedLabel(altLabel); maintainQueueAndForceRunOfLoadStatisticsUpdater(project); // Verify that the queue length load stat continues to reflect the labels assigned to the items in the queue. float labelQueueLengthNew = label.loadStatistics.queueLength .getLatest(TimeScale.SEC10); assertThat("After assigning an alternate label to the job, the queue length load statistic for the " + "queued builds should not decrease.", labelQueueLengthNew, greaterThan(labelQueueLength)); } /** * Verify that when a {@link Label} is assigned to a {@link Project}, that * label's {@link LoadStatistics#queueLength} reflects the number of items * in the queue scheduled for that project, and updates if the project's * label is changed. */ @Test public void queueLengthReflectsJobsAssignedLabel() throws Exception { final Label label = Label.get(LABEL_STRING); final Label altLabel = Label.get(ALT_LABEL_STRING); FreeStyleProject project = createTestProject(); // Assign a label to the job. project.setAssignedLabel(label); // Before queueing the builds the rolling queue lengths should be 0. assertTrue( "Initially the rolling queue length for the label is 0.", label.loadStatistics.queueLength.getLatest(TimeScale.SEC10) == 0f); assertTrue( "Initially the rolling queue length for the alt label is 0.", altLabel.loadStatistics.queueLength.getLatest(TimeScale.SEC10) == 0f); // Add the job to the build queue several times. for (int i = 0; i < 3; i++) { project.scheduleBuild(0, CAUSE, new ParametersAction(new StringParameterValue( PARAMETER_NAME, String.valueOf(i)))); } // Verify that the real queue length is 3. assertEquals("The job is queued as often as it was scheduled.", 3, j .getInstance().getQueue().getItems(project).size()); maintainQueueAndForceRunOfLoadStatisticsUpdater(project); float labelQueueLength = label.loadStatistics.queueLength .getLatest(TimeScale.SEC10); assertTrue( "After LoadStatisticsUpdater runs, the queue length load statistic for the label is greater than 0.", labelQueueLength > 0f); // Assign an alternate label to the job and update the load stats. project.setAssignedLabel(altLabel); maintainQueueAndForceRunOfLoadStatisticsUpdater(project); // Verify that the queue length load stats of the labels reflect the newly project's newly assigned label. float labelQueueLengthNew = label.loadStatistics.queueLength .getLatest(TimeScale.SEC10); assertTrue( "After assigning an alternate label to the job, the queue length load statistic for the queued builds should decrease.", labelQueueLengthNew < labelQueueLength); float altLabelQueueLength = altLabel.loadStatistics.queueLength .getLatest(TimeScale.SEC10); assertTrue( "After assigning an alternate label to the job, the queue length load statistic for the alternate label should be greater than 0.", altLabelQueueLength > 0f); } private FreeStyleProject createTestProject() throws IOException { FreeStyleProject project = j.createFreeStyleProject(PROJECT_NAME); // In order to queue multiple builds of the job it needs to be // parameterised. project.addProperty(new ParametersDefinitionProperty( new StringParameterDefinition(PARAMETER_NAME, "0"))); // Prevent builds from being queued as blocked by allowing concurrent // builds. project.setConcurrentBuild(true); return project; } private void maintainQueueAndForceRunOfLoadStatisticsUpdater( FreeStyleProject project) throws InterruptedException { Queue queue = j.getInstance().getQueue(); // ensure the queued items are in the right state, i.e. buildable rather // than waiting int count = 0; while (queue.getItem(project) instanceof WaitingItem && ++count < 100) { queue.maintain(); Thread.sleep(10); } assertTrue( "After waiting there are buildable items in the build queue.", queue.getBuildableItems().size() > 0); // create a LoadStatisticsUpdater, and run it in order to update the // load stats for all the labels LoadStatisticsUpdater updater = new LoadStatisticsUpdater(); updater.doRun(); } private static class LabelAssignmentActionImpl implements LabelAssignmentAction { @Override public String getIconFileName() { return null; } @Override public String getDisplayName() { return LABEL_STRING + " LabelAssignmentAction"; } @Override public String getUrlName() { return null; } @Override public Label getAssignedLabel(SubTask p_task) { return Label.get(LABEL_STRING); } } }
NehemiahMi/jenkins
test/src/test/java/hudson/model/LabelLoadStatisticsQueueLengthTest.java
Java
mit
9,631
<?php /** * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Aws\Tests\AutoScaling\Integration; use Aws\AutoScaling\AutoScalingClient; use Aws\Ec2\Enum\InstanceType; /** * @group integration * @group example */ class AutoScaling_20110101_Test extends \Aws\Tests\IntegrationTestCase { const TEST_AMI = 'ami-49ec5a20'; const LAUNCH_NAME = 'php-integ-as-launch-config'; /** @var AutoScalingClient */ protected $autoscaling; public function setUp() { $this->autoscaling = $this->getServiceBuilder()->get('autoscaling'); } /** * CreateLaunchConfiguration * * @example Aws\AutoScaling\AutoScalingClient::createLaunchConfiguration * @example Aws\AutoScaling\AutoScalingClient::createLaunchConfiguration */ public function testCreateLaunchConfiguration() { $launchConfigName = self::LAUNCH_NAME; $client = $this->autoscaling; self::log('Create a launch configuration.'); // @begin $client->createLaunchConfiguration(array( 'LaunchConfigurationName' => $launchConfigName, 'ImageId' => self::TEST_AMI, 'InstanceType' => InstanceType::M1_SMALL, )); } /** * Iterate over the results of DescribeLaunchConfigurations * * @example Aws\AutoScaling\AutoScalingClient::describeLaunchConfigurations * @depends testCreateLaunchConfiguration */ public function testListsLaunchConfigs() { $client = $this->autoscaling; self::log('Make sure iterators work by iterating launch configurations.'); // @begin $iterator = $client->getIterator('DescribeLaunchConfigurations'); foreach ($iterator as $launchConfig) { var_export($launchConfig); } // end $iterator->rewind(); $configs = $iterator->toArray(); $this->assertGreaterThanOrEqual(1, $configs); $this->assertArrayHasKey('LaunchConfigurationName', $configs[0]); } /** * @depends testListsLaunchConfigs */ public function testHandlesErrors() { $launchConfigName = self::LAUNCH_NAME; $client = $this->autoscaling; // @begin // Create a launch configuration with error handling try { $client->createLaunchConfiguration(array( 'LaunchConfigurationName' => $launchConfigName, 'ImageId' => self::TEST_AMI, 'InstanceType' => InstanceType::M1_SMALL, )); $this->fail('An exception should have been thrown'); } catch (\Aws\AutoScaling\Exception\AutoScalingException $e) { if ($e->getCode() == 'AlreadyExists') { $this->assertInstanceOf('Aws\AutoScaling\Exception\AlreadyExistsException', $e); } else { throw $e; } } } /** * Delete a launch configuration * * @example Aws\AutoScaling\AutoScalingClient::deleteLaunchConfiguration * @depends testHandlesErrors */ public function testDeletesLaunchConfigs() { $launchConfigName = self::LAUNCH_NAME; $client = $this->autoscaling; self::log('Delete the launch configuration.'); // @begin $client->deleteLaunchConfiguration(array( 'LaunchConfigurationName' => $launchConfigName, )); } }
dapangchi/stampcircles
texigniter/vendor/aws/aws-sdk-php/tests/Aws/Tests/AutoScaling/Integration/AutoScaling_20110101_Test.php
PHP
mit
3,992
!function(e){return"object"==typeof exports&&"object"==typeof module?e(require("../lib/tern"),require("./node_resolve")):"function"==typeof define&&define.amd?define(["../lib/tern","./node_resolve"],e):void e(tern,tern)}(function(e){"use strict";e.registerPlugin("node",function(e){e.loadPlugin("node_resolve"),e.on("postReset",function(){var t=e.mod.modules,s=e.cx.definitions.node;for(var r in s)/^[a-z_]*$/.test(r)&&(t.knownModules[r]=s[r])}),e.addDefs(t)});var t={"!name":"node","!define":{events:{"!url":"https://nodejs.org/api/events.html","!doc":"Many objects in Node emit events: a net.Server emits an event each time a peer connects to it, a fs.readStream emits an event when the file is opened. All objects which emit events are instances of events.EventEmitter.",EventEmitter:{prototype:{addListener:{"!type":"fn(event: string, listener: fn())","!url":"https://nodejs.org/api/events.html#events_emitter_addlistener_eventname_listener","!doc":"Adds a listener to the end of the listeners array for the specified event."},on:{"!type":"fn(event: string, listener: fn())","!url":"https://nodejs.org/api/events.html#events_emitter_on_eventname_listener","!doc":"Adds a listener to the end of the listeners array for the specified event."},once:{"!type":"fn(event: string, listener: fn())","!url":"https://nodejs.org/api/events.html#events_emitter_once_eventname_listener","!doc":"Adds a one time listener for the event. This listener is invoked only the next time the event is fired, after which it is removed."},removeListener:{"!type":"fn(event: string, listener: fn())","!url":"https://nodejs.org/api/events.html#events_emitter_removelistener_eventname_listener","!doc":"Remove a listener from the listener array for the specified event. Caution: changes array indices in the listener array behind the listener."},removeAllListeners:{"!type":"fn(event: string)","!url":"https://nodejs.org/api/events.html#events_emitter_removealllisteners_eventname","!doc":"Removes all listeners, or those of the specified event."},setMaxListeners:{"!type":"fn(n: number)","!url":"https://nodejs.org/api/events.html#events_emitter_setmaxlisteners_n","!doc":"By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function allows that to be increased. Set to zero for unlimited."},listeners:{"!type":"fn(event: string) -> [fn()]","!url":"https://nodejs.org/api/events.html#events_emitter_listeners_eventname","!doc":"Returns an array of listeners for the specified event."},emit:{"!type":"fn(event: string)","!url":"https://nodejs.org/api/events.html#events_emitter_emit_eventname_arg1_arg2","!doc":"Execute each of the listeners in order with the supplied arguments."}},"!url":"https://nodejs.org/api/events.html#events_class_eventemitter","!doc":"To access the EventEmitter class, require('events').EventEmitter."}},stream:{"!type":"fn()",prototype:{"!proto":"events.EventEmitter.prototype",pipe:{"!type":"fn(destination: +stream.Writable, options?: ?)","!url":"https://nodejs.org/api/stream.html#stream_readable_pipe_destination_options","!doc":"Connects this readable stream to destination WriteStream. Incoming data on this stream gets written to destination. Properly manages back-pressure so that a slow destination will not be overwhelmed by a fast readable stream."}},Writable:{"!type":"fn(options?: ?)",prototype:{"!proto":"stream.prototype",write:{"!type":"fn(chunk: string|+Buffer, encoding?: string, callback?: fn()) -> bool","!url":"https://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback_1","!doc":"Writes chunk to the stream. Returns true if the data has been flushed to the underlying resource. Returns false to indicate that the buffer is full, and the data will be sent out in the future. The 'drain' event will indicate when the buffer is empty again."},cork:{"!type":"fn()","!url":"https://nodejs.org/api/stream.html#stream_writable_cork","!doc":"Forces buffering of all writes. Buffered data will be flushed either at .uncork() or at .end() call."},uncork:{"!type":"fn()","!url":"https://nodejs.org/api/stream.html#stream_writable_uncork","!doc":"Flush all data, buffered since .cork() call."},setDefaultEncoding:{"!type":"fn(encoding: string) -> bool","!url":"https://nodejs.org/api/stream.html#stream_writable_setdefaultencoding_encoding","!doc":"Sets the default encoding for a writable stream. Returns true if the encoding is valid and is set. Otherwise returns false."},end:{"!type":"fn(chunk?: string|+Buffer, encoding?: string, callback?: fn()) -> bool","!url":"https://nodejs.org/api/stream.html#stream_writable_end_chunk_encoding_callback","!doc":"Call this method to signal the end of the data being written to the stream."}},"!url":"https://nodejs.org/api/stream.html#stream_class_stream_writable","!doc":"A Writable Stream has the following methods, members, and events."},Readable:{"!type":"fn(options?: ?)",prototype:{"!proto":"stream.prototype",setEncoding:{"!type":"fn(encoding: string)","!url":"https://nodejs.org/api/stream.html#stream_readable_setencoding_encoding","!doc":"Makes the 'data' event emit a string instead of a Buffer. encoding can be 'utf8', 'utf16le' ('ucs2'), 'ascii', or 'hex'."},pause:{"!type":"fn()","!url":"https://nodejs.org/api/stream.html#stream_readable_pause","!doc":"Switches the readable stream into \"old mode\", where data is emitted using a 'data' event rather than being buffered for consumption via the read() method."},resume:{"!type":"fn()","!url":"https://nodejs.org/api/stream.html#stream_readable_resume","!doc":"Switches the readable stream into \"old mode\", where data is emitted using a 'data' event rather than being buffered for consumption via the read() method."},destroy:"fn()",unpipe:{"!type":"fn(dest?: +stream.Writable)","!url":"https://nodejs.org/api/stream.html#stream_readable_unpipe_destination","!doc":"Undo a previously established pipe(). If no destination is provided, then all previously established pipes are removed."},push:{"!type":"fn(chunk: +Buffer) -> bool","!url":"https://nodejs.org/api/stream.html#stream_readable_push_chunk","!doc":"Explicitly insert some data into the read queue. If called with null, will signal the end of the data."},unshift:{"!type":"fn(chunk: +Buffer) -> bool","!url":"https://nodejs.org/api/stream.html#stream_readable_unshift_chunk","!doc":"This is the corollary of readable.push(chunk). Rather than putting the data at the end of the read queue, it puts it at the front of the read queue."},wrap:{"!type":"fn(stream: ?) -> +stream.Readable","!url":"https://nodejs.org/api/stream.html#stream_readable_wrap_stream","!doc":"If you are using an older Node library that emits 'data' events and has a pause() method that is advisory only, then you can use the wrap() method to create a Readable stream that uses the old stream as its data source."},read:{"!type":"fn(size?: number) -> +Buffer","!url":"https://nodejs.org/api/stream.html#stream_readable_read_size_1","!doc":"Call this method to consume data once the 'readable' event is emitted."}},"!url":"https://nodejs.org/api/stream.html#stream_class_stream_readable","!doc":"A Readable Stream has the following methods, members, and events."},Duplex:{"!type":"fn(options?: ?)",prototype:{"!proto":"stream.Readable.prototype",write:"fn(chunk: +Buffer, encoding?: string, callback?: fn()) -> bool",end:"fn(chunk: +Buffer, encoding?: string, callback?: fn()) -> bool"},"!url":"https://nodejs.org/api/stream.html#stream_class_stream_duplex","!doc":'A "duplex" stream is one that is both Readable and Writable, such as a TCP socket connection.'},Transform:{"!type":"fn(options?: ?)",prototype:{"!proto":"stream.Duplex.prototype"},"!url":"https://nodejs.org/api/stream.html#stream_class_stream_transform","!doc":'A "transform" stream is a duplex stream where the output is causally connected in some way to the input, such as a zlib stream or a crypto stream.'},PassThrough:"stream.Transform","!url":"https://nodejs.org/api/stream.html#stream_stream","!doc":"A stream is an abstract interface implemented by various objects in Node. For example a request to an HTTP server is a stream, as is stdout. Streams are readable, writable, or both. All streams are instances of EventEmitter"},querystring:{"!url":"https://nodejs.org/api/querystring.html","!doc":"This module provides utilities for dealing with query strings.",stringify:{"!type":"fn(obj: ?, sep?: string, eq?: string) -> string","!url":"https://nodejs.org/api/querystring.html#querystring_querystring_stringify_obj_sep_eq","!doc":"Serialize an object to a query string. Optionally override the default separator ('&') and assignment ('=') characters."},parse:{"!type":"fn(str: string, sep?: string, eq?: string, options?: ?) -> ?","!url":"https://nodejs.org/api/querystring.html#querystring_querystring_parse_str_sep_eq_options","!doc":"Deserialize a query string to an object. Optionally override the default separator ('&') and assignment ('=') characters."},escape:{"!type":"fn(string) -> string","!url":"https://nodejs.org/api/querystring.html#querystring_querystring_escape","!doc":"The escape function used by querystring.stringify, provided so that it could be overridden if necessary."},unescape:{"!type":"fn(string) -> string","!url":"https://nodejs.org/api/querystring.html#querystring_querystring_unescape","!doc":"The unescape function used by querystring.parse, provided so that it could be overridden if necessary."}},http:{"!url":"https://nodejs.org/api/http.html","!doc":"The HTTP interfaces in Node are designed to support many features of the protocol which have been traditionally difficult to use. In particular, large, possibly chunk-encoded, messages. The interface is careful to never buffer entire requests or responses--the user is able to stream data.",STATUS_CODES:{},createServer:{"!type":"fn(listener?: fn(request: +http.IncomingMessage, response: +http.ServerResponse)) -> +http.Server","!url":"https://nodejs.org/api/http.html#http_http_createserver_requestlistener","!doc":"Returns a new web server object."},Server:{"!type":"fn()",prototype:{"!proto":"events.EventEmitter.prototype",listen:{"!type":"fn(port: number, hostname?: string, backlog?: number, callback?: fn())","!url":"https://nodejs.org/api/http.html#http_server_listen_port_hostname_backlog_callback","!doc":"Begin accepting connections on the specified port and hostname. If the hostname is omitted, the server will accept connections directed to any IPv4 address (INADDR_ANY)."},close:{"!type":"fn(callback?: ?)","!url":"https://nodejs.org/api/http.html#http_server_close_callback","!doc":"Stops the server from accepting new connections."},maxHeadersCount:{"!type":"number","!url":"https://nodejs.org/api/http.html#http_server_maxheaderscount","!doc":"Limits maximum incoming headers count, equal to 1000 by default. If set to 0 - no limit will be applied."},setTimeout:{"!type":"fn(timeout: number, callback?: fn())","!url":"https://nodejs.org/api/http.html#http_server_settimeout_msecs_callback","!doc":"Sets the timeout value for sockets, and emits a 'timeout' event on the Server object, passing the socket as an argument, if a timeout occurs."},timeout:{"!type":"number","!url":"https://nodejs.org/api/http.html#http_server_timeout","!doc":"The number of milliseconds of inactivity before a socket is presumed to have timed out."}},"!url":"https://nodejs.org/api/http.html#http_class_http_server","!doc":"Class for HTTP server objects."},ServerResponse:{"!type":"fn()",prototype:{"!proto":"stream.Writable.prototype",writeContinue:{"!type":"fn()","!url":"https://nodejs.org/api/http.html#http_response_writecontinue","!doc":"Sends a HTTP/1.1 100 Continue message to the client, indicating that the request body should be sent."},writeHead:{"!type":"fn(statusCode: number, headers?: ?)","!url":"https://nodejs.org/api/http.html#http_response_writehead_statuscode_reasonphrase_headers","!doc":"Sends a response header to the request. The status code is a 3-digit HTTP status code, like 404. The last argument, headers, are the response headers. Optionally one can give a human-readable reasonPhrase as the second argument."},setTimeout:{"!type":"fn(timeout: number, callback?: fn())","!url":"https://nodejs.org/api/http.html#http_response_settimeout_msecs_callback","!doc":"Sets the Socket's timeout value to msecs. If a callback is provided, then it is added as a listener on the 'timeout' event on the response object."},statusCode:{"!type":"number","!url":"https://nodejs.org/api/http.html#http_response_statuscode","!doc":"When using implicit headers (not calling response.writeHead() explicitly), this property controls the status code that will be sent to the client when the headers get flushed."},setHeader:{"!type":"fn(name: string, value: string)","!url":"https://nodejs.org/api/http.html#http_response_setheader_name_value","!doc":"Sets a single header value for implicit headers. If this header already exists in the to-be-sent headers, its value will be replaced. Use an array of strings here if you need to send multiple headers with the same name."},headersSent:{"!type":"bool","!url":"https://nodejs.org/api/http.html#http_response_headerssent","!doc":"Boolean (read-only). True if headers were sent, false otherwise."},sendDate:{"!type":"bool","!url":"https://nodejs.org/api/http.html#http_response_senddate","!doc":"When true, the Date header will be automatically generated and sent in the response if it is not already present in the headers. Defaults to true."},getHeader:{"!type":"fn(name: string) -> string","!url":"https://nodejs.org/api/http.html#http_response_getheader_name","!doc":"Reads out a header that's already been queued but not sent to the client. Note that the name is case insensitive. This can only be called before headers get implicitly flushed."},removeHeader:{"!type":"fn(name: string)","!url":"https://nodejs.org/api/http.html#http_response_removeheader_name","!doc":"Removes a header that's queued for implicit sending."},addTrailers:{"!type":"fn(headers: ?)","!url":"https://nodejs.org/api/http.html#http_response_addtrailers_headers","!doc":"This method adds HTTP trailing headers (a header but at the end of the message) to the response."}},"!url":"https://nodejs.org/api/http.html#http_class_http_serverresponse","!doc":"This object is created internally by a HTTP server--not by the user. It is passed as the second parameter to the 'request' event."},request:{"!type":"fn(options: ?, callback?: fn(res: +http.IncomingMessage)) -> +http.ClientRequest","!url":"https://nodejs.org/api/http.html#http_http_request_options_callback","!doc":"Node maintains several connections per server to make HTTP requests. This function allows one to transparently issue requests."},get:{"!type":"fn(options: ?, callback?: fn(res: +http.IncomingMessage)) -> +http.ClientRequest","!url":"https://nodejs.org/api/http.html#http_http_get_options_callback","!doc":"Since most requests are GET requests without bodies, Node provides this convenience method. The only difference between this method and http.request() is that it sets the method to GET and calls req.end() automatically."},globalAgent:{"!type":"+http.Agent","!url":"https://nodejs.org/api/http.html#http_http_globalagent","!doc":"Global instance of Agent which is used as the default for all http client requests."},Agent:{"!type":"fn()",prototype:{maxSockets:{"!type":"number","!url":"https://nodejs.org/api/http.html#http_agent_maxsockets","!doc":"By default set to 5. Determines how many concurrent sockets the agent can have open per host."},sockets:{"!type":"[+net.Socket]","!url":"https://nodejs.org/api/http.html#http_agent_sockets","!doc":"An object which contains arrays of sockets currently in use by the Agent. Do not modify."},requests:{"!type":"[+http.ClientRequest]","!url":"https://nodejs.org/api/http.html#http_agent_requests","!doc":"An object which contains queues of requests that have not yet been assigned to sockets. Do not modify."}},"!url":"https://nodejs.org/api/http.html#http_class_http_agent","!doc":"In node 0.5.3+ there is a new implementation of the HTTP Agent which is used for pooling sockets used in HTTP client requests."},ClientRequest:{"!type":"fn()",prototype:{"!proto":"stream.Writable.prototype",abort:{"!type":"fn()","!url":"https://nodejs.org/api/http.html#http_request_abort","!doc":"Aborts a request. (New since v0.3.8.)"},setTimeout:{"!type":"fn(timeout: number, callback?: fn())","!url":"https://nodejs.org/api/http.html#http_request_settimeout_timeout_callback","!doc":"Once a socket is assigned to this request and is connected socket.setTimeout() will be called."},setNoDelay:{"!type":"fn(noDelay?: fn())","!url":"https://nodejs.org/api/http.html#http_request_setnodelay_nodelay","!doc":"Once a socket is assigned to this request and is connected socket.setNoDelay() will be called."},setSocketKeepAlive:{"!type":"fn(enable?: bool, initialDelay?: number)","!url":"https://nodejs.org/api/http.html#http_request_setsocketkeepalive_enable_initialdelay","!doc":"Once a socket is assigned to this request and is connected socket.setKeepAlive() will be called."}},"!url":"https://nodejs.org/api/http.html#http_class_http_clientrequest","!doc":"This object is created internally and returned from http.request(). It represents an in-progress request whose header has already been queued. The header is still mutable using the setHeader(name, value), getHeader(name), removeHeader(name) API. The actual header will be sent along with the first data chunk or when closing the connection."},IncomingMessage:{"!type":"fn()",prototype:{"!proto":"stream.Readable.prototype",httpVersion:{"!type":"string","!url":"https://nodejs.org/api/http.html#http_message_httpversion","!doc":"In case of server request, the HTTP version sent by the client. In the case of client response, the HTTP version of the connected-to server. Probably either '1.1' or '1.0'."},headers:{"!type":"?","!url":"https://nodejs.org/api/http.html#http_message_headers","!doc":"The request/response headers object."},trailers:{"!type":"?","!url":"https://nodejs.org/api/http.html#http_message_trailers","!doc":"The request/response trailers object. Only populated after the 'end' event."},setTimeout:{"!type":"fn(timeout: number, callback?: fn())","!url":"https://nodejs.org/api/http.html#http_message_settimeout_msecs_callback","!doc":"Calls message.connection.setTimeout(msecs, callback)."},setEncoding:{"!type":"fn(encoding?: string)","!url":"https://nodejs.org/api/http.html#http_message_setencoding_encoding","!doc":"Set the encoding for data emitted by the 'data' event."},pause:{"!type":"fn()","!url":"https://nodejs.org/api/http.html#http_message_pause","!doc":"Pauses request/response from emitting events. Useful to throttle back a download."},resume:{"!type":"fn()","!url":"https://nodejs.org/api/http.html#http_message_resume","!doc":"Resumes a paused request/response."},method:{"!type":"string","!url":"https://nodejs.org/api/http.html#http_message_method","!doc":"Only valid for request obtained from http.Server."},url:{"!type":"string","!url":"https://nodejs.org/api/http.html#http_message_url","!doc":"Only valid for request obtained from http.Server."},statusCode:{"!type":"number","!url":"https://nodejs.org/api/http.html#http_message_statuscode","!doc":"Only valid for response obtained from http.ClientRequest."},socket:{"!type":"+net.Socket","!url":"https://nodejs.org/api/http.html#http_message_socket","!doc":"The net.Socket object associated with the connection."}},"!url":"https://nodejs.org/api/http.html#http_http_incomingmessage","!doc":"An IncomingMessage object is created by http.Server or http.ClientRequest and passed as the first argument to the 'request' and 'response' event respectively. It may be used to access response status, headers and data."}},https:{"!url":"https://nodejs.org/api/http.html","!doc":"HTTPS is the HTTP protocol over TLS/SSL. In Node this is implemented as a separate module.",Server:"http.Server",createServer:{"!type":"fn(listener?: fn(request: +http.IncomingMessage, response: +http.ServerResponse)) -> +https.Server","!url":"https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener","!doc":"Returns a new HTTPS web server object. The options is similar to tls.createServer(). The requestListener is a function which is automatically added to the 'request' event."},request:{"!type":"fn(options: ?, callback?: fn(res: +http.IncomingMessage)) -> +http.ClientRequest","!url":"https://nodejs.org/api/https.html#https_https_request_options_callback","!doc":"Makes a request to a secure web server."},get:{"!type":"fn(options: ?, callback?: fn(res: +http.IncomingMessage)) -> +http.ClientRequest","!url":"https://nodejs.org/api/https.html#https_https_get_options_callback","!doc":"Like http.get() but for HTTPS."},Agent:"http.Agent",globalAgent:"http.globalAgent"},cluster:{"!proto":"events.EventEmitter.prototype",settings:{exec:"string",args:"[string]",silent:"bool","!url":"https://nodejs.org/api/cluster.html#cluster_cluster_settings","!doc":"All settings set by the .setupMaster is stored in this settings object. This object is not supposed to be changed or set manually, by you."},Worker:{"!type":"fn()",prototype:{"!proto":"events.EventEmitter.prototype",id:{"!type":"string","!url":"https://nodejs.org/api/cluster.html#cluster_worker_id","!doc":"Each new worker is given its own unique id, this id is stored in the id."},process:{"!type":"+child_process.ChildProcess","!url":"https://nodejs.org/api/cluster.html#cluster_worker_process","!doc":"All workers are created using child_process.fork(), the returned object from this function is stored in process."},suicide:{"!type":"bool","!url":"https://nodejs.org/api/cluster.html#cluster_worker_suicide","!doc":"This property is a boolean. It is set when a worker dies after calling .kill() or immediately after calling the .disconnect() method. Until then it is undefined."},send:{"!type":"fn(message: ?, sendHandle?: ?)","!url":"https://nodejs.org/api/cluster.html#cluster_worker_send_message_sendhandle","!doc":"This function is equal to the send methods provided by child_process.fork(). In the master you should use this function to send a message to a specific worker. However in a worker you can also use process.send(message), since this is the same function."},destroy:"fn()",disconnect:{"!type":"fn()","!url":"https://nodejs.org/api/cluster.html#cluster_worker_disconnect","!doc":"When calling this function the worker will no longer accept new connections, but they will be handled by any other listening worker. Existing connection will be allowed to exit as usual. When no more connections exist, the IPC channel to the worker will close allowing it to die graceful. When the IPC channel is closed the disconnect event will emit, this is then followed by the exit event, there is emitted when the worker finally die."},kill:{"!type":"fn(signal?: string)","!url":"https://nodejs.org/api/cluster.html#cluster_worker_kill_signal_sigterm","!doc":"This function will kill the worker, and inform the master to not spawn a new worker. The boolean suicide lets you distinguish between voluntary and accidental exit."}},"!url":"https://nodejs.org/api/cluster.html#cluster_class_worker","!doc":"A Worker object contains all public information and method about a worker. In the master it can be obtained using cluster.workers. In a worker it can be obtained using cluster.worker."},isMaster:{"!type":"bool","!url":"https://nodejs.org/api/cluster.html#cluster_cluster_ismaster","!doc":"True if the process is a master. This is determined by the process.env.NODE_UNIQUE_ID. If process.env.NODE_UNIQUE_ID is undefined, then isMaster is true."},isWorker:{"!type":"bool","!url":"https://nodejs.org/api/cluster.html#cluster_cluster_isworker","!doc":"This boolean flag is true if the process is a worker forked from a master. If the process.env.NODE_UNIQUE_ID is set to a value, then isWorker is true."},setupMaster:{"!type":"fn(settings?: cluster.settings)","!url":"https://nodejs.org/api/cluster.html#cluster_cluster_setupmaster_settings","!doc":"setupMaster is used to change the default 'fork' behavior. The new settings are effective immediately and permanently, they cannot be changed later on."},fork:{"!type":"fn(env?: ?) -> +cluster.Worker","!url":"https://nodejs.org/api/cluster.html#cluster_cluster_fork_env","!doc":"Spawn a new worker process. This can only be called from the master process."},disconnect:{"!type":"fn(callback?: fn())","!url":"https://nodejs.org/api/cluster.html#cluster_cluster_disconnect_callback","!doc":"When calling this method, all workers will commit a graceful suicide. When they are disconnected all internal handlers will be closed, allowing the master process to die graceful if no other event is waiting."},worker:{"!type":"+cluster.Worker","!url":"https://nodejs.org/api/cluster.html#cluster_cluster_worker","!doc":"A reference to the current worker object. Not available in the master process."},workers:{"!type":"[+cluster.Worker]","!url":"https://nodejs.org/api/cluster.html#cluster_cluster_workers","!doc":"A hash that stores the active worker objects, keyed by id field. Makes it easy to loop through all the workers. It is only available in the master process."},"!url":"https://nodejs.org/api/cluster.html#cluster_cluster","!doc":"A single instance of Node runs in a single thread. To take advantage of multi-core systems the user will sometimes want to launch a cluster of Node processes to handle the load."},zlib:{"!url":"https://nodejs.org/api/zlib.html","!doc":"This provides bindings to Gzip/Gunzip, Deflate/Inflate, and DeflateRaw/InflateRaw classes. Each class takes the same options, and is a readable/writable Stream.",Zlib:{"!type":"fn()",prototype:{"!proto":"stream.Duplex.prototype",flush:{"!type":"fn(callback: fn())","!url":"https://nodejs.org/api/zlib.html#zlib_zlib_flush_callback","!doc":"Flush pending data. Don't call this frivolously, premature flushes negatively impact the effectiveness of the compression algorithm."},reset:{"!type":"fn()","!url":"https://nodejs.org/api/zlib.html#zlib_zlib_reset","!doc":"Reset the compressor/decompressor to factory defaults. Only applicable to the inflate and deflate algorithms."}},"!url":"https://nodejs.org/api/zlib.html#zlib_class_zlib_zlib","!doc":"Not exported by the zlib module. It is documented here because it is the base class of the compressor/decompressor classes."},deflate:{"!type":"fn(buf: +Buffer, callback: fn())","!url":"https://nodejs.org/api/zlib.html#zlib_zlib_deflate_buf_callback","!doc":"Compress a string with Deflate."},deflateRaw:{"!type":"fn(buf: +Buffer, callback: fn())","!url":"https://nodejs.org/api/zlib.html#zlib_zlib_deflateraw_buf_callback","!doc":"Compress a string with DeflateRaw."},gzip:{"!type":"fn(buf: +Buffer, callback: fn())","!url":"https://nodejs.org/api/zlib.html#zlib_zlib_gzip_buf_callback","!doc":"Compress a string with Gzip."},gunzip:{"!type":"fn(buf: +Buffer, callback: fn())","!url":"https://nodejs.org/api/zlib.html#zlib_zlib_gunzip_buf_callback","!doc":"Decompress a raw Buffer with Gunzip."},inflate:{"!type":"fn(buf: +Buffer, callback: fn())","!url":"https://nodejs.org/api/zlib.html#zlib_zlib_inflate_buf_callback","!doc":"Decompress a raw Buffer with Inflate."},inflateRaw:{"!type":"fn(buf: +Buffer, callback: fn())","!url":"https://nodejs.org/api/zlib.html#zlib_zlib_inflateraw_buf_callback","!doc":"Decompress a raw Buffer with InflateRaw."},unzip:{"!type":"fn(buf: +Buffer, callback: fn())","!url":"https://nodejs.org/api/zlib.html#zlib_zlib_unzip_buf_callback","!doc":"Decompress a raw Buffer with Unzip."},Gzip:{"!type":"fn()","!url":"https://nodejs.org/api/zlib.html#zlib_class_zlib_gzip","!doc":"Compress data using gzip.",prototype:{"!proto:":"zlib.Zlib.prototype"}},createGzip:{"!type":"fn(options: ?) -> +zlib.Zlib","!url":"https://nodejs.org/api/zlib.html#zlib_zlib_creategzip_options","!doc":"Returns a new Gzip object with an options."},Gunzip:{"!type":"fn()","!url":"https://nodejs.org/api/zlib.html#zlib_class_zlib_gunzip","!doc":"Decompress a gzip stream.",prototype:{"!proto:":"zlib.Zlib.prototype"}},createGunzip:{"!type":"fn(options: ?) -> +zlib.Gunzip","!url":"https://nodejs.org/api/zlib.html#zlib_zlib_creategunzip_options","!doc":"Returns a new Gunzip object with an options."},Deflate:{"!type":"fn()","!url":"https://nodejs.org/api/zlib.html#zlib_class_zlib_deflate","!doc":"Compress data using deflate.",prototype:{"!proto:":"zlib.Zlib.prototype"}},createDeflate:{"!type":"fn(options: ?) -> +zlib.Deflate","!url":"https://nodejs.org/api/zlib.html#zlib_zlib_createdeflate_options","!doc":"Returns a new Deflate object with an options."},Inflate:{"!type":"fn()","!url":"https://nodejs.org/api/zlib.html#zlib_class_zlib_inflate","!doc":"Decompress a deflate stream.",prototype:{"!proto:":"zlib.Zlib.prototype"}},createInflate:{"!type":"fn(options: ?) -> +zlib.Inflate","!url":"https://nodejs.org/api/zlib.html#zlib_zlib_createinflate_options","!doc":"Returns a new Inflate object with an options."},InflateRaw:{"!type":"fn()","!url":"https://nodejs.org/api/zlib.html#zlib_class_zlib_inflateraw","!doc":"Decompress a raw deflate stream.",prototype:{"!proto:":"zlib.Zlib.prototype"}},createInflateRaw:{"!type":"fn(options: ?) -> +zlib.InflateRaw","!url":"https://nodejs.org/api/zlib.html#zlib_zlib_createinflateraw_options","!doc":"Returns a new InflateRaw object with an options."},DeflateRaw:{"!type":"fn()","!url":"https://nodejs.org/api/zlib.html#zlib_class_zlib_deflateraw","!doc":"Compress data using deflate, and do not append a zlib header.",prototype:{"!proto:":"zlib.Zlib.prototype"}},createDeflateRaw:{"!type":"fn(options: ?) -> +zlib.DeflateRaw","!url":"https://nodejs.org/api/zlib.html#zlib_zlib_createdeflateraw_options","!doc":"Returns a new DeflateRaw object with an options."},Unzip:{"!type":"fn()","!url":"https://nodejs.org/api/zlib.html#zlib_class_zlib_unzip","!doc":"Decompress either a Gzip- or Deflate-compressed stream by auto-detecting the header.",prototype:{"!proto:":"zlib.Zlib.prototype"}},createUnzip:{"!type":"fn(options: ?) -> +zlib.Unzip","!url":"https://nodejs.org/api/zlib.html#zlib_zlib_createunzip_options","!doc":"Returns a new Unzip object with an options."},Z_NO_FLUSH:"number",Z_PARTIAL_FLUSH:"number",Z_SYNC_FLUSH:"number",Z_FULL_FLUSH:"number",Z_FINISH:"number",Z_BLOCK:"number",Z_TREES:"number",Z_OK:"number",Z_STREAM_END:"number",Z_NEED_DICT:"number",Z_ERRNO:"number",Z_STREAM_ERROR:"number",Z_DATA_ERROR:"number",Z_MEM_ERROR:"number",Z_BUF_ERROR:"number",Z_VERSION_ERROR:"number",Z_NO_COMPRESSION:"number",Z_BEST_SPEED:"number",Z_BEST_COMPRESSION:"number",Z_DEFAULT_COMPRESSION:"number",Z_FILTERED:"number",Z_HUFFMAN_ONLY:"number",Z_RLE:"number",Z_FIXED:"number",Z_DEFAULT_STRATEGY:"number",Z_BINARY:"number",Z_TEXT:"number",Z_ASCII:"number",Z_UNKNOWN:"number",Z_DEFLATED:"number",Z_NULL:"number"},os:{"!url":"https://nodejs.org/api/os.html","!doc":"Provides a few basic operating-system related utility functions.",tmpdir:{"!type":"fn() -> string","!url":"https://nodejs.org/api/os.html#os_os_tmpdir","!doc":"Returns the operating system's default directory for temp files."},endianness:{"!type":"fn() -> string","!url":"https://nodejs.org/api/os.html#os_os_endianness","!doc":'Returns the endianness of the CPU. Possible values are "BE" or "LE".'},hostname:{"!type":"fn() -> string","!url":"https://nodejs.org/api/os.html#os_os_hostname","!doc":"Returns the hostname of the operating system."},type:{"!type":"fn() -> string","!url":"https://nodejs.org/api/os.html#os_os_type","!doc":"Returns the operating system name."},platform:{"!type":"fn() -> string","!url":"https://nodejs.org/api/os.html#os_os_platform","!doc":"Returns the operating system platform."},arch:{"!type":"fn() -> string","!url":"https://nodejs.org/api/os.html#os_os_arch","!doc":"Returns the operating system CPU architecture."},release:{ "!type":"fn() -> string","!url":"https://nodejs.org/api/os.html#os_os_release","!doc":"Returns the operating system release."},uptime:{"!type":"fn() -> number","!url":"https://nodejs.org/api/os.html#os_os_uptime","!doc":"Returns the system uptime in seconds."},loadavg:{"!type":"fn() -> [number]","!url":"https://nodejs.org/api/os.html#os_os_loadavg","!doc":"Returns an array containing the 1, 5, and 15 minute load averages."},totalmem:{"!type":"fn() -> number","!url":"https://nodejs.org/api/os.html#os_os_totalmem","!doc":"Returns the total amount of system memory in bytes."},freemem:{"!type":"fn() -> number","!url":"https://nodejs.org/api/os.html#os_os_freemem","!doc":"Returns the amount of free system memory in bytes."},cpus:{"!type":"fn() -> [os.cpuSpec]","!url":"https://nodejs.org/api/os.html#os_os_cpus","!doc":"Returns an array of objects containing information about each CPU/core installed: model, speed (in MHz), and times (an object containing the number of milliseconds the CPU/core spent in: user, nice, sys, idle, and irq)."},networkInterfaces:{"!type":"fn() -> ?","!url":"https://nodejs.org/api/os.html#os_os_networkinterfaces","!doc":"Get a list of network interfaces."},EOL:{"!type":"string","!url":"https://nodejs.org/api/os.html#os_os_eol","!doc":"A constant defining the appropriate End-of-line marker for the operating system."}},punycode:{"!url":"https://nodejs.org/api/punycode.html","!doc":"Punycode.js is bundled with Node.js v0.6.2+. Use require('punycode') to access it. (To use it with other Node.js versions, use npm to install the punycode module first.)",decode:{"!type":"fn(string: string) -> string","!url":"https://nodejs.org/api/punycode.html#punycode_punycode_decode_string","!doc":"Converts a Punycode string of ASCII code points to a string of Unicode code points."},encode:{"!type":"fn(string: string) -> string","!url":"https://nodejs.org/api/punycode.html#punycode_punycode_encode_string","!doc":"Converts a string of Unicode code points to a Punycode string of ASCII code points."},toUnicode:{"!type":"fn(domain: string) -> string","!url":"https://nodejs.org/api/punycode.html#punycode_punycode_tounicode_domain","!doc":"Converts a Punycode string representing a domain name to Unicode. Only the Punycoded parts of the domain name will be converted, i.e. it doesn't matter if you call it on a string that has already been converted to Unicode."},toASCII:{"!type":"fn(domain: string) -> string","!url":"https://nodejs.org/api/punycode.html#punycode_punycode_toascii_domain","!doc":"Converts a Unicode string representing a domain name to Punycode. Only the non-ASCII parts of the domain name will be converted, i.e. it doesn't matter if you call it with a domain that's already in ASCII."},ucs2:{decode:{"!type":"fn(string: string) -> string","!url":"https://nodejs.org/api/punycode.html#punycode_punycode_ucs2_decode_string","!doc":"Creates an array containing the decimal code points of each Unicode character in the string. While JavaScript uses UCS-2 internally, this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16."},encode:{"!type":"fn(codePoints: [number]) -> string","!url":"https://nodejs.org/api/punycode.html#punycode_punycode_ucs2_encode_codepoints","!doc":"Creates a string based on an array of decimal code points."}},version:{"!type":"?","!url":"https://nodejs.org/api/punycode.html#punycode_punycode_version","!doc":"A string representing the current Punycode.js version number."}},repl:{"!url":"https://nodejs.org/api/repl.html","!doc":"A Read-Eval-Print-Loop (REPL) is available both as a standalone program and easily includable in other programs. The REPL provides a way to interactively run JavaScript and see the results. It can be used for debugging, testing, or just trying things out.",start:{"!type":"fn(options: ?) -> +events.EventEmitter","!url":"https://nodejs.org/api/repl.html#repl_repl_start_options","!doc":"Returns and starts a REPLServer instance."}},readline:{"!url":"https://nodejs.org/api/readline.html","!doc":"Readline allows reading of a stream (such as process.stdin) on a line-by-line basis.",createInterface:{"!type":"fn(options: ?) -> +readline.Interface","!url":"https://nodejs.org/api/readline.html#readline_readline_createinterface_options","!doc":"Creates a readline Interface instance."},Interface:{"!type":"fn()",prototype:{"!proto":"events.EventEmitter.prototype",setPrompt:{"!type":"fn(prompt: string, length: number)","!url":"https://nodejs.org/api/readline.html#readline_rl_setprompt_prompt_length","!doc":"Sets the prompt, for example when you run node on the command line, you see > , which is node's prompt."},prompt:{"!type":"fn(preserveCursor?: bool)","!url":"https://nodejs.org/api/readline.html#readline_rl_prompt_preservecursor","!doc":"Readies readline for input from the user, putting the current setPrompt options on a new line, giving the user a new spot to write. Set preserveCursor to true to prevent the cursor placement being reset to 0."},question:{"!type":"fn(query: string, callback: fn())","!url":"https://nodejs.org/api/readline.html#readline_rl_question_query_callback","!doc":"Prepends the prompt with query and invokes callback with the user's response. Displays the query to the user, and then invokes callback with the user's response after it has been typed."},pause:{"!type":"fn()","!url":"https://nodejs.org/api/readline.html#readline_rl_pause","!doc":"Pauses the readline input stream, allowing it to be resumed later if needed."},resume:{"!type":"fn()","!url":"https://nodejs.org/api/readline.html#readline_rl_resume","!doc":"Resumes the readline input stream."},close:{"!type":"fn()","!url":"https://nodejs.org/api/readline.html#readline_rl_close","!doc":'Closes the Interface instance, relinquishing control on the input and output streams. The "close" event will also be emitted.'},write:{"!type":"fn(data: ?, key?: ?)","!url":"https://nodejs.org/api/readline.html#readline_rl_write_data_key","!doc":"Writes data to output stream. key is an object literal to represent a key sequence; available if the terminal is a TTY."}},"!url":"https://nodejs.org/api/readline.html#readline_class_interface","!doc":"The class that represents a readline interface with an input and output stream."}},vm:{"!url":"https://nodejs.org/api/vm.html","!doc":"JavaScript code can be compiled and run immediately or compiled, saved, and run later.",createContext:{"!type":"fn(initSandbox?: ?) -> ?","!url":"https://nodejs.org/api/vm.html#vm_vm_createcontext_initsandbox","!doc":"vm.createContext creates a new context which is suitable for use as the 2nd argument of a subsequent call to vm.runInContext. A (V8) context comprises a global object together with a set of build-in objects and functions. The optional argument initSandbox will be shallow-copied to seed the initial contents of the global object used by the context."},Script:{"!type":"fn()",prototype:{runInThisContext:{"!type":"fn()","!url":"https://nodejs.org/api/vm.html#vm_script_runinthiscontext","!doc":"Similar to vm.runInThisContext but a method of a precompiled Script object. script.runInThisContext runs the code of script and returns the result. Running code does not have access to local scope, but does have access to the global object (v8: in actual context)."},runInNewContext:{"!type":"fn(sandbox?: ?)","!url":"https://nodejs.org/api/vm.html#vm_script_runinnewcontext_sandbox","!doc":"Similar to vm.runInNewContext a method of a precompiled Script object. script.runInNewContext runs the code of script with sandbox as the global object and returns the result. Running code does not have access to local scope. sandbox is optional."}},"!url":"https://nodejs.org/api/vm.html#vm_class_script","!doc":"A class for running scripts. Returned by vm.createScript."},runInThisContext:{"!type":"fn(code: string, filename?: string)","!url":"https://nodejs.org/api/vm.html#vm_vm_runinthiscontext_code_filename","!doc":"vm.runInThisContext() compiles code, runs it and returns the result. Running code does not have access to local scope. filename is optional, it's used only in stack traces."},runInNewContext:{"!type":"fn(code: string, sandbox?: ?, filename?: string)","!url":"https://nodejs.org/api/vm.html#vm_vm_runinnewcontext_code_sandbox_filename","!doc":"vm.runInNewContext compiles code, then runs it in sandbox and returns the result. Running code does not have access to local scope. The object sandbox will be used as the global object for code. sandbox and filename are optional, filename is only used in stack traces."},runInContext:{"!type":"fn(code: string, context: ?, filename?: string)","!url":"https://nodejs.org/api/vm.html#vm_vm_runincontext_code_context_filename","!doc":"vm.runInContext compiles code, then runs it in context and returns the result. A (V8) context comprises a global object, together with a set of built-in objects and functions. Running code does not have access to local scope and the global object held within context will be used as the global object for code. filename is optional, it's used only in stack traces."},createScript:{"!type":"fn(code: string, filename?: string) -> +vm.Script","!url":"https://nodejs.org/api/vm.html#vm_vm_createscript_code_filename","!doc":"createScript compiles code but does not run it. Instead, it returns a vm.Script object representing this compiled code. This script can be run later many times using methods below. The returned script is not bound to any global object. It is bound before each run, just for that run. filename is optional, it's only used in stack traces."}},child_process:{"!url":"https://nodejs.org/api/child_process.html","!doc":"Node provides a tri-directional popen(3) facility through the child_process module.",ChildProcess:{"!type":"fn()",prototype:{"!proto":"events.EventEmitter.prototype",stdin:{"!type":"+stream.Writable","!url":"https://nodejs.org/api/child_process.html#child_process_child_stdin","!doc":"A Writable Stream that represents the child process's stdin. Closing this stream via end() often causes the child process to terminate."},stdout:{"!type":"+stream.Readable","!url":"https://nodejs.org/api/child_process.html#child_process_child_stdout","!doc":"A Readable Stream that represents the child process's stdout."},stderr:{"!type":"+stream.Readable","!url":"https://nodejs.org/api/child_process.html#child_process_child_stderr","!doc":"A Readable Stream that represents the child process's stderr."},pid:{"!type":"number","!url":"https://nodejs.org/api/child_process.html#child_process_child_pid","!doc":"The PID of the child process."},kill:{"!type":"fn(signal?: string)","!url":"https://nodejs.org/api/child_process.html#child_process_child_kill_signal","!doc":"Send a signal to the child process. If no argument is given, the process will be sent 'SIGTERM'."},send:{"!type":"fn(message: ?, sendHandle?: ?)","!url":"https://nodejs.org/api/child_process.html#child_process_child_send_message_sendhandle","!doc":"When using child_process.fork() you can write to the child using child.send(message, [sendHandle]) and messages are received by a 'message' event on the child."},disconnect:{"!type":"fn()","!url":"https://nodejs.org/api/child_process.html#child_process_child_disconnect","!doc":"To close the IPC connection between parent and child use the child.disconnect() method. This allows the child to exit gracefully since there is no IPC channel keeping it alive. When calling this method the disconnect event will be emitted in both parent and child, and the connected flag will be set to false. Please note that you can also call process.disconnect() in the child process."}},"!url":"https://nodejs.org/api/child_process.html#child_process_class_childprocess","!doc":"ChildProcess is an EventEmitter."},spawn:{"!type":"fn(command: string, args?: [string], options?: ?) -> +child_process.ChildProcess","!url":"https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options","!doc":"Launches a new process with the given command, with command line arguments in args. If omitted, args defaults to an empty Array."},exec:{"!type":"fn(command: string, callback: fn(error: ?, stdout: +Buffer, stderr: +Buffer)) -> +child_process.ChildProcess","!url":"https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback","!doc":"Runs a command in a shell and buffers the output."},execFile:{"!type":"fn(file: string, args: [string], options: ?, callback: fn(error: ?, stdout: +Buffer, stderr: +Buffer)) -> +child_process.ChildProcess","!url":"https://nodejs.org/api/child_process.html#child_process_child_process_execfile_file_args_options_callback","!doc":"This is similar to child_process.exec() except it does not execute a subshell but rather the specified file directly. This makes it slightly leaner than child_process.exec. It has the same options."},fork:{"!type":"fn(modulePath: string, args?: [string], options?: ?) -> +child_process.ChildProcess","!url":"https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options","!doc":"This is a special case of the spawn() functionality for spawning Node processes. In addition to having all the methods in a normal ChildProcess instance, the returned object has a communication channel built-in."}},url:{"!url":"https://nodejs.org/api/url.html","!doc":"This module has utilities for URL resolution and parsing. ",parse:{"!type":"fn(urlStr: string, parseQueryString?: bool, slashesDenoteHost?: bool) -> url.type","!url":"https://nodejs.org/api/url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost","!doc":"Take a URL string, and return an object."},format:{"!type":"fn(url: url.type) -> string","!url":"https://nodejs.org/api/url.html#url_url_format_urlobj","!doc":"Take a parsed URL object, and return a formatted URL string."},resolve:{"!type":"fn(from: string, to: string) -> string","!url":"https://nodejs.org/api/url.html#url_url_resolve_from_to","!doc":"Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag."}},dns:{"!url":"https://nodejs.org/api/dns.html","!doc":"This module contains functions that belong to two different categories:\n1) Functions that use the underlying operating system facilities to perform name resolution, and that do not necessarily do any network communication.\n2) Functions that connect to an actual DNS server to perform name resolution, and that always use the network to perform DNS queries.",lookup:{"!type":"fn(domain: string, callback: fn(err: +Error, address: string, family: number)) -> string","!url":"https://nodejs.org/api/dns.html#dns_dns_lookup_domain_family_callback","!doc":"Resolves a domain (e.g. 'google.com') into the first found A (IPv4) or AAAA (IPv6) record. The family can be the integer 4 or 6. Defaults to null that indicates both Ip v4 and v6 address family."},resolve:{"!type":"fn(domain: string, callback: fn(err: +Error, addresses: [string])) -> [string]","!url":"https://nodejs.org/api/dns.html#dns_dns_resolve_domain_rrtype_callback","!doc":"Resolves a domain (e.g. 'google.com') into an array of the record types specified by rrtype. Valid rrtypes are 'A' (IPV4 addresses, default), 'AAAA' (IPV6 addresses), 'MX' (mail exchange records), 'TXT' (text records), 'SRV' (SRV records), 'PTR' (used for reverse IP lookups), 'NS' (name server records) and 'CNAME' (canonical name records)."},resolve4:{"!type":"fn(domain: string, callback: fn(err: +Error, addresses: [string])) -> [string]","!url":"https://nodejs.org/api/dns.html#dns_dns_resolve4_domain_callback","!doc":"The same as dns.resolve(), but only for IPv4 queries (A records). addresses is an array of IPv4 addresses (e.g. ['74.125.79.104', '74.125.79.105', '74.125.79.106'])."},resolve6:{"!type":"fn(domain: string, callback: fn(err: +Error, addresses: [string])) -> [string]","!url":"https://nodejs.org/api/dns.html#dns_dns_resolve6_domain_callback","!doc":"The same as dns.resolve4() except for IPv6 queries (an AAAA query)."},resolveMx:{"!type":"fn(domain: string, callback: fn(err: +Error, addresses: [string])) -> [string]","!url":"https://nodejs.org/api/dns.html#dns_dns_resolvemx_domain_callback","!doc":"The same as dns.resolve(), but only for mail exchange queries (MX records)."},resolveTxt:{"!type":"fn(domain: string, callback: fn(err: +Error, addresses: [string])) -> [string]","!url":"https://nodejs.org/api/dns.html#dns_dns_resolvetxt_domain_callback","!doc":"The same as dns.resolve(), but only for text queries (TXT records). addresses is an array of the text records available for domain (e.g., ['v=spf1 ip4:0.0.0.0 ~all'])."},resolveSrv:{"!type":"fn(domain: string, callback: fn(err: +Error, addresses: [string])) -> [string]","!url":"https://nodejs.org/api/dns.html#dns_dns_resolvesrv_domain_callback","!doc":"The same as dns.resolve(), but only for service records (SRV records). addresses is an array of the SRV records available for domain. Properties of SRV records are priority, weight, port, and name (e.g., [{'priority': 10, {'weight': 5, 'port': 21223, 'name': 'service.example.com'}, ...])."},resolveNs:{"!type":"fn(domain: string, callback: fn(err: +Error, addresses: [string])) -> [string]","!url":"https://nodejs.org/api/dns.html#dns_dns_resolvens_domain_callback","!doc":"The same as dns.resolve(), but only for name server records (NS records). addresses is an array of the name server records available for domain (e.g., ['ns1.example.com', 'ns2.example.com'])."},resolveCname:{"!type":"fn(domain: string, callback: fn(err: +Error, addresses: [string])) -> [string]","!url":"https://nodejs.org/api/dns.html#dns_dns_resolvecname_domain_callback","!doc":"The same as dns.resolve(), but only for canonical name records (CNAME records). addresses is an array of the canonical name records available for domain (e.g., ['bar.example.com'])."},reverse:{"!type":"fn(ip: string, callback: fn(err: +Error, domains: [string])) -> [string]","!url":"https://nodejs.org/api/dns.html#dns_dns_reverse_ip_callback","!doc":"Reverse resolves an ip address to an array of domain names."}},net:{"!url":"https://nodejs.org/api/net.html","!doc":"The net module provides you with an asynchronous network wrapper. It contains methods for creating both servers and clients (called streams).",createServer:{"!type":"fn(options?: ?, connectionListener?: fn(socket: +net.Socket)) -> +net.Server","!url":"https://nodejs.org/api/net.html#net_net_createserver_options_connectionlistener","!doc":"Creates a new TCP server. The connectionListener argument is automatically set as a listener for the 'connection' event."},Server:{"!type":"fn()",prototype:{"!proto":"net.Socket.prototype",listen:{"!type":"fn(port: number, hostname?: string, backlog?: number, callback?: fn())","!url":"https://nodejs.org/api/net.html#net_server_listen_port_host_backlog_callback","!doc":"Begin accepting connections on the specified port and host. If the host is omitted, the server will accept connections directed to any IPv4 address (INADDR_ANY). A port value of zero will assign a random port."},close:{"!type":"fn(callback?: fn())","!url":"https://nodejs.org/api/net.html#net_server_close_callback","!doc":"Stops the server from accepting new connections and keeps existing connections. This function is asynchronous, the server is finally closed when all connections are ended and the server emits a 'close' event. Optionally, you can pass a callback to listen for the 'close' event."},maxConnections:{"!type":"number","!url":"https://nodejs.org/api/net.html#net_server_maxconnections","!doc":"Set this property to reject connections when the server's connection count gets high."},getConnections:{"!type":"fn(callback: fn(err: +Error, count: number))","!url":"https://nodejs.org/api/net.html#net_server_getconnections_callback","!doc":"Asynchronously get the number of concurrent connections on the server. Works when sockets were sent to forks."}},"!url":"https://nodejs.org/api/net.html#net_class_net_server","!doc":"This class is used to create a TCP or UNIX server. A server is a net.Socket that can listen for new incoming connections."},Socket:{"!type":"fn(options: ?)",prototype:{"!proto":"events.EventEmitter.prototype",connect:{"!type":"fn(port: number, host?: string, connectionListener?: fn())","!url":"https://nodejs.org/api/net.html#net_socket_connect_port_host_connectlistener","!doc":"Opens the connection for a given socket. If port and host are given, then the socket will be opened as a TCP socket, if host is omitted, localhost will be assumed. If a path is given, the socket will be opened as a unix socket to that path."},bufferSize:{"!type":"number","!url":"https://nodejs.org/api/net.html#net_socket_buffersize","!doc":"net.Socket has the property that socket.write() always works. This is to help users get up and running quickly. The computer cannot always keep up with the amount of data that is written to a socket - the network connection simply might be too slow. Node will internally queue up the data written to a socket and send it out over the wire when it is possible. (Internally it is polling on the socket's file descriptor for being writable)."},setEncoding:{"!type":"fn(encoding?: string)","!url":"https://nodejs.org/api/net.html#net_socket_setencoding_encoding","!doc":"Set the encoding for the socket as a Readable Stream."},write:{"!type":"fn(data: +Buffer, encoding?: string, callback?: fn())","!url":"https://nodejs.org/api/net.html#net_socket_write_data_encoding_callback","!doc":"Sends data on the socket. The second parameter specifies the encoding in the case of a string--it defaults to UTF8 encoding."},end:{"!type":"fn(data?: +Buffer, encoding?: string)","!url":"https://nodejs.org/api/net.html#net_socket_end_data_encoding","!doc":"Half-closes the socket. i.e., it sends a FIN packet. It is possible the server will still send some data."},destroy:{"!type":"fn()","!url":"https://nodejs.org/api/net.html#net_socket_destroy","!doc":"Ensures that no more I/O activity happens on this socket. Only necessary in case of errors (parse error or so)."},pause:{"!type":"fn()","!url":"https://nodejs.org/api/net.html#net_socket_pause","!doc":"Pauses the reading of data. That is, 'data' events will not be emitted. Useful to throttle back an upload."},resume:{"!type":"fn()","!url":"https://nodejs.org/api/net.html#net_socket_resume","!doc":"Resumes reading after a call to pause()."},setTimeout:{"!type":"fn(timeout: number, callback?: fn())","!url":"https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback","!doc":"Sets the socket to timeout after timeout milliseconds of inactivity on the socket. By default net.Socket do not have a timeout."},setKeepAlive:{"!type":"fn(enable?: bool, initialDelay?: number)","!url":"https://nodejs.org/api/net.html#net_socket_setkeepalive_enable_initialdelay","!doc":"Enable/disable keep-alive functionality, and optionally set the initial delay before the first keepalive probe is sent on an idle socket. enable defaults to false."},address:{"!type":"fn() -> net.address","!url":"https://nodejs.org/api/net.html#net_socket_address","!doc":"Returns the bound address, the address family name and port of the socket as reported by the operating system. Returns an object with three properties, e.g. { port: 12346, family: 'IPv4', address: '127.0.0.1' }"},unref:{"!type":"fn()","!url":"https://nodejs.org/api/net.html#net_socket_unref","!doc":"Calling unref on a socket will allow the program to exit if this is the only active socket in the event system. If the socket is already unrefd calling unref again will have no effect."},ref:{"!type":"fn()","!url":"https://nodejs.org/api/net.html#net_socket_ref","!doc":"Opposite of unref, calling ref on a previously unrefd socket will not let the program exit if it's the only socket left (the default behavior). If the socket is refd calling ref again will have no effect."},remoteAddress:{"!type":"string","!url":"https://nodejs.org/api/net.html#net_socket_remoteaddress","!doc":"The string representation of the remote IP address. For example, '74.125.127.100' or '2001:4860:a005::68'."},remotePort:{"!type":"number","!url":"https://nodejs.org/api/net.html#net_socket_remoteport","!doc":"The numeric representation of the remote port. For example, 80 or 21."},localPort:{"!type":"number","!url":"https://nodejs.org/api/net.html#net_socket_localport","!doc":"The numeric representation of the local port. For example, 80 or 21."},bytesRead:{"!type":"number","!url":"https://nodejs.org/api/net.html#net_socket_bytesread","!doc":"The amount of received bytes."},bytesWritten:{"!type":"number","!url":"https://nodejs.org/api/net.html#net_socket_byteswritten","!doc":"The amount of bytes sent."},setNoDelay:{"!type":"fn(noDelay?: fn())","!url":"https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay","!doc":"Disables the Nagle algorithm. By default TCP connections use the Nagle algorithm, they buffer data before sending it off. Setting true for noDelay will immediately fire off data each time socket.write() is called. noDelay defaults to true."},localAddress:{"!type":"string","!url":"https://nodejs.org/api/net.html#net_socket_localaddress","!doc":"The string representation of the local IP address the remote client is connecting on. For example, if you are listening on '0.0.0.0' and the client connects on '192.168.1.1', the value would be '192.168.1.1'."}},"!url":"https://nodejs.org/api/net.html#net_class_net_socket","!doc":"This object is an abstraction of a TCP or UNIX socket. net.Socket instances implement a duplex Stream interface. They can be created by the user and used as a client (with connect()) or they can be created by Node and passed to the user through the 'connection' event of a server."},connect:{"!type":"fn(options: ?, connectionListener?: fn()) -> +net.Socket","!url":"https://nodejs.org/api/net.html#net_net_connect_options_connectionlistener","!doc":"Constructs a new socket object and opens the socket to the given location. When the socket is established, the 'connect' event will be emitted."},createConnection:{"!type":"fn(options: ?, connectionListener?: fn()) -> +net.Socket","!url":"https://nodejs.org/api/net.html#net_net_createconnection_options_connectionlistener","!doc":"Constructs a new socket object and opens the socket to the given location. When the socket is established, the 'connect' event will be emitted."},isIP:{"!type":"fn(input: string) -> number","!url":"https://nodejs.org/api/net.html#net_net_isip_input","!doc":"Tests if input is an IP address. Returns 0 for invalid strings, returns 4 for IP version 4 addresses, and returns 6 for IP version 6 addresses."},isIPv4:{"!type":"fn(input: string) -> bool","!url":"https://nodejs.org/api/net.html#net_net_isipv4_input","!doc":"Returns true if input is a version 4 IP address, otherwise returns false."},isIPv6:{"!type":"fn(input: string) -> bool","!url":"https://nodejs.org/api/net.html#net_net_isipv6_input","!doc":"Returns true if input is a version 6 IP address, otherwise returns false."}},dgram:{"!url":"https://nodejs.org/api/dgram.html","!doc":"UDP / Datagram Sockets",createSocket:{"!type":"fn(type: string, callback?: fn()) -> +dgram.Socket","!url":"https://nodejs.org/api/dgram.html#dgram_dgram_createsocket_type_callback","!doc":"Creates a datagram Socket of the specified types. Valid types are udp4 and udp6."},Socket:{"!type":"fn()",prototype:{"!proto":"events.EventEmitter.prototype",send:{"!type":"fn(buf: +Buffer, offset: number, length: number, port: number, address: string, callback?: fn())","!url":"https://nodejs.org/api/dgram.html#dgram_socket_send_buf_offset_length_port_address_callback","!doc":"For UDP sockets, the destination port and IP address must be specified. A string may be supplied for the address parameter, and it will be resolved with DNS. An optional callback may be specified to detect any DNS errors and when buf may be re-used. Note that DNS lookups will delay the time that a send takes place, at least until the next tick. The only way to know for sure that a send has taken place is to use the callback."},bind:{"!type":"fn(port: number, address?: string)","!url":"https://nodejs.org/api/dgram.html#dgram_socket_bind_port_address_callback","!doc":"For UDP sockets, listen for datagrams on a named port and optional address. If address is not specified, the OS will try to listen on all addresses."},close:{"!type":"fn()","!url":"https://nodejs.org/api/dgram.html#dgram_socket_close","!doc":"Close the underlying socket and stop listening for data on it."},address:{address:"string",family:"string",port:"number","!url":"https://nodejs.org/api/dgram.html#dgram_socket_address","!doc":"Returns an object containing the address information for a socket. For UDP sockets, this object will contain address , family and port."},setBroadcast:{"!type":"fn(flag: bool)","!url":"https://nodejs.org/api/dgram.html#dgram_socket_setbroadcast_flag","!doc":"Sets or clears the SO_BROADCAST socket option. When this option is set, UDP packets may be sent to a local interface's broadcast address."},setTTL:{"!type":"fn(ttl: number)","!url":"https://nodejs.org/api/dgram.html#dgram_socket_setttl_ttl","!doc":'Sets the IP_TTL socket option. TTL stands for "Time to Live," but in this context it specifies the number of IP hops that a packet is allowed to go through. Each router or gateway that forwards a packet decrements the TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. Changing TTL values is typically done for network probes or when multicasting.'},setMulticastTTL:{"!type":"fn(ttl: number)","!url":"https://nodejs.org/api/dgram.html#dgram_socket_setmulticastttl_ttl","!doc":'Sets the IP_MULTICAST_TTL socket option. TTL stands for "Time to Live," but in this context it specifies the number of IP hops that a packet is allowed to go through, specifically for multicast traffic. Each router or gateway that forwards a packet decrements the TTL. If the TTL is decremented to 0 by a router, it will not be forwarded.'},setMulticastLoopback:{"!type":"fn(flag: bool)","!url":"https://nodejs.org/api/dgram.html#dgram_socket_setmulticastloopback_flag","!doc":"Sets or clears the IP_MULTICAST_LOOP socket option. When this option is set, multicast packets will also be received on the local interface."},addMembership:{"!type":"fn(multicastAddress: string, multicastInterface?: string)","!url":"https://nodejs.org/api/dgram.html#dgram_socket_addmembership_multicastaddress_multicastinterface","!doc":"Tells the kernel to join a multicast group with IP_ADD_MEMBERSHIP socket option."},dropMembership:{"!type":"fn(multicastAddress: string, multicastInterface?: string)","!url":"https://nodejs.org/api/dgram.html#dgram_socket_dropmembership_multicastaddress_multicastinterface","!doc":"Opposite of addMembership - tells the kernel to leave a multicast group with IP_DROP_MEMBERSHIP socket option. This is automatically called by the kernel when the socket is closed or process terminates, so most apps will never need to call this."}},"!url":"https://nodejs.org/api/dgram.html#dgram_class_dgram_socket","!doc":"The dgram Socket class encapsulates the datagram functionality. It should be created via dgram.createSocket(type, [callback])."}},fs:{"!url":"https://nodejs.org/api/fs.html","!doc":"File I/O is provided by simple wrappers around standard POSIX functions. To use this module do require('fs'). All the methods have asynchronous and synchronous forms.",access:{"!type":"fn(path: string|+Buffer, mode?: number, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_access_path_mode_callback","!doc":"Tests a user's permissions for the file or directory specified by path. The mode argument is an optional integer that specifies the accessibility checks to be performed. The following constants define the possible values of mode. It is possible to create a mask consisting of the bitwise OR of two or more values."},accessSync:{"!type":"fn(path: string|+Buffer, mode?: number)", "!url":"https://nodejs.org/api/fs.html#fs_fs_accesssync_path_mode","!doc":"Synchronous version of fs.access(). This throws if any accessibility checks fail, and does nothing otherwise."},appendFile:{"!type":"fn(file: string|+Buffer|number, data: string|+Buffer, options?: ?, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_appendfile_file_data_options_callback","!doc":"Asynchronously append data to a file, creating the file if it does not yet exist. data can be a string or a buffer."},appendFileSync:{"!type":"fn(file: string|+Buffer|number, data: string|+Buffer, options?: ?)","!url":"https://nodejs.org/api/fs.html#fs_fs_appendfilesync_file_data_options","!doc":"The synchronous version of fs.appendFile(). Returns undefined."},chmod:{"!type":"fn(path: string|+Buffer, mode: number, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_chmod_path_mode_callback","!doc":"Asynchronous chmod(2). No arguments other than a possible exception are given to the completion callback."},chmodSync:{"!type":"fn(path: string|+Buffer, mode: number)","!url":"https://nodejs.org/api/fs.html#fs_fs_chmodsync_path_mode","!doc":"Synchronous chmod(2). Returns undefined."},chown:{"!type":"fn(path: string|+Buffer, uid: number, gid: number, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_chown_path_uid_gid_callback","!doc":"Asynchronous chown(2). No arguments other than a possible exception are given to the completion callback."},chownSync:{"!type":"fn(path: string|+Buffer, uid: number, gid: number)","!url":"https://nodejs.org/api/fs.html#fs_fs_chownsync_path_uid_gid","!doc":"Synchronous chown(2). Returns undefined."},close:{"!type":"fn(fd: number, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_close_fd_callback","!doc":"Asynchronous close(2). No arguments other than a possible exception are given to the completion callback."},closeSync:{"!type":"fn(fd: number)","!url":"https://nodejs.org/api/fs.html#fs_fs_closesync_fd","!doc":"Synchronous close(2). Returns undefined."},createReadStream:{"!type":"fn(path: string|+Buffer, options?: ?) -> +fs.ReadStream","!url":"https://nodejs.org/api/fs.html#fs_fs_createreadstream_path_options","!doc":"Returns a new ReadStream object. (See Readable Stream)."},createWriteStream:{"!type":"fn(path: string|+Buffer, options?: ?) -> +fs.WriteStream","!url":"https://nodejs.org/api/fs.html#fs_fs_createwritestream_path_options","!doc":"Returns a new WriteStream object. (See Writable Stream)."},exists:{"!type":"fn(path: string|+Buffer, callback: fn(exists: bool))","!url":"https://nodejs.org/api/fs.html#fs_fs_exists_path_callback","!doc":"Test whether or not the given path exists by checking with the file system. Then call the callback argument with either true or false. Example:"},existsSync:{"!type":"fn(path: string|+Buffer) -> bool","!url":"https://nodejs.org/api/fs.html#fs_fs_existssync_path","!doc":"Stability: 0 - Deprecated: Use fs.statSync() or fs.accessSync() instead."},fchmod:{"!type":"fn(fd: number, mode: number, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_fchmod_fd_mode_callback","!doc":"Asynchronous fchmod(2). No arguments other than a possible exception are given to the completion callback."},fchmodSync:{"!type":"fn(fd: number, mode: number)","!url":"https://nodejs.org/api/fs.html#fs_fs_fchmodsync_fd_mode","!doc":"Synchronous fchmod(2). Returns undefined."},fchown:{"!type":"fn(fd: number, uid: number, gid: number, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_fchown_fd_uid_gid_callback","!doc":"Asynchronous fchown(2). No arguments other than a possible exception are given to the completion callback."},fchownSync:{"!type":"fn(fd: number, uid: number, gid: number)","!url":"https://nodejs.org/api/fs.html#fs_fs_fchownsync_fd_uid_gid","!doc":"Synchronous fchown(2). Returns undefined."},fdatasync:{"!type":"fn(fd: number, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_fdatasync_fd_callback","!doc":"Asynchronous fdatasync(2). No arguments other than a possible exception are given to the completion callback."},fdatasyncSync:{"!type":"fn(fd: number)","!url":"https://nodejs.org/api/fs.html#fs_fs_fdatasyncsync_fd","!doc":"Synchronous fdatasync(2). Returns undefined."},fstat:{"!type":"fn(fd: number, callback: fn(err: +Error, stats: +fs.Stats))","!url":"https://nodejs.org/api/fs.html#fs_fs_fstat_fd_callback","!doc":"Asynchronous fstat(2). The callback gets two arguments (err, stats) where stats is a fs.Stats object. fstat() is identical to stat(), except that the file to be stat-ed is specified by the file descriptor fd."},fstatSync:{"!type":"fn(fd: number) -> +fs.Stats","!url":"https://nodejs.org/api/fs.html#fs_fs_fstatsync_fd","!doc":"Synchronous fstat(2). Returns an instance of fs.Stats."},fsync:{"!type":"fn(fd: number, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_fsync_fd_callback","!doc":"Asynchronous fsync(2). No arguments other than a possible exception are given to the completion callback."},fsyncSync:{"!type":"fn(fd: number)","!url":"https://nodejs.org/api/fs.html#fs_fs_fsyncsync_fd","!doc":"Synchronous fsync(2). Returns undefined."},ftruncate:{"!type":"fn(fd: number, len: number, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_ftruncate_fd_len_callback","!doc":"Asynchronous ftruncate(2). No arguments other than a possible exception are given to the completion callback."},ftruncateSync:{"!type":"fn(fd: number, len: number)","!url":"https://nodejs.org/api/fs.html#fs_fs_ftruncatesync_fd_len","!doc":"Synchronous ftruncate(2). Returns undefined."},futimes:{"!type":"fn(fd: number, atime: number, mtime: number, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_futimes_fd_atime_mtime_callback","!doc":"Change the file timestamps of a file referenced by the supplied file descriptor."},futimesSync:{"!type":"fn(fd: number, atime: number, mtime: number)","!url":"https://nodejs.org/api/fs.html#fs_fs_futimessync_fd_atime_mtime","!doc":"Synchronous version of fs.futimes(). Returns undefined."},lchmod:{"!type":"fn(path: string|+Buffer, mode: number, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_lchmod_path_mode_callback","!doc":"Asynchronous lchmod(2). No arguments other than a possible exception are given to the completion callback."},lchmodSync:{"!type":"fn(path: string|+Buffer, mode: number)","!url":"https://nodejs.org/api/fs.html#fs_fs_lchmodsync_path_mode","!doc":"Synchronous lchmod(2). Returns undefined."},lchown:{"!type":"fn(path: string|+Buffer, uid: number, gid: number, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_lchown_path_uid_gid_callback","!doc":"Asynchronous lchown(2). No arguments other than a possible exception are given to the completion callback."},lchownSync:{"!type":"fn(path: string|+Buffer, uid: number, gid: number)","!url":"https://nodejs.org/api/fs.html#fs_fs_lchownsync_path_uid_gid","!doc":"Synchronous lchown(2). Returns undefined."},link:{"!type":"fn(srcpath: string|+Buffer, dstpath: string|+Buffer, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_link_srcpath_dstpath_callback","!doc":"Asynchronous link(2). No arguments other than a possible exception are given to the completion callback."},linkSync:{"!type":"fn(srcpath: string|+Buffer, dstpath: string|+Buffer)","!url":"https://nodejs.org/api/fs.html#fs_fs_linksync_srcpath_dstpath","!doc":"Synchronous link(2). Returns undefined."},lstat:{"!type":"fn(path: string|+Buffer, callback: fn(err: +Error, stats: +fs.Stats))","!url":"https://nodejs.org/api/fs.html#fs_fs_lstat_path_callback","!doc":"Asynchronous lstat(2). The callback gets two arguments (err, stats) where stats is a fs.Stats object. lstat() is identical to stat(), except that if path is a symbolic link, then the link itself is stat-ed, not the file that it refers to."},lstatSync:{"!type":"fn(path: string|+Buffer) -> +fs.Stats","!url":"https://nodejs.org/api/fs.html#fs_fs_lstatsync_path","!doc":"Synchronous lstat(2). Returns an instance of fs.Stats."},mkdir:{"!type":"fn(path: string|+Buffer, mode?: number, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_mkdir_path_mode_callback","!doc":"Asynchronous mkdir(2). No arguments other than a possible exception are given to the completion callback. mode defaults to 0o777."},mkdirSync:{"!type":"fn(path: string|+Buffer, mode?: number)","!url":"https://nodejs.org/api/fs.html#fs_fs_mkdirsync_path_mode","!doc":"Synchronous mkdir(2). Returns undefined."},mkdtemp:{"!type":"fn(prefix: string, options?: ?, callback: fn(err: +Error, folder: string))","!url":"https://nodejs.org/api/fs.html#fs_fs_mkdtemp_prefix_options_callback","!doc":"Creates a unique temporary directory."},mkdtempSync:{"!type":"fn(prefix: string, options?: ?) -> string","!url":"https://nodejs.org/api/fs.html#fs_fs_mkdtempsync_prefix_options","!doc":"The synchronous version of fs.mkdtemp(). Returns the created folder path."},open:{"!type":"fn(path: string|+Buffer, flags: string|number, mode?: number, callback: fn(err: +Error, fd: number))","!url":"https://nodejs.org/api/fs.html#fs_fs_open_path_flags_mode_callback","!doc":"Asynchronous file open. See open(2). flags can be:"},openSync:{"!type":"fn(path: string|+Buffer, flags: string|number, mode?: number) -> number","!url":"https://nodejs.org/api/fs.html#fs_fs_opensync_path_flags_mode","!doc":"Synchronous version of fs.open(). Returns an integer representing the file descriptor."},read:{"!type":"fn(fd: number, buffer: string|+Buffer, offset: number, length: number, position: number, callback: fn(err: +Error, bytesRead: number, buffer: +Buffer))","!url":"https://nodejs.org/api/fs.html#fs_fs_read_fd_buffer_offset_length_position_callback","!doc":"Read data from the file specified by fd."},readdir:{"!type":"fn(path: string|+Buffer, options?: ?, callback: fn(err: +Error, files: [string|+Buffer]))","!url":"https://nodejs.org/api/fs.html#fs_fs_readdir_path_options_callback","!doc":"Asynchronous readdir(3). Reads the contents of a directory. The callback gets two arguments (err, files) where files is an array of the names of the files in the directory excluding '.' and '..'."},readdirSync:{"!type":"fn(path: string|+Buffer, options?: ?) -> [string|+Buffer]","!url":"https://nodejs.org/api/fs.html#fs_fs_readdirsync_path_options","!doc":"Synchronous readdir(3). Returns an array of filenames excluding '.' and '..'."},readFile:{"!type":"fn(file: string|+Buffer|number, options?: ?, callback: fn(err: +Error, data: string|+Buffer))","!url":"https://nodejs.org/api/fs.html#fs_fs_readfile_file_options_callback","!doc":"Asynchronously reads the entire contents of a file. Example:"},readFileSync:{"!type":"fn(file: string|+Buffer|number, options?: ?) -> string|+Buffer","!url":"https://nodejs.org/api/fs.html#fs_fs_readfilesync_file_options","!doc":"Synchronous version of fs.readFile. Returns the contents of the file."},readlink:{"!type":"fn(path: string|+Buffer, options?: ?, callback: fn(err: +Error, linkString: string|+Buffer))","!url":"https://nodejs.org/api/fs.html#fs_fs_readlink_path_options_callback","!doc":"Asynchronous readlink(2). The callback gets two arguments (err, linkString)."},readlinkSync:{"!type":"fn(path: string|+Buffer, options?: ?) -> string|+Buffer","!url":"https://nodejs.org/api/fs.html#fs_fs_readlinksync_path_options","!doc":"Synchronous readlink(2). Returns the symbolic link's string value."},readSync:{"!type":"fn(fd: number, buffer: string|+Buffer, offset: number, length: number, position: number) -> number","!url":"https://nodejs.org/api/fs.html#fs_fs_readsync_fd_buffer_offset_length_position","!doc":"Synchronous version of fs.read(). Returns the number of bytesRead."},realpath:{"!type":"fn(path: string|+Buffer, options?: ?, callback: fn(err: +Error, resolvedPath: string|+Buffer))","!url":"https://nodejs.org/api/fs.html#fs_fs_realpath_path_options_callback","!doc":"Asynchronous realpath(3). The callback gets two arguments (err, resolvedPath). May use process.cwd to resolve relative paths."},realpathSync:{"!type":"fn(path: string|+Buffer, options?: ?) -> string|+Buffer","!url":"https://nodejs.org/api/fs.html#fs_fs_realpathsync_path_options","!doc":"Synchronous realpath(3). Returns the resolved path."},rename:{"!type":"fn(oldPath: string|+Buffer, newPath: string|+Buffer, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_rename_oldpath_newpath_callback","!doc":"Asynchronous rename(2). No arguments other than a possible exception are given to the completion callback."},renameSync:{"!type":"fn(oldPath: string|+Buffer, newPath: string|+Buffer)","!url":"https://nodejs.org/api/fs.html#fs_fs_renamesync_oldpath_newpath","!doc":"Synchronous rename(2). Returns undefined."},rmdir:{"!type":"fn(path: string|+Buffer, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_rmdir_path_callback","!doc":"Asynchronous rmdir(2). No arguments other than a possible exception are given to the completion callback."},rmdirSync:{"!type":"fn(path: string|+Buffer)","!url":"https://nodejs.org/api/fs.html#fs_fs_rmdirsync_path","!doc":"Synchronous rmdir(2). Returns undefined."},stat:{"!type":"fn(path: string|+Buffer, callback: fn(err: +Error, stats: +fs.Stats))","!url":"https://nodejs.org/api/fs.html#fs_fs_stat_path_callback","!doc":"Asynchronous stat(2). The callback gets two arguments (err, stats) where stats is a fs.Stats object. See the fs.Stats section for more information."},statSync:{"!type":"fn(path: string|+Buffer) -> +fs.Stats","!url":"https://nodejs.org/api/fs.html#fs_fs_statsync_path","!doc":"Synchronous stat(2). Returns an instance of fs.Stats."},symlink:{"!type":"fn(target: string|+Buffer, path: string|+Buffer, type?: string, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_symlink_target_path_type_callback","!doc":"Asynchronous symlink(2). No arguments other than a possible exception are given to the completion callback. The type argument can be set to 'dir', 'file', or 'junction' (default is 'file') and is only available on Windows (ignored on other platforms). Note that Windows junction points require the destination path to be absolute. When using 'junction', the target argument will automatically be normalized to absolute path."},symlinkSync:{"!type":"fn(target: string|+Buffer, path: string|+Buffer, type?: string)","!url":"https://nodejs.org/api/fs.html#fs_fs_symlinksync_target_path_type","!doc":"Synchronous symlink(2). Returns undefined."},truncate:{"!type":"fn(path: string|+Buffer, len: number, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_truncate_path_len_callback","!doc":"Asynchronous truncate(2). No arguments other than a possible exception are given to the completion callback. A file descriptor can also be passed as the first argument. In this case, fs.ftruncate() is called."},truncateSync:{"!type":"fn(path: string|+Buffer, len: number)","!url":"https://nodejs.org/api/fs.html#fs_fs_truncatesync_path_len","!doc":"Synchronous truncate(2). Returns undefined. A file descriptor can also be passed as the first argument. In this case, fs.ftruncateSync() is called."},unlink:{"!type":"fn(path: string|+Buffer, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_unlink_path_callback","!doc":"Asynchronous unlink(2). No arguments other than a possible exception are given to the completion callback."},unlinkSync:{"!type":"fn(path: string|+Buffer)","!url":"https://nodejs.org/api/fs.html#fs_fs_unlinksync_path","!doc":"Synchronous unlink(2). Returns undefined."},unwatchFile:{"!type":"fn(filename: string|+Buffer, listener?: fn(curr: +fs.Stats, prev: +fs.Stats))","!url":"https://nodejs.org/api/fs.html#fs_fs_unwatchfile_filename_listener","!doc":"Stop watching for changes on filename. If listener is specified, only that particular listener is removed. Otherwise, all listeners are removed and you have effectively stopped watching filename."},utimes:{"!type":"fn(path: string|+Buffer, atime: number, mtime: number, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_utimes_path_atime_mtime_callback","!doc":"Change file timestamps of the file referenced by the supplied path."},utimesSync:{"!type":"fn(path: string|+Buffer, atime: number, mtime: number)","!url":"https://nodejs.org/api/fs.html#fs_fs_utimessync_path_atime_mtime","!doc":"Synchronous version of fs.utimes(). Returns undefined."},watch:{"!type":"fn(filename: string|+Buffer, options?: ?, listener?: fn(eventType: string, filename?: string)) -> +fs.FSWatcher","!url":"https://nodejs.org/api/fs.html#fs_fs_watch_filename_options_listener","!doc":"Watch for changes on filename, where filename is either a file or a directory. The returned object is a fs.FSWatcher."},watchFile:{"!type":"fn(filename: string|+Buffer, options?: ?, listener: fn(curr: +fs.Stats, prev: +fs.Stats))","!url":"https://nodejs.org/api/fs.html#fs_fs_watchfile_filename_options_listener","!doc":"Watch for changes on filename. The callback listener will be called each time the file is accessed."},write:{"!type":"fn(fd: number, data: string|+Buffer, position?: number, encoding?: string, callback: fn(err: +Error, bytesRead: number, buffer: +Buffer))","!url":"https://nodejs.org/api/fs.html#fs_fs_write_fd_data_position_encoding_callback","!doc":"Write data to the file specified by fd. If data is not a Buffer instance then the value will be coerced to a string."},writeFile:{"!type":"fn(file: string|+Buffer|number, data: string|+Buffer, options?: ?, callback: fn(err: +Error))","!url":"https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback","!doc":"Asynchronously writes data to a file, replacing the file if it already exists. data can be a string or a buffer."},writeFileSync:{"!type":"fn(file: string|+Buffer|number, data: string|+Buffer, options?: ?)","!url":"https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options","!doc":"The synchronous version of fs.writeFile(). Returns undefined."},writeSync:{"!type":"fn(fd: number, data: string|+Buffer, position?: number, encoding?: string) -> number","!url":"https://nodejs.org/api/fs.html#fs_fs_writesync_fd_data_position_encoding","!doc":"Synchronous versions of fs.write(). Returns the number of bytes written."},FSWatcher:{"!type":"fn()","!url":"https://nodejs.org/api/fs.html#fs_class_fs_fswatcher","!doc":"Objects returned from fs.watch() are of this type.",prototype:{close:{"!type":"fn()","!url":"https://nodejs.org/api/fs.html#fs_watcher_close","!doc":"Stop watching for changes on the given fs.FSWatcher."}}},ReadStream:{"!type":"fn()","!url":"https://nodejs.org/api/fs.html#fs_class_fs_readstream","!doc":"ReadStream is a Readable Stream.",prototype:{bytesRead:{"!type":"number","!url":"https://nodejs.org/api/fs.html#fs_readstream_bytesread","!doc":"The number of bytes read so far."},path:{"!type":"string","!url":"https://nodejs.org/api/fs.html#fs_readstream_path","!doc":"The path to the file the stream is reading from as specified in the first argument to fs.createReadStream(). If path is passed as a string, then readStream.path will be a string. If path is passed as a Buffer, then readStream.path will be a Buffer."},"!proto":"stream.Readable"}},Stats:{"!type":"fn()","!url":"https://nodejs.org/api/fs.html#fs_class_fs_stats","!doc":"Objects returned from fs.stat(), fs.lstat() and fs.fstat() and their synchronous counterparts are of this type.",prototype:{isFile:"fn() -> bool",isDirectory:"fn() -> bool",isBlockDevice:"fn() -> bool",isCharacterDevice:"fn() -> bool",isSymbolicLink:"fn() -> bool",isFIFO:"fn() -> bool",isSocket:"fn() -> bool",dev:"number",ino:"number",mode:"number",nlink:"number",uid:"number",gid:"number",rdev:"number",size:"number",blksize:"number",blocks:"number",atime:"+Date",mtime:"+Date",ctime:"+Date",birthtime:"+Date"}},WriteStream:{"!type":"fn()","!url":"https://nodejs.org/api/fs.html#fs_class_fs_writestream","!doc":"WriteStream is a Writable Stream.",prototype:{bytesWritten:{"!type":"number","!url":"https://nodejs.org/api/fs.html#fs_writestream_byteswritten","!doc":"The number of bytes written so far. Does not include data that is still queued for writing."},path:{"!type":"string","!url":"https://nodejs.org/api/fs.html#fs_writestream_path","!doc":"The path to the file the stream is writing to as specified in the first argument to fs.createWriteStream(). If path is passed as a string, then writeStream.path will be a string. If path is passed as a Buffer, then writeStream.path will be a Buffer."},"!proto":"stream.Writable"}},constants:{"!url":"https://nodejs.org/api/fs.html#fs_fs_constants","!doc":"Returns an object containing commonly used constants for file system operations. The specific constants currently defined are described in FS Constants.",F_OK:"number",R_OK:"number",W_OK:"number",X_OK:"number",O_RDONLY:"number",O_WRONLY:"number",O_RDWR:"number",O_CREAT:"number",O_EXCL:"number",O_NOCTTY:"number",O_TRUNC:"number",O_APPEND:"number",O_DIRECTORY:"number",O_NOATIME:"number",O_NOFOLLOW:"number",O_SYNC:"number",O_SYMLINK:"number",O_DIRECT:"number",O_NONBLOCK:"number",S_IFMT:"number",S_IFREG:"number",S_IFDIR:"number",S_IFCHR:"number",S_IFBLK:"number",S_IFIFO:"number",S_IFLNK:"number",S_IFSOCK:"number",S_IRWXU:"number",S_IRUSR:"number",S_IWUSR:"number",S_IXUSR:"number",S_IRWXG:"number",S_IRGRP:"number",S_IWGRP:"number",S_IXGRP:"number",S_IRWXO:"number",S_IROTH:"number",S_IWOTH:"number",S_IXOTH:"number"}},path:{"!url":"https://nodejs.org/api/path.html","!doc":"This module contains utilities for handling and transforming file paths. Almost all these methods perform only string transformations. The file system is not consulted to check whether paths are valid.",normalize:{"!type":"fn(p: string) -> string","!url":"https://nodejs.org/api/path.html#path_path_normalize_p","!doc":"Normalize a string path, taking care of '..' and '.' parts."},join:{"!type":"fn() -> string","!url":"https://nodejs.org/api/path.html#path_path_join_path","!doc":"Join all arguments together and normalize the resulting path."},resolve:{"!type":"fn(from: string, from2: string, from3: string, from4: string, from5: string, to: string) -> string","!url":"https://nodejs.org/api/path.html#path_path_resolve_from_to","!doc":"Resolves to to an absolute path."},relative:{"!type":"fn(from: string, to: string) -> string","!url":"https://nodejs.org/api/path.html#path_path_relative_from_to","!doc":"Solve the relative path from from to to."},dirname:{"!type":"fn(p: string) -> string","!url":"https://nodejs.org/api/path.html#path_path_dirname_p","!doc":"Return the directory name of a path. Similar to the Unix dirname command."},basename:{"!type":"fn(p: string, ext?: string) -> string","!url":"https://nodejs.org/api/path.html#path_path_basename_p_ext","!doc":"Return the last portion of a path. Similar to the Unix basename command."},extname:{"!type":"fn(p: string) -> string","!url":"https://nodejs.org/api/path.html#path_path_extname_p","!doc":"Return the extension of the path, from the last '.' to end of string in the last portion of the path. If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string."},sep:{"!type":"string","!url":"https://nodejs.org/api/path.html#path_path_sep","!doc":"The platform-specific file separator. '\\\\' or '/'."},delimiter:{"!type":"string","!url":"https://nodejs.org/api/path.html#path_path_delimiter","!doc":"The platform-specific path delimiter, ; or ':'."}},string_decoder:{"!url":"https://nodejs.org/api/string_decoder.html","!doc":"StringDecoder decodes a buffer to a string. It is a simple interface to buffer.toString() but provides additional support for utf8.",StringDecoder:{"!type":"fn(encoding?: string)",prototype:{write:{"!type":"fn(buffer: +Buffer) -> string","!url":"https://nodejs.org/api/string_decoder.html#string_decoder_decoder_write_buffer","!doc":"Returns a decoded string."},end:{"!type":"fn()","!url":"https://nodejs.org/api/string_decoder.html#string_decoder_decoder_end","!doc":"Returns any trailing bytes that were left in the buffer."}},"!url":"https://nodejs.org/api/string_decoder.html#string_decoder_class_stringdecoder","!doc":"Accepts a single argument, encoding which defaults to utf8."}},tls:{"!url":"https://nodejs.org/api/tls.html","!doc":"The tls module uses OpenSSL to provide Transport Layer Security and/or Secure Socket Layer: encrypted stream communication.",CLIENT_RENEG_LIMIT:"number",CLIENT_RENEG_WINDOW:"number",SLAB_BUFFER_SIZE:"number",getCiphers:{"!type":"fn() -> [string]","!url":"https://nodejs.org/api/tls.html#tls_tls_getciphers","!doc":"Returns an array with the names of the supported SSL ciphers."},Server:{"!type":"fn()",prototype:{"!proto":"net.Server.prototype",listen:{"!type":"fn(port: number, host?: string, callback?: fn())","!url":"https://nodejs.org/api/tls.html#tls_server_listen_port_host_callback","!doc":"Begin accepting connections on the specified port and host. If the host is omitted, the server will accept connections directed to any IPv4 address (INADDR_ANY)."},close:{"!type":"fn()","!url":"https://nodejs.org/api/tls.html#tls_server_close","!doc":"Stops the server from accepting new connections. This function is asynchronous, the server is finally closed when the server emits a 'close' event."},addContext:{"!type":"fn(hostName: string, credentials: tls.Server.credentials)","!url":"https://nodejs.org/api/tls.html#tls_server_addcontext_hostname_credentials","!doc":"Add secure context that will be used if client request's SNI hostname is matching passed hostname (wildcards can be used). credentials can contain key, cert and ca."}},"!url":"https://nodejs.org/api/tls.html#tls_class_tls_server","!doc":"This class is a subclass of net.Server and has the same methods on it. Instead of accepting just raw TCP connections, this accepts encrypted connections using TLS or SSL."},createServer:{"!type":"fn(options?: ?, connectionListener?: fn(stream: +tls.CleartextStream)) -> +tls.Server","!url":"https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener","!doc":"Creates a new tls.Server. The connectionListener argument is automatically set as a listener for the secureConnection event."},CleartextStream:{"!type":"fn()",prototype:{"!proto":"stream.Duplex.prototype",authorized:{"!type":"bool","!url":"https://nodejs.org/api/tls.html#tls_cleartextstream_authorized","!doc":"A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false"},authorizationError:{"!type":"+Error","!url":"https://nodejs.org/api/tls.html#tls_cleartextstream_authorizationerror","!doc":"The reason why the peer's certificate has not been verified. This property becomes available only when cleartextStream.authorized === false."},getPeerCertificate:{"!type":"fn() -> ?","!url":"https://nodejs.org/api/tls.html#tls_cleartextstream_getpeercertificate","!doc":"Returns an object representing the peer's certificate. The returned object has some properties corresponding to the field of the certificate."},getCipher:{"!type":"fn() -> tls.cipher","!url":"https://nodejs.org/api/tls.html#tls_cleartextstream_getcipher","!doc":"Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection."},address:{"!type":"net.address","!url":"https://nodejs.org/api/tls.html#tls_cleartextstream_address","!doc":"Returns the bound address, the address family name and port of the underlying socket as reported by the operating system. Returns an object with three properties, e.g. { port: 12346, family: 'IPv4', address: '127.0.0.1' }"},remoteAddress:{"!type":"string","!url":"https://nodejs.org/api/tls.html#tls_cleartextstream_remoteaddress","!doc":"The string representation of the remote IP address. For example, '74.125.127.100' or '2001:4860:a005::68'."},remotePort:{"!type":"number","!url":"https://nodejs.org/api/tls.html#tls_cleartextstream_remoteport","!doc":"The numeric representation of the remote port. For example, 443."}},"!url":"https://nodejs.org/api/tls.html#tls_class_tls_cleartextstream","!doc":"This is a stream on top of the Encrypted stream that makes it possible to read/write an encrypted data as a cleartext data."},connect:{"!type":"fn(port: number, host?: string, options: ?, listener: fn()) -> +tls.CleartextStream","!url":"https://nodejs.org/api/tls.html#tls_tls_connect_options_callback","!doc":"Creates a new client connection to the given port and host (old API) or options.port and options.host. (If host is omitted, it defaults to localhost.)"},createSecurePair:{"!type":"fn(credentials?: crypto.credentials, isServer?: bool, requestCert?: bool, rejectUnauthorized?: bool) -> +tls.SecurePair","!url":"https://nodejs.org/api/tls.html#tls_tls_createsecurepair_credentials_isserver_requestcert_rejectunauthorized","!doc":"Creates a new secure pair object with two streams, one of which reads/writes encrypted data, and one reads/writes cleartext data. Generally the encrypted one is piped to/from an incoming encrypted data stream, and the cleartext one is used as a replacement for the initial encrypted stream."},SecurePair:{"!type":"fn()",prototype:{"!proto":"events.EventEmitter.prototype",cleartext:{"!type":"+tls.CleartextStream","!url":"https://nodejs.org/api/tls.html#tls_class_securepair","!doc":"Returned by tls.createSecurePair."},encrypted:{"!type":"+stream.Duplex","!url":"https://nodejs.org/api/tls.html#tls_class_securepair","!doc":"Returned by tls.createSecurePair."}},"!url":"https://nodejs.org/api/tls.html#tls_class_securepair","!doc":"Returned by tls.createSecurePair."}},crypto:{"!url":"https://nodejs.org/api/crypto.html","!doc":"The crypto module offers a way of encapsulating secure credentials to be used as part of a secure HTTPS net or http connection.\nIt also offers a set of wrappers for OpenSSL's hash, hmac, cipher, decipher, sign and verify methods.",getCiphers:{"!type":"fn() -> [string]","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_getciphers","!doc":"Returns an array with the names of the supported ciphers."},getHashes:{"!type":"fn() -> [string]","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_gethashes","!doc":"Returns an array with the names of the supported hash algorithms."},createCredentials:{"!type":"fn(details?: ?) -> crypto.credentials","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_createcredentials_details","!doc":"Creates a credentials object."},createHash:{"!type":"fn(algorithm: string) -> +crypto.Hash","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm","!doc":"Creates and returns a hash object, a cryptographic hash with the given algorithm which can be used to generate hash digests."},Hash:{"!type":"fn()",prototype:{"!proto":"stream.Duplex.prototype",update:{"!type":"fn(data: +Buffer, encoding?: string)","!url":"https://nodejs.org/api/crypto.html#crypto_hash_update_data_input_encoding","!doc":"Updates the hash content with the given data, the encoding of which is given in input_encoding and can be 'utf8', 'ascii' or 'binary'. If no encoding is provided, then a buffer is expected."},digest:{"!type":"fn(encoding?: string) -> +Buffer","!url":"https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding","!doc":"Calculates the digest of all of the passed data to be hashed. The encoding can be 'hex', 'binary' or 'base64'. If no encoding is provided, then a buffer is returned."}},"!url":"https://nodejs.org/api/crypto.html#crypto_class_hash","!doc":"The class for creating hash digests of data."},createHmac:{"!type":"fn(algorithm: string, key: string) -> +crypto.Hmac","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_createhmac_algorithm_key","!doc":"Creates and returns a hmac object, a cryptographic hmac with the given algorithm and key."},Hmac:{"!type":"fn()",prototype:{update:{"!type":"fn(data: +Buffer)","!url":"https://nodejs.org/api/crypto.html#crypto_hmac_update_data", "!doc":"Update the hmac content with the given data. This can be called many times with new data as it is streamed."},digest:{"!type":"fn(encoding?: string) -> +Buffer","!url":"https://nodejs.org/api/crypto.html#crypto_hmac_digest_encoding","!doc":"Calculates the digest of all of the passed data to the hmac. The encoding can be 'hex', 'binary' or 'base64'. If no encoding is provided, then a buffer is returned."}},"!url":"https://nodejs.org/api/crypto.html#crypto_class_hmac","!doc":"Class for creating cryptographic hmac content."},createCipher:{"!type":"fn(algorithm: string, password: string) -> +crypto.Cipher","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_createcipher_algorithm_password","!doc":"Creates and returns a cipher object, with the given algorithm and password."},createCipheriv:{"!type":"fn(algorithm: string, password: string, iv: string) -> +crypto.Cipher","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_createcipheriv_algorithm_key_iv","!doc":"Creates and returns a cipher object, with the given algorithm, key and iv."},Cipher:{"!type":"fn()",prototype:{"!proto":"stream.Duplex.prototype",update:{"!type":"fn(data: +Buffer, input_encoding?: string, output_encoding?: string) -> +Buffer","!url":"https://nodejs.org/api/crypto.html#crypto_cipher_update_data_input_encoding_output_encoding","!doc":"Updates the cipher with data, the encoding of which is given in input_encoding and can be 'utf8', 'ascii' or 'binary'. If no encoding is provided, then a buffer is expected."},final:{"!type":"fn(output_encoding?: string) -> +Buffer","!url":"https://nodejs.org/api/crypto.html#crypto_cipher_final_output_encoding","!doc":"Returns any remaining enciphered contents, with output_encoding being one of: 'binary', 'base64' or 'hex'. If no encoding is provided, then a buffer is returned."},setAutoPadding:{"!type":"fn(auto_padding: bool)","!url":"https://nodejs.org/api/crypto.html#crypto_cipher_setautopadding_auto_padding_true","!doc":"You can disable automatic padding of the input data to block size. If auto_padding is false, the length of the entire input data must be a multiple of the cipher's block size or final will fail. Useful for non-standard padding, e.g. using 0x0 instead of PKCS padding. You must call this before cipher.final."}},"!url":"https://nodejs.org/api/crypto.html#crypto_class_cipher","!doc":"Class for encrypting data."},createDecipher:{"!type":"fn(algorithm: string, password: string) -> +crypto.Decipher","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_createdecipher_algorithm_password","!doc":"Creates and returns a decipher object, with the given algorithm and key. This is the mirror of the createCipher() above."},createDecipheriv:{"!type":"fn(algorithm: string, key: string, iv: string) -> +crypto.Decipher","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_createdecipheriv_algorithm_key_iv","!doc":"Creates and returns a decipher object, with the given algorithm, key and iv. This is the mirror of the createCipheriv() above."},Decipher:{"!type":"fn()",prototype:{"!proto":"stream.Duplex.prototype",update:{"!type":"fn(data: +Buffer, input_encoding?: string, output_encoding?: string)","!url":"https://nodejs.org/api/crypto.html#crypto_decipher_update_data_input_encoding_output_encoding","!doc":"Updates the decipher with data, which is encoded in 'binary', 'base64' or 'hex'. If no encoding is provided, then a buffer is expected."},final:{"!type":"fn(output_encoding?: string) -> +Buffer","!url":"https://nodejs.org/api/crypto.html#crypto_decipher_final_output_encoding","!doc":"Returns any remaining plaintext which is deciphered, with output_encoding being one of: 'binary', 'ascii' or 'utf8'. If no encoding is provided, then a buffer is returned."},setAutoPadding:{"!type":"fn(auto_padding: bool)","!url":"https://nodejs.org/api/crypto.html#crypto_decipher_setautopadding_auto_padding_true","!doc":"You can disable auto padding if the data has been encrypted without standard block padding to prevent decipher.final from checking and removing it. Can only work if the input data's length is a multiple of the ciphers block size. You must call this before streaming data to decipher.update."}},"!url":"https://nodejs.org/api/crypto.html#crypto_class_decipher","!doc":"Class for decrypting data."},createSign:{"!type":"fn(algorithm: string) -> +crypto.Sign","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_createsign_algorithm","!doc":"Creates and returns a signing object, with the given algorithm. On recent OpenSSL releases, openssl list-public-key-algorithms will display the available signing algorithms. Examples are 'RSA-SHA256'."},Sign:{"!type":"fn()",prototype:{"!proto":"stream.Writable.prototype",update:{"!type":"fn(data: +Buffer)","!url":"https://nodejs.org/api/crypto.html#crypto_sign_update_data","!doc":"Updates the sign object with data. This can be called many times with new data as it is streamed."},sign:{"!type":"fn(private_key: string, output_format: string) -> +Buffer","!url":"https://nodejs.org/api/crypto.html#crypto_sign_sign_private_key_output_format","!doc":"Calculates the signature on all the updated data passed through the sign. private_key is a string containing the PEM encoded private key for signing."}},"!url":"https://nodejs.org/api/crypto.html#crypto_class_sign","!doc":"Class for generating signatures."},createVerify:{"!type":"fn(algorith: string) -> +crypto.Verify","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_createverify_algorithm","!doc":"Creates and returns a verification object, with the given algorithm. This is the mirror of the signing object above."},Verify:{"!type":"fn()",prototype:{"!proto":"stream.Writable.prototype",update:{"!type":"fn(data: +Buffer)","!url":"https://nodejs.org/api/crypto.html#crypto_verifier_update_data","!doc":"Updates the verifier object with data. This can be called many times with new data as it is streamed."},verify:{"!type":"fn(object: string, signature: string, signature_format?: string) -> bool","!url":"https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format","!doc":"Verifies the signed data by using the object and signature. object is a string containing a PEM encoded object, which can be one of RSA public key, DSA public key, or X.509 certificate. signature is the previously calculated signature for the data, in the signature_format which can be 'binary', 'hex' or 'base64'. If no encoding is specified, then a buffer is expected."}},"!url":"https://nodejs.org/api/crypto.html#crypto_class_verify","!doc":"Class for verifying signatures."},createDiffieHellman:{"!type":"fn(prime: number, encoding?: string) -> +crypto.DiffieHellman","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_creatediffiehellman_prime_length","!doc":"Creates a Diffie-Hellman key exchange object and generates a prime of the given bit length. The generator used is 2."},DiffieHellman:{"!type":"fn()",prototype:{generateKeys:{"!type":"fn(encoding?: string) -> +Buffer","!url":"https://nodejs.org/api/crypto.html#crypto_diffiehellman_generatekeys_encoding","!doc":"Generates private and public Diffie-Hellman key values, and returns the public key in the specified encoding. This key should be transferred to the other party. Encoding can be 'binary', 'hex', or 'base64'. If no encoding is provided, then a buffer is returned."},computeSecret:{"!type":"fn(other_public_key: +Buffer, input_encoding?: string, output_encoding?: string) -> +Buffer","!url":"https://nodejs.org/api/crypto.html#crypto_diffiehellman_computesecret_other_public_key_input_encoding_output_encoding","!doc":"Computes the shared secret using other_public_key as the other party's public key and returns the computed shared secret. Supplied key is interpreted using specified input_encoding, and secret is encoded using specified output_encoding. Encodings can be 'binary', 'hex', or 'base64'. If the input encoding is not provided, then a buffer is expected."},getPrime:{"!type":"fn(encoding?: string) -> +Buffer","!url":"https://nodejs.org/api/crypto.html#crypto_diffiehellman_getprime_encoding","!doc":"Returns the Diffie-Hellman prime in the specified encoding, which can be 'binary', 'hex', or 'base64'. If no encoding is provided, then a buffer is returned."},getGenerator:{"!type":"fn(encoding: string) -> +Buffer","!url":"https://nodejs.org/api/crypto.html#crypto_diffiehellman_getgenerator_encoding","!doc":"Returns the Diffie-Hellman prime in the specified encoding, which can be 'binary', 'hex', or 'base64'. If no encoding is provided, then a buffer is returned."},getPublicKey:{"!type":"fn(encoding?: string) -> +Buffer","!url":"https://nodejs.org/api/crypto.html#crypto_diffiehellman_getpublickey_encoding","!doc":"Returns the Diffie-Hellman public key in the specified encoding, which can be 'binary', 'hex', or 'base64'. If no encoding is provided, then a buffer is returned."},getPrivateKey:{"!type":"fn(encoding?: string) -> +Buffer","!url":"https://nodejs.org/api/crypto.html#crypto_diffiehellman_getprivatekey_encoding","!doc":"Returns the Diffie-Hellman private key in the specified encoding, which can be 'binary', 'hex', or 'base64'. If no encoding is provided, then a buffer is returned."},setPublicKey:{"!type":"fn(public_key: +Buffer, encoding?: string)","!url":"https://nodejs.org/api/crypto.html#crypto_diffiehellman_setpublickey_public_key_encoding","!doc":"Sets the Diffie-Hellman public key. Key encoding can be 'binary', 'hex' or 'base64'. If no encoding is provided, then a buffer is expected."},setPrivateKey:{"!type":"fn(public_key: +Buffer, encoding?: string)","!url":"https://nodejs.org/api/crypto.html#crypto_diffiehellman_setprivatekey_private_key_encoding","!doc":"Sets the Diffie-Hellman private key. Key encoding can be 'binary', 'hex' or 'base64'. If no encoding is provided, then a buffer is expected."}},"!url":"https://nodejs.org/api/crypto.html#crypto_class_diffiehellman","!doc":"The class for creating Diffie-Hellman key exchanges."},getDiffieHellman:{"!type":"fn(group_name: string) -> +crypto.DiffieHellman","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_getdiffiehellman_group_name","!doc":"Creates a predefined Diffie-Hellman key exchange object. The supported groups are: 'modp1', 'modp2', 'modp5' (defined in RFC 2412) and 'modp14', 'modp15', 'modp16', 'modp17', 'modp18' (defined in RFC 3526). The returned object mimics the interface of objects created by crypto.createDiffieHellman() above, but will not allow to change the keys (with diffieHellman.setPublicKey() for example). The advantage of using this routine is that the parties don't have to generate nor exchange group modulus beforehand, saving both processor and communication time."},pbkdf2:{"!type":"fn(password: string, salt: string, iterations: number, keylen: number, callback: fn(err: +Error, derivedKey: string))","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2_password_salt_iterations_keylen_callback","!doc":"Asynchronous PBKDF2 applies pseudorandom function HMAC-SHA1 to derive a key of given length from the given password, salt and iterations. The callback gets two arguments (err, derivedKey)."},pbkdf2Sync:{"!type":"fn(password: string, salt: string, iterations: number, keylen: number) -> string","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2sync_password_salt_iterations_keylen","!doc":"Synchronous PBKDF2 function. Returns derivedKey or throws error."},randomBytes:{"!type":"fn(size: number, callback?: fn(err: +Error, buf: +Buffer))","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback","!doc":"Generates cryptographically strong pseudo-random data."},pseudoRandomBytes:{"!type":"fn(size: number, callback?: fn(err: +Error, buf: +Buffer))","!url":"https://nodejs.org/api/crypto.html#crypto_crypto_pseudorandombytes_size_callback","!doc":"Generates non-cryptographically strong pseudo-random data. The data returned will be unique if it is sufficiently long, but is not necessarily unpredictable. For this reason, the output of this function should never be used where unpredictability is important, such as in the generation of encryption keys."},DEFAULT_ENCODING:"string"},util:{"!url":"https://nodejs.org/api/util.html","!doc":"The util module is primarily designed to support the needs of Node's internal APIs. Many of these utilities are useful for your own programs. If you find that these functions are lacking for your purposes, however, you are encouraged to write your own utilities. We are not interested in any future additions to the util module that are unnecessary for Node's internal functionality.",format:{"!type":"fn(format: string) -> string","!url":"https://nodejs.org/api/util.html#util_util_format_format","!doc":"Returns a formatted string using the first argument as a printf-like format."},debug:{"!type":"fn(msg: string)","!url":"https://nodejs.org/api/util.html#util_util_debug_string","!doc":"A synchronous output function. Will block the process and output string immediately to stderr."},error:{"!type":"fn(msg: string, ...string: string)","!url":"https://nodejs.org/api/util.html#util_util_error","!doc":"Same as util.debug() except this will output all arguments immediately to stderr."},puts:{"!type":"fn(data: string)","!url":"https://nodejs.org/api/util.html#util_util_puts","!doc":"A synchronous output function. Will block the process and output all arguments to stdout with newlines after each argument."},print:{"!type":"fn(data: string)","!url":"https://nodejs.org/api/util.html#util_util_print","!doc":"A synchronous output function. Will block the process, cast each argument to a string then output to stdout. Does not place newlines after each argument."},log:{"!type":"fn(string: string)","!url":"https://nodejs.org/api/util.html#util_util_log_string","!doc":"Output with timestamp on stdout."},inspect:{"!type":"fn(object: ?, options: {showHidden: bool, depth: number, colors: bool, customInspect: bool, showProxy: bool, maxArrayLength: number, breakLength: number}) -> string","!url":"https://nodejs.org/api/util.html#util_util_inspect_object_options","!doc":"Return a string representation of object, which is useful for debugging."},isArray:{"!type":"fn(object: ?) -> bool","!url":"https://nodejs.org/api/util.html#util_util_isarray_object","!doc":'Returns true if the given "object" is an Array. false otherwise.'},isRegExp:{"!type":"fn(object: ?) -> bool","!url":"https://nodejs.org/api/util.html#util_util_isregexp_object","!doc":'Returns true if the given "object" is a RegExp. false otherwise.'},isDate:{"!type":"fn(object: ?) -> bool","!url":"https://nodejs.org/api/util.html#util_util_isdate_object","!doc":'Returns true if the given "object" is a Date. false otherwise.'},isError:{"!type":"fn(object: ?) -> bool","!url":"https://nodejs.org/api/util.html#util_util_iserror_object","!doc":'Returns true if the given "object" is an Error. false otherwise.'},isBoolean:{"!type":"fn(object: ?) -> bool","!url":"https://nodejs.org/api/util.html#util_util_isboolean_object","!doc":'Returns true if the given "object" is a Boolean. false otherwise.'},isNull:{"!type":"fn(object: ?) -> bool","!url":"https://nodejs.org/api/util.html#util_util_isnull_object","!doc":'Returns true if the given "object" is strictly null. false otherwise.'},isNullOrUndefined:{"!type":"fn(object: ?) -> bool","!url":"https://nodejs.org/api/util.html#util_util_isnullorundefined_object","!doc":'Returns true if the given "object" is null or undefined. false otherwise.'},isNumber:{"!type":"fn(object: ?) -> bool","!url":"https://nodejs.org/api/util.html#util_util_isnumber_object","!doc":'Returns true if the given "object" is a Number. false otherwise.'},isString:{"!type":"fn(object: ?) -> bool","!url":"https://nodejs.org/api/util.html#util_util_isstring_object","!doc":'Returns true if the given "object" is a String. false otherwise.'},isSymbol:{"!type":"fn(object: ?) -> bool","!url":"https://nodejs.org/api/util.html#util_util_issymbol_object","!doc":'Returns true if the given "object" is a Symbol. false otherwise.'},isUndefined:{"!type":"fn(object: ?) -> bool","!url":"https://nodejs.org/api/util.html#util_util_isundefined_object","!doc":'Returns true if the given "object" is undefined. false otherwise.'},isObject:{"!type":"fn(object: ?) -> bool","!url":"https://nodejs.org/api/util.html#util_util_isobject_object","!doc":'Returns true if the given "object" is strictly an Object and not a Function. false otherwise.'},isFunction:{"!type":"fn(object: ?) -> bool","!url":"https://nodejs.org/api/util.html#util_util_isfunction_object","!doc":'Returns true if the given "object" is a Function. false otherwise.'},isPrimitive:{"!type":"fn(object: ?) -> bool","!url":"https://nodejs.org/api/util.html#util_util_isprimitive_object","!doc":'Returns true if the given "object" is a primitive type. false otherwise.'},isBuffer:{"!type":"fn(object: ?) -> bool","!url":"https://nodejs.org/api/util.html#util_util_isbuffer_object","!doc":'Returns true if the given "object" is a Buffer. false otherwise.'},inherits:{"!type":"fn(constructor: ?, superConstructor: ?)","!url":"https://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor","!doc":"Inherit the prototype methods from one constructor into another. The prototype of constructor will be set to a new object created from superConstructor."}},assert:{"!url":"https://nodejs.org/api/assert.html","!doc":"The assert module provides a simple set of assertion tests that can be used to test invariants. The module is intended for internal use by Node.js, but can be used in application code via require('assert'). However, assert is not a testing framework, and is not intended to be used as a general purpose assertion library.","!type":"fn(value: ?, message?: string)",ok:{"!type":"fn(value: ?, message?: string)","!url":"https://nodejs.org/api/assert.html#assert_assert_value_message_assert_ok_value_message","!doc":"Tests if value is truthy. It is equivalent to assert.equal(!!value, true, message)."},deepEqual:{"!type":"fn(actual: ?, expected: ?, message?: string)","!url":"https://nodejs.org/api/assert.html#assert_assert_deepequal_actual_expected_message","!doc":"Tests for deep equality between the actual and expected parameters. Primitive values are compared with the equal comparison operator ( == )."},deepStrictEqual:{"!type":"fn(actual: ?, expected: ?, message?: string)","!url":"https://nodejs.org/api/assert.html#assert_assert_deepstrictequal_actual_expected_message","!doc":"Generally identical to assert.deepEqual with the exception that primitive values are compared using the strict equality operator ( === )."},doesNotThrow:{"!type":"fn(block: fn(), error?: ?, message?: string)","!url":"https://nodejs.org/api/assert.html#assert_assert_doesnotthrow_block_error_message","!doc":"Asserts that the function block does not throw an error. See assert.throws() for more details."},equal:{"!type":"fn(actual: ?, expected: ?, message?: string)","!url":"https://nodejs.org/api/assert.html#assert_assert_equal_actual_expected_message","!doc":"Tests shallow, coercive equality between the actual and expected parameters using the equal comparison operator ( == )."},fail:{"!type":"fn(actual: ?, expected: ?, message: string, operator: string)","!url":"https://nodejs.org/api/assert.html#assert_assert_fail_actual_expected_message_operator","!doc":"Throws an AssertionError. If message is falsy, the error message is set as the values of actual and expected separated by the provided operator. Otherwise, the error message is the value of message."},ifError:{"!type":"fn(value: ?)","!url":"https://nodejs.org/api/assert.html#assert_assert_iferror_value","!doc":"Throws value if value is truthy. This is useful when testing the error argument in callbacks."},notDeepEqual:{"!type":"fn(actual: ?, expected: ?, message?: string)","!url":"https://nodejs.org/api/assert.html#assert_assert_notdeepequal_actual_expected_message","!doc":"Tests for any deep inequality. Opposite of assert.deepEqual."},notDeepStrictEqual:{"!type":"fn(actual: ?, expected: ?, message?: string)","!url":"https://nodejs.org/api/assert.html#assert_assert_notdeepstrictequal_actual_expected_message","!doc":"Tests for deep strict inequality. Opposite of assert.deepStrictEqual."},notEqual:{"!type":"fn(actual: ?, expected: ?, message?: string)","!url":"https://nodejs.org/api/assert.html#assert_assert_notequal_actual_expected_message","!doc":"Tests shallow, coercive inequality with the not equal comparison operator ( != )."},notStrictEqual:{"!type":"fn(actual: ?, expected: ?, message?: string)","!url":"https://nodejs.org/api/assert.html#assert_assert_notstrictequal_actual_expected_message","!doc":"Tests strict inequality as determined by the strict not equal operator ( !== )."},strictEqual:{"!type":"fn(actual: ?, expected: ?, message?: string)","!url":"https://nodejs.org/api/assert.html#assert_assert_strictequal_actual_expected_message","!doc":"Tests strict equality as determined by the strict equality operator ( === )."},throws:{"!type":"fn(block: fn(), error?: ?, message?: string)","!url":"https://nodejs.org/api/assert.html#assert_assert_throws_block_error_message","!doc":"Expects the function block to throw an error. If specified, error can be a constructor, RegExp, or validation function."}},tty:{"!url":"https://nodejs.org/api/tty.html","!doc":"The tty module houses the tty.ReadStream and tty.WriteStream classes. In most cases, you will not need to use this module directly.",isatty:{"!type":"fn(fd: number) -> bool","!url":"https://nodejs.org/api/tty.html#tty_tty_isatty_fd","!doc":"Returns true or false depending on if the fd is associated with a terminal."}},domain:{"!url":"https://nodejs.org/api/domain.html","!doc":"Domains provide a way to handle multiple different IO operations as a single group. If any of the event emitters or callbacks registered to a domain emit an error event, or throw an error, then the domain object will be notified, rather than losing the context of the error in the process.on('uncaughtException') handler, or causing the program to exit immediately with an error code.",create:{"!type":"fn() -> +events.EventEmitter","!url":"https://nodejs.org/api/domain.html#domain_domain_create","!doc":"Returns a new Domain object."},Domain:{"!type":"fn()",prototype:{"!proto":"events.EventEmitter.prototype",run:{"!type":"fn(fn: fn())","!url":"https://nodejs.org/api/domain.html#domain_domain_run_fn","!doc":"Run the supplied function in the context of the domain, implicitly binding all event emitters, timers, and lowlevel requests that are created in that context."},members:{"!type":"[+events.EventEmitter]","!url":"https://nodejs.org/api/domain.html#domain_domain_members","!doc":"An array of timers and event emitters that have been explicitly added to the domain."},add:{"!type":"fn(emitter: +events.EventEmitter)","!url":"https://nodejs.org/api/domain.html#domain_domain_add_emitter","!doc":"Explicitly adds an emitter to the domain. If any event handlers called by the emitter throw an error, or if the emitter emits an error event, it will be routed to the domain's error event, just like with implicit binding."},remove:{"!type":"fn(emitter: +events.EventEmitter)","!url":"https://nodejs.org/api/domain.html#domain_domain_remove_emitter","!doc":"The opposite of domain.add(emitter). Removes domain handling from the specified emitter."},bind:{"!type":"fn(callback: fn(err: +Error, data: ?)) -> !0","!url":"https://nodejs.org/api/domain.html#domain_domain_bind_callback","!doc":"The returned function will be a wrapper around the supplied callback function. When the returned function is called, any errors that are thrown will be routed to the domain's error event."},intercept:{"!type":"fn(cb: fn(data: ?)) -> !0","!url":"https://nodejs.org/api/domain.html#domain_domain_intercept_callback","!doc":"This method is almost identical to domain.bind(callback). However, in addition to catching thrown errors, it will also intercept Error objects sent as the first argument to the function."},dispose:{"!type":"fn()","!url":"https://nodejs.org/api/domain.html#domain_domain_dispose","!doc":"The dispose method destroys a domain, and makes a best effort attempt to clean up any and all IO that is associated with the domain. Streams are aborted, ended, closed, and/or destroyed. Timers are cleared. Explicitly bound callbacks are no longer called. Any error events that are raised as a result of this are ignored."}},"!url":"https://nodejs.org/api/domain.html#domain_class_domain","!doc":"The Domain class encapsulates the functionality of routing errors and uncaught exceptions to the active Domain object."}},"os.cpuSpec":{model:"string",speed:"number",times:{user:"number",nice:"number",sys:"number",idle:"number",irq:"number"}},"process.memoryUsage.type":{rss:"number",heapTotal:"?",number:"?",heapUsed:"number"},"net.address":{port:"number",family:"string",address:"string"},"url.type":{href:"string",protocol:"string",auth:"string",hostname:"string",port:"string",host:"string",pathname:"string",search:"string",query:"string",slashes:"bool",hash:"string"},"tls.Server.credentials":{key:"string",cert:"string",ca:"string"},"tls.cipher":{name:"string",version:"string"},"crypto.credentials":{pfx:"string",key:"string",passphrase:"string",cert:"string",ca:"string",crl:"string",ciphers:"string"},buffer:{"!url":"https://nodejs.org/api/buffer.html","!doc":"Prior to the introduction of TypedArray in ECMAScript 2015 (ES6), the JavaScript language had no mechanism for reading or manipulating streams of binary data. The Buffer class was introduced as part of the Node.js API to make it possible to interact with octet streams in the context of things like TCP streams and file system operations.",Buffer:"Buffer",SlowBuffer:"Buffer",INSPECT_MAX_BYTES:{"!type":"number","!url":"https://nodejs.org/api/buffer.html#buffer_buffer_inspect_max_bytes","!doc":"Returns the maximum number of bytes that will be returned when buf.inspect() is called. This can be overridden by user modules. See util.inspect() for more details on buf.inspect() behavior."},kMaxLength:{"!type":"number","!url":"https://nodejs.org/api/buffer.html#buffer_buffer_kmaxlength","!doc":"On 32-bit architectures, this value is (2^30)-1 (~1GB). On 64-bit architectures, this value is (2^31)-1 (~2GB)."}},module:{},timers:{clearImmediate:{"!type":"fn(immediateObject: ?)","!url":"https://nodejs.org/api/timers.html#timers_clearimmediate_immediateobject","!doc":"Stops an immediate from triggering."},clearInterval:{"!type":"fn(intervalObject: timers.Timer)","!url":"https://nodejs.org/api/timers.html#timers_clearinterval_intervalobject","!doc":"Stops an interval from triggering."},clearTimeout:{"!type":"fn(timeoutObject: timers.Timer)","!url":"https://nodejs.org/api/timers.html#timers_cleartimeout_timeoutobject","!doc":"Prevents a timeout from triggering."},setImmediate:{"!type":"fn(callback: fn(), args?: ?) -> ?","!url":"https://nodejs.org/api/timers.html#timers_setimmediate_callback_arg","!doc":'To schedule the "immediate" execution of callback after I/O events callbacks and before setTimeout and setInterval. Returns an immediateObject for possible use with clearImmediate(). Optionally you can also pass arguments to the callback.'},setInterval:{"!type":"fn(callback: fn(), delay: number, args?: ?) -> timers.Timer","!url":"https://nodejs.org/api/timers.html#timers_setinterval_callback_delay_arg","!doc":"To schedule the repeated execution of callback every delay milliseconds. Returns a intervalObject for possible use with clearInterval(). Optionally you can also pass arguments to the callback."},setTimeout:{"!type":"fn(callback: fn(), delay: number, args?: ?) -> timers.Timer","!url":"https://nodejs.org/api/timers.html#timers_settimeout_callback_delay_arg","!doc":"To schedule execution of a one-time callback after delay milliseconds. Returns a timeoutObject for possible use with clearTimeout(). Optionally you can also pass arguments to the callback."},Timer:{ref:{"!type":"fn() -> timers.Timer","!url":"https://nodejs.org/api/timers.html#timers_ref","!doc":"If you had previously unref()d a timer you can call ref() to explicitly request the timer hold the program open. If the timer is already refd calling ref again will have no effect."},unref:{"!type":"fn() -> timers.Timer","!url":"https://nodejs.org/api/timers.html#timers_unref","!doc":"The opaque value returned by setTimeout and setInterval also has the method timer.unref() which will allow you to create a timer that is active but if it is the only item left in the event loop, it won't keep the program running. If the timer is already unrefd calling unref again will have no effect."}}}},process:{stdout:{"!type":"+stream.Writable","!url":"https://nodejs.org/api/process.html#process_process_stdout","!doc":"A Writable Stream to stdout."},stderr:{"!type":"+stream.Writable","!url":"https://nodejs.org/api/process.html#process_process_stderr","!doc":"A writable stream to stderr."},stdin:{"!type":"+stream.Readable","!url":"https://nodejs.org/api/process.html#process_process_stdin","!doc":"A Readable Stream for stdin. The stdin stream is paused by default, so one must call process.stdin.resume() to read from it."},argv:{"!type":"[string]","!url":"https://nodejs.org/api/process.html#process_process_argv","!doc":"An array containing the command line arguments. The first element will be 'node', the second element will be the name of the JavaScript file. The next elements will be any additional command line arguments."},execPath:{"!type":"string","!url":"https://nodejs.org/api/process.html#process_process_execpath","!doc":"This is the absolute pathname of the executable that started the process."},abort:{"!type":"fn()","!url":"https://nodejs.org/api/process.html#process_process_abort","!doc":"This causes node to emit an abort. This will cause node to exit and generate a core file."},chdir:{"!type":"fn(directory: string)","!url":"https://nodejs.org/api/process.html#process_process_chdir_directory","!doc":"Changes the current working directory of the process or throws an exception if that fails."},cwd:{"!type":"fn()","!url":"https://nodejs.org/api/process.html#process_process_cwd","!doc":"Returns the current working directory of the process."},env:{"!url":"https://nodejs.org/api/process.html#process_process_env","!doc":"An object containing the user environment."},exit:{"!type":"fn(code?: number)","!url":"https://nodejs.org/api/process.html#process_process_exit_code","!doc":"Ends the process with the specified code. If omitted, exit uses the 'success' code 0."},getgid:{"!type":"fn() -> number","!url":"https://nodejs.org/api/process.html#process_process_getgid","!doc":"Gets the group identity of the process. This is the numerical group id, not the group name."},setgid:{"!type":"fn(id: number)","!url":"https://nodejs.org/api/process.html#process_process_setgid_id","!doc":"Sets the group identity of the process. This accepts either a numerical ID or a groupname string. If a groupname is specified, this method blocks while resolving it to a numerical ID."},getuid:{"!type":"fn() -> number","!url":"https://nodejs.org/api/process.html#process_process_getuid","!doc":"Gets the user identity of the process. This is the numerical userid, not the username."},setuid:{"!type":"fn(id: number)","!url":"https://nodejs.org/api/process.html#process_process_setuid_id","!doc":"Sets the user identity of the process. This accepts either a numerical ID or a username string. If a username is specified, this method blocks while resolving it to a numerical ID."},version:{"!type":"string","!url":"https://nodejs.org/api/process.html#process_process_version","!doc":"A compiled-in property that exposes NODE_VERSION."},versions:{http_parser:"string",node:"string",v8:"string",ares:"string",uv:"string",zlib:"string",openssl:"string","!url":"https://nodejs.org/api/process.html#process_process_versions","!doc":"A property exposing version strings of node and its dependencies."}, config:{target_defaults:{cflags:"[?]",default_configuration:"string",defines:"[string]",include_dirs:"[string]",libraries:"[string]"},variables:{clang:"number",host_arch:"string",node_install_npm:"bool",node_install_waf:"bool",node_prefix:"string",node_shared_openssl:"bool",node_shared_v8:"bool",node_shared_zlib:"bool",node_use_dtrace:"bool",node_use_etw:"bool",node_use_openssl:"bool",target_arch:"string",v8_no_strict_aliasing:"number",v8_use_snapshot:"bool",visibility:"string"},"!url":"https://nodejs.org/api/process.html#process_process_config","!doc":'An Object containing the JavaScript representation of the configure options that were used to compile the current node executable. This is the same as the "config.gypi" file that was produced when running the ./configure script.'},kill:{"!type":"fn(pid: number, signal?: string)","!url":"https://nodejs.org/api/process.html#process_process_kill_pid_signal","!doc":"Send a signal to a process. pid is the process id and signal is the string describing the signal to send. Signal names are strings like 'SIGINT' or 'SIGUSR1'. If omitted, the signal will be 'SIGTERM'."},pid:{"!type":"number","!url":"https://nodejs.org/api/process.html#process_process_pid","!doc":"The PID of the process."},title:{"!type":"string","!url":"https://nodejs.org/api/process.html#process_process_title","!doc":"Getter/setter to set what is displayed in 'ps'."},arch:{"!type":"string","!url":"https://nodejs.org/api/process.html#process_process_arch","!doc":"What processor architecture you're running on: 'arm', 'ia32', or 'x64'."},platform:{"!type":"string","!url":"https://nodejs.org/api/process.html#process_process_platform","!doc":"What platform you're running on: 'darwin', 'freebsd', 'linux', 'sunos' or 'win32'"},memoryUsage:{"!type":"fn() -> process.memoryUsage.type","!url":"https://nodejs.org/api/process.html#process_process_memoryusage","!doc":"Returns an object describing the memory usage of the Node process measured in bytes."},nextTick:{"!type":"fn(callback: fn())","!url":"https://nodejs.org/api/process.html#process_process_nexttick_callback","!doc":"On the next loop around the event loop call this callback. This is not a simple alias to setTimeout(fn, 0), it's much more efficient. It typically runs before any other I/O events fire, but there are some exceptions."},maxTickDepth:{"!type":"number","!url":"https://nodejs.org/api/process.html#process_process_maxtickdepth","!doc":"The maximum depth of nextTick-calling nextTick-callbacks that will be evaluated before allowing other forms of I/O to occur."},umask:{"!type":"fn(mask?: number) -> number","!url":"https://nodejs.org/api/process.html#process_process_umask_mask","!doc":"Sets or reads the process's file mode creation mask. Child processes inherit the mask from the parent process. Returns the old mask if mask argument is given, otherwise returns the current mask."},uptime:{"!type":"fn() -> number","!url":"https://nodejs.org/api/process.html#process_process_uptime","!doc":"Number of seconds Node has been running."},hrtime:{"!type":"fn() -> [number]","!url":"https://nodejs.org/api/process.html#process_process_hrtime","!doc":"Returns the current high-resolution real time in a [seconds, nanoseconds] tuple Array. It is relative to an arbitrary time in the past. It is not related to the time of day and therefore not subject to clock drift. The primary use is for measuring performance between intervals."},"!url":"https://nodejs.org/api/globals.html#globals_process","!doc":"The process object."},global:{"!type":"<top>","!url":"https://nodejs.org/api/globals.html#globals_global","!doc":"In browsers, the top-level scope is the global scope. That means that in browsers if you're in the global scope var something will define a global variable. In Node this is different. The top-level scope is not the global scope; var something inside a Node module will be local to that module."},console:{log:{"!type":"fn(text: string)","!url":"https://nodejs.org/api/console.html#console_console_log_data","!doc":"Prints to stdout with newline. This function can take multiple arguments in a printf()-like way."},info:{"!type":"fn(text: string)","!url":"https://nodejs.org/api/console.html#console_console_info_data","!doc":"Same as console.log."},error:{"!type":"fn(text: string)","!url":"https://nodejs.org/api/console.html#console_console_error_data","!doc":"Same as console.log but prints to stderr."},warn:{"!type":"fn(text: string)","!url":"https://nodejs.org/api/console.html#console_console_warn_data","!doc":"Same as console.error."},dir:{"!type":"fn(obj: ?)","!url":"https://nodejs.org/api/console.html#console_console_dir_obj_options","!doc":"Uses util.inspect on obj and prints resulting string to stdout."},time:{"!type":"fn(label: string)","!url":"https://nodejs.org/api/console.html#console_console_time_label","!doc":"Mark a time."},timeEnd:{"!type":"fn(label: string)","!url":"https://nodejs.org/api/console.html#console_console_timeend_label","!doc":"Finish timer, record output."},trace:{"!type":"fn(label: string)","!url":"https://nodejs.org/api/console.html#console_console_trace_message","!doc":"Print a stack trace to stderr of the current position."},assert:{"!type":"fn(expression: bool)","!url":"https://nodejs.org/api/console.html#console_console_assert_value_message","!doc":"Same as assert.ok() where if the expression evaluates as false throw an AssertionError with message."},"!url":"https://nodejs.org/api/globals.html#globals_console","!doc":"Used to print to stdout and stderr."},__filename:{"!type":"string","!url":"https://nodejs.org/api/globals.html#globals_filename","!doc":"The filename of the code being executed. This is the resolved absolute path of this code file. For a main program this is not necessarily the same filename used in the command line. The value inside a module is the path to that module file."},__dirname:{"!type":"string","!url":"https://nodejs.org/api/globals.html#globals_dirname","!doc":"The name of the directory that the currently executing script resides in."},clearImmediate:"timers.clearImmediate",clearInterval:"timers.clearInterval",clearTimeout:"timers.clearTimeout",setImmediate:"timers.setImmediate",setInterval:"timers.setInterval",setTimeout:"timers.setTimeout",Buffer:{"!type":"fn(sizeOrSource: number|[number]|+ArrayBuffer|+Buffer|string, byteOffsetOrEncoding?: number|string, length?: number) -> +Buffer","!url":"https://nodejs.org/api/buffer.html#buffer_class_buffer","!doc":"The Buffer class is a global type for dealing with binary data directly. It can be constructed in a variety of ways.",prototype:{length:{"!type":"number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_length","!doc":'Returns the amount of memory allocated for buf in bytes. Note that this does not necessarily reflect the amount of "usable" data within buf.'},compare:{"!type":"fn(target: +Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_compare_target_targetstart_targetend_sourcestart_sourceend","!doc":"Compares buf with target and returns a number indicating whether buf comes before, after, or is the same as target in sort order. Comparison is based on the actual sequence of bytes in each Buffer."},copy:{"!type":"fn(target: +Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_copy_target_targetstart_sourcestart_sourceend","!doc":"Copies data from a region of buf to a region in target even if the target memory region overlaps with buf."},entries:{"!type":"fn() -> +iter[:t=[number, number]]","!url":"https://nodejs.org/api/buffer.html#buffer_buf_entries","!doc":"Creates and returns an iterator of [index, byte] pairs from the contents of buf."},equals:{"!type":"fn(otherBuffer: +Buffer) -> bool","!url":"https://nodejs.org/api/buffer.html#buffer_buf_equals_otherbuffer","!doc":"Returns true if both buf and otherBuffer have exactly the same bytes, false otherwise."},fill:{"!type":"fn(value: string|+Buffer|number, offset?: number, end?: number, encoding?: string) -> +Buffer","!url":"https://nodejs.org/api/buffer.html#buffer_buf_fill_value_offset_end_encoding","!doc":"Fills buf with the specified value. If the offset and end are not given, the entire buf will be filled. This is meant to be a small simplification to allow the creation and filling of a Buffer to be done on a single line."},indexOf:{"!type":"fn(value: string|+Buffer|number, byteOffset?: number, encoding?: string) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_indexof_value_byteoffset_encoding","!doc":"If value is:"},includes:{"!type":"fn(value: string|+Buffer|number, byteOffset?: number, encoding?: string) -> bool","!url":"https://nodejs.org/api/buffer.html#buffer_buf_includes_value_byteoffset_encoding","!doc":"Equivalent to buf.indexOf() !== -1."},keys:{"!type":"fn() -> +iter[:t=number]","!url":"https://nodejs.org/api/buffer.html#buffer_buf_keys","!doc":"Creates and returns an iterator of buf keys (indices)."},lastIndexOf:{"!type":"fn(value: string|+Buffer|number, byteOffset?: number, encoding?: string) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_lastindexof_value_byteoffset_encoding","!doc":"Identical to buf.indexOf(), except buf is searched from back to front instead of front to back."},readDoubleBE:{"!type":"fn(offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readdoublebe_offset_noassert","!doc":"Reads a 64-bit double from buf at the specified offset with specified endian format (readDoubleBE() returns big endian, readDoubleLE() returns little endian)."},readDoubleLE:{"!type":"fn(offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readdoublele_offset_noassert","!doc":"Reads a 64-bit double from buf at the specified offset with specified endian format (readDoubleBE() returns big endian, readDoubleLE() returns little endian)."},readFloatBE:{"!type":"fn(offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readfloatbe_offset_noassert","!doc":"Reads a 32-bit float from buf at the specified offset with specified endian format (readFloatBE() returns big endian, readFloatLE() returns little endian)."},readFloatLE:{"!type":"fn(offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readfloatle_offset_noassert","!doc":"Reads a 32-bit float from buf at the specified offset with specified endian format (readFloatBE() returns big endian, readFloatLE() returns little endian)."},readInt8:{"!type":"fn(offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readint8_offset_noassert","!doc":"Reads a signed 8-bit integer from buf at the specified offset."},readInt16BE:{"!type":"fn(offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readint16be_offset_noassert","!doc":"Reads a signed 16-bit integer from buf at the specified offset with the specified endian format (readInt16BE() returns big endian, readInt16LE() returns little endian)."},readInt16LE:{"!type":"fn(offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readint16le_offset_noassert","!doc":"Reads a signed 16-bit integer from buf at the specified offset with the specified endian format (readInt16BE() returns big endian, readInt16LE() returns little endian)."},readInt32BE:{"!type":"fn(offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readint32be_offset_noassert","!doc":"Reads a signed 32-bit integer from buf at the specified offset with the specified endian format (readInt32BE() returns big endian, readInt32LE() returns little endian)."},readInt32LE:{"!type":"fn(offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readint32le_offset_noassert","!doc":"Reads a signed 32-bit integer from buf at the specified offset with the specified endian format (readInt32BE() returns big endian, readInt32LE() returns little endian)."},readIntBE:{"!type":"fn(offset: number, byteLength: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readintbe_offset_bytelength_noassert","!doc":"Reads byteLength number of bytes from buf at the specified offset and interprets the result as a two's complement signed value. Supports up to 48 bits of accuracy."},readIntLE:{"!type":"fn(offset: number, byteLength: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readintle_offset_bytelength_noassert","!doc":"Reads byteLength number of bytes from buf at the specified offset and interprets the result as a two's complement signed value. Supports up to 48 bits of accuracy."},readUInt8:{"!type":"fn(offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readuint8_offset_noassert","!doc":"Reads an unsigned 8-bit integer from buf at the specified offset."},readUInt16BE:{"!type":"fn(offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readuint16be_offset_noassert","!doc":"Reads an unsigned 16-bit integer from buf at the specified offset with specified endian format (readUInt16BE() returns big endian, readUInt16LE() returns little endian)."},readUInt16LE:{"!type":"fn(offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readuint16le_offset_noassert","!doc":"Reads an unsigned 16-bit integer from buf at the specified offset with specified endian format (readUInt16BE() returns big endian, readUInt16LE() returns little endian)."},readUInt32BE:{"!type":"fn(offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readuint32be_offset_noassert","!doc":"Reads an unsigned 32-bit integer from buf at the specified offset with specified endian format (readUInt32BE() returns big endian, readUInt32LE() returns little endian)."},readUInt32LE:{"!type":"fn(offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readuint32le_offset_noassert","!doc":"Reads an unsigned 32-bit integer from buf at the specified offset with specified endian format (readUInt32BE() returns big endian, readUInt32LE() returns little endian)."},readUIntBE:{"!type":"fn(offset: number, byteLength: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readuintbe_offset_bytelength_noassert","!doc":"Reads byteLength number of bytes from buf at the specified offset and interprets the result as an unsigned integer. Supports up to 48 bits of accuracy."},readUIntLE:{"!type":"fn(offset: number, byteLength: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_readuintle_offset_bytelength_noassert","!doc":"Reads byteLength number of bytes from buf at the specified offset and interprets the result as an unsigned integer. Supports up to 48 bits of accuracy."},slice:{"!type":"fn(start?: number, end?: number) -> +Buffer","!url":"https://nodejs.org/api/buffer.html#buffer_buf_slice_start_end","!doc":"Returns a new Buffer that references the same memory as the original, but offset and cropped by the start and end indices."},swap16:{"!type":"fn() -> +Buffer","!url":"https://nodejs.org/api/buffer.html#buffer_buf_swap16","!doc":"Interprets buf as an array of unsigned 16-bit integers and swaps the byte-order in-place. Throws a RangeError if buf.length is not a multiple of 2."},swap32:{"!type":"fn() -> +Buffer","!url":"https://nodejs.org/api/buffer.html#buffer_buf_swap32","!doc":"Interprets buf as an array of unsigned 32-bit integers and swaps the byte-order in-place. Throws a RangeError if buf.length is not a multiple of 4."},swap64:{"!type":"fn() -> +Buffer","!url":"https://nodejs.org/api/buffer.html#buffer_buf_swap64","!doc":"Interprets buf as an array of 64-bit numbers and swaps the byte-order in-place. Throws a RangeError if buf.length is not a multiple of 8."},toString:{"!type":"fn(encoding?: string, start?: number, end?: number) -> string","!url":"https://nodejs.org/api/buffer.html#buffer_buf_tostring_encoding_start_end","!doc":"Decodes buf to a string according to the specified character encoding in encoding. start and end may be passed to decode only a subset of buf."},toJSON:{"!type":"fn()","!url":"https://nodejs.org/api/buffer.html#buffer_buf_tojson","!doc":"Returns a JSON representation of buf. JSON.stringify() implicitly calls this function when stringifying a Buffer instance."},values:{"!type":"fn() -> +iter[:t=number]","!url":"https://nodejs.org/api/buffer.html#buffer_buf_values","!doc":"Creates and returns an iterator for buf values (bytes). This function is called automatically when a Buffer is used in a for..of statement."},write:{"!type":"fn(string: string, offset?: number, length?: number, encoding?: string) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_write_string_offset_length_encoding","!doc":"Writes string to buf at offset according to the character encoding in encoding. The length parameter is the number of bytes to write. If buf did not contain enough space to fit the entire string, only a partial amount of string will be written. However, partially encoded characters will not be written."},writeDoubleBE:{"!type":"fn(value: number, offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writedoublebe_value_offset_noassert","!doc":"Writes value to buf at the specified offset with specified endian format (writeDoubleBE() writes big endian, writeDoubleLE() writes little endian). value should be a valid 64-bit double. Behavior is undefined when value is anything other than a 64-bit double."},writeDoubleLE:{"!type":"fn(value: number, offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writedoublele_value_offset_noassert","!doc":"Writes value to buf at the specified offset with specified endian format (writeDoubleBE() writes big endian, writeDoubleLE() writes little endian). value should be a valid 64-bit double. Behavior is undefined when value is anything other than a 64-bit double."},writeFloatBE:{"!type":"fn(value: number, offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writefloatbe_value_offset_noassert","!doc":"Writes value to buf at the specified offset with specified endian format (writeFloatBE() writes big endian, writeFloatLE() writes little endian). value should be a valid 32-bit float. Behavior is undefined when value is anything other than a 32-bit float."},writeFloatLE:{"!type":"fn(value: number, offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writefloatle_value_offset_noassert","!doc":"Writes value to buf at the specified offset with specified endian format (writeFloatBE() writes big endian, writeFloatLE() writes little endian). value should be a valid 32-bit float. Behavior is undefined when value is anything other than a 32-bit float."},writeInt8:{"!type":"fn(value: number, offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writeint8_value_offset_noassert","!doc":"Writes value to buf at the specified offset. value should be a valid signed 8-bit integer. Behavior is undefined when value is anything other than a signed 8-bit integer."},writeInt16BE:{"!type":"fn(value: number, offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writeint16be_value_offset_noassert","!doc":"Writes value to buf at the specified offset with specified endian format (writeInt16BE() writes big endian, writeInt16LE() writes little endian). value should be a valid signed 16-bit integer. Behavior is undefined when value is anything other than a signed 16-bit integer."},writeInt16LE:{"!type":"fn(value: number, offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writeint16le_value_offset_noassert","!doc":"Writes value to buf at the specified offset with specified endian format (writeInt16BE() writes big endian, writeInt16LE() writes little endian). value should be a valid signed 16-bit integer. Behavior is undefined when value is anything other than a signed 16-bit integer."},writeInt32BE:{"!type":"fn(value: number, offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writeint32be_value_offset_noassert","!doc":"Writes value to buf at the specified offset with specified endian format (writeInt32BE() writes big endian, writeInt32LE() writes little endian). value should be a valid signed 32-bit integer. Behavior is undefined when value is anything other than a signed 32-bit integer."},writeInt32LE:{"!type":"fn(value: number, offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writeint32le_value_offset_noassert","!doc":"Writes value to buf at the specified offset with specified endian format (writeInt32BE() writes big endian, writeInt32LE() writes little endian). value should be a valid signed 32-bit integer. Behavior is undefined when value is anything other than a signed 32-bit integer."},writeIntBE:{"!type":"fn(value: number, offset: number, byteLength: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writeintbe_value_offset_bytelength_noassert","!doc":"Writes byteLength bytes of value to buf at the specified offset. Supports up to 48 bits of accuracy. Behavior is undefined when value is anything other than a signed integer."},writeIntLE:{"!type":"fn(value: number, offset: number, byteLength: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writeintle_value_offset_bytelength_noassert","!doc":"Writes byteLength bytes of value to buf at the specified offset. Supports up to 48 bits of accuracy. Behavior is undefined when value is anything other than a signed integer."},writeUInt8:{"!type":"fn(value: number, offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writeuint8_value_offset_noassert","!doc":"Writes value to buf at the specified offset. value should be a valid unsigned 8-bit integer. Behavior is undefined when value is anything other than an unsigned 8-bit integer."},writeUInt16BE:{"!type":"fn(value: number, offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writeuint16be_value_offset_noassert","!doc":"Writes value to buf at the specified offset with specified endian format (writeUInt16BE() writes big endian, writeUInt16LE() writes little endian). value should be a valid unsigned 16-bit integer. Behavior is undefined when value is anything other than an unsigned 16-bit integer."},writeUInt16LE:{"!type":"fn(value: number, offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writeuint16le_value_offset_noassert","!doc":"Writes value to buf at the specified offset with specified endian format (writeUInt16BE() writes big endian, writeUInt16LE() writes little endian). value should be a valid unsigned 16-bit integer. Behavior is undefined when value is anything other than an unsigned 16-bit integer."},writeUInt32BE:{"!type":"fn(value: number, offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writeuint32be_value_offset_noassert","!doc":"Writes value to buf at the specified offset with specified endian format (writeUInt32BE() writes big endian, writeUInt32LE() writes little endian). value should be a valid unsigned 32-bit integer. Behavior is undefined when value is anything other than an unsigned 32-bit integer."},writeUInt32LE:{"!type":"fn(value: number, offset: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writeuint32le_value_offset_noassert","!doc":"Writes value to buf at the specified offset with specified endian format (writeUInt32BE() writes big endian, writeUInt32LE() writes little endian). value should be a valid unsigned 32-bit integer. Behavior is undefined when value is anything other than an unsigned 32-bit integer."},writeUIntBE:{"!type":"fn(value: number, offset: number, byteLength: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writeuintbe_value_offset_bytelength_noassert","!doc":"Writes byteLength bytes of value to buf at the specified offset. Supports up to 48 bits of accuracy. Behavior is undefined when value is anything other than an unsigned integer."},writeUIntLE:{"!type":"fn(value: number, offset: number, byteLength: number, noAssert?: bool) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_buf_writeuintle_value_offset_bytelength_noassert","!doc":"Writes byteLength bytes of value to buf at the specified offset. Supports up to 48 bits of accuracy. Behavior is undefined when value is anything other than an unsigned integer."},"!proto":"Uint8Array.prototype"},alloc:{"!type":"fn(size: number, fill?: string|+Buffer|number, encoding?: string)","!url":"https://nodejs.org/api/buffer.html#buffer_class_method_buffer_alloc_size_fill_encoding","!doc":"Allocates a new Buffer of size bytes. If fill is undefined, the Buffer will be zero-filled."},allocUnsafe:{"!type":"fn(size: number)","!url":"https://nodejs.org/api/buffer.html#buffer_class_method_buffer_allocunsafe_size","!doc":"Allocates a new non-zero-filled Buffer of size bytes. The size must be less than or equal to the value of buffer.kMaxLength. Otherwise, a RangeError is thrown. A zero-length Buffer will be created if size <= 0."},allocUnsafeSlow:{"!type":"fn(size: number)","!url":"https://nodejs.org/api/buffer.html#buffer_class_method_buffer_allocunsafeslow_size","!doc":"Allocates a new non-zero-filled and non-pooled Buffer of size bytes. The size must be less than or equal to the value of buffer.kMaxLength. Otherwise, a RangeError is thrown. A zero-length Buffer will be created if size <= 0."},byteLength:{"!type":"fn(string: ?, encoding?: string) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_class_method_buffer_bytelength_string_encoding","!doc":"Returns the actual byte length of a string. This is not the same as String.prototype.length since that returns the number of characters in a string."},compare:{"!type":"fn(buf1: +Buffer, buf2: +Buffer) -> number","!url":"https://nodejs.org/api/buffer.html#buffer_class_method_buffer_compare_buf1_buf2","!doc":"Compares buf1 to buf2 typically for the purpose of sorting arrays of Buffer instances. This is equivalent to calling buf1.compare(buf2)."},concat:{"!type":"fn(list: ?, totalLength?: number) -> +Buffer","!url":"https://nodejs.org/api/buffer.html#buffer_class_method_buffer_concat_list_totallength","!doc":"Returns a new Buffer which is the result of concatenating all the Buffer instances in the list together."},from:{"!type":"fn(source: [number]|+ArrayBuffer|+Buffer|string, byteOffsetOrEncoding?: number|string, length?: number) -> +Buffer","!url":"https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_string_encoding","!doc":"Creates a new Buffer from existing array, ArrayBuffer, Buffer, or string."},isBuffer:{"!type":"fn(obj: ?) -> bool","!url":"https://nodejs.org/api/buffer.html#buffer_class_method_buffer_isbuffer_obj","!doc":"Returns true if obj is a Buffer, false otherwise."},isEncoding:{"!type":"fn(encoding: string) -> bool","!url":"https://nodejs.org/api/buffer.html#buffer_class_method_buffer_isencoding_encoding","!doc":"Returns true if encoding contains a supported character encoding, or false otherwise."},poolSize:{"!type":"number","!url":"https://nodejs.org/api/buffer.html#buffer_class_property_buffer_poolsize","!doc":"This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. This value may be modified."}}}}); //# sourceMappingURL=node.min.js.map
ahocevar/cdnjs
ajax/libs/tern/0.21.0/plugin/node.min.js
JavaScript
mit
156,254
ej.addCulture( "prs", { name: "prs", englishName: "Dari", nativeName: "Ψ―Ψ±Ω‰", language: "prs", isRTL: true, numberFormat: { pattern: ["n-"], ",": ".", ".": ",", "NaN": "ΨΊ ΨΉ", negativeInfinity: "-∞", positiveInfinity: "∞", percent: { pattern: ["%n-","%n"], ",": ".", ".": "," }, currency: { pattern: ["$n-","$n"], symbol: "Ψ‹" } }, calendars: { standard: { name: "Hijri", firstDay: 6, days: { names: ["ΫŒΪ©Ψ΄Ω†Ψ¨Ω‡","Ψ―ΩˆΨ΄Ω†Ψ¨Ω‡","Ψ³Ω‡\u200c Ψ΄Ω†Ψ¨Ω‡","Ϊ†Ω‡Ψ§Ψ± Ψ΄Ω†Ψ¨Ω‡","ΩΎΩ†Ψ¬Ψ΄Ω†Ψ¨Ω‡","Ψ¬Ω…ΨΉΩ‡","Ψ΄Ω†Ψ¨Ω‡"], namesAbbr: ["ΫŒΪ©Ψ΄Ω†Ψ¨Ω‡","Ψ―ΩˆΨ΄Ω†Ψ¨Ω‡","Ψ³Ω‡\u200c Ψ΄Ω†Ψ¨Ω‡","Ϊ†Ω‡Ψ§Ψ± Ψ΄Ω†Ψ¨Ω‡","ΩΎΩ†Ψ¬Ψ΄Ω†Ψ¨Ω‡","Ψ¬Ω…ΨΉΩ‡","Ψ΄Ω†Ψ¨Ω‡"], namesShort: ["ی","Ψ―","Ψ³","Ϊ†","ΩΎ","Ψ¬","Ψ΄"] }, months: { names: ["Ω…Ψ­Ψ±Ω‘Ω…","ءفر","ربيع Ψ§Ω„Ψ£ΩˆΩ‘Ω„","ربيع Ψ§Ω„Ψ«Ψ§Ω†ΩŠ","Ψ¬Ω…Ψ§Ψ―Ω‰ Ψ§Ω„Ψ£ΩˆΩ„","Ψ¬Ω…Ψ§Ψ―Ω‰ Ψ§Ω„Ψ«Ψ§Ω†ΩŠ","Ψ±Ψ¬Ψ¨","Ψ΄ΨΉΨ¨Ψ§Ω†","Ψ±Ω…ΨΆΨ§Ω†","Ψ΄ΩˆΩ‘Ψ§Ω„","ذو Ψ§Ω„Ω‚ΨΉΨ―Ψ©","ذو Ψ§Ω„Ψ­Ψ¬Ω‘Ψ©",""], namesAbbr: ["Ω…Ψ­Ψ±Ω‘Ω…","ءفر","ربيع Ψ§Ω„Ψ£ΩˆΩ‘Ω„","ربيع Ψ§Ω„Ψ«Ψ§Ω†ΩŠ","Ψ¬Ω…Ψ§Ψ―Ω‰ Ψ§Ω„Ψ£ΩˆΩ„","Ψ¬Ω…Ψ§Ψ―Ω‰ Ψ§Ω„Ψ«Ψ§Ω†ΩŠ","Ψ±Ψ¬Ψ¨","Ψ΄ΨΉΨ¨Ψ§Ω†","Ψ±Ω…ΨΆΨ§Ω†","Ψ΄ΩˆΩ‘Ψ§Ω„","ذو Ψ§Ω„Ω‚ΨΉΨ―Ψ©","ذو Ψ§Ω„Ψ­Ψ¬Ω‘Ψ©",""] }, AM: ["ΨΊ.Ω…","ΨΊ.Ω…","ΨΊ.Ω…"], PM: ["ΨΊ.و","ΨΊ.و","ΨΊ.و"], twoDigitYearMax: 1451, patterns: { d: "yyyy/M/d", D: "yyyy, dd, MMMM, dddd", f: "yyyy, dd, MMMM, dddd h:mm tt", F: "yyyy, dd, MMMM, dddd h:mm:ss tt", M: "d MMMM" }, convert: { // Adapted to Script from System.Globalization.HijriCalendar ticks1970: 62135596800000, // number of days leading up to each month monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355], minDate: -42521673600000, maxDate: 253402300799999, // The number of days to add or subtract from the calendar to accommodate the variances // in the start and the end of Ramadan and to accommodate the date difference between // countries/regions. May be dynamically adjusted based on user preference, but should // remain in the range of -2 to 2, inclusive. hijriAdjustment: 0, toGregorian: function(hyear, hmonth, hday) { var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment; // 86400000 = ticks per day var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970); // adjust for timezone, because we are interested in the gregorian date for the same timezone // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base // date in the current timezone. gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset()); return gdate; }, fromGregorian: function(gdate) { if ((gdate < this.minDate) || (gdate > this.maxDate)) return null; var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000, daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment; // very particular formula determined by someone smart, adapted from the server-side implementation. // it approximates the hijri year. var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1, absDays = this.daysToYear(hyear), daysInYear = this.isLeapYear(hyear) ? 355 : 354; // hyear is just approximate, it may need adjustment up or down by 1. if (daysSinceJan0101 < absDays) { hyear--; absDays -= daysInYear; } else if (daysSinceJan0101 === absDays) { hyear--; absDays = this.daysToYear(hyear); } else { if (daysSinceJan0101 > (absDays + daysInYear)) { absDays += daysInYear; hyear++; } } // determine month by looking at how many days into the hyear we are // monthDays contains the number of days up to each month. hmonth = 0; var daysIntoYear = daysSinceJan0101 - absDays; while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) { hmonth++; } hmonth--; hday = daysIntoYear - this.monthDays[hmonth]; return [hyear, hmonth, hday]; }, daysToYear: function(year) { // calculates how many days since Jan 1, 0001 var yearsToYear30 = Math.floor((year - 1) / 30) * 30, yearsInto30 = year - yearsToYear30 - 1, days = Math.floor((yearsToYear30 * 10631) / 30) + 227013; while (yearsInto30 > 0) { days += (this.isLeapYear(yearsInto30) ? 355 : 354); yearsInto30--; } return days; }, isLeapYear: function(year) { return ((((year * 11) + 14) % 30) < 11); } } }, Gregorian_Localized: { firstDay: 6, days: { names: ["ΫŒΪ©Ψ΄Ω†Ψ¨Ω‡","Ψ―ΩˆΨ΄Ω†Ψ¨Ω‡","Ψ³Ω‡\u200c Ψ΄Ω†Ψ¨Ω‡","Ϊ†Ω‡Ψ§Ψ± Ψ΄Ω†Ψ¨Ω‡","ΩΎΩ†Ψ¬Ψ΄Ω†Ψ¨Ω‡","Ψ¬Ω…ΨΉΩ‡","Ψ΄Ω†Ψ¨Ω‡"], namesAbbr: ["ΫŒΪ©Ψ΄Ω†Ψ¨Ω‡","Ψ―ΩˆΨ΄Ω†Ψ¨Ω‡","Ψ³Ω‡\u200c Ψ΄Ω†Ψ¨Ω‡","Ϊ†Ω‡Ψ§Ψ± Ψ΄Ω†Ψ¨Ω‡","ΩΎΩ†Ψ¬Ψ΄Ω†Ψ¨Ω‡","Ψ¬Ω…ΨΉΩ‡","Ψ΄Ω†Ψ¨Ω‡"], namesShort: ["ی","Ψ―","Ψ³","Ϊ†","ΩΎ","Ψ¬","Ψ΄"] }, months: { names: ["جدی","Ψ―Ω„Ωˆ","حوΨͺ","Ψ­Ω…Ω„","ثور","جوزا","Ψ³Ψ±Ψ·Ψ§Ω†","Ψ§Ψ³Ψ―","Ψ³Ω†Ψ¨Ω„Ω‡","Ω…ΫŒΨ²Ψ§Ω†","ΨΉΩ‚Ψ±Ψ¨","Ω‚ΩˆΨ³",""], namesAbbr: ["جدی","Ψ―Ω„Ωˆ","حوΨͺ","Ψ­Ω…Ω„","ثور","جوزا","Ψ³Ψ±Ψ·Ψ§Ω†","Ψ§Ψ³Ψ―","Ψ³Ω†Ψ¨Ω„Ω‡","Ω…ΫŒΨ²Ψ§Ω†","ΨΉΩ‚Ψ±Ψ¨","Ω‚ΩˆΨ³",""] }, AM: ["ΨΊ.Ω…","ΨΊ.Ω…","ΨΊ.Ω…"], PM: ["ΨΊ.و","ΨΊ.و","ΨΊ.و"], patterns: { d: "yyyy/M/d", D: "yyyy, dd, MMMM, dddd", f: "yyyy, dd, MMMM, dddd h:mm tt", F: "yyyy, dd, MMMM, dddd h:mm:ss tt", M: "d MMMM" } } } });
abishekrsrikaanth/jsdelivr
files/syncfusion-ej-global/14.4.15/i18n/ej.culture.prs.js
JavaScript
mit
6,888
// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var common = require('../common'); var assert = require('assert'); var StringDecoder = require('../../').StringDecoder; var decoder = new StringDecoder('utf8'); var buffer = new Buffer('$'); assert.deepEqual('$', decoder.write(buffer)); buffer = new Buffer('Β’'); assert.deepEqual('', decoder.write(buffer.slice(0, 1))); assert.deepEqual('Β’', decoder.write(buffer.slice(1, 2))); buffer = new Buffer('€'); assert.deepEqual('', decoder.write(buffer.slice(0, 1))); assert.deepEqual('', decoder.write(buffer.slice(1, 2))); assert.deepEqual('€', decoder.write(buffer.slice(2, 3))); buffer = new Buffer([0xF0, 0xA4, 0xAD, 0xA2]); var s = ''; s += decoder.write(buffer.slice(0, 1)); s += decoder.write(buffer.slice(1, 2)); s += decoder.write(buffer.slice(2, 3)); s += decoder.write(buffer.slice(3, 4)); assert.ok(s.length > 0); // CESU-8 buffer = new Buffer('EDA0BDEDB18D', 'hex'); // THUMBS UP SIGN (in CESU-8) var s = ''; s += decoder.write(buffer.slice(0, 1)); s += decoder.write(buffer.slice(1, 2)); s += decoder.write(buffer.slice(2, 3)); // complete lead surrogate assert.equal(s, ''); s += decoder.write(buffer.slice(3, 4)); s += decoder.write(buffer.slice(4, 5)); s += decoder.write(buffer.slice(5, 6)); // complete trail surrogate assert.equal(s, '\uD83D\uDC4D'); // THUMBS UP SIGN (in UTF-16) var s = ''; s += decoder.write(buffer.slice(0, 2)); s += decoder.write(buffer.slice(2, 4)); // complete lead surrogate assert.equal(s, ''); s += decoder.write(buffer.slice(4, 6)); // complete trail surrogate assert.equal(s, '\uD83D\uDC4D'); // THUMBS UP SIGN (in UTF-16) var s = ''; s += decoder.write(buffer.slice(0, 3)); // complete lead surrogate assert.equal(s, ''); s += decoder.write(buffer.slice(3, 6)); // complete trail surrogate assert.equal(s, '\uD83D\uDC4D'); // THUMBS UP SIGN (in UTF-16) var s = ''; s += decoder.write(buffer.slice(0, 4)); // complete lead surrogate assert.equal(s, ''); s += decoder.write(buffer.slice(4, 5)); s += decoder.write(buffer.slice(5, 6)); // complete trail surrogate assert.equal(s, '\uD83D\uDC4D'); // THUMBS UP SIGN (in UTF-16) var s = ''; s += decoder.write(buffer.slice(0, 5)); // complete lead surrogate assert.equal(s, ''); s += decoder.write(buffer.slice(5, 6)); // complete trail surrogate assert.equal(s, '\uD83D\uDC4D'); // THUMBS UP SIGN (in UTF-16) var s = ''; s += decoder.write(buffer.slice(0, 6)); assert.equal(s, '\uD83D\uDC4D'); // THUMBS UP SIGN (in UTF-16) // UCS-2 decoder = new StringDecoder('ucs2'); buffer = new Buffer('ab', 'ucs2'); assert.equal(decoder.write(buffer), 'ab'); // 2 complete chars buffer = new Buffer('abc', 'ucs2'); assert.equal(decoder.write(buffer.slice(0, 3)), 'a'); // 'a' and first of 'b' assert.equal(decoder.write(buffer.slice(3, 6)), 'bc'); // second of 'b' and 'c' // UTF-16LE buffer = new Buffer('3DD84DDC', 'hex'); // THUMBS UP SIGN (in CESU-8) var s = ''; s += decoder.write(buffer.slice(0, 1)); s += decoder.write(buffer.slice(1, 2)); // complete lead surrogate assert.equal(s, ''); s += decoder.write(buffer.slice(2, 3)); s += decoder.write(buffer.slice(3, 4)); // complete trail surrogate assert.equal(s, '\uD83D\uDC4D'); // THUMBS UP SIGN (in UTF-16) var s = ''; s += decoder.write(buffer.slice(0, 2)); // complete lead surrogate assert.equal(s, ''); s += decoder.write(buffer.slice(2, 4)); // complete trail surrogate assert.equal(s, '\uD83D\uDC4D'); // THUMBS UP SIGN (in UTF-16) var s = ''; s += decoder.write(buffer.slice(0, 3)); // complete lead surrogate assert.equal(s, ''); s += decoder.write(buffer.slice(3, 4)); // complete trail surrogate assert.equal(s, '\uD83D\uDC4D'); // THUMBS UP SIGN (in UTF-16) var s = ''; s += decoder.write(buffer.slice(0, 4)); assert.equal(s, '\uD83D\uDC4D'); // THUMBS UP SIGN (in UTF-16) // A mixed ascii and non-ascii string // Test stolen from deps/v8/test/cctest/test-strings.cc // U+02E4 -> CB A4 // U+0064 -> 64 // U+12E4 -> E1 8B A4 // U+0030 -> 30 // U+3045 -> E3 81 85 var expected = '\u02e4\u0064\u12e4\u0030\u3045'; var buffer = new Buffer([0xCB, 0xA4, 0x64, 0xE1, 0x8B, 0xA4, 0x30, 0xE3, 0x81, 0x85]); var charLengths = [0, 0, 1, 2, 2, 2, 3, 4, 4, 4, 5, 5]; // Split the buffer into 3 segments // |----|------|-------| // 0 i j buffer.length // Scan through every possible 3 segment combination // and make sure that the string is always parsed. common.print('scanning '); for (var j = 2; j < buffer.length; j++) { for (var i = 1; i < j; i++) { var decoder = new StringDecoder('utf8'); var sum = decoder.write(buffer.slice(0, i)); // just check that we've received the right amount // after the first write assert.equal(charLengths[i], sum.length); sum += decoder.write(buffer.slice(i, j)); sum += decoder.write(buffer.slice(j, buffer.length)); assert.equal(expected, sum); common.print('.'); } } console.log(' crayon!');
Flareninja/Other-Metas
node_modules/gulp-util/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/test/simple/test-string-decoder.js
JavaScript
mit
6,014
// moment.js language configuration // language : Morocco Central Atlas TamaziΙ£t in Latin (tzm-la) // author : Abdel Said : https://github.com/abdelsaid (function (factory) { if (typeof define === 'function' && define.amd) { define(['moment'], factory); // AMD } else if (typeof exports === 'object') { module.exports = factory(require('../moment')); // Node } else { factory(window.moment); // Browser global } }(function (moment) { return moment.lang('tzm-la', { months : "innayr_brΛ€ayrΛ€_marΛ€sΛ€_ibrir_mayyw_ywnyw_ywlywz_Ι£wΕ‘t_Ε‘wtanbir_ktΛ€wbrΛ€_nwwanbir_dwjnbir".split("_"), monthsShort : "innayr_brΛ€ayrΛ€_marΛ€sΛ€_ibrir_mayyw_ywnyw_ywlywz_Ι£wΕ‘t_Ε‘wtanbir_ktΛ€wbrΛ€_nwwanbir_dwjnbir".split("_"), weekdays : "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), weekdaysShort : "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), weekdaysMin : "asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"), longDateFormat : { LT : "HH:mm", L : "DD/MM/YYYY", LL : "D MMMM YYYY", LLL : "D MMMM YYYY LT", LLLL : "dddd D MMMM YYYY LT" }, calendar : { sameDay: "[asdkh g] LT", nextDay: '[aska g] LT', nextWeek: 'dddd [g] LT', lastDay: '[assant g] LT', lastWeek: 'dddd [g] LT', sameElse: 'L' }, relativeTime : { future : "dadkh s yan %s", past : "yan %s", s : "imik", m : "minuḍ", mm : "%d minuḍ", h : "saΙ›a", hh : "%d tassaΙ›in", d : "ass", dd : "%d ossan", M : "ayowr", MM : "%d iyyirn", y : "asgas", yy : "%d isgasn" }, week : { dow : 6, // Saturday is the first day of the week. doy : 12 // The week that contains Jan 1st is the first week of the year. } }); }));
dhenson02/cdnjs
ajax/libs/moment.js/2.4.0/lang/tzm-la.js
JavaScript
mit
2,066
var BlockStream = require("../block-stream.js") var blockSizes = [16]//, 25]//, 1024] , writeSizes = [4, 15, 16, 17, 64 ]//, 64, 100] , writeCounts = [1, 10]//, 100] , tap = require("tap") writeCounts.forEach(function (writeCount) { blockSizes.forEach(function (blockSize) { writeSizes.forEach(function (writeSize) { tap.test("writeSize=" + writeSize + " blockSize="+blockSize + " writeCount="+writeCount, function (t) { var f = new BlockStream(blockSize, {nopad: true }) var actualChunks = 0 var actualBytes = 0 var timeouts = 0 f.on("data", function (c) { timeouts ++ actualChunks ++ actualBytes += c.length // make sure that no data gets corrupted, and basic sanity var before = c.toString() // simulate a slow write operation setTimeout(function () { timeouts -- var after = c.toString() t.equal(after, before, "should not change data") // now corrupt it, to find leaks. for (var i = 0; i < c.length; i ++) { c[i] = "x".charCodeAt(0) } }, 100) }) f.on("end", function () { // round up to the nearest block size var expectChunks = Math.ceil(writeSize * writeCount * 2 / blockSize) var expectBytes = writeSize * writeCount * 2 t.equal(actualBytes, expectBytes, "bytes=" + expectBytes + " writeSize=" + writeSize) t.equal(actualChunks, expectChunks, "chunks=" + expectChunks + " writeSize=" + writeSize) // wait for all the timeout checks to finish, then end the test setTimeout(function WAIT () { if (timeouts > 0) return setTimeout(WAIT) t.end() }, 100) }) for (var i = 0; i < writeCount; i ++) { var a = new Buffer(writeSize); for (var j = 0; j < writeSize; j ++) a[j] = "a".charCodeAt(0) var b = new Buffer(writeSize); for (var j = 0; j < writeSize; j ++) b[j] = "b".charCodeAt(0) f.write(a) f.write(b) } f.end() }) }) }) })
jfrank1500/minicurso_2015
bin/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/block-stream/test/nopad-thorough.js
JavaScript
mit
2,052
YUI.add('datatype-xml-parse', function (Y, NAME) { /** * Parse XML submodule. * * @module datatype-xml * @submodule datatype-xml-parse * @for XML */ var LANG = Y.Lang; Y.mix(Y.namespace("XML"), { /** * Converts data to type XMLDocument. * * @method parse * @param data {String} Data to convert. * @return {XMLDoc} XML Document. */ parse: function(data) { var xmlDoc = null; if(LANG.isString(data)) { try { if(!LANG.isUndefined(ActiveXObject)) { xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = false; xmlDoc.loadXML(data); } } catch(ee) { try { if (!LANG.isUndefined(DOMParser)) { xmlDoc = new DOMParser().parseFromString(data, "text/xml"); } if (!LANG.isUndefined(Windows.Data.Xml.Dom)) { xmlDoc = new Windows.Data.Xml.Dom.XmlDocument(); xmlDoc.loadXml(data); } } catch(e) { } } } if( (LANG.isNull(xmlDoc)) || (LANG.isNull(xmlDoc.documentElement)) || (xmlDoc.documentElement.nodeName === "parsererror") ) { } return xmlDoc; } }); // Add Parsers shortcut Y.namespace("Parsers").xml = Y.XML.parse; Y.namespace("DataType"); Y.DataType.XML = Y.XML; }, '@VERSION@');
cluo/cdnjs
ajax/libs/yui/3.10.1/datatype-xml-parse/datatype-xml-parse.js
JavaScript
mit
1,566
var baseDifference = require('./_baseDifference'), baseFlatten = require('./_baseFlatten'), baseRest = require('./_baseRest'), isArrayLikeObject = require('./isArrayLikeObject'); /** * Creates an array of `array` values not included in the other given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * **Note:** Unlike `_.pullAll`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.without, _.xor * @example * * _.difference([2, 1], [2, 3]); * // => [1] */ var difference = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; }); module.exports = difference;
gentataufik20/simplecrud
node_modules/lodash/difference.js
JavaScript
mit
1,063
import {Request} from '../lib/request'; import {Response} from '../lib/response'; import {AWSError} from '../lib/error'; import {Service} from '../lib/service'; import {ServiceConfigurationOptions} from '../lib/service'; import {ConfigBase as Config} from '../lib/config'; interface Blob {} declare class Snowball extends Service { /** * Constructs a service object. This object has one method for each API operation. */ constructor(options?: Snowball.Types.ClientConfiguration) config: Config & Snowball.Types.ClientConfiguration; /** * Cancels a cluster job. You can only cancel a cluster job while it's in the AwaitingQuorum status. You'll have at least an hour after creating a cluster job to cancel it. */ cancelCluster(params: Snowball.Types.CancelClusterRequest, callback?: (err: AWSError, data: Snowball.Types.CancelClusterResult) => void): Request<Snowball.Types.CancelClusterResult, AWSError>; /** * Cancels a cluster job. You can only cancel a cluster job while it's in the AwaitingQuorum status. You'll have at least an hour after creating a cluster job to cancel it. */ cancelCluster(callback?: (err: AWSError, data: Snowball.Types.CancelClusterResult) => void): Request<Snowball.Types.CancelClusterResult, AWSError>; /** * Cancels the specified job. You can only cancel a job before its JobState value changes to PreparingAppliance. Requesting the ListJobs or DescribeJob action will return a job's JobState as part of the response element data returned. */ cancelJob(params: Snowball.Types.CancelJobRequest, callback?: (err: AWSError, data: Snowball.Types.CancelJobResult) => void): Request<Snowball.Types.CancelJobResult, AWSError>; /** * Cancels the specified job. You can only cancel a job before its JobState value changes to PreparingAppliance. Requesting the ListJobs or DescribeJob action will return a job's JobState as part of the response element data returned. */ cancelJob(callback?: (err: AWSError, data: Snowball.Types.CancelJobResult) => void): Request<Snowball.Types.CancelJobResult, AWSError>; /** * Creates an address for a Snowball to be shipped to. In most regions, addresses are validated at the time of creation. The address you provide must be located within the serviceable area of your region. If the address is invalid or unsupported, then an exception is thrown. */ createAddress(params: Snowball.Types.CreateAddressRequest, callback?: (err: AWSError, data: Snowball.Types.CreateAddressResult) => void): Request<Snowball.Types.CreateAddressResult, AWSError>; /** * Creates an address for a Snowball to be shipped to. In most regions, addresses are validated at the time of creation. The address you provide must be located within the serviceable area of your region. If the address is invalid or unsupported, then an exception is thrown. */ createAddress(callback?: (err: AWSError, data: Snowball.Types.CreateAddressResult) => void): Request<Snowball.Types.CreateAddressResult, AWSError>; /** * Creates an empty cluster. Each cluster supports five nodes. You use the CreateJob action separately to create the jobs for each of these nodes. The cluster does not ship until these five node jobs have been created. */ createCluster(params: Snowball.Types.CreateClusterRequest, callback?: (err: AWSError, data: Snowball.Types.CreateClusterResult) => void): Request<Snowball.Types.CreateClusterResult, AWSError>; /** * Creates an empty cluster. Each cluster supports five nodes. You use the CreateJob action separately to create the jobs for each of these nodes. The cluster does not ship until these five node jobs have been created. */ createCluster(callback?: (err: AWSError, data: Snowball.Types.CreateClusterResult) => void): Request<Snowball.Types.CreateClusterResult, AWSError>; /** * Creates a job to import or export data between Amazon S3 and your on-premises data center. Your AWS account must have the right trust policies and permissions in place to create a job for Snowball. If you're creating a job for a node in a cluster, you only need to provide the clusterId value; the other job attributes are inherited from the cluster. */ createJob(params: Snowball.Types.CreateJobRequest, callback?: (err: AWSError, data: Snowball.Types.CreateJobResult) => void): Request<Snowball.Types.CreateJobResult, AWSError>; /** * Creates a job to import or export data between Amazon S3 and your on-premises data center. Your AWS account must have the right trust policies and permissions in place to create a job for Snowball. If you're creating a job for a node in a cluster, you only need to provide the clusterId value; the other job attributes are inherited from the cluster. */ createJob(callback?: (err: AWSError, data: Snowball.Types.CreateJobResult) => void): Request<Snowball.Types.CreateJobResult, AWSError>; /** * Takes an AddressId and returns specific details about that address in the form of an Address object. */ describeAddress(params: Snowball.Types.DescribeAddressRequest, callback?: (err: AWSError, data: Snowball.Types.DescribeAddressResult) => void): Request<Snowball.Types.DescribeAddressResult, AWSError>; /** * Takes an AddressId and returns specific details about that address in the form of an Address object. */ describeAddress(callback?: (err: AWSError, data: Snowball.Types.DescribeAddressResult) => void): Request<Snowball.Types.DescribeAddressResult, AWSError>; /** * Returns a specified number of ADDRESS objects. Calling this API in one of the US regions will return addresses from the list of all addresses associated with this account in all US regions. */ describeAddresses(params: Snowball.Types.DescribeAddressesRequest, callback?: (err: AWSError, data: Snowball.Types.DescribeAddressesResult) => void): Request<Snowball.Types.DescribeAddressesResult, AWSError>; /** * Returns a specified number of ADDRESS objects. Calling this API in one of the US regions will return addresses from the list of all addresses associated with this account in all US regions. */ describeAddresses(callback?: (err: AWSError, data: Snowball.Types.DescribeAddressesResult) => void): Request<Snowball.Types.DescribeAddressesResult, AWSError>; /** * Returns information about a specific cluster including shipping information, cluster status, and other important metadata. */ describeCluster(params: Snowball.Types.DescribeClusterRequest, callback?: (err: AWSError, data: Snowball.Types.DescribeClusterResult) => void): Request<Snowball.Types.DescribeClusterResult, AWSError>; /** * Returns information about a specific cluster including shipping information, cluster status, and other important metadata. */ describeCluster(callback?: (err: AWSError, data: Snowball.Types.DescribeClusterResult) => void): Request<Snowball.Types.DescribeClusterResult, AWSError>; /** * Returns information about a specific job including shipping information, job status, and other important metadata. */ describeJob(params: Snowball.Types.DescribeJobRequest, callback?: (err: AWSError, data: Snowball.Types.DescribeJobResult) => void): Request<Snowball.Types.DescribeJobResult, AWSError>; /** * Returns information about a specific job including shipping information, job status, and other important metadata. */ describeJob(callback?: (err: AWSError, data: Snowball.Types.DescribeJobResult) => void): Request<Snowball.Types.DescribeJobResult, AWSError>; /** * Returns a link to an Amazon S3 presigned URL for the manifest file associated with the specified JobId value. You can access the manifest file for up to 60 minutes after this request has been made. To access the manifest file after 60 minutes have passed, you'll have to make another call to the GetJobManifest action. The manifest is an encrypted file that you can download after your job enters the WithCustomer status. The manifest is decrypted by using the UnlockCode code value, when you pass both values to the Snowball through the Snowball client when the client is started for the first time. As a best practice, we recommend that you don't save a copy of an UnlockCode value in the same location as the manifest file for that job. Saving these separately helps prevent unauthorized parties from gaining access to the Snowball associated with that job. The credentials of a given job, including its manifest file and unlock code, expire 90 days after the job is created. */ getJobManifest(params: Snowball.Types.GetJobManifestRequest, callback?: (err: AWSError, data: Snowball.Types.GetJobManifestResult) => void): Request<Snowball.Types.GetJobManifestResult, AWSError>; /** * Returns a link to an Amazon S3 presigned URL for the manifest file associated with the specified JobId value. You can access the manifest file for up to 60 minutes after this request has been made. To access the manifest file after 60 minutes have passed, you'll have to make another call to the GetJobManifest action. The manifest is an encrypted file that you can download after your job enters the WithCustomer status. The manifest is decrypted by using the UnlockCode code value, when you pass both values to the Snowball through the Snowball client when the client is started for the first time. As a best practice, we recommend that you don't save a copy of an UnlockCode value in the same location as the manifest file for that job. Saving these separately helps prevent unauthorized parties from gaining access to the Snowball associated with that job. The credentials of a given job, including its manifest file and unlock code, expire 90 days after the job is created. */ getJobManifest(callback?: (err: AWSError, data: Snowball.Types.GetJobManifestResult) => void): Request<Snowball.Types.GetJobManifestResult, AWSError>; /** * Returns the UnlockCode code value for the specified job. A particular UnlockCode value can be accessed for up to 90 days after the associated job has been created. The UnlockCode value is a 29-character code with 25 alphanumeric characters and 4 hyphens. This code is used to decrypt the manifest file when it is passed along with the manifest to the Snowball through the Snowball client when the client is started for the first time. As a best practice, we recommend that you don't save a copy of the UnlockCode in the same location as the manifest file for that job. Saving these separately helps prevent unauthorized parties from gaining access to the Snowball associated with that job. */ getJobUnlockCode(params: Snowball.Types.GetJobUnlockCodeRequest, callback?: (err: AWSError, data: Snowball.Types.GetJobUnlockCodeResult) => void): Request<Snowball.Types.GetJobUnlockCodeResult, AWSError>; /** * Returns the UnlockCode code value for the specified job. A particular UnlockCode value can be accessed for up to 90 days after the associated job has been created. The UnlockCode value is a 29-character code with 25 alphanumeric characters and 4 hyphens. This code is used to decrypt the manifest file when it is passed along with the manifest to the Snowball through the Snowball client when the client is started for the first time. As a best practice, we recommend that you don't save a copy of the UnlockCode in the same location as the manifest file for that job. Saving these separately helps prevent unauthorized parties from gaining access to the Snowball associated with that job. */ getJobUnlockCode(callback?: (err: AWSError, data: Snowball.Types.GetJobUnlockCodeResult) => void): Request<Snowball.Types.GetJobUnlockCodeResult, AWSError>; /** * Returns information about the Snowball service limit for your account, and also the number of Snowballs your account has in use. The default service limit for the number of Snowballs that you can have at one time is 1. If you want to increase your service limit, contact AWS Support. */ getSnowballUsage(params: Snowball.Types.GetSnowballUsageRequest, callback?: (err: AWSError, data: Snowball.Types.GetSnowballUsageResult) => void): Request<Snowball.Types.GetSnowballUsageResult, AWSError>; /** * Returns information about the Snowball service limit for your account, and also the number of Snowballs your account has in use. The default service limit for the number of Snowballs that you can have at one time is 1. If you want to increase your service limit, contact AWS Support. */ getSnowballUsage(callback?: (err: AWSError, data: Snowball.Types.GetSnowballUsageResult) => void): Request<Snowball.Types.GetSnowballUsageResult, AWSError>; /** * Returns an array of JobListEntry objects of the specified length. Each JobListEntry object is for a job in the specified cluster and contains a job's state, a job's ID, and other information. */ listClusterJobs(params: Snowball.Types.ListClusterJobsRequest, callback?: (err: AWSError, data: Snowball.Types.ListClusterJobsResult) => void): Request<Snowball.Types.ListClusterJobsResult, AWSError>; /** * Returns an array of JobListEntry objects of the specified length. Each JobListEntry object is for a job in the specified cluster and contains a job's state, a job's ID, and other information. */ listClusterJobs(callback?: (err: AWSError, data: Snowball.Types.ListClusterJobsResult) => void): Request<Snowball.Types.ListClusterJobsResult, AWSError>; /** * Returns an array of ClusterListEntry objects of the specified length. Each ClusterListEntry object contains a cluster's state, a cluster's ID, and other important status information. */ listClusters(params: Snowball.Types.ListClustersRequest, callback?: (err: AWSError, data: Snowball.Types.ListClustersResult) => void): Request<Snowball.Types.ListClustersResult, AWSError>; /** * Returns an array of ClusterListEntry objects of the specified length. Each ClusterListEntry object contains a cluster's state, a cluster's ID, and other important status information. */ listClusters(callback?: (err: AWSError, data: Snowball.Types.ListClustersResult) => void): Request<Snowball.Types.ListClustersResult, AWSError>; /** * Returns an array of JobListEntry objects of the specified length. Each JobListEntry object contains a job's state, a job's ID, and a value that indicates whether the job is a job part, in the case of export jobs. Calling this API action in one of the US regions will return jobs from the list of all jobs associated with this account in all US regions. */ listJobs(params: Snowball.Types.ListJobsRequest, callback?: (err: AWSError, data: Snowball.Types.ListJobsResult) => void): Request<Snowball.Types.ListJobsResult, AWSError>; /** * Returns an array of JobListEntry objects of the specified length. Each JobListEntry object contains a job's state, a job's ID, and a value that indicates whether the job is a job part, in the case of export jobs. Calling this API action in one of the US regions will return jobs from the list of all jobs associated with this account in all US regions. */ listJobs(callback?: (err: AWSError, data: Snowball.Types.ListJobsResult) => void): Request<Snowball.Types.ListJobsResult, AWSError>; /** * While a cluster's ClusterState value is in the AwaitingQuorum state, you can update some of the information associated with a cluster. Once the cluster changes to a different job state, usually 60 minutes after the cluster being created, this action is no longer available. */ updateCluster(params: Snowball.Types.UpdateClusterRequest, callback?: (err: AWSError, data: Snowball.Types.UpdateClusterResult) => void): Request<Snowball.Types.UpdateClusterResult, AWSError>; /** * While a cluster's ClusterState value is in the AwaitingQuorum state, you can update some of the information associated with a cluster. Once the cluster changes to a different job state, usually 60 minutes after the cluster being created, this action is no longer available. */ updateCluster(callback?: (err: AWSError, data: Snowball.Types.UpdateClusterResult) => void): Request<Snowball.Types.UpdateClusterResult, AWSError>; /** * While a job's JobState value is New, you can update some of the information associated with a job. Once the job changes to a different job state, usually within 60 minutes of the job being created, this action is no longer available. */ updateJob(params: Snowball.Types.UpdateJobRequest, callback?: (err: AWSError, data: Snowball.Types.UpdateJobResult) => void): Request<Snowball.Types.UpdateJobResult, AWSError>; /** * While a job's JobState value is New, you can update some of the information associated with a job. Once the job changes to a different job state, usually within 60 minutes of the job being created, this action is no longer available. */ updateJob(callback?: (err: AWSError, data: Snowball.Types.UpdateJobResult) => void): Request<Snowball.Types.UpdateJobResult, AWSError>; } declare namespace Snowball { export interface Address { /** * The unique ID for an address. */ AddressId?: AddressId; /** * The name of a person to receive a Snowball at an address. */ Name?: String; /** * The name of the company to receive a Snowball at an address. */ Company?: String; /** * The first line in a street address that a Snowball is to be delivered to. */ Street1?: String; /** * The second line in a street address that a Snowball is to be delivered to. */ Street2?: String; /** * The third line in a street address that a Snowball is to be delivered to. */ Street3?: String; /** * The city in an address that a Snowball is to be delivered to. */ City?: String; /** * The state or province in an address that a Snowball is to be delivered to. */ StateOrProvince?: String; /** * This field is no longer used and the value is ignored. */ PrefectureOrDistrict?: String; /** * This field is no longer used and the value is ignored. */ Landmark?: String; /** * The country in an address that a Snowball is to be delivered to. */ Country?: String; /** * The postal code in an address that a Snowball is to be delivered to. */ PostalCode?: String; /** * The phone number associated with an address that a Snowball is to be delivered to. */ PhoneNumber?: String; /** * If the address you are creating is a primary address, then set this option to true. This field is not supported in most regions. */ IsRestricted?: Boolean; } export type AddressId = string; export type AddressList = Address[]; export type Boolean = boolean; export interface CancelClusterRequest { /** * The 39-character ID for the cluster that you want to cancel, for example CID123e4567-e89b-12d3-a456-426655440000. */ ClusterId: ClusterId; } export interface CancelClusterResult { } export interface CancelJobRequest { /** * The 39-character job ID for the job that you want to cancel, for example JID123e4567-e89b-12d3-a456-426655440000. */ JobId: JobId; } export interface CancelJobResult { } export type ClusterId = string; export interface ClusterListEntry { /** * The 39-character ID for the cluster that you want to list, for example CID123e4567-e89b-12d3-a456-426655440000. */ ClusterId?: String; /** * The current state of this cluster. For information about the state of a specific node, see JobListEntry$JobState. */ ClusterState?: ClusterState; /** * The creation date for this cluster. */ CreationDate?: Timestamp; /** * Defines an optional description of the cluster, for example Environmental Data Cluster-01. */ Description?: String; } export type ClusterListEntryList = ClusterListEntry[]; export interface ClusterMetadata { /** * The automatically generated ID for a cluster. */ ClusterId?: String; /** * The optional description of the cluster. */ Description?: String; /** * The KmsKeyARN Amazon Resource Name (ARN) associated with this cluster. This ARN was created using the CreateKey API action in AWS Key Management Service (AWS KMS). */ KmsKeyARN?: KmsKeyARN; /** * The role ARN associated with this cluster. This ARN was created using the CreateRole API action in AWS Identity and Access Management (IAM). */ RoleARN?: RoleARN; /** * The current status of the cluster. */ ClusterState?: ClusterState; /** * The type of job for this cluster. Currently, the only job type supported for clusters is LOCAL_USE. */ JobType?: JobType; /** * The type of AWS Snowball appliance to use for this cluster. Currently, the only supported appliance type for cluster jobs is EDGE. */ SnowballType?: SnowballType; /** * The creation date for this cluster. */ CreationDate?: Timestamp; /** * The arrays of JobResource objects that can include updated S3Resource objects or LambdaResource objects. */ Resources?: JobResource; /** * The automatically generated ID for a specific address. */ AddressId?: AddressId; /** * The shipping speed for each node in this cluster. This speed doesn't dictate how soon you'll get each Snowball Edge appliance, rather it represents how quickly each appliance moves to its destination while in transit. Regional shipping speeds are as follows: In Australia, you have access to express shipping. Typically, appliances shipped express are delivered in about a day. In the European Union (EU), you have access to express shipping. Typically, Snowball Edges shipped express are delivered in about a day. In addition, most countries in the EU have access to standard shipping, which typically takes less than a week, one way. In India, Snowball Edges are delivered in one to seven days. In the US, you have access to one-day shipping and two-day shipping. */ ShippingOption?: ShippingOption; /** * The Amazon Simple Notification Service (Amazon SNS) notification settings for this cluster. */ Notification?: Notification; /** * The ID of the address that you want a cluster shipped to, after it will be shipped to its primary address. This field is not supported in most regions. */ ForwardingAddressId?: AddressId; } export type ClusterState = "AwaitingQuorum"|"Pending"|"InUse"|"Complete"|"Cancelled"|string; export interface CreateAddressRequest { /** * The address that you want the Snowball shipped to. */ Address: Address; } export interface CreateAddressResult { /** * The automatically generated ID for a specific address. You'll use this ID when you create a job to specify which address you want the Snowball for that job shipped to. */ AddressId?: String; } export interface CreateClusterRequest { /** * The type of job for this cluster. Currently, the only job type supported for clusters is LOCAL_USE. */ JobType: JobType; /** * The resources associated with the cluster job. These resources include Amazon S3 buckets and optional AWS Lambda functions written in the Python language. */ Resources: JobResource; /** * An optional description of this specific cluster, for example Environmental Data Cluster-01. */ Description?: String; /** * The ID for the address that you want the cluster shipped to.&gt; */ AddressId: AddressId; /** * The KmsKeyARN value that you want to associate with this cluster. KmsKeyARN values are created by using the CreateKey API action in AWS Key Management Service (AWS KMS). */ KmsKeyARN?: KmsKeyARN; /** * The RoleARN that you want to associate with this cluster. RoleArn values are created by using the CreateRole API action in AWS Identity and Access Management (IAM). */ RoleARN: RoleARN; /** * The type of AWS Snowball appliance to use for this cluster. Currently, the only supported appliance type for cluster jobs is EDGE. */ SnowballType?: SnowballType; /** * The shipping speed for each node in this cluster. This speed doesn't dictate how soon you'll get each Snowball Edge appliance, rather it represents how quickly each appliance moves to its destination while in transit. Regional shipping speeds are as follows: In Australia, you have access to express shipping. Typically, appliances shipped express are delivered in about a day. In the European Union (EU), you have access to express shipping. Typically, Snowball Edges shipped express are delivered in about a day. In addition, most countries in the EU have access to standard shipping, which typically takes less than a week, one way. In India, Snowball Edges are delivered in one to seven days. In the US, you have access to one-day shipping and two-day shipping. */ ShippingOption: ShippingOption; /** * The Amazon Simple Notification Service (Amazon SNS) notification settings for this cluster. */ Notification?: Notification; /** * The forwarding address ID for a cluster. This field is not supported in most regions. */ ForwardingAddressId?: AddressId; } export interface CreateClusterResult { /** * The automatically generated ID for a cluster. */ ClusterId?: ClusterId; } export interface CreateJobRequest { /** * Defines the type of job that you're creating. */ JobType?: JobType; /** * Defines the Amazon S3 buckets associated with this job. With IMPORT jobs, you specify the bucket or buckets that your transferred data will be imported into. With EXPORT jobs, you specify the bucket or buckets that your transferred data will be exported from. Optionally, you can also specify a KeyRange value. If you choose to export a range, you define the length of the range by providing either an inclusive BeginMarker value, an inclusive EndMarker value, or both. Ranges are UTF-8 binary sorted. */ Resources?: JobResource; /** * Defines an optional description of this specific job, for example Important Photos 2016-08-11. */ Description?: String; /** * The ID for the address that you want the Snowball shipped to. */ AddressId?: AddressId; /** * The KmsKeyARN that you want to associate with this job. KmsKeyARNs are created using the CreateKey AWS Key Management Service (KMS) API action. */ KmsKeyARN?: KmsKeyARN; /** * The RoleARN that you want to associate with this job. RoleArns are created using the CreateRole AWS Identity and Access Management (IAM) API action. */ RoleARN?: RoleARN; /** * If your job is being created in one of the US regions, you have the option of specifying what size Snowball you'd like for this job. In all other regions, Snowballs come with 80 TB in storage capacity. */ SnowballCapacityPreference?: SnowballCapacity; /** * The shipping speed for this job. This speed doesn't dictate how soon you'll get the Snowball, rather it represents how quickly the Snowball moves to its destination while in transit. Regional shipping speeds are as follows: In Australia, you have access to express shipping. Typically, Snowballs shipped express are delivered in about a day. In the European Union (EU), you have access to express shipping. Typically, Snowballs shipped express are delivered in about a day. In addition, most countries in the EU have access to standard shipping, which typically takes less than a week, one way. In India, Snowballs are delivered in one to seven days. In the US, you have access to one-day shipping and two-day shipping. */ ShippingOption?: ShippingOption; /** * Defines the Amazon Simple Notification Service (Amazon SNS) notification settings for this job. */ Notification?: Notification; /** * The ID of a cluster. If you're creating a job for a node in a cluster, you need to provide only this clusterId value. The other job attributes are inherited from the cluster. */ ClusterId?: ClusterId; /** * The type of AWS Snowball appliance to use for this job. Currently, the only supported appliance type for cluster jobs is EDGE. */ SnowballType?: SnowballType; /** * The forwarding address ID for a job. This field is not supported in most regions. */ ForwardingAddressId?: AddressId; } export interface CreateJobResult { /** * The automatically generated ID for a job, for example JID123e4567-e89b-12d3-a456-426655440000. */ JobId?: JobId; } export interface DataTransfer { /** * The number of bytes transferred between a Snowball and Amazon S3. */ BytesTransferred?: Long; /** * The number of objects transferred between a Snowball and Amazon S3. */ ObjectsTransferred?: Long; /** * The total bytes of data for a transfer between a Snowball and Amazon S3. This value is set to 0 (zero) until all the keys that will be transferred have been listed. */ TotalBytes?: Long; /** * The total number of objects for a transfer between a Snowball and Amazon S3. This value is set to 0 (zero) until all the keys that will be transferred have been listed. */ TotalObjects?: Long; } export interface DescribeAddressRequest { /** * The automatically generated ID for a specific address. */ AddressId: AddressId; } export interface DescribeAddressResult { /** * The address that you want the Snowball or Snowballs associated with a specific job to be shipped to. */ Address?: Address; } export interface DescribeAddressesRequest { /** * The number of ADDRESS objects to return. */ MaxResults?: ListLimit; /** * HTTP requests are stateless. To identify what object comes "next" in the list of ADDRESS objects, you have the option of specifying a value for NextToken as the starting point for your list of returned addresses. */ NextToken?: String; } export interface DescribeAddressesResult { /** * The Snowball shipping addresses that were created for this account. */ Addresses?: AddressList; /** * HTTP requests are stateless. If you use the automatically generated NextToken value in your next DescribeAddresses call, your list of returned addresses will start from this point in the array. */ NextToken?: String; } export interface DescribeClusterRequest { /** * The automatically generated ID for a cluster. */ ClusterId: ClusterId; } export interface DescribeClusterResult { /** * Information about a specific cluster, including shipping information, cluster status, and other important metadata. */ ClusterMetadata?: ClusterMetadata; } export interface DescribeJobRequest { /** * The automatically generated ID for a job, for example JID123e4567-e89b-12d3-a456-426655440000. */ JobId: JobId; } export interface DescribeJobResult { /** * Information about a specific job, including shipping information, job status, and other important metadata. */ JobMetadata?: JobMetadata; /** * Information about a specific job part (in the case of an export job), including shipping information, job status, and other important metadata. */ SubJobMetadata?: JobMetadataList; } export interface EventTriggerDefinition { /** * The Amazon Resource Name (ARN) for any local Amazon S3 resource that is an AWS Lambda function's event trigger associated with this job. */ EventResourceARN?: ResourceARN; } export type EventTriggerDefinitionList = EventTriggerDefinition[]; export interface GetJobManifestRequest { /** * The ID for a job that you want to get the manifest file for, for example JID123e4567-e89b-12d3-a456-426655440000. */ JobId: JobId; } export interface GetJobManifestResult { /** * The Amazon S3 presigned URL for the manifest file associated with the specified JobId value. */ ManifestURI?: String; } export interface GetJobUnlockCodeRequest { /** * The ID for the job that you want to get the UnlockCode value for, for example JID123e4567-e89b-12d3-a456-426655440000. */ JobId: JobId; } export interface GetJobUnlockCodeResult { /** * The UnlockCode value for the specified job. The UnlockCode value can be accessed for up to 90 days after the job has been created. */ UnlockCode?: String; } export interface GetSnowballUsageRequest { } export interface GetSnowballUsageResult { /** * The service limit for number of Snowballs this account can have at once. The default service limit is 1 (one). */ SnowballLimit?: Integer; /** * The number of Snowballs that this account is currently using. */ SnowballsInUse?: Integer; } export type Integer = number; export type JobId = string; export interface JobListEntry { /** * The automatically generated ID for a job, for example JID123e4567-e89b-12d3-a456-426655440000. */ JobId?: String; /** * The current state of this job. */ JobState?: JobState; /** * A value that indicates that this job is a master job. A master job represents a successful request to create an export job. Master jobs aren't associated with any Snowballs. Instead, each master job will have at least one job part, and each job part is associated with a Snowball. It might take some time before the job parts associated with a particular master job are listed, because they are created after the master job is created. */ IsMaster?: Boolean; /** * The type of job. */ JobType?: JobType; /** * The type of appliance used with this job. */ SnowballType?: SnowballType; /** * The creation date for this job. */ CreationDate?: Timestamp; /** * The optional description of this specific job, for example Important Photos 2016-08-11. */ Description?: String; } export type JobListEntryList = JobListEntry[]; export interface JobLogs { /** * A link to an Amazon S3 presigned URL where the job completion report is located. */ JobCompletionReportURI?: String; /** * A link to an Amazon S3 presigned URL where the job success log is located. */ JobSuccessLogURI?: String; /** * A link to an Amazon S3 presigned URL where the job failure log is located. */ JobFailureLogURI?: String; } export interface JobMetadata { /** * The automatically generated ID for a job, for example JID123e4567-e89b-12d3-a456-426655440000. */ JobId?: String; /** * The current status of the jobs. */ JobState?: JobState; /** * The type of job. */ JobType?: JobType; /** * The type of appliance used with this job. */ SnowballType?: SnowballType; /** * The creation date for this job. */ CreationDate?: Timestamp; /** * An array of S3Resource objects. Each S3Resource object represents an Amazon S3 bucket that your transferred data will be exported from or imported into. */ Resources?: JobResource; /** * The description of the job, provided at job creation. */ Description?: String; /** * The Amazon Resource Name (ARN) for the AWS Key Management Service (AWS KMS) key associated with this job. This ARN was created using the CreateKey API action in AWS KMS. */ KmsKeyARN?: KmsKeyARN; /** * The role ARN associated with this job. This ARN was created using the CreateRole API action in AWS Identity and Access Management (IAM). */ RoleARN?: RoleARN; /** * The ID for the address that you want the Snowball shipped to. */ AddressId?: AddressId; /** * A job's shipping information, including inbound and outbound tracking numbers and shipping speed options. */ ShippingDetails?: ShippingDetails; /** * The Snowball capacity preference for this job, specified at job creation. In US regions, you can choose between 50 TB and 80 TB Snowballs. All other regions use 80 TB capacity Snowballs. */ SnowballCapacityPreference?: SnowballCapacity; /** * The Amazon Simple Notification Service (Amazon SNS) notification settings associated with a specific job. The Notification object is returned as a part of the response syntax of the DescribeJob action in the JobMetadata data type. */ Notification?: Notification; /** * A value that defines the real-time status of a Snowball's data transfer while the appliance is at AWS. This data is only available while a job has a JobState value of InProgress, for both import and export jobs. */ DataTransferProgress?: DataTransfer; /** * Links to Amazon S3 presigned URLs for the job report and logs. For import jobs, the PDF job report becomes available at the end of the import process. For export jobs, your job report typically becomes available while the Snowball for your job part is being delivered to you. */ JobLogInfo?: JobLogs; /** * The 39-character ID for the cluster, for example CID123e4567-e89b-12d3-a456-426655440000. */ ClusterId?: String; /** * The ID of the address that you want a job shipped to, after it will be shipped to its primary address. This field is not supported in most regions. */ ForwardingAddressId?: AddressId; } export type JobMetadataList = JobMetadata[]; export interface JobResource { /** * An array of S3Resource objects. */ S3Resources?: S3ResourceList; /** * The Python-language Lambda functions for this job. */ LambdaResources?: LambdaResourceList; } export type JobState = "New"|"PreparingAppliance"|"PreparingShipment"|"InTransitToCustomer"|"WithCustomer"|"InTransitToAWS"|"WithAWS"|"InProgress"|"Complete"|"Cancelled"|"Listing"|"Pending"|string; export type JobStateList = JobState[]; export type JobType = "IMPORT"|"EXPORT"|"LOCAL_USE"|string; export interface KeyRange { /** * The key that starts an optional key range for an export job. Ranges are inclusive and UTF-8 binary sorted. */ BeginMarker?: String; /** * The key that ends an optional key range for an export job. Ranges are inclusive and UTF-8 binary sorted. */ EndMarker?: String; } export type KmsKeyARN = string; export interface LambdaResource { /** * An Amazon Resource Name (ARN) that represents an AWS Lambda function to be triggered by PUT object actions on the associated local Amazon S3 resource. */ LambdaArn?: ResourceARN; /** * The array of ARNs for S3Resource objects to trigger the LambdaResource objects associated with this job. */ EventTriggers?: EventTriggerDefinitionList; } export type LambdaResourceList = LambdaResource[]; export interface ListClusterJobsRequest { /** * The 39-character ID for the cluster that you want to list, for example CID123e4567-e89b-12d3-a456-426655440000. */ ClusterId: ClusterId; /** * The number of JobListEntry objects to return. */ MaxResults?: ListLimit; /** * HTTP requests are stateless. To identify what object comes "next" in the list of JobListEntry objects, you have the option of specifying NextToken as the starting point for your returned list. */ NextToken?: String; } export interface ListClusterJobsResult { /** * Each JobListEntry object contains a job's state, a job's ID, and a value that indicates whether the job is a job part, in the case of export jobs. */ JobListEntries?: JobListEntryList; /** * HTTP requests are stateless. If you use the automatically generated NextToken value in your next ListClusterJobsResult call, your list of returned jobs will start from this point in the array. */ NextToken?: String; } export interface ListClustersRequest { /** * The number of ClusterListEntry objects to return. */ MaxResults?: ListLimit; /** * HTTP requests are stateless. To identify what object comes "next" in the list of ClusterListEntry objects, you have the option of specifying NextToken as the starting point for your returned list. */ NextToken?: String; } export interface ListClustersResult { /** * Each ClusterListEntry object contains a cluster's state, a cluster's ID, and other important status information. */ ClusterListEntries?: ClusterListEntryList; /** * HTTP requests are stateless. If you use the automatically generated NextToken value in your next ClusterListEntry call, your list of returned clusters will start from this point in the array. */ NextToken?: String; } export interface ListJobsRequest { /** * The number of JobListEntry objects to return. */ MaxResults?: ListLimit; /** * HTTP requests are stateless. To identify what object comes "next" in the list of JobListEntry objects, you have the option of specifying NextToken as the starting point for your returned list. */ NextToken?: String; } export interface ListJobsResult { /** * Each JobListEntry object contains a job's state, a job's ID, and a value that indicates whether the job is a job part, in the case of export jobs. */ JobListEntries?: JobListEntryList; /** * HTTP requests are stateless. If you use this automatically generated NextToken value in your next ListJobs call, your returned JobListEntry objects will start from this point in the array. */ NextToken?: String; } export type ListLimit = number; export type Long = number; export interface Notification { /** * The new SNS TopicArn that you want to associate with this job. You can create Amazon Resource Names (ARNs) for topics by using the CreateTopic Amazon SNS API action. You can subscribe email addresses to an Amazon SNS topic through the AWS Management Console, or by using the Subscribe AWS Simple Notification Service (SNS) API action. */ SnsTopicARN?: SnsTopicARN; /** * The list of job states that will trigger a notification for this job. */ JobStatesToNotify?: JobStateList; /** * Any change in job state will trigger a notification for this job. */ NotifyAll?: Boolean; } export type ResourceARN = string; export type RoleARN = string; export interface S3Resource { /** * The Amazon Resource Name (ARN) of an Amazon S3 bucket. */ BucketArn?: ResourceARN; /** * For export jobs, you can provide an optional KeyRange within a specific Amazon S3 bucket. The length of the range is defined at job creation, and has either an inclusive BeginMarker, an inclusive EndMarker, or both. Ranges are UTF-8 binary sorted. */ KeyRange?: KeyRange; } export type S3ResourceList = S3Resource[]; export interface Shipment { /** * Status information for a shipment. */ Status?: String; /** * The tracking number for this job. Using this tracking number with your region's carrier's website, you can track a Snowball as the carrier transports it. For India, the carrier is Amazon Logistics. For all other regions, UPS is the carrier. */ TrackingNumber?: String; } export interface ShippingDetails { /** * The shipping speed for a particular job. This speed doesn't dictate how soon you'll get the Snowball from the job's creation date. This speed represents how quickly it moves to its destination while in transit. Regional shipping speeds are as follows: In Australia, you have access to express shipping. Typically, Snowballs shipped express are delivered in about a day. In the European Union (EU), you have access to express shipping. Typically, Snowballs shipped express are delivered in about a day. In addition, most countries in the EU have access to standard shipping, which typically takes less than a week, one way. In India, Snowballs are delivered in one to seven days. In the United States of America (US), you have access to one-day shipping and two-day shipping. */ ShippingOption?: ShippingOption; /** * The Status and TrackingNumber values for a Snowball being delivered to the address that you specified for a particular job. */ InboundShipment?: Shipment; /** * The Status and TrackingNumber values for a Snowball being returned to AWS for a particular job. */ OutboundShipment?: Shipment; } export type ShippingOption = "SECOND_DAY"|"NEXT_DAY"|"EXPRESS"|"STANDARD"|string; export type SnowballCapacity = "T50"|"T80"|"T100"|"NoPreference"|string; export type SnowballType = "STANDARD"|"EDGE"|string; export type SnsTopicARN = string; export type String = string; export type Timestamp = Date; export interface UpdateClusterRequest { /** * The cluster ID of the cluster that you want to update, for example CID123e4567-e89b-12d3-a456-426655440000. */ ClusterId: ClusterId; /** * The new role Amazon Resource Name (ARN) that you want to associate with this cluster. To create a role ARN, use the CreateRole API action in AWS Identity and Access Management (IAM). */ RoleARN?: RoleARN; /** * The updated description of this cluster. */ Description?: String; /** * The updated arrays of JobResource objects that can include updated S3Resource objects or LambdaResource objects. */ Resources?: JobResource; /** * The ID of the updated Address object. */ AddressId?: AddressId; /** * The updated shipping option value of this cluster's ShippingDetails object. */ ShippingOption?: ShippingOption; /** * The new or updated Notification object. */ Notification?: Notification; /** * The updated ID for the forwarding address for a cluster. This field is not supported in most regions. */ ForwardingAddressId?: AddressId; } export interface UpdateClusterResult { } export interface UpdateJobRequest { /** * The job ID of the job that you want to update, for example JID123e4567-e89b-12d3-a456-426655440000. */ JobId: JobId; /** * The new role Amazon Resource Name (ARN) that you want to associate with this job. To create a role ARN, use the CreateRoleAWS Identity and Access Management (IAM) API action. */ RoleARN?: RoleARN; /** * The new or updated Notification object. */ Notification?: Notification; /** * The updated S3Resource object (for a single Amazon S3 bucket or key range), or the updated JobResource object (for multiple buckets or key ranges). */ Resources?: JobResource; /** * The ID of the updated Address object. */ AddressId?: AddressId; /** * The updated shipping option value of this job's ShippingDetails object. */ ShippingOption?: ShippingOption; /** * The updated description of this job's JobMetadata object. */ Description?: String; /** * The updated SnowballCapacityPreference of this job's JobMetadata object. The 50 TB Snowballs are only available in the US regions. */ SnowballCapacityPreference?: SnowballCapacity; /** * The updated ID for the forwarding address for a job. This field is not supported in most regions. */ ForwardingAddressId?: AddressId; } export interface UpdateJobResult { } /** * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version. */ export type apiVersion = "2016-06-30"|"latest"|string; export interface ClientApiVersions { /** * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version. */ apiVersion?: apiVersion; } export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions; /** * Contains interfaces for use with the Snowball client. */ export import Types = Snowball; } export = Snowball;
roshpr/terraform_firehose
lambda/ingestor/node_modules/aws-sdk/clients/snowball.d.ts
TypeScript
mit
48,555
package org.bouncycastle.i18n; import org.bouncycastle.i18n.filter.Filter; import org.bouncycastle.i18n.filter.TrustedInput; import org.bouncycastle.i18n.filter.UntrustedInput; import org.bouncycastle.i18n.filter.UntrustedUrlInput; import java.io.UnsupportedEncodingException; import java.text.DateFormat; import java.text.Format; import java.text.MessageFormat; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; import java.util.TimeZone; public class LocalizedMessage { protected static final int NO_FILTER = 0; protected static final int FILTER = 1; protected static final int FILTER_URL = 2; protected String id; protected String resource; // ISO-8859-1 is the default encoding public static final String DEFAULT_ENCODING = "ISO-8859-1"; protected String encoding = DEFAULT_ENCODING; protected FilteredArguments arguments; protected FilteredArguments extraArgs = null; protected Filter filter = null; protected ClassLoader loader = null; /** * Constructs a new LocalizedMessage using <code>resource</code> as the base name for the * RessourceBundle and <code>id</code> as the message bundle id the resource file. * @param resource base name of the resource file * @param id the id of the corresponding bundle in the resource file * @throws NullPointerException if <code>resource</code> or <code>id</code> is <code>null</code> */ public LocalizedMessage(String resource,String id) throws NullPointerException { if (resource == null || id == null) { throw new NullPointerException(); } this.id = id; this.resource = resource; arguments = new FilteredArguments(); } /** * Constructs a new LocalizedMessage using <code>resource</code> as the base name for the * RessourceBundle and <code>id</code> as the message bundle id the resource file. * @param resource base name of the resource file * @param id the id of the corresponding bundle in the resource file * @param encoding the encoding of the resource file * @throws NullPointerException if <code>resource</code> or <code>id</code> is <code>null</code> * @throws UnsupportedEncodingException if the encoding is not supported */ public LocalizedMessage(String resource,String id, String encoding) throws NullPointerException, UnsupportedEncodingException { if (resource == null || id == null) { throw new NullPointerException(); } this.id = id; this.resource = resource; arguments = new FilteredArguments(); this.encoding = encoding; } /** * Constructs a new LocalizedMessage using <code>resource</code> as the base name for the * RessourceBundle and <code>id</code> as the message bundle id the resource file. * @param resource base name of the resource file * @param id the id of the corresponding bundle in the resource file * @param arguments an array containing the arguments for the message * @throws NullPointerException if <code>resource</code> or <code>id</code> is <code>null</code> */ public LocalizedMessage(String resource, String id, Object[] arguments) throws NullPointerException { if (resource == null || id == null || arguments == null) { throw new NullPointerException(); } this.id = id; this.resource = resource; this.arguments = new FilteredArguments(arguments); } /** * Constructs a new LocalizedMessage using <code>resource</code> as the base name for the * RessourceBundle and <code>id</code> as the message bundle id the resource file. * @param resource base name of the resource file * @param id the id of the corresponding bundle in the resource file * @param encoding the encoding of the resource file * @param arguments an array containing the arguments for the message * @throws NullPointerException if <code>resource</code> or <code>id</code> is <code>null</code> * @throws UnsupportedEncodingException if the encoding is not supported */ public LocalizedMessage(String resource, String id, String encoding, Object[] arguments) throws NullPointerException, UnsupportedEncodingException { if (resource == null || id == null || arguments == null) { throw new NullPointerException(); } this.id = id; this.resource = resource; this.arguments = new FilteredArguments(arguments); this.encoding = encoding; } /** * Reads the entry <code>id + "." + key</code> from the resource file and returns a * formated message for the given Locale and TimeZone. * @param key second part of the entry id * @param loc the used {@link Locale} * @param timezone the used {@link TimeZone} * @return a Strng containing the localized message * @throws MissingEntryException if the resource file is not available or the entry does not exist. */ public String getEntry(String key,Locale loc, TimeZone timezone) throws MissingEntryException { String entry = id; if (key != null) { entry += "." + key; } try { ResourceBundle bundle; if (loader == null) { bundle = ResourceBundle.getBundle(resource,loc); } else { bundle = ResourceBundle.getBundle(resource, loc); } String result = bundle.getString(entry); if (!encoding.equals(DEFAULT_ENCODING)) { result = new String(result.getBytes(DEFAULT_ENCODING), encoding); } if (!arguments.isEmpty()) { result = formatWithTimeZone(result,arguments.getFilteredArgs(loc),loc,timezone); } result = addExtraArgs(result, loc); return result; } catch (MissingResourceException mre) { throw new MissingEntryException("Can't find entry " + entry + " in resource file " + resource + ".", resource, entry, loc, loader != null ? loader : this.getClassLoader()); } catch (UnsupportedEncodingException use) { // should never occur - cause we already test this in the constructor throw new RuntimeException(use.toString()); } } protected String formatWithTimeZone( String template, Object[] arguments, Locale locale, TimeZone timezone) { MessageFormat mf = new MessageFormat(" "); mf.setLocale(locale); mf.applyPattern(template); if (!timezone.equals(TimeZone.getDefault())) { Format[] formats = mf.getFormats(); for (int i = 0; i < formats.length; i++) { if (formats[i] instanceof DateFormat) { DateFormat temp = (DateFormat) formats[i]; temp.setTimeZone(timezone); mf.setFormat(i,temp); } } } return mf.format(arguments); } protected String addExtraArgs(String msg, Locale locale) { if (extraArgs != null) { StringBuffer sb = new StringBuffer(msg); Object[] filteredArgs = extraArgs.getFilteredArgs(locale); for (int i = 0; i < filteredArgs.length; i++) { sb.append(filteredArgs[i]); } msg = sb.toString(); } return msg; } /** * Sets the {@link Filter} that is used to filter the arguments of this message * @param filter the {@link Filter} to use. <code>null</code> to disable filtering. */ public void setFilter(Filter filter) { arguments.setFilter(filter); if (extraArgs != null) { extraArgs.setFilter(filter); } this.filter = filter; } /** * Returns the current filter. * @return the current filter */ public Filter getFilter() { return filter; } /** * Set the {@link ClassLoader} which loads the resource files. If it is set to <code>null</code> * then the default {@link ClassLoader} is used. * @param loader the {@link ClassLoader} which loads the resource files */ public void setClassLoader(ClassLoader loader) { this.loader = loader; } /** * Returns the {@link ClassLoader} which loads the resource files or <code>null</code> * if the default ClassLoader is used. * @return the {@link ClassLoader} which loads the resource files */ public ClassLoader getClassLoader() { return loader; } /** * Returns the id of the message in the resource bundle. * @return the id of the message */ public String getId() { return id; } /** * Returns the name of the resource bundle for this message * @return name of the resource file */ public String getResource() { return resource; } /** * Returns an <code>Object[]</code> containing the message arguments. * @return the message arguments */ public Object[] getArguments() { return arguments.getArguments(); } /** * * @param extraArg */ public void setExtraArgument(Object extraArg) { setExtraArguments(new Object[] {extraArg}); } /** * * @param extraArgs */ public void setExtraArguments(Object[] extraArgs) { if (extraArgs != null) { this.extraArgs = new FilteredArguments(extraArgs); this.extraArgs.setFilter(filter); } else { this.extraArgs = null; } } /** * * @return */ public Object[] getExtraArgs() { return (extraArgs == null) ? null : extraArgs.getArguments(); } protected class FilteredArguments { protected Filter filter = null; protected boolean[] isLocaleSpecific; protected int[] argFilterType; protected Object[] arguments; protected Object[] unpackedArgs; protected Object[] filteredArgs; FilteredArguments() { this(new Object[0]); } FilteredArguments(Object[] args) { this.arguments = args; this.unpackedArgs = new Object[args.length]; this.filteredArgs = new Object[args.length]; this.isLocaleSpecific = new boolean[args.length]; this.argFilterType = new int[args.length]; for (int i = 0; i < args.length; i++) { if (args[i] instanceof TrustedInput) { this.unpackedArgs[i] = ((TrustedInput) args[i]).getInput(); argFilterType[i] = NO_FILTER; } else if (args[i] instanceof UntrustedInput) { this.unpackedArgs[i] = ((UntrustedInput) args[i]).getInput(); if (args[i] instanceof UntrustedUrlInput) { argFilterType[i] = FILTER_URL; } else { argFilterType[i] = FILTER; } } else { this.unpackedArgs[i] = args[i]; argFilterType[i] = FILTER; } // locale specific this.isLocaleSpecific[i] = (this.unpackedArgs[i] instanceof LocaleString); } } public boolean isEmpty() { return unpackedArgs.length == 0; } public Object[] getArguments() { return arguments; } public Object[] getFilteredArgs(Locale locale) { Object[] result = new Object[unpackedArgs.length]; for (int i = 0; i < unpackedArgs.length; i++) { Object arg; if (filteredArgs[i] != null) { arg = filteredArgs[i]; } else { arg = unpackedArgs[i]; if (isLocaleSpecific[i]) { // get locale arg = ((LocaleString) arg).getLocaleString(locale); arg = filter(argFilterType[i], arg); } else { arg = filter(argFilterType[i], arg); filteredArgs[i] = arg; } } result[i] = arg; } return result; } private Object filter(int type, Object obj) { if (filter != null) { Object o = (null == obj) ? "null" : obj; switch (type) { case NO_FILTER: return o; case FILTER: return filter.doFilter(o.toString()); case FILTER_URL: return filter.doFilterUrl(o.toString()); default: return null; } } else { return obj; } } public Filter getFilter() { return filter; } public void setFilter(Filter filter) { if (filter != this.filter) { for (int i = 0; i < unpackedArgs.length; i++) { filteredArgs[i] = null; } } this.filter = filter; } } public String toString() { StringBuffer sb = new StringBuffer(); sb.append("Resource: \"").append(resource); sb.append("\" Id: \"").append(id).append("\""); sb.append(" Arguments: ").append(arguments.getArguments().length).append(" normal, ") .append(extraArgs.getArguments().length).append(" extra"); sb.append(" Encoding: ").append(encoding); sb.append(" ClassLoader: ").append(loader); return sb.toString(); } }
sake/bouncycastle-java
jdk1.1/org/bouncycastle/i18n/LocalizedMessage.java
Java
mit
14,906
/*! * OOjs UI v0.19.1 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2017 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * * Date: 2017-02-08T00:38:35Z */ .oo-ui-icon-fullScreen { background-image: url('themes/mediawiki/images/icons/fullScreen.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/fullScreen.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/fullScreen.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/fullScreen.png'); } .oo-ui-image-invert.oo-ui-icon-fullScreen { background-image: url('themes/mediawiki/images/icons/fullScreen-invert.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/fullScreen-invert.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/fullScreen-invert.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/fullScreen-invert.png'); } .oo-ui-image-progressive.oo-ui-icon-fullScreen { background-image: url('themes/mediawiki/images/icons/fullScreen-progressive.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/fullScreen-progressive.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/fullScreen-progressive.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/fullScreen-progressive.png'); } .oo-ui-icon-image { background-image: url('themes/mediawiki/images/icons/image-ltr.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/image-ltr.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/image-ltr.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/image-ltr.png'); } .oo-ui-image-invert.oo-ui-icon-image { background-image: url('themes/mediawiki/images/icons/image-ltr-invert.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/image-ltr-invert.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/image-ltr-invert.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/image-ltr-invert.png'); } .oo-ui-image-progressive.oo-ui-icon-image { background-image: url('themes/mediawiki/images/icons/image-ltr-progressive.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/image-ltr-progressive.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/image-ltr-progressive.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/image-ltr-progressive.png'); } .oo-ui-icon-imageAdd { background-image: url('themes/mediawiki/images/icons/imageAdd-ltr.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageAdd-ltr.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageAdd-ltr.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/imageAdd-ltr.png'); } .oo-ui-image-invert.oo-ui-icon-imageAdd { background-image: url('themes/mediawiki/images/icons/imageAdd-ltr-invert.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageAdd-ltr-invert.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageAdd-ltr-invert.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/imageAdd-ltr-invert.png'); } .oo-ui-image-progressive.oo-ui-icon-imageAdd { background-image: url('themes/mediawiki/images/icons/imageAdd-ltr-progressive.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageAdd-ltr-progressive.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageAdd-ltr-progressive.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/imageAdd-ltr-progressive.png'); } .oo-ui-icon-imageLock { background-image: url('themes/mediawiki/images/icons/imageLock-ltr.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageLock-ltr.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageLock-ltr.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/imageLock-ltr.png'); } .oo-ui-image-invert.oo-ui-icon-imageLock { background-image: url('themes/mediawiki/images/icons/imageLock-ltr-invert.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageLock-ltr-invert.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageLock-ltr-invert.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/imageLock-ltr-invert.png'); } .oo-ui-image-progressive.oo-ui-icon-imageLock { background-image: url('themes/mediawiki/images/icons/imageLock-ltr-progressive.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageLock-ltr-progressive.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageLock-ltr-progressive.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/imageLock-ltr-progressive.png'); } .oo-ui-icon-imageGallery { background-image: url('themes/mediawiki/images/icons/imageGallery-ltr.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageGallery-ltr.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageGallery-ltr.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/imageGallery-ltr.png'); } .oo-ui-image-invert.oo-ui-icon-imageGallery { background-image: url('themes/mediawiki/images/icons/imageGallery-ltr-invert.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageGallery-ltr-invert.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageGallery-ltr-invert.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/imageGallery-ltr-invert.png'); } .oo-ui-image-progressive.oo-ui-icon-imageGallery { background-image: url('themes/mediawiki/images/icons/imageGallery-ltr-progressive.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageGallery-ltr-progressive.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/imageGallery-ltr-progressive.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/imageGallery-ltr-progressive.png'); } .oo-ui-icon-play { background-image: url('themes/mediawiki/images/icons/play-ltr.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/play-ltr.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/play-ltr.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/play-ltr.png'); } .oo-ui-image-invert.oo-ui-icon-play { background-image: url('themes/mediawiki/images/icons/play-ltr-invert.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/play-ltr-invert.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/play-ltr-invert.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/play-ltr-invert.png'); } .oo-ui-image-progressive.oo-ui-icon-play { background-image: url('themes/mediawiki/images/icons/play-ltr-progressive.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/play-ltr-progressive.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/play-ltr-progressive.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/play-ltr-progressive.png'); } .oo-ui-icon-stop { background-image: url('themes/mediawiki/images/icons/stop.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/stop.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/stop.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/stop.png'); } .oo-ui-image-invert.oo-ui-icon-stop { background-image: url('themes/mediawiki/images/icons/stop-invert.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/stop-invert.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/stop-invert.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/stop-invert.png'); } .oo-ui-image-progressive.oo-ui-icon-stop { background-image: url('themes/mediawiki/images/icons/stop-progressive.png'); background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/stop-progressive.svg'); background-image: linear-gradient(transparent, transparent), /* @embed */ url('themes/mediawiki/images/icons/stop-progressive.svg'); background-image: -o-linear-gradient(transparent, transparent), url('themes/mediawiki/images/icons/stop-progressive.png'); }
tonytomov/cdnjs
ajax/libs/oojs-ui/0.19.1/oojs-ui-mediawiki-icons-media.css
CSS
mit
11,493
ο»Ώ/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.lang['nb']={"editor":"Rikteksteditor","editorPanel":"Panel for rikteksteditor","common":{"editorHelp":"Trykk ALT 0 for hjelp","browseServer":"Bla gjennom tjener","url":"URL","protocol":"Protokoll","upload":"Last opp","uploadSubmit":"Send det til serveren","image":"Bilde","flash":"Flash","form":"Skjema","checkbox":"Avmerkingsboks","radio":"Alternativknapp","textField":"Tekstboks","textarea":"TekstomrΓ₯de","hiddenField":"Skjult felt","button":"Knapp","select":"Rullegardinliste","imageButton":"Bildeknapp","notSet":"<ikke satt>","id":"Id","name":"Navn","langDir":"SprΓ₯kretning","langDirLtr":"Venstre til hΓΈyre (LTR)","langDirRtl":"HΓΈyre til venstre (RTL)","langCode":"SprΓ₯kkode","longDescr":"Utvidet beskrivelse","cssClass":"Stilarkklasser","advisoryTitle":"Tittel","cssStyle":"Stil","ok":"OK","cancel":"Avbryt","close":"Lukk","preview":"ForhΓ₯ndsvis","resize":"Dra for Γ₯ skalere","generalTab":"Generelt","advancedTab":"Avansert","validateNumberFailed":"Denne verdien er ikke et tall.","confirmNewPage":"Alle ulagrede endringer som er gjort i dette innholdet vil gΓ₯ tapt. Er du sikker pΓ₯ at du vil laste en ny side?","confirmCancel":"Du har endret noen alternativer. Er du sikker pΓ₯ at du vil lukke dialogvinduet?","options":"Valg","target":"MΓ₯l","targetNew":"Nytt vindu (_blank)","targetTop":"Hele vinduet (_top)","targetSelf":"Samme vindu (_self)","targetParent":"Foreldrevindu (_parent)","langDirLTR":"Venstre til hΓΈyre (VTH)","langDirRTL":"HΓΈyre til venstre (HTV)","styles":"Stil","cssClasses":"Stilarkklasser","width":"Bredde","height":"HΓΈyde","align":"Juster","alignLeft":"Venstre","alignRight":"HΓΈyre","alignCenter":"Midtjuster","alignJustify":"Blokkjuster","alignTop":"Topp","alignMiddle":"Midten","alignBottom":"Bunn","alignNone":"Ingen","invalidValue":"Ugyldig verdi.","invalidHeight":"HΓΈyde mΓ₯ vΓ¦re et tall.","invalidWidth":"Bredde mΓ₯ vΓ¦re et tall.","invalidCssLength":"Den angitte verdien for feltet \"%1\" mΓ₯ vΓ¦re et positivt tall med eller uten en gyldig CSS-mΓ₯lingsenhet (px, %, in, cm, mm, em, ex, pt, eller pc).","invalidHtmlLength":"Den angitte verdien for feltet \"%1\" mΓ₯ vΓ¦re et positivt tall med eller uten en gyldig HTML-mΓ₯lingsenhet (px eller %).","invalidInlineStyle":"Verdi angitt for inline stil mΓ₯ bestΓ₯ av en eller flere sett med formatet \"navn : verdi\", separert med semikolon","cssLengthTooltip":"Skriv inn et tall for en piksel-verdi eller et tall med en gyldig CSS-enhet (px, %, in, cm, mm, em, ex, pt, eller pc).","unavailable":"%1<span class=\"cke_accessibility\">, utilgjenglig</span>","keyboard":{"8":"Backspace","13":"Enter","16":"Shift","17":"Ctrl","18":"Alt","32":"Mellomrom","35":"End","36":"Home","46":"Delete","224":"Command"},"keyboardShortcut":"Tastatursnarvei"},"about":{"copy":"Copyright &copy; $1. Alle rettigheter reservert.","dlgTitle":"Om CKEditor","help":"Se $1 for hjelp.","moreInfo":"For lisensieringsinformasjon, vennligst besΓΈk vΓ₯rt nettsted:","title":"Om CKEditor","userGuide":"CKEditors brukerveiledning"},"basicstyles":{"bold":"Fet","italic":"Kursiv","strike":"Gjennomstreking","subscript":"Senket skrift","superscript":"Hevet skrift","underline":"Understreking"},"bidi":{"ltr":"Tekstretning fra venstre til hΓΈyre","rtl":"Tekstretning fra hΓΈyre til venstre"},"blockquote":{"toolbar":"Blokksitat"},"clipboard":{"copy":"Kopier","copyError":"Din nettlesers sikkerhetsinstillinger tillater ikke automatisk kopiering av tekst. Vennligst bruk tastatursnarveien (Ctrl/Cmd+C).","cut":"Klipp ut","cutError":"Din nettlesers sikkerhetsinstillinger tillater ikke automatisk utklipping av tekst. Vennligst bruk tastatursnarveien (Ctrl/Cmd+X).","paste":"Lim inn","pasteArea":"InnlimingsomrΓ₯de","pasteMsg":"Vennligst lim inn i fΓΈlgende boks med tastaturet (<strong>Ctrl/Cmd+V</strong>) og trykk <strong>OK</strong>.","securityMsg":"Din nettlesers sikkerhetsinstillinger gir ikke redigeringsverktΓΈyet direkte tilgang til utklippstavlen. Du mΓ₯ derfor lime det inn pΓ₯ nytt i dette vinduet.","title":"Lim inn"},"button":{"selectedLabel":"%1 (Valgt)"},"colorbutton":{"auto":"Automatisk","bgColorTitle":"Bakgrunnsfarge","colors":{"000":"Svart","800000":"RΓΈdbrun","8B4513":"Salbrun","2F4F4F":"GrΓΈnnsvart","008080":"BlΓ₯grΓΈnn","000080":"MarineblΓ₯","4B0082":"Indigo","696969":"MΓΈrk grΓ₯","B22222":"MΓΈrkerΓΈd","A52A2A":"Brun","DAA520":"Lys brun","006400":"MΓΈrk grΓΈnn","40E0D0":"Turkis","0000CD":"Medium blΓ₯","800080":"Purpur","808080":"GrΓ₯","F00":"RΓΈd","FF8C00":"MΓΈrk oransje","FFD700":"Gull","008000":"GrΓΈnn","0FF":"Cyan","00F":"BlΓ₯","EE82EE":"Fiolett","A9A9A9":"Svak grΓ₯","FFA07A":"Rosa-oransje","FFA500":"Oransje","FFFF00":"Gul","00FF00":"Lime","AFEEEE":"Svak turkis","ADD8E6":"Lys blΓ₯","DDA0DD":"Plomme","D3D3D3":"Lys grΓ₯","FFF0F5":"Svak lavendelrosa","FAEBD7":"Antikk-hvit","FFFFE0":"Lys gul","F0FFF0":"Honningmelon","F0FFFF":"Svak asurblΓ₯","F0F8FF":"Svak cyan","E6E6FA":"Lavendel","FFF":"Hvit","1ABC9C":"Strong Cyan","2ECC71":"Emerald","3498DB":"Bright Blue","9B59B6":"Amethyst","4E5F70":"Grayish Blue","F1C40F":"Vivid Yellow","16A085":"Dark Cyan","27AE60":"Dark Emerald","2980B9":"Strong Blue","8E44AD":"Dark Violet","2C3E50":"Desaturated Blue","F39C12":"Orange","E67E22":"Carrot","E74C3C":"Pale Red","ECF0F1":"Bright Silver","95A5A6":"Light Grayish Cyan","DDD":"Light Gray","D35400":"Pumpkin","C0392B":"Strong Red","BDC3C7":"Silver","7F8C8D":"Grayish Cyan","999":"Dark Gray"},"more":"Flere farger...","panelTitle":"Farger","textColorTitle":"Tekstfarge"},"colordialog":{"clear":"TΓΈm","highlight":"Merk","options":"Alternativer for farge","selected":"Valgt farge","title":"Velg farge"},"templates":{"button":"Maler","emptyListMsg":"(Ingen maler definert)","insertOption":"Erstatt gjeldende innhold","options":"Alternativer for mal","selectPromptMsg":"Velg malen du vil Γ₯pne i redigeringsverktΓΈyet:","title":"Innholdsmaler"},"contextmenu":{"options":"Alternativer for hΓΈyreklikkmeny"},"copyformatting":{"label":"Copy Formatting","notification":{"copied":"Formatting copied","applied":"Formatting applied","canceled":"Formatting canceled","failed":"Formatting failed. You cannot apply styles without copying them first."}},"div":{"IdInputLabel":"Id","advisoryTitleInputLabel":"Tittel","cssClassInputLabel":"Stilark-klasser","edit":"Rediger Div","inlineStyleInputLabel":"Inlinestiler","langDirLTRLabel":"Venstre til hΓΈyre (LTR)","langDirLabel":"SprΓ₯kretning","langDirRTLLabel":"HΓΈyre til venstre (RTL)","languageCodeInputLabel":" SprΓ₯kkode","remove":"Fjern Div","styleSelectLabel":"Stil","title":"Sett inn Div Container","toolbar":"Sett inn Div Container"},"toolbar":{"toolbarCollapse":"Skjul verktΓΈylinje","toolbarExpand":"Vis verktΓΈylinje","toolbarGroups":{"document":"Dokument","clipboard":"Utklippstavle/Angre","editing":"Redigering","forms":"Skjema","basicstyles":"Basisstiler","paragraph":"Avsnitt","links":"Lenker","insert":"Innsetting","styles":"Stiler","colors":"Farger","tools":"VerktΓΈy"},"toolbars":"VerktΓΈylinjer for editor"},"elementspath":{"eleLabel":"Element-sti","eleTitle":"%1 element"},"find":{"find":"SΓΈk","findOptions":"SΓΈkealternativer","findWhat":"SΓΈk etter:","matchCase":"Skill mellom store og smΓ₯ bokstaver","matchCyclic":"SΓΈk i hele dokumentet","matchWord":"Bare hele ord","notFoundMsg":"Fant ikke sΓΈketeksten.","replace":"Erstatt","replaceAll":"Erstatt alle","replaceSuccessMsg":"%1 tilfelle(r) erstattet.","replaceWith":"Erstatt med:","title":"SΓΈk og erstatt"},"fakeobjects":{"anchor":"Anker","flash":"Flash-animasjon","hiddenfield":"Skjult felt","iframe":"IFrame","unknown":"Ukjent objekt"},"flash":{"access":"Scripttilgang","accessAlways":"Alltid","accessNever":"Aldri","accessSameDomain":"Samme domene","alignAbsBottom":"Abs bunn","alignAbsMiddle":"Abs midten","alignBaseline":"Bunnlinje","alignTextTop":"Tekst topp","bgcolor":"Bakgrunnsfarge","chkFull":"Tillat fullskjerm","chkLoop":"Loop","chkMenu":"SlΓ₯ pΓ₯ Flash-meny","chkPlay":"Autospill","flashvars":"Variabler for flash","hSpace":"HMarg","properties":"Egenskaper for Flash-objekt","propertiesTab":"Egenskaper","quality":"Kvalitet","qualityAutoHigh":"Auto hΓΈy","qualityAutoLow":"Auto lav","qualityBest":"Best","qualityHigh":"HΓΈy","qualityLow":"Lav","qualityMedium":"Medium","scale":"Skaler","scaleAll":"Vis alt","scaleFit":"Skaler til Γ₯ passe","scaleNoBorder":"Ingen ramme","title":"Flash-egenskaper","vSpace":"VMarg","validateHSpace":"HMarg mΓ₯ vΓ¦re et tall.","validateSrc":"Vennligst skriv inn lenkens url.","validateVSpace":"VMarg mΓ₯ vΓ¦re et tall.","windowMode":"Vindumodus","windowModeOpaque":"Opaque","windowModeTransparent":"Gjennomsiktig","windowModeWindow":"Vindu"},"font":{"fontSize":{"label":"StΓΈrrelse","voiceLabel":"SkriftstΓΈrrelse","panelTitle":"SkriftstΓΈrrelse"},"label":"Skrift","panelTitle":"Skrift","voiceLabel":"Font"},"forms":{"button":{"title":"Egenskaper for knapp","text":"Tekst (verdi)","type":"Type","typeBtn":"Knapp","typeSbm":"Send","typeRst":"Nullstill"},"checkboxAndRadio":{"checkboxTitle":"Egenskaper for avmerkingsboks","radioTitle":"Egenskaper for alternativknapp","value":"Verdi","selected":"Valgt","required":"PΓ₯krevd"},"form":{"title":"Egenskaper for skjema","menu":"Egenskaper for skjema","action":"Handling","method":"Metode","encoding":"Encoding"},"hidden":{"title":"Egenskaper for skjult felt","name":"Navn","value":"Verdi"},"select":{"title":"Egenskaper for rullegardinliste","selectInfo":"Info","opAvail":"Tilgjengelige alternativer","value":"Verdi","size":"StΓΈrrelse","lines":"Linjer","chkMulti":"Tillat flervalg","required":"PΓ₯krevd","opText":"Tekst","opValue":"Verdi","btnAdd":"Legg til","btnModify":"Endre","btnUp":"Opp","btnDown":"Ned","btnSetValue":"Sett som valgt","btnDelete":"Slett"},"textarea":{"title":"Egenskaper for tekstomrΓ₯de","cols":"Kolonner","rows":"Rader"},"textfield":{"title":"Egenskaper for tekstfelt","name":"Navn","value":"Verdi","charWidth":"Tegnbredde","maxChars":"Maks antall tegn","required":"PΓ₯krevd","type":"Type","typeText":"Tekst","typePass":"Passord","typeEmail":"Epost","typeSearch":"SΓΈk","typeTel":"Telefonnummer","typeUrl":"URL"}},"format":{"label":"Format","panelTitle":"Avsnittsformat","tag_address":"Adresse","tag_div":"Normal (DIV)","tag_h1":"Overskrift 1","tag_h2":"Overskrift 2","tag_h3":"Overskrift 3","tag_h4":"Overskrift 4","tag_h5":"Overskrift 5","tag_h6":"Overskrift 6","tag_p":"Normal","tag_pre":"Formatert"},"horizontalrule":{"toolbar":"Sett inn horisontal linje"},"iframe":{"border":"Vis ramme rundt iframe","noUrl":"Vennligst skriv inn URL for iframe","scrolling":"Aktiver scrollefelt","title":"Egenskaper for IFrame","toolbar":"IFrame"},"image":{"alt":"Alternativ tekst","border":"Ramme","btnUpload":"Send det til serveren","button2Img":"Vil du endre den valgte bildeknappen til et vanlig bilde?","hSpace":"HMarg","img2Button":"Vil du endre det valgte bildet til en bildeknapp?","infoTab":"Bildeinformasjon","linkTab":"Lenke","lockRatio":"LΓ₯s forhold","menu":"Bildeegenskaper","resetSize":"Tilbakestill stΓΈrrelse","title":"Bildeegenskaper","titleButton":"Egenskaper for bildeknapp","upload":"Last opp","urlMissing":"Bildets adresse mangler.","vSpace":"VMarg","validateBorder":"Ramme mΓ₯ vΓ¦re et heltall.","validateHSpace":"HMarg mΓ₯ vΓ¦re et heltall.","validateVSpace":"VMarg mΓ₯ vΓ¦re et heltall."},"indent":{"indent":"Øk innrykk","outdent":"Reduser innrykk"},"smiley":{"options":"Alternativer for smil","title":"Sett inn smil","toolbar":"Smil"},"justify":{"block":"Blokkjuster","center":"Midtstill","left":"Venstrejuster","right":"HΓΈyrejuster"},"language":{"button":"Sett sprΓ₯k","remove":"Fjern sprΓ₯k"},"link":{"acccessKey":"Aksessknapp","advanced":"Avansert","advisoryContentType":"Type","advisoryTitle":"Tittel","anchor":{"toolbar":"Anker","menu":"Rediger anker","title":"Egenskaper for anker","name":"Ankernavn","errorName":"Vennligst skriv inn ankernavnet","remove":"Fjern anker"},"anchorId":"Element etter ID","anchorName":"Anker etter navn","charset":"Lenket tegnsett","cssClasses":"Stilarkklasser","download":"Tving nedlasting","displayText":"Tekst som skal vises","emailAddress":"E-postadresse","emailBody":"Melding","emailSubject":"Meldingsemne","id":"Id","info":"Lenkeinfo","langCode":"SprΓ₯kkode","langDir":"SprΓ₯kretning","langDirLTR":"Venstre til hΓΈyre (LTR)","langDirRTL":"HΓΈyre til venstre (RTL)","menu":"Rediger lenke","name":"Navn","noAnchors":"(Ingen anker i dokumentet)","noEmail":"Vennligst skriv inn e-postadressen","noUrl":"Vennligst skriv inn lenkens URL","other":"<annen>","popupDependent":"Avhenging (Netscape)","popupFeatures":"Egenskaper for popup-vindu","popupFullScreen":"Fullskjerm (IE)","popupLeft":"Venstre posisjon","popupLocationBar":"Adresselinje","popupMenuBar":"Menylinje","popupResizable":"Skalerbar","popupScrollBars":"Scrollbar","popupStatusBar":"Statuslinje","popupToolbar":"VerktΓΈylinje","popupTop":"Topp-posisjon","rel":"Relasjon (rel)","selectAnchor":"Velg et anker","styles":"Stil","tabIndex":"Tabindeks","target":"MΓ₯l","targetFrame":"<ramme>","targetFrameName":"MΓ₯lramme","targetPopup":"<popup-vindu>","targetPopupName":"Navn pΓ₯ popup-vindu","title":"Lenke","toAnchor":"Lenke til anker i teksten","toEmail":"E-post","toUrl":"URL","toolbar":"Lenke","type":"Lenketype","unlink":"Fjern lenke","upload":"Last opp"},"list":{"bulletedlist":"Legg til / fjern punktliste","numberedlist":"Legg til / fjern nummerert liste"},"liststyle":{"armenian":"Armensk nummerering","bulletedTitle":"Egenskaper for punktliste","circle":"Sirkel","decimal":"Tall (1, 2, 3, osv.)","decimalLeadingZero":"Tall, med fΓΈrstesiffer null (01, 02, 03, osv.)","disc":"Disk","georgian":"Georgisk nummerering (an, ban, gan, osv.)","lowerAlpha":"Alfabetisk, smΓ₯ (a, b, c, d, e, osv.)","lowerGreek":"Gresk, smΓ₯ (alpha, beta, gamma, osv.)","lowerRoman":"Romertall, smΓ₯ (i, ii, iii, iv, v, osv.)","none":"Ingen","notset":"<ikke satt>","numberedTitle":"Egenskaper for nummerert liste","square":"Firkant","start":"Start","type":"Type","upperAlpha":"Alfabetisk, store (A, B, C, D, E, osv.)","upperRoman":"Romertall, store (I, II, III, IV, V, osv.)","validateStartNumber":"Starten pΓ₯ listen mΓ₯ vΓ¦re et heltall."},"magicline":{"title":"Sett inn nytt avsnitt her"},"maximize":{"maximize":"Maksimer","minimize":"Minimer"},"newpage":{"toolbar":"Ny side"},"pagebreak":{"alt":"Sideskift","toolbar":"Sett inn sideskift for utskrift"},"pastetext":{"button":"Lim inn som ren tekst","title":"Lim inn som ren tekst"},"pastefromword":{"confirmCleanup":"Teksten du limer inn ser ut til Γ₯ vΓ¦re kopiert fra Word. Vil du renske den fΓΈr du limer den inn?","error":"Det var ikke mulig Γ₯ renske den innlimte teksten pΓ₯ grunn av en intern feil","title":"Lim inn fra Word","toolbar":"Lim inn fra Word"},"preview":{"preview":"ForhΓ₯ndsvis"},"print":{"toolbar":"Skriv ut"},"removeformat":{"toolbar":"Fjern formatering"},"save":{"toolbar":"Lagre"},"selectall":{"toolbar":"Merk alt"},"showblocks":{"toolbar":"Vis blokker"},"sourcearea":{"toolbar":"Kilde"},"specialchar":{"options":"Alternativer for spesialtegn","title":"Velg spesialtegn","toolbar":"Sett inn spesialtegn"},"scayt":{"btn_about":"Om SCAYT","btn_dictionaries":"OrdbΓΈker","btn_disable":"SlΓ₯ av SCAYT","btn_enable":"SlΓ₯ pΓ₯ SCAYT","btn_langs":"SprΓ₯k","btn_options":"Valg","text_title":"Stavekontroll mens du skriver"},"stylescombo":{"label":"Stil","panelTitle":"Stilformater","panelTitle1":"Blokkstiler","panelTitle2":"Inlinestiler","panelTitle3":"Objektstiler"},"table":{"border":"RammestΓΈrrelse","caption":"Tittel","cell":{"menu":"Celle","insertBefore":"Sett inn celle fΓΈr","insertAfter":"Sett inn celle etter","deleteCell":"Slett celler","merge":"SlΓ₯ sammen celler","mergeRight":"SlΓ₯ sammen hΓΈyre","mergeDown":"SlΓ₯ sammen ned","splitHorizontal":"Del celle horisontalt","splitVertical":"Del celle vertikalt","title":"Celleegenskaper","cellType":"Celletype","rowSpan":"Radspenn","colSpan":"Kolonnespenn","wordWrap":"Tekstbrytning","hAlign":"Horisontal justering","vAlign":"Vertikal justering","alignBaseline":"Grunnlinje","bgColor":"Bakgrunnsfarge","borderColor":"Rammefarge","data":"Data","header":"Overskrift","yes":"Ja","no":"Nei","invalidWidth":"Cellebredde mΓ₯ vΓ¦re et tall.","invalidHeight":"CellehΓΈyde mΓ₯ vΓ¦re et tall.","invalidRowSpan":"Radspenn mΓ₯ vΓ¦re et heltall.","invalidColSpan":"Kolonnespenn mΓ₯ vΓ¦re et heltall.","chooseColor":"Velg"},"cellPad":"Cellepolstring","cellSpace":"Cellemarg","column":{"menu":"Kolonne","insertBefore":"Sett inn kolonne fΓΈr","insertAfter":"Sett inn kolonne etter","deleteColumn":"Slett kolonner"},"columns":"Kolonner","deleteTable":"Slett tabell","headers":"Overskrifter","headersBoth":"Begge","headersColumn":"FΓΈrste kolonne","headersNone":"Ingen","headersRow":"FΓΈrste rad","invalidBorder":"RammestΓΈrrelse mΓ₯ vΓ¦re et tall.","invalidCellPadding":"Cellepolstring mΓ₯ vΓ¦re et positivt tall.","invalidCellSpacing":"Cellemarg mΓ₯ vΓ¦re et positivt tall.","invalidCols":"Antall kolonner mΓ₯ vΓ¦re et tall stΓΈrre enn 0.","invalidHeight":"TabellhΓΈyde mΓ₯ vΓ¦re et tall.","invalidRows":"Antall rader mΓ₯ vΓ¦re et tall stΓΈrre enn 0.","invalidWidth":"Tabellbredde mΓ₯ vΓ¦re et tall.","menu":"Egenskaper for tabell","row":{"menu":"Rader","insertBefore":"Sett inn rad fΓΈr","insertAfter":"Sett inn rad etter","deleteRow":"Slett rader"},"rows":"Rader","summary":"Sammendrag","title":"Egenskaper for tabell","toolbar":"Tabell","widthPc":"prosent","widthPx":"piksler","widthUnit":"Bredde-enhet"},"undo":{"redo":"GjΓΈr om","undo":"Angre"},"wsc":{"btnIgnore":"Ignorer","btnIgnoreAll":"Ignorer alle","btnReplace":"Erstatt","btnReplaceAll":"Erstatt alle","btnUndo":"Angre","changeTo":"Endre til","errorLoading":"Feil under lasting av applikasjonstjenestetjener: %s.","ieSpellDownload":"Stavekontroll er ikke installert. Vil du laste den ned nΓ₯?","manyChanges":"Stavekontroll fullfΓΈrt: %1 ord endret","noChanges":"Stavekontroll fullfΓΈrt: ingen ord endret","noMispell":"Stavekontroll fullfΓΈrt: ingen feilstavinger funnet","noSuggestions":"- Ingen forslag -","notAvailable":"Beklager, tjenesten er utilgjenglig nΓ₯.","notInDic":"Ikke i ordboken","oneChange":"Stavekontroll fullfΓΈrt: Ett ord endret","progress":"Stavekontroll pΓ₯gΓ₯r...","title":"Stavekontroll","toolbar":"Stavekontroll"}};
fengnovo/diary
plugins-test/editor/ckEditorTest/web/ckEditor/lang/nb.js
JavaScript
mit
18,272
!function(e,t,n){var a={messages:{required:"The %s field is required.",matches:"The %s field does not match the %s field.",default:"The %s field is still set to default, please change.",valid_email:"The %s field must contain a valid email address.",valid_emails:"The %s field must contain all valid email addresses.",min_length:"The %s field must be at least %s characters in length.",max_length:"The %s field must not exceed %s characters in length.",exact_length:"The %s field must be exactly %s characters in length.",greater_than:"The %s field must contain a number greater than %s.",less_than:"The %s field must contain a number less than %s.",alpha:"The %s field must only contain alphabetical characters.",alpha_numeric:"The %s field must only contain alpha-numeric characters.",alpha_dash:"The %s field must only contain alpha-numeric characters, underscores, and dashes.",numeric:"The %s field must contain only numbers.",integer:"The %s field must contain an integer.",decimal:"The %s field must contain a decimal number.",is_natural:"The %s field must contain only positive numbers.",is_natural_no_zero:"The %s field must contain a number greater than zero.",valid_ip:"The %s field must contain a valid IP.",valid_base64:"The %s field must contain a base64 string.",valid_credit_card:"The %s field must contain a valid credit card number.",is_file_type:"The %s field must contain only %s files.",valid_url:"The %s field must contain a valid URL."},callback:function(e){}},i=/^(.+?)\[(.+)\]$/,s=/^[0-9]+$/,r=/^\-?[0-9]+$/,l=/^\-?[0-9]*\.?[0-9]+$/,u=/^[a-zA-Z0-9.!#$%&amp;'*+\-\/=?\^_`{|}~\-]+@[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*$/,o=/^[a-z]+$/i,h=/^[a-z0-9]+$/i,d=/^[a-z0-9_\-]+$/i,c=/^[0-9]+$/i,f=/^[1-9][0-9]*$/i,p=/^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$/i,m=/[^a-zA-Z0-9\/\+=]/i,v=/^[\d\-\s]+$/,_=/^((http|https):\/\/(\w+:{0,1}\w*@)?(\S+)|)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,g=function(e,t,i){this.callback=i||a.callback,this.errors=[],this.fields={},this.form=this._formByNameOrNode(e)||{},this.messages={},this.handlers={},this.conditionals={};for(var s=0,r=t.length;s<r;s++){var l=t[s];if((l.name||l.names)&&l.rules)if(l.names)for(var u=0,o=l.names.length;u<o;u++)this._addField(l,l.names[u]);else this._addField(l,l.name)}var h=this.form.onsubmit;this.form.onsubmit=function(e){return function(t){try{return e._validateForm(t)&&(h===n||h())}catch(e){}}}(this)},y=function(e,t){var n;{if(!(e.length>0)||"radio"!==e[0].type&&"checkbox"!==e[0].type)return e[t];for(n=0,elementLength=e.length;n<elementLength;n++)if(e[n].checked)return e[n][t]}};g.prototype.setMessage=function(e,t){return this.messages[e]=t,this},g.prototype.registerCallback=function(e,t){return e&&"string"==typeof e&&t&&"function"==typeof t&&(this.handlers[e]=t),this},g.prototype.registerConditional=function(e,t){return e&&"string"==typeof e&&t&&"function"==typeof t&&(this.conditionals[e]=t),this},g.prototype._formByNameOrNode=function(e){return"object"==typeof e?e:t.forms[e]},g.prototype._addField=function(e,t){this.fields[t]={name:t,display:e.display||t,rules:e.rules,depends:e.depends,id:null,type:null,value:null,checked:null}},g.prototype._validateForm=function(e){this.errors=[];for(var t in this.fields)if(this.fields.hasOwnProperty(t)){var a=this.fields[t]||{},i=this.form[a.name];i&&i!==n&&(a.id=y(i,"id"),a.type=i.length>0?i[0].type:i.type,a.value=y(i,"value"),a.checked=y(i,"checked"),a.depends&&"function"==typeof a.depends?a.depends.call(this,a)&&this._validateField(a):a.depends&&"string"==typeof a.depends&&this.conditionals[a.depends]?this.conditionals[a.depends].call(this,a)&&this._validateField(a):this._validateField(a))}return"function"==typeof this.callback&&this.callback(this.errors,e),this.errors.length>0&&(e&&e.preventDefault?e.preventDefault():event&&(event.returnValue=!1)),!0},g.prototype._validateField=function(e){for(var t=e.rules.split("|"),s=e.rules.indexOf("required"),r=!e.value||""===e.value||e.value===n,l=0,u=t.length;l<u;l++){var o=t[l],h=null,d=!1,c=i.exec(o);if((s!==-1||o.indexOf("!callback_")!==-1||!r)&&(c&&(o=c[1],h=c[2]),"!"===o.charAt(0)&&(o=o.substring(1,o.length)),"function"==typeof this._hooks[o]?this._hooks[o].apply(this,[e,h])||(d=!0):"callback_"===o.substring(0,9)&&(o=o.substring(9,o.length),"function"==typeof this.handlers[o]&&this.handlers[o].apply(this,[e.value,h])===!1&&(d=!0)),d)){var f=this.messages[e.name+"."+o]||this.messages[o]||a.messages[o],p="An error has occurred with the "+e.display+" field.";f&&(p=f.replace("%s",e.display),h&&(p=p.replace("%s",this.fields[h]?this.fields[h].display:h))),this.errors.push({id:e.id,name:e.name,message:p,rule:o});break}}},g.prototype._hooks={required:function(e){var t=e.value;return"checkbox"===e.type||"radio"===e.type?e.checked===!0:null!==t&&""!==t},default:function(e,t){return e.value!==t},matches:function(e,t){var n=this.form[t];return!!n&&e.value===n.value},valid_email:function(e){return u.test(e.value)},valid_emails:function(e){for(var t=e.value.split(","),n=0,a=t.length;n<a;n++)if(!u.test(t[n]))return!1;return!0},min_length:function(e,t){return!!s.test(t)&&e.value.length>=parseInt(t,10)},max_length:function(e,t){return!!s.test(t)&&e.value.length<=parseInt(t,10)},exact_length:function(e,t){return!!s.test(t)&&e.value.length===parseInt(t,10)},greater_than:function(e,t){return!!l.test(e.value)&&parseFloat(e.value)>parseFloat(t)},less_than:function(e,t){return!!l.test(e.value)&&parseFloat(e.value)<parseFloat(t)},alpha:function(e){return o.test(e.value)},alpha_numeric:function(e){return h.test(e.value)},alpha_dash:function(e){return d.test(e.value)},numeric:function(e){return s.test(e.value)},integer:function(e){return r.test(e.value)},decimal:function(e){return l.test(e.value)},is_natural:function(e){return c.test(e.value)},is_natural_no_zero:function(e){return f.test(e.value)},valid_ip:function(e){return p.test(e.value)},valid_base64:function(e){return m.test(e.value)},valid_url:function(e){return _.test(e.value)},valid_credit_card:function(e){if(!v.test(e.value))return!1;for(var t=0,n=0,a=!1,i=e.value.replace(/\D/g,""),s=i.length-1;s>=0;s--){var r=i.charAt(s);n=parseInt(r,10),a&&(n*=2)>9&&(n-=9),t+=n,a=!a}return t%10===0},is_file_type:function(e,t){if("file"!==e.type)return!0;var n=e.value.substr(e.value.lastIndexOf(".")+1),a=t.split(","),i=!1,s=0,r=a.length;for(s;s<r;s++)n==a[s]&&(i=!0);return i}},e.FormValidator=g}(window,document);
jdh8/cdnjs
ajax/libs/validate-js/1.4/validate.min.js
JavaScript
mit
6,433
var common = require("../common-tap") , test = require("tap").test , path = require("path") , rimraf = require("rimraf") , osenv = require("osenv") , mkdirp = require("mkdirp") , pkg = path.resolve(__dirname, "ls-depth-unmet") , mr = require("npm-registry-mock") , opts = {cwd: pkg} , cache = path.resolve(pkg, "cache") , tmp = path.resolve(pkg, "tmp") , nodeModules = path.resolve(pkg, "node_modules") function cleanup () { process.chdir(osenv.tmpdir()) rimraf.sync(cache) rimraf.sync(tmp) rimraf.sync(nodeModules) } test("setup", function (t) { cleanup() mkdirp.sync(cache) mkdirp.sync(tmp) mr(common.port, function (s) { var cmd = ["install", "underscore@1.3.1", "mkdirp", "test-package-with-one-dep", "--registry=" + common.registry] common.npm(cmd, opts, function (er, c) { if (er) throw er t.equal(c, 0) s.close() t.end() }) }) }) test("npm ls --depth=0", function (t) { common.npm(["ls", "--depth=0"], opts, function (er, c, out) { if (er) throw er t.equal(c, 1) t.has(out, /UNMET DEPENDENCY optimist@0\.6\.0/ , "output contains optimist@0.6.0 and labeled as unmet dependency") t.has(out, /mkdirp@0\.3\.5 extraneous/ , "output contains mkdirp@0.3.5 and labeled as extraneous") t.has(out, /underscore@1\.3\.1 invalid/ , "output contains underscore@1.3.1 and labeled as invalid") t.has(out, /test-package-with-one-dep@0\.0\.0\n/ , "output contains test-package-with-one-dep@0.0.0 and has no labels") t.doesNotHave(out, /test-package@0\.0\.0/ , "output does not contain test-package@0.0.0 which is at depth=1") t.end() }) }) test("npm ls --depth=1", function (t) { common.npm(["ls", "--depth=1"], opts, function (er, c, out) { if (er) throw er t.equal(c, 1) t.has(out, /UNMET DEPENDENCY optimist@0\.6\.0/ , "output contains optimist@0.6.0 and labeled as unmet dependency") t.has(out, /mkdirp@0\.3\.5 extraneous/ , "output contains mkdirp@0.3.5 and labeled as extraneous") t.has(out, /underscore@1\.3\.1 invalid/ , "output contains underscore@1.3.1 and labeled as invalid") t.has(out, /test-package-with-one-dep@0\.0\.0\n/ , "output contains test-package-with-one-dep@0.0.0 and has no labels") t.has(out, /test-package@0\.0\.0/ , "output contains test-package@0.0.0 which is at depth=1") t.end() }) }) test("npm ls --depth=Infinity", function (t) { // travis has a preconfigured depth=0, in general we can not depend // on the default value in all environments, so explictly set it here common.npm(["ls", "--depth=Infinity"], opts, function (er, c, out) { if (er) throw er t.equal(c, 1) t.has(out, /UNMET DEPENDENCY optimist@0\.6\.0/ , "output contains optimist@0.6.0 and labeled as unmet dependency") t.has(out, /mkdirp@0\.3\.5 extraneous/ , "output contains mkdirp@0.3.5 and labeled as extraneous") t.has(out, /underscore@1\.3\.1 invalid/ , "output contains underscore@1.3.1 and labeled as invalid") t.has(out, /test-package-with-one-dep@0\.0\.0\n/ , "output contains test-package-with-one-dep@0.0.0 and has no labels") t.has(out, /test-package@0\.0\.0/ , "output contains test-package@0.0.0 which is at depth=1") t.end() }) }) test("cleanup", function (t) { cleanup() t.end() })
jsalva/crux
crux/emberjs/ember_apps/crux/node_modules/ember-cli/node_modules/npm/test/tap/ls-depth-unmet.js
JavaScript
mit
3,374
<!-- hbox layout --> <div class="hbox hbox-auto-xs bg-light " ng-controller="JVectorMapDemoCtrl" ng-init=" app.settings.asideFolded = true; app.settings.asideDock = false; app.settings.container = false; app.hideAside = true" > <!-- column --> <div class="col item"> <div ui-jq="vectorMap" class="h-full" style="min-height:240px;" ui-options="{ map: 'us_aea_en', markers: {{usa_markers}}, normalizeFunction: 'polynomial', backgroundColor: 'transparent', zoomMin: 0.5, regionsSelectable: true, markersSelectable: true, regionsSelectableOne: true, markersSelectableOne: true, focusOn: { x:0, y:0, scale: 0.6 }, series: { markers: [{ attribute: 'r', scale: [5, 15], values: [ 100.70, 255.16, 310.69, 605.17, 248.31, 107.35, 217.22 ] }] }, regionStyle: { initial: { fill: '#dde6e9', stroke: '#edf1f2', 'stroke-width': 2, 'stroke-opacity': 1 }, hover: { fill: '#fff' }, selected: { fill: '{{app.color.info}}' }, }, markerStyle: { initial: { fill: '{{app.color.info}}', stroke: '#fff', r: 10 }, hover: { stroke: '#fff' }, selected: { fill: '{{app.color.warning}}' } } }"> </div> <div class="top" style="top:20px;left:60px"> <div class="panel no-border w-md"> <div class="panel-heading "> <a href class="pull-right" ng-click="isCollapsed = !isCollapsed" ui-toggle-class> <i class="fa fa-angle-up text"></i> <i class="fa fa-angle-down text-active"></i> </a> <span class="font-bold">Mark Detail</span> </div> <div collapse="isCollapsed"> <div class="panel-body bg-light lter"> <div class="scrollable" style="max-height:110px" ui-jq="slimScroll" ui-options="{height:'110px', size:'6px'}"> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi id neque quam. Aliquam sollicitudin venenatis ipsum ac feugiat. </p> <p> Vestibulum ullamcorper sodales nisi nec condimentum. Mauris convallis mauris at pellentesque volutpat. </p> </div> </div> <div class="panel-footer"> <i class="fa fa-fw m-r-xs text-info fa-bookmark"></i><span class="font-bold">37</span> <i class="fa fa-fw m-r-xs text-info fa-star m-l"></i><span class="font-bold">120</span> </div> </div> </div> </div> <div class="bottom text-right w-full"> <small class="text-muted wrapper-sm block">Data @ naturalearthdata.com.</small> </div> </div> <!-- /column --> <!-- column --> <div class="col w-md lter b-l"> <div class="vbox"> <div class="wrapper b-b b-light">Map</div> <div class="row-row"> <div class="cell"> <div class="cell-inner"> <div class="wrapper-md"> This is the scrollable content <p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> You got the bottom </div> </div> </div> </div> <div class="wrapper b-t b-light text-center"> <p>Footer with fluid height</p> <a href class="btn btn-info">Create Marker</a> </div> </div> </div> <!-- /column --> </div> <!-- /hbox layout -->
extroxe/jyshop
source/admin/tpl/layout_fullwidth.html
HTML
mit
4,133
<!doctype html> <html> <head> <meta charset="utf-8"> <title>CodeMirror: Perl mode</title> <link rel="stylesheet" href="../../lib/codemirror.css"> <script src="../../lib/codemirror.js"></script> <script src="perl.js"></script> <link rel="stylesheet" href="../../doc/docs.css"> <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> </head> <body> <h1>CodeMirror: Perl mode</h1> <div><textarea id="code" name="code"> #!/usr/bin/perl use Something qw(func1 func2); # strings my $s1 = qq'single line'; our $s2 = q(multi- line); =item Something Example. =cut my $html=<<'HTML' <html> <title>hi!</title> </html> HTML print "first,".join(',', 'second', qq~third~); if($s1 =~ m[(?<!\s)(l.ne)\z]o) { $h->{$1}=$$.' predefined variables'; $s2 =~ s/\-line//ox; $s1 =~ s[ line ] [ block ]ox; } 1; # numbers and comments __END__ something... </textarea></div> <script> var editor = CodeMirror.fromTextArea(document.getElementById("code"), { lineNumbers: true }); </script> <p><strong>MIME types defined:</strong> <code>text/x-perl</code>.</p> </body> </html>
mpinkston/w2ui
libs/CodeMirror/mode/perl/index.html
HTML
mit
1,246
/* flatpickr v4.0.7, @license MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (factory((global.hr = {}))); }(this, (function (exports) { 'use strict'; var fp = typeof window !== "undefined" && window.flatpickr !== undefined ? window.flatpickr : { l10ns: {}, }; var Croatian = { firstDayOfWeek: 1, weekdays: { shorthand: ["Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"], longhand: [ "Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota", ], }, months: { shorthand: [ "Sij", "Velj", "Ožu", "Tra", "Svi", "Lip", "Srp", "Kol", "Ruj", "Lis", "Stu", "Pro", ], longhand: [ "Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac", ], }, }; fp.l10ns.hr = Croatian; var hr = fp.l10ns; exports.Croatian = Croatian; exports['default'] = hr; Object.defineProperty(exports, '__esModule', { value: true }); })));
extend1994/cdnjs
ajax/libs/flatpickr/4.0.7/l10n/hr.js
JavaScript
mit
1,575
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Tests\Http\Firewall; use Symfony\Component\Security\Http\Firewall\DigestData; class DigestDataTest extends \PHPUnit_Framework_TestCase { public function testGetResponse() { $digestAuth = new DigestData( 'username="user", realm="Welcome, robot!", ' . 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . 'response="b52938fc9e6d7c01be7702ece9031b42"' ); $this->assertEquals('b52938fc9e6d7c01be7702ece9031b42', $digestAuth->getResponse()); } public function testGetUsername() { $digestAuth = new DigestData( 'username="user", realm="Welcome, robot!", ' . 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . 'response="b52938fc9e6d7c01be7702ece9031b42"' ); $this->assertEquals('user', $digestAuth->getUsername()); } public function testGetUsernameWithQuote() { $digestAuth = new DigestData( 'username="\"user\"", realm="Welcome, robot!", ' . 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . 'response="b52938fc9e6d7c01be7702ece9031b42"' ); $this->assertEquals('"user"', $digestAuth->getUsername()); } public function testGetUsernameWithQuoteAndEscape() { $digestAuth = new DigestData( 'username="\"u\\\\\"ser\"", realm="Welcome, robot!", ' . 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . 'response="b52938fc9e6d7c01be7702ece9031b42"' ); $this->assertEquals('"u\\"ser"', $digestAuth->getUsername()); } public function testGetUsernameWithSingleQuote() { $digestAuth = new DigestData( 'username="\"u\'ser\"", realm="Welcome, robot!", ' . 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . 'response="b52938fc9e6d7c01be7702ece9031b42"' ); $this->assertEquals('"u\'ser"', $digestAuth->getUsername()); } public function testGetUsernameWithSingleQuoteAndEscape() { $digestAuth = new DigestData( 'username="\"u\\\'ser\"", realm="Welcome, robot!", ' . 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . 'response="b52938fc9e6d7c01be7702ece9031b42"' ); $this->assertEquals('"u\\\'ser"', $digestAuth->getUsername()); } public function testGetUsernameWithEscape() { $digestAuth = new DigestData( 'username="\"u\\ser\"", realm="Welcome, robot!", ' . 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . 'response="b52938fc9e6d7c01be7702ece9031b42"' ); $this->assertEquals('"u\\ser"', $digestAuth->getUsername()); } public function testValidateAndDecode() { $time = microtime(true); $key = 'ThisIsAKey'; $nonce = base64_encode($time . ':' . md5($time . ':' . $key)); $digestAuth = new DigestData( 'username="user", realm="Welcome, robot!", nonce="' . $nonce . '", ' . 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . 'response="b52938fc9e6d7c01be7702ece9031b42"' ); try { $digestAuth->validateAndDecode($key, 'Welcome, robot!'); } catch (\Exception $e) { $this->fail(sprintf('testValidateAndDecode fail with message: %s', $e->getMessage())); } } public function testCalculateServerDigest() { $this->calculateServerDigest('user', 'Welcome, robot!', 'pass,word=password', 'ThisIsAKey', '00000001', 'MDIwODkz', 'auth', 'GET', '/path/info?p1=5&p2=5'); } public function testCalculateServerDigestWithQuote() { $this->calculateServerDigest('\"user\"', 'Welcome, \"robot\"!', 'pass,word=password', 'ThisIsAKey', '00000001', 'MDIwODkz', 'auth', 'GET', '/path/info?p1=5&p2=5'); } public function testCalculateServerDigestWithQuoteAndEscape() { $this->calculateServerDigest('\"u\\\\\"ser\"', 'Welcome, \"robot\"!', 'pass,word=password', 'ThisIsAKey', '00000001', 'MDIwODkz', 'auth', 'GET', '/path/info?p1=5&p2=5'); } public function testCalculateServerDigestEscape() { $this->calculateServerDigest('\"u\\ser\"', 'Welcome, \"robot\"!', 'pass,word=password', 'ThisIsAKey', '00000001', 'MDIwODkz', 'auth', 'GET', '/path/info?p1=5&p2=5'); $this->calculateServerDigest('\"u\\ser\\\\\"', 'Welcome, \"robot\"!', 'pass,word=password', 'ThisIsAKey', '00000001', 'MDIwODkz', 'auth', 'GET', '/path/info?p1=5&p2=5'); } public function testIsNonceExpired() { $time = microtime(true) + 10; $key = 'ThisIsAKey'; $nonce = base64_encode($time . ':' . md5($time . ':' . $key)); $digestAuth = new DigestData( 'username="user", realm="Welcome, robot!", nonce="' . $nonce . '", ' . 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . 'response="b52938fc9e6d7c01be7702ece9031b42"' ); $digestAuth->validateAndDecode($key, 'Welcome, robot!'); $this->assertFalse($digestAuth->isNonceExpired()); } protected function setUp() { class_exists('Symfony\Component\Security\Http\Firewall\DigestAuthenticationListener', true); } private function calculateServerDigest($username, $realm, $password, $key, $nc, $cnonce, $qop, $method, $uri) { $time = microtime(true); $nonce = base64_encode($time . ':' . md5($time . ':' . $key)); $response = md5( md5($username . ':' . $realm . ':' . $password) . ':' . $nonce . ':' . $nc . ':' . $cnonce . ':' . $qop . ':' . md5($method . ':' . $uri) ); $digest = sprintf('username="%s", realm="%s", nonce="%s", uri="%s", cnonce="%s", nc=%s, qop="%s", response="%s"', $username, $realm, $nonce, $uri, $cnonce, $nc, $qop, $response ); $digestAuth = new DigestData($digest); $this->assertEquals($digestAuth->getResponse(), $digestAuth->calculateServerDigest($password, $method)); } }
gcubar/BlogBundle-Symfony
vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Http/Firewall/DigestDataTest.php
PHP
mit
7,187
YUI.add('scrollview-paginator', function(Y) { /** * Provides a plugin, which adds pagination support to ScrollView instances * * @module scrollview-paginator */ var UI = (Y.ScrollView) ? Y.ScrollView.UI_SRC : "ui", INDEX = "index", SCROLL_X = "scrollX", TOTAL = "total", BOUNDING_BOX = "boundingBox", CONTENT_BOX = "contentBox"; /** * Scrollview plugin that adds support for paging * * @class ScrollViewPaginator * @namespace Plugin * @extends Plugin.Base * @constructor */ function PaginatorPlugin() { PaginatorPlugin.superclass.constructor.apply(this, arguments); } /** * The identity of the plugin * * @property ScrollViewPaginator.NAME * @type String * @default 'paginatorPlugin' * @static */ PaginatorPlugin.NAME = 'pluginScrollViewPaginator'; /** * The namespace on which the plugin will reside * * @property ScrollViewPaginator.NS * @type String * @default 'pages' * @static */ PaginatorPlugin.NS = 'pages'; /** * The default attribute configuration for the plugin * * @property ScrollViewPaginator.ATTRS * @type Object * @static */ PaginatorPlugin.ATTRS = { /** * CSS selector for a page inside the scrollview. The scrollview * will snap to the closest page. * * @attribute selector * @type {String} */ selector: { value: null }, /** * The active page number for a paged scrollview * * @attribute index * @type {Number} * @default 0 */ index: { value: 0 }, /** * The total number of pages * * @attribute total * @type {Number} * @default 0 */ total: { value: 0 } }; Y.extend(PaginatorPlugin, Y.Plugin.Base, { /** * Designated initializer * * @method initializer */ initializer: function() { var host, paginator = this; // kweight host = paginator._host = paginator.get('host'); paginator.beforeHostMethod('_flickFrame', paginator._flickFrame); paginator.afterHostMethod('_uiDimensionsChange', paginator._calcOffsets); paginator.afterHostEvent('scrollEnd', paginator._scrollEnded); paginator.afterHostEvent('render', paginator._afterRender); paginator.after('indexChange', paginator._afterIndexChange); }, /** * Calculate the page boundary offsets * * @method _calcOffsets * @protected */ _calcOffsets : function() { var host = this._host, cb = host.get(CONTENT_BOX), bb = host.get(BOUNDING_BOX), pageSelector = this.get("selector"), pages, offsets; // Pre-calculate min/max values for each page pages = pageSelector ? cb.all(pageSelector) : cb.get("children"); this.set(TOTAL, pages.size()); this._pgOff = offsets = pages.get("offsetLeft"); offsets.push(host._scrollWidth - bb.get("offsetWidth")); }, /** * Executed to respond to the flick event, by over-riding the default flickFrame animation. * This is needed to determine if the next or prev page should be activated. * * @method _flickFrame * @protected */ _flickFrame: function() { var host = this._host, velocity = host._currentVelocity, inc = velocity < 0, pageIndex = this.get(INDEX), pageCount = this.get(TOTAL); if (velocity) { Y.log("Handling flick - increment: " + inc + ", pageIndex: " + pageIndex, "scrollview-paginator"); if (inc && pageIndex < pageCount-1) { this.set(INDEX, pageIndex+1); } else if (!inc && pageIndex > 0) { this.set(INDEX, pageIndex-1); } } return this._prevent; }, /** * After host render handler * * @method _afterRender * @protected */ _afterRender: function(e) { var host = this._host; host.get("boundingBox").addClass(host.getClassName("paged")); }, /** * scrollEnd handler detects if a page needs to change * * @method _scrollEnded * @param {Event.Facade} * @protected */ _scrollEnded: function(e) { var host = this._host, pageIndex = this.get(INDEX), pageCount = this.get(TOTAL); Y.log("_scrollEnded - onGME: " + e.onGestureMoveEnd + ", flicking: " + host._flicking + ", halfway: " + host._scrolledHalfway + ", forward: " + host._scrolledForward, "scrollview-paginator"); if(e.onGestureMoveEnd && !host._flicking) { if(host._scrolledHalfway) { if(host._scrolledForward && pageIndex < pageCount-1) { this.set(INDEX, pageIndex+1); } else if (pageIndex > 0) { this.set(INDEX, pageIndex-1); } else { this.snapToCurrent(); } } else { this.snapToCurrent(); } } host._flicking = false; }, /** * index attr change handler * * @method _afterIndexChange * @protected */ _afterIndexChange: function(e) { if(e.src !== UI) { this._uiIndex(e.newVal); } }, /** * Update the UI based on the current page index * * @method _uiIndex * @protected */ _uiIndex: function(index) { this.scrollTo(index, 350, 'ease-out'); }, /** * Scroll to the next page in the scrollview, with animation * * @method next */ next: function() { var index = this.get(INDEX); if(index < this.get(TOTAL)-1) { this.set(INDEX, index+1); } }, /** * Scroll to the previous page in the scrollview, with animation * * @method prev */ prev: function() { var index = this.get(INDEX); if(index > 0) { this.set(INDEX, index-1); } }, /** * Scroll to a given page in the scrollview, with animation. * * @method scrollTo * @param index {Number} The index of the page to scroll to * @param duration {Number} The number of ms the animation should last * @param easing {String} The timing function to use in the animation */ scrollTo: function(index, duration, easing) { var host = this._host, x = host.get(SCROLL_X); if(host._scrollsHorizontal) { x = this._pgOff[index]; host.set(SCROLL_X, x, { duration: duration, easing: easing }); } }, /** * Snaps the scrollview to the currently selected page * * @method snapToCurrent */ snapToCurrent: function() { var host = this._host; host._killTimer(); Y.log("snapToCurrent:" + this.get(INDEX), "scrollview-paginator"); host.set(SCROLL_X, this._pgOff[this.get(INDEX)], { duration: 300, easing: 'ease-out' }); }, _prevent: new Y.Do.Prevent() }); Y.namespace('Plugin').ScrollViewPaginator = PaginatorPlugin; }, '@VERSION@' ,{requires:['plugin']});
dannyxx001/cdnjs
ajax/libs/yui/3.4.0pr2/scrollview/scrollview-paginator-debug.js
JavaScript
mit
7,308
YUI.add('io-base', function(Y) { /** * Base IO functionality. Provides basic XHR transport support. * @module io * @submodule io-base */ /** * The io class is a utility that brokers HTTP requests through a simplified * interface. Specifically, it allows JavaScript to make HTTP requests to * a resource without a page reload. The underlying transport for making * same-domain requests is the XMLHttpRequest object. YUI.io can also use * Flash, if specified as a transport, for cross-domain requests. * * @class io */ /** * @event io:start * @description This event is fired by YUI.io when a transaction is initiated. * @type Event Custom */ var E_START = 'io:start', /** * @event io:complete * @description This event is fired by YUI.io when a transaction is complete. * Response status and data are accessible, if available. * @type Event Custom */ E_COMPLETE = 'io:complete', /** * @event io:success * @description This event is fired by YUI.io when a transaction is complete, and * the HTTP status resolves to HTTP2xx. * @type Event Custom */ E_SUCCESS = 'io:success', /** * @event io:failure * @description This event is fired by YUI.io when a transaction is complete, and * the HTTP status resolves to HTTP4xx, 5xx and above. * @type Event Custom */ E_FAILURE = 'io:failure', /** * @event io:end * @description This event signifies the end of the transaction lifecycle. The * transaction transport is destroyed. * @type Event Custom */ E_END = 'io:end', //-------------------------------------- // Properties //-------------------------------------- /** * @description A transaction counter that increments for each transaction. * * @property transactionId * @private * @static * @type int */ transactionId = 0, /** * @description Object of default HTTP headers to be initialized and sent * for all transactions. * * @property _headers * @private * @static * @type object */ _headers = { 'X-Requested-With' : 'XMLHttpRequest' }, /** * @description Object that stores timeout values for any transaction with * a defined "timeout" configuration property. * * @property _timeout * @private * @static * @type object */ _timeout = {}, // Window reference w = Y.config.win; //-------------------------------------- // Methods //-------------------------------------- /** * @description Method that creates the XMLHttpRequest transport * * @method _xhr * @private * @static * @return object */ function _xhr() { return w.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); } /** * @description Method that increments _transactionId for each transaction. * * @method _id * @private * @static * @return int */ function _id() { var id = transactionId; transactionId++; return id; } /** * @description Method that creates a unique transaction object for each * request. * * @method _create * @private * @static * @param {number} c - configuration object subset to determine if * the transaction is an XDR or file upload, * requiring an alternate transport. * @param {number} i - transaction id * @return object */ function _create(c, i) { var o = {}; o.id = Y.Lang.isNumber(i) ? i : _id(); c = c || {}; if (!c.use && !c.upload) { o.c = _xhr(); } else if (c.use) { if (c.use === 'native') { if (w.XDomainRequest) { o.c = new XDomainRequest(); o.t = c.use; } else { o.c = _xhr(); } } else { o.c = Y.io._transport[c.use]; o.t = c.use; } } else { o.c = {}; } return o; } function _destroy(o) { if (w) { if (o.c && w.XMLHttpRequest) { o.c.onreadystatechange = null; } else if (Y.UA.ie === 6 && !o.t) { // IE, when using XMLHttpRequest as an ActiveX Object, will throw // a "Type Mismatch" error if the event handler is set to "null". o.c.abort(); } } o.c = null; o = null; } /** * @description Method for creating and subscribing transaction events. * * @method _tE * @private * @static * @param {string} e - event to be published * @param {object} c - configuration data subset for event subscription. * * @return void */ function _tE(e, c) { var eT = new Y.EventTarget().publish('transaction:' + e), a = c.arguments, cT = c.context || Y; if (a) { eT.on(c.on[e], cT, a); } else { eT.on(c.on[e], cT); } return eT; } /** * @description Fires event "io:start" and creates, fires a * transaction-specific start event, if config.on.start is * defined. * * @method _ioStart * @private * @static * @param {number} id - transaction id * @param {object} c - configuration object for the transaction. * * @return void */ function _ioStart(id, c) { var a = c.arguments; if (a) { Y.fire(E_START, id, a); } else { Y.fire(E_START, id); } if (c.on && c.on.start) { _tE('start', c).fire(id); } } /** * @description Fires event "io:complete" and creates, fires a * transaction-specific "complete" event, if config.on.complete is * defined. * * @method _ioComplete * @private * @static * @param {object} o - transaction object. * @param {object} c - configuration object for the transaction. * * @return void */ function _ioComplete(o, c) { var r = o.e ? { status: 0, statusText: o.e } : o.c, a = c.arguments; if (a) { Y.fire(E_COMPLETE, o.id, r, a); } else { Y.fire(E_COMPLETE, o.id, r); } if (c.on && c.on.complete) { _tE('complete', c).fire(o.id, r); } } /** * @description Fires event "io:end" and creates, fires a * transaction-specific "end" event, if config.on.end is * defined. * * @method _ioEnd * @private * @static * @param {object} o - transaction object. * @param {object} c - configuration object for the transaction. * * @return void */ function _ioEnd(o, c) { var a = c.arguments; if (a) { Y.fire(E_END, o.id, a); } else { Y.fire(E_END, o.id); } if (c.on && c.on.end) { _tE('end', c).fire(o.id); } _destroy(o); } /** * @description Fires event "io:success" and creates, fires a * transaction-specific "success" event, if config.on.success is * defined. * * @method _ioSuccess * @private * @static * @param {object} o - transaction object. * @param {object} c - configuration object for the transaction. * * @return void */ function _ioSuccess(o, c) { var a = c.arguments; if (a) { Y.fire(E_SUCCESS, o.id, o.c, a); } else { Y.fire(E_SUCCESS, o.id, o.c); } if (c.on && c.on.success) { _tE('success', c).fire(o.id, o.c); } _ioEnd(o, c); } /** * @description Fires event "io:failure" and creates, fires a * transaction-specific "failure" event, if config.on.failure is * defined. * * @method _ioFailure * @private * @static * @param {object} o - transaction object. * @param {object} c - configuration object for the transaction. * * @return void */ function _ioFailure(o, c) { var r = o.e ? { status: 0, statusText: o.e } : o.c, a = c.arguments; if (a) { Y.fire(E_FAILURE, o.id, r, a); } else { Y.fire(E_FAILURE, o.id, r); } if (c.on && c.on.failure) { _tE('failure', c).fire(o.id, r); } _ioEnd(o, c); } /** * @description Resends an XDR transaction, using the Flash tranport, * if the native transport fails. * * @method _resend * @private * @static * @param {object} o - Transaction object generated by _create(). * @param {string} uri - qualified path to transaction resource. * @param {object} c - configuration object for the transaction. * * @return void */ function _resend(o, uri, c, d) { _destroy(o); c.xdr.use = 'flash'; // If the original request included serialized form data and // additional data are defined in configuration.data, it must // be reset to prevent data duplication. c.data = c.form && d ? d : null; return Y.io(uri, c, o.id); } /** * @description Method that concatenates string data for HTTP GET transactions. * * @method _concat * @private * @static * @param {string} s - URI or root data. * @param {string} d - data to be concatenated onto URI. * @return int */ function _concat(s, d) { s += ((s.indexOf('?') == -1) ? '?' : '&') + d; return s; } /** * @description Method that stores default client headers for all transactions. * If a label is passed with no value argument, the header will be deleted. * * @method _setHeader * @private * @static * @param {string} l - HTTP header * @param {string} v - HTTP header value * @return int */ function _setHeader(l, v) { if (v) { _headers[l] = v; } else { delete _headers[l]; } } /** * @description Method that sets all HTTP headers to be sent in a transaction. * * @method _setHeaders * @private * @static * @param {object} o - XHR instance for the specific transaction. * @param {object} h - HTTP headers for the specific transaction, as defined * in the configuration object passed to YUI.io(). * @return void */ function _setHeaders(o, h) { var p; h = h || {}; for (p in _headers) { if (_headers.hasOwnProperty(p)) { /* if (h[p]) { // Configuration headers will supersede preset io headers, // if headers match. continue; } else { h[p] = _headers[p]; } */ if (!h[p]) { h[p] = _headers[p]; } } } for (p in h) { if (h.hasOwnProperty(p)) { if (h[p] !== 'disable') { o.setRequestHeader(p, h[p]); } } } } /** * @description Terminates a transaction due to an explicit abort or * timeout. * * @method _ioCancel * @private * @static * @param {object} o - Transaction object generated by _create(). * @param {string} s - Identifies timed out or aborted transaction. * * @return void */ function _ioCancel(o, s) { if (o && o.c) { o.e = s; o.c.abort(); } } /** * @description Starts timeout count if the configuration object * has a defined timeout property. * * @method _startTimeout * @private * @static * @param {object} o - Transaction object generated by _create(). * @param {object} t - Timeout in milliseconds. * @return void */ function _startTimeout(o, t) { _timeout[o.id] = w.setTimeout(function() { _ioCancel(o, 'timeout'); }, t); } /** * @description Clears the timeout interval started by _startTimeout(). * * @method _clearTimeout * @private * @static * @param {number} id - Transaction id. * @return void */ function _clearTimeout(id) { w.clearTimeout(_timeout[id]); delete _timeout[id]; } /** * @description Method that determines if a transaction response qualifies * as success or failure, based on the response HTTP status code, and * fires the appropriate success or failure events. * * @method _handleResponse * @private * @static * @param {object} o - Transaction object generated by _create(). * @param {object} c - Configuration object passed to io(). * @return void */ function _handleResponse(o, c) { var status; try { status = (o.c.status && o.c.status !== 0) ? o.c.status : 0; } catch(e) { status = 0; } // IE reports HTTP 204 as HTTP 1223. if (status >= 200 && status < 300 || status === 1223) { _ioSuccess(o, c); } else { _ioFailure(o, c); } } /** * @description Event handler bound to onreadystatechange. * * @method _readyState * @private * @static * @param {object} o - Transaction object generated by _create(). * @param {object} c - Configuration object passed to YUI.io(). * @return void */ function _readyState(o, c) { if (o.c.readyState === 4) { if (c.timeout) { _clearTimeout(o.id); } w.setTimeout( function() { _ioComplete(o, c); _handleResponse(o, c); }, 0); } } /** * @description Method for requesting a transaction. _io() is implemented as * yui.io(). Each transaction may include a configuration object. Its * properties are: * * method: HTTP method verb (e.g., GET or POST). If this property is not * not defined, the default value will be GET. * * data: This is the name-value string that will be sent as the transaction * data. If the request is HTTP GET, the data become part of * querystring. If HTTP POST, the data are sent in the message body. * * xdr: Defines the transport to be used for cross-domain requests. By * setting this property, the transaction will use the specified * transport instead of XMLHttpRequest. * The properties are: * { * use: Specify the transport to be used: 'flash' and 'native' * dataType: Set the value to 'XML' if that is the expected * response content type. * } * * * form: This is a defined object used to process HTML form as data. The * properties are: * { * id: Node object or id of HTML form. * useDisabled: Boolean value to allow disabled HTML form field * values to be sent as part of the data. * } * * on: This is a defined object used to create and handle specific * events during a transaction lifecycle. These events will fire in * addition to the global io events. The events are: * start - This event is fired when a request is sent to a resource. * complete - This event fires when the transaction is complete. * success - This event fires when the response status resolves to * HTTP 2xx. * failure - This event fires when the response status resolves to * HTTP 4xx, 5xx; and, for all transaction exceptions, * including aborted transactions and transaction timeouts. * end - This even is fired at the conclusion of the transaction * lifecycle, after a success or failure resolution. * * The properties are: * { * start: function(id, arguments){}, * complete: function(id, responseobject, arguments){}, * success: function(id, responseobject, arguments){}, * failure: function(id, responseobject, arguments){}, * end: function(id, arguments){} * } * Each property can reference a function or be written as an * inline function. * * sync: To enable synchronous transactions, set the configuration property * "sync" to true; the default behavior is false. Synchronous * transactions are limited to same-domain requests only. * * context: Object reference for all defined transaction event handlers * when it is implemented as a method of a base object. Defining * "context" will set the reference of "this," used in the * event handlers, to the context value. In the case where * different event handlers all have different contexts, * use Y.bind() to set the execution context, bypassing this * configuration. * * headers: This is a defined object of client headers, as many as. * desired for the transaction. The object pattern is: * { 'header': 'value' }. * * timeout: This value, defined as milliseconds, is a time threshold for the * transaction. When this threshold is reached, and the transaction's * Complete event has not yet fired, the transaction will be aborted. * * arguments: Object, array, string, or number passed to all registered * event handlers. This value is available as the second * argument in the "start" and "abort" event handlers; and, it is * the third argument in the "complete", "success", and "failure" * event handlers. * * @method _io * @private * @static * @param {string} uri - qualified path to transaction resource. * @param {object} c - configuration object for the transaction. * @param {number} i - transaction id, if already set. * @return object */ function _io(uri, c, i) { var f, o, d, m, r, s, oD, a, j, u = uri; c = Y.Object(c); o = _create(c.xdr || c.form, i); m = c.method ? c.method = c.method.toUpperCase() : c.method = 'GET'; s = c.sync; oD = c.data; //To serialize an object into a key-value string, add the //QueryString module to the YUI instance's 'use' method. if (Y.Lang.isObject(c.data) && Y.QueryString) { c.data = Y.QueryString.stringify(c.data); Y.log('Configuration property "data" is an object. The serialized value is: ' + c.data, 'info', 'io'); } if (c.form) { if (c.form.upload) { // This is a file upload transaction, calling // upload() in io-upload-iframe. return Y.io.upload(o, uri, c); } else { // Serialize HTML form data. f = Y.io._serialize(c.form, c.data); if (m === 'POST' || m === 'PUT') { c.data = f; } else if (m === 'GET') { uri = _concat(uri, f); } } } if (c.data && m === 'GET') { uri = _concat(uri, c.data); Y.log('HTTP GET with configuration data. The querystring is: ' + uri, 'info', 'io'); } if (c.data && m === 'POST') { c.headers = Y.merge({ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, c.headers); } if (o.t) { return Y.io.xdr(uri, o, c); } if (!s) { o.c.onreadystatechange = function() { _readyState(o, c); }; } try { o.c.open(m, uri, s ? false : true); // Will work only in browsers that implement the // Cross-Origin Resource Sharing draft. if (c.xdr && c.xdr.credentials) { o.c.withCredentials = true; } } catch(e1) { if (c.xdr) { // This exception is usually thrown by browsers // that do not support native XDR transactions. return _resend(o, u, c, oD); } } _setHeaders(o.c, c.headers); _ioStart(o.id, c); try { // Using "null" with HTTP POST will result in a request // with no Content-Length header defined. o.c.send(c.data || ''); if (s) { d = o.c; a = ['status', 'statusText', 'responseText', 'responseXML']; r = c.arguments ? { id: o.id, arguments: c.arguments } : { id: o.id }; for (j = 0; j < 4; j++) { r[a[j]] = o.c[a[j]]; } r.getAllResponseHeaders = function() { return d.getAllResponseHeaders(); }; r.getResponseHeader = function(h) { return d.getResponseHeader(h); }; _ioComplete(o, c); _handleResponse(o, c); return r; } } catch(e2) { if (c.xdr) { // This exception is usually thrown by browsers // that do not support native XDR transactions. return _resend(o, u, c, oD); } } // If config.timeout is defined, and the request is standard XHR, // initialize timeout polling. if (c.timeout) { _startTimeout(o, c.timeout); Y.log('Configuration timeout set to: ' + c.timeout, 'info', 'io'); } return { id: o.id, abort: function() { return o.c ? _ioCancel(o, 'abort') : false; }, isInProgress: function() { return o.c ? o.c.readyState !== 4 && o.c.readyState !== 0 : false; } }; } _io.start = _ioStart; _io.complete = _ioComplete; _io.success = _ioSuccess; _io.failure = _ioFailure; _io.end = _ioEnd; _io._id = _id; _io._timeout = _timeout; //-------------------------------------- // Begin public interface definition //-------------------------------------- /** * @description Method that stores default client headers for all transactions. * If a label is passed with no value argument, the header will be deleted. * This is the interface for _setHeader(). * * @method header * @public * @static * @param {string} l - HTTP header * @param {string} v - HTTP header value * @return int */ _io.header = _setHeader; /** * @description Method for requesting a transaction. This * is the interface for _io(). * * @method io * @public * @static * @param {string} uri - qualified path to transaction resource. * @param {object} c - configuration object for the transaction. * @return object */ Y.io = _io; Y.io.http = _io; }, '@VERSION@' ,{requires:['event-custom-base', 'querystring-stringify-simple']});
aashish24/cdnjs
ajax/libs/yui/3.3.0pr2/io/io-base-debug.js
JavaScript
mit
23,563
YUI.add('widget-stack', function(Y) { /** * Provides stackable (z-index) support for Widgets through an extension. * * @module widget-stack */ var L = Y.Lang, UA = Y.UA, Node = Y.Node, Widget = Y.Widget, ZINDEX = "zIndex", SHIM = "shim", VISIBLE = "visible", BOUNDING_BOX = "boundingBox", RENDER_UI = "renderUI", BIND_UI = "bindUI", SYNC_UI = "syncUI", OFFSET_WIDTH = "offsetWidth", OFFSET_HEIGHT = "offsetHeight", PARENT_NODE = "parentNode", FIRST_CHILD = "firstChild", WIDTH = "width", HEIGHT = "height", PX = "px", // HANDLE KEYS SHIM_DEFERRED = "shimdeferred", SHIM_RESIZE = "shimresize", // Events VisibleChange = "visibleChange", WidthChange = "widthChange", HeightChange = "heightChange", ShimChange = "shimChange", ZIndexChange = "zIndexChange", ContentUpdate = "contentUpdate", // CSS STACKED = "stacked"; /** * Widget extension, which can be used to add stackable (z-index) support to the * base Widget class along with a shimming solution, through the * <a href="Base.html#method_build">Base.build</a> method. * * @class WidgetStack * @param {Object} User configuration object */ function Stack(config) { this._stackNode = this.get(BOUNDING_BOX); this._stackHandles = {}; // WIDGET METHOD OVERLAP Y.after(this._renderUIStack, this, RENDER_UI); Y.after(this._syncUIStack, this, SYNC_UI); Y.after(this._bindUIStack, this, BIND_UI); } // Static Properties /** * Static property used to define the default attribute * configuration introduced by WidgetStack. * * @property WidgetStack.ATTRS * @type Object * @static */ Stack.ATTRS = { /** * @attribute shim * @type boolean * @default false, for all browsers other than IE6, for which a shim is enabled by default. * * @description Boolean flag to indicate whether or not a shim should be added to the Widgets * boundingBox, to protect it from select box bleedthrough. */ shim: { value: (UA.ie == 6) }, /** * @attribute zIndex * @type number * @default 0 * @description The z-index to apply to the Widgets boundingBox. Non-numerical values for * zIndex will be converted to 0 */ zIndex: { value:0, setter: function(val) { return this._setZIndex(val); } } }; /** * The HTML parsing rules for the WidgetStack class. * * @property WidgetStack.HTML_PARSER * @static * @type Object */ Stack.HTML_PARSER = { zIndex: function(contentBox) { return contentBox.getStyle(ZINDEX); } }; /** * Default class used to mark the shim element * * @property WidgetStack.SHIM_CLASS_NAME * @type String * @static * @default "yui-widget-shim" */ Stack.SHIM_CLASS_NAME = Widget.getClassName(SHIM); /** * Default class used to mark the boundingBox of a stacked widget. * * @property WidgetStack.STACKED_CLASS_NAME * @type String * @static * @default "yui-widget-stacked" */ Stack.STACKED_CLASS_NAME = Widget.getClassName(STACKED); /** * Default markup template used to generate the shim element. * * @property WidgetStack.SHIM_TEMPLATE * @type String * @static */ Stack.SHIM_TEMPLATE = '<iframe class="' + Stack.SHIM_CLASS_NAME + '" frameborder="0" title="Widget Stacking Shim" src="javascript:false" tabindex="-1" role="presentation"></iframe>'; Stack.prototype = { /** * Synchronizes the UI to match the Widgets stack state. This method in * invoked after syncUI is invoked for the Widget class using YUI's aop infrastructure. * * @method _syncUIStack * @protected */ _syncUIStack: function() { this._uiSetShim(this.get(SHIM)); this._uiSetZIndex(this.get(ZINDEX)); }, /** * Binds event listeners responsible for updating the UI state in response to * Widget stack related state changes. * <p> * This method is invoked after bindUI is invoked for the Widget class * using YUI's aop infrastructure. * </p> * @method _bindUIStack * @protected */ _bindUIStack: function() { this.after(ShimChange, this._afterShimChange); this.after(ZIndexChange, this._afterZIndexChange); }, /** * Creates/Initializes the DOM to support stackability. * <p> * This method in invoked after renderUI is invoked for the Widget class * using YUI's aop infrastructure. * </p> * @method _renderUIStack * @protected */ _renderUIStack: function() { this._stackNode.addClass(Stack.STACKED_CLASS_NAME); }, /** * Default setter for zIndex attribute changes. Normalizes zIndex values to * numbers, converting non-numerical values to 0. * * @method _setZIndex * @protected * @param {String | Number} zIndex * @return {Number} Normalized zIndex */ _setZIndex: function(zIndex) { if (L.isString(zIndex)) { zIndex = parseInt(zIndex, 10); } if (!L.isNumber(zIndex)) { zIndex = 0; } return zIndex; }, /** * Default attribute change listener for the shim attribute, responsible * for updating the UI, in response to attribute changes. * * @method _afterShimChange * @protected * @param {EventFacade} e The event facade for the attribute change */ _afterShimChange : function(e) { this._uiSetShim(e.newVal); }, /** * Default attribute change listener for the zIndex attribute, responsible * for updating the UI, in response to attribute changes. * * @method _afterZIndexChange * @protected * @param {EventFacade} e The event facade for the attribute change */ _afterZIndexChange : function(e) { this._uiSetZIndex(e.newVal); }, /** * Updates the UI to reflect the zIndex value passed in. * * @method _uiSetZIndex * @protected * @param {number} zIndex The zindex to be reflected in the UI */ _uiSetZIndex: function (zIndex) { this._stackNode.setStyle(ZINDEX, zIndex); }, /** * Updates the UI to enable/disable the shim. If the widget is not currently visible, * creation of the shim is deferred until it is made visible, for performance reasons. * * @method _uiSetShim * @protected * @param {boolean} enable If true, creates/renders the shim, if false, removes it. */ _uiSetShim: function (enable) { if (enable) { // Lazy creation if (this.get(VISIBLE)) { this._renderShim(); } else { this._renderShimDeferred(); } } else { this._destroyShim(); } }, /** * Sets up change handlers for the visible attribute, to defer shim creation/rendering * until the Widget is made visible. * * @method _renderShimDeferred * @private */ _renderShimDeferred : function() { this._stackHandles[SHIM_DEFERRED] = this._stackHandles[SHIM_DEFERRED] || []; var handles = this._stackHandles[SHIM_DEFERRED], createBeforeVisible = function(e) { if (e.newVal) { this._renderShim(); } }; handles.push(this.on(VisibleChange, createBeforeVisible)); }, /** * Sets up event listeners to resize the shim when the size of the Widget changes. * <p> * NOTE: This method is only used for IE6 currently, since IE6 doesn't support a way to * resize the shim purely through CSS, when the Widget does not have an explicit width/height * set. * </p> * @method _addShimResizeHandlers * @private */ _addShimResizeHandlers : function() { this._stackHandles[SHIM_RESIZE] = this._stackHandles[SHIM_RESIZE] || []; var sizeShim = this.sizeShim, handles = this._stackHandles[SHIM_RESIZE]; this.sizeShim(); handles.push(this.after(VisibleChange, sizeShim)); handles.push(this.after(WidthChange, sizeShim)); handles.push(this.after(HeightChange, sizeShim)); handles.push(this.after(ContentUpdate, sizeShim)); }, /** * Detaches any handles stored for the provided key * * @method _detachStackHandles * @param String handleKey The key defining the group of handles which should be detached * @private */ _detachStackHandles : function(handleKey) { var handles = this._stackHandles[handleKey], handle; if (handles && handles.length > 0) { while((handle = handles.pop())) { handle.detach(); } } }, /** * Creates the shim element and adds it to the DOM * * @method _renderShim * @private */ _renderShim : function() { var shimEl = this._shimNode, stackEl = this._stackNode; if (!shimEl) { shimEl = this._shimNode = this._getShimTemplate(); stackEl.insertBefore(shimEl, stackEl.get(FIRST_CHILD)); if (UA.ie == 6) { this._addShimResizeHandlers(); } this._detachStackHandles(SHIM_DEFERRED); } }, /** * Removes the shim from the DOM, and detaches any related event * listeners. * * @method _destroyShim * @private */ _destroyShim : function() { if (this._shimNode) { this._shimNode.get(PARENT_NODE).removeChild(this._shimNode); this._shimNode = null; this._detachStackHandles(SHIM_DEFERRED); this._detachStackHandles(SHIM_RESIZE); } }, /** * For IE6, synchronizes the size and position of iframe shim to that of * Widget bounding box which it is protecting. For all other browsers, * this method does not do anything. * * @method sizeShim */ sizeShim: function () { var shim = this._shimNode, node = this._stackNode; if (shim && UA.ie === 6 && this.get(VISIBLE)) { shim.setStyle(WIDTH, node.get(OFFSET_WIDTH) + PX); shim.setStyle(HEIGHT, node.get(OFFSET_HEIGHT) + PX); } }, /** * Creates a cloned shim node, using the SHIM_TEMPLATE html template, for use on a new instance. * * @method _getShimTemplate * @private * @return {Node} node A new shim Node instance. */ _getShimTemplate : function() { if (!Stack._SHIM_TEMPLATE) { Stack._SHIM_TEMPLATE = Node.create(Stack.SHIM_TEMPLATE); } return Stack._SHIM_TEMPLATE.cloneNode(true); } }; Y.WidgetStack = Stack; }, '@VERSION@' ,{requires:['widget']});
dhowe/cdnjs
ajax/libs/yui/3.0.0b1/widget/widget-stack.js
JavaScript
mit
12,248
YUI.add('io-xdr', function(Y) { /** Extends IO to provide an alternate, Flash transport, for making cross-domain requests. @module io-base @submodule io-xdr @for IO **/ /** Fires when the XDR transport is ready for use. @event io:xdrReady **/ var E_XDR_READY = Y.publish('io:xdrReady', { fireOnce: true }), /** Map of stored configuration objects when using Flash as the transport for cross-domain requests. @property _cB @private @type {Object} **/ _cB = {}, /** Map of transaction simulated readyState values when XDomainRequest is the transport. @property _rS @private @type {Object} **/ _rS = {}, // Document reference d = Y.config.doc, // Window reference w = Y.config.win, // XDomainRequest cross-origin request detection xdr = w && w.XDomainRequest; /** Method that creates the Flash transport swf. @method _swf @private @param {String} uri - location of io.swf. @param {String} yid - YUI sandbox id. @param {String} yid - IO instance id. **/ function _swf(uri, yid, uid) { var o = '<object id="io_swf" type="application/x-shockwave-flash" data="' + uri + '" width="0" height="0">' + '<param name="movie" value="' + uri + '">' + '<param name="FlashVars" value="yid=' + yid + '&uid=' + uid + '">' + '<param name="allowScriptAccess" value="always">' + '</object>', c = d.createElement('div'); d.body.appendChild(c); c.innerHTML = o; } /** Creates a response object for XDR transactions, for success and failure cases. @method _data @private @param {Object} o - Transaction object generated by _create() in io-base. @param {Boolean} u - Configuration xdr.use. @param {Boolean} d - Configuration xdr.dataType. @return {Object} **/ function _data(o, u, d) { if (u === 'flash') { o.c.responseText = decodeURI(o.c.responseText); } if (d === 'xml') { o.c.responseXML = Y.DataType.XML.parse(o.c.responseText); } return o; } /** Method for intiating an XDR transaction abort. @method _abort @private @param {Object} o - Transaction object generated by _create() in io-base. @param {Object} c - configuration object for the transaction. **/ function _abort(o, c) { return o.c.abort(o.id, c); } /** Method for determining if an XDR transaction has completed and all data are received. @method _isInProgress @private @param {Object} o - Transaction object generated by _create() in io-base. **/ function _isInProgress(o) { return xdr ? _rS[o.id] !== 4 : o.c.isInProgress(o.id); } Y.mix(Y.IO.prototype, { /** Map of io transports. @property _transport @private @type {Object} **/ _transport: {}, /** Sets event handlers for XDomainRequest transactions. @method _ieEvt @private @static @param {Object} o - Transaction object generated by _create() in io-base. @param {Object} c - configuration object for the transaction. **/ _ieEvt: function(o, c) { var io = this, i = o.id, t = 'timeout'; o.c.onprogress = function() { _rS[i] = 3; }; o.c.onload = function() { _rS[i] = 4; io.xdrResponse('success', o, c); }; o.c.onerror = function() { _rS[i] = 4; io.xdrResponse('failure', o, c); }; if (c[t]) { o.c.ontimeout = function() { _rS[i] = 4; io.xdrResponse(t, o, c); }; o.c[t] = c[t]; } }, /** Method for accessing the transport's interface for making a cross-domain transaction. @method xdr @param {String} uri - qualified path to transaction resource. @param {Object} o - Transaction object generated by _create() in io-base. @param {Object} c - configuration object for the transaction. **/ xdr: function(uri, o, c) { var io = this; if (c.xdr.use === 'flash') { // The configuration object cannot be serialized safely // across Flash's ExternalInterface. _cB[o.id] = c; w.setTimeout(function() { try { o.c.send(uri, { id: o.id, uid: o.uid, method: c.method, data: c.data, headers: c.headers }); } catch(e) { io.xdrResponse('transport error', o, c); delete _cB[o.id]; } }, Y.io.xdr.delay); } else if (xdr) { io._ieEvt(o, c); o.c.open(c.method || 'GET', uri); o.c.send(c.data); } else { o.c.send(uri, o, c); } return { id: o.id, abort: function() { return o.c ? _abort(o, c) : false; }, isInProgress: function() { return o.c ? _isInProgress(o.id) : false; }, io: io }; }, /** Response controller for cross-domain requests when using the Flash transport or IE8's XDomainRequest object. @method xdrResponse @param {String} e Event name @param {Object} o Transaction object generated by _create() in io-base. @param {Object} c Configuration object for the transaction. @return {Object} **/ xdrResponse: function(e, o, c) { c = _cB[o.id] ? _cB[o.id] : c; var io = this, m = xdr ? _rS : _cB, u = c.xdr.use, d = c.xdr.dataType; switch (e) { case 'start': io.start(o, c); break; //case 'complete': //This case is not used by Flash or XDomainRequest. //io.complete(o, c); //break; case 'success': io.success(_data(o, u, d), c); delete m[o.id]; break; case 'timeout': case 'abort': case 'transport error': o.c = { status: 0, statusText: e }; case 'failure': io.failure(_data(o, u, d), c); delete m[o.id]; break; } }, /** Fires event "io:xdrReady" @method _xdrReady @private @param {Number} yid - YUI sandbox id. @param {Number} uid - IO instance id. **/ _xdrReady: function(yid, uid) { Y.fire(E_XDR_READY, yid, uid); }, /** Initializes the desired transport. @method transport @param {Object} o - object of transport configurations. **/ transport: function(c) { if (c.id === 'flash') { _swf(Y.UA.ie ? c.src + '?d=' + new Date().valueOf().toString() : c.src, Y.id, c.uid); } this._transport[c.id] = (c.id === 'flash') ? d.getElementById('io_swf') : c.src; } }); /** Fires event "io:xdrReady" @method xdrReady @protected @static @param {Number} yid - YUI sandbox id. @param {Number} uid - IO instance id. **/ Y.io.xdrReady = function(yid, uid){ var io = Y.io._map[uid]; Y.io.xdr.delay = 0; io._xdrReady.apply(io, [yid, uid]); }; Y.io.xdrResponse = function(e, o, c){ var io = Y.io._map[o.uid]; io.xdrResponse.apply(io, [e, o, c]); }; Y.io.transport = function(c){ var io = Y.io._map['io:0'] || new Y.IO(); c.uid = io._uid; io.transport.apply(io, [c]); }; /** Delay value to calling the Flash transport, in the event io.swf has not finished loading. Once the E_XDR_READY event is fired, this value will be set to 0. @property delay @static @type {Number} **/ Y.io.xdr = { delay : 100 }; }, '@VERSION@' ,{requires:['io-base','datatype-xml-parse']});
dominic/cdnjs
ajax/libs/yui/3.5.0pr1/io-xdr/io-xdr.js
JavaScript
mit
7,820
if(typeof YUI!="undefined"){YUI._YUI=YUI;}var YUI=function(){var c=0,f=this,b=arguments,a=b.length,e=function(h,g){return(h&&h.hasOwnProperty&&(h instanceof g));},d=(typeof YUI_config!=="undefined")&&YUI_config;if(!(e(f,YUI))){f=new YUI();}else{f._init();if(YUI.GlobalConfig){f.applyConfig(YUI.GlobalConfig);}if(d){f.applyConfig(d);}if(!a){f._setup();}}if(a){for(;c<a;c++){f.applyConfig(b[c]);}f._setup();}f.instanceOf=e;return f;};(function(){var q,b,r="@VERSION@",i=".",o="http://yui.yahooapis.com/",u="yui3-js-enabled",d="yui3-css-stamp",m=function(){},h=Array.prototype.slice,s={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},g=(typeof window!="undefined"),f=(g)?window:null,w=(g)?f.document:null,e=w&&w.documentElement,a=e&&e.className,c={},j=new Date().getTime(),n=function(A,z,y,x){if(A&&A.addEventListener){A.addEventListener(z,y,x);}else{if(A&&A.attachEvent){A.attachEvent("on"+z,y);}}},v=function(B,A,z,x){if(B&&B.removeEventListener){try{B.removeEventListener(A,z,x);}catch(y){}}else{if(B&&B.detachEvent){B.detachEvent("on"+A,z);}}},t=function(){YUI.Env.windowLoaded=true;YUI.Env.DOMReady=true;if(g){v(window,"load",t);}},k=function(z,y){var x=z.Env._loader;if(x){x.ignoreRegistered=false;x.onEnd=null;x.data=null;x.required=[];x.loadType=null;}else{x=new z.Loader(z.config);z.Env._loader=x;}YUI.Env.core=z.Array.dedupe([].concat(YUI.Env.core,["loader-base","loader-rollup","loader-yui3"]));return x;},p=function(z,y){for(var x in y){if(y.hasOwnProperty(x)){z[x]=y[x];}}},l={success:true};if(e&&a.indexOf(u)==-1){if(a){a+=" ";}a+=u;e.className=a;}if(r.indexOf("@")>-1){r="3.3.0";}q={applyConfig:function(D){D=D||m;var z,B,A=this.config,C=A.modules,y=A.groups,x=this.Env._loader;for(B in D){if(D.hasOwnProperty(B)){z=D[B];if(C&&B=="modules"){p(C,z);}else{if(y&&B=="groups"){p(y,z);}else{if(B=="win"){A[B]=(z&&z.contentWindow)||z;A.doc=A[B]?A[B].document:null;}else{if(B=="_yuid"){}else{A[B]=z;}}}}}}if(x){x._config(D);}},_config:function(x){this.applyConfig(x);},_init:function(){var A,z,B=this,x=YUI.Env,y=B.Env,C;B.version=r;if(!y){B.Env={core:["get","features","intl-base","yui-log","yui-later"],mods:{},versions:{},base:o,cdn:o+r+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(H,F){var D=H.match(F),G,E;if(D){G=RegExp.leftContext||H.slice(0,H.indexOf(D[0]));E=D[3];if(D[1]){G+="?"+D[1];}G={filter:E,path:G};}return G;},getBase:x&&x.getBase||function(H){var F=(w&&w.getElementsByTagName("script"))||[],I=y.cdn,E,G,D,J;for(G=0,D=F.length;G<D;++G){J=F[G].src;if(J){E=B.Env.parseBasePath(J,H);if(E){A=E.filter;I=E.path;break;}}}return I;}};y=B.Env;y._loaded[r]={};if(x&&B!==YUI){y._yidx=++x._yidx;y._guidp=("yui_"+r+"_"+y._yidx+"_"+j).replace(/\./g,"_");}else{if(YUI._YUI){x=YUI._YUI.Env;y._yidx+=x._yidx;y._uidx+=x._uidx;for(C in x){if(!(C in y)){y[C]=x[C];}}delete YUI._YUI;}}B.id=B.stamp(B);c[B.id]=B;}B.constructor=YUI;B.config=B.config||{bootstrap:true,cacheUse:true,debug:true,doc:w,fetchCSS:true,throwFail:true,useBrowserConsole:true,useNativeES5:true,win:f};if(w&&!w.getElementById(d)){z=w.createElement("div");z.innerHTML='<div id="'+d+'" style="position: absolute !important; visibility: hidden !important"></div>';YUI.Env.cssStampEl=z.firstChild;e.insertBefore(YUI.Env.cssStampEl,e.firstChild);}B.config.lang=B.config.lang||"en-US";B.config.base=YUI.config.base||B.Env.getBase(B.Env._BASE_RE);if(!A||(!("mindebug").indexOf(A))){A="min";}A=(A)?"-"+A:A;B.config.loaderPath=YUI.config.loaderPath||"loader/loader"+A+".js";},_setup:function(C){var y,B=this,x=[],A=YUI.Env.mods,z=B.config.core||[].concat(YUI.Env.core);for(y=0;y<z.length;y++){if(A[z[y]]){x.push(z[y]);}}B._attach(["yui-base"]);B._attach(x);if(B.Loader){k(B);}},applyTo:function(D,C,z){if(!(C in s)){this.log(C+": applyTo not allowed","warn","yui");return null;}var y=c[D],B,x,A;if(y){B=C.split(".");x=y;for(A=0;A<B.length;A=A+1){x=x[B[A]];if(!x){this.log("applyTo not found: "+C,"warn","yui");}}return x&&x.apply(y,z);}return null;},add:function(y,D,C,x){x=x||{};var B=YUI.Env,E={name:y,fn:D,version:C,details:x},F,A,z=B.versions;B.mods[y]=E;z[C]=z[C]||{};z[C][y]=E;for(A in c){if(c.hasOwnProperty(A)){F=c[A].Env._loader;if(F){if(!F.moduleInfo[y]){F.addModule(x,y);}}}}return this;},_attach:function(C,N){var G,O,M,J,x,E,z,A=YUI.Env.mods,H=YUI.Env.aliases,y=this,F,B=y.Env._loader,D=y.Env._attached,I=C.length,B,L=[];for(G=0;G<I;G++){O=C[G];M=A[O];L.push(O);if(B&&B.conditions[O]){y.Object.each(B.conditions[O],function(Q){var P=Q&&((Q.ua&&y.UA[Q.ua])||(Q.test&&Q.test(y)));if(P){L.push(Q.name);}});}}C=L;I=C.length;for(G=0;G<I;G++){if(!D[C[G]]){O=C[G];M=A[O];if(H&&H[O]){y._attach(H[O]);continue;}if(!M){if(B&&B.moduleInfo[O]){M=B.moduleInfo[O];N=true;}if(!N&&O){if((O.indexOf("skin-")===-1)&&(O.indexOf("css")===-1)){y.Env._missed.push(O);y.Env._missed=y.Array.dedupe(y.Env._missed);y.message("NOT loaded: "+O,"warn","yui");}}}else{D[O]=true;for(F=0;F<y.Env._missed.length;F++){if(y.Env._missed[F]===O){y.message("Found: "+O+" (was reported as missing earlier)","warn","yui");y.Env._missed.splice(F,1);}}J=M.details;x=J.requires;E=J.use;z=J.after;if(x){for(F=0;F<x.length;F++){if(!D[x[F]]){if(!y._attach(x)){return false;}break;}}}if(z){for(F=0;F<z.length;F++){if(!D[z[F]]){if(!y._attach(z,true)){return false;}break;}}}if(M.fn){try{M.fn(y,O);}catch(K){y.error("Attach error: "+O,K,O);return false;}}if(E){for(F=0;F<E.length;F++){if(!D[E[F]]){if(!y._attach(E)){return false;}break;}}}}}}return true;},use:function(){var A=h.call(arguments,0),E=A[A.length-1],D=this,C=0,y=[],z,x=D.Env,B=true;if(D.Lang.isFunction(E)){A.pop();}else{E=null;}if(D.Lang.isArray(A[0])){A=A[0];}if(D.config.cacheUse){while((z=A[C++])){if(!x._attached[z]){B=false;break;}}if(B){if(A.length){}D._notify(E,l,A);return D;}}if(D._loading){D._useQueue=D._useQueue||new D.Queue();D._useQueue.add([A,E]);}else{D._use(A,function(G,F){G._notify(E,F,A);});}return D;},_notify:function(A,x,y){if(!x.success&&this.config.loadErrorFn){this.config.loadErrorFn.call(this,this,A,x,y); }else{if(A){try{A(this,x);}catch(z){this.error("use callback error",z,y);}}}},_use:function(z,B){if(!this.Array){this._attach(["yui-base"]);}var O,G,P,L,y=this,Q=YUI.Env,A=Q.mods,x=y.Env,D=x._used,N=Q.aliases,K=Q._loaderQueue,T=z[0],F=y.Array,R=y.config,E=R.bootstrap,M=[],I=[],S=true,C=R.fetchCSS,J=function(X,W){var V=0,U=[];if(!X.length){return;}if(N){for(V=0;V<X.length;V++){if(N[X[V]]){U=[].concat(U,N[X[V]]);}else{U.push(X[V]);}}X=U;}F.each(X,function(ab){if(!W){I.push(ab);}if(D[ab]){return;}var Z=A[ab],ac,aa;if(Z){D[ab]=true;ac=Z.details.requires;aa=Z.details.use;}else{if(!Q._loaded[r][ab]){M.push(ab);}else{D[ab]=true;}}if(ac&&ac.length){J(ac);}if(aa&&aa.length){J(aa,1);}});},H=function(Z){var W=Z||{success:true,msg:"not dynamic"},V,U,X=true,aa=W.data;y._loading=false;if(aa){U=M;M=[];I=[];J(aa);V=M.length;if(V){if(M.sort().join()==U.sort().join()){V=false;}}}if(V&&aa){y._loading=false;y._use(z,function(){if(y._attach(aa)){y._notify(B,W,aa);}});}else{if(aa){X=y._attach(aa);}if(X){y._notify(B,W,z);}}if(y._useQueue&&y._useQueue.size()&&!y._loading){y._use.apply(y,y._useQueue.next());}};if(T==="*"){S=y._attach(y.Object.keys(A));if(S){H();}return y;}if(A["loader"]&&!y.Loader){y._attach(["loader"]);}if(E&&y.Loader&&z.length){G=k(y);G.require(z);G.ignoreRegistered=true;G._boot=true;G.calculate(null,(C)?null:"js");z=G.sorted;G._boot=false;}J(z);O=M.length;if(O){M=y.Object.keys(F.hash(M));O=M.length;}if(E&&O&&y.Loader){y._loading=true;G=k(y);G.onEnd=H;G.context=y;G.data=z;G.ignoreRegistered=false;G.require(z);G.insert(null,(C)?null:"js");}else{if(E&&O&&y.Get&&!x.bootstrapped){y._loading=true;P=function(){y._loading=false;K.running=false;x.bootstrapped=true;Q._bootstrapping=false;if(y._attach(["loader"])){y._use(z,B);}};if(Q._bootstrapping){K.add(P);}else{Q._bootstrapping=true;y.Get.script(R.base+R.loaderPath,{onEnd:P});}}else{S=y._attach(z);if(S){H();}}}return y;},namespace:function(){var y=arguments,C,A=0,z,B,x;for(;A<y.length;A++){C=this;x=y[A];if(x.indexOf(i)>-1){B=x.split(i);for(z=(B[0]=="YAHOO")?1:0;z<B.length;z++){C[B[z]]=C[B[z]]||{};C=C[B[z]];}}else{C[x]=C[x]||{};C=C[x];}}return C;},log:m,message:m,dump:function(x){return""+x;},error:function(B,y,A){var z=this,x;if(z.config.errorFn){x=z.config.errorFn.apply(z,arguments);}if(z.config.throwFail&&!x){throw (y||new Error(B));}else{z.message(B,"error",""+A);}return z;},guid:function(x){var y=this.Env._guidp+"_"+(++this.Env._uidx);return(x)?(x+y):y;},stamp:function(z,A){var x;if(!z){return z;}if(z.uniqueID&&z.nodeType&&z.nodeType!==9){x=z.uniqueID;}else{x=(typeof z==="string")?z:z._yuid;}if(!x){x=this.guid();if(!A){try{z._yuid=x;}catch(y){x=null;}}}return x;},destroy:function(){var x=this;if(x.Event){x.Event._unload();}delete c[x.id];delete x.Env;delete x.config;}};YUI.prototype=q;for(b in q){if(q.hasOwnProperty(b)){YUI[b]=q[b];}}YUI.applyConfig=function(x){if(!x){return;}if(YUI.GlobalConfig){this.prototype.applyConfig.call(this,YUI.GlobalConfig);}this.prototype.applyConfig.call(this,x);YUI.GlobalConfig=this.config;};YUI._init();if(g){n(window,"load",t);}else{t();}YUI.Env.add=n;YUI.Env.remove=v;if(typeof exports=="object"){exports.YUI=YUI;}}());YUI.add("yui-base",function(b){var j=b.Lang||(b.Lang={}),o=String.prototype,l=Object.prototype.toString,a={"undefined":"undefined","number":"number","boolean":"boolean","string":"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},c=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,s=/^\s+|\s+$/g,e=/\{\s*\[(?:native code|function)\]\s*\}/i;j._isNative=function(w){return !!(b.config.useNativeES5&&w&&e.test(w));};j.isArray=j._isNative(Array.isArray)?Array.isArray:function(w){return j.type(w)==="array";};j.isBoolean=function(w){return typeof w==="boolean";};j.isDate=function(w){return j.type(w)==="date"&&w.toString()!=="Invalid Date"&&!isNaN(w);};j.isFunction=function(w){return j.type(w)==="function";};j.isNull=function(w){return w===null;};j.isNumber=function(w){return typeof w==="number"&&isFinite(w);};j.isObject=function(y,x){var w=typeof y;return(y&&(w==="object"||(!x&&(w==="function"||j.isFunction(y)))))||false;};j.isString=function(w){return typeof w==="string";};j.isUndefined=function(w){return typeof w==="undefined";};j.isValue=function(x){var w=j.type(x);switch(w){case"number":return isFinite(x);case"null":case"undefined":return false;default:return !!w;}};j.now=Date.now||function(){return new Date().getTime();};j.sub=function(w,x){return w.replace?w.replace(c,function(y,z){return j.isUndefined(x[z])?y:x[z];}):w;};j.trim=o.trim?function(w){return w&&w.trim?w.trim():w;}:function(w){try{return w.replace(s,"");}catch(x){return w;}};j.trimLeft=o.trimLeft?function(w){return w.trimLeft();}:function(w){return w.replace(/^\s+/,"");};j.trimRight=o.trimRight?function(w){return w.trimRight();}:function(w){return w.replace(/\s+$/,"");};j.type=function(w){return a[typeof w]||a[l.call(w)]||(w?"object":"null");};var g=b.Lang,r=Array.prototype,p=Object.prototype.hasOwnProperty;function k(y,B,A){var x,w;B||(B=0);if(A||k.test(y)){try{return r.slice.call(y,B);}catch(z){w=[];for(x=y.length;B<x;++B){w.push(y[B]);}return w;}}return[y];}b.Array=k;k.dedupe=function(B){var A={},y=[],x,z,w;for(x=0,w=B.length;x<w;++x){z=B[x];if(!p.call(A,z)){A[z]=1;y.push(z);}}return y;};k.each=k.forEach=g._isNative(r.forEach)?function(y,w,x){r.forEach.call(y||[],w,x||b);return b;}:function(A,y,z){for(var x=0,w=(A&&A.length)||0;x<w;++x){if(x in A){y.call(z||b,A[x],x,A);}}return b;};k.hash=function(z,x){var A={},B=(x&&x.length)||0,y,w;for(y=0,w=z.length;y<w;++y){if(y in z){A[z[y]]=B>y&&y in x?x[y]:true;}}return A;};k.indexOf=g._isNative(r.indexOf)?function(y,w,x){return r.indexOf.call(y,w,x);}:function(z,x,y){var w=z.length;y=+y||0;y=(y>0||-1)*Math.floor(Math.abs(y));if(y<0){y+=w;if(y<0){y=0;}}for(;y<w;++y){if(y in z&&z[y]===x){return y;}}return -1;};k.numericSort=function(x,w){return x-w;};k.some=g._isNative(r.some)?function(y,w,x){return r.some.call(y,w,x);}:function(A,y,z){for(var x=0,w=A.length; x<w;++x){if(x in A&&y.call(z,A[x],x,A)){return true;}}return false;};k.test=function(y){var w=0;if(g.isArray(y)){w=1;}else{if(g.isObject(y)){try{if("length" in y&&!y.tagName&&!y.alert&&!y.apply){w=2;}}catch(x){}}}return w;};function u(){this._init();this.add.apply(this,arguments);}u.prototype={_init:function(){this._q=[];},next:function(){return this._q.shift();},last:function(){return this._q.pop();},add:function(){this._q.push.apply(this._q,arguments);return this;},size:function(){return this._q.length;}};b.Queue=u;YUI.Env._loaderQueue=YUI.Env._loaderQueue||new u();var n="__",p=Object.prototype.hasOwnProperty,m=b.Lang.isObject,f=b.config.win;b.cached=function(y,w,x){w||(w={});return function(z){var A=arguments.length>1?Array.prototype.join.call(arguments,n):String(z);if(!(A in w)||(x&&w[A]==x)){w[A]=y.apply(y,arguments);}return w[A];};};b.getLocation=function(){return f&&f.location;};b.merge=function(){var y=arguments,z=0,x=y.length,w={};for(;z<x;++z){b.mix(w,y[z],true);}return w;};b.mix=function(w,x,D,y,A,E){var B,H,G,z,I,C,F;if(!w||!x){return w||b;}if(A){if(A===2){b.mix(w.prototype,x.prototype,D,y,0,E);}G=A===1||A===3?x.prototype:x;F=A===1||A===4?w.prototype:w;if(!G||!F){return w;}}else{G=x;F=w;}B=D&&!E;if(y){for(z=0,C=y.length;z<C;++z){I=y[z];if(!p.call(G,I)){continue;}H=B?false:I in F;if(E&&H&&m(F[I],true)&&m(G[I],true)){b.mix(F[I],G[I],D,null,0,E);}else{if(D||!H){F[I]=G[I];}}}}else{for(I in G){if(!p.call(G,I)){continue;}H=B?false:I in F;if(E&&H&&m(F[I],true)&&m(G[I],true)){b.mix(F[I],G[I],D,null,0,E);}else{if(D||!H){F[I]=G[I];}}}if(b.Object._hasEnumBug){b.mix(F,G,D,b.Object._forceEnum,A,E);}}return w;};var g=b.Lang,p=Object.prototype.hasOwnProperty,v,h=b.Object=g._isNative(Object.create)?function(w){return Object.create(w);}:(function(){function w(){}return function(x){w.prototype=x;return new w();};}()),d=h._forceEnum=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf"],t=h._hasEnumBug=!{valueOf:0}.propertyIsEnumerable("valueOf"),q=h._hasProtoEnumBug=(function(){}).propertyIsEnumerable("prototype"),i=h.owns=function(x,w){return !!x&&p.call(x,w);};h.hasKey=i;h.keys=g._isNative(Object.keys)?Object.keys:function(A){if(!g.isObject(A)){throw new TypeError("Object.keys called on a non-object");}var z=[],y,x,w;if(q&&typeof A==="function"){for(x in A){if(i(A,x)&&x!=="prototype"){z.push(x);}}}else{for(x in A){if(i(A,x)){z.push(x);}}}if(t){for(y=0,w=d.length;y<w;++y){x=d[y];if(i(A,x)){z.push(x);}}}return z;};h.values=function(A){var z=h.keys(A),y=0,w=z.length,x=[];for(;y<w;++y){x.push(A[z[y]]);}return x;};h.size=function(x){try{return h.keys(x).length;}catch(w){return 0;}};h.hasValue=function(x,w){return b.Array.indexOf(h.values(x),w)>-1;};h.each=function(z,x,A,y){var w;for(w in z){if(y||i(z,w)){x.call(A||b,z[w],w,z);}}return b;};h.some=function(z,x,A,y){var w;for(w in z){if(y||i(z,w)){if(x.call(A||b,z[w],w,z)){return true;}}}return false;};h.getValue=function(A,z){if(!g.isObject(A)){return v;}var x,y=b.Array(z),w=y.length;for(x=0;A!==v&&x<w;x++){A=A[y[x]];}return A;};h.setValue=function(C,A,B){var w,z=b.Array(A),y=z.length-1,x=C;if(y>=0){for(w=0;x!==v&&w<y;w++){x=x[z[w]];}if(x!==v){x[z[w]]=B;}else{return v;}}return C;};h.isEmpty=function(w){return !h.keys(Object(w)).length;};YUI.Env.parseUA=function(C){var B=function(F){var G=0;return parseFloat(F.replace(/\./g,function(){return(G++==1)?"":".";}));},E=b.config.win,w=E&&E.navigator,z={ie:0,opera:0,gecko:0,webkit:0,safari:0,chrome:0,mobile:null,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,silk:0,accel:false,webos:0,caja:w&&w.cajaVersion,secure:false,os:null,nodejs:0},x=C||w&&w.userAgent,D=E&&E.location,y=D&&D.href,A;z.userAgent=x;z.secure=y&&(y.toLowerCase().indexOf("https")===0);if(x){if((/windows|win32/i).test(x)){z.os="windows";}else{if((/macintosh|mac_powerpc/i).test(x)){z.os="macintosh";}else{if((/android/i).test(x)){z.os="android";}else{if((/symbos/i).test(x)){z.os="symbos";}else{if((/linux/i).test(x)){z.os="linux";}else{if((/rhino/i).test(x)){z.os="rhino";}}}}}}if((/KHTML/).test(x)){z.webkit=1;}if((/IEMobile|XBLWP7/).test(x)){z.mobile="windows";}if((/Fennec/).test(x)){z.mobile="gecko";}A=x.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){z.webkit=B(A[1]);z.safari=z.webkit;if(/ Mobile\//.test(x)||(/iPad|iPod|iPhone/).test(x)){z.mobile="Apple";A=x.match(/OS ([^\s]*)/);if(A&&A[1]){A=B(A[1].replace("_","."));}z.ios=A;z.os="ios";z.ipad=z.ipod=z.iphone=0;A=x.match(/iPad|iPod|iPhone/);if(A&&A[0]){z[A[0].toLowerCase()]=z.ios;}}else{A=x.match(/NokiaN[^\/]*|webOS\/\d\.\d/);if(A){z.mobile=A[0];}if(/webOS/.test(x)){z.mobile="WebOS";A=x.match(/webOS\/([^\s]*);/);if(A&&A[1]){z.webos=B(A[1]);}}if(/ Android/.test(x)){if(/Mobile/.test(x)){z.mobile="Android";}A=x.match(/Android ([^\s]*);/);if(A&&A[1]){z.android=B(A[1]);}}if(/Silk/.test(x)){A=x.match(/Silk\/([^\s]*)\)/);if(A&&A[1]){z.silk=B(A[1]);}if(!z.android){z.android=2.34;z.os="Android";}if(/Accelerated=true/.test(x)){z.accel=true;}}}A=x.match(/Chrome\/([^\s]*)/);if(A&&A[1]){z.chrome=B(A[1]);z.safari=0;}else{A=x.match(/AdobeAIR\/([^\s]*)/);if(A){z.air=A[0];}}}if(!z.webkit){if(/Opera/.test(x)){A=x.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){z.opera=B(A[1]);}A=x.match(/Version\/([^\s]*)/);if(A&&A[1]){z.opera=B(A[1]);}if(/Opera Mobi/.test(x)){z.mobile="opera";A=x.replace("Opera Mobi","").match(/Opera ([^\s]*)/);if(A&&A[1]){z.opera=B(A[1]);}}A=x.match(/Opera Mini[^;]*/);if(A){z.mobile=A[0];}}else{A=x.match(/MSIE\s([^;]*)/);if(A&&A[1]){z.ie=B(A[1]);}else{A=x.match(/Gecko\/([^\s]*)/);if(A){z.gecko=1;A=x.match(/rv:([^\s\)]*)/);if(A&&A[1]){z.gecko=B(A[1]);}}}}}}if(!C){if(typeof process=="object"){if(process.versions&&process.versions.node){z.os=process.platform;z.nodejs=process.versions.node;}}YUI.Env.UA=z;}return z;};b.UA=YUI.Env.UA||YUI.Env.parseUA();YUI.Env.aliases={"anim":["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],"app":["app-base","model","model-list","router","view"],"attribute":["attribute-base","attribute-complex"],"autocomplete":["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],"base":["base-base","base-pluginhost","base-build"],"button":["button-base","button-group","cssbutton"],"cache":["cache-base","cache-offline","cache-plugin"],"collection":["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],"controller":["router"],"dataschema":["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],"datasource":["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],"datatable":["datatable-core","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-scroll","datatable-datasource","datatable-sort"],"datatype":["datatype-number","datatype-date","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],"dd":["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],"dom":["dom-base","dom-screen","dom-style","selector-native","selector"],"editor":["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],"event":["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],"handlebars":["handlebars-compiler"],"highlight":["highlight-base","highlight-accentfold"],"history":["history-base","history-hash","history-hash-ie","history-html5"],"io":["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],"json":["json-parse","json-stringify"],"loader":["loader-base","loader-rollup","loader-yui3"],"node":["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],"pluginhost":["pluginhost-base","pluginhost-config"],"querystring":["querystring-parse","querystring-stringify"],"recordset":["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],"resize":["resize-base","resize-proxy","resize-constrain"],"slider":["slider-base","slider-value-range","clickable-rail","range-slider"],"text":["text-accentfold","text-wordbreak"],"widget":["widget-base","widget-htmlparser","widget-uievents","widget-skin"]}; },"@VERSION@");YUI.add("get",function(c){var b=c.Lang,d,a;c.Get=d={cssOptions:{attributes:{rel:"stylesheet"},doc:c.config.linkDoc||c.config.doc,pollInterval:50},jsOptions:{autopurge:true,doc:c.config.scriptDoc||c.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(j){var f,k,g,e,h;if(!j.abort){k=j;h=this._pending;j=null;if(h&&h.transaction.id===k){j=h.transaction;this._pending=null;}else{for(f=0,e=this._queue.length;f<e;++f){g=this._queue[f].transaction;if(g.id===k){j=g;this._queue.splice(f,1);break;}}}}j&&j.abort();},css:function(f,e,g){return this._load("css",f,e,g);},js:function(f,e,g){return this._load("js",f,e,g);},load:function(f,e,g){return this._load(null,f,e,g);},_autoPurge:function(e){if(e&&this._purgeNodes.length>=e){this._purge(this._purgeNodes);}},_getEnv:function(){var f=c.config.doc,e=c.UA;return(this._env={async:f&&f.createElement("script").async===true,cssLoad:!!(e.gecko?e.gecko>=9:!e.webkit),preservesScriptOrder:!!(e.gecko||e.opera)});},_getTransaction:function(k,g){var l=[],h,e,j,f;if(!b.isArray(k)){k=[k];}g=c.merge(this.options,g);g.attributes=c.merge(this.options.attributes,g.attributes);for(h=0,e=k.length;h<e;++h){f=k[h];j={attributes:{}};if(typeof f==="string"){j.url=f;}else{if(f.url){c.mix(j,f,false,null,0,true);f=f.url;}else{continue;}}c.mix(j,g,false,null,0,true);if(!j.type){if(this.REGEX_CSS.test(f)){j.type="css";}else{if(!this.REGEX_JS.test(f)){}j.type="js";}}c.mix(j,j.type==="js"?this.jsOptions:this.cssOptions,false,null,0,true);j.attributes.id||(j.attributes.id=c.guid());if(j.win){j.doc=j.win.document;}else{j.win=j.doc.defaultView||j.doc.parentWindow;}if(j.charset){j.attributes.charset=j.charset;}l.push(j);}return new a(l,g);},_load:function(f,g,e,i){var h;if(typeof e==="function"){i=e;e={};}e||(e={});e.type=f;if(!this._env){this._getEnv();}h=this._getTransaction(g,e);this._queue.push({callback:i,transaction:h});this._next();return h;},_next:function(){var e;if(this._pending){return;}e=this._queue.shift();if(e){this._pending=e;e.transaction.execute(function(){e.callback&&e.callback.apply(this,arguments);d._pending=null;d._next();});}},_purge:function(e){var g=this._purgeNodes,i=e!==g,f,h;while(h=e.pop()){if(!h._yuiget_finished){continue;}h.parentNode&&h.parentNode.removeChild(h);if(i){f=c.Array.indexOf(g,h);if(f>-1){g.splice(f,1);}}}}};d.script=d.js;d.Transaction=a=function(g,f){var e=this;e.id=a._lastId+=1;e.data=f.data;e.errors=[];e.nodes=[];e.options=f;e.requests=g;e._callbacks=[];e._queue=[];e._waiting=0;e.tId=e.id;e.win=f.win||c.config.win;};a._lastId=0;a.prototype={_state:"new",abort:function(e){this._pending=null;this._pendingCSS=null;this._pollTimer=clearTimeout(this._pollTimer);this._queue=[];this._waiting=0;this.errors.push({error:e||"Aborted"});this._finish();},execute:function(m){var g=this,l=g.requests,k=g._state,h,f,e,j;if(k==="done"){m&&m(g.errors.length?g.errors:null,g);return;}else{m&&g._callbacks.push(m);if(k==="executing"){return;}}g._state="executing";g._queue=e=[];if(g.options.timeout){g._timeout=setTimeout(function(){g.abort("Timeout");},g.options.timeout);}for(h=0,f=l.length;h<f;++h){j=g.requests[h];if(j.async||j.type==="css"){g._insert(j);}else{e.push(j);}}g._next();},purge:function(){d._purge(this.nodes);},_createNode:function(g,f,i){var h=i.createElement(g),e;for(e in f){if(f.hasOwnProperty(e)){h.setAttribute(e,f[e]);}}return h;},_finish:function(){var k=this.errors.length?this.errors:null,f=this.options,j=f.context||this,h,g,e;if(this._state==="done"){return;}this._state="done";for(g=0,e=this._callbacks.length;g<e;++g){this._callbacks[g].call(j,k,this);}h=this._getEventData();if(k){if(f.onTimeout&&k[k.length-1].error==="Timeout"){f.onTimeout.call(j,h);}if(f.onFailure){f.onFailure.call(j,h);}}else{if(f.onSuccess){f.onSuccess.call(j,h);}}if(f.onEnd){f.onEnd.call(j,h);}},_getEventData:function(e){if(e){return c.merge(this,{abort:this.abort,purge:this.purge,request:e,url:e.url,win:e.win});}else{return this;}},_getInsertBefore:function(i){var j=i.doc,g=i.insertBefore,f,h,e;if(g){return typeof g==="string"?j.getElementById(g):g;}f=d._insertCache;e=c.stamp(j);if((g=f[e])){return g;}if((g=j.getElementsByTagName("base")[0])){return(f[e]=g);}g=j.head||j.getElementsByTagName("head")[0];if(g){g.appendChild(j.createTextNode(""));return(f[e]=g.lastChild);}return(f[e]=j.getElementsByTagName("script")[0]);},_insert:function(m){var j=d._env,k=this._getInsertBefore(m),g=m.type==="js",f=m.node,n=this,e=c.UA,h;if(!f){if(g){h="script";}else{if(!j.cssLoad&&e.gecko){h="style";}else{h="link";}}f=m.node=this._createNode(h,m.attributes,m.doc);}function i(){n._progress("Failed to load "+m.url,m);}function l(){n._progress(null,m);}if(g){f.setAttribute("src",m.url);if(m.async){f.async=true;}else{if(j.async){f.async=false;}if(!j.preservesScriptOrder){this._pending=m;}}}else{if(!j.cssLoad&&e.gecko){f.innerHTML=(m.attributes.charset?'@charset "'+m.attributes.charset+'";':"")+'@import "'+m.url+'";';}else{f.setAttribute("href",m.url);}}if(g&&e.ie&&e.ie<9){f.onreadystatechange=function(){if(/loaded|complete/.test(f.readyState)){f.onreadystatechange=null;l();}};}else{if(!g&&!j.cssLoad){this._poll(m);}else{f.onerror=i;f.onload=l;}}this._waiting+=1;this.nodes.push(f);k.parentNode.insertBefore(f,k);},_next:function(){if(this._pending){return;}if(this._queue.length){this._insert(this._queue.shift());}else{if(!this._waiting){this._finish();}}},_poll:function(m){var p=this,q=p._pendingCSS,k=c.UA.webkit,g,e,f,o,n,h;if(m){q||(q=p._pendingCSS=[]);q.push(m);if(p._pollTimer){return;}}p._pollTimer=null;for(g=0;g<q.length;++g){n=q[g];if(k){h=n.doc.styleSheets;f=h.length;o=n.node.href;while(--f>=0){if(h[f].href===o){q.splice(g,1);g-=1;p._progress(null,n);break;}}}else{try{e=!!n.node.sheet.cssRules;q.splice(g,1);g-=1;p._progress(null,n);}catch(l){}}}if(q.length){p._pollTimer=setTimeout(function(){p._poll.call(p);},p.options.pollInterval); }},_progress:function(g,f){var e=this.options;if(g){f.error=g;this.errors.push({error:g,request:f});}f.node._yuiget_finished=f.finished=true;if(e.onProgress){e.onProgress.call(e.context||this,this._getEventData(f));}if(f.autopurge){d._autoPurge(this.options.purgethreshold);d._purgeNodes.push(f.node);}if(this._pending===f){this._pending=null;}this._waiting-=1;this._next();}};},"@VERSION@",{requires:["yui-base"]});YUI.add("features",function(b){var c={};b.mix(b.namespace("Features"),{tests:c,add:function(d,e,f){c[d]=c[d]||{};c[d][e]=f;},all:function(e,f){var g=c[e],d=[];if(g){b.Object.each(g,function(i,h){d.push(h+":"+(b.Features.test(e,h,f)?1:0));});}return(d.length)?d.join(";"):"";},test:function(e,g,f){f=f||[];var d,i,k,j=c[e],h=j&&j[g];if(!h){}else{d=h.result;if(b.Lang.isUndefined(d)){i=h.ua;if(i){d=(b.UA[i]);}k=h.test;if(k&&((!i)||d)){d=k.apply(b,f);}h.result=d;}}return d;}});var a=b.Features.add;a("load","0",{"name":"graphics-canvas-default","test":function(h){var f=h.config.doc,g=h.config.defaultGraphicEngine&&h.config.defaultGraphicEngine=="canvas",e=f&&f.createElement("canvas"),d=(f&&f.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"));return(!d||g)&&(e&&e.getContext&&e.getContext("2d"));},"trigger":"graphics"});a("load","1",{"name":"autocomplete-list-keys","test":function(d){return !(d.UA.ios||d.UA.android);},"trigger":"autocomplete-list"});a("load","2",{"name":"graphics-svg","test":function(h){var g=h.config.doc,f=!h.config.defaultGraphicEngine||h.config.defaultGraphicEngine!="canvas",e=g&&g.createElement("canvas"),d=(g&&g.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"));return d&&(f||!e);},"trigger":"graphics"});a("load","3",{"name":"history-hash-ie","test":function(e){var d=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange" in e.config.win)||!d||d<8);},"trigger":"history-hash"});a("load","4",{"name":"graphics-vml-default","test":function(f){var e=f.config.doc,d=e&&e.createElement("canvas");return(e&&!e.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!d||!d.getContext||!d.getContext("2d")));},"trigger":"graphics"});a("load","5",{"name":"graphics-svg-default","test":function(h){var g=h.config.doc,f=!h.config.defaultGraphicEngine||h.config.defaultGraphicEngine!="canvas",e=g&&g.createElement("canvas"),d=(g&&g.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"));return d&&(f||!e);},"trigger":"graphics"});a("load","6",{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"});a("load","7",{"name":"transition-timer","test":function(g){var f=g.config.doc,e=(f)?f.documentElement:null,d=true;if(e&&e.style){d=!("MozTransition" in e.style||"WebkitTransition" in e.style);}return d;},"trigger":"transition"});a("load","8",{"name":"dom-style-ie","test":function(j){var h=j.Features.test,i=j.Features.add,f=j.config.win,g=j.config.doc,d="documentElement",e=false;i("style","computedStyle",{test:function(){return f&&"getComputedStyle" in f;}});i("style","opacity",{test:function(){return g&&"opacity" in g[d].style;}});e=(!h("style","opacity")&&!h("style","computedStyle"));return e;},"trigger":"dom-style"});a("load","9",{"name":"selector-css2","test":function(f){var e=f.config.doc,d=e&&!("querySelectorAll" in e);return d;},"trigger":"selector"});a("load","10",{"name":"event-base-ie","test":function(e){var d=e.config.doc&&e.config.doc.implementation;return(d&&(!d.hasFeature("Events","2.0")));},"trigger":"node-base"});a("load","11",{"name":"dd-gestures","test":function(d){return((d.config.win&&("ontouchstart" in d.config.win))&&!(d.UA.chrome&&d.UA.chrome<6));},"trigger":"dd-drag"});a("load","12",{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"});a("load","13",{"name":"graphics-canvas","test":function(h){var f=h.config.doc,g=h.config.defaultGraphicEngine&&h.config.defaultGraphicEngine=="canvas",e=f&&f.createElement("canvas"),d=(f&&f.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"));return(!d||g)&&(e&&e.getContext&&e.getContext("2d"));},"trigger":"graphics"});a("load","14",{"name":"graphics-vml","test":function(f){var e=f.config.doc,d=e&&e.createElement("canvas");return(e&&!e.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!d||!d.getContext||!d.getContext("2d")));},"trigger":"graphics"});},"@VERSION@",{requires:["yui-base"]});YUI.add("intl-base",function(b){var a=/[, ]/;b.mix(b.namespace("Intl"),{lookupBestLang:function(g,h){var f,j,c,e;function d(l){var k;for(k=0;k<h.length;k+=1){if(l.toLowerCase()===h[k].toLowerCase()){return h[k];}}}if(b.Lang.isString(g)){g=g.split(a);}for(f=0;f<g.length;f+=1){j=g[f];if(!j||j==="*"){continue;}while(j.length>0){c=d(j);if(c){return c;}else{e=j.lastIndexOf("-");if(e>=0){j=j.substring(0,e);if(e>=2&&j.charAt(e-2)==="-"){j=j.substring(0,e-2);}}else{break;}}}}return"";}});},"@VERSION@",{requires:["yui-base"]});YUI.add("yui-log",function(d){var c=d,e="yui:log",a="undefined",b={debug:1,info:1,warn:1,error:1};c.log=function(j,s,g,q){var l,p,n,k,o,i=c,r=i.config,h=(i.fire)?i:YUI.Env.globalEvents;if(r.debug){if(g){p=r.logExclude;n=r.logInclude;if(n&&!(g in n)){l=1;}else{if(n&&(g in n)){l=!n[g];}else{if(p&&(g in p)){l=p[g];}}}}if(!l){if(r.useBrowserConsole){k=(g)?g+": "+j:j;if(i.Lang.isFunction(r.logFn)){r.logFn.call(i,j,s,g);}else{if(typeof console!=a&&console.log){o=(s&&console[s]&&(s in b))?s:"log";console[o](k);}else{if(typeof opera!=a){opera.postError(k);}}}}if(h&&!q){if(h==i&&(!h.getEvent(e))){h.publish(e,{broadcast:2});}h.fire(e,{msg:j,cat:s,src:g});}}}return i;};c.message=function(){return c.log.apply(c,arguments);};},"@VERSION@",{requires:["yui-base"]});YUI.add("yui-later",function(b){var a=[];b.later=function(j,f,k,g,h){j=j||0;g=(!b.Lang.isUndefined(g))?b.Array(g):a;f=f||b.config.win||b;var i=false,c=(f&&b.Lang.isString(k))?f[k]:k,d=function(){if(!i){if(!c.apply){c(g[0],g[1],g[2],g[3]);}else{c.apply(f,g||a);}}},e=(h)?setInterval(d,j):setTimeout(d,j); return{id:e,interval:h,cancel:function(){i=true;if(this.interval){clearInterval(e);}else{clearTimeout(e);}}};};b.Lang.later=b.later;},"@VERSION@",{requires:["yui-base"]});YUI.add("yui",function(a){},"@VERSION@",{use:["yui-base","get","features","intl-base","yui-log","yui-later"]});YUI.add("oop",function(h){var d=h.Lang,c=h.Array,b=Object.prototype,a="_~yuim~_",e=b.hasOwnProperty,g=b.toString;function f(l,k,m,i,j){if(l&&l[j]&&l!==h){return l[j].call(l,k,m);}else{switch(c.test(l)){case 1:return c[j](l,k,m);case 2:return c[j](h.Array(l,0,true),k,m);default:return h.Object[j](l,k,m,i);}}}h.augment=function(i,k,r,o,s){var n=i.prototype,m=n&&k,q=k.prototype,v=n||i,j,u,p,l,t;s=s?h.Array(s):[];if(m){u={};p={};l={};j=function(x,w){if(r||!(w in n)){if(g.call(x)==="[object Function]"){l[w]=x;u[w]=p[w]=function(){return t(this,x,arguments);};}else{u[w]=x;}}};t=function(w,y,z){for(var x in l){if(e.call(l,x)&&w[x]===p[x]){w[x]=l[x];}}k.apply(w,s);return y.apply(w,z);};if(o){h.Array.each(o,function(w){if(w in q){j(q[w],w);}});}else{h.Object.each(q,j,null,true);}}h.mix(v,u||q,r,o);if(!m){k.apply(v,s);}return i;};h.aggregate=function(k,j,i,l){return h.mix(k,j,i,l,0,true);};h.extend=function(l,k,i,n){if(!k||!l){h.error("extend failed, verify dependencies");}var m=k.prototype,j=h.Object(m);l.prototype=j;j.constructor=l;l.superclass=m;if(k!=Object&&m.constructor==b.constructor){m.constructor=k;}if(i){h.mix(j,i,true);}if(n){h.mix(l,n,true);}return l;};h.each=function(k,j,l,i){return f(k,j,l,i,"each");};h.some=function(k,j,l,i){return f(k,j,l,i,"some");};h.clone=function(l,m,r,s,k,q){if(!d.isObject(l)){return l;}if(h.instanceOf(l,YUI)){return l;}var n,j=q||{},i,p=h.each;switch(d.type(l)){case"date":return new Date(l);case"regexp":return l;case"function":return l;case"array":n=[];break;default:if(l[a]){return j[l[a]];}i=h.guid();n=(m)?{}:h.Object(l);l[a]=i;j[i]=l;}if(!l.addEventListener&&!l.attachEvent){p(l,function(t,o){if((o||o===0)&&(!r||(r.call(s||this,t,o,this,l)!==false))){if(o!==a){if(o=="prototype"){}else{this[o]=h.clone(t,m,r,s,k||l,j);}}}},n);}if(!q){h.Object.each(j,function(t,o){if(t[a]){try{delete t[a];}catch(u){t[a]=null;}}},this);j=null;}return n;};h.bind=function(i,k){var j=arguments.length>2?h.Array(arguments,2,true):null;return function(){var m=d.isString(i)?k[i]:i,l=(j)?j.concat(h.Array(arguments,0,true)):arguments;return m.apply(k||m,l);};};h.rbind=function(i,k){var j=arguments.length>2?h.Array(arguments,2,true):null;return function(){var m=d.isString(i)?k[i]:i,l=(j)?h.Array(arguments,0,true).concat(j):arguments;return m.apply(k||m,l);};};},"@VERSION@",{requires:["yui-base"]});YUI.add("features",function(b){var c={};b.mix(b.namespace("Features"),{tests:c,add:function(d,e,f){c[d]=c[d]||{};c[d][e]=f;},all:function(e,f){var g=c[e],d=[];if(g){b.Object.each(g,function(i,h){d.push(h+":"+(b.Features.test(e,h,f)?1:0));});}return(d.length)?d.join(";"):"";},test:function(e,g,f){f=f||[];var d,i,k,j=c[e],h=j&&j[g];if(!h){}else{d=h.result;if(b.Lang.isUndefined(d)){i=h.ua;if(i){d=(b.UA[i]);}k=h.test;if(k&&((!i)||d)){d=k.apply(b,f);}h.result=d;}}return d;}});var a=b.Features.add;a("load","0",{"name":"graphics-canvas-default","test":function(h){var f=h.config.doc,g=h.config.defaultGraphicEngine&&h.config.defaultGraphicEngine=="canvas",e=f&&f.createElement("canvas"),d=(f&&f.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"));return(!d||g)&&(e&&e.getContext&&e.getContext("2d"));},"trigger":"graphics"});a("load","1",{"name":"autocomplete-list-keys","test":function(d){return !(d.UA.ios||d.UA.android);},"trigger":"autocomplete-list"});a("load","2",{"name":"graphics-svg","test":function(h){var g=h.config.doc,f=!h.config.defaultGraphicEngine||h.config.defaultGraphicEngine!="canvas",e=g&&g.createElement("canvas"),d=(g&&g.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"));return d&&(f||!e);},"trigger":"graphics"});a("load","3",{"name":"history-hash-ie","test":function(e){var d=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange" in e.config.win)||!d||d<8);},"trigger":"history-hash"});a("load","4",{"name":"graphics-vml-default","test":function(f){var e=f.config.doc,d=e&&e.createElement("canvas");return(e&&!e.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!d||!d.getContext||!d.getContext("2d")));},"trigger":"graphics"});a("load","5",{"name":"graphics-svg-default","test":function(h){var g=h.config.doc,f=!h.config.defaultGraphicEngine||h.config.defaultGraphicEngine!="canvas",e=g&&g.createElement("canvas"),d=(g&&g.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"));return d&&(f||!e);},"trigger":"graphics"});a("load","6",{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"});a("load","7",{"name":"transition-timer","test":function(g){var f=g.config.doc,e=(f)?f.documentElement:null,d=true;if(e&&e.style){d=!("MozTransition" in e.style||"WebkitTransition" in e.style);}return d;},"trigger":"transition"});a("load","8",{"name":"dom-style-ie","test":function(j){var h=j.Features.test,i=j.Features.add,f=j.config.win,g=j.config.doc,d="documentElement",e=false;i("style","computedStyle",{test:function(){return f&&"getComputedStyle" in f;}});i("style","opacity",{test:function(){return g&&"opacity" in g[d].style;}});e=(!h("style","opacity")&&!h("style","computedStyle"));return e;},"trigger":"dom-style"});a("load","9",{"name":"selector-css2","test":function(f){var e=f.config.doc,d=e&&!("querySelectorAll" in e);return d;},"trigger":"selector"});a("load","10",{"name":"event-base-ie","test":function(e){var d=e.config.doc&&e.config.doc.implementation;return(d&&(!d.hasFeature("Events","2.0")));},"trigger":"node-base"});a("load","11",{"name":"dd-gestures","test":function(d){return((d.config.win&&("ontouchstart" in d.config.win))&&!(d.UA.chrome&&d.UA.chrome<6));},"trigger":"dd-drag"});a("load","12",{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"});a("load","13",{"name":"graphics-canvas","test":function(h){var f=h.config.doc,g=h.config.defaultGraphicEngine&&h.config.defaultGraphicEngine=="canvas",e=f&&f.createElement("canvas"),d=(f&&f.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")); return(!d||g)&&(e&&e.getContext&&e.getContext("2d"));},"trigger":"graphics"});a("load","14",{"name":"graphics-vml","test":function(f){var e=f.config.doc,d=e&&e.createElement("canvas");return(e&&!e.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!d||!d.getContext||!d.getContext("2d")));},"trigger":"graphics"});},"@VERSION@",{requires:["yui-base"]});YUI.add("dom-core",function(e){var n="nodeType",c="ownerDocument",b="documentElement",a="defaultView",g="parentWindow",j="tagName",k="parentNode",i="previousSibling",l="nextSibling",h="contains",d="compareDocumentPosition",m=[],f={byId:function(p,o){return f.allById(p,o)[0]||null;},ancestor:function(p,q,s,r){var o=null;if(s){o=(!q||q(p))?p:null;}return o||f.elementByAxis(p,k,q,null,r);},ancestors:function(q,r,t,s){var p=q,o=[];while((p=f.ancestor(p,r,t,s))){t=false;if(p){o.unshift(p);if(s&&s(p)){return o;}}}return o;},elementByAxis:function(p,s,r,q,o){while(p&&(p=p[s])){if((q||p[j])&&(!r||r(p))){return p;}if(o&&o(p)){return null;}}return null;},contains:function(p,q){var o=false;if(!q||!p||!q[n]||!p[n]){o=false;}else{if(p[h]){if(e.UA.opera||q[n]===1){o=p[h](q);}else{o=f._bruteContains(p,q);}}else{if(p[d]){if(p===q||!!(p[d](q)&16)){o=true;}}}}return o;},inDoc:function(q,r){var p=false,o;if(q&&q.nodeType){(r)||(r=q[c]);o=r[b];if(o&&o.contains&&q.tagName){p=o.contains(q);}else{p=f.contains(o,q);}}return p;},allById:function(t,o){o=o||e.config.doc;var p=[],q=[],r,s;if(o.querySelectorAll){q=o.querySelectorAll('[id="'+t+'"]');}else{if(o.all){p=o.all(t);if(p){if(p.nodeName){if(p.id===t){q.push(p);p=m;}else{p=[p];}}if(p.length){for(r=0;s=p[r++];){if(s.id===t||(s.attributes&&s.attributes.id&&s.attributes.id.value===t)){q.push(s);}}}}}else{q=[f._getDoc(o).getElementById(t)];}}return q;},isWindow:function(o){return !!(o&&o.alert&&o.document);},_removeChildNodes:function(o){while(o.firstChild){o.removeChild(o.firstChild);}},siblings:function(r,q){var o=[],p=r;while((p=p[i])){if(p[j]&&(!q||q(p))){o.unshift(p);}}p=r;while((p=p[l])){if(p[j]&&(!q||q(p))){o.push(p);}}return o;},_bruteContains:function(o,p){while(p){if(o===p){return true;}p=p.parentNode;}return false;},_getRegExp:function(p,o){o=o||"";f._regexCache=f._regexCache||{};if(!f._regexCache[p+o]){f._regexCache[p+o]=new RegExp(p,o);}return f._regexCache[p+o];},_getDoc:function(o){var p=e.config.doc;if(o){p=(o[n]===9)?o:o[c]||o.document||e.config.doc;}return p;},_getWin:function(o){var p=f._getDoc(o);return p[a]||p[g]||e.config.win;},_batch:function(o,w,u,t,s,q){w=(typeof w==="string")?f[w]:w;var x,r=0,p,v;if(w&&o){while((p=o[r++])){x=x=w.call(f,p,u,t,s,q);if(typeof x!=="undefined"){(v)||(v=[]);v.push(x);}}}return(typeof v!=="undefined")?v:o;},generateID:function(o){var p=o.id;if(!p){p=e.stamp(o);o.id=p;}return p;}};e.DOM=f;},"@VERSION@",{requires:["oop","features"]});YUI.add("dom-base",function(b){var o=b.config.doc.documentElement,g=b.DOM,m="tagName",a="ownerDocument",c="",n=b.Features.add,k=b.Features.test;b.mix(g,{getText:(o.textContent!==undefined)?function(s){var r="";if(s){r=s.textContent;}return r||"";}:function(s){var r="";if(s){r=s.innerText||s.nodeValue;}return r||"";},setText:(o.textContent!==undefined)?function(r,s){if(r){r.textContent=s;}}:function(r,s){if("innerText" in r){r.innerText=s;}else{if("nodeValue" in r){r.nodeValue=s;}}},CUSTOM_ATTRIBUTES:(!o.hasAttribute)?{"for":"htmlFor","class":"className"}:{"htmlFor":"for","className":"class"},setAttribute:function(t,r,u,s){if(t&&r&&t.setAttribute){r=g.CUSTOM_ATTRIBUTES[r]||r;t.setAttribute(r,u,s);}},getAttribute:function(u,r,t){t=(t!==undefined)?t:2;var s="";if(u&&r&&u.getAttribute){r=g.CUSTOM_ATTRIBUTES[r]||r;s=u.getAttribute(r,t);if(s===null){s="";}}return s;},VALUE_SETTERS:{},VALUE_GETTERS:{},getValue:function(t){var s="",r;if(t&&t[m]){r=g.VALUE_GETTERS[t[m].toLowerCase()];if(r){s=r(t);}else{s=t.value;}}if(s===c){s=c;}return(typeof s==="string")?s:"";},setValue:function(r,s){var t;if(r&&r[m]){t=g.VALUE_SETTERS[r[m].toLowerCase()];if(t){t(r,s);}else{r.value=s;}}},creators:{}});n("value-set","select",{test:function(){var r=b.config.doc.createElement("select");r.innerHTML="<option>1</option><option>2</option>";r.value="2";return(r.value&&r.value==="2");}});if(!k("value-set","select")){g.VALUE_SETTERS.select=function(u,v){for(var s=0,r=u.getElementsByTagName("option"),t;t=r[s++];){if(g.getValue(t)===v){t.selected=true;break;}}};}b.mix(g.VALUE_GETTERS,{button:function(r){return(r.attributes&&r.attributes.value)?r.attributes.value.value:"";}});b.mix(g.VALUE_SETTERS,{button:function(s,t){var r=s.attributes.value;if(!r){r=s[a].createAttribute("value");s.setAttributeNode(r);}r.value=t;}});b.mix(g.VALUE_GETTERS,{option:function(s){var r=s.attributes;return(r.value&&r.value.specified)?s.value:s.text;},select:function(s){var t=s.value,r=s.options;if(r&&r.length){if(s.multiple){}else{t=g.getValue(r[s.selectedIndex]);}}return t;}});var h,f,q;b.mix(b.DOM,{hasClass:function(t,s){var r=b.DOM._getRegExp("(?:^|\\s+)"+s+"(?:\\s+|$)");return r.test(t.className);},addClass:function(s,r){if(!b.DOM.hasClass(s,r)){s.className=b.Lang.trim([s.className,r].join(" "));}},removeClass:function(s,r){if(r&&f(s,r)){s.className=b.Lang.trim(s.className.replace(b.DOM._getRegExp("(?:^|\\s+)"+r+"(?:\\s+|$)")," "));if(f(s,r)){q(s,r);}}},replaceClass:function(s,r,t){q(s,r);h(s,t);},toggleClass:function(s,r,t){var u=(t!==undefined)?t:!(f(s,r));if(u){h(s,r);}else{q(s,r);}}});f=b.DOM.hasClass;q=b.DOM.removeClass;h=b.DOM.addClass;var e=/<([a-z]+)/i,g=b.DOM,n=b.Features.add,k=b.Features.test,j={},i=function(t,r){var u=b.config.doc.createElement("div"),s=true;u.innerHTML=t;if(!u.firstChild||u.firstChild.tagName!==r.toUpperCase()){s=false;}return s;},p=/(?:\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\s*<tbody/,d="<table>",l="</table>";b.mix(b.DOM,{_fragClones:{},_create:function(s,t,r){r=r||"div";var u=g._fragClones[r];if(u){u=u.cloneNode(false);}else{u=g._fragClones[r]=t.createElement(r);}u.innerHTML=s;return u;},_children:function(v,r){var t=0,s=v.children,w,u,x; if(s&&s.tags){if(r){s=v.children.tags(r);}else{u=s.tags("!").length;}}if(!s||(!s.tags&&r)||u){w=s||v.childNodes;s=[];while((x=w[t++])){if(x.nodeType===1){if(!r||r===x.tagName){s.push(x);}}}}return s||[];},create:function(v,y){if(typeof v==="string"){v=b.Lang.trim(v);}y=y||b.config.doc;var u=e.exec(v),w=g._create,s=j,x=null,t,z,r;if(v!=undefined){if(u&&u[1]){t=s[u[1].toLowerCase()];if(typeof t==="function"){w=t;}else{z=t;}}r=w(v,y,z).childNodes;if(r.length===1){x=r[0].parentNode.removeChild(r[0]);}else{if(r[0]&&r[0].className==="yui3-big-dummy"){if(r.length===2){x=r[0].nextSibling;}else{r[0].parentNode.removeChild(r[0]);x=g._nl2frag(r,y);}}else{x=g._nl2frag(r,y);}}}return x;},_nl2frag:function(s,v){var t=null,u,r;if(s&&(s.push||s.item)&&s[0]){v=v||s[0].ownerDocument;t=v.createDocumentFragment();if(s.item){s=b.Array(s,0,true);}for(u=0,r=s.length;u<r;u++){t.appendChild(s[u]);}}return t;},addHTML:function(y,x,t){var r=y.parentNode,v=0,w,s=x,u;if(x!=undefined){if(x.nodeType){u=x;}else{if(typeof x=="string"||typeof x=="number"){s=u=g.create(x);}else{if(x[0]&&x[0].nodeType){u=b.config.doc.createDocumentFragment();while((w=x[v++])){u.appendChild(w);}}}}}if(t){if(u&&t.parentNode){t.parentNode.insertBefore(u,t);}else{switch(t){case"replace":while(y.firstChild){y.removeChild(y.firstChild);}if(u){y.appendChild(u);}break;case"before":if(u){r.insertBefore(u,y);}break;case"after":if(u){if(y.nextSibling){r.insertBefore(u,y.nextSibling);}else{r.appendChild(u);}}break;default:if(u){y.appendChild(u);}}}}else{if(u){y.appendChild(u);}}return s;},wrap:function(u,s){var t=(s&&s.nodeType)?s:b.DOM.create(s),r=t.getElementsByTagName("*");if(r.length){t=r[r.length-1];}if(u.parentNode){u.parentNode.replaceChild(t,u);}t.appendChild(u);},unwrap:function(u){var s=u.parentNode,t=s.lastChild,r=u,v;if(s){v=s.parentNode;if(v){u=s.firstChild;while(u!==t){r=u.nextSibling;v.insertBefore(u,s);u=r;}v.replaceChild(t,s);}else{s.removeChild(u);}}}});n("innerhtml","table",{test:function(){var r=b.config.doc.createElement("table");try{r.innerHTML="<tbody></tbody>";}catch(s){return false;}return(r.firstChild&&r.firstChild.nodeName==="TBODY");}});n("innerhtml-div","tr",{test:function(){return i("<tr></tr>","tr");}});n("innerhtml-div","script",{test:function(){return i("<script><\/script>","script");}});if(!k("innerhtml","table")){j.tbody=function(s,t){var u=g.create(d+s+l,t),r=b.DOM._children(u,"tbody")[0];if(u.children.length>1&&r&&!p.test(s)){r.parentNode.removeChild(r);}return u;};}if(!k("innerhtml-div","script")){j.script=function(r,s){var t=s.createElement("div");t.innerHTML="-"+r;t.removeChild(t.firstChild);return t;};j.link=j.style=j.script;}if(!k("innerhtml-div","tr")){b.mix(j,{option:function(r,s){return g.create('<select><option class="yui3-big-dummy" selected></option>'+r+"</select>",s);},tr:function(r,s){return g.create("<tbody>"+r+"</tbody>",s);},td:function(r,s){return g.create("<tr>"+r+"</tr>",s);},col:function(r,s){return g.create("<colgroup>"+r+"</colgroup>",s);},tbody:"table"});b.mix(j,{legend:"fieldset",th:j.td,thead:j.tbody,tfoot:j.tbody,caption:j.tbody,colgroup:j.tbody,optgroup:j.option});}g.creators=j;b.mix(b.DOM,{setWidth:function(s,r){b.DOM._setSize(s,"width",r);},setHeight:function(s,r){b.DOM._setSize(s,"height",r);},_setSize:function(s,u,t){t=(t>0)?t:0;var r=0;s.style[u]=t+"px";r=(u==="height")?s.offsetHeight:s.offsetWidth;if(r>t){t=t-(r-t);if(t<0){t=0;}s.style[u]=t+"px";}}});},"@VERSION@",{requires:["dom-core"]});YUI.add("dom-style",function(a){(function(e){var p="documentElement",b="defaultView",n="ownerDocument",h="style",i="float",r="cssFloat",s="styleFloat",k="transparent",d="getComputedStyle",c="getBoundingClientRect",o=e.config.win,g=e.config.doc,t=undefined,q=e.DOM,f="transform",l=["WebkitTransform","MozTransform","OTransform"],m=/color$/i,j=/width|height|top|left|right|bottom|margin|padding/i;e.Array.each(l,function(u){if(u in g[p].style){f=u;}});e.mix(q,{DEFAULT_UNIT:"px",CUSTOM_STYLES:{},setStyle:function(x,u,y,w){w=w||x.style;var v=q.CUSTOM_STYLES;if(w){if(y===null||y===""){y="";}else{if(!isNaN(new Number(y))&&j.test(u)){y+=q.DEFAULT_UNIT;}}if(u in v){if(v[u].set){v[u].set(x,y,w);return;}else{if(typeof v[u]==="string"){u=v[u];}}}else{if(u===""){u="cssText";y="";}}w[u]=y;}},getStyle:function(x,u,w){w=w||x.style;var v=q.CUSTOM_STYLES,y="";if(w){if(u in v){if(v[u].get){return v[u].get(x,u,w);}else{if(typeof v[u]==="string"){u=v[u];}}}y=w[u];if(y===""){y=q[d](x,u);}}return y;},setStyles:function(v,w){var u=v.style;e.each(w,function(x,y){q.setStyle(v,y,x,u);},q);},getComputedStyle:function(w,u){var y="",x=w[n],v;if(w[h]&&x[b]&&x[b][d]){v=x[b][d](w,null);if(v){y=v[u];}}return y;}});if(g[p][h][r]!==t){q.CUSTOM_STYLES[i]=r;}else{if(g[p][h][s]!==t){q.CUSTOM_STYLES[i]=s;}}if(e.UA.opera){q[d]=function(w,v){var u=w[n][b],x=u[d](w,"")[v];if(m.test(v)){x=e.Color.toRGB(x);}return x;};}if(e.UA.webkit){q[d]=function(w,v){var u=w[n][b],x=u[d](w,"")[v];if(x==="rgba(0, 0, 0, 0)"){x=k;}return x;};}e.DOM._getAttrOffset=function(y,v){var A=e.DOM[d](y,v),x=y.offsetParent,u,w,z;if(A==="auto"){u=e.DOM.getStyle(y,"position");if(u==="static"||u==="relative"){A=0;}else{if(x&&x[c]){w=x[c]()[v];z=y[c]()[v];if(v==="left"||v==="top"){A=z-w;}else{A=w-y[c]()[v];}}}}return A;};e.DOM._getOffset=function(u){var w,v=null;if(u){w=q.getStyle(u,"position");v=[parseInt(q[d](u,"left"),10),parseInt(q[d](u,"top"),10)];if(isNaN(v[0])){v[0]=parseInt(q.getStyle(u,"left"),10);if(isNaN(v[0])){v[0]=(w==="relative")?0:u.offsetLeft||0;}}if(isNaN(v[1])){v[1]=parseInt(q.getStyle(u,"top"),10);if(isNaN(v[1])){v[1]=(w==="relative")?0:u.offsetTop||0;}}}return v;};q.CUSTOM_STYLES.transform={set:function(v,w,u){u[f]=w;},get:function(v,u){return q[d](v,f);}};})(a);(function(d){var b=parseInt,c=RegExp;d.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(e){if(!d.Color.re_RGB.test(e)){e=d.Color.toHex(e); }if(d.Color.re_hex.exec(e)){e="rgb("+[b(c.$1,16),b(c.$2,16),b(c.$3,16)].join(", ")+")";}return e;},toHex:function(f){f=d.Color.KEYWORDS[f]||f;if(d.Color.re_RGB.exec(f)){f=[Number(c.$1).toString(16),Number(c.$2).toString(16),Number(c.$3).toString(16)];for(var e=0;e<f.length;e++){if(f[e].length<2){f[e]="0"+f[e];}}f=f.join("");}if(f.length<6){f=f.replace(d.Color.re_hex3,"$1$1");}if(f!=="transparent"&&f.indexOf("#")<0){f="#"+f;}return f.toUpperCase();}};})(a);},"@VERSION@",{requires:["dom-base"]});YUI.add("dom-style-ie",function(a){(function(d){var A="hasLayout",l="px",m="filter",b="filters",x="opacity",q="auto",h="borderWidth",k="borderTopWidth",u="borderRightWidth",z="borderBottomWidth",i="borderLeftWidth",j="width",s="height",v="transparent",w="visible",c="getComputedStyle",C=undefined,B=d.config.doc.documentElement,p=d.Features.test,n=d.Features.add,t=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,o=(d.UA.ie>=8),f=function(e){return e.currentStyle||e.style;},r={CUSTOM_STYLES:{},get:function(e,E){var D="",F;if(e){F=f(e)[E];if(E===x&&d.DOM.CUSTOM_STYLES[x]){D=d.DOM.CUSTOM_STYLES[x].get(e);}else{if(!F||(F.indexOf&&F.indexOf(l)>-1)){D=F;}else{if(d.DOM.IE.COMPUTED[E]){D=d.DOM.IE.COMPUTED[E](e,E);}else{if(t.test(F)){D=r.getPixel(e,E)+l;}else{D=F;}}}}}return D;},sizeOffsets:{width:["Left","Right"],height:["Top","Bottom"],top:["Top"],bottom:["Bottom"]},getOffset:function(E,e){var I=f(E)[e],J=e.charAt(0).toUpperCase()+e.substr(1),F="offset"+J,D="pixel"+J,H=r.sizeOffsets[e],G=E.ownerDocument.compatMode,K="";if(I===q||I.indexOf("%")>-1){K=E["offset"+J];if(G!=="BackCompat"){if(H[0]){K-=r.getPixel(E,"padding"+H[0]);K-=r.getBorderWidth(E,"border"+H[0]+"Width",1);}if(H[1]){K-=r.getPixel(E,"padding"+H[1]);K-=r.getBorderWidth(E,"border"+H[1]+"Width",1);}}}else{if(!E.style[D]&&!E.style[e]){E.style[e]=I;}K=E.style[D];}return K+l;},borderMap:{thin:(o)?"1px":"2px",medium:(o)?"3px":"4px",thick:(o)?"5px":"6px"},getBorderWidth:function(D,F,e){var E=e?"":l,G=D.currentStyle[F];if(G.indexOf(l)<0){if(r.borderMap[G]&&D.currentStyle.borderStyle!=="none"){G=r.borderMap[G];}else{G=0;}}return(e)?parseFloat(G):G;},getPixel:function(E,e){var G=null,D=f(E),H=D.right,F=D[e];E.style.right=F;G=E.style.pixelRight;E.style.right=H;return G;},getMargin:function(E,e){var F,D=f(E);if(D[e]==q){F=0;}else{F=r.getPixel(E,e);}return F+l;},getVisibility:function(D,e){var E;while((E=D.currentStyle)&&E[e]=="inherit"){D=D.parentNode;}return(E)?E[e]:w;},getColor:function(D,e){var E=f(D)[e];if(!E||E===v){d.DOM.elementByAxis(D,"parentNode",null,function(F){E=f(F)[e];if(E&&E!==v){D=F;return true;}});}return d.Color.toRGB(E);},getBorderColor:function(D,e){var E=f(D),F=E[e]||E.color;return d.Color.toRGB(d.Color.toHex(F));}},g={};n("style","computedStyle",{test:function(){return"getComputedStyle" in d.config.win;}});n("style","opacity",{test:function(){return"opacity" in B.style;}});n("style","filter",{test:function(){return"filters" in B;}});if(!p("style","opacity")&&p("style","filter")){d.DOM.CUSTOM_STYLES[x]={get:function(E){var G=100;try{G=E[b]["DXImageTransform.Microsoft.Alpha"][x];}catch(F){try{G=E[b]("alpha")[x];}catch(D){}}return G/100;},set:function(E,H,D){var G,F=f(E),e=F[m];D=D||E.style;if(H===""){G=(x in F)?F[x]:1;H=G;}if(typeof e=="string"){D[m]=e.replace(/alpha([^)]*\))/gi,"")+((H<1)?"alpha("+x+"="+H*100+")":"");if(!D[m]){D.removeAttribute(m);}if(!F[A]){D.zoom=1;}}}};}try{d.config.doc.createElement("div").style.height="-1px";}catch(y){d.DOM.CUSTOM_STYLES.height={set:function(E,F,D){var e=parseFloat(F);if(e>=0||F==="auto"||F===""){D.height=F;}else{}}};d.DOM.CUSTOM_STYLES.width={set:function(E,F,D){var e=parseFloat(F);if(e>=0||F==="auto"||F===""){D.width=F;}else{}}};}if(!p("style","computedStyle")){g[j]=g[s]=r.getOffset;g.color=g.backgroundColor=r.getColor;g[h]=g[k]=g[u]=g[z]=g[i]=r.getBorderWidth;g.marginTop=g.marginRight=g.marginBottom=g.marginLeft=r.getMargin;g.visibility=r.getVisibility;g.borderColor=g.borderTopColor=g.borderRightColor=g.borderBottomColor=g.borderLeftColor=r.getBorderColor;d.DOM[c]=r.get;d.namespace("DOM.IE");d.DOM.IE.COMPUTED=g;d.DOM.IE.ComputedStyle=r;}})(a);},"@VERSION@",{requires:["dom-style"]});YUI.add("dom-screen",function(a){(function(f){var d="documentElement",q="compatMode",o="position",c="fixed",m="relative",g="left",h="top",i="BackCompat",p="medium",e="borderLeftWidth",b="borderTopWidth",r="getBoundingClientRect",k="getComputedStyle",l=f.DOM,n=/^t(?:able|d|h)$/i,j;if(f.UA.ie){if(f.config.doc[q]!=="BackCompat"){j=d;}else{j="body";}}f.mix(l,{winHeight:function(t){var s=l._getWinSize(t).height;return s;},winWidth:function(t){var s=l._getWinSize(t).width;return s;},docHeight:function(t){var s=l._getDocSize(t).height;return Math.max(s,l._getWinSize(t).height);},docWidth:function(t){var s=l._getDocSize(t).width;return Math.max(s,l._getWinSize(t).width);},docScrollX:function(u,v){v=v||(u)?l._getDoc(u):f.config.doc;var t=v.defaultView,s=(t)?t.pageXOffset:0;return Math.max(v[d].scrollLeft,v.body.scrollLeft,s);},docScrollY:function(u,v){v=v||(u)?l._getDoc(u):f.config.doc;var t=v.defaultView,s=(t)?t.pageYOffset:0;return Math.max(v[d].scrollTop,v.body.scrollTop,s);},getXY:function(){if(f.config.doc[d][r]){return function(v){var D=null,w,t,y,x,C,B,A,z,s,u;if(v&&v.tagName){A=v.ownerDocument;y=A[q];if(y!==i){u=A[d];}else{u=A.body;}if(u.contains){s=u.contains(v);}else{s=f.DOM.contains(u,v);}if(s){z=A.defaultView;if(z&&"pageXOffset" in z){w=z.pageXOffset;t=z.pageYOffset;}else{w=(j)?A[j].scrollLeft:l.docScrollX(v,A);t=(j)?A[j].scrollTop:l.docScrollY(v,A);}if(f.UA.ie){if(!A.documentMode||A.documentMode<8||y===i){C=u.clientLeft;B=u.clientTop;}}x=v[r]();D=[x.left,x.top];if(C||B){D[0]-=C;D[1]-=B;}if((t||w)){if(!f.UA.ios||(f.UA.ios>=4.2)){D[0]+=w;D[1]+=t;}}}else{D=l._getOffset(v);}}return D;};}else{return function(t){var w=null,v,s,y,u,x;if(t){if(l.inDoc(t)){w=[t.offsetLeft,t.offsetTop];v=t.ownerDocument;s=t;y=((f.UA.gecko||f.UA.webkit>519)?true:false);while((s=s.offsetParent)){w[0]+=s.offsetLeft; w[1]+=s.offsetTop;if(y){w=l._calcBorders(s,w);}}if(l.getStyle(t,o)!=c){s=t;while((s=s.parentNode)){u=s.scrollTop;x=s.scrollLeft;if(f.UA.gecko&&(l.getStyle(s,"overflow")!=="visible")){w=l._calcBorders(s,w);}if(u||x){w[0]-=x;w[1]-=u;}}w[0]+=l.docScrollX(t,v);w[1]+=l.docScrollY(t,v);}else{w[0]+=l.docScrollX(t,v);w[1]+=l.docScrollY(t,v);}}else{w=l._getOffset(t);}}return w;};}}(),getScrollbarWidth:f.cached(function(){var v=f.config.doc,t=v.createElement("div"),s=v.getElementsByTagName("body")[0],u=0.1;if(s){t.style.cssText="position:absolute;visibility:hidden;overflow:scroll;width:20px;";t.appendChild(v.createElement("p")).style.height="1px";s.insertBefore(t,s.firstChild);u=t.offsetWidth-t.clientWidth;s.removeChild(t);}return u;},null,0.1),getX:function(s){return l.getXY(s)[0];},getY:function(s){return l.getXY(s)[1];},setXY:function(t,w,z){var u=l.setStyle,y,x,s,v;if(t&&w){y=l.getStyle(t,o);x=l._getOffset(t);if(y=="static"){y=m;u(t,o,y);}v=l.getXY(t);if(w[0]!==null){u(t,g,w[0]-v[0]+x[0]+"px");}if(w[1]!==null){u(t,h,w[1]-v[1]+x[1]+"px");}if(!z){s=l.getXY(t);if(s[0]!==w[0]||s[1]!==w[1]){l.setXY(t,w,true);}}}else{}},setX:function(t,s){return l.setXY(t,[s,null]);},setY:function(s,t){return l.setXY(s,[null,t]);},swapXY:function(t,s){var u=l.getXY(t);l.setXY(t,l.getXY(s));l.setXY(s,u);},_calcBorders:function(v,w){var u=parseInt(l[k](v,b),10)||0,s=parseInt(l[k](v,e),10)||0;if(f.UA.gecko){if(n.test(v.tagName)){u=0;s=0;}}w[0]+=s;w[1]+=u;return w;},_getWinSize:function(v,y){y=y||(v)?l._getDoc(v):f.config.doc;var x=y.defaultView||y.parentWindow,z=y[q],u=x.innerHeight,t=x.innerWidth,s=y[d];if(z&&!f.UA.opera){if(z!="CSS1Compat"){s=y.body;}u=s.clientHeight;t=s.clientWidth;}return{height:u,width:t};},_getDocSize:function(t){var u=(t)?l._getDoc(t):f.config.doc,s=u[d];if(u[q]!="CSS1Compat"){s=u.body;}return{height:s.scrollHeight,width:s.scrollWidth};}});})(a);(function(g){var d="top",c="right",h="bottom",b="left",f=function(m,k){var o=Math.max(m[d],k[d]),p=Math.min(m[c],k[c]),i=Math.min(m[h],k[h]),j=Math.max(m[b],k[b]),n={};n[d]=o;n[c]=p;n[h]=i;n[b]=j;return n;},e=g.DOM;g.mix(e,{region:function(j){var k=e.getXY(j),i=false;if(j&&k){i=e._getRegion(k[1],k[0]+j.offsetWidth,k[1]+j.offsetHeight,k[0]);}return i;},intersect:function(k,i,m){var j=m||e.region(k),l={},p=i,o;if(p.tagName){l=e.region(p);}else{if(g.Lang.isObject(i)){l=i;}else{return false;}}o=f(l,j);return{top:o[d],right:o[c],bottom:o[h],left:o[b],area:((o[h]-o[d])*(o[c]-o[b])),yoff:((o[h]-o[d])),xoff:(o[c]-o[b]),inRegion:e.inRegion(k,i,false,m)};},inRegion:function(l,i,j,o){var m={},k=o||e.region(l),q=i,p;if(q.tagName){m=e.region(q);}else{if(g.Lang.isObject(i)){m=i;}else{return false;}}if(j){return(k[b]>=m[b]&&k[c]<=m[c]&&k[d]>=m[d]&&k[h]<=m[h]);}else{p=f(m,k);if(p[h]>=p[d]&&p[c]>=p[b]){return true;}else{return false;}}},inViewportRegion:function(j,i,k){return e.inRegion(j,e.viewportRegion(j),i,k);},_getRegion:function(k,m,i,j){var n={};n[d]=n[1]=k;n[b]=n[0]=j;n[h]=i;n[c]=m;n.width=n[c]-n[b];n.height=n[h]-n[d];return n;},viewportRegion:function(j){j=j||g.config.doc.documentElement;var i=false,l,k;if(j){l=e.docScrollX(j);k=e.docScrollY(j);i=e._getRegion(k,e.winWidth(j)+l,k+e.winHeight(j),l);}return i;}});})(a);},"@VERSION@",{requires:["dom-base","dom-style"]});YUI.add("selector-native",function(a){(function(e){e.namespace("Selector");var c="compareDocumentPosition",d="ownerDocument";var b={useNative:true,_compare:("sourceIndex" in e.config.doc.documentElement)?function(i,h){var g=i.sourceIndex,f=h.sourceIndex;if(g===f){return 0;}else{if(g>f){return 1;}}return -1;}:(e.config.doc.documentElement[c]?function(g,f){if(g[c](f)&4){return -1;}else{return 1;}}:function(j,i){var h,f,g;if(j&&i){h=j[d].createRange();h.setStart(j,0);f=i[d].createRange();f.setStart(i,0);g=h.compareBoundaryPoints(1,f);}return g;}),_sort:function(f){if(f){f=e.Array(f,0,true);if(f.sort){f.sort(b._compare);}}return f;},_deDupe:function(f){var g=[],h,j;for(h=0;(j=f[h++]);){if(!j._found){g[g.length]=j;j._found=true;}}for(h=0;(j=g[h++]);){j._found=null;j.removeAttribute("_found");}return g;},query:function(g,o,p,f){o=o||e.config.doc;var l=[],h=(e.Selector.useNative&&e.config.doc.querySelector&&!f),k=[[g,o]],m,q,j,n=(h)?e.Selector._nativeQuery:e.Selector._bruteQuery;if(g&&n){if(!f&&(!h||o.tagName)){k=b._splitQueries(g,o);}for(j=0;(m=k[j++]);){q=n(m[0],m[1],p);if(!p){q=e.Array(q,0,true);}if(q){l=l.concat(q);}}if(k.length>1){l=b._sort(b._deDupe(l));}}return(p)?(l[0]||null):l;},_splitQueries:function(h,l){var g=h.split(","),j=[],m="",k,f;if(l){if(l.tagName){l.id=l.id||e.guid();m='[id="'+l.id+'"] ';}for(k=0,f=g.length;k<f;++k){h=m+g[k];j.push([h,l]);}}return j;},_nativeQuery:function(f,g,h){if(e.UA.webkit&&f.indexOf(":checked")>-1&&(e.Selector.pseudos&&e.Selector.pseudos.checked)){return e.Selector.query(f,g,h,true);}try{return g["querySelector"+(h?"":"All")](f);}catch(i){return e.Selector.query(f,g,h,true);}},filter:function(g,f){var h=[],j,k;if(g&&f){for(j=0;(k=g[j++]);){if(e.Selector.test(k,f)){h[h.length]=k;}}}else{}return h;},test:function(h,k,p){var n=false,f=false,g,q,t,o,s,m,l,r;if(h&&h.tagName){if(typeof k=="function"){n=k.call(h,h);}else{g=k.split(",");if(!p&&!e.DOM.inDoc(h)){q=h.parentNode;if(q){p=q;}else{s=h[d].createDocumentFragment();s.appendChild(h);p=s;f=true;}}p=p||h[d];if(!h.id){h.id=e.guid();}for(m=0;(r=g[m++]);){r+='[id="'+h.id+'"]';o=e.Selector.query(r,p);for(l=0;t=o[l++];){if(t===h){n=true;break;}}if(n){break;}}if(f){s.removeChild(h);}}}return n;},ancestor:function(g,f,h){return e.DOM.ancestor(g,function(i){return e.Selector.test(i,f);},h);}};e.mix(e.Selector,b,true);})(a);},"@VERSION@",{requires:["dom-base"]});YUI.add("selector",function(a){},"@VERSION@",{requires:["selector-native"]});YUI.add("event-custom-base",function(b){b.Env.evt={handles:{},plugins:{}};var g=0,i=1,p={objs:{},before:function(s,u,v,w){var t=s,r;if(w){r=[s,w].concat(b.Array(arguments,4,true));t=b.rbind.apply(b,r);}return this._inject(g,t,u,v);},after:function(s,u,v,w){var t=s,r;if(w){r=[s,w].concat(b.Array(arguments,4,true)); t=b.rbind.apply(b,r);}return this._inject(i,t,u,v);},_inject:function(r,t,u,w){var x=b.stamp(u),v,s;if(!this.objs[x]){this.objs[x]={};}v=this.objs[x];if(!v[w]){v[w]=new b.Do.Method(u,w);u[w]=function(){return v[w].exec.apply(v[w],arguments);};}s=x+b.stamp(t)+w;v[w].register(s,t,r);return new b.EventHandle(v[w],s);},detach:function(r){if(r.detach){r.detach();}},_unload:function(s,r){}};b.Do=p;p.Method=function(r,s){this.obj=r;this.methodName=s;this.method=r[s];this.before={};this.after={};};p.Method.prototype.register=function(s,t,r){if(r){this.after[s]=t;}else{this.before[s]=t;}};p.Method.prototype._delete=function(r){delete this.before[r];delete this.after[r];};p.Method.prototype.exec=function(){var t=b.Array(arguments,0,true),u,s,x,v=this.before,r=this.after,w=false;for(u in v){if(v.hasOwnProperty(u)){s=v[u].apply(this.obj,t);if(s){switch(s.constructor){case p.Halt:return s.retVal;case p.AlterArgs:t=s.newArgs;break;case p.Prevent:w=true;break;default:}}}}if(!w){s=this.method.apply(this.obj,t);}p.originalRetVal=s;p.currentRetVal=s;for(u in r){if(r.hasOwnProperty(u)){x=r[u].apply(this.obj,t);if(x&&x.constructor==p.Halt){return x.retVal;}else{if(x&&x.constructor==p.AlterReturn){s=x.newRetVal;p.currentRetVal=s;}}}}return s;};p.AlterArgs=function(s,r){this.msg=s;this.newArgs=r;};p.AlterReturn=function(s,r){this.msg=s;this.newRetVal=r;};p.Halt=function(s,r){this.msg=s;this.retVal=r;};p.Prevent=function(r){this.msg=r;};p.Error=p.Halt;var m="after",q=["broadcast","monitored","bubbles","context","contextFn","currentTarget","defaultFn","defaultTargetOnly","details","emitFacade","fireOnce","async","host","preventable","preventedFn","queuable","silent","stoppedFn","target","type"],n=9,a="yui:log";b.CustomEvent=function(r,s){s=s||{};this.id=b.stamp(this);this.type=r;this.context=b;this.logSystem=(r==a);this.silent=this.logSystem;this.subscribers={};this.afters={};this.preventable=true;this.bubbles=true;this.signature=n;this.subCount=0;this.afterCount=0;this.applyConfig(s,true);};b.CustomEvent.prototype={constructor:b.CustomEvent,hasSubs:function(r){var v=this.subCount,t=this.afterCount,u=this.sibling;if(u){v+=u.subCount;t+=u.afterCount;}if(r){return(r=="after")?t:v;}return(v+t);},monitor:function(t){this.monitored=true;var s=this.id+"|"+this.type+"_"+t,r=b.Array(arguments,0,true);r[0]=s;return this.host.on.apply(this.host,r);},getSubs:function(){var u=b.merge(this.subscribers),r=b.merge(this.afters),t=this.sibling;if(t){b.mix(u,t.subscribers);b.mix(r,t.afters);}return[u,r];},applyConfig:function(s,r){if(s){b.mix(this,s,r,q);}},_on:function(w,u,t,r){if(!w){this.log("Invalid callback for CE: "+this.type);}var v=new b.Subscriber(w,u,t,r);if(this.fireOnce&&this.fired){if(this.async){setTimeout(b.bind(this._notify,this,v,this.firedWith),0);}else{this._notify(v,this.firedWith);}}if(r==m){this.afters[v.id]=v;this.afterCount++;}else{this.subscribers[v.id]=v;this.subCount++;}return new b.EventHandle(this,v);},subscribe:function(t,s){var r=(arguments.length>2)?b.Array(arguments,2,true):null;return this._on(t,s,r,true);},on:function(t,s){var r=(arguments.length>2)?b.Array(arguments,2,true):null;if(this.host){this.host._monitor("attach",this.type,{args:arguments});}return this._on(t,s,r,true);},after:function(t,s){var r=(arguments.length>2)?b.Array(arguments,2,true):null;return this._on(t,s,r,m);},detach:function(w,u){if(w&&w.detach){return w.detach();}var t,v,x=0,r=b.merge(this.subscribers,this.afters);for(t in r){if(r.hasOwnProperty(t)){v=r[t];if(v&&(!w||w===v.fn)){this._delete(v);x++;}}}return x;},unsubscribe:function(){return this.detach.apply(this,arguments);},_notify:function(v,u,r){this.log(this.type+"->"+"sub: "+v.id);var t;t=v.notify(u,this);if(false===t||this.stopped>1){this.log(this.type+" cancelled by subscriber");return false;}return true;},log:function(s,r){if(!this.silent){}},fire:function(){if(this.fireOnce&&this.fired){this.log("fireOnce event: "+this.type+" already fired");return true;}else{var r=b.Array(arguments,0,true);this.fired=true;this.firedWith=r;if(this.emitFacade){return this.fireComplex(r);}else{return this.fireSimple(r);}}},fireSimple:function(r){this.stopped=0;this.prevented=0;if(this.hasSubs()){var s=this.getSubs();this._procSubs(s[0],r);this._procSubs(s[1],r);}this._broadcast(r);return this.stopped?false:true;},fireComplex:function(r){r[0]=r[0]||{};return this.fireSimple(r);},_procSubs:function(v,t,r){var w,u;for(u in v){if(v.hasOwnProperty(u)){w=v[u];if(w&&w.fn){if(false===this._notify(w,t,r)){this.stopped=2;}if(this.stopped==2){return false;}}}}return true;},_broadcast:function(s){if(!this.stopped&&this.broadcast){var r=b.Array(s);r.unshift(this.type);if(this.host!==b){b.fire.apply(b,r);}if(this.broadcast==2){b.Global.fire.apply(b.Global,r);}}},unsubscribeAll:function(){return this.detachAll.apply(this,arguments);},detachAll:function(){return this.detach();},_delete:function(r){if(r){if(this.subscribers[r.id]){delete this.subscribers[r.id];this.subCount--;}if(this.afters[r.id]){delete this.afters[r.id];this.afterCount--;}}if(this.host){this.host._monitor("detach",this.type,{ce:this,sub:r});}if(r){r.deleted=true;}}};b.Subscriber=function(t,s,r){this.fn=t;this.context=s;this.id=b.stamp(this);this.args=r;};b.Subscriber.prototype={constructor:b.Subscriber,_notify:function(v,t,u){if(this.deleted&&!this.postponed){if(this.postponed){delete this.fn;delete this.context;}else{delete this.postponed;return null;}}var r=this.args,s;switch(u.signature){case 0:s=this.fn.call(v,u.type,t,v);break;case 1:s=this.fn.call(v,t[0]||null,v);break;default:if(r||t){t=t||[];r=(r)?t.concat(r):t;s=this.fn.apply(v,r);}else{s=this.fn.call(v);}}if(this.once){u._delete(this);}return s;},notify:function(s,u){var v=this.context,r=true;if(!v){v=(u.contextFn)?u.contextFn():u.context;}if(b.config.throwFail){r=this._notify(v,s,u);}else{try{r=this._notify(v,s,u);}catch(t){b.error(this+" failed: "+t.message,t);}}return r;},contains:function(s,r){if(r){return((this.fn==s)&&this.context==r);}else{return(this.fn==s);}}}; b.EventHandle=function(r,s){this.evt=r;this.sub=s;};b.EventHandle.prototype={batch:function(r,s){r.call(s||this,this);if(b.Lang.isArray(this.evt)){b.Array.each(this.evt,function(t){t.batch.call(s||t,r);});}},detach:function(){var r=this.evt,t=0,s;if(r){if(b.Lang.isArray(r)){for(s=0;s<r.length;s++){t+=r[s].detach();}}else{r._delete(this.sub);t=1;}}return t;},monitor:function(r){return this.evt.monitor.apply(this.evt,arguments);}};var j=b.Lang,h=":",e="|",l="~AFTER~",k=b.Array,c=b.cached(function(r){return r.replace(/(.*)(:)(.*)/,"*$2$3");}),o=b.cached(function(r,s){if(!s||!j.isString(r)||r.indexOf(h)>-1){return r;}return s+h+r;}),f=b.cached(function(u,w){var s=u,v,x,r;if(!j.isString(s)){return s;}r=s.indexOf(l);if(r>-1){x=true;s=s.substr(l.length);}r=s.indexOf(e);if(r>-1){v=s.substr(0,(r));s=s.substr(r+1);if(s=="*"){s=null;}}return[v,(w)?o(s,w):s,x,s];}),d=function(r){var s=(j.isObject(r))?r:{};this._yuievt=this._yuievt||{id:b.guid(),events:{},targets:{},config:s,chain:("chain" in s)?s.chain:b.config.chain,bubbling:false,defaults:{context:s.context||this,host:this,emitFacade:s.emitFacade,fireOnce:s.fireOnce,queuable:s.queuable,monitored:s.monitored,broadcast:s.broadcast,defaultTargetOnly:s.defaultTargetOnly,bubbles:("bubbles" in s)?s.bubbles:true}};};d.prototype={constructor:d,once:function(){var r=this.on.apply(this,arguments);r.batch(function(s){if(s.sub){s.sub.once=true;}});return r;},onceAfter:function(){var r=this.after.apply(this,arguments);r.batch(function(s){if(s.sub){s.sub.once=true;}});return r;},parseType:function(r,s){return f(r,s||this._yuievt.config.prefix);},on:function(v,A,t){var D=f(v,this._yuievt.config.prefix),F,G,s,J,C,B,H,x=b.Env.evt.handles,u,r,y,I=b.Node,E,z,w;this._monitor("attach",D[1],{args:arguments,category:D[0],after:D[2]});if(j.isObject(v)){if(j.isFunction(v)){return b.Do.before.apply(b.Do,arguments);}F=A;G=t;s=k(arguments,0,true);J=[];if(j.isArray(v)){w=true;}u=v._after;delete v._after;b.each(v,function(M,L){if(j.isObject(M)){F=M.fn||((j.isFunction(M))?M:F);G=M.context||G;}var K=(u)?l:"";s[0]=K+((w)?M:L);s[1]=F;s[2]=G;J.push(this.on.apply(this,s));},this);return(this._yuievt.chain)?this:new b.EventHandle(J);}B=D[0];u=D[2];y=D[3];if(I&&b.instanceOf(this,I)&&(y in I.DOM_EVENTS)){s=k(arguments,0,true);s.splice(2,0,I.getDOMNode(this));return b.on.apply(b,s);}v=D[1];if(b.instanceOf(this,YUI)){r=b.Env.evt.plugins[v];s=k(arguments,0,true);s[0]=y;if(I){E=s[2];if(b.instanceOf(E,b.NodeList)){E=b.NodeList.getDOMNodes(E);}else{if(b.instanceOf(E,I)){E=I.getDOMNode(E);}}z=(y in I.DOM_EVENTS);if(z){s[2]=E;}}if(r){H=r.on.apply(b,s);}else{if((!v)||z){H=b.Event._attach(s);}}}if(!H){C=this._yuievt.events[v]||this.publish(v);H=C._on(A,t,(arguments.length>3)?k(arguments,3,true):null,(u)?"after":true);}if(B){x[B]=x[B]||{};x[B][v]=x[B][v]||[];x[B][v].push(H);}return(this._yuievt.chain)?this:H;},subscribe:function(){return this.on.apply(this,arguments);},detach:function(A,C,r){var G=this._yuievt.events,v,x=b.Node,E=x&&(b.instanceOf(this,x));if(!A&&(this!==b)){for(v in G){if(G.hasOwnProperty(v)){G[v].detach(C,r);}}if(E){b.Event.purgeElement(x.getDOMNode(this));}return this;}var u=f(A,this._yuievt.config.prefix),z=j.isArray(u)?u[0]:null,H=(u)?u[3]:null,w,D=b.Env.evt.handles,F,B,y,t,s=function(M,K,L){var J=M[K],N,I;if(J){for(I=J.length-1;I>=0;--I){N=J[I].evt;if(N.host===L||N.el===L){J[I].detach();}}}};if(z){B=D[z];A=u[1];F=(E)?b.Node.getDOMNode(this):this;if(B){if(A){s(B,A,F);}else{for(v in B){if(B.hasOwnProperty(v)){s(B,v,F);}}}return this;}}else{if(j.isObject(A)&&A.detach){A.detach();return this;}else{if(E&&((!H)||(H in x.DOM_EVENTS))){y=k(arguments,0,true);y[2]=x.getDOMNode(this);b.detach.apply(b,y);return this;}}}w=b.Env.evt.plugins[H];if(b.instanceOf(this,YUI)){y=k(arguments,0,true);if(w&&w.detach){w.detach.apply(b,y);return this;}else{if(!A||(!w&&x&&(A in x.DOM_EVENTS))){y[0]=A;b.Event.detach.apply(b.Event,y);return this;}}}t=G[u[1]];if(t){t.detach(C,r);}return this;},unsubscribe:function(){return this.detach.apply(this,arguments);},detachAll:function(r){return this.detach(r);},unsubscribeAll:function(){return this.detachAll.apply(this,arguments);},publish:function(t,u){var s,y,r,x,w=this._yuievt,v=w.config.prefix;if(j.isObject(t)){r={};b.each(t,function(A,z){r[z]=this.publish(z,A||u);},this);return r;}t=(v)?o(t,v):t;this._monitor("publish",t,{args:arguments});s=w.events;y=s[t];if(y){if(u){y.applyConfig(u,true);}}else{x=w.defaults;y=new b.CustomEvent(t,(u)?b.merge(x,u):x);s[t]=y;}return s[t];},_monitor:function(u,r,v){var s,t=this.getEvent(r);if((this._yuievt.config.monitored&&(!t||t.monitored))||(t&&t.monitored)){s=r+"_"+u;v.monitored=u;this.fire.call(this,s,v);}},fire:function(v){var z=j.isString(v),u=(z)?v:(v&&v.type),y,s,x=this._yuievt.config.prefix,w,r=(z)?k(arguments,1,true):arguments;u=(x)?o(u,x):u;this._monitor("fire",u,{args:r});y=this.getEvent(u,true);w=this.getSibling(u,y);if(w&&!y){y=this.publish(u);}if(!y){if(this._yuievt.hasTargets){return this.bubble({type:u},r,this);}s=true;}else{y.sibling=w;s=y.fire.apply(y,r);}return(this._yuievt.chain)?this:s;},getSibling:function(r,t){var s;if(r.indexOf(h)>-1){r=c(r);s=this.getEvent(r,true);if(s){s.applyConfig(t);s.bubbles=false;s.broadcast=0;}}return s;},getEvent:function(s,r){var u,t;if(!r){u=this._yuievt.config.prefix;s=(u)?o(s,u):s;}t=this._yuievt.events;return t[s]||null;},after:function(t,s){var r=k(arguments,0,true);switch(j.type(t)){case"function":return b.Do.after.apply(b.Do,arguments);case"array":case"object":r[0]._after=true;break;default:r[0]=l+t;}return this.on.apply(this,r);},before:function(){return this.on.apply(this,arguments);}};b.EventTarget=d;b.mix(b,d.prototype);d.call(b,{bubbles:false});YUI.Env.globalEvents=YUI.Env.globalEvents||new d();b.Global=YUI.Env.globalEvents;},"@VERSION@",{requires:["oop"]});YUI.add("event-custom-complex",function(f){var b,e,d={},a=f.CustomEvent.prototype,c=f.EventTarget.prototype;f.EventFacade=function(h,g){h=h||d;this._event=h;this.details=h.details;this.type=h.type;this._type=h.type; this.target=h.target;this.currentTarget=g;this.relatedTarget=h.relatedTarget;};f.extend(f.EventFacade,Object,{stopPropagation:function(){this._event.stopPropagation();this.stopped=1;},stopImmediatePropagation:function(){this._event.stopImmediatePropagation();this.stopped=2;},preventDefault:function(){this._event.preventDefault();this.prevented=1;},halt:function(g){this._event.halt(g);this.prevented=1;this.stopped=(g)?2:1;}});a.fireComplex=function(p){var r,l,g,n,i,o,u,j,h,t=this,s=t.host||t,m,k;if(t.stack){if(t.queuable&&t.type!=t.stack.next.type){t.log("queue "+t.type);t.stack.queue.push([t,p]);return true;}}r=t.stack||{id:t.id,next:t,silent:t.silent,stopped:0,prevented:0,bubbling:null,type:t.type,afterQueue:new f.Queue(),defaultTargetOnly:t.defaultTargetOnly,queue:[]};j=t.getSubs();t.stopped=(t.type!==r.type)?0:r.stopped;t.prevented=(t.type!==r.type)?0:r.prevented;t.target=t.target||s;u=new f.EventTarget({fireOnce:true,context:s});t.events=u;if(t.stoppedFn){u.on("stopped",t.stoppedFn);}t.currentTarget=s;t.details=p.slice();t.log("Firing "+t.type);t._facade=null;l=t._getFacade(p);if(f.Lang.isObject(p[0])){p[0]=l;}else{p.unshift(l);}if(j[0]){t._procSubs(j[0],p,l);}if(t.bubbles&&s.bubble&&!t.stopped){k=r.bubbling;r.bubbling=t.type;if(r.type!=t.type){r.stopped=0;r.prevented=0;}o=s.bubble(t,p,null,r);t.stopped=Math.max(t.stopped,r.stopped);t.prevented=Math.max(t.prevented,r.prevented);r.bubbling=k;}if(t.prevented){if(t.preventedFn){t.preventedFn.apply(s,p);}}else{if(t.defaultFn&&((!t.defaultTargetOnly&&!r.defaultTargetOnly)||s===l.target)){t.defaultFn.apply(s,p);}}t._broadcast(p);if(j[1]&&!t.prevented&&t.stopped<2){if(r.id===t.id||t.type!=s._yuievt.bubbling){t._procSubs(j[1],p,l);while((m=r.afterQueue.last())){m();}}else{h=j[1];if(r.execDefaultCnt){h=f.merge(h);f.each(h,function(q){q.postponed=true;});}r.afterQueue.add(function(){t._procSubs(h,p,l);});}}t.target=null;if(r.id===t.id){n=r.queue;while(n.length){g=n.pop();i=g[0];r.next=i;i.fire.apply(i,g[1]);}t.stack=null;}o=!(t.stopped);if(t.type!=s._yuievt.bubbling){r.stopped=0;r.prevented=0;t.stopped=0;t.prevented=0;}return o;};a._getFacade=function(){var g=this._facade,j,i,h=this.details;if(!g){g=new f.EventFacade(this,this.currentTarget);}j=h&&h[0];if(f.Lang.isObject(j,true)){i={};f.mix(i,g,true,e);f.mix(g,j,true);f.mix(g,i,true,e);g.type=j.type||g.type;}g.details=this.details;g.target=this.originalTarget||this.target;g.currentTarget=this.currentTarget;g.stopped=0;g.prevented=0;this._facade=g;return this._facade;};a.stopPropagation=function(){this.stopped=1;if(this.stack){this.stack.stopped=1;}this.events.fire("stopped",this);};a.stopImmediatePropagation=function(){this.stopped=2;if(this.stack){this.stack.stopped=2;}this.events.fire("stopped",this);};a.preventDefault=function(){if(this.preventable){this.prevented=1;if(this.stack){this.stack.prevented=1;}}};a.halt=function(g){if(g){this.stopImmediatePropagation();}else{this.stopPropagation();}this.preventDefault();};c.addTarget=function(g){this._yuievt.targets[f.stamp(g)]=g;this._yuievt.hasTargets=true;};c.getTargets=function(){return f.Object.values(this._yuievt.targets);};c.removeTarget=function(g){delete this._yuievt.targets[f.stamp(g)];};c.bubble=function(u,q,o,s){var m=this._yuievt.targets,p=true,v,r=u&&u.type,h,l,n,j,g=o||(u&&u.target)||this,k;if(!u||((!u.stopped)&&m)){for(l in m){if(m.hasOwnProperty(l)){v=m[l];h=v.getEvent(r,true);j=v.getSibling(r,h);if(j&&!h){h=v.publish(r);}k=v._yuievt.bubbling;v._yuievt.bubbling=r;if(!h){if(v._yuievt.hasTargets){v.bubble(u,q,g,s);}}else{h.sibling=j;h.target=g;h.originalTarget=g;h.currentTarget=v;n=h.broadcast;h.broadcast=false;h.emitFacade=true;h.stack=s;p=p&&h.fire.apply(h,q||u.details||[]);h.broadcast=n;h.originalTarget=null;if(h.stopped){break;}}v._yuievt.bubbling=k;}}}return p;};b=new f.EventFacade();e=f.Object.keys(b);},"@VERSION@",{requires:["event-custom-base"]});YUI.add("node-core",function(c){var j=".",e="nodeName",n="nodeType",b="ownerDocument",m="tagName",d="_yuid",i={},p=Array.prototype.slice,f=c.DOM,k=function(r){if(!this.getDOMNode){return new k(r);}if(typeof r=="string"){r=k._fromString(r);if(!r){return null;}}var q=(r.nodeType!==9)?r.uniqueID:r[d];if(q&&k._instances[q]&&k._instances[q]._node!==r){r[d]=null;}q=q||c.stamp(r);if(!q){q=c.guid();}this[d]=q;this._node=r;this._stateProxy=r;if(this._initPlugins){this._initPlugins();}},o=function(r){var q=null;if(r){q=(typeof r=="string")?function(s){return c.Selector.test(s,r);}:function(s){return r(c.one(s));};}return q;};k.ATTRS={};k.DOM_EVENTS={};k._fromString=function(q){if(q){if(q.indexOf("doc")===0){q=c.config.doc;}else{if(q.indexOf("win")===0){q=c.config.win;}else{q=c.Selector.query(q,null,true);}}}return q||null;};k.NAME="node";k.re_aria=/^(?:role$|aria-)/;k.SHOW_TRANSITION="fadeIn";k.HIDE_TRANSITION="fadeOut";k._instances={};k.getDOMNode=function(q){if(q){return(q.nodeType)?q:q._node||null;}return null;};k.scrubVal=function(r,q){if(r){if(typeof r=="object"||typeof r=="function"){if(n in r||f.isWindow(r)){r=c.one(r);}else{if((r.item&&!r._nodes)||(r[0]&&r[0][n])){r=c.all(r);}}}}else{if(typeof r==="undefined"){r=q;}else{if(r===null){r=null;}}}return r;};k.addMethod=function(q,s,r){if(q&&s&&typeof s=="function"){k.prototype[q]=function(){var u=p.call(arguments),v=this,t;if(u[0]&&u[0]._node){u[0]=u[0]._node;}if(u[1]&&u[1]._node){u[1]=u[1]._node;}u.unshift(v._node);t=s.apply(v,u);if(t){t=k.scrubVal(t,v);}(typeof t!="undefined")||(t=v);return t;};}else{}};k.importMethod=function(s,q,r){if(typeof q=="string"){r=r||q;k.addMethod(r,s[q],s);}else{c.Array.each(q,function(t){k.importMethod(s,t);});}};k.one=function(t){var q=null,s,r;if(t){if(typeof t=="string"){t=k._fromString(t);if(!t){return null;}}else{if(t.getDOMNode){return t;}}if(t.nodeType||c.DOM.isWindow(t)){r=(t.uniqueID&&t.nodeType!==9)?t.uniqueID:t._yuid;q=k._instances[r];s=q?q._node:null;if(!q||(s&&t!==s)){q=new k(t);if(t.nodeType!=11){k._instances[q[d]]=q;}}}}return q;};k.DEFAULT_SETTER=function(q,s){var r=this._stateProxy,t;if(q.indexOf(j)>-1){t=q; q=q.split(j);c.Object.setValue(r,q,s);}else{if(typeof r[q]!="undefined"){r[q]=s;}}return s;};k.DEFAULT_GETTER=function(q){var r=this._stateProxy,s;if(q.indexOf&&q.indexOf(j)>-1){s=c.Object.getValue(r,q.split(j));}else{if(typeof r[q]!="undefined"){s=r[q];}}return s;};c.mix(k.prototype,{DATA_PREFIX:"data-",toString:function(){var t=this[d]+": not bound to a node",s=this._node,q,u,r;if(s){q=s.attributes;u=(q&&q.id)?s.getAttribute("id"):null;r=(q&&q.className)?s.getAttribute("className"):null;t=s[e];if(u){t+="#"+u;}if(r){t+="."+r.replace(" ",".");}t+=" "+this[d];}return t;},get:function(q){var r;if(this._getAttr){r=this._getAttr(q);}else{r=this._get(q);}if(r){r=k.scrubVal(r,this);}else{if(r===null){r=null;}}return r;},_get:function(q){var r=k.ATTRS[q],s;if(r&&r.getter){s=r.getter.call(this);}else{if(k.re_aria.test(q)){s=this._node.getAttribute(q,2);}else{s=k.DEFAULT_GETTER.apply(this,arguments);}}return s;},set:function(q,s){var r=k.ATTRS[q];if(this._setAttr){this._setAttr.apply(this,arguments);}else{if(r&&r.setter){r.setter.call(this,s,q);}else{if(k.re_aria.test(q)){this._node.setAttribute(q,s);}else{k.DEFAULT_SETTER.apply(this,arguments);}}}return this;},setAttrs:function(q){if(this._setAttrs){this._setAttrs(q);}else{c.Object.each(q,function(r,s){this.set(s,r);},this);}return this;},getAttrs:function(r){var q={};if(this._getAttrs){this._getAttrs(r);}else{c.Array.each(r,function(s,t){q[s]=this.get(s);},this);}return q;},compareTo:function(q){var r=this._node;if(q&&q._node){q=q._node;}return r===q;},inDoc:function(r){var q=this._node;r=(r)?r._node||r:q[b];if(r.documentElement){return f.contains(r.documentElement,q);}},getById:function(s){var r=this._node,q=f.byId(s,r[b]);if(q&&f.contains(r,q)){q=c.one(q);}else{q=null;}return q;},ancestor:function(q,s,r){if(arguments.length===2&&(typeof s=="string"||typeof s=="function")){r=s;}return c.one(f.ancestor(this._node,o(q),s,o(r)));},ancestors:function(q,s,r){if(arguments.length===2&&(typeof s=="string"||typeof s=="function")){r=s;}return c.all(f.ancestors(this._node,o(q),s,o(r)));},previous:function(r,q){return c.one(f.elementByAxis(this._node,"previousSibling",o(r),q));},next:function(r,q){return c.one(f.elementByAxis(this._node,"nextSibling",o(r),q));},siblings:function(q){return c.all(f.siblings(this._node,o(q)));},one:function(q){return c.one(c.Selector.query(q,this._node,true));},all:function(q){var r=c.all(c.Selector.query(q,this._node));r._query=q;r._queryRoot=this._node;return r;},test:function(q){return c.Selector.test(this._node,q);},remove:function(q){var r=this._node;if(r&&r.parentNode){r.parentNode.removeChild(r);}if(q){this.destroy();}return this;},replace:function(q){var r=this._node;if(typeof q=="string"){q=k.create(q);}r.parentNode.replaceChild(k.getDOMNode(q),r);return this;},replaceChild:function(r,q){if(typeof r=="string"){r=f.create(r);}return c.one(this._node.replaceChild(k.getDOMNode(r),k.getDOMNode(q)));},destroy:function(s){var r=c.config.doc.uniqueID?"uniqueID":"_yuid",q;this.purge();if(this.unplug){this.unplug();}this.clearData();if(s){c.NodeList.each(this.all("*"),function(t){q=k._instances[t[r]];if(q){q.destroy();}});}this._node=null;this._stateProxy=null;delete k._instances[this._yuid];},invoke:function(x,r,q,w,v,u){var t=this._node,s;if(r&&r._node){r=r._node;}if(q&&q._node){q=q._node;}s=t[x](r,q,w,v,u);return k.scrubVal(s,this);},swap:c.config.doc.documentElement.swapNode?function(q){this._node.swapNode(k.getDOMNode(q));}:function(q){q=k.getDOMNode(q);var s=this._node,r=q.parentNode,t=q.nextSibling;if(t===s){r.insertBefore(s,q);}else{if(q===s.nextSibling){r.insertBefore(q,s);}else{s.parentNode.replaceChild(q,s);f.addHTML(r,s,t);}}return this;},hasMethod:function(r){var q=this._node;return !!(q&&r in q&&typeof q[r]!="unknown"&&(typeof q[r]=="function"||String(q[r]).indexOf("function")===1));},isFragment:function(){return(this.get("nodeType")===11);},empty:function(){this.get("childNodes").remove().destroy(true);return this;},getDOMNode:function(){return this._node;}},true);c.Node=k;c.one=k.one;var a=function(q){var r=[];if(q){if(typeof q==="string"){this._query=q;q=c.Selector.query(q);}else{if(q.nodeType||f.isWindow(q)){q=[q];}else{if(q._node){q=[q._node];}else{if(q[0]&&q[0]._node){c.Array.each(q,function(s){if(s._node){r.push(s._node);}});q=r;}else{q=c.Array(q,0,true);}}}}}this._nodes=q||[];};a.NAME="NodeList";a.getDOMNodes=function(q){return(q&&q._nodes)?q._nodes:q;};a.each=function(q,t,s){var r=q._nodes;if(r&&r.length){c.Array.each(r,t,s||q);}else{}};a.addMethod=function(q,s,r){if(q&&s){a.prototype[q]=function(){var u=[],t=arguments;c.Array.each(this._nodes,function(z){var y=(z.uniqueID&&z.nodeType!==9)?"uniqueID":"_yuid",w=c.Node._instances[z[y]],x,v;if(!w){w=a._getTempNode(z);}x=r||w;v=s.apply(x,t);if(v!==undefined&&v!==w){u[u.length]=v;}});return u.length?u:this;};}else{}};a.importMethod=function(s,q,r){if(typeof q==="string"){r=r||q;a.addMethod(q,s[q]);}else{c.Array.each(q,function(t){a.importMethod(s,t);});}};a._getTempNode=function(r){var q=a._tempNode;if(!q){q=c.Node.create("<div></div>");a._tempNode=q;}q._node=r;q._stateProxy=r;return q;};c.mix(a.prototype,{_invoke:function(t,s,q){var r=(q)?[]:this;this.each(function(u){var v=u[t].apply(u,s);if(q){r.push(v);}});return r;},item:function(q){return c.one((this._nodes||[])[q]);},each:function(s,r){var q=this;c.Array.each(this._nodes,function(u,t){u=c.one(u);return s.call(r||u,u,t,q);});return q;},batch:function(r,q){var s=this;c.Array.each(this._nodes,function(v,u){var t=c.Node._instances[v[d]];if(!t){t=a._getTempNode(v);}return r.call(q||t,t,u,s);});return s;},some:function(s,r){var q=this;return c.Array.some(this._nodes,function(u,t){u=c.one(u);r=r||u;return s.call(r,u,t,q);});},toFrag:function(){return c.one(c.DOM._nl2frag(this._nodes));},indexOf:function(q){return c.Array.indexOf(this._nodes,c.Node.getDOMNode(q));},filter:function(q){return c.all(c.Selector.filter(this._nodes,q));},modulus:function(t,s){s=s||0;var q=[];a.each(this,function(u,r){if(r%t===s){q.push(u); }});return c.all(q);},odd:function(){return this.modulus(2,1);},even:function(){return this.modulus(2);},destructor:function(){},refresh:function(){var t,r=this._nodes,s=this._query,q=this._queryRoot;if(s){if(!q){if(r&&r[0]&&r[0].ownerDocument){q=r[0].ownerDocument;}}this._nodes=c.Selector.query(s,q);}return this;},_prepEvtArgs:function(t,s,r){var q=c.Array(arguments,0,true);if(q.length<2){q[2]=this._nodes;}else{q.splice(2,0,this._nodes);}q[3]=r||this;return q;},on:function(s,r,q){return c.on.apply(c,this._prepEvtArgs.apply(this,arguments));},once:function(s,r,q){return c.once.apply(c,this._prepEvtArgs.apply(this,arguments));},after:function(s,r,q){return c.after.apply(c,this._prepEvtArgs.apply(this,arguments));},size:function(){return this._nodes.length;},isEmpty:function(){return this._nodes.length<1;},toString:function(){var t="",s=this[d]+": not bound to any nodes",q=this._nodes,r;if(q&&q[0]){r=q[0];t+=r[e];if(r.id){t+="#"+r.id;}if(r.className){t+="."+r.className.replace(" ",".");}if(q.length>1){t+="...["+q.length+" items]";}}return t||s;},getDOMNodes:function(){return this._nodes;}},true);a.importMethod(c.Node.prototype,["destroy","empty","remove","set"]);a.prototype.get=function(r){var u=[],t=this._nodes,s=false,v=a._getTempNode,q,w;if(t[0]){q=c.Node._instances[t[0]._yuid]||v(t[0]);w=q._get(r);if(w&&w.nodeType){s=true;}}c.Array.each(t,function(x){q=c.Node._instances[x._yuid];if(!q){q=v(x);}w=q._get(r);if(!s){w=c.Node.scrubVal(w,q);}u.push(w);});return(s)?c.all(u):u;};c.NodeList=a;c.all=function(q){return new a(q);};c.Node.all=c.all;var l=c.NodeList,h=Array.prototype,g={"concat":1,"pop":0,"push":0,"shift":0,"slice":1,"splice":1,"unshift":0};c.Object.each(g,function(r,q){l.prototype[q]=function(){var u=[],v=0,s,t;while(typeof(s=arguments[v++])!="undefined"){u.push(s._node||s._nodes||s);}t=h[q].apply(this._nodes,u);if(r){t=c.all(t);}else{t=c.Node.scrubVal(t);}return t;};});c.Array.each(["removeChild","hasChildNodes","cloneNode","hasAttribute","scrollIntoView","getElementsByTagName","focus","blur","submit","reset","select","createCaption"],function(q){c.Node.prototype[q]=function(u,s,r){var t=this.invoke(q,u,s,r);return t;};});c.Node.prototype.removeAttribute=function(q){var r=this._node;if(r){r.removeAttribute(q);}return this;};c.Node.importMethod(c.DOM,["contains","setAttribute","getAttribute","wrap","unwrap","generateID"]);c.NodeList.importMethod(c.Node.prototype,["getAttribute","setAttribute","removeAttribute","unwrap","wrap","generateID"]);},"@VERSION@",{requires:["dom-core","selector"]});YUI.add("node-base",function(e){var d=["hasClass","addClass","removeClass","replaceClass","toggleClass"];e.Node.importMethod(e.DOM,d);e.NodeList.importMethod(e.Node.prototype,d);var c=e.Node,b=e.DOM;c.create=function(f,g){if(g&&g._node){g=g._node;}return e.one(b.create(f,g));};e.mix(c.prototype,{create:c.create,insert:function(g,f){this._insert(g,f);return this;},_insert:function(i,g){var h=this._node,f=null;if(typeof g=="number"){g=this._node.childNodes[g];}else{if(g&&g._node){g=g._node;}}if(i&&typeof i!="string"){i=i._node||i._nodes||i;}f=b.addHTML(h,i,g);return f;},prepend:function(f){return this.insert(f,0);},append:function(f){return this.insert(f,null);},appendChild:function(f){return c.scrubVal(this._insert(f));},insertBefore:function(g,f){return e.Node.scrubVal(this._insert(g,f));},appendTo:function(f){e.one(f).append(this);return this;},setContent:function(f){this._insert(f,"replace");return this;},getContent:function(f){return this.get("innerHTML");}});e.Node.prototype.setHTML=e.Node.prototype.setContent;e.Node.prototype.getHTML=e.Node.prototype.getContent;e.NodeList.importMethod(e.Node.prototype,["append","insert","appendChild","insertBefore","prepend","setContent","getContent"]);var c=e.Node,b=e.DOM;c.ATTRS={text:{getter:function(){return b.getText(this._node);},setter:function(f){b.setText(this._node,f);return f;}},"for":{getter:function(){return b.getAttribute(this._node,"for");},setter:function(f){b.setAttribute(this._node,"for",f);return f;}},"options":{getter:function(){return this._node.getElementsByTagName("option");}},"children":{getter:function(){var j=this._node,h=j.children,k,g,f;if(!h){k=j.childNodes;h=[];for(g=0,f=k.length;g<f;++g){if(k[g].tagName){h[h.length]=k[g];}}}return e.all(h);}},value:{getter:function(){return b.getValue(this._node);},setter:function(f){b.setValue(this._node,f);return f;}}};e.Node.importMethod(e.DOM,["setAttribute","getAttribute"]);var c=e.Node;var a=e.NodeList;c.DOM_EVENTS={abort:1,beforeunload:1,blur:1,change:1,click:1,close:1,command:1,contextmenu:1,dblclick:1,DOMMouseScroll:1,drag:1,dragstart:1,dragenter:1,dragover:1,dragleave:1,dragend:1,drop:1,error:1,focus:1,key:1,keydown:1,keypress:1,keyup:1,load:1,message:1,mousedown:1,mouseenter:1,mouseleave:1,mousemove:1,mousemultiwheel:1,mouseout:1,mouseover:1,mouseup:1,mousewheel:1,orientationchange:1,reset:1,resize:1,select:1,selectstart:1,submit:1,scroll:1,textInput:1,unload:1};e.mix(c.DOM_EVENTS,e.Env.evt.plugins);e.augment(c,e.EventTarget);e.mix(c.prototype,{purge:function(g,f){e.Event.purgeElement(this._node,g,f);return this;}});e.mix(e.NodeList.prototype,{_prepEvtArgs:function(i,h,g){var f=e.Array(arguments,0,true);if(f.length<2){f[2]=this._nodes;}else{f.splice(2,0,this._nodes);}f[3]=g||this;return f;},on:function(h,g,f){return e.on.apply(e,this._prepEvtArgs.apply(this,arguments));},once:function(h,g,f){return e.once.apply(e,this._prepEvtArgs.apply(this,arguments));},after:function(h,g,f){return e.after.apply(e,this._prepEvtArgs.apply(this,arguments));},onceAfter:function(h,g,f){return e.onceAfter.apply(e,this._prepEvtArgs.apply(this,arguments));}});a.importMethod(e.Node.prototype,["detach","detachAll"]);e.mix(e.Node.ATTRS,{offsetHeight:{setter:function(f){e.DOM.setHeight(this._node,f);return f;},getter:function(){return this._node.offsetHeight;}},offsetWidth:{setter:function(f){e.DOM.setWidth(this._node,f);return f;},getter:function(){return this._node.offsetWidth;}}});e.mix(e.Node.prototype,{sizeTo:function(f,g){var i; if(arguments.length<2){i=e.one(f);f=i.get("offsetWidth");g=i.get("offsetHeight");}this.setAttrs({offsetWidth:f,offsetHeight:g});}});var c=e.Node;e.mix(c.prototype,{show:function(f){f=arguments[arguments.length-1];this.toggleView(true,f);return this;},_show:function(){this.setStyle("display","");},_isHidden:function(){return e.DOM.getStyle(this._node,"display")==="none";},toggleView:function(f,g){this._toggleView.apply(this,arguments);},_toggleView:function(f,g){g=arguments[arguments.length-1];if(typeof f!="boolean"){f=(this._isHidden())?1:0;}if(f){this._show();}else{this._hide();}if(typeof g=="function"){g.call(this);}return this;},hide:function(f){f=arguments[arguments.length-1];this.toggleView(false,f);return this;},_hide:function(){this.setStyle("display","none");}});e.NodeList.importMethod(e.Node.prototype,["show","hide","toggleView"]);if(!e.config.doc.documentElement.hasAttribute){e.Node.prototype.hasAttribute=function(f){if(f==="value"){if(this.get("value")!==""){return true;}}return !!(this._node.attributes[f]&&this._node.attributes[f].specified);};}e.Node.prototype.focus=function(){try{this._node.focus();}catch(f){}return this;};e.Node.ATTRS.type={setter:function(g){if(g==="hidden"){try{this._node.type="hidden";}catch(f){this.setStyle("display","none");this._inputType="hidden";}}else{try{this._node.type=g;}catch(f){}}return g;},getter:function(){return this._inputType||this._node.type;},_bypassProxy:true};if(e.config.doc.createElement("form").elements.nodeType){e.Node.ATTRS.elements={getter:function(){return this.all("input, textarea, button, select");}};}e.mix(e.Node.prototype,{_initData:function(){if(!("_data" in this)){this._data={};}},getData:function(g){this._initData();var h=this._data,f=h;if(arguments.length){if(g in h){f=h[g];}else{f=this._getDataAttribute(g);}}else{if(typeof h=="object"&&h!==null){f={};e.Object.each(h,function(i,j){f[j]=i;});f=this._getDataAttributes(f);}}return f;},_getDataAttributes:function(k){k=k||{};var l=0,j=this._node.attributes,f=j.length,m=this.DATA_PREFIX,h=m.length,g;while(l<f){g=j[l].name;if(g.indexOf(m)===0){g=g.substr(h);if(!(g in k)){k[g]=this._getDataAttribute(g);}}l+=1;}return k;},_getDataAttribute:function(g){var g=this.DATA_PREFIX+g,h=this._node,f=h.attributes,i=f&&f[g]&&f[g].value;return i;},setData:function(f,g){this._initData();if(arguments.length>1){this._data[f]=g;}else{this._data=f;}return this;},clearData:function(f){if("_data" in this){if(typeof f!="undefined"){delete this._data[f];}else{delete this._data;}}return this;}});e.mix(e.NodeList.prototype,{getData:function(g){var f=(arguments.length)?[g]:[];return this._invoke("getData",f,true);},setData:function(g,h){var f=(arguments.length>1)?[g,h]:[g];return this._invoke("setData",f);},clearData:function(g){var f=(arguments.length)?[g]:[];return this._invoke("clearData",[g]);}});},"@VERSION@",{requires:["dom-base","node-core","event-base"]});(function(){var a=YUI.Env;if(!a._ready){a._ready=function(){a.DOMReady=true;a.remove(YUI.config.doc,"DOMContentLoaded",a._ready);};a.add(YUI.config.doc,"DOMContentLoaded",a._ready);}})();YUI.add("event-base",function(e){e.publish("domready",{fireOnce:true,async:true});if(YUI.Env.DOMReady){e.fire("domready");}else{e.Do.before(function(){e.fire("domready");},YUI.Env,"_ready");}var b=e.UA,d={},a={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9,63272:46,63273:36,63275:35},c=function(h){if(!h){return h;}try{if(h&&3==h.nodeType){h=h.parentNode;}}catch(g){return null;}return e.one(h);},f=function(g,h,i){this._event=g;this._currentTarget=h;this._wrapper=i||d;this.init();};e.extend(f,Object,{init:function(){var i=this._event,j=this._wrapper.overrides,g=i.pageX,l=i.pageY,k,h=this._currentTarget;this.altKey=i.altKey;this.ctrlKey=i.ctrlKey;this.metaKey=i.metaKey;this.shiftKey=i.shiftKey;this.type=(j&&j.type)||i.type;this.clientX=i.clientX;this.clientY=i.clientY;this.pageX=g;this.pageY=l;k=i.keyCode||i.charCode;if(b.webkit&&(k in a)){k=a[k];}this.keyCode=k;this.charCode=k;this.which=i.which||i.charCode||k;this.button=this.which;this.target=c(i.target);this.currentTarget=c(h);this.relatedTarget=c(i.relatedTarget);if(i.type=="mousewheel"||i.type=="DOMMouseScroll"){this.wheelDelta=(i.detail)?(i.detail*-1):Math.round(i.wheelDelta/80)||((i.wheelDelta<0)?-1:1);}if(this._touch){this._touch(i,h,this._wrapper);}},stopPropagation:function(){this._event.stopPropagation();this._wrapper.stopped=1;this.stopped=1;},stopImmediatePropagation:function(){var g=this._event;if(g.stopImmediatePropagation){g.stopImmediatePropagation();}else{this.stopPropagation();}this._wrapper.stopped=2;this.stopped=2;},preventDefault:function(g){var h=this._event;h.preventDefault();h.returnValue=g||false;this._wrapper.prevented=1;this.prevented=1;},halt:function(g){if(g){this.stopImmediatePropagation();}else{this.stopPropagation();}this.preventDefault();}});f.resolve=c;e.DOM2EventFacade=f;e.DOMEventFacade=f;(function(){e.Env.evt.dom_wrappers={};e.Env.evt.dom_map={};var q=e.Env.evt,i=e.config,n=i.win,s=YUI.Env.add,l=YUI.Env.remove,p=function(){YUI.Env.windowLoaded=true;e.Event._load();l(n,"load",p);},g=function(){e.Event._unload();},j="domready",m="~yui|2|compat~",o=function(u){try{return(u&&typeof u!=="string"&&e.Lang.isNumber(u.length)&&!u.tagName&&!u.alert);}catch(t){return false;}},h=e.CustomEvent.prototype._delete,k=function(u){var t=h.apply(this,arguments);if(!this.subCount&&!this.afterCount){e.Event._clean(this);}return t;},r=function(){var v=false,w=0,u=[],x=q.dom_wrappers,t=null,y=q.dom_map;return{POLL_RETRYS:1000,POLL_INTERVAL:40,lastError:null,_interval:null,_dri:null,DOMReady:false,startInterval:function(){if(!r._interval){r._interval=setInterval(r._poll,r.POLL_INTERVAL);}},onAvailable:function(z,D,H,A,E,G){var F=e.Array(z),B,C;for(B=0;B<F.length;B=B+1){u.push({id:F[B],fn:D,obj:H,override:A,checkReady:E,compat:G});}w=this.POLL_RETRYS;setTimeout(r._poll,0);C=new e.EventHandle({_delete:function(){if(C.handle){C.handle.detach();return;}var J,I;for(J=0;J<F.length;J++){for(I=0; I<u.length;I++){if(F[J]===u[I].id){u.splice(I,1);}}}}});return C;},onContentReady:function(D,B,C,A,z){return r.onAvailable(D,B,C,A,true,z);},attach:function(C,B,A,z){return r._attach(e.Array(arguments,0,true));},_createWrapper:function(F,E,z,A,D){var C,G=e.stamp(F),B="event:"+G+E;if(false===D){B+="native";}if(z){B+="capture";}C=x[B];if(!C){C=e.publish(B,{silent:true,bubbles:false,contextFn:function(){if(A){return C.el;}else{C.nodeRef=C.nodeRef||e.one(C.el);return C.nodeRef;}}});C.overrides={};C.el=F;C.key=B;C.domkey=G;C.type=E;C.fn=function(H){C.fire(r.getEvent(H,F,(A||(false===D))));};C.capture=z;if(F==n&&E=="load"){C.fireOnce=true;t=B;}C._delete=k;x[B]=C;y[G]=y[G]||{};y[G][B]=C;s(F,E,C.fn,z);}return C;},_attach:function(F,E){var K,M,C,J,z,B=false,D,G=F[0],H=F[1],A=F[2]||n,N=E&&E.facade,L=E&&E.capture,I=E&&E.overrides;if(F[F.length-1]===m){K=true;}if(!H||!H.call){return false;}if(o(A)){M=[];e.each(A,function(P,O){F[2]=P;M.push(r._attach(F.slice(),E));});return new e.EventHandle(M);}else{if(e.Lang.isString(A)){if(K){C=e.DOM.byId(A);}else{C=e.Selector.query(A);switch(C.length){case 0:C=null;break;case 1:C=C[0];break;default:F[2]=C;return r._attach(F,E);}}if(C){A=C;}else{D=r.onAvailable(A,function(){D.handle=r._attach(F,E);},r,true,false,K);return D;}}}if(!A){return false;}if(e.Node&&e.instanceOf(A,e.Node)){A=e.Node.getDOMNode(A);}J=r._createWrapper(A,G,L,K,N);if(I){e.mix(J.overrides,I);}if(A==n&&G=="load"){if(YUI.Env.windowLoaded){B=true;}}if(K){F.pop();}z=F[3];D=J._on(H,z,(F.length>4)?F.slice(4):null);if(B){J.fire();}return D;},detach:function(G,H,B,E){var F=e.Array(arguments,0,true),J,C,I,D,z,A;if(F[F.length-1]===m){J=true;}if(G&&G.detach){return G.detach();}if(typeof B=="string"){if(J){B=e.DOM.byId(B);}else{B=e.Selector.query(B);C=B.length;if(C<1){B=null;}else{if(C==1){B=B[0];}}}}if(!B){return false;}if(B.detach){F.splice(2,1);return B.detach.apply(B,F);}else{if(o(B)){I=true;for(D=0,C=B.length;D<C;++D){F[2]=B[D];I=(e.Event.detach.apply(e.Event,F)&&I);}return I;}}if(!G||!H||!H.call){return r.purgeElement(B,false,G);}z="event:"+e.stamp(B)+G;A=x[z];if(A){return A.detach(H);}else{return false;}},getEvent:function(C,A,z){var B=C||n.event;return(z)?B:new e.DOMEventFacade(B,A,x["event:"+e.stamp(A)+C.type]);},generateId:function(z){return e.DOM.generateID(z);},_isValidCollection:o,_load:function(z){if(!v){v=true;if(e.fire){e.fire(j);}r._poll();}},_poll:function(){if(r.locked){return;}if(e.UA.ie&&!YUI.Env.DOMReady){r.startInterval();return;}r.locked=true;var A,z,E,B,D,F,C=!v;if(!C){C=(w>0);}D=[];F=function(I,J){var H,G=J.override;try{if(J.compat){if(J.override){if(G===true){H=J.obj;}else{H=G;}}else{H=I;}J.fn.call(H,J.obj);}else{H=J.obj||e.one(I);J.fn.apply(H,(e.Lang.isArray(G))?G:[]);}}catch(K){}};for(A=0,z=u.length;A<z;++A){E=u[A];if(E&&!E.checkReady){B=(E.compat)?e.DOM.byId(E.id):e.Selector.query(E.id,null,true);if(B){F(B,E);u[A]=null;}else{D.push(E);}}}for(A=0,z=u.length;A<z;++A){E=u[A];if(E&&E.checkReady){B=(E.compat)?e.DOM.byId(E.id):e.Selector.query(E.id,null,true);if(B){if(v||(B.get&&B.get("nextSibling"))||B.nextSibling){F(B,E);u[A]=null;}}else{D.push(E);}}}w=(D.length===0)?0:w-1;if(C){r.startInterval();}else{clearInterval(r._interval);r._interval=null;}r.locked=false;return;},purgeElement:function(B,z,G){var E=(e.Lang.isString(B))?e.Selector.query(B,null,true):B,H=r.getListeners(E,G),D,F,C,A;if(z&&E){H=H||[];C=e.Selector.query("*",E);D=0;F=C.length;for(;D<F;++D){A=r.getListeners(C[D],G);if(A){H=H.concat(A);}}}if(H){for(D=0,F=H.length;D<F;++D){H[D].detachAll();}}},_clean:function(B){var A=B.key,z=B.domkey;l(B.el,B.type,B.fn,B.capture);delete x[A];delete e._yuievt.events[A];if(y[z]){delete y[z][A];if(!e.Object.size(y[z])){delete y[z];}}},getListeners:function(D,C){var E=e.stamp(D,true),z=y[E],B=[],A=(C)?"event:"+E+C:null,F=q.plugins;if(!z){return null;}if(A){if(F[C]&&F[C].eventDef){A+="_synth";}if(z[A]){B.push(z[A]);}A+="native";if(z[A]){B.push(z[A]);}}else{e.each(z,function(H,G){B.push(H);});}return(B.length)?B:null;},_unload:function(z){e.each(x,function(B,A){if(B.type=="unload"){B.fire(z);}B.detachAll();});l(n,"unload",g);},nativeAdd:s,nativeRemove:l};}();e.Event=r;if(i.injected||YUI.Env.windowLoaded){p();}else{s(n,"load",p);}if(e.UA.ie){e.on(j,r._poll);}s(n,"unload",g);r.Custom=e.CustomEvent;r.Subscriber=e.Subscriber;r.Target=e.EventTarget;r.Handle=e.EventHandle;r.Facade=e.EventFacade;r._poll();})();e.Env.evt.plugins.available={on:function(i,h,k,j){var g=arguments.length>4?e.Array(arguments,4,true):null;return e.Event.onAvailable.call(e.Event,k,h,j,g);}};e.Env.evt.plugins.contentready={on:function(i,h,k,j){var g=arguments.length>4?e.Array(arguments,4,true):null;return e.Event.onContentReady.call(e.Event,k,h,j,g);}};},"@VERSION@",{requires:["event-custom-base"]});YUI.add("pluginhost-base",function(c){var a=c.Lang;function b(){this._plugins={};}b.prototype={plug:function(g,d){var e,h,f;if(a.isArray(g)){for(e=0,h=g.length;e<h;e++){this.plug(g[e]);}}else{if(g&&!a.isFunction(g)){d=g.cfg;g=g.fn;}if(g&&g.NS){f=g.NS;d=d||{};d.host=this;if(this.hasPlugin(f)){this[f].setAttrs(d);}else{this[f]=new g(d);this._plugins[f]=g;}}}return this;},unplug:function(f){var e=f,d=this._plugins;if(f){if(a.isFunction(f)){e=f.NS;if(e&&(!d[e]||d[e]!==f)){e=null;}}if(e){if(this[e]){this[e].destroy();delete this[e];}if(d[e]){delete d[e];}}}else{for(e in this._plugins){if(this._plugins.hasOwnProperty(e)){this.unplug(e);}}}return this;},hasPlugin:function(d){return(this._plugins[d]&&this[d]);},_initPlugins:function(d){this._plugins=this._plugins||{};if(this._initConfigPlugins){this._initConfigPlugins(d);}},_destroyPlugins:function(){this.unplug();}};c.namespace("Plugin").Host=b;},"@VERSION@",{requires:["yui-base"]});YUI.add("pluginhost-config",function(c){var b=c.Plugin.Host,a=c.Lang;b.prototype._initConfigPlugins=function(e){var g=(this._getClasses)?this._getClasses():[this.constructor],d=[],h={},f,j,l,m,k;for(j=g.length-1;j>=0;j--){f=g[j];m=f._UNPLUG;if(m){c.mix(h,m,true);}l=f._PLUG;if(l){c.mix(d,l,true);}}for(k in d){if(d.hasOwnProperty(k)){if(!h[k]){this.plug(d[k]); }}}if(e&&e.plugins){this.plug(e.plugins);}};b.plug=function(e,j,g){var k,h,d,f;if(e!==c.Base){e._PLUG=e._PLUG||{};if(!a.isArray(j)){if(g){j={fn:j,cfg:g};}j=[j];}for(h=0,d=j.length;h<d;h++){k=j[h];f=k.NAME||k.fn.NAME;e._PLUG[f]=k;}}};b.unplug=function(e,h){var j,g,d,f;if(e!==c.Base){e._UNPLUG=e._UNPLUG||{};if(!a.isArray(h)){h=[h];}for(g=0,d=h.length;g<d;g++){j=h[g];f=j.NAME;if(!e._PLUG[f]){e._UNPLUG[f]=j;}else{delete e._PLUG[f];}}}};},"@VERSION@",{requires:["pluginhost-base"]});YUI.add("event-delegate",function(a){var c=a.Array,h=a.Lang,b=h.isString,i=h.isObject,e=h.isArray,g=a.Selector.test,d=a.Env.evt.handles;function f(u,w,l,k){var s=c(arguments,0,true),t=b(l)?l:null,r,o,j,n,v,m,q,x,p;if(i(u)){x=[];if(e(u)){for(m=0,q=u.length;m<q;++m){s[0]=u[m];x.push(a.delegate.apply(a,s));}}else{s.unshift(null);for(m in u){if(u.hasOwnProperty(m)){s[0]=m;s[1]=u[m];x.push(a.delegate.apply(a,s));}}}return new a.EventHandle(x);}r=u.split(/\|/);if(r.length>1){v=r.shift();s[0]=u=r.shift();}o=a.Node.DOM_EVENTS[u];if(i(o)&&o.delegate){p=o.delegate.apply(o,arguments);}if(!p){if(!u||!w||!l||!k){return;}j=(t)?a.Selector.query(t,null,true):l;if(!j&&b(l)){p=a.on("available",function(){a.mix(p,a.delegate.apply(a,s),true);},l);}if(!p&&j){s.splice(2,2,j);p=a.Event._attach(s,{facade:false});p.sub.filter=k;p.sub._notify=f.notifySub;}}if(p&&v){n=d[v]||(d[v]={});n=n[u]||(n[u]=[]);n.push(p);}return p;}f.notifySub=function(q,l,p){l=l.slice();if(this.args){l.push.apply(l,this.args);}var o=f._applyFilter(this.filter,l,p),n,m,j,k;if(o){o=c(o);n=l[0]=new a.DOMEventFacade(l[0],p.el,p);n.container=a.one(p.el);for(m=0,j=o.length;m<j&&!n.stopped;++m){n.currentTarget=a.one(o[m]);k=this.fn.apply(this.context||n.currentTarget,l);if(k===false){break;}}return k;}};f.compileFilter=a.cached(function(j){return function(l,k){return g(l._node,j,k.currentTarget._node);};});f._applyFilter=function(n,l,q){var p=l[0],j=q.el,o=p.target||p.srcElement,k=[],m=false;if(o.nodeType===3){o=o.parentNode;}l.unshift(o);if(b(n)){while(o){m=(o===j);if(g(o,n,(m?null:j))){k.push(o);}if(m){break;}o=o.parentNode;}}else{l[0]=a.one(o);l[1]=new a.DOMEventFacade(p,j,q);while(o){if(n.apply(l[0],l)){k.push(o);}if(o===j){break;}o=o.parentNode;l[0]=a.one(o);}l[1]=p;}if(k.length<=1){k=k[0];}l.shift();return k;};a.delegate=a.Event.delegate=f;},"@VERSION@",{requires:["node-base"]});YUI.add("node-event-delegate",function(a){a.Node.prototype.delegate=function(d){var c=a.Array(arguments,0,true),b=(a.Lang.isObject(d)&&!a.Lang.isArray(d))?1:2;c.splice(b,0,this._node);return a.delegate.apply(a,c);};},"@VERSION@",{requires:["node-base","event-delegate"]});YUI.add("node-pluginhost",function(a){a.Node.plug=function(){var b=a.Array(arguments);b.unshift(a.Node);a.Plugin.Host.plug.apply(a.Base,b);return a.Node;};a.Node.unplug=function(){var b=a.Array(arguments);b.unshift(a.Node);a.Plugin.Host.unplug.apply(a.Base,b);return a.Node;};a.mix(a.Node,a.Plugin.Host,false,null,1);a.NodeList.prototype.plug=function(){var b=arguments;a.NodeList.each(this,function(c){a.Node.prototype.plug.apply(a.one(c),b);});};a.NodeList.prototype.unplug=function(){var b=arguments;a.NodeList.each(this,function(c){a.Node.prototype.unplug.apply(a.one(c),b);});};},"@VERSION@",{requires:["node-base","pluginhost"]});YUI.add("node-screen",function(a){a.each(["winWidth","winHeight","docWidth","docHeight","docScrollX","docScrollY"],function(b){a.Node.ATTRS[b]={getter:function(){var c=Array.prototype.slice.call(arguments);c.unshift(a.Node.getDOMNode(this));return a.DOM[b].apply(this,c);}};});a.Node.ATTRS.scrollLeft={getter:function(){var b=a.Node.getDOMNode(this);return("scrollLeft" in b)?b.scrollLeft:a.DOM.docScrollX(b);},setter:function(c){var b=a.Node.getDOMNode(this);if(b){if("scrollLeft" in b){b.scrollLeft=c;}else{if(b.document||b.nodeType===9){a.DOM._getWin(b).scrollTo(c,a.DOM.docScrollY(b));}}}else{}}};a.Node.ATTRS.scrollTop={getter:function(){var b=a.Node.getDOMNode(this);return("scrollTop" in b)?b.scrollTop:a.DOM.docScrollY(b);},setter:function(c){var b=a.Node.getDOMNode(this);if(b){if("scrollTop" in b){b.scrollTop=c;}else{if(b.document||b.nodeType===9){a.DOM._getWin(b).scrollTo(a.DOM.docScrollX(b),c);}}}else{}}};a.Node.importMethod(a.DOM,["getXY","setXY","getX","setX","getY","setY","swapXY"]);a.Node.ATTRS.region={getter:function(){var b=this.getDOMNode(),c;if(b&&!b.tagName){if(b.nodeType===9){b=b.documentElement;}}if(a.DOM.isWindow(b)){c=a.DOM.viewportRegion(b);}else{c=a.DOM.region(b);}return c;}};a.Node.ATTRS.viewportRegion={getter:function(){return a.DOM.viewportRegion(a.Node.getDOMNode(this));}};a.Node.importMethod(a.DOM,"inViewportRegion");a.Node.prototype.intersect=function(b,d){var c=a.Node.getDOMNode(this);if(a.instanceOf(b,a.Node)){b=a.Node.getDOMNode(b);}return a.DOM.intersect(c,b,d);};a.Node.prototype.inRegion=function(b,d,e){var c=a.Node.getDOMNode(this);if(a.instanceOf(b,a.Node)){b=a.Node.getDOMNode(b);}return a.DOM.inRegion(c,b,d,e);};},"@VERSION@",{requires:["node-base","dom-screen"]});YUI.add("node-style",function(a){(function(b){b.mix(b.Node.prototype,{setStyle:function(c,d){b.DOM.setStyle(this._node,c,d);return this;},setStyles:function(c){b.DOM.setStyles(this._node,c);return this;},getStyle:function(c){return b.DOM.getStyle(this._node,c);},getComputedStyle:function(c){return b.DOM.getComputedStyle(this._node,c);}});b.NodeList.importMethod(b.Node.prototype,["getStyle","getComputedStyle","setStyle","setStyles"]);})(a);},"@VERSION@",{requires:["dom-style","node-base"]});YUI.add("querystring-stringify-simple",function(c){var b=c.namespace("QueryString"),a=encodeURIComponent;b.stringify=function(j,k){var d=[],h=k&&k.arrayKey?true:false,g,f,e;for(g in j){if(j.hasOwnProperty(g)){if(c.Lang.isArray(j[g])){for(f=0,e=j[g].length;f<e;f++){d.push(a(h?g+"[]":g)+"="+a(j[g][f]));}}else{d.push(a(g)+"="+a(j[g]));}}}return d.join("&");};},"@VERSION@",{requires:["yui-base"]});YUI.add("io-base",function(h){var c=["start","complete","end","success","failure","progress"],b=["status","statusText","responseText","responseXML"],f=h.config.win,e=f.XMLHttpRequest,g=f.XDomainRequest,d=0; function a(i){var j=this;j._uid="io:"+d++;j._init(i);h.io._map[j._uid]=j;}a.prototype={_id:0,_headers:{"X-Requested-With":"XMLHttpRequest"},_timeout:{},_init:function(k){var m=this,l,j;m.cfg=k||{};h.augment(m,h.EventTarget);for(l=0,j=c.length;l<j;++l){m.publish("io:"+c[l],h.merge({broadcast:1},k));m.publish("io-trn:"+c[l],k);}},_create:function(j,p){var o=this,m={id:h.Lang.isNumber(p)?p:o._id++,uid:o._uid},k=j.xdr,i=k&&k.use,l=(k&&k.use==="native"&&g),n=o._transport;if(!i){i=(j.form&&j.form.upload)?"iframe":"xhr";}switch(i){case"native":case"xhr":m.c=l?new g():e?new e():new ActiveXObject("Microsoft.XMLHTTP");if(f&&f.FormData&&j.data instanceof FormData){m.c.upload.onprogress=function(q){o.progress(m,q,j);};m.c.onload=function(q){o.load(m,q,j);};m.c.onerror=function(q){o.error(m,q,j);};m.upload=true;}m.transport=l?true:false;break;default:m.c=(n&&n[i])||{};m.transport=true;}return m;},_destroy:function(i){if(f&&!i.transport){if(e&&!i.upload){i.c.onreadystatechange=null;}else{if(i.upload){i.c.upload.onprogress=null;i.c.onload=null;i.c.onerror=null;}else{if(h.UA.ie&&!i.e){i.c.abort();}}}}i=i.c=null;},_evt:function(m,j,i){var o=this,k,p=i["arguments"],q=o.cfg.emitFacade,l="io:"+m,n="io-trn:"+m;if(j.e){j.c={status:0,statusText:j.e};}k=[q?{id:j.id,data:j.c,cfg:i,"arguments":p}:j.id];if(!q){if(m===c[0]||m===c[2]&&p){if(p){k.push(p);}}else{if(j.evt){k.push(j.evt);}else{k.push(j.c);}if(p){k.push(p);}}}k.unshift(l);o.fire.apply(o,k);if(i.on){k[0]=n;o.once(n,i.on[m],i.context||h);o.fire.apply(o,k);}},start:function(j,i){this._evt(c[0],j,i);},complete:function(j,i){this._evt(c[1],j,i);},end:function(j,i){this._evt(c[2],j,i);this._destroy(j);},success:function(j,i){this._evt(c[3],j,i);this.end(j,i);},failure:function(j,i){this._evt(c[4],j,i);this.end(j,i);},progress:function(k,j,i){k.evt=j;this._evt(c[5],k,i);},load:function(k,j,i){k.evt=j.target;this._evt(c[1],k,i);},error:function(k,j,i){k.evt=j;this._evt(c[4],k,i);},_retry:function(k,j,i){this._destroy(k);i.xdr.use="flash";return this.send(j,i,k.id);},_concat:function(i,j){i+=(i.indexOf("?")===-1?"?":"&")+j;return i;},setHeader:function(i,j){if(j){this._headers[i]=j;}else{delete this._headers[i];}},_setHeaders:function(j,i){i=h.merge(this._headers,i);h.Object.each(i,function(l,k){if(l!=="disable"){j.setRequestHeader(k,i[k]);}});},_startTimeout:function(j,i){var k=this;k._timeout[j.id]=f.setTimeout(function(){k._abort(j,"timeout");},i);},_clearTimeout:function(i){f.clearTimeout(this._timeout[i]);delete this._timeout[i];},_result:function(l,j){var i;try{i=l.c.status;}catch(k){i=0;}if(i>=200&&i<300||i===304||i===1223){this.success(l,j);}else{this.failure(l,j);}},_rS:function(j,i){var k=this;if(j.c.readyState===4){if(i.timeout){k._clearTimeout(j.id);}f.setTimeout(function(){k.complete(j,i);k._result(j,i);},0);}},_abort:function(j,i){if(j&&j.c){j.e=i;j.c.abort();}},send:function(l,m,k){var n,j,q,r,v,p,t=this,w=l,o={};m=m?h.Object(m):{};n=t._create(m,k);j=m.method?m.method.toUpperCase():"GET";v=m.sync;p=m.data;if((h.Lang.isObject(p)&&!p.nodeType)&&!n.upload){p=h.QueryString.stringify(p);}if(m.form){if(m.form.upload){return t.upload(n,l,m);}else{p=t._serialize(m.form,p);}}if(p){switch(j){case"GET":case"HEAD":case"DELETE":w=t._concat(w,p);p="";break;case"POST":case"PUT":m.headers=h.merge({"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},m.headers);break;}}if(n.transport){return t.xdr(w,n,m);}if(!v&&!n.upload){n.c.onreadystatechange=function(){t._rS(n,m);};}try{n.c.open(j,w,!v,m.username||null,m.password||null);t._setHeaders(n.c,m.headers||{});t.start(n,m);if(m.xdr&&m.xdr.credentials){if(!h.UA.ie){n.c.withCredentials=true;}}n.c.send(p);if(v){for(q=0,r=b.length;q<r;++q){o[b[q]]=n.c[b[q]];}o.getAllResponseHeaders=function(){return n.c.getAllResponseHeaders();};o.getResponseHeader=function(i){return n.c.getResponseHeader(i);};t.complete(n,m);t._result(n,m);return o;}}catch(s){if(n.transport){return t._retry(n,l,m);}else{t.complete(n,m);t._result(n,m);}}if(m.timeout){t._startTimeout(n,m.timeout);}return{id:n.id,abort:function(){return n.c?t._abort(n,"abort"):false;},isInProgress:function(){return n.c?(n.c.readyState%4):false;},io:t};}};h.io=function(j,i){var k=h.io._map["io:0"]||new a();return k.send.apply(k,[j,i]);};h.io.header=function(i,j){var k=h.io._map["io:0"]||new a();k.setHeader(i,j);};h.IO=a;h.io._map={};},"@VERSION@",{requires:["event-custom-base","querystring-stringify-simple"]});YUI.add("json-parse",function(Y){function fromGlobal(ref){return(Y.config.win||this||{})[ref];}var _JSON=fromGlobal("JSON"),Native=(Object.prototype.toString.call(_JSON)==="[object JSON]"&&_JSON),useNative=!!Native,_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){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){if(typeof s!=="string"){s+="";}return Native&&Y.JSON.useNativeParse?Native.parse(s,reviver):_parse(s,reviver);};function workingNative(k,v){return k==="ok"?true:v;}if(Native){try{useNative=(Native.parse('{"ok":false}',workingNative)).ok;}catch(e){useNative=false;}}Y.JSON.useNativeParse=useNative;},"@VERSION@",{requires:["yui-base"]});YUI.add("transition",function(b){var i="",h="",f=b.config.doc,r="documentElement",s="transition",k="Transition",m,j,p,a,n,c,l,t,q={},g=["Webkit","Moz"],e={Webkit:"webkitTransitionEnd"},d=function(){this.init.apply(this,arguments); };d._toCamel=function(u){u=u.replace(/-([a-z])/gi,function(w,v){return v.toUpperCase();});return u;};d._toHyphen=function(u){u=u.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g,function(y,x,w,v){var z=((x)?"-"+x.toLowerCase():"")+w;if(v){z+="-"+v.toLowerCase();}return z;});return u;};d.SHOW_TRANSITION="fadeIn";d.HIDE_TRANSITION="fadeOut";d.useNative=false;b.Array.each(g,function(v){var u=v+k;if(u in f[r].style){i=v;h=d._toHyphen(v)+"-";d.useNative=true;d.supported=true;d._VENDOR_PREFIX=v;}});k=i+k;m=i+"TransitionProperty";j=h+"transition-property";p=h+"transition-duration";a=h+"transition-timing-function";n=h+"transition-delay";c="transitionend";l="on"+i.toLowerCase()+"transitionend";c=e[i]||c;t=i+"Transform";d.fx={};d.toggles={};d._hasEnd={};d._reKeywords=/^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i;b.Node.DOM_EVENTS[c]=1;d.NAME="transition";d.DEFAULT_EASING="ease";d.DEFAULT_DURATION=0.5;d.DEFAULT_DELAY=0;d._nodeAttrs={};d.prototype={constructor:d,init:function(v,u){var w=this;w._node=v;if(!w._running&&u){w._config=u;v._transition=w;w._duration=("duration" in u)?u.duration:w.constructor.DEFAULT_DURATION;w._delay=("delay" in u)?u.delay:w.constructor.DEFAULT_DELAY;w._easing=u.easing||w.constructor.DEFAULT_EASING;w._count=0;w._running=false;}return w;},addProperty:function(v,x){var A=this,y=this._node,C=b.stamp(y),B=b.one(y),F=d._nodeAttrs[C],z,E,u,D,w;if(!F){F=d._nodeAttrs[C]={};}D=F[v];if(x&&x.value!==undefined){w=x.value;}else{if(x!==undefined){w=x;x=q;}}if(typeof w==="function"){w=w.call(B,B);}if(D&&D.transition){if(D.transition!==A){D.transition._count--;}}A._count++;u=((typeof x.duration!="undefined")?x.duration:A._duration)||0.0001;F[v]={value:w,duration:u,delay:(typeof x.delay!="undefined")?x.delay:A._delay,easing:x.easing||A._easing,transition:A};z=b.DOM.getComputedStyle(y,v);E=(typeof w==="string")?z:parseFloat(z);if(d.useNative&&E===w){setTimeout(function(){A._onNativeEnd.call(y,{propertyName:v,elapsedTime:u});},u*1000);}},removeProperty:function(w){var v=this,u=d._nodeAttrs[b.stamp(v._node)];if(u&&u[w]){delete u[w];v._count--;}},initAttrs:function(v){var u,w=this._node;if(v.transform&&!v[t]){v[t]=v.transform;delete v.transform;}for(u in v){if(v.hasOwnProperty(u)&&!d._reKeywords.test(u)){this.addProperty(u,v[u]);if(w.style[u]===""){b.DOM.setStyle(w,u,b.DOM.getComputedStyle(w,u));}}}},run:function(y){var x=this,v=x._node,u=x._config,w={type:"transition:start",config:u};if(!x._running){x._running=true;if(u.on&&u.on.start){u.on.start.call(b.one(v),w);}x.initAttrs(x._config);x._callback=y;x._start();}return x;},_start:function(){this._runNative();},_prepDur:function(u){u=parseFloat(u);return u+"s";},_runNative:function(w){var C=this,x=C._node,E=b.stamp(x),v=x.style,A=x.ownerDocument.defaultView.getComputedStyle(x),I=d._nodeAttrs[E],y="",J=A[d._toCamel(j)],H=j+": ",B=p+": ",G=a+": ",D=n+": ",z,F,u;if(J!=="all"){H+=J+",";B+=A[d._toCamel(p)]+",";G+=A[d._toCamel(a)]+",";D+=A[d._toCamel(n)]+",";}for(u in I){z=d._toHyphen(u);F=I[u];if((F=I[u])&&F.transition===C){if(u in x.style){B+=C._prepDur(F.duration)+",";D+=C._prepDur(F.delay)+",";G+=(F.easing)+",";H+=z+",";y+=z+": "+F.value+"; ";}else{this.removeProperty(u);}}}H=H.replace(/,$/,";");B=B.replace(/,$/,";");G=G.replace(/,$/,";");D=D.replace(/,$/,";");if(!d._hasEnd[E]){x.addEventListener(c,C._onNativeEnd,"");d._hasEnd[E]=true;}v.cssText+=H+B+G+D+y;},_end:function(u){var y=this,w=y._node,A=y._callback,v=y._config,x={type:"transition:end",config:v,elapsedTime:u},z=b.one(w);y._running=false;y._callback=null;if(w){if(v.on&&v.on.end){setTimeout(function(){v.on.end.call(z,x);if(A){A.call(z,x);}},1);}else{if(A){setTimeout(function(){A.call(z,x);},1);}}}},_endNative:function(u){var v=this._node,w=v.ownerDocument.defaultView.getComputedStyle(v,"")[d._toCamel(j)];u=d._toHyphen(u);if(typeof w==="string"){w=w.replace(new RegExp("(?:^|,\\s)"+u+",?"),",");w=w.replace(/^,|,$/,"");v.style[k]=w;}},_onNativeEnd:function(B){var x=this,A=b.stamp(x),u=B,v=d._toCamel(u.propertyName),E=u.elapsedTime,D=d._nodeAttrs[A],C=D[v],y=(C)?C.transition:null,z,w;if(y){y.removeProperty(v);y._endNative(v);w=y._config[v];z={type:"propertyEnd",propertyName:v,elapsedTime:E,config:w};if(w&&w.on&&w.on.end){w.on.end.call(b.one(x),z);}if(y._count<=0){y._end(E);x.style[m]="";}}},destroy:function(){var v=this,u=v._node;if(u){u.removeEventListener(c,v._onNativeEnd,false);v._node=null;}}};b.Transition=d;b.TransitionNative=d;b.Node.prototype.transition=function(w,v,A){var u=d._nodeAttrs[b.stamp(this._node)],y=(u)?u.transition||null:null,x,z;if(typeof w==="string"){if(typeof v==="function"){A=v;v=null;}x=d.fx[w];if(v&&typeof v!=="boolean"){v=b.clone(v);for(z in x){if(x.hasOwnProperty(z)){if(!(z in v)){v[z]=x[z];}}}}else{v=x;}}else{A=v;v=w;}if(y&&!y._running){y.init(this,v);}else{y=new d(this._node,v);}y.run(A);return this;};b.Node.prototype.show=function(v,u,w){this._show();if(v&&b.Transition){if(typeof v!=="string"&&!v.push){if(typeof u==="function"){w=u;u=v;}v=d.SHOW_TRANSITION;}this.transition(v,u,w);}return this;};var o=function(v,u,w){return function(){if(u){u.call(v);}if(w){w.apply(v._node,arguments);}};};b.Node.prototype.hide=function(v,u,w){if(v&&b.Transition){if(typeof u==="function"){w=u;u=null;}w=o(this,this._hide,w);if(typeof v!=="string"&&!v.push){if(typeof u==="function"){w=u;u=v;}v=d.HIDE_TRANSITION;}this.transition(v,u,w);}else{this._hide();}return this;};b.NodeList.prototype.transition=function(v,y){var u=this._nodes,w=0,x;while((x=u[w++])){b.one(x).transition(v,y);}return this;};b.Node.prototype.toggleView=function(v,u,w){this._toggles=this._toggles||[];w=arguments[arguments.length-1];if(typeof v=="boolean"){u=v;v=null;}v=v||b.Transition.DEFAULT_TOGGLE;if(typeof u=="undefined"&&v in this._toggles){u=!this._toggles[v];}u=(u)?1:0;if(u){this._show();}else{w=o(this,this._hide,w);}this._toggles[v]=u;this.transition(b.Transition.toggles[v][u],w);return this;};b.NodeList.prototype.toggleView=function(w,u,z){var v=this._nodes,x=0,y;while((y=v[x++])){b.one(y).toggleView(w,u,z); }return this;};b.mix(d.fx,{fadeOut:{opacity:0,duration:0.5,easing:"ease-out"},fadeIn:{opacity:1,duration:0.5,easing:"ease-in"},sizeOut:{height:0,width:0,duration:0.75,easing:"ease-out"},sizeIn:{height:function(u){return u.get("scrollHeight")+"px";},width:function(u){return u.get("scrollWidth")+"px";},duration:0.5,easing:"ease-in",on:{start:function(){var u=this.getStyle("overflow");if(u!=="hidden"){this.setStyle("overflow","hidden");this._transitionOverflow=u;}},end:function(){if(this._transitionOverflow){this.setStyle("overflow",this._transitionOverflow);delete this._transitionOverflow;}}}}});b.mix(d.toggles,{size:["sizeOut","sizeIn"],fade:["fadeOut","fadeIn"]});d.DEFAULT_TOGGLE="fade";},"@VERSION@",{requires:["node-style"]});YUI.add("selector-css2",function(g){var h="parentNode",d="tagName",e="attributes",a="combinator",f="pseudos",c=g.Selector,b={_reRegExpTokens:/([\^\$\?\[\]\*\+\-\.\(\)\|\\])/,SORT_RESULTS:true,_re:{attr:/(\[[^\]]*\])/g,esc:/\\[:\[\]\(\)#\.\'\>+~"]/gi,pseudos:/(\([^\)]*\))/g},_isXML:(function(){var i=(g.config.doc.createElement("div").tagName!=="DIV");return i;}()),shorthand:{"\\#(-?[_a-z0-9]+[-\\w\\uE000]*)":"[id=$1]","\\.(-?[_a-z]+[-\\w\\uE000]*)":"[className~=$1]"},operators:{"":function(j,i){return g.DOM.getAttribute(j,i)!=="";},"~=":"(?:^|\\s+){val}(?:\\s+|$)","|=":"^{val}-?"},pseudos:{"first-child":function(i){return g.DOM._children(i[h])[0]===i;}},_bruteQuery:function(n,r,t){var o=[],i=[],q=c._tokenize(n),m=q[q.length-1],s=g.DOM._getDoc(r),k,j,p,l;if(m){j=m.id;p=m.className;l=m.tagName||"*";if(r.getElementsByTagName){if(j&&(r.all||(r.nodeType===9||g.DOM.inDoc(r)))){i=g.DOM.allById(j,r);}else{if(p){i=r.getElementsByClassName(p);}else{i=r.getElementsByTagName(l);}}}else{k=r.firstChild;while(k){if(k.tagName&&(l==="*"||k.tagName===l)){i.push(k);}k=k.nextSibling||k.firstChild;}}if(i.length){o=c._filterNodes(i,q,t);}}return o;},_filterNodes:function(u,q,s){var z=0,y,A=q.length,t=A-1,p=[],w=u[0],D=w,B=g.Selector.getters,o,x,m,r,k,v,l,C;for(z=0;(D=w=u[z++]);){t=A-1;r=null;testLoop:while(D&&D.tagName){m=q[t];l=m.tests;y=l.length;if(y&&!k){while((C=l[--y])){o=C[1];if(B[C[0]]){v=B[C[0]](D,C[0]);}else{v=D[C[0]];if(C[0]==="tagName"&&!c._isXML){v=v.toUpperCase();}if(v===undefined&&D.getAttribute){v=D.getAttribute(C[0]);}}if((o==="="&&v!==C[2])||(typeof o!=="string"&&o.test&&!o.test(v))||(!o.test&&typeof o==="function"&&!o(D,C[0],C[2]))){if((D=D[r])){while(D&&(!D.tagName||(m.tagName&&m.tagName!==D.tagName))){D=D[r];}}continue testLoop;}}}t--;if(!k&&(x=m.combinator)){r=x.axis;D=D[r];while(D&&!D.tagName){D=D[r];}if(x.direct){r=null;}}else{p.push(w);if(s){return p;}break;}}}w=D=null;return p;},combinators:{" ":{axis:"parentNode"},">":{axis:"parentNode",direct:true},"+":{axis:"previousSibling",direct:true}},_parsers:[{name:e,re:/^\uE003(-?[a-z]+[\w\-]*)+([~\|\^\$\*!=]=?)?['"]?([^\uE004'"]*)['"]?\uE004/i,fn:function(l,m){var k=l[2]||"",i=c.operators,j=(l[3])?l[3].replace(/\\/g,""):"",n;if((l[1]==="id"&&k==="=")||(l[1]==="className"&&g.config.doc.documentElement.getElementsByClassName&&(k==="~="||k==="="))){m.prefilter=l[1];l[3]=j;m[l[1]]=(l[1]==="id")?l[3]:j;}if(k in i){n=i[k];if(typeof n==="string"){l[3]=j.replace(c._reRegExpTokens,"\\$1");n=new RegExp(n.replace("{val}",l[3]));}l[2]=n;}if(!m.last||m.prefilter!==l[1]){return l.slice(1);}}},{name:d,re:/^((?:-?[_a-z]+[\w-]*)|\*)/i,fn:function(j,k){var i=j[1];if(!c._isXML){i=i.toUpperCase();}k.tagName=i;if(i!=="*"&&(!k.last||k.prefilter)){return[d,"=",i];}if(!k.prefilter){k.prefilter="tagName";}}},{name:a,re:/^\s*([>+~]|\s)\s*/,fn:function(i,j){}},{name:f,re:/^:([\-\w]+)(?:\uE005['"]?([^\uE005]*)['"]?\uE006)*/i,fn:function(i,j){var k=c[f][i[1]];if(k){if(i[2]){i[2]=i[2].replace(/\\/g,"");}return[i[2],k];}else{return false;}}}],_getToken:function(i){return{tagName:null,id:null,className:null,attributes:{},combinator:null,tests:[]};},_tokenize:function(l){l=l||"";l=c._replaceShorthand(g.Lang.trim(l));var k=c._getToken(),q=l,p=[],r=false,n,o,m,j;outer:do{r=false;for(m=0;(j=c._parsers[m++]);){if((n=j.re.exec(l))){if(j.name!==a){k.selector=l;}l=l.replace(n[0],"");if(!l.length){k.last=true;}if(c._attrFilters[n[1]]){n[1]=c._attrFilters[n[1]];}o=j.fn(n,k);if(o===false){r=false;break outer;}else{if(o){k.tests.push(o);}}if(!l.length||j.name===a){p.push(k);k=c._getToken(k);if(j.name===a){k.combinator=g.Selector.combinators[n[1]];}}r=true;}}}while(r&&l.length);if(!r||l.length){p=[];}return p;},_replaceShorthand:function(k){var m=c.shorthand,l=k.match(c._re.esc),n,q,p,o,j;if(l){k=k.replace(c._re.esc,"\uE000");}n=k.match(c._re.attr);q=k.match(c._re.pseudos);if(n){k=k.replace(c._re.attr,"\uE001");}if(q){k=k.replace(c._re.pseudos,"\uE002");}for(p in m){if(m.hasOwnProperty(p)){k=k.replace(new RegExp(p,"gi"),m[p]);}}if(n){for(o=0,j=n.length;o<j;++o){k=k.replace(/\uE001/,n[o]);}}if(q){for(o=0,j=q.length;o<j;++o){k=k.replace(/\uE002/,q[o]);}}k=k.replace(/\[/g,"\uE003");k=k.replace(/\]/g,"\uE004");k=k.replace(/\(/g,"\uE005");k=k.replace(/\)/g,"\uE006");if(l){for(o=0,j=l.length;o<j;++o){k=k.replace("\uE000",l[o]);}}return k;},_attrFilters:{"class":"className","for":"htmlFor"},getters:{href:function(j,i){return g.DOM.getAttribute(j,i);}}};g.mix(g.Selector,b,true);g.Selector.getters.src=g.Selector.getters.rel=g.Selector.getters.href;if(g.Selector.useNative&&g.config.doc.querySelector){g.Selector.shorthand["\\.(-?[_a-z]+[-\\w]*)"]="[class~=$1]";}},"@VERSION@",{requires:["selector-native"]});YUI.add("selector-css3",function(a){a.Selector._reNth=/^(?:([\-]?\d*)(n){1}|(odd|even)$)*([\-+]?\d*)$/;a.Selector._getNth=function(d,o,q,h){a.Selector._reNth.test(o);var m=parseInt(RegExp.$1,10),c=RegExp.$2,j=RegExp.$3,k=parseInt(RegExp.$4,10)||0,p=[],l=a.DOM._children(d.parentNode,q),f;if(j){m=2;f="+";c="n";k=(j==="odd")?1:0;}else{if(isNaN(m)){m=(c)?1:0;}}if(m===0){if(h){k=l.length-k+1;}if(l[k-1]===d){return true;}else{return false;}}else{if(m<0){h=!!h;m=Math.abs(m);}}if(!h){for(var e=k-1,g=l.length;e<g;e+=m){if(e>=0&&l[e]===d){return true;}}}else{for(var e=l.length-k,g=l.length; e>=0;e-=m){if(e<g&&l[e]===d){return true;}}}return false;};a.mix(a.Selector.pseudos,{"root":function(b){return b===b.ownerDocument.documentElement;},"nth-child":function(b,c){return a.Selector._getNth(b,c);},"nth-last-child":function(b,c){return a.Selector._getNth(b,c,null,true);},"nth-of-type":function(b,c){return a.Selector._getNth(b,c,b.tagName);},"nth-last-of-type":function(b,c){return a.Selector._getNth(b,c,b.tagName,true);},"last-child":function(c){var b=a.DOM._children(c.parentNode);return b[b.length-1]===c;},"first-of-type":function(b){return a.DOM._children(b.parentNode,b.tagName)[0]===b;},"last-of-type":function(c){var b=a.DOM._children(c.parentNode,c.tagName);return b[b.length-1]===c;},"only-child":function(c){var b=a.DOM._children(c.parentNode);return b.length===1&&b[0]===c;},"only-of-type":function(c){var b=a.DOM._children(c.parentNode,c.tagName);return b.length===1&&b[0]===c;},"empty":function(b){return b.childNodes.length===0;},"not":function(b,c){return !a.Selector.test(b,c);},"contains":function(b,c){var d=b.innerText||b.textContent||"";return d.indexOf(c)>-1;},"checked":function(b){return(b.checked===true||b.selected===true);},enabled:function(b){return(b.disabled!==undefined&&!b.disabled);},disabled:function(b){return(b.disabled);}});a.mix(a.Selector.operators,{"^=":"^{val}","$=":"{val}$","*=":"{val}"});a.Selector.combinators["~"]={axis:"previousSibling"};},"@VERSION@",{requires:["selector-native","selector-css2"]});YUI.add("yui-log",function(d){var c=d,e="yui:log",a="undefined",b={debug:1,info:1,warn:1,error:1};c.log=function(j,s,g,q){var l,p,n,k,o,i=c,r=i.config,h=(i.fire)?i:YUI.Env.globalEvents;if(r.debug){if(g){p=r.logExclude;n=r.logInclude;if(n&&!(g in n)){l=1;}else{if(n&&(g in n)){l=!n[g];}else{if(p&&(g in p)){l=p[g];}}}}if(!l){if(r.useBrowserConsole){k=(g)?g+": "+j:j;if(i.Lang.isFunction(r.logFn)){r.logFn.call(i,j,s,g);}else{if(typeof console!=a&&console.log){o=(s&&console[s]&&(s in b))?s:"log";console[o](k);}else{if(typeof opera!=a){opera.postError(k);}}}}if(h&&!q){if(h==i&&(!h.getEvent(e))){h.publish(e,{broadcast:2});}h.fire(e,{msg:j,cat:s,src:g});}}}return i;};c.message=function(){return c.log.apply(c,arguments);};},"@VERSION@",{requires:["yui-base"]});YUI.add("dump",function(g){var b=g.Lang,c="{...}",f="f(){...}",a=", ",d=" => ",e=function(p,n){var j,h,l=[],k=b.type(p);if(!b.isObject(p)){return p+"";}else{if(k=="date"){return p;}else{if(p.nodeType&&p.tagName){return p.tagName+"#"+p.id;}else{if(p.document&&p.navigator){return"window";}else{if(p.location&&p.body){return"document";}else{if(k=="function"){return f;}}}}}}n=(b.isNumber(n))?n:3;if(k=="array"){l.push("[");for(j=0,h=p.length;j<h;j=j+1){if(b.isObject(p[j])){l.push((n>0)?b.dump(p[j],n-1):c);}else{l.push(p[j]);}l.push(a);}if(l.length>1){l.pop();}l.push("]");}else{if(k=="regexp"){l.push(p.toString());}else{l.push("{");for(j in p){if(p.hasOwnProperty(j)){try{l.push(j+d);if(b.isObject(p[j])){l.push((n>0)?b.dump(p[j],n-1):c);}else{l.push(p[j]);}l.push(a);}catch(m){l.push("Error: "+m.message);}}}if(l.length>1){l.pop();}l.push("}");}}return l.join("");};g.dump=e;b.dump=e;},"@VERSION@",{requires:["yui-base"]});YUI.add("transition-timer",function(b){var a=b.Transition;b.mix(a.prototype,{_start:function(){if(a.useNative){this._runNative();}else{this._runTimer();}},_runTimer:function(){var c=this;c._initAttrs();a._running[b.stamp(c)]=c;c._startTime=new Date();a._startTimer();},_endTimer:function(){var c=this;delete a._running[b.stamp(c)];c._startTime=null;},_runFrame:function(){var c=new Date()-this._startTime;this._runAttrs(c);},_runAttrs:function(e){var o=this,n=o._node,u=o._config,f=b.stamp(n),m=a._nodeAttrs[f],h=a.behaviors,l=false,g=false,v,w,j,q,c,s,r,k,p;for(w in m){if((j=m[w])&&j.transition===o){r=j.duration;s=j.delay;c=(e-s)/1000;k=e;v={type:"propertyEnd",propertyName:w,config:u,elapsedTime:c};q=(p in h&&"set" in h[p])?h[p].set:a.DEFAULT_SETTER;l=(k>=r);if(k>r){k=r;}if(!s||e>=s){q(o,w,j.from,j.to,k-s,r-s,j.easing,j.unit);if(l){delete m[w];o._count--;if(u[w]&&u[w].on&&u[w].on.end){u[w].on.end.call(b.one(n),v);}if(!g&&o._count<=0){g=true;o._end(c);o._endTimer();}}}}}},_initAttrs:function(){var j=this,e=a.behaviors,l=b.stamp(j._node),q=a._nodeAttrs[l],d,i,k,n,g,c,m,o,p,f,h;for(c in q){if((d=q[c])&&d.transition===j){i=d.duration*1000;k=d.delay*1000;n=d.easing;g=d.value;if(c in j._node.style||c in b.DOM.CUSTOM_STYLES){f=(c in e&&"get" in e[c])?e[c].get(j,c):a.DEFAULT_GETTER(j,c);o=a.RE_UNITS.exec(f);m=a.RE_UNITS.exec(g);f=o?o[1]:f;h=m?m[1]:g;p=m?m[2]:o?o[2]:"";if(!p&&a.RE_DEFAULT_UNIT.test(c)){p=a.DEFAULT_UNIT;}if(typeof n==="string"){if(n.indexOf("cubic-bezier")>-1){n=n.substring(13,n.length-1).split(",");}else{if(a.easings[n]){n=a.easings[n];}}}d.from=Number(f);d.to=Number(h);d.unit=p;d.easing=n;d.duration=i+k;d.delay=k;}else{delete q[c];j._count--;}}}},destroy:function(){this.detachAll();this._node=null;}},true);b.mix(b.Transition,{_runtimeAttrs:{},RE_DEFAULT_UNIT:/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i,DEFAULT_UNIT:"px",intervalTime:20,behaviors:{left:{get:function(d,c){return b.DOM._getAttrOffset(d._node,c);}}},DEFAULT_SETTER:function(f,g,i,j,l,e,h,k){i=Number(i);j=Number(j);var d=f._node,c=a.cubicBezier(h,l/e);c=i+c[0]*(j-i);if(d){if(g in d.style||g in b.DOM.CUSTOM_STYLES){k=k||"";b.DOM.setStyle(d,g,c+k);}}else{f._end();}},DEFAULT_GETTER:function(e,c){var d=e._node,f="";if(c in d.style||c in b.DOM.CUSTOM_STYLES){f=b.DOM.getComputedStyle(d,c);}return f;},_startTimer:function(){if(!a._timer){a._timer=setInterval(a._runFrame,a.intervalTime);}},_stopTimer:function(){clearInterval(a._timer);a._timer=null;},_runFrame:function(){var c=true,d;for(d in a._running){if(a._running[d]._runFrame){c=false;a._running[d]._runFrame();}}if(c){a._stopTimer();}},cubicBezier:function(s,m){var z=0,f=0,w=s[0],e=s[1],v=s[2],d=s[3],u=1,c=0,r=u-3*v+3*w-z,q=3*v-6*w+3*z,o=3*w-3*z,n=z,l=c-3*d+3*e-f,k=3*d-6*e+3*f,j=3*e-3*f,i=f,h=(((r*m)+q)*m+o)*m+n,g=(((l*m)+k)*m+j)*m+i;return[h,g];},easings:{ease:[0.25,0,1,0.25],linear:[0,0,1,1],"ease-in":[0.42,0,1,1],"ease-out":[0,0,0.58,1],"ease-in-out":[0.42,0,0.58,1]},_running:{},_timer:null,RE_UNITS:/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/},true); a.behaviors.top=a.behaviors.bottom=a.behaviors.right=a.behaviors.left;b.Transition=a;},"@VERSION@",{requires:["transition"]});YUI.add("simpleyui",function(a){},"@VERSION@",{use:["yui","oop","dom","event-custom-base","event-base","pluginhost","node","event-delegate","io-base","json-parse","transition","selector-css3","dom-style-ie","querystring-stringify-simple"]});var Y=YUI().use("*");
hasantayyar/cdnjs
ajax/libs/yui/3.5.0pr3/simpleyui/simpleyui-min.js
JavaScript
mit
136,377
YUI.add('axis-base', function (Y, NAME) { /** * The Charts widget provides an api for displaying data * graphically. * * @module charts * @main charts */ /** * Provides functionality for the handling of axis data in a chart. * * @module charts * @submodule axis-base */ var CONFIG = Y.config, WINDOW = CONFIG.win, DOCUMENT = CONFIG.doc, Y_Lang = Y.Lang, IS_STRING = Y_Lang.isString, Y_DOM = Y.DOM, LeftAxisLayout, RightAxisLayout, BottomAxisLayout, TopAxisLayout, _getClassName = Y.ClassNameManager.getClassName, SERIES_MARKER = _getClassName("seriesmarker"); /** * The Renderer class is a base class for chart components that use the `styles` * attribute. * * @module charts * @class Renderer * @constructor */ function Renderer(){} Renderer.ATTRS = { /** * Style properties for class * * @attribute styles * @type Object */ styles: { getter: function() { this._styles = this._styles || this._getDefaultStyles(); return this._styles; }, setter: function(val) { this._styles = this._setStyles(val); } }, /** * The graphic in which drawings will be rendered. * * @attribute graphic * @type Graphic */ graphic: {} }; Renderer.NAME = "renderer"; Renderer.prototype = { /** * Storage for `styles` attribute. * * @property _styles * @type Object * @private */ _styles: null, /** * Method used by `styles` setter. * * @method _setStyles * @param {Object} newStyles Hash of properties to update. * @return Object * @protected */ _setStyles: function(newstyles) { var styles = this.get("styles"); return this._mergeStyles(newstyles, styles); }, /** * Merges to object literals so that only specified properties are * overwritten. * * @method _mergeStyles * @param {Object} a Hash of new styles * @param {Object} b Hash of original styles * @return Object * @protected */ _mergeStyles: function(a, b) { if(!b) { b = {}; } var newstyles = Y.merge(b, {}); Y.Object.each(a, function(value, key, a) { if(b.hasOwnProperty(key) && Y_Lang.isObject(value) && !Y_Lang.isFunction(value) && !Y_Lang.isArray(value)) { newstyles[key] = this._mergeStyles(value, b[key]); } else { newstyles[key] = value; } }, this); return newstyles; }, /** * Gets the default value for the `styles` attribute. * * @method _getDefaultStyles * @return Object * @protected */ _getDefaultStyles: function() { return {padding:{ top:0, right: 0, bottom: 0, left: 0 }}; } }; Y.augment(Renderer, Y.Attribute); Y.Renderer = Renderer; /** * The axis-base submodule contains functionality for the handling of axis data in a chart. * * @module charts * @submodule axis-base */ /** * An abstract class that provides the core functionality used by the following classes: * <ul> * <li>{{#crossLink "CategoryAxisBase"}}{{/crossLink}}</li> * <li>{{#crossLink "NumericAxisBase"}}{{/crossLink}}</li> * <li>{{#crossLink "StackedAxisBase"}}{{/crossLink}}</li> * <li>{{#crossLink "TimeAxisBase"}}{{/crossLink}}</li> * <li>{{#crossLink "CategoryAxis"}}{{/crossLink}}</li> * <li>{{#crossLink "NumericAxis"}}{{/crossLink}}</li> * <li>{{#crossLink "StackedAxis"}}{{/crossLink}}</li> * <li>{{#crossLink "TimeAxis"}}{{/crossLink}}</li> * </ul> * * @class AxisBase * @constructor * @extends Base * @uses Renderer * @param {Object} config (optional) Configuration parameters. * @submodule axis-base */ Y.AxisBase = Y.Base.create("axisBase", Y.Base, [Y.Renderer], { /** * @method initializer * @private */ initializer: function() { this.after("minimumChange", Y.bind(this._keyChangeHandler, this)); this.after("maximumChange", Y.bind(this._keyChangeHandler, this)); this.after("keysChange", this._keyChangeHandler); this.after("dataProviderChange", this._dataProviderChangeHandler); }, /** * Handles changes to `dataProvider`. * * @method _dataProviderChangeHandler * @param {Object} e Event object. * @private */ _dataProviderChangeHandler: function(e) { var keyCollection = this.get("keyCollection").concat(), keys = this.get("keys"), i; if(keys) { for(i in keys) { if(keys.hasOwnProperty(i)) { delete keys[i]; } } } if(keyCollection && keyCollection.length) { this.set("keys", keyCollection); } }, /** * Calculates the maximum and minimum values for the `Data`. * * @method _updateMinAndMax * @private */ _updateMinAndMax: function() { }, /** * Constant used to generate unique id. * * @property GUID * @type String * @private */ GUID: "yuibaseaxis", /** * Type of data used in `Axis`. * * @property _type * @type String * @readOnly * @private */ _type: null, /** * Storage for `setMaximum` attribute. * * @property _setMaximum * @type Object * @private */ _setMaximum: null, /** * Storage for `setMinimum` attribute. * * @property _setMinimum * @type Object * @private */ _setMinimum: null, /** * Reference to data array. * * @property _data * @type Array * @private */ _data: null, /** * Indicates whether the all data is up to date. * * @property _updateTotalDataFlag * @type Boolean * @private */ _updateTotalDataFlag: true, /** * Storage for `dataReady` attribute. * * @property _dataReady * @type Boolean * @readOnly * @private */ _dataReady: false, /** * Adds an array to the key hash. * * @method addKey * @param value Indicates what key to use in retrieving * the array. */ addKey: function (value) { this.set("keys", value); }, /** * Gets an array of values based on a key. * * @method _getKeyArray * @param {String} key Value key associated with the data array. * @param {Array} data Array in which the data resides. * @return Array * @private */ _getKeyArray: function(key, data) { var i = 0, obj, keyArray = [], len = data.length; for(; i < len; ++i) { obj = data[i]; keyArray[i] = obj[key]; } return keyArray; }, /** * Updates the total data array. * * @method _updateTotalData * @private */ _updateTotalData: function() { var keys = this.get("keys"), i; this._data = []; for(i in keys) { if(keys.hasOwnProperty(i)) { this._data = this._data.concat(keys[i]); } } this._updateTotalDataFlag = false; }, /** * Removes an array from the key hash. * * @method removeKey * @param {String} value Indicates what key to use in removing from * the hash. */ removeKey: function(value) { var keys = this.get("keys"); if(keys.hasOwnProperty(value)) { delete keys[value]; this._keyChangeHandler(); } }, /** * Returns a value based of a key value and an index. * * @method getKeyValueAt * @param {String} key value used to look up the correct array * @param {Number} index within the array * @return Number */ getKeyValueAt: function(key, index) { var value = NaN, keys = this.get("keys"); if(keys[key] && Y_Lang.isNumber(parseFloat(keys[key][index]))) { value = keys[key][index]; } return parseFloat(value); }, /** * Returns values based on key identifiers. When a string is passed as an argument, an array of values is returned. * When an array of keys is passed as an argument, an object literal with an array of values mapped to each key is * returned. * * @method getDataByKey * @param {String|Array} value value used to identify the array * @return Array|Object */ getDataByKey: function (value) { var obj, i, len, key, keys = this.get("keys"); if(Y_Lang.isArray(value)) { obj = {}; len = value.length; for(i = 0; i < len; i = i + 1) { key = value[i]; if(keys[key]) { obj[key] = this.getDataByKey(key); } } } else if(keys[value]) { obj = keys[value]; } else { obj = null; } return obj; }, /** * Returns the total number of majorUnits that will appear on an axis. * * @method getTotalMajorUnits * @return Number */ getTotalMajorUnits: function() { var units, majorUnit = this.get("styles").majorUnit; units = majorUnit.count; return units; }, /** * Gets the distance that the first and last ticks are offset from there respective * edges. * * @method getEdgeOffset * @param {Number} ct Number of ticks on the axis. * @param {Number} l Length (in pixels) of the axis. * @return Number */ getEdgeOffset: function(ct, l) { var edgeOffset; if(this.get("calculateEdgeOffset")) { edgeOffset = l/ct; } else { edgeOffset = 0; } return edgeOffset; }, /** * Updates the `Axis` after a change in keys. * * @method _keyChangeHandler * @param {Object} e Event object. * @private */ _keyChangeHandler: function(e) { this._updateMinAndMax(); this._updateTotalDataFlag = true; this.fire("dataUpdate"); }, /** * Gets the default value for the `styles` attribute. Overrides * base implementation. * * @method _getDefaultStyles * @return Object * @protected */ _getDefaultStyles: function() { var axisstyles = { majorUnit: { determinant:"count", count:11, distance:75 } }; return axisstyles; }, /** * Getter method for maximum attribute. * * @method _maximumGetter * @return Number * @private */ _maximumGetter: function () { var max = this.get("dataMaximum"), min = this.get("minimum"); //If all values are zero, force a range so that the Axis and related series //will still render. if(min === 0 && max === 0) { max = 10; } if(Y_Lang.isNumber(this._setMaximum)) { max = this._setMaximum; } return parseFloat(max); }, /** * Setter method for maximum attribute. * * @method _maximumSetter * @param {Object} value * @private */ _maximumSetter: function (value) { this._setMaximum = parseFloat(value); return value; }, /** * Getter method for minimum attribute. * * @method _minimumGetter * @return Number * @private */ _minimumGetter: function () { var min = this.get("dataMinimum"); if(Y_Lang.isNumber(this._setMinimum)) { min = this._setMinimum; } return parseFloat(min); }, /** * Setter method for minimum attribute. * * @method _minimumSetter * @param {Object} value * @private */ _minimumSetter: function(val) { this._setMinimum = parseFloat(val); return val; }, /** * Indicates whether or not the maximum attribute has been explicitly set. * * @method _getSetMax * @return Boolean * @private */ _getSetMax: function() { return Y_Lang.isNumber(this._setMaximum); }, /** * Indicates whether or not the minimum attribute has been explicitly set. * * @method _getSetMin * @return Boolean * @private */ _getSetMin: function() { return Y_Lang.isNumber(this._setMinimum); } }, { ATTRS: { /** * Determines whether and offset is automatically calculated for the edges of the axis. * * @attr calculateEdgeOffset * @type Boolean */ calculateEdgeOffset: { value: false }, labelFunction: { valueFn: function() { return this.formatLabel; } }, /** * Hash of array identifed by a string value. * * @attribute keys * @type Object */ keys: { value: {}, setter: function(val) { var keys = {}, i, len, data = this.get("dataProvider"); if(Y_Lang.isArray(val)) { len = val.length; for(i = 0; i < len; ++i) { keys[val[i]] = this._getKeyArray(val[i], data); } } else if(Y_Lang.isString(val)) { keys = this.get("keys"); keys[val] = this._getKeyArray(val, data); } else { for(i in val) { if(val.hasOwnProperty(i)) { keys[i] = this._getKeyArray(i, data); } } } this._updateTotalDataFlag = true; return keys; } }, /** *Returns the type of axis data * <dl> * <dt>time</dt><dd>Manages time data</dd> * <dt>stacked</dt><dd>Manages stacked numeric data</dd> * <dt>numeric</dt><dd>Manages numeric data</dd> * <dt>category</dt><dd>Manages categorical data</dd> * </dl> * * @attribute type * @type String */ type: { readOnly: true, getter: function () { return this._type; } }, /** * Instance of `ChartDataProvider` that the class uses * to build its own data. * * @attribute dataProvider * @type Array */ dataProvider:{ setter: function (value) { return value; } }, /** * The maximum value contained in the `data` array. Used for * `maximum` when `autoMax` is true. * * @attribute dataMaximum * @type Number */ dataMaximum: { getter: function () { if(!Y_Lang.isNumber(this._dataMaximum)) { this._updateMinAndMax(); } return this._dataMaximum; } }, /** * The maximum value that will appear on an axis. * * @attribute maximum * @type Number */ maximum: { lazyAdd: false, getter: "_maximumGetter", setter: "_maximumSetter" }, /** * The minimum value contained in the `data` array. Used for * `minimum` when `autoMin` is true. * * @attribute dataMinimum * @type Number */ dataMinimum: { getter: function () { if(!Y_Lang.isNumber(this._dataMinimum)) { this._updateMinAndMax(); } return this._dataMinimum; } }, /** * The minimum value that will appear on an axis. * * @attribute minimum * @type Number */ minimum: { lazyAdd: false, getter: "_minimumGetter", setter: "_minimumSetter" }, /** * Determines whether the maximum is calculated or explicitly * set by the user. * * @attribute setMax * @type Boolean */ setMax: { readOnly: true, getter: "_getSetMax" }, /** * Determines whether the minimum is calculated or explicitly * set by the user. * * @attribute setMin * @type Boolean */ setMin: { readOnly: true, getter: "_getSetMin" }, /** * Array of axis data * * @attribute data * @type Array */ data: { getter: function () { if(!this._data || this._updateTotalDataFlag) { this._updateTotalData(); } return this._data; } }, /** * Array containing all the keys in the axis. * @attribute keyCollection * @type Array */ keyCollection: { getter: function() { var keys = this.get("keys"), i, col = []; for(i in keys) { if(keys.hasOwnProperty(i)) { col.push(i); } } return col; }, readOnly: true }, /** * Object which should have by the labelFunction * * @attribute labelFunctionScope * @type Object */ labelFunctionScope: {} } }); }, '@VERSION@', {"requires": ["classnamemanager", "datatype-number", "datatype-date", "base", "event-custom"]});
paleozogt/cdnjs
ajax/libs/yui/3.9.0pr3/axis-base/axis-base-debug.js
JavaScript
mit
19,150
YUI.add('datatable-base', function(Y) { var YLang = Y.Lang, Ysubstitute = Y.Lang.substitute, YNode = Y.Node, Ycreate = YNode.create, YgetClassName = Y.ClassNameManager.getClassName, DATATABLE = "datatable", COLUMN = "column", FOCUS = "focus", KEYDOWN = "keydown", MOUSEENTER = "mouseenter", MOUSELEAVE = "mouseleave", MOUSEUP = "mouseup", MOUSEDOWN = "mousedown", CLICK = "click", DOUBLECLICK = "doubleclick", CLASS_COLUMNS = YgetClassName(DATATABLE, "columns"), CLASS_DATA = YgetClassName(DATATABLE, "data"), CLASS_MSG = YgetClassName(DATATABLE, "msg"), CLASS_LINER = YgetClassName(DATATABLE, "liner"), CLASS_FIRST = YgetClassName(DATATABLE, "first"), CLASS_LAST = YgetClassName(DATATABLE, "last"), CLASS_EVEN = YgetClassName(DATATABLE, "even"), CLASS_ODD = YgetClassName(DATATABLE, "odd"), TEMPLATE_TABLE = '<table></table>', TEMPLATE_COL = '<col></col>', TEMPLATE_THEAD = '<thead class="'+CLASS_COLUMNS+'"></thead>', TEMPLATE_TBODY = '<tbody class="'+CLASS_DATA+'"></tbody>', TEMPLATE_TH = '<th id="{id}" rowspan="{rowspan}" colspan="{colspan}" class="{classnames}"><div class="'+CLASS_LINER+'">{value}</div></th>', TEMPLATE_TR = '<tr id="{id}"></tr>', TEMPLATE_TD = '<td headers="{headers}" class="{classnames}"><div class="'+CLASS_LINER+'">{value}</div></td>', TEMPLATE_VALUE = '{value}', TEMPLATE_MSG = '<tbody class="'+CLASS_MSG+'"></tbody>'; /** * The Column class defines and manages attributes of Columns for DataTable. * * @class Column * @extends Widget * @constructor */ function Column(config) { Column.superclass.constructor.apply(this, arguments); } ///////////////////////////////////////////////////////////////////////////// // // STATIC PROPERTIES // ///////////////////////////////////////////////////////////////////////////// Y.mix(Column, { /** * Class name. * * @property NAME * @type String * @static * @final * @value "column" */ NAME: "column", ///////////////////////////////////////////////////////////////////////////// // // ATTRIBUTES // ///////////////////////////////////////////////////////////////////////////// ATTRS: { id: { valueFn: "_defaultId", writeOnce: true }, key: { valueFn: "_defaultKey" }, field: { valueFn: "_defaultField" }, label: { valueFn: "_defaultLabel" }, keyIndex: { readOnly: true }, parent: { readOnly: true }, children: { }, colSpan: { readOnly: true }, rowSpan: { readOnly: true }, thNode: { readOnly: true }, thLinerNode: { readOnly: true }, thLabelNode: { readOnly: true }, abbr: { value: null }, headers: {}, // set by Columnset code classnames: { readOnly: true, getter: "_getClassnames" }, editor: {}, formatter: {}, // requires datatable-colresize resizeable: {}, //requires datatable-sort sortable: {}, hidden: {}, width: {}, minWidth: {}, maxAutoWidth: {} } }); ///////////////////////////////////////////////////////////////////////////// // // PROTOTYPE // ///////////////////////////////////////////////////////////////////////////// Y.extend(Column, Y.Widget, { ///////////////////////////////////////////////////////////////////////////// // // ATTRIBUTE HELPERS // ///////////////////////////////////////////////////////////////////////////// /** * @method _defaultId * @description Return ID for instance. * @returns String * @private */ _defaultId: function() { return Y.guid(); }, /** * @method _defaultKey * @description Return key for instance. Defaults to ID if one was not * provided. * @returns String * @private */ _defaultKey: function(key) { return key || Y.guid(); }, /** * @method _defaultField * @description Return field for instance. Defaults to key if one was not * provided. * @returns String * @private */ _defaultField: function(field) { return field || this.get("key"); }, /** * @method _defaultLabel * @description Return label for instance. Defaults to key if one was not * provided. * @returns String * @private */ _defaultLabel: function(label) { return label || this.get("key"); }, /** * Updates the UI if changes are made to abbr. * * @method _afterAbbrChange * @param e {Event} Custom event for the attribute change. * @private */ _afterAbbrChange: function (e) { this._uiSetAbbr(e.newVal); }, ///////////////////////////////////////////////////////////////////////////// // // METHODS // ///////////////////////////////////////////////////////////////////////////// /** * Initializer. * * @method initializer * @param config {Object} Config object. * @private */ initializer: function(config) { }, /** * Destructor. * * @method destructor * @private */ destructor: function() { }, /** * Returns classnames for Column. * * @method _getClassnames * @private */ _getClassnames: function () { return Y.ClassNameManager.getClassName(COLUMN, this.get("id")); /*var allClasses; // Add CSS classes if(lang.isString(oColumn.className)) { // Single custom class allClasses = [oColumn.className]; } else if(lang.isArray(oColumn.className)) { // Array of custom classes allClasses = oColumn.className; } else { // no custom classes allClasses = []; } // Hook for setting width with via dynamic style uses key since ID is too disposable allClasses[allClasses.length] = this.getId() + "-col-" +oColumn.getSanitizedKey(); // Column key - minus any chars other than "A-Z", "a-z", "0-9", "_", "-", ".", or ":" allClasses[allClasses.length] = "yui-dt-col-" +oColumn.getSanitizedKey(); var isSortedBy = this.get("sortedBy") || {}; // Sorted if(oColumn.key === isSortedBy.key) { allClasses[allClasses.length] = isSortedBy.dir || ''; } // Hidden if(oColumn.hidden) { allClasses[allClasses.length] = DT.CLASS_HIDDEN; } // Selected if(oColumn.selected) { allClasses[allClasses.length] = DT.CLASS_SELECTED; } // Sortable if(oColumn.sortable) { allClasses[allClasses.length] = DT.CLASS_SORTABLE; } // Resizeable if(oColumn.resizeable) { allClasses[allClasses.length] = DT.CLASS_RESIZEABLE; } // Editable if(oColumn.editor) { allClasses[allClasses.length] = DT.CLASS_EDITABLE; } // Addtnl classes, including First/Last if(aAddClasses) { allClasses = allClasses.concat(aAddClasses); } return allClasses.join(' ');*/ }, //////////////////////////////////////////////////////////////////////////// // // SYNC // //////////////////////////////////////////////////////////////////////////// /** * Syncs UI to intial state. * * @method syncUI * @private */ syncUI: function() { this._uiSetAbbr(this.get("abbr")); }, /** * Updates abbr. * * @method _uiSetAbbr * @param val {String} New abbr. * @protected */ _uiSetAbbr: function(val) { this._thNode.set("abbr", val); } }); Y.Column = Column; /** * The Columnset class defines and manages a collection of Columns. * * @class Columnset * @extends Base * @constructor */ function Columnset(config) { Columnset.superclass.constructor.apply(this, arguments); } ///////////////////////////////////////////////////////////////////////////// // // STATIC PROPERTIES // ///////////////////////////////////////////////////////////////////////////// Y.mix(Columnset, { /** * Class name. * * @property NAME * @type String * @static * @final * @value "columnset" */ NAME: "columnset", ///////////////////////////////////////////////////////////////////////////// // // ATTRIBUTES // ///////////////////////////////////////////////////////////////////////////// ATTRS: { definitions: { setter: "_setDefinitions" }, // DOM tree representation of all Columns tree: { readOnly: true, value: [] }, //TODO: is this necessary? // Flat representation of all Columns flat: { readOnly: true, value: [] }, // Hash of all Columns by ID hash: { readOnly: true, value: {} }, // Flat representation of only Columns that are meant to display data keys: { readOnly: true, value: [] } } }); ///////////////////////////////////////////////////////////////////////////// // // PROTOTYPE // ///////////////////////////////////////////////////////////////////////////// Y.extend(Columnset, Y.Base, { ///////////////////////////////////////////////////////////////////////////// // // ATTRIBUTE HELPERS // ///////////////////////////////////////////////////////////////////////////// /** * @method _setDefinitions * @description Clones definitions before setting. * @param definitions {Array} Array of column definitions. * @returns Array * @private */ _setDefinitions: function(definitions) { return Y.clone(definitions); }, ///////////////////////////////////////////////////////////////////////////// // // METHODS // ///////////////////////////////////////////////////////////////////////////// /** * Initializer. Generates all internal representations of the collection of * Columns. * * @method initializer * @param config {Object} Config object. * @private */ initializer: function() { // DOM tree representation of all Columns var tree = [], // Flat representation of all Columns flat = [], // Hash of all Columns by ID hash = {}, // Flat representation of only Columns that are meant to display data keys = [], // Original definitions definitions = this.get("definitions"), self = this; // Internal recursive function to define Column instances function parseColumns(depth, currentDefinitions, parent) { var i=0, len = currentDefinitions.length, currentDefinition, column, currentChildren; // One level down depth++; // Create corresponding dom node if not already there for this depth if(!tree[depth]) { tree[depth] = []; } // Parse each node at this depth for attributes and any children for(; i<len; ++i) { currentDefinition = currentDefinitions[i]; currentDefinition = YLang.isString(currentDefinition) ? {key:currentDefinition} : currentDefinition; // Instantiate a new Column for each node column = new Y.Column(currentDefinition); // Cross-reference Column ID back to the original object literal definition currentDefinition.yuiColumnId = column.get("id"); // Add the new Column to the flat list flat.push(column); // Add the new Column to the hash hash[column.get("id")] = column; // Assign its parent as an attribute, if applicable if(parent) { column._set("parent", parent); } // The Column has descendants if(YLang.isArray(currentDefinition.children)) { currentChildren = currentDefinition.children; column._set("children", currentChildren); self._setColSpans(column, currentDefinition); self._cascadePropertiesToChildren(column, currentChildren); // The children themselves must also be parsed for Column instances if(!tree[depth+1]) { tree[depth+1] = []; } parseColumns(depth, currentChildren, column); } // This Column does not have any children else { column._set("keyIndex", keys.length); column._set("colSpan", 1); keys.push(column); } // Add the Column to the top-down dom tree tree[depth].push(column); } depth--; } // Parse out Column instances from the array of object literals parseColumns(-1, definitions); // Save to the Columnset instance this._set("tree", tree); this._set("flat", flat); this._set("hash", hash); this._set("keys", keys); this._setRowSpans(); this._setHeaders(); }, /** * Destructor. * * @method destructor * @private */ destructor: function() { }, ///////////////////////////////////////////////////////////////////////////// // // COLUMN HELPERS // ///////////////////////////////////////////////////////////////////////////// /** * Cascade certain properties to children if not defined on their own. * * @method _cascadePropertiesToChildren * @private */ _cascadePropertiesToChildren: function(column, currentChildren) { //TODO: this is all a giant todo var i = 0, len = currentChildren.length, child; // Cascade certain properties to children if not defined on their own for(; i<len; ++i) { child = currentChildren[i]; if(column.get("className") && (child.className === undefined)) { child.className = column.get("className"); } if(column.get("editor") && (child.editor === undefined)) { child.editor = column.get("editor"); } if(column.get("formatter") && (child.formatter === undefined)) { child.formatter = column.get("formatter"); } if(column.get("resizeable") && (child.resizeable === undefined)) { child.resizeable = column.get("resizeable"); } if(column.get("sortable") && (child.sortable === undefined)) { child.sortable = column.get("sortable"); } if(column.get("hidden")) { child.hidden = true; } if(column.get("width") && (child.width === undefined)) { child.width = column.get("width"); } if(column.get("minWidth") && (child.minWidth === undefined)) { child.minWidth = column.get("minWidth"); } if(column.get("maxAutoWidth") && (child.maxAutoWidth === undefined)) { child.maxAutoWidth = column.get("maxAutoWidth"); } } }, /** * @method _setColSpans * @description Calculates and sets colSpan attribute on given Column. * @param column {Array} Column instance. * @param definition {Object} Column definition. * @private */ _setColSpans: function(column, definition) { // Determine COLSPAN value for this Column var terminalChildNodes = 0; function countTerminalChildNodes(ancestor) { var descendants = ancestor.children, i = 0, len = descendants.length; // Drill down each branch and count terminal nodes for(; i<len; ++i) { // Keep drilling down if(YLang.isArray(descendants[i].children)) { countTerminalChildNodes(descendants[i]); } // Reached branch terminus else { terminalChildNodes++; } } } countTerminalChildNodes(definition); column._set("colSpan", terminalChildNodes); }, /** * @method _setRowSpans * @description Calculates and sets rowSpan attribute on all Columns. * @private */ _setRowSpans: function() { // Determine ROWSPAN value for each Column in the DOM tree function parseDomTreeForRowSpan(tree) { var maxRowDepth = 1, currentRow, currentColumn, m,p; // Calculate the max depth of descendants for this row function countMaxRowDepth(row, tmpRowDepth) { tmpRowDepth = tmpRowDepth || 1; var i = 0, len = row.length, col; for(; i<len; ++i) { col = row[i]; // Column has children, so keep counting if(YLang.isArray(col.children)) { tmpRowDepth++; countMaxRowDepth(col.children, tmpRowDepth); tmpRowDepth--; } // Column has children, so keep counting else if(col.get && YLang.isArray(col.get("children"))) { tmpRowDepth++; countMaxRowDepth(col.get("children"), tmpRowDepth); tmpRowDepth--; } // No children, is it the max depth? else { if(tmpRowDepth > maxRowDepth) { maxRowDepth = tmpRowDepth; } } } } // Count max row depth for each row for(m=0; m<tree.length; m++) { currentRow = tree[m]; countMaxRowDepth(currentRow); // Assign the right ROWSPAN values to each Column in the row for(p=0; p<currentRow.length; p++) { currentColumn = currentRow[p]; if(!YLang.isArray(currentColumn.get("children"))) { currentColumn._set("rowSpan", maxRowDepth); } else { currentColumn._set("rowSpan", 1); } } // Reset counter for next row maxRowDepth = 1; } } parseDomTreeForRowSpan(this.get("tree")); }, /** * @method _setHeaders * @description Calculates and sets headers attribute on all Columns. * @private */ _setHeaders: function() { var headers, column, allKeys = this.get("keys"), i=0, len = allKeys.length; function recurseAncestorsForHeaders(headers, column) { headers.push(column.get("key")); //headers[i].push(column.getSanitizedKey()); if(column.get("parent")) { recurseAncestorsForHeaders(headers, column.get("parent")); } } for(; i<len; ++i) { headers = []; column = allKeys[i]; recurseAncestorsForHeaders(headers, column); column._set("headers", headers.reverse().join(" ")); } }, getColumn: function() { } }); Y.Columnset = Columnset; /** * The DataTable widget provides a progressively enhanced DHTML control for * displaying tabular data across A-grade browsers. * * @module datatable */ /** * Provides the base DataTable implementation, which can be extended to add * additional functionality, such as sorting or scrolling. * * @module datatable * @submodule datatable-base */ /** * Base class for the DataTable widget. * @class DataSource.Base * @extends Widget * @constructor */ function DTBase(config) { DTBase.superclass.constructor.apply(this, arguments); } ///////////////////////////////////////////////////////////////////////////// // // STATIC PROPERTIES // ///////////////////////////////////////////////////////////////////////////// Y.mix(DTBase, { /** * Class name. * * @property NAME * @type String * @static * @final * @value "dataTable" */ NAME: "dataTable", ///////////////////////////////////////////////////////////////////////////// // // ATTRIBUTES // ///////////////////////////////////////////////////////////////////////////// ATTRS: { /** * @attribute columnset * @description Pointer to Columnset instance. * @type Array | Y.Columnset */ columnset: { setter: "_setColumnset" }, /** * @attribute recordset * @description Pointer to Recordset instance. * @type Array | Y.Recordset */ recordset: { setter: "_setRecordset" }, /*TODO * @attribute state * @description Internal state. * @readonly * @type */ /*state: { value: new Y.State(), readOnly: true },*/ /** * @attribute strings * @description The collection of localizable strings used to label * elements of the UI. * @type Object */ strings: { valueFn: function() { return Y.Intl.get("datatable-base"); } }, /** * @attribute thValueTemplate * @description Tokenized markup template for TH value. * @type String * @default '{value}' */ thValueTemplate: { value: TEMPLATE_VALUE }, /** * @attribute tdValueTemplate * @description Tokenized markup template for TD value. * @type String * @default '{value}' */ tdValueTemplate: { value: TEMPLATE_VALUE }, /** * @attribute trTemplate * @description Tokenized markup template for TR node creation. * @type String * @default '<tr id="{id}"></tr>' */ trTemplate: { value: TEMPLATE_TR } }, ///////////////////////////////////////////////////////////////////////////// // // TODO: HTML_PARSER // ///////////////////////////////////////////////////////////////////////////// HTML_PARSER: { /*caption: function (srcNode) { }*/ } }); ///////////////////////////////////////////////////////////////////////////// // // PROTOTYPE // ///////////////////////////////////////////////////////////////////////////// Y.extend(DTBase, Y.Widget, { /** * @property thTemplate * @description Tokenized markup template for TH node creation. * @type String * @default '<th id="{id}" rowspan="{rowspan}" colspan="{colspan}"><div class="'+CLASS_LINER+'">{value}</div></th>' */ thTemplate: TEMPLATE_TH, /** * @property tdTemplate * @description Tokenized markup template for TD node creation. * @type String * @default '<td headers="{headers}"><div class="'+CLASS_LINER+'">{value}</div></td>' */ tdTemplate: TEMPLATE_TD, /** * @property _theadNode * @description Pointer to THEAD node. * @type Y.Node * @private */ _theadNode: null, /** * @property _tbodyNode * @description Pointer to TBODY node. * @type Y.Node * @private */ _tbodyNode: null, /** * @property _msgNode * @description Pointer to message display node. * @type Y.Node * @private */ _msgNode: null, ///////////////////////////////////////////////////////////////////////////// // // ATTRIBUTE HELPERS // ///////////////////////////////////////////////////////////////////////////// /** * Updates the UI if changes are made to any of the strings in the strings * attribute. * * @method _afterStringsChange * @param e {Event} Custom event for the attribute change. * @protected */ _afterStringsChange: function (e) { this._uiSetStrings(e.newVal); }, /** * @method _setColumnset * @description Converts Array to Y.Columnset. * @param columns {Array | Y.Columnset} * @returns Y.Columnset * @private */ _setColumnset: function(columns) { return YLang.isArray(columns) ? new Y.Columnset({definitions:columns}) : columns; }, /** * Updates the UI if changes are made to Columnset. * * @method _afterColumnsetChange * @param e {Event} Custom event for the attribute change. * @private */ _afterColumnsetChange: function (e) { this._uiSetColumnset(e.newVal); }, /** * @method _setRecordset * @description Converts Array to Y.Recordset. * @param records {Array | Y.Recordset} * @returns Y.Recordset * @private */ _setRecordset: function(rs) { if(YLang.isArray(rs)) { rs = new Y.Recordset({records:rs}); } rs.addTarget(this); return rs; }, /** * @method _afterRecordsetChange * @description Adds bubble target. * @param records {Array | Y.Recordset} * @returns Y.Recordset * @private */ _afterRecordsetChange: function (e) { this._uiSetRecordset(e.newVal); }, ///////////////////////////////////////////////////////////////////////////// // // METHODS // ///////////////////////////////////////////////////////////////////////////// /** * Initializer. * * @method initializer * @param config {Object} Config object. * @private */ initializer: function(config) { }, /** * Destructor. * * @method destructor * @private */ destructor: function() { this.get("recordset").removeTarget(this); }, //////////////////////////////////////////////////////////////////////////// // // RENDER // //////////////////////////////////////////////////////////////////////////// /** * Renders UI. * * @method renderUI * @private */ renderUI: function() { // TABLE return (this._addTableNode(this.get("contentBox")) && // COLGROUP this._addColgroupNode(this._tableNode) && // THEAD this._addTheadNode(this._tableNode) && // Primary TBODY this._addTbodyNode(this._tableNode) && // Message TBODY this._addMessageNode(this._tableNode) && // CAPTION this._addCaptionNode(this._tableNode)); }, /** * Creates and attaches TABLE element to given container. * * @method _addTableNode * @param containerNode {Y.Node} Parent node. * @protected * @returns Y.Node */ _addTableNode: function(containerNode) { if (!this._tableNode) { this._tableNode = containerNode.appendChild(Ycreate(TEMPLATE_TABLE)); } return this._tableNode; }, /** * Creates and attaches COLGROUP element to given TABLE. * * @method _addColgroupNode * @param tableNode {Y.Node} Parent node. * @protected * @returns Y.Node */ _addColgroupNode: function(tableNode) { // Add COLs to DOCUMENT FRAGMENT var len = this.get("columnset").get("keys").length, i = 0, allCols = ["<colgroup>"]; for(; i<len; ++i) { allCols.push(TEMPLATE_COL); } allCols.push("</colgroup>"); // Create COLGROUP this._colgroupNode = tableNode.insertBefore(Ycreate(allCols.join("")), tableNode.get("firstChild")); return this._colgroupNode; }, /** * Creates and attaches THEAD element to given container. * * @method _addTheadNode * @param tableNode {Y.Node} Parent node. * @protected * @returns Y.Node */ _addTheadNode: function(tableNode) { if(tableNode) { this._theadNode = tableNode.insertBefore(Ycreate(TEMPLATE_THEAD), this._colgroupNode.next()); return this._theadNode; } }, /** * Creates and attaches TBODY element to given container. * * @method _addTbodyNode * @param tableNode {Y.Node} Parent node. * @protected * @returns Y.Node */ _addTbodyNode: function(tableNode) { this._tbodyNode = tableNode.appendChild(Ycreate(TEMPLATE_TBODY)); return this._tbodyNode; }, /** * Creates and attaches message display element to given container. * * @method _addMessageNode * @param tableNode {Y.Node} Parent node. * @protected * @returns Y.Node */ _addMessageNode: function(tableNode) { this._msgNode = tableNode.insertBefore(Ycreate(TEMPLATE_MSG), this._tbodyNode); return this._msgNode; }, /** * Creates and attaches CAPTION element to given container. * * @method _addCaptionNode * @param tableNode {Y.Node} Parent node. * @protected * @returns Y.Node */ _addCaptionNode: function(tableNode) { //TODO: node.createCaption this._captionNode = tableNode.invoke("createCaption"); return this._captionNode; }, //////////////////////////////////////////////////////////////////////////// // // BIND // //////////////////////////////////////////////////////////////////////////// /** * Binds events. * * @method bindUI * @private */ bindUI: function() { var tableNode = this._tableNode, contentBox = this.get("contentBox"), theadFilter = "thead."+CLASS_COLUMNS+">tr>th", tbodyFilter ="tbody."+CLASS_DATA+">tr>td", msgFilter = "tbody."+CLASS_MSG+">tr>td"; // Define custom events that wrap DOM events. Simply pass through DOM // event facades. //TODO: do we need queuable=true? //TODO: All the other events. /** * Fired when a TH element has a click. * * @event theadCellClick */ this.publish("theadCellClick", {defaultFn: this._defTheadCellClickFn, emitFacade:false, queuable:true}); /** * Fired when a THEAD>TR element has a click. * * @event theadRowClick */ this.publish("theadRowClick", {defaultFn: this._defTheadRowClickFn, emitFacade:false, queuable:true}); /** * Fired when the THEAD element has a click. * * @event theadClick */ this.publish("theadClick", {defaultFn: this._defTheadClickFn, emitFacade:false, queuable:true}); /** * Fired when a TH element has a mouseenter. * * @event theadCellMouseenter */ this.publish("theadCellMouseenter", {defaultFn: this._defTheadCellMouseenterFn, emitFacade:false, queuable:true}); /** * Fired when a THEAD>TR element has a mouseenter. * * @event theadRowMouseenter */ this.publish("theadRowMouseenter", {defaultFn: this._defTheadRowMouseenterFn, emitFacade:false, queuable:true}); /** * Fired when the THEAD element has a mouseenter. * * @event theadMouseenter */ this.publish("theadMouseenter", {defaultFn: this._defTheadMouseenterFn, emitFacade:false, queuable:true}); /** * Fired when a TD element has a click. * * @event tbodyCellClick */ this.publish("tbodyCellClick", {defaultFn: this._defTbodyCellClickFn, emitFacade:false, queuable:true}); /** * Fired when a TBODY>TR element has a click. * * @event tbodyRowClick */ this.publish("tbodyRowClick", {defaultFn: this._defTbodyRowClickFn, emitFacade:false, queuable:true}); /** * Fired when the TBODY element has a click. * * @event tbodyClick */ this.publish("tbodyClick", {defaultFn: this._defTbodyClickFn, emitFacade:false, queuable:true}); // Bind to THEAD DOM events tableNode.delegate(FOCUS, this._onDomEvent, theadFilter, this, "theadCellFocus"); tableNode.delegate(KEYDOWN, this._onDomEvent, theadFilter, this, "theadCellKeydown"); tableNode.delegate(MOUSEENTER, this._onDomEvent, theadFilter, this, "theadCellMouseenter"); tableNode.delegate(MOUSELEAVE, this._onDomEvent, theadFilter, this, "theadCellMouseleave"); tableNode.delegate(MOUSEUP, this._onDomEvent, theadFilter, this, "theadCellMouseup"); tableNode.delegate(MOUSEDOWN, this._onDomEvent, theadFilter, this, "theadCellMousedown"); tableNode.delegate(CLICK, this._onDomEvent, theadFilter, this, "theadCellClick"); // Since we can't listen for click and dblclick on the same element... contentBox.delegate(DOUBLECLICK, this._onEvent, theadFilter, this, "theadCellDoubleclick"); // Bind to TBODY DOM events tableNode.delegate(FOCUS, this._onDomEvent, tbodyFilter, this, "tbodyCellFocus"); tableNode.delegate(KEYDOWN, this._onDomEvent, tbodyFilter, this, "tbodyCellKeydown"); tableNode.delegate(MOUSEENTER, this._onDomEvent, tbodyFilter, this, "tbodyCellMouseenter"); tableNode.delegate(MOUSELEAVE, this._onDomEvent, tbodyFilter, this, "tbodyCellMouseleave"); tableNode.delegate(MOUSEUP, this._onDomEvent, tbodyFilter, this, "tbodyCellMouseup"); tableNode.delegate(MOUSEDOWN, this._onDomEvent, tbodyFilter, this, "tbodyCellMousedown"); tableNode.delegate(CLICK, this._onDomEvent, tbodyFilter, this, "tbodyCellClick"); // Since we can't listen for click and dblclick on the same element... contentBox.delegate(DOUBLECLICK, this._onEvent, tbodyFilter, this, "tbodyCellDoubleclick"); // Bind to message TBODY DOM events tableNode.delegate(FOCUS, this._onDomEvent, msgFilter, this, "msgCellFocus"); tableNode.delegate(KEYDOWN, this._onDomEvent, msgFilter, this, "msgCellKeydown"); tableNode.delegate(MOUSEENTER, this._onDomEvent, msgFilter, this, "msgCellMouseenter"); tableNode.delegate(MOUSELEAVE, this._onDomEvent, msgFilter, this, "msgCellMouseleave"); tableNode.delegate(MOUSEUP, this._onDomEvent, msgFilter, this, "msgCellMouseup"); tableNode.delegate(MOUSEDOWN, this._onDomEvent, msgFilter, this, "msgCellMousedown"); tableNode.delegate(CLICK, this._onDomEvent, msgFilter, this, "msgCellClick"); // Since we can't listen for click and dblclick on the same element... contentBox.delegate(DOUBLECLICK, this._onDomEvent, msgFilter, this, "msgCellDoubleclick"); }, /** * On DOM event, fires corresponding custom event. * * @method _onDomEvent * @param e {DOMEvent} The original DOM event facade. * @param type {String} Corresponding custom event to fire. * @private */ _onDomEvent: function(e, type) { this.fire(type, e); }, //TODO: abstract this out _defTheadCellClickFn: function(e) { this.fire("theadRowClick", e); }, _defTheadRowClickFn: function(e) { this.fire("theadClick", e); }, _defTheadClickFn: function(e) { }, //////////////////////////////////////////////////////////////////////////// // // SYNC // //////////////////////////////////////////////////////////////////////////// /** * Syncs UI to intial state. * * @method syncUI * @private */ syncUI: function() { // THEAD ROWS this._uiSetColumnset(this.get("columnset")); // DATA ROWS this._uiSetRecordset(this.get("recordset")); // STRINGS this._uiSetStrings(this.get("strings")); }, /** * Updates all strings. * * @method _uiSetStrings * @param strings {Object} Collection of new strings. * @protected */ _uiSetStrings: function (strings) { this._uiSetSummary(strings.summary); this._uiSetCaption(strings.caption); }, /** * Updates summary. * * @method _uiSetSummary * @param val {String} New summary. * @protected */ _uiSetSummary: function(val) { this._tableNode.set("summary", val); }, /** * Updates caption. * * @method _uiSetCaption * @param val {String} New caption. * @protected */ _uiSetCaption: function(val) { this._captionNode.setContent(val); }, //////////////////////////////////////////////////////////////////////////// // // THEAD/COLUMNSET FUNCTIONALITY // //////////////////////////////////////////////////////////////////////////// /** * Updates THEAD. * * @method _uiSetColumnset * @param cs {Y.Columnset} New Columnset. * @protected */ _uiSetColumnset: function(cs) { var tree = cs.get("tree"), thead = this._theadNode, i = 0, len = tree.length, parent = thead.get("parentNode"), nextSibling = thead.next(); // Move THEAD off DOM thead.remove(); thead.get("children").remove(true); // Iterate tree of columns to add THEAD rows for(; i<len; ++i) { this._addTheadTrNode({thead:thead, columns:tree[i]}, (i === 0), (i === len-1)); } // Column helpers needs _theadNode to exist //this._createColumnHelpers(); // Re-attach THEAD to DOM parent.insert(thead, nextSibling); }, /** * Creates and attaches header row element. * * @method _addTheadTrNode * @param o {Object} {thead, columns}. * @param isFirst {Boolean} Is first row. * @param isFirst {Boolean} Is last row. * @protected */ _addTheadTrNode: function(o, isFirst, isLast) { o.tr = this._createTheadTrNode(o, isFirst, isLast); this._attachTheadTrNode(o); }, /** * Creates header row element. * * @method _createTheadTrNode * @param o {Object} {thead, columns}. * @param isFirst {Boolean} Is first row. * @param isLast {Boolean} Is last row. * @protected * @returns Y.Node */ _createTheadTrNode: function(o, isFirst, isLast) { //TODO: custom classnames var tr = Ycreate(Ysubstitute(this.get("trTemplate"), o)), i = 0, columns = o.columns, len = columns.length, column; // Set FIRST/LAST class if(isFirst) { tr.addClass(CLASS_FIRST); } if(isLast) { tr.addClass(CLASS_LAST); } for(; i<len; ++i) { column = columns[i]; this._addTheadThNode({value:column.get("label"), column: column, tr:tr}); } return tr; }, /** * Attaches header row element. * * @method _attachTheadTrNode * @param o {Object} {thead, columns, tr}. * @protected */ _attachTheadTrNode: function(o) { o.thead.appendChild(o.tr); }, /** * Creates and attaches header cell element. * * @method _addTheadThNode * @param o {Object} {value, column, tr}. * @protected */ _addTheadThNode: function(o) { o.th = this._createTheadThNode(o); this._attachTheadThNode(o); }, /** * Creates header cell element. * * @method _createTheadThNode * @param o {Object} {value, column, tr}. * @protected * @returns Y.Node */ _createTheadThNode: function(o) { var column = o.column; // Populate template object o.id = column.get("id");//TODO: validate 1 column ID per document o.colspan = column.get("colSpan"); o.rowspan = column.get("rowSpan"); //TODO o.abbr = column.get("abbr"); o.classnames = column.get("classnames"); o.value = Ysubstitute(this.get("thValueTemplate"), o); /*TODO // Clear minWidth on hidden Columns if(column.get("hidden")) { //this._clearMinWidth(column); } */ //column._set("thNode", o.th); return Ycreate(Ysubstitute(this.thTemplate, o)); }, /** * Attaches header cell element. * * @method _attachTheadTrNode * @param o {Object} {value, column, tr}. * @protected */ _attachTheadThNode: function(o) { o.tr.appendChild(o.th); }, //////////////////////////////////////////////////////////////////////////// // // TBODY/RECORDSET FUNCTIONALITY // //////////////////////////////////////////////////////////////////////////// /** * Updates TBODY. * * @method _uiSetRecordset * @param rs {Y.Recordset} New Recordset. * @protected */ _uiSetRecordset: function(rs) { var i = 0,//TODOthis.get("state.offsetIndex") len = rs.getLength(), //TODOthis.get("state.pageLength") tbody = this._tbodyNode, parent = tbody.get("parentNode"), nextSibling = tbody.next(), o = {tbody:tbody}; //TODO: not sure best time to do this -- depends on sdt // Move TBODY off DOM tbody.remove(); // Iterate Recordset to use existing TR when possible or add new TR for(; i<len; ++i) { o.record = rs.getRecord(i); o.rowindex = i; this._addTbodyTrNode(o); //TODO: sometimes rowindex != recordindex } // Re-attach TBODY to DOM parent.insert(tbody, nextSibling); }, /** * Creates and attaches data row element. * * @method _addTbodyTrNode * @param o {Object} {tbody, record} * @protected */ _addTbodyTrNode: function(o) { var tbody = o.tbody, record = o.record; o.tr = tbody.one("#"+record.get("id")) || this._createTbodyTrNode(o); this._attachTbodyTrNode(o); }, /** * Creates data row element. * * @method _createTbodyTrNode * @param o {Object} {tbody, record} * @protected * @returns Y.Node */ _createTbodyTrNode: function(o) { var tr = Ycreate(Ysubstitute(this.get("trTemplate"), {id:o.record.get("id")})), i = 0, allKeys = this.get("columnset").get("keys"), len = allKeys.length; o.tr = tr; for(; i<len; ++i) { o.column = allKeys[i]; this._addTbodyTdNode(o); } return tr; }, /** * Attaches data row element. * * @method _attachTbodyTrNode * @param o {Object} {tbody, record, tr}. * @protected */ _attachTbodyTrNode: function(o) { var tbody = o.tbody, tr = o.tr, index = o.rowindex, nextSibling = tbody.get("children").item(index) || null, isEven = (index%2===0); if(isEven) { tr.replaceClass(CLASS_ODD, CLASS_EVEN); } else { tr.replaceClass(CLASS_EVEN, CLASS_ODD); } tbody.insertBefore(tr, nextSibling); }, /** * Creates and attaches data cell element. * * @method _addTbodyTdNode * @param o {Object} {record, column, tr}. * @protected */ _addTbodyTdNode: function(o) { o.td = this._createTbodyTdNode(o); this._attachTbodyTdNode(o); }, /** * Creates data cell element. * * @method _createTbodyTdNode * @param o {Object} {record, column, tr}. * @protected * @returns Y.Node */ _createTbodyTdNode: function(o) { var column = o.column; //TODO: attributes? or methods? o.headers = column.get("headers"); o.classnames = column.get("classnames"); o.value = this.formatDataCell(o); return Ycreate(Ysubstitute(this.tdTemplate, o)); }, /** * Attaches data cell element. * * @method _attachTbodyTdNode * @param o {Object} {record, column, tr, headers, classnames, value}. * @protected */ _attachTbodyTdNode: function(o) { o.tr.appendChild(o.td); }, /** * Returns markup to insert into data cell element. * * @method formatDataCell * @param @param o {Object} {record, column, tr, headers, classnames}. */ formatDataCell: function(o) { var record = o.record; o.data = record.get("data"); o.value = record.getValue(o.column.get("key")); return Ysubstitute(this.get("tdValueTemplate"), o); } }); Y.namespace("DataTable").Base = DTBase; }, '@VERSION@' ,{requires:['intl','substitute','widget','recordset-base'], lang:['en']}); YUI.add('datatable-sort', function(Y) { /** * Plugs DataTable with sorting functionality. * * @module datatable * @submodule datatable-sort */ /** * Adds column sorting to DataTable. * @class DataTableSort * @extends Plugin.Base */ var YgetClassName = Y.ClassNameManager.getClassName, DATATABLE = "datatable", ASC = "asc", DESC = "desc", CLASS_ASC = YgetClassName(DATATABLE, "asc"), CLASS_DESC = YgetClassName(DATATABLE, "desc"), CLASS_SORTABLE = YgetClassName(DATATABLE, "sortable"), //TODO: Don't use hrefs - use tab/arrow/enter TEMPLATE = '<a class="{link_class}" title="{link_title}" href="{link_href}">{value}</a>'; function DataTableSort() { DataTableSort.superclass.constructor.apply(this, arguments); } ///////////////////////////////////////////////////////////////////////////// // // STATIC PROPERTIES // ///////////////////////////////////////////////////////////////////////////// Y.mix(DataTableSort, { /** * The namespace for the plugin. This will be the property on the host which * references the plugin instance. * * @property NS * @type String * @static * @final * @value "sort" */ NS: "sort", /** * Class name. * * @property NAME * @type String * @static * @final * @value "dataTableSort" */ NAME: "dataTableSort", ///////////////////////////////////////////////////////////////////////////// // // ATTRIBUTES // ///////////////////////////////////////////////////////////////////////////// ATTRS: { /** * @attribute trigger * @description Name of DataTable custom event that should trigger a * column to sort. * @type String * @default "theadCellClick" * @initOnly */ trigger: { value: "theadCellClick", writeOnce: "initOnly" }, /** * @attribute sortedBy * @description Sort state: {field,dir} * @type Object */ sortedBy: { value: null }, /** * @attribute template * @description Tokenized markup template for TH sort element. * @type String * @default '<a class="{link_class}" title="{link_title}" href="{link_href}">{value}</a>' */ template: { value: TEMPLATE } } }); ///////////////////////////////////////////////////////////////////////////// // // PROTOTYPE // ///////////////////////////////////////////////////////////////////////////// Y.extend(DataTableSort, Y.Plugin.Base, { ///////////////////////////////////////////////////////////////////////////// // // METHODS // ///////////////////////////////////////////////////////////////////////////// /** * Initializer. * * @method initializer * @param config {Object} Config object. * @private */ initializer: function(config) { var dt = this.get("host"); dt.get("recordset").plug(Y.Plugin.RecordsetSort, {dt: dt}); dt.get("recordset").sort.addTarget(dt); // Wrap link around TH value this.doBefore("_createTheadThNode", this._beforeCreateTheadThNode); // Add class this.doBefore("_attachTheadThNode", function(o) { if(o.column.get("sortable")) { o.th.addClass(CLASS_SORTABLE); } }); // Attach trigger handlers dt.on(this.get("trigger"), this._onEventSortColumn); // Attach UI hooks dt.after("recordsetSort:sort", function() { dt._uiSetRecordset(dt.get("recordset")); }); dt.after("sortedByChangeEvent", function() { //alert('ok'); }); //TODO //dt.after("recordset:mutation", function() {//reset sortedBy}); //TODO //add Column sortFn ATTR // Update UI after the fact (plug-then-render case) if(dt.get("rendered")) { dt._uiSetColumnset(dt.get("columnset")); } }, /** * Before header cell element is created, inserts link markup around {value}. * * @method _beforeCreateTheadThNode * @param o {Object} {value, column, tr}. * @protected */ _beforeCreateTheadThNode: function(o) { if(o.column.get("sortable")) { o.value = Y.substitute(this.get("template"), { link_class: "foo", link_title: "bar", link_href: "bat", value: o.value }); } }, /** * In response to the "trigger" event, sorts the underlying Recordset and * updates the sortedBy attribute. * * @method _beforeCreateTheadThNode * @param o {Object} {value, column, tr}. * @protected */ _onEventSortColumn: function(e) { e.halt(); //TODO: normalize e.currentTarget to TH var column = this.get("columnset").get("hash")[e.currentTarget.get("id")], field = column.get("field"), prevSortedBy = this.get("sortedBy"), dir = (prevSortedBy && prevSortedBy.field === field && prevSortedBy.dir === ASC) ? DESC : ASC, sorter = column.get("sortFn"); if(column.get("sortable")) { this.get("recordset").sort.sort(field, dir === DESC, sorter); this.set("sortedBy", {field: field, dir: dir}); } } }); Y.namespace("Plugin").DataTableSort = DataTableSort; }, '@VERSION@' ,{lang:['en'], requires:['plugin','datatable-base','recordset-sort']}); YUI.add('datatable-scroll', function(Y) { /** * Extends DataTable base to enable x,y, and xy scrolling. * @module datatable * @submodule datatable-scroll */ var YDo = Y.Do, YNode = Y.Node, YLang = Y.Lang, YUA = Y.UA, YStyleSheet = Y.StyleSheet, YgetClassName = Y.ClassNameManager.getClassName, DATATABLE = "datatable", CLASS_HEADER = YgetClassName(DATATABLE, "hd"), CLASS_BODY = YgetClassName(DATATABLE, "bd"), CLASS_LINER = YgetClassName(DATATABLE, "liner"), CLASS_SCROLLABLE = YgetClassName(DATATABLE, "scrollable"), CONTAINER_HEADER = '<div class="'+CLASS_HEADER+'"></div>', CONTAINER_BODY = '<div class="'+CLASS_BODY+'"></div>', TEMPLATE_TABLE = '<table></table>'; function DataTableScroll() { DataTableScroll.superclass.constructor.apply(this, arguments); } Y.mix(DataTableScroll, { NS: "scroll", NAME: "dataTableScroll", ATTRS: { /** * @description The width for the table. Set to a string (ex: "200px", "20em") * * @attribute width * @public * @static * @type string */ width: { value: undefined }, /** * @description The height for the table. Set to a string (ex: "200px", "20em") * * @attribute height * @public * @static * @type string */ height: { value: undefined }, /** * @description The scrolling direction for the table. Can be set to 'x', 'y', or 'xy' * * @attribute scroll * @public * @static * @type string */ scroll: { value: 'y' }, /** * @description The hexadecimal colour value to set on the top-right of the table if a scrollbar exists. * * @attribute COLOR_COLUMNFILLER * @public * @static * @type string */ COLOR_COLUMNFILLER: { value: '#f2f2f2', validator: YLang.isString, setter: function(param) { if (this._headerContainerNode) { this._headerContainerNode.setStyle('backgroundColor', param); } } } } }); Y.extend(DataTableScroll, Y.Plugin.Base, { /** * @description The table node created in datatable-base * * @property _parentTableNode * @private * @type Y.Node */ _parentTableNode: null, /** * @description The THEAD node which resides within the table node created in datatable-base * * @property _parentTheadNode * @private * @type Y.Node */ _parentTheadNode: null, /** * @description The TBODY node which resides within the table node created in datatable-base * * @property _parentTbodyNode * @private * @type Y.Node */ _parentTbodyNode: null, /** * @description The TBODY Message node which resides within the table node created in datatable-base * * @property _parentMsgNode * @private * @type Y.Node */ _parentMsgNode: null, /** * @description The contentBox specified for the datatable in datatable-base * * @property _parentContainer * @private * @type Y.Node */ _parentContainer: null, /** * @description The DIV node that contains all the scrollable elements (a table with a tbody on it) * * @property _bodyContainerNode * @private * @type Y.Node */ _bodyContainerNode: null, /** * @description The DIV node that contains a table with a THEAD in it (which syncs its horizontal scroll with the _bodyContainerNode above) * * @property _headerContainerNode * @private * @type Y.Node */ _headerContainerNode: null, //-------------------------------------- // Methods //-------------------------------------- initializer: function(config) { var dt = this.get("host"); this._parentContainer = dt.get('contentBox'); this._parentContainer.addClass(CLASS_SCROLLABLE); this._setUpNodes(); }, ///////////////////////////////////////////////////////////////////////////// // // Set up Table Nodes // ///////////////////////////////////////////////////////////////////////////// /** * @description Set up methods to fire after host methods execute * * @method _setUpNodes * @private */ _setUpNodes: function() { var dt = this.get('host'); this.afterHostMethod("_addTableNode", this._setUpParentTableNode); this.afterHostMethod("_addTheadNode", this._setUpParentTheadNode); this.afterHostMethod("_addTbodyNode", this._setUpParentTbodyNode); this.afterHostMethod("_addMessageNode", this._setUpParentMessageNode); this.afterHostMethod("renderUI", this.renderUI); this.afterHostMethod("syncUI", this.syncUI); if (this.get('scroll') !== 'x') { this.afterHostMethod('_attachTheadThNode', this._attachTheadThNode); this.afterHostMethod('_attachTbodyTdNode', this._attachTbodyTdNode); } }, /** * @description Stores the main <table> node provided by the host as a private property * * @method _setUpParentTableNode * @private */ _setUpParentTableNode: function() { this._parentTableNode = this.get('host')._tableNode; }, /** * @description Stores the main <thead> node provided by the host as a private property * * @method _setUpParentTheadNode * @private */ _setUpParentTheadNode: function() { this._parentTheadNode = this.get('host')._theadNode; }, /** * @description Stores the main <tbody> node provided by the host as a private property * * @method _setUpParentTbodyNode * @private */ _setUpParentTbodyNode: function() { this._parentTbodyNode = this.get('host')._tbodyNode; }, /** * @description Stores the main <tbody> message node provided by the host as a private property * * @method _setUpParentMessageNode * @private */ _setUpParentMessageNode: function() { this._parentMsgNode = this.get('host')._msgNode; }, ///////////////////////////////////////////////////////////////////////////// // // Renderer // ///////////////////////////////////////////////////////////////////////////// /** * @description Primary rendering method that takes the datatable rendered in * the host, and splits it up into two separate <divs> each containing two * separate tables (one containing the head and one containing the body). * This method fires after renderUI is called on datatable-base. * * @method renderUI * @public */ renderUI: function() { //Y.Profiler.start('render'); this._createBodyContainer(); this._createHeaderContainer(); this._setContentBoxDimensions(); //Y.Profiler.stop('render'); //console.log(Y.Profiler.getReport("render")); }, /** * @description Post rendering method that is responsible for creating a column * filler, and performing width and scroll synchronization between the <th> * elements and the <td> elements. * This method fires after syncUI is called on datatable-base * * @method syncUI * @public */ syncUI: function() { //Y.Profiler.start('sync'); this._syncWidths(); this._syncScroll(); //Y.Profiler.stop('sync'); //console.log(Y.Profiler.getReport("sync")); }, /** * @description Adjusts the width of the TH and the TDs to make sure that the two are in sync * * Implementation Details: * Compares the width of the TH liner div to the the width of the TD node. The TD liner width * is not actually used because the TD often stretches past the liner if the parent DIV is very * large. Measuring the TD width is more accurate. * * Instead of measuring via .get('width'), 'clientWidth' is used, as it returns a number, whereas * 'width' returns a string, In IE6, 'clientWidth' is not supported, so 'offsetWidth' is used. * 'offsetWidth' is not as accurate on Chrome,FF as 'clientWidth' - thus the need for the fork. * * @method _syncWidths * @public */ _syncWidths: function() { var th = YNode.all('#'+this._parentContainer.get('id')+' .yui3-datatable-hd table thead th'), //nodelist of all THs td = YNode.one('#'+this._parentContainer.get('id')+' .yui3-datatable-bd table .yui3-datatable-data').get('firstChild').get('children'), //nodelist of all TDs in 1st row i, len, thWidth, tdWidth, thLiner, tdLiner, ie = YUA.ie; //stylesheet = new YStyleSheet('columnsSheet'), //className; /* This for loop goes through the first row of TDs in the table. In a table, the width of the row is equal to the width of the longest cell in that column. Therefore, we can observe the widths of the cells in the first row only, as they will be the same in all the cells below (in each respective column) */ for (i=0, len = th.size(); i<len; i++) { //className = '.'+td.item(i).get('classList')._nodes[0]; //If a width has not been already set on the TD: //if (td.item(i).get('firstChild').getStyle('width') === "auto") { //Get the liners for the TH and the TD cell in question thLiner = th.item(i).get('firstChild'); //TODO: use liner API - how? this is a node. tdLiner = td.item(i).get('firstChild'); /* If browser is not IE - get the clientWidth of the Liner div and the TD. Note: We are not getting the width of the TDLiner, we are getting the width of the actual cell. Why? Because when the table is set to auto width, the cell will grow to try to fit the table in its container. The liner could potentially be much smaller than the cell width. TODO: Explore if there is a better way using only LINERS widths */ if (!ie) { thWidth = thLiner.get('clientWidth'); //TODO: this should actually be done with getComputedStyle('width') but this messes up columns. Explore this option. tdWidth = td.item(i).get('clientWidth'); } //IE wasn't recognizing clientWidths, so we are using offsetWidths. //TODO: should use getComputedStyle('width') because offsetWidth will screw up when padding is changed. else { thWidth = thLiner.get('offsetWidth'); tdWidth = td.item(i).get('offsetWidth'); //thWidth = parseFloat(thLiner.getComputedStyle('width').split('px')[0]); //tdWidth = parseFloat(td.item(i).getComputedStyle('width').split('px')[0]); /* TODO: for some reason, using tdLiner.get('clientWidth') doesn't work - why not? */ } //if TH is bigger than TD, enlarge TD Liner if (thWidth > tdWidth) { tdLiner.setStyle('width', (thWidth - 20 + 'px')); //thLiner.setStyle('width', (tdWidth - 20 + 'px')); //stylesheet.set(className,{'width': (thWidth - 20 + 'px')}); } //if TD is bigger than TH, enlarge TH Liner else if (tdWidth > thWidth) { thLiner.setStyle('width', (tdWidth - 20 + 'px')); //tdLiner.setStyle('width', (tdWidth - 20 + 'px')); //stylesheet.set(className,{'width': (tdWidth - 20 + 'px')}); } //} } //stylesheet.enable(); //After the widths have synced, there is a wrapping issue in the headerContainer in IE6. The header does not span the full //length of the table (does not cover all of the y-scrollbar). By adding this line in when there is a y-scroll, the header will span correctly. //TODO: this should not really occur on this.get('scroll') === y - it should occur when scrollHeight > clientHeight, but clientHeight is not getting recognized in IE6? if (ie && this.get('scroll') === 'y' && this._bodyContainerNode.get('scrollHeight') > this._bodyContainerNode.get('offsetHeight')) { this._headerContainerNode.setStyle('width', this._parentContainer.get('offsetWidth')+ 15 +'px'); } }, /** * @description Adds the approriate width to the liner divs of the TH nodes before they are appended to DOM * * @method _attachTheadThNode * @public */ _attachTheadThNode: function(o) { var w = o.column.get('width') || 'auto'; if (w !== 'auto') { o.th.get('firstChild').setStyles({'width': w, 'overflow':'hidden'}); //TODO: use liner API but liner is undefined here (not created?) } return o; }, /** * @description Adds the appropriate width to the liner divs of the TD nodes before they are appended to DOM * * @method _attachTbodyTdNode * @public */ _attachTbodyTdNode: function(o) { var w = o.column.get('width') || 'auto'; if (w !== 'auto') { o.td.get('firstChild').setStyles({'width': w, 'overflow': 'hidden'}); //TODO: use liner API but liner is undefined here (not created?) //o.td.setStyles({'width': w, 'overflow': 'hidden'}); } return o; }, /** * @description Creates the body DIV that contains all the data. * * @method _createBodyContainer * @private */ _createBodyContainer: function() { var bd = YNode.create(CONTAINER_BODY), onScrollFn = Y.bind("_onScroll", this); this._bodyContainerNode = bd; this._setStylesForTbody(); bd.appendChild(this._parentTableNode); this._parentContainer.appendChild(bd); bd.on('scroll', onScrollFn); }, /** * @description Creates the DIV that contains a <table> with all the headers. * * @method _createHeaderContainer * @private */ _createHeaderContainer: function() { var hd = YNode.create(CONTAINER_HEADER), tbl = YNode.create(TEMPLATE_TABLE); this._headerContainerNode = hd; //hd.setStyle('backgroundColor',this.get("COLOR_COLUMNFILLER")); this._setStylesForThead(); tbl.appendChild(this._parentTheadNode); hd.appendChild(tbl); this._parentContainer.prepend(hd); }, /** * @description Creates styles for the TBODY based on what type of table it is. * * @method _setStylesForTbody * @private */ _setStylesForTbody: function() { var dir = this.get('scroll'), w = this.get('width') || "", h = this.get('height') || "", el = this._bodyContainerNode, styles = {'width':"", 'height':h}; if (dir === 'x') { //X-Scrolling tables should not have a Y-Scrollbar so overflow-y is hidden. THe width on x-scrolling tables must be set by user. styles['overflowY'] = 'hidden'; styles['width'] = w; } else if (dir === 'y') { //Y-Scrolling tables should not have a X-Scrollbar so overflow-x is hidden. The width isn't neccessary because it can be auto. styles['overflowX'] = 'hidden'; } else { //assume xy - the width must be set on xy. styles['width'] = w; } el.setStyles(styles); return el; }, /** * @description Creates styles for the THEAD based on what type of datatable it is. * * @method _setStylesForThead * @private */ _setStylesForThead: function() { var dir = this.get('scroll'), w = this.get('width') || "", el = this._headerContainerNode; //if (dir !== 'y') { el.setStyles({'width': w, 'overflow': 'hidden'}); // } }, /** * @description Sets an auto width on the content box if it doesn't exist or if its a y-datatable. * * @method _setContentBoxDimensions * @private */ _setContentBoxDimensions: function() { if (this.get('scroll') === 'y' || (!this.get('width'))) { this._parentContainer.setStyle('width', 'auto'); } }, ///////////////////////////////////////////////////////////////////////////// // // Scroll Syncing // ///////////////////////////////////////////////////////////////////////////// /** * @description Ensures that scrolling is synced across the two tables * * @method _onScroll * @private */ _onScroll: function() { this._headerContainerNode.set('scrollLeft', this._bodyContainerNode.get('scrollLeft')); }, /** * @description Syncs padding around scrollable tables, including Column header right-padding * and container width and height. * * @method _syncScroll * @private */ _syncScroll : function() { this._syncScrollX(); this._syncScrollY(); this._syncScrollOverhang(); if(YUA.opera) { // Bug 1925874 this._headerContainerNode.set('scrollLeft', this._bodyContainerNode.get('scrollLeft')); if(!this.get("width")) { // Bug 1926125 document.body.style += ''; } } }, /** * @description Snaps container width for y-scrolling tables. * * @method _syncScrollY * @private */ _syncScrollY : function() { var tBody = this._parentTbodyNode, tBodyContainer = this._bodyContainerNode, w; // X-scrolling not enabled if(!this.get("width")) { // Snap outer container width to content w = (tBodyContainer.get('scrollHeight') > tBodyContainer.get('clientHeight')) ? // but account for y-scrollbar since it is visible (tBody.get('parentNode').get('clientWidth') + 19) + "px" : // no y-scrollbar, just borders (tBody.get('parentNode').get('clientWidth') + 2) + "px"; this._parentContainer.setStyle('width', w); } }, /** * @description Snaps container height for x-scrolling tables in IE. Syncs message TBODY width. * Taken from YUI2 ScrollingDataTable.js * * @method _syncScrollX * @private */ _syncScrollX: function() { var tBody = this._parentTbodyNode, tBodyContainer = this._bodyContainerNode, w; this._headerContainerNode.set('scrollLeft', this._bodyContainerNode.get('scrollLeft')); if(!this.get('height') && (YUA.ie)) { w = (tBodyContainer.get('scrollWidth') > tBodyContainer.get('offsetWidth')) ? (tBody.get('parentNode').get('offsetHeight') + 18) + "px" : tBody.get('parentNode').get('offsetHeight') + "px"; tBodyContainer.setStyle('height', w); } if (tBody.get('rows').length === 0) { this._parentMsgNode.get('parentNode').setStyle('width', this._parentTheadNode.get('parentNode').get('offsetWidth')+'px'); } else { this._parentMsgNode.get('parentNode').setStyle('width', ""); } }, /** * @description Adds/removes Column header overhang as necesary. * Taken from YUI2 ScrollingDataTable.js * * @method _syncScrollOverhang * @private */ _syncScrollOverhang: function() { var tBodyContainer = this._bodyContainerNode, padding = 1; //when its both x and y scrolling if ((tBodyContainer.get('scrollHeight') > tBodyContainer.get('clientHeight')) || (tBodyContainer.get('scrollWidth') > tBodyContainer.get('clientWidth'))) { padding = 18; } this._setOverhangValue(padding); }, /** * @description Sets Column header overhang to given width. * Taken from YUI2 ScrollingDataTable.js with minor modifications * * @method _setOverhangValue * @param nBorderWidth {Number} Value of new border for overhang. * @private */ _setOverhangValue: function(borderWidth) { var host = this.get('host'), cols = host.get('columnset').get('definitions'), //lastHeaders = cols[cols.length-1] || [], len = cols.length, value = borderWidth + "px solid " + this.get("COLOR_COLUMNFILLER"), children = YNode.all('#'+this._parentContainer.get('id')+ ' .' + CLASS_HEADER + ' table thead th'); children.item(len-1).setStyle('borderRight', value); } }); Y.namespace("Plugin").DataTableScroll = DataTableScroll; }, '@VERSION@' ,{requires:['plugin','datatable-base','stylesheet']}); YUI.add('datatable', function(Y){}, '@VERSION@' ,{use:['datatable-base','datatable-sort','datatable-scroll']});
upgle/cdnjs
ajax/libs/yui/3.3.0pr1/datatable/datatable-debug.js
JavaScript
mit
70,709
YUI.add('json-parse', function(Y) { /** * The JSON Utility provides methods to serialize JavaScript objects into * JSON strings and parse JavaScript objects from strings containing JSON data. * Three modules are available for inclusion: * <ol> * <li>1. <code>json-parse</code> for parsing JSON strings into native JavaScript data</li> * <li>2. <code>json-stringify</code> for stringification of JavaScript objects into JSON strings</li> * <li>3. <code>json</code> for both parsing and stringification</li> * </ol> * * Both <code>json-parse</code> and <code>json-stringify</code> create functions in a static JSON class under your YUI instance (e.g. Y.JSON.parse(..)). * @module json * @class JSON * @static */ /** * Provides Y.JSON.parse method to take JSON strings and return native * JavaScript objects. * @module json * @submodule json-parse * @for JSON * @static */ Y.JSON = Y.JSON || {}; // All internals kept private for security reasons /** * Replace certain Unicode characters that JavaScript may handle incorrectly * during eval--either by deleting them or treating them as line endings--with * escae sequences. * IMPORTANT NOTE: This regex will be used to modify the input if a match is * found. * @property _UNICODE_EXCEPTIONS * @type {RegExp} * @private */ var _UNICODE_EXCEPTIONS = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, /** * First step in the validation. Regex used to replace all escape * sequences (i.e. "\\", etc) with '@' characters (a non-JSON character). * @property _ESCAPES * @type {RegExp} * @private */ _ESCAPES = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, /** * Second step in the validation. Regex used to replace all simple * values with ']' characters. * @property _VALUES * @type {RegExp} * @private */ _VALUES = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, /** * Third step in the validation. Regex used to remove all open square * brackets following a colon, comma, or at the beginning of the string. * @property _BRACKETS * @type {RegExp} * @private */ _BRACKETS = /(?:^|:|,)(?:\s*\[)+/g, /** * Final step in the validation. Regex used to test the string left after * all previous replacements for invalid characters. * @property _INVALID * @type {RegExp} * @private */ _INVALID = /^[\],:{}\s]*$/, has = Object.prototype.hasOwnProperty, /** * Traverses nested objects, applying a reviver function to each (key,value) * from the scope if the key:value's containing object. The value returned * from the function will replace the original value in the key:value pair. * If the value returned is undefined, the key will be omitted from the * returned object. * @method _revive * @param data {MIXED} Any JavaScript data * @param reviver {Function} filter or mutation function * @return {MIXED} The results of the filtered data * @private */ _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 (has.call(value,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 a JSON string, returning the native JavaScript representation. * @param s {string} JSON string data * @param reviver {function} (optional) function(k,v) passed each key value pair of object literals, allowing pruning or altering values * @return {MIXED} the native JavaScript representation of the JSON string * @throws SyntaxError * @method parse * @static * @public */ Y.JSON.parse = function (s,reviver) { // Ensure valid JSON if (typeof s === 'string') { // Replace certain Unicode characters that are otherwise handled // incorrectly by some browser implementations. // NOTE: This modifies the input if such characters are found! s = s.replace(_UNICODE_EXCEPTIONS, function (c) { return '\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4); }); // Test for validity if (_INVALID.test(s.replace(_ESCAPES,'@'). replace(_VALUES,']'). replace(_BRACKETS,''))) { // Eval the text into a JavaScript data structure, apply any // reviver function, and return return _revive( eval('(' + s + ')'), reviver ); } } // The text is not JSON parsable throw new SyntaxError('parseJSON'); }; }, '@VERSION@' );
tonytlwu/cdnjs
ajax/libs/yui/3.0.0pr2/json/json-parse.js
JavaScript
mit
4,967
YUI.add('editor-selection', function(Y) { /** * Wraps some common Selection/Range functionality into a simple object * @class EditorSelection * @constructor * @module editor * @submodule selection */ //TODO This shouldn't be there, Y.Node doesn't normalize getting textnode content. var textContent = 'textContent', INNER_HTML = 'innerHTML', FONT_FAMILY = 'fontFamily'; if (Y.UA.ie) { textContent = 'nodeValue'; } Y.EditorSelection = function(domEvent) { var sel, par, ieNode, nodes, rng, i; if (Y.config.win.getSelection && (!Y.UA.ie || Y.UA.ie < 9)) { sel = Y.config.win.getSelection(); } else if (Y.config.doc.selection) { sel = Y.config.doc.selection.createRange(); } this._selection = sel; if (!sel) { return false; } if (sel.pasteHTML) { this.isCollapsed = (sel.compareEndPoints('StartToEnd', sel)) ? false : true; if (this.isCollapsed) { this.anchorNode = this.focusNode = Y.one(sel.parentElement()); if (domEvent) { ieNode = Y.config.doc.elementFromPoint(domEvent.clientX, domEvent.clientY); } rng = sel.duplicate(); if (!ieNode) { par = sel.parentElement(); nodes = par.childNodes; for (i = 0; i < nodes.length; i++) { //This causes IE to not allow a selection on a doubleclick //rng.select(nodes[i]); if (rng.inRange(sel)) { if (!ieNode) { ieNode = nodes[i]; } } } } this.ieNode = ieNode; if (ieNode) { if (ieNode.nodeType !== 3) { if (ieNode.firstChild) { ieNode = ieNode.firstChild; } if (ieNode && ieNode.tagName && ieNode.tagName.toLowerCase() === 'body') { if (ieNode.firstChild) { ieNode = ieNode.firstChild; } } } this.anchorNode = this.focusNode = Y.EditorSelection.resolve(ieNode); rng.moveToElementText(sel.parentElement()); var comp = sel.compareEndPoints('StartToStart', rng), moved = 0; if (comp) { //We are not at the beginning of the selection. //Setting the move to something large, may need to increase it later moved = Math.abs(sel.move('character', -9999)); } this.anchorOffset = this.focusOffset = moved; this.anchorTextNode = this.focusTextNode = Y.one(ieNode); } } else { //This helps IE deal with a selection and nodeChange events if (sel.htmlText && sel.htmlText !== '') { var n = Y.Node.create(sel.htmlText); if (n && n.get('id')) { var id = n.get('id'); this.anchorNode = this.focusNode = Y.one('#' + id); } else if (n) { n = n.get('childNodes'); this.anchorNode = this.focusNode = n.item(0); } } } //var self = this; //debugger; } else { this.isCollapsed = sel.isCollapsed; this.anchorNode = Y.EditorSelection.resolve(sel.anchorNode); this.focusNode = Y.EditorSelection.resolve(sel.focusNode); this.anchorOffset = sel.anchorOffset; this.focusOffset = sel.focusOffset; this.anchorTextNode = Y.one(sel.anchorNode); this.focusTextNode = Y.one(sel.focusNode); } if (Y.Lang.isString(sel.text)) { this.text = sel.text; } else { if (sel.toString) { this.text = sel.toString(); } else { this.text = ''; } } }; /** * Utility method to remove dead font-family styles from an element. * @static * @method removeFontFamily */ Y.EditorSelection.removeFontFamily = function(n) { n.removeAttribute('face'); var s = n.getAttribute('style').toLowerCase(); if (s === '' || (s == 'font-family: ')) { n.removeAttribute('style'); } if (s.match(Y.EditorSelection.REG_FONTFAMILY)) { s = s.replace(Y.EditorSelection.REG_FONTFAMILY, ''); n.setAttribute('style', s); } }; /** * Performs a prefilter on all nodes in the editor. Looks for nodes with a style: fontFamily or font face * It then creates a dynamic class assigns it and removed the property. This is so that we don't lose * the fontFamily when selecting nodes. * @static * @method filter */ Y.EditorSelection.filter = function(blocks) { var startTime = (new Date()).getTime(); Y.log('Filtering nodes', 'info', 'editor-selection'); var nodes = Y.all(Y.EditorSelection.ALL), baseNodes = Y.all('strong,em'), doc = Y.config.doc, hrs, classNames = {}, cssString = '', ls; var startTime1 = (new Date()).getTime(); nodes.each(function(n) { var raw = Y.Node.getDOMNode(n); if (raw.style[FONT_FAMILY]) { classNames['.' + n._yuid] = raw.style[FONT_FAMILY]; n.addClass(n._yuid); Y.EditorSelection.removeFontFamily(raw); } /* if (n.getStyle(FONT_FAMILY)) { classNames['.' + n._yuid] = n.getStyle(FONT_FAMILY); n.addClass(n._yuid); n.removeAttribute('face'); n.setStyle(FONT_FAMILY, ''); if (n.getAttribute('style') === '') { n.removeAttribute('style'); } //This is for IE if (n.getAttribute('style').toLowerCase() === 'font-family: ') { n.removeAttribute('style'); } } */ }); var endTime1 = (new Date()).getTime(); Y.log('Node Filter Timer: ' + (endTime1 - startTime1) + 'ms', 'info', 'editor-selection'); Y.all('.hr').addClass('yui-skip').addClass('yui-non'); if (Y.UA.ie) { hrs = doc.getElementsByTagName('hr'); Y.each(hrs, function(hr) { var el = doc.createElement('div'); el.className = 'hr yui-non yui-skip'; el.setAttribute('readonly', true); el.setAttribute('contenteditable', false); //Keep it from being Edited if (hr.parentNode) { hr.parentNode.replaceChild(el, hr); } //Had to move to inline style. writes for ie's < 8. They don't render el.setAttribute('style'); var s = el.style; s.border = '1px solid #ccc'; s.lineHeight = '0'; s.height = '0'; s.fontSize = '0'; s.marginTop = '5px'; s.marginBottom = '5px'; s.marginLeft = '0px'; s.marginRight = '0px'; s.padding = '0'; }); } Y.each(classNames, function(v, k) { cssString += k + ' { font-family: ' + v.replace(/"/gi, '') + '; }'; }); Y.StyleSheet(cssString, 'editor'); //Not sure about this one? baseNodes.each(function(n, k) { var t = n.get('tagName').toLowerCase(), newTag = 'i'; if (t === 'strong') { newTag = 'b'; } Y.EditorSelection.prototype._swap(baseNodes.item(k), newTag); }); //Filter out all the empty UL/OL's ls = Y.all('ol,ul'); ls.each(function(v, k) { var lis = v.all('li'); if (!lis.size()) { v.remove(); } }); if (blocks) { Y.EditorSelection.filterBlocks(); } var endTime = (new Date()).getTime(); Y.log('Filter Timer: ' + (endTime - startTime) + 'ms', 'info', 'editor-selection'); }; /** * Method attempts to replace all "orphined" text nodes in the main body by wrapping them with a <p>. Called from filter. * @static * @method filterBlocks */ Y.EditorSelection.filterBlocks = function() { var startTime = (new Date()).getTime(); Y.log('RAW filter blocks', 'info', 'editor-selection'); var childs = Y.config.doc.body.childNodes, i, node, wrapped = false, doit = true, sel, single, br, divs, spans, c, s; if (childs) { for (i = 0; i < childs.length; i++) { node = Y.one(childs[i]); if (!node.test(Y.EditorSelection.BLOCKS)) { doit = true; if (childs[i].nodeType == 3) { c = childs[i][textContent].match(Y.EditorSelection.REG_CHAR); s = childs[i][textContent].match(Y.EditorSelection.REG_NON); if (c === null && s) { doit = false; } } if (doit) { if (!wrapped) { wrapped = []; } wrapped.push(childs[i]); } } else { wrapped = Y.EditorSelection._wrapBlock(wrapped); } } wrapped = Y.EditorSelection._wrapBlock(wrapped); } single = Y.all(Y.EditorSelection.DEFAULT_BLOCK_TAG); if (single.size() === 1) { Y.log('Only One default block tag (' + Y.EditorSelection.DEFAULT_BLOCK_TAG + '), focus it..', 'info', 'editor-selection'); br = single.item(0).all('br'); if (br.size() === 1) { if (!br.item(0).test('.yui-cursor')) { br.item(0).remove(); } var html = single.item(0).get('innerHTML'); if (html === '' || html === ' ') { Y.log('Paragraph empty, focusing cursor', 'info', 'editor-selection'); single.set('innerHTML', Y.EditorSelection.CURSOR); sel = new Y.EditorSelection(); sel.focusCursor(true, true); } if (br.item(0).test('.yui-cursor') && Y.UA.ie) { br.item(0).remove(); } } } else { single.each(function(p) { var html = p.get('innerHTML'); if (html === '') { Y.log('Empty Paragraph Tag Found, Removing It', 'info', 'editor-selection'); p.remove(); } }); } if (!Y.UA.ie) { /* divs = Y.all('div, p'); divs.each(function(d) { if (d.hasClass('yui-non')) { return; } var html = d.get('innerHTML'); if (html === '') { Y.log('Empty DIV/P Tag Found, Removing It', 'info', 'editor-selection'); d.remove(); } else { Y.log('DIVS/PS Count: ' + d.get('childNodes').size(), 'info', 'editor-selection'); if (d.get('childNodes').size() == 1) { Y.log('This Div/P only has one Child Node', 'info', 'editor-selection'); if (d.ancestor('p')) { Y.log('This Div/P is a child of a paragraph, remove it..', 'info', 'editor-selection'); d.replace(d.get('firstChild')); } } } });*/ /* Removed this, as it was causing Pasting to be funky in Safari spans = Y.all('.Apple-style-span, .apple-style-span'); Y.log('Apple Spans found: ' + spans.size(), 'info', 'editor-selection'); spans.each(function(s) { s.setAttribute('style', ''); }); */ } var endTime = (new Date()).getTime(); Y.log('FilterBlocks Timer: ' + (endTime - startTime) + 'ms', 'info', 'editor-selection'); }; /** * Regular Expression used to find dead font-family styles * @static * @property REG_FONTFAMILY */ Y.EditorSelection.REG_FONTFAMILY = /font-family: ;/; /** * Regular Expression to determine if a string has a character in it * @static * @property REG_CHAR */ Y.EditorSelection.REG_CHAR = /[a-zA-Z-0-9_!@#\$%\^&*\(\)-=_+\[\]\\{}|;':",.\/<>\?]/gi; /** * Regular Expression to determine if a string has a non-character in it * @static * @property REG_NON */ Y.EditorSelection.REG_NON = /[\s|\n|\t]/gi; /** * Regular Expression to remove all HTML from a string * @static * @property REG_NOHTML */ Y.EditorSelection.REG_NOHTML = /<\S[^><]*>/g; /** * Wraps an array of elements in a Block level tag * @static * @private * @method _wrapBlock */ Y.EditorSelection._wrapBlock = function(wrapped) { if (wrapped) { var newChild = Y.Node.create('<' + Y.EditorSelection.DEFAULT_BLOCK_TAG + '></' + Y.EditorSelection.DEFAULT_BLOCK_TAG + '>'), firstChild = Y.one(wrapped[0]), i; for (i = 1; i < wrapped.length; i++) { newChild.append(wrapped[i]); } firstChild.replace(newChild); newChild.prepend(firstChild); } return false; }; /** * Undoes what filter does enough to return the HTML from the Editor, then re-applies the filter. * @static * @method unfilter * @return {String} The filtered HTML */ Y.EditorSelection.unfilter = function() { var nodes = Y.all('body [class]'), html = '', nons, ids, body = Y.one('body'); Y.log('UnFiltering nodes', 'info', 'editor-selection'); nodes.each(function(n) { if (n.hasClass(n._yuid)) { //One of ours n.setStyle(FONT_FAMILY, n.getStyle(FONT_FAMILY)); n.removeClass(n._yuid); if (n.getAttribute('class') === '') { n.removeAttribute('class'); } } }); nons = Y.all('.yui-non'); nons.each(function(n) { if (!n.hasClass('yui-skip') && n.get('innerHTML') === '') { n.remove(); } else { n.removeClass('yui-non').removeClass('yui-skip'); } }); ids = Y.all('body [id]'); ids.each(function(n) { if (n.get('id').indexOf('yui_3_') === 0) { n.removeAttribute('id'); n.removeAttribute('_yuid'); } }); if (body) { html = body.get('innerHTML'); } Y.all('.hr').addClass('yui-skip').addClass('yui-non'); /* nodes.each(function(n) { n.addClass(n._yuid); n.setStyle(FONT_FAMILY, ''); if (n.getAttribute('style') === '') { n.removeAttribute('style'); } }); */ return html; }; /** * Resolve a node from the selection object and return a Node instance * @static * @method resolve * @param {HTMLElement} n The HTMLElement to resolve. Might be a TextNode, gives parentNode. * @return {Node} The Resolved node */ Y.EditorSelection.resolve = function(n) { if (n && n.nodeType === 3) { //Adding a try/catch here because in rare occasions IE will //Throw a error accessing the parentNode of a stranded text node. //In the case of Ctrl+Z (Undo) try { n = n.parentNode; } catch (re) { n = 'body'; } } return Y.one(n); }; /** * Returns the innerHTML of a node with all HTML tags removed. * @static * @method getText * @param {Node} node The Node instance to remove the HTML from * @return {String} The string of text */ Y.EditorSelection.getText = function(node) { var txt = node.get('innerHTML').replace(Y.EditorSelection.REG_NOHTML, ''); //Clean out the cursor subs to see if the Node is empty txt = txt.replace('<span><br></span>', '').replace('<br>', ''); return txt; }; //Y.EditorSelection.DEFAULT_BLOCK_TAG = 'div'; Y.EditorSelection.DEFAULT_BLOCK_TAG = 'p'; /** * The selector to use when looking for Nodes to cache the value of: [style],font[face] * @static * @property ALL */ Y.EditorSelection.ALL = '[style],font[face]'; /** * The selector to use when looking for block level items. * @static * @property BLOCKS */ Y.EditorSelection.BLOCKS = 'p,div,ul,ol,table,style'; /** * The temporary fontname applied to a selection to retrieve their values: yui-tmp * @static * @property TMP */ Y.EditorSelection.TMP = 'yui-tmp'; /** * The default tag to use when creating elements: span * @static * @property DEFAULT_TAG */ Y.EditorSelection.DEFAULT_TAG = 'span'; /** * The id of the outer cursor wrapper * @static * @property DEFAULT_TAG */ Y.EditorSelection.CURID = 'yui-cursor'; /** * The id used to wrap the inner space of the cursor position * @static * @property CUR_WRAPID */ Y.EditorSelection.CUR_WRAPID = 'yui-cursor-wrapper'; /** * The default HTML used to focus the cursor.. * @static * @property CURSOR */ Y.EditorSelection.CURSOR = '<span><br class="yui-cursor"></span>'; Y.EditorSelection.hasCursor = function() { var cur = Y.all('#' + Y.EditorSelection.CUR_WRAPID); Y.log('Has Cursor: ' + cur.size(), 'info', 'editor-selection'); return cur.size(); }; /** * Called from Editor keydown to remove the "extra" space before the cursor. * @static * @method cleanCursor */ Y.EditorSelection.cleanCursor = function() { //Y.log('Cleaning Cursor', 'info', 'Selection'); var cur, sel = 'br.yui-cursor'; cur = Y.all(sel); if (cur.size()) { cur.each(function(b) { var c = b.get('parentNode.parentNode.childNodes'), html; if (c.size()) { b.remove(); } else { html = Y.EditorSelection.getText(c.item(0)); if (html !== '') { b.remove(); } } }); } /* var cur = Y.all('#' + Y.EditorSelection.CUR_WRAPID); if (cur.size()) { cur.each(function(c) { var html = c.get('innerHTML'); if (html == '&nbsp;' || html == '<br>') { if (c.previous() || c.next()) { c.remove(); } } }); } */ }; Y.EditorSelection.prototype = { /** * Range text value * @property text * @type String */ text: null, /** * Flag to show if the range is collapsed or not * @property isCollapsed * @type Boolean */ isCollapsed: null, /** * A Node instance of the parentNode of the anchorNode of the range * @property anchorNode * @type Node */ anchorNode: null, /** * The offset from the range object * @property anchorOffset * @type Number */ anchorOffset: null, /** * A Node instance of the actual textNode of the range. * @property anchorTextNode * @type Node */ anchorTextNode: null, /** * A Node instance of the parentNode of the focusNode of the range * @property focusNode * @type Node */ focusNode: null, /** * The offset from the range object * @property focusOffset * @type Number */ focusOffset: null, /** * A Node instance of the actual textNode of the range. * @property focusTextNode * @type Node */ focusTextNode: null, /** * The actual Selection/Range object * @property _selection * @private */ _selection: null, /** * Wrap an element, with another element * @private * @method _wrap * @param {HTMLElement} n The node to wrap * @param {String} tag The tag to use when creating the new element. * @return {HTMLElement} The wrapped node */ _wrap: function(n, tag) { var tmp = Y.Node.create('<' + tag + '></' + tag + '>'); tmp.set(INNER_HTML, n.get(INNER_HTML)); n.set(INNER_HTML, ''); n.append(tmp); return Y.Node.getDOMNode(tmp); }, /** * Swap an element, with another element * @private * @method _swap * @param {HTMLElement} n The node to swap * @param {String} tag The tag to use when creating the new element. * @return {HTMLElement} The new node */ _swap: function(n, tag) { var tmp = Y.Node.create('<' + tag + '></' + tag + '>'); tmp.set(INNER_HTML, n.get(INNER_HTML)); n.replace(tmp, n); return Y.Node.getDOMNode(tmp); }, /** * Get all the nodes in the current selection. This method will actually perform a filter first. * Then it calls doc.execCommand('fontname', null, 'yui-tmp') to touch all nodes in the selection. * The it compiles a list of all nodes affected by the execCommand and builds a NodeList to return. * @method getSelected * @return {NodeList} A NodeList of all items in the selection. */ getSelected: function() { Y.EditorSelection.filter(); Y.config.doc.execCommand('fontname', null, Y.EditorSelection.TMP); var nodes = Y.all(Y.EditorSelection.ALL), items = []; nodes.each(function(n, k) { if (n.getStyle(FONT_FAMILY) == Y.EditorSelection.TMP) { n.setStyle(FONT_FAMILY, ''); Y.EditorSelection.removeFontFamily(n); if (!n.test('body')) { items.push(Y.Node.getDOMNode(nodes.item(k))); } } }); return Y.all(items); }, /** * Insert HTML at the current cursor position and return a Node instance of the newly inserted element. * @method insertContent * @param {String} html The HTML to insert. * @return {Node} The inserted Node. */ insertContent: function(html) { return this.insertAtCursor(html, this.anchorTextNode, this.anchorOffset, true); }, /** * Insert HTML at the current cursor position, this method gives you control over the text node to insert into and the offset where to put it. * @method insertAtCursor * @param {String} html The HTML to insert. * @param {Node} node The text node to break when inserting. * @param {Number} offset The left offset of the text node to break and insert the new content. * @param {Boolean} collapse Should the range be collapsed after insertion. default: false * @return {Node} The inserted Node. */ insertAtCursor: function(html, node, offset, collapse) { var cur = Y.Node.create('<' + Y.EditorSelection.DEFAULT_TAG + ' class="yui-non"></' + Y.EditorSelection.DEFAULT_TAG + '>'), inHTML, txt, txt2, newNode, range = this.createRange(), b; if (node && node.test('body')) { b = Y.Node.create('<span></span>'); node.append(b); node = b; } if (range.pasteHTML) { if (offset === 0 && node && !node.previous() && node.get('nodeType') === 3) { /* * For some strange reason, range.pasteHTML fails if the node is a textNode and * the offset is 0. (The cursor is at the beginning of the line) * It will always insert the new content at position 1 instead of * position 0. Here we test for that case and do it the hard way. */ node.insert(html, 'before'); if (range.moveToElementText) { range.moveToElementText(Y.Node.getDOMNode(node.previous())); } //Move the cursor after the new node range.collapse(false); range.select(); return node.previous(); } else { newNode = Y.Node.create(html); try { range.pasteHTML('<span id="rte-insert"></span>'); } catch (e) {} inHTML = Y.one('#rte-insert'); if (inHTML) { inHTML.set('id', ''); inHTML.replace(newNode); if (range.moveToElementText) { range.moveToElementText(Y.Node.getDOMNode(newNode)); } range.collapse(false); range.select(); return newNode; } else { Y.on('available', function() { inHTML.set('id', ''); inHTML.replace(newNode); if (range.moveToElementText) { range.moveToElementText(Y.Node.getDOMNode(newNode)); } range.collapse(false); range.select(); }, '#rte-insert'); } } } else { //TODO using Y.Node.create here throws warnings & strips first white space character //txt = Y.one(Y.Node.create(inHTML.substr(0, offset))); //txt2 = Y.one(Y.Node.create(inHTML.substr(offset))); if (offset > 0) { inHTML = node.get(textContent); txt = Y.one(Y.config.doc.createTextNode(inHTML.substr(0, offset))); txt2 = Y.one(Y.config.doc.createTextNode(inHTML.substr(offset))); node.replace(txt, node); newNode = Y.Node.create(html); if (newNode.get('nodeType') === 11) { b = Y.Node.create('<span></span>'); b.append(newNode); newNode = b; } txt.insert(newNode, 'after'); //if (txt2 && txt2.get('length')) { if (txt2) { newNode.insert(cur, 'after'); cur.insert(txt2, 'after'); this.selectNode(cur, collapse); } } else { if (node.get('nodeType') === 3) { node = node.get('parentNode'); } newNode = Y.Node.create(html); html = node.get('innerHTML').replace(/\n/gi, ''); if (html === '' || html === '<br>') { node.append(newNode); } else { if (newNode.get('parentNode')) { node.insert(newNode, 'before'); } else { Y.one('body').prepend(newNode); } } if (node.get('firstChild').test('br')) { node.get('firstChild').remove(); } } } return newNode; }, /** * Get all elements inside a selection and wrap them with a new element and return a NodeList of all elements touched. * @method wrapContent * @param {String} tag The tag to wrap all selected items with. * @return {NodeList} A NodeList of all items in the selection. */ wrapContent: function(tag) { tag = (tag) ? tag : Y.EditorSelection.DEFAULT_TAG; if (!this.isCollapsed) { Y.log('Wrapping selection with: ' + tag, 'info', 'editor-selection'); var items = this.getSelected(), changed = [], range, last, first, range2; items.each(function(n, k) { var t = n.get('tagName').toLowerCase(); if (t === 'font') { changed.push(this._swap(items.item(k), tag)); } else { changed.push(this._wrap(items.item(k), tag)); } }, this); range = this.createRange(); first = changed[0]; last = changed[changed.length - 1]; if (this._selection.removeAllRanges) { range.setStart(changed[0], 0); range.setEnd(last, last.childNodes.length); this._selection.removeAllRanges(); this._selection.addRange(range); } else { if (range.moveToElementText) { range.moveToElementText(Y.Node.getDOMNode(first)); range2 = this.createRange(); range2.moveToElementText(Y.Node.getDOMNode(last)); range.setEndPoint('EndToEnd', range2); } range.select(); } changed = Y.all(changed); Y.log('Returning NodeList with (' + changed.size() + ') item(s)' , 'info', 'editor-selection'); return changed; } else { Y.log('Can not wrap a collapsed selection, use insertContent', 'error', 'editor-selection'); return Y.all([]); } }, /** * Find and replace a string inside a text node and replace it with HTML focusing the node after * to allow you to continue to type. * @method replace * @param {String} se The string to search for. * @param {String} re The string of HTML to replace it with. * @return {Node} The node inserted. */ replace: function(se,re) { Y.log('replacing (' + se + ') with (' + re + ')'); var range = this.createRange(), node, txt, index, newNode; if (range.getBookmark) { index = range.getBookmark(); txt = this.anchorNode.get('innerHTML').replace(se, re); this.anchorNode.set('innerHTML', txt); range.moveToBookmark(index); newNode = Y.one(range.parentElement()); } else { node = this.anchorTextNode; txt = node.get(textContent); index = txt.indexOf(se); txt = txt.replace(se, ''); node.set(textContent, txt); newNode = this.insertAtCursor(re, node, index, true); } return newNode; }, /** * Destroy the range. * @method remove * @chainable * @return {EditorSelection} */ remove: function() { if (this._selection && this._selection.removeAllRanges) { this._selection.removeAllRanges(); } return this; }, /** * Wrapper for the different range creation methods. * @method createRange * @return {RangeObject} */ createRange: function() { if (Y.config.doc.selection) { return Y.config.doc.selection.createRange(); } else { return Y.config.doc.createRange(); } }, /** * Select a Node (hilighting it). * @method selectNode * @param {Node} node The node to select * @param {Boolean} collapse Should the range be collapsed after insertion. default: false * @chainable * @return {EditorSelection} */ selectNode: function(node, collapse, end) { if (!node) { Y.log('Node passed to selectNode is null', 'error', 'editor-selection'); return; } end = end || 0; node = Y.Node.getDOMNode(node); var range = this.createRange(); if (range.selectNode) { range.selectNode(node); this._selection.removeAllRanges(); this._selection.addRange(range); if (collapse) { try { this._selection.collapse(node, end); } catch (err) { this._selection.collapse(node, 0); } } } else { if (node.nodeType === 3) { node = node.parentNode; } try { range.moveToElementText(node); } catch(e) {} if (collapse) { range.collapse(((end) ? false : true)); } range.select(); } return this; }, /** * Put a placeholder in the DOM at the current cursor position. * @method setCursor * @return {Node} */ setCursor: function() { this.removeCursor(false); return this.insertContent(Y.EditorSelection.CURSOR); }, /** * Get the placeholder in the DOM at the current cursor position. * @method getCursor * @return {Node} */ getCursor: function() { return Y.all('#' + Y.EditorSelection.CURID); }, /** * Remove the cursor placeholder from the DOM. * @method removeCursor * @param {Boolean} keep Setting this to true will keep the node, but remove the unique parts that make it the cursor. * @return {Node} */ removeCursor: function(keep) { var cur = this.getCursor(); if (cur) { if (keep) { cur.removeAttribute('id'); cur.set('innerHTML', '<br class="yui-cursor">'); } else { cur.remove(); } } return cur; }, /** * Gets a stored cursor and focuses it for editing, must be called sometime after setCursor * @method focusCursor * @return {Node} */ focusCursor: function(collapse, end) { if (collapse !== false) { collapse = true; } if (end !== false) { end = true; } var cur = this.removeCursor(true); if (cur) { cur.each(function(c) { this.selectNode(c, collapse, end); }, this); } }, /** * Generic toString for logging. * @method toString * @return {String} */ toString: function() { return 'EditorSelection Object'; } }; //TODO Remove this alias in 3.6.0 Y.Selection = Y.EditorSelection; }, '@VERSION@' ,{requires:['node'], skinnable:false});
froala/cdnjs
ajax/libs/yui/3.6.0pr2/editor-selection/editor-selection-debug.js
JavaScript
mit
37,233
.yui3-calendar-header{padding-left:15px;padding-right:15px}.yui3-calendar-header-label{width:100%}.yui3-calendarnav-prevmonth{cursor:pointer}.yui3-calendarnav-nextmonth{cursor:pointer}.yui3-skin-night .yui3-calendarnav-prevmonth,.yui3-skin-night .yui3-calendarnav-nextmonth{color:#fff;width:12px;height:14px;background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALZJREFUeNpi/P//PwORQBqIu6DsMiB+SpQukAUEMCcQVwPx5/8I8BkqxklIPyHDA4H44X/c4CFUDckWGADxgf/EgwNQPQQtEALiaf/JB9OgZmBYwAzERUD84T/l4APULGaYBR5AfPU/9QHITA8maGJiY6A+YENOpmw0CCI2bJEsCsRzKDB8DtSMgUum6DiKiIwWRUlOhhUVdUD8Dcngb1AxgkUFIwmFnRwQt0PZlUD8iBhNAAEGALbfq7SGiQoPAAAAAElFTkSuQmCC);background-repeat:no-repeat}.yui3-skin-night .yui3-calendarnav-prevmonth:hover,.yui3-skin-night .yui3-calendarnav-nextmonth:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPpJREFUeNpi/P//PwMxQD9jszSQ6oJyyy7O8H1KjD5GQhYADeYEUkVAXAHEPFDhL0DcAcR9QIu+k20B0PBAIDUBiOVwKHkExAVAS9aTZAHQYAOowfYMxIGDUIsu4LUAaLAQkGoB4kwG8sB0IK4BWvQOxQKgwcxAdj4Q1wExPwNl4CMQNwHxRKBFfxn10jd5ADm9QKzFQF1wDYiLmaAcNgbqA7CZTEBv7ADS2iDboN5joEIQgczSBpmNHsmiQKodiJPJNHwuEFcCDX49MMkUi0VRUB/hy2ggFy+jtKgohRYVnFDh79CiopuiogLNIjmobxigrn5EjD6AAAMAok9vhfHG8wQAAAAASUVORK5CYII=);color:#06c}.yui3-skin-night .yui3-calendarnav-month-disabled,.yui3-skin-night .yui3-calendarnav-month-disabled:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQhJREFUeNqs0yGLAlEUhuHrKoIgCFbBJghb3F+g0WrVarEqLIhBEEFYWKNNMBktU4z6C5RNkwyCyWQSTPuOfCOCrHNnxwMPyOGe73DAiTmOYywrhy/9/sTBZujN4k0KPbioi6teKuqCmsKGSN/10+q5ehN6QQkrLJB/Mp/Xm5VmAhdkMcEGZWNfZc1MlPGwII42dmiZ/1dLGW1lXhdU8YNvZEz0yijLy6z6FyTN6yvpX7DEOzo4vSD4pCwvc+lfcMEYBUwjhE+VMVbmw7/oiCY+sA4RvNZMUxmB38EWFTSwfxK815uKZkJ/yXMU0cf5rn9Wr6g3f1bC4nwvbIAZRup1Ay671a8AAwC3OzOqxK+rkwAAAABJRU5ErkJggg==);cursor:default;color:#ccc}.yui3-skin-night .yui3-calendarnav-prevmonth,.yui3-skin-night .yui3-calendarnav-prevmonth:hover{background-position:0 0;margin-left:-12px}.yui3-skin-night .yui3-calendarnav-nextmonth,.yui3-skin-night .yui3-calendarnav-nextmonth:hover{background-position:-12px 0;margin-right:-12px}.yui3-skin-night .yui3-calendarnav-prevmonth span,.yui3-skin-night .yui3-calendarnav-nextmonth span{display:none;*display:block}#yui3-css-stamp.skin-night-calendarnavigator{display:none}
taydakov/cdnjs
ajax/libs/yui/3.7.0pr1/calendarnavigator/assets/skins/night/calendarnavigator.css
CSS
mit
2,509
/*! * Fine Uploader * * Copyright 2015, Widen Enterprises, Inc. info@fineuploader.com * * Version: 5.2.2 * * Homepage: http://fineuploader.com * * Repository: git://github.com/FineUploader/fine-uploader.git * * Licensed only under the Widen Commercial License (http://fineuploader.com/licensing). */ /*! fine-uploader 2015-06-09 */ .qq-gallery .qq-btn{float:right;border:0;padding:0;margin:0;box-shadow:none}.qq-gallery .qq-upload-button{display:inline;width:105px;padding:7px 10px;float:left;text-align:center;background:#00ABC7;color:#FFF;border-radius:2px;border:1px solid #37B7CC;box-shadow:0 1px 1px rgba(255,255,255,.37) inset,1px 0 1px rgba(255,255,255,.07) inset,0 1px 0 rgba(0,0,0,.36),0 -2px 12px rgba(0,0,0,.08) inset}.qq-gallery .qq-upload-button-hover{background:#33B6CC}.qq-gallery .qq-upload-button-focus{outline:1px dotted #000}.qq-gallery.qq-uploader{position:relative;min-height:200px;max-height:490px;overflow-y:hidden;width:inherit;border-radius:6px;border:1px dashed #CCC;background-color:#FAFAFA;padding:20px}.qq-gallery.qq-uploader:before{content:attr(qq-drop-area-text) " ";position:absolute;font-size:200%;left:0;width:100%;text-align:center;top:45%;opacity:.25;filter:alpha(opacity=25)}.qq-gallery .qq-upload-drop-area,.qq-upload-extra-drop-area{position:absolute;top:0;left:0;width:100%;height:100%;min-height:30px;z-index:2;background:#F9F9F9;border-radius:4px;text-align:center}.qq-gallery .qq-upload-drop-area span{display:block;position:absolute;top:50%;width:100%;margin-top:-8px;font-size:16px}.qq-gallery .qq-upload-extra-drop-area{position:relative;margin-top:50px;font-size:16px;padding-top:30px;height:20px;min-height:40px}.qq-gallery .qq-upload-drop-area-active{background:#FDFDFD;border-radius:4px}.qq-gallery .qq-upload-list{margin:0;padding:10px 0 0;list-style:none;max-height:450px;overflow-y:auto;clear:both;box-shadow:none}.qq-gallery .qq-upload-list li{display:inline-block;position:relative;max-width:120px;margin:0 25px 25px 0;padding:0;line-height:16px;font-size:13px;color:#424242;background-color:#FFF;border-radius:2px;box-shadow:0 1px 1px 0 rgba(0,0,0,.22);vertical-align:top;height:186px}.qq-gallery .qq-upload-spinner,.qq-gallery .qq-upload-size,.qq-gallery .qq-upload-retry,.qq-gallery .qq-upload-failed-text,.qq-gallery .qq-upload-delete,.qq-gallery .qq-upload-pause,.qq-gallery .qq-upload-continue{display:inline}.qq-gallery .qq-upload-retry:hover,.qq-gallery .qq-upload-delete:hover,.qq-gallery .qq-upload-pause:hover,.qq-gallery .qq-upload-continue:hover{background-color:transparent}.qq-gallery .qq-upload-delete,.qq-gallery .qq-upload-pause,.qq-gallery .qq-upload-continue,.qq-gallery .qq-upload-cancel{cursor:pointer}.qq-gallery .qq-upload-delete,.qq-gallery .qq-upload-pause,.qq-gallery .qq-upload-continue{border:0;background:0;color:#00A0BA;font-size:12px;padding:0}.qq-gallery .qq-upload-status-text{color:#333;font-size:12px;padding-left:3px;padding-top:2px;width:inherit;display:none;width:108px}.qq-gallery .qq-upload-fail .qq-upload-status-text{text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;display:block}.qq-gallery .qq-upload-retrying .qq-upload-status-text{display:inline-block}.qq-gallery .qq-upload-retrying .qq-progress-bar-container{display:none}.qq-gallery .qq-upload-cancel{background-color:#525252;color:#F7F7F7;font-weight:700;font-family:Arial,Helvetica,sans-serif;border-radius:12px;border:0;height:22px;width:22px;padding:4px;position:absolute;right:-5px;top:-6px;margin:0;line-height:17px}.qq-gallery .qq-upload-cancel:hover{background-color:#525252}.qq-gallery .qq-upload-retry{cursor:pointer;position:absolute;top:30px;left:50%;margin-left:-31px;box-shadow:0 1px 1px rgba(255,255,255,.37) inset,1px 0 1px rgba(255,255,255,.07) inset,0 4px 4px rgba(0,0,0,.5),0 -2px 12px rgba(0,0,0,.08) inset;padding:3px 4px;border:1px solid #d2ddc7;border-radius:2px;color:inherit;background-color:#EBF6E0;z-index:1}.qq-gallery .qq-upload-retry:hover{background-color:#f7ffec}.qq-gallery .qq-file-info{padding:10px 6px 4px;margin-top:-3px;border-radius:0 0 2px 2px;text-align:left;overflow:hidden}.qq-gallery .qq-file-info .qq-file-name{position:relative}.qq-gallery .qq-upload-file{display:block;margin-right:0;margin-bottom:3px;width:auto;text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden}.qq-gallery .qq-upload-spinner{display:inline-block;background:url(loading.gif);position:absolute;left:50%;margin-left:-7px;top:53px;width:15px;height:15px;vertical-align:text-bottom}.qq-gallery .qq-drop-processing{display:block}.qq-gallery .qq-drop-processing-spinner{display:inline-block;background:url(processing.gif);width:24px;height:24px;vertical-align:text-bottom}.qq-gallery .qq-upload-failed-text{display:none;font-style:italic;font-weight:700}.qq-gallery .qq-upload-failed-icon{display:none;width:15px;height:15px;vertical-align:text-bottom}.qq-gallery .qq-upload-fail .qq-upload-failed-text{display:inline}.qq-gallery .qq-upload-retrying .qq-upload-failed-text{display:inline}.qq-gallery .qq-upload-list li.qq-upload-success{background-color:#F2F7ED}.qq-gallery .qq-upload-list li.qq-upload-fail{background-color:#F5EDED;box-shadow:0 0 1px 0 red;border:0}.qq-gallery .qq-progress-bar{display:block;background:#00abc7;width:0;height:15px;border-radius:6px;margin-bottom:3px}.qq-gallery .qq-total-progress-bar{height:25px;border-radius:9px}.qq-gallery .qq-total-progress-bar-container{margin-left:9px;display:inline;float:right;width:500px}.qq-gallery .qq-upload-size{float:left;font-size:11px;color:#929292;margin-bottom:3px;margin-right:0;display:inline-block}.qq-gallery INPUT.qq-edit-filename{position:absolute;opacity:0;filter:alpha(opacity=0);z-index:-1;-ms-filter:"alpha(Opacity=0)"}.qq-gallery .qq-upload-file.qq-editable{cursor:pointer;margin-right:20px}.qq-gallery .qq-edit-filename-icon.qq-editable{display:inline-block;cursor:pointer;position:absolute;right:0;top:0}.qq-gallery INPUT.qq-edit-filename.qq-editing{position:static;height:28px;width:90px;width:-moz-available;padding:0 8px;margin-bottom:3px;border:1px solid #ccc;border-radius:2px;font-size:13px;opacity:1;filter:alpha(opacity=100);-ms-filter:"alpha(Opacity=100)"}.qq-gallery .qq-edit-filename-icon{display:none;background:url(edit.gif);width:15px;height:15px;vertical-align:text-bottom}.qq-gallery .qq-delete-icon{background:url(trash.gif);width:15px;height:15px;vertical-align:sub;display:inline-block}.qq-gallery .qq-retry-icon{background:url(retry.gif);width:15px;height:15px;vertical-align:sub;display:inline-block;float:none}.qq-gallery .qq-continue-icon{background:url(continue.gif);width:15px;height:15px;vertical-align:sub;display:inline-block}.qq-gallery .qq-pause-icon{background:url(pause.gif);width:15px;height:15px;vertical-align:sub;display:inline-block}.qq-gallery .qq-hide{display:none}.qq-gallery .qq-in-progress .qq-thumbnail-wrapper{opacity:.5;filter:alpha(opacity=50)}.qq-gallery .qq-thumbnail-wrapper{overflow:hidden;position:relative;height:120px;width:120px}.qq-gallery .qq-thumbnail-selector{border-radius:2px 2px 0 0;bottom:0;top:0;margin:auto;display:block}:root *> .qq-gallery .qq-thumbnail-selector{position:relative;top:50%;transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);-webkit-transform:translateY(-50%)}.qq-gallery.qq-uploader DIALOG{display:none}.qq-gallery.qq-uploader DIALOG[open]{display:block}.qq-gallery.qq-uploader DIALOG{display:none}.qq-gallery.qq-uploader DIALOG[open]{display:block}.qq-gallery.qq-uploader DIALOG .qq-dialog-buttons{text-align:center;padding-top:10px}.qq-gallery.qq-uploader DIALOG .qq-dialog-buttons BUTTON{margin-left:5px;margin-right:5px}.qq-gallery.qq-uploader DIALOG .qq-dialog-message-selector{padding-bottom:10px}.qq-gallery .qq-uploader DIALOG::backdrop{background-color:rgba(0,0,0,.7)} /*! 2015-06-09 */
dhenson02/cdnjs
ajax/libs/file-uploader/5.2.2/azure.fine-uploader/fine-uploader-gallery.min.css
CSS
mit
7,790
/** * @license * lodash 3.0.0 (Custom Build) lodash.com/license | Underscore.js 1.7.0 underscorejs.org/LICENSE * Build: `lodash modern -o ./lodash.js` */ ;(function(){function n(n,t){if(n!==t){var r=n===n,e=t===t;if(n>t||!r||typeof n=="undefined"&&e)return 1;if(n<t||!e||typeof t=="undefined"&&r)return-1}return 0}function t(n,t,r){if(t!==t)return p(n,r);r=(r||0)-1;for(var e=n.length;++r<e;)if(n[r]===t)return r;return-1}function r(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].c;return n}function e(n){return typeof n=="string"?n:null==n?"":n+""}function u(n){return n.charCodeAt(0)}function o(n,t){for(var r=-1,e=n.length;++r<e&&-1<t.indexOf(n.charAt(r)););return r }function i(n,t){for(var r=n.length;r--&&-1<t.indexOf(n.charAt(r)););return r}function a(t,r){return n(t.a,r.a)||t.b-r.b}function f(t,r){for(var e=-1,u=t.a,o=r.a,i=u.length;++e<i;){var a=n(u[e],o[e]);if(a)return a}return t.b-r.b}function c(n){return Wt[n]}function l(n){return Nt[n]}function s(n){return"\\"+Lt[n]}function p(n,t,r){var e=n.length;for(t=r?t||e:(t||0)-1;r?t--:++t<e;){var u=n[t];if(u!==u)return t}return-1}function h(n){return n&&typeof n=="object"||false}function g(n){return 160>=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n) }function v(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;)n[r]===t&&(n[r]=B,o[++u]=r);return o}function d(n){for(var t=-1,r=n.length;++t<r&&g(n.charCodeAt(t)););return t}function y(n){for(var t=n.length;t--&&g(n.charCodeAt(t)););return t}function _(n){return Ft[n]}function m(g){function Wt(n){if(h(n)&&!To(n)){if(n instanceof Nt)return n;if(Nu.call(n,"__wrapped__"))return new Nt(n.__wrapped__,n.__chain__,zt(n.__actions__))}return new Nt(n)}function Nt(n,t,r){this.__actions__=r||[],this.__chain__=!!t,this.__wrapped__=n }function Ft(n){this.actions=null,this.dir=1,this.dropCount=0,this.filtered=false,this.iteratees=null,this.takeCount=lo,this.views=null,this.wrapped=n}function Ut(){this.__data__={}}function Lt(n){var t=n?n.length:0;for(this.data={hash:no(null),set:new Yu};t--;)this.push(n[t])}function Bt(n,t){var r=n.data;return(typeof t=="string"||Ge(t)?r.set.has(t):r.hash[t])?0:-1}function zt(n,t){var r=-1,e=n.length;for(t||(t=mu(e));++r<e;)t[r]=n[r];return t}function Mt(n,t){for(var r=-1,e=n.length;++r<e&&false!==t(n[r],r,n););return n }function qt(n,t){for(var r=-1,e=n.length;++r<e;)if(!t(n[r],r,n))return false;return true}function Pt(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;){var i=n[r];t(i,r,n)&&(o[++u]=i)}return o}function Kt(n,t){for(var r=-1,e=n.length,u=mu(e);++r<e;)u[r]=t(n[r],r,n);return u}function Vt(n){for(var t=-1,r=n.length,e=co;++t<r;){var u=n[t];u>e&&(e=u)}return e}function Yt(n,t,r,e){var u=-1,o=n.length;for(e&&o&&(r=n[++u]);++u<o;)r=t(r,n[u],u,n);return r}function Zt(n,t,r,e){var u=n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n); return r}function Gt(n,t){for(var r=-1,e=n.length;++r<e;)if(t(n[r],r,n))return true;return false}function Jt(n,t){return typeof n=="undefined"?t:n}function Xt(n,t,r,e){return typeof n!="undefined"&&Nu.call(e,r)?n:t}function Ht(n,t,r){var e=Fo(t);if(!r)return nr(t,n,e);for(var u=-1,o=e.length;++u<o;){var i=e[u],a=n[i],f=r(a,t[i],i,n,t);(f===f?f===a:a!==a)&&(typeof a!="undefined"||i in n)||(n[i]=f)}return n}function Qt(n,t){for(var r=-1,e=n.length,u=ue(e),o=t.length,i=mu(o);++r<o;){var a=t[r];u?(a=parseFloat(a),i[r]=re(a,e)?n[a]:b):i[r]=n[a] }return i}function nr(n,t,r){r||(r=t,t={});for(var e=-1,u=r.length;++e<u;){var o=r[e];t[o]=n[o]}return t}function tr(n,t,r){var u=typeof n;if("function"==u){if(u=typeof t!="undefined"){var u=Wt.support,o=!(u.funcNames?n.name:u.funcDecomp);if(!o){var i=Su.call(n);u.funcNames||(o=!_t.test(i)),o||(o=kt.test(i)||Je(n),bo(n,o))}u=o}n=u?Wr(n,t,r):n}else n=null==n?gu:"object"==u?wr(n,!r):Ar(r?e(n):n);return n}function rr(n,t,r,e,u,o,i){var a;if(r&&(a=u?r(n,e,u):r(n)),typeof a!="undefined")return a;if(!Ge(n))return n; if(e=To(n)){if(a=Qr(n),!t)return zt(n,a)}else{var f=Uu.call(n),c=f==K;if(f!=Y&&f!=z&&(!c||u))return Tt[f]?te(n,f,t):u?n:{};if(a=ne(c?{}:n),!t)return nr(n,a,Fo(n))}for(o||(o=[]),i||(i=[]),u=o.length;u--;)if(o[u]==n)return i[u];return o.push(n),i.push(a),(e?Mt:gr)(n,function(e,u){a[u]=rr(e,t,r,u,n,o,i)}),a}function er(n,t,r,e){if(!Ze(n))throw new Iu($);return Zu(function(){n.apply(b,Er(r,e))},t)}function ur(n,r){var e=n?n.length:0,u=[];if(!e)return u;var o=-1,i=Hr(),a=i==t,f=a&&200<=r.length&&wo(r),c=r.length; f&&(i=Bt,a=false,r=f);n:for(;++o<e;)if(f=n[o],a&&f===f){for(var l=c;l--;)if(r[l]===f)continue n;u.push(f)}else 0>i(r,f)&&u.push(f);return u}function or(n,t){var r=n?n.length:0;if(!ue(r))return gr(n,t);for(var e=-1,u=se(n);++e<r&&false!==t(u[e],e,u););return n}function ir(n,t){var r=n?n.length:0;if(!ue(r))return vr(n,t);for(var e=se(n);r--&&false!==t(e[r],r,e););return n}function ar(n,t){var r=true;return or(n,function(n,e,u){return r=!!t(n,e,u)}),r}function fr(n,t){var r=[];return or(n,function(n,e,u){t(n,e,u)&&r.push(n) }),r}function cr(n,t,r,e){var u;return r(n,function(n,r,o){return t(n,r,o)?(u=e?r:n,false):void 0}),u}function lr(n,t,r,e){e=(e||0)-1;for(var u=n.length,o=-1,i=[];++e<u;){var a=n[e];if(h(a)&&ue(a.length)&&(To(a)||Ke(a))){t&&(a=lr(a,t,r));var f=-1,c=a.length;for(i.length+=c;++f<c;)i[++o]=a[f]}else r||(i[++o]=a)}return i}function sr(n,t,r){var e=-1,u=se(n);r=r(n);for(var o=r.length;++e<o;){var i=r[e];if(false===t(u[i],i,u))break}return n}function pr(n,t,r){var e=se(n);r=r(n);for(var u=r.length;u--;){var o=r[u]; if(false===t(e[o],o,e))break}return n}function hr(n,t){sr(n,t,eu)}function gr(n,t){return sr(n,t,Fo)}function vr(n,t){return pr(n,t,Fo)}function dr(n,t){for(var r=-1,e=t.length,u=-1,o=[];++r<e;){var i=t[r];Ze(n[i])&&(o[++u]=i)}return o}function yr(n,t,r){var e=-1,u=typeof t=="function",o=n?n.length:0,i=ue(o)?mu(o):[];return or(n,function(n){var o=u?t:null!=n&&n[t];i[++e]=o?o.apply(n,r):b}),i}function _r(n,t,r,e,u,o){if(n===t)return 0!==n||1/n==1/t;var i=typeof n,a=typeof t;if("function"!=i&&"object"!=i&&"function"!=a&&"object"!=a||null==n||null==t)n=n!==n&&t!==t; else n:{var i=_r,a=To(n),f=To(t),c=D,l=D;a||(c=Uu.call(n),c==z?c=Y:c!=Y&&(a=nu(n))),f||(l=Uu.call(t),l==z?l=Y:l!=Y&&nu(t));var s=c==Y,f=l==Y,l=c==l;if(!l||a||s)if(c=s&&Nu.call(n,"__wrapped__"),f=f&&Nu.call(t,"__wrapped__"),c||f)n=i(c?n.value():n,f?t.value():t,r,e,u,o);else if(l){for(u||(u=[]),o||(o=[]),c=u.length;c--;)if(u[c]==n){n=o[c]==t;break n}u.push(n),o.push(t),n=(a?Yr:Gr)(n,t,i,r,e,u,o),u.pop(),o.pop()}else n=false;else n=Zr(n,t,c)}return n}function mr(n,t,r,e,u){var o=t.length;if(null==n)return!o; for(var i=-1,a=!u;++i<o;)if(a&&e[i]?r[i]!==n[t[i]]:!Nu.call(n,t[i]))return false;for(i=-1;++i<o;){var f=t[i];if(a&&e[i])f=Nu.call(n,f);else{var c=n[f],l=r[i],f=u?u(c,l,f):b;typeof f=="undefined"&&(f=_r(l,c,u,true))}if(!f)return false}return true}function br(n,t){var r=[];return or(n,function(n,e,u){r.push(t(n,e,u))}),r}function wr(n,t){var r=Fo(n),e=r.length;if(1==e){var u=r[0],o=n[u];if(oe(o))return function(n){return null!=n&&o===n[u]&&Nu.call(n,u)}}t&&(n=rr(n,true));for(var i=mu(e),a=mu(e);e--;)o=n[r[e]],i[e]=o,a[e]=oe(o); return function(n){return mr(n,r,i,a)}}function xr(n,t,r,e,u){var o=ue(t.length)&&(To(t)||nu(t));return(o?Mt:gr)(t,function(t,i,a){if(h(t)){e||(e=[]),u||(u=[]);n:{t=e;for(var f=u,c=t.length,l=a[i];c--;)if(t[c]==l){n[i]=f[c],i=void 0;break n}c=n[i],a=r?r(c,l,i,n,a):b;var s=typeof a=="undefined";s&&(a=l,ue(l.length)&&(To(l)||nu(l))?a=To(c)?c:c?zt(c):[]:(Wo(l)||Ke(l))&&(a=Ke(c)?tu(c):Wo(c)?c:{})),t.push(l),f.push(a),s?n[i]=xr(a,l,r,t,f):(a===a?a!==c:c===c)&&(n[i]=a),i=void 0}return i}f=n[i],a=r?r(f,t,i,n,a):b,(l=typeof a=="undefined")&&(a=t),!o&&typeof a=="undefined"||!l&&(a===a?a===f:f!==f)||(n[i]=a) }),n}function Ar(n){return function(t){return null==t?b:t[n]}}function jr(n,t){return n+qu(fo()*(t-n+1))}function kr(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function Er(n,t,r){var e=-1,u=n.length;for(t=null==t?0:+t||0,0>t&&(t=-t>u?0:u+t),r=typeof r=="undefined"||r>u?u:+r||0,0>r&&(r+=u),u=t>r?0:r-t,r=mu(u);++e<u;)r[e]=n[e+t];return r}function Rr(n,t){var r;return or(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function Ir(n,r){var e=-1,u=Hr(),o=n.length,i=u==t,a=i&&200<=o,f=a&&wo(),c=[]; f?(u=Bt,i=false):(a=false,f=r?[]:c);n:for(;++e<o;){var l=n[e],s=r?r(l,e,n):l;if(i&&l===l){for(var p=f.length;p--;)if(f[p]===s)continue n;r&&f.push(s),c.push(l)}else 0>u(f,s)&&((r||a)&&f.push(s),c.push(l))}return c}function Or(n,t){for(var r=-1,e=t.length,u=mu(e);++r<e;)u[r]=n[t[r]];return u}function Cr(n,t){var r=n;r instanceof Ft&&(r=r.value());for(var e=-1,u=t.length;++e<u;){var r=[r],o=t[e];Ku.apply(r,o.args),r=o.func.apply(o.thisArg,r)}return r}function Tr(n,t,r){var e=0,u=n?n.length:e;if(typeof t=="number"&&t===t&&u<=ho){for(;e<u;){var o=e+u>>>1,i=n[o]; (r?i<=t:i<t)?e=o+1:u=o}return u}return Sr(n,t,gu,r)}function Sr(n,t,r,e){t=r(t);for(var u=0,o=n?n.length:0,i=t!==t,a=typeof t=="undefined";u<o;){var f=qu((u+o)/2),c=r(n[f]),l=c===c;(i?l||e:a?l&&(e||typeof c!="undefined"):e?c<=t:c<t)?u=f+1:o=f}return uo(o,po)}function Wr(n,t,r){if(typeof n!="function")return gu;if(typeof t=="undefined")return n;switch(r){case 1:return function(r){return n.call(t,r)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,o){return n.call(t,r,e,u,o) };case 5:return function(r,e,u,o,i){return n.call(t,r,e,u,o,i)}}return function(){return n.apply(t,arguments)}}function Nr(n){return zu.call(n,0)}function Fr(n,t,r){for(var e=r.length,u=-1,o=eo(n.length-e,0),i=-1,a=t.length,f=mu(o+a);++i<a;)f[i]=t[i];for(;++u<e;)f[r[u]]=n[u];for(;o--;)f[i++]=n[u++];return f}function Ur(n,t,r){for(var e=-1,u=r.length,o=-1,i=eo(n.length-u,0),a=-1,f=t.length,c=mu(i+f);++o<i;)c[o]=n[o];for(i=o;++a<f;)c[i+a]=t[a];for(;++e<u;)c[i+r[e]]=n[o++];return c}function Lr(n,t){return function(r,e,u){var o=t?t():{}; if(e=Xr(e,u,3),To(r)){u=-1;for(var i=r.length;++u<i;){var a=r[u];n(o,a,e(a,u,r),r)}}else or(r,function(t,r,u){n(o,t,e(t,r,u),u)});return o}}function $r(n){return function(){var t=arguments.length,r=arguments[0];if(2>t||null==r)return r;if(3<t&&ee(arguments[1],arguments[2],arguments[3])&&(t=2),3<t&&"function"==typeof arguments[t-2])var e=Wr(arguments[--t-1],arguments[t--],5);else 2<t&&"function"==typeof arguments[t-1]&&(e=arguments[--t]);for(var u=0;++u<t;){var o=arguments[u];o&&n(r,o,e)}return r} }function Br(n,t){function r(){return(this instanceof r?e:n).apply(t,arguments)}var e=Dr(n);return r}function zr(n){return function(t){var r=-1;t=lu(ou(t));for(var e=t.length,u="";++r<e;)u=n(u,t[r],r);return u}}function Dr(n){return function(){var t=mo(n.prototype),r=n.apply(t,arguments);return Ge(r)?r:t}}function Mr(n,t){return function(r,e,o){o&&ee(r,e,o)&&(e=null);var i=Xr(),a=null==e;if(i===tr&&a||(a=false,e=i(e,o,3)),a){if(e=To(r),e||!Qe(r))return n(e?r:le(r));e=u}return Jr(r,e,t)}}function qr(n,t,r,e,u,o,i,a,f,c){function l(){for(var w=arguments.length,j=w,k=mu(w);j--;)k[j]=arguments[j]; if(e&&(k=Fr(k,e,u)),o&&(k=Ur(k,o,i)),g||y){var j=l.placeholder,E=v(k,j),w=w-E.length;if(w<c){var O=a?zt(a):null,w=eo(c-w,0),C=g?E:null,E=g?null:E,T=g?k:null,k=g?null:k;return t|=g?R:I,t&=~(g?I:R),d||(t&=~(x|A)),k=qr(n,t,r,T,C,k,E,O,f,w),k.placeholder=j,k}}if(j=p?r:this,h&&(n=j[m]),a)for(O=k.length,w=uo(a.length,O),C=zt(k);w--;)E=a[w],k[w]=re(E,O)?C[E]:b;return s&&f<k.length&&(k.length=f),(this instanceof l?_||Dr(n):n).apply(j,k)}var s=t&C,p=t&x,h=t&A,g=t&k,d=t&j,y=t&E,_=!h&&Dr(n),m=n;return l}function Pr(n,t,r){return n=n.length,t=+t,n<t&&to(t)?(t-=n,r=null==r?" ":e(r),fu(r,Du(t/r.length)).slice(0,t)):"" }function Kr(n,t,r,e){function u(){for(var t=-1,a=arguments.length,f=-1,c=e.length,l=mu(a+c);++f<c;)l[f]=e[f];for(;a--;)l[f++]=arguments[++t];return(this instanceof u?i:n).apply(o?r:this,l)}var o=t&x,i=Dr(n);return u}function Vr(n,t,r,e,u,o,i,a){var f=t&A;if(!f&&!Ze(n))throw new Iu($);var c=e?e.length:0;if(c||(t&=~(R|I),e=u=null),c-=u?u.length:0,t&I){var l=e,s=u;e=u=null}var p=!f&&xo(n);if(r=[n,t,r,e,u,l,s,o,i,a],p&&true!==p){e=r[1],t=p[1],a=e|t,o=C|O,u=x|A,i=o|u|j|E;var l=e&C&&!(t&C),s=e&O&&!(t&O),h=(s?r:p)[7],g=(l?r:p)[8]; o=a>=o&&a<=i&&(e<O||(s||l)&&h.length<=g),(!(e>=O&&t>u||e>u&&t>=O)||o)&&(t&x&&(r[2]=p[2],a|=e&x?0:j),(e=p[3])&&(u=r[3],r[3]=u?Fr(u,e,p[4]):zt(e),r[4]=u?v(r[3],B):zt(p[4])),(e=p[5])&&(u=r[5],r[5]=u?Ur(u,e,p[6]):zt(e),r[6]=u?v(r[5],B):zt(p[6])),(e=p[7])&&(r[7]=zt(e)),t&C&&(r[8]=null==r[8]?p[8]:uo(r[8],p[8])),null==r[9]&&(r[9]=p[9]),r[0]=p[0],r[1]=a),t=r[1],a=r[9]}return r[9]=null==a?f?0:n.length:eo(a-c,0)||0,(p?bo:Ao)(t==x?Br(r[0],r[2]):t!=R&&t!=(x|R)||r[4].length?qr.apply(null,r):Kr.apply(null,r),r) }function Yr(n,t,r,e,u,o,i){var a=-1,f=n.length,c=t.length,l=true;if(f!=c&&(!u||c<=f))return false;for(;l&&++a<f;){var s=n[a],p=t[a],l=b;if(e&&(l=u?e(p,s,a):e(s,p,a)),typeof l=="undefined")if(u)for(var h=c;h--&&(p=t[h],!(l=s&&s===p||r(s,p,e,u,o,i))););else l=s&&s===p||r(s,p,e,u,o,i)}return!!l}function Zr(n,t,r){switch(r){case M:case q:return+n==+t;case P:return n.name==t.name&&n.message==t.message;case V:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case Z:case G:return n==e(t)}return false}function Gr(n,t,r,e,u,o,i){var a=Fo(n),f=a.length,c=Fo(t).length; if(f!=c&&!u)return false;for(var l,c=-1;++c<f;){var s=a[c],p=Nu.call(t,s);if(p){var h=n[s],g=t[s],p=b;e&&(p=u?e(g,h,s):e(h,g,s)),typeof p=="undefined"&&(p=h&&h===g||r(h,g,e,u,o,i))}if(!p)return false;l||(l="constructor"==s)}return l||(r=n.constructor,e=t.constructor,!(r!=e&&"constructor"in n&&"constructor"in t)||typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)?true:false}function Jr(n,t,r){var e=r?lo:co,u=e,o=u;return or(n,function(n,i,a){i=t(n,i,a),((r?i<u:i>u)||i===e&&i===o)&&(u=i,o=n) }),o}function Xr(n,t,r){var e=Wt.callback||pu,e=e===pu?tr:e;return r?e(n,t,r):e}function Hr(n,r,e){var u=Wt.indexOf||de,u=u===de?t:u;return n?u(n,r,e):u}function Qr(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&Nu.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function ne(n){return n=n.constructor,typeof n=="function"&&n instanceof n||(n=ku),new n}function te(n,t,r){var e=n.constructor;switch(t){case J:return Nr(n);case M:case q:return new e(+n);case X:case H:case Q:case nt:case tt:case rt:case et:case ut:case ot:return t=n.buffer,new e(r?Nr(t):t,n.byteOffset,n.length); case V:case G:return new e(n);case Z:var u=new e(n.source,yt.exec(n));u.lastIndex=n.lastIndex}return u}function re(n,t){return n=+n,t=null==t?vo:t,-1<n&&0==n%1&&n<t}function ee(n,t,r){if(!Ge(r))return false;var e=typeof t;return"number"==e?(e=r.length,e=ue(e)&&re(t,e)):e="string"==e&&t in n,e&&r[t]===n}function ue(n){return typeof n=="number"&&-1<n&&0==n%1&&n<=vo}function oe(n){return n===n&&(0===n?0<1/n:!Ge(n))}function ie(n,t){n=se(n);for(var r=-1,e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o]) }return u}function ae(n,t){var r={};return hr(n,function(n,e,u){t(n,e,u)&&(r[e]=n)}),r}function fe(n){var t;if(!h(n)||Uu.call(n)!=Y||!(Nu.call(n,"constructor")||(t=n.constructor,typeof t!="function"||t instanceof t)))return false;var r;return hr(n,function(n,t){r=t}),typeof r=="undefined"||Nu.call(n,r)}function ce(n){for(var t=eu(n),r=t.length,e=r&&n.length,u=Wt.support,u=e&&ue(e)&&(To(n)||u.nonEnumArgs&&Ke(n)),o=-1,i=[];++o<r;){var a=t[o];(u&&re(a,e)||Nu.call(n,a))&&i.push(a)}return i}function le(n){return null==n?[]:ue(n.length)?Ge(n)?n:ku(n):uu(n) }function se(n){return Ge(n)?n:ku(n)}function pe(n,t,r){return n&&n.length?((r?ee(n,t,r):null==t)&&(t=1),Er(n,0>t?0:t)):[]}function he(n,t,r){var e=n?n.length:0;return e?((r?ee(n,t,r):null==t)&&(t=1),t=e-(+t||0),Er(n,0,0>t?0:t)):[]}function ge(n,t,r){var e=-1,u=n?n.length:0;for(t=Xr(t,r,3);++e<u;)if(t(n[e],e,n))return e;return-1}function ve(n){return n?n[0]:b}function de(n,r,e){var u=n?n.length:0;if(!u)return-1;if(typeof e=="number")e=0>e?eo(u+e,0):e||0;else if(e)return e=Tr(n,r),n=n[e],(r===r?r===n:n!==n)?e:-1; return t(n,r,e)}function ye(n){return pe(n,1)}function _e(n,r,e,u){if(!n||!n.length)return[];typeof r!="boolean"&&null!=r&&(u=e,e=ee(n,r,u)?null:r,r=false);var o=Xr();if((o!==tr||null!=e)&&(e=o(e,u,3)),r&&Hr()==t){r=e;var i;e=-1,u=n.length;for(var o=-1,a=[];++e<u;){var f=n[e],c=r?r(f,e,n):f;e&&i===c||(i=c,a[++o]=f)}n=a}else n=Ir(n,e);return n}function me(n){for(var t=-1,r=(n&&n.length&&Vt(Kt(n,Wu)))>>>0,e=mu(r);++t<r;)e[t]=Kt(n,Ar(t));return e}function be(n,t){var r=-1,e=n?n.length:0,u={};for(!e||t||To(n[0])||(t=[]);++r<e;){var o=n[r]; t?u[o]=t[r]:o&&(u[o[0]]=o[1])}return u}function we(n){return n=Wt(n),n.__chain__=true,n}function xe(n,t,r){return t.call(r,n)}function Ae(n,t,r){var e=n?n.length:0;return ue(e)||(n=uu(n),e=n.length),e?(r=typeof r=="number"?0>r?eo(e+r,0):r||0:0,typeof n=="string"||!To(n)&&Qe(n)?r<e&&-1<n.indexOf(t,r):-1<Hr(n,t,r)):false}function je(n,t,r){var e=To(n)?qt:ar;return(typeof t!="function"||typeof r!="undefined")&&(t=Xr(t,r,3)),e(n,t)}function ke(n,t,r){var e=To(n)?Pt:fr;return t=Xr(t,r,3),e(n,t)}function Ee(n,t,r){return To(n)?(t=ge(n,t,r),-1<t?n[t]:b):(t=Xr(t,r,3),cr(n,t,or)) }function Re(n,t,r){return typeof t=="function"&&typeof r=="undefined"&&To(n)?Mt(n,t):or(n,Wr(t,r,3))}function Ie(n,t,r){if(typeof t=="function"&&typeof r=="undefined"&&To(n))for(r=n.length;r--&&false!==t(n[r],r,n););else n=ir(n,Wr(t,r,3));return n}function Oe(n,t,r){var e=To(n)?Kt:br;return t=Xr(t,r,3),e(n,t)}function Ce(n,t,r,e){return(To(n)?Yt:kr)(n,Xr(t,e,4),r,3>arguments.length,or)}function Te(n,t,r,e){return(To(n)?Zt:kr)(n,Xr(t,e,4),r,3>arguments.length,ir)}function Se(n,t,r){return(r?ee(n,t,r):null==t)?(n=le(n),t=n.length,0<t?n[jr(0,t-1)]:b):(n=We(n),n.length=uo(0>t?0:+t||0,n.length),n) }function We(n){n=le(n);for(var t=-1,r=n.length,e=mu(r);++t<r;){var u=jr(0,t);t!=u&&(e[t]=e[u]),e[u]=n[t]}return e}function Ne(n,t,r){var e=To(n)?Gt:Rr;return(typeof t!="function"||typeof r!="undefined")&&(t=Xr(t,r,3)),e(n,t)}function Fe(n,t){var r;if(!Ze(t)){if(!Ze(n))throw new Iu($);var e=n;n=t,t=e}return function(){return 0<--n?r=t.apply(this,arguments):t=null,r}}function Ue(n,t){var r=x;if(2<arguments.length)var e=Er(arguments,2),u=v(e,Ue.placeholder),r=r|R;return Vr(n,r,t,e,u)}function Le(n,t){var r=x|A; if(2<arguments.length)var e=Er(arguments,2),u=v(e,Le.placeholder),r=r|R;return Vr(t,r,n,e,u)}function $e(n,t,r){return r&&ee(n,t,r)&&(t=null),n=Vr(n,k,null,null,null,null,null,t),n.placeholder=$e.placeholder,n}function Be(n,t,r){return r&&ee(n,t,r)&&(t=null),n=Vr(n,E,null,null,null,null,null,t),n.placeholder=Be.placeholder,n}function ze(n,t,r){function e(){var r=t-(Co()-c);0>=r||r>t?(a&&Mu(a),r=p,a=s=p=b,r&&(h=Co(),f=n.apply(l,i),s||a||(i=l=null))):s=Zu(e,r)}function u(){s&&Mu(s),a=s=p=b,(v||g!==t)&&(h=Co(),f=n.apply(l,i),s||a||(i=l=null)) }function o(){if(i=arguments,c=Co(),l=this,p=v&&(s||!d),false===g)var r=d&&!s;else{a||d||(h=c);var o=g-(c-h),y=0>=o||o>g;y?(a&&(a=Mu(a)),h=c,f=n.apply(l,i)):a||(a=Zu(u,o))}return y&&s?s=Mu(s):s||t===g||(s=Zu(e,t)),r&&(y=true,f=n.apply(l,i)),!y||s||a||(i=l=null),f}var i,a,f,c,l,s,p,h=0,g=false,v=true;if(!Ze(n))throw new Iu($);if(t=0>t?0:t,true===r)var d=true,v=false;else Ge(r)&&(d=r.leading,g="maxWait"in r&&eo(+r.maxWait||0,t),v="trailing"in r?r.trailing:v);return o.cancel=function(){s&&Mu(s),a&&Mu(a),a=s=p=b},o}function De(){var n=arguments,t=n.length-1; if(0>t)return function(){};if(!qt(n,Ze))throw new Iu($);return function(){for(var r=t,e=n[r].apply(this,arguments);r--;)e=n[r].call(this,e);return e}}function Me(n,t){function r(){var e=r.cache,u=t?t.apply(this,arguments):arguments[0];if(e.has(u))return e.get(u);var o=n.apply(this,arguments);return e.set(u,o),o}if(!Ze(n)||t&&!Ze(t))throw new Iu($);return r.cache=new Me.Cache,r}function qe(n){var t=Er(arguments,1),r=v(t,qe.placeholder);return Vr(n,R,null,t,r)}function Pe(n){var t=Er(arguments,1),r=v(t,Pe.placeholder); return Vr(n,I,null,t,r)}function Ke(n){return ue(h(n)?n.length:b)&&Uu.call(n)==z||false}function Ve(n){return n&&1===n.nodeType&&h(n)&&-1<Uu.call(n).indexOf("Element")||false}function Ye(n){return h(n)&&typeof n.message=="string"&&Uu.call(n)==P||false}function Ze(n){return typeof n=="function"||false}function Ge(n){var t=typeof n;return"function"==t||n&&"object"==t||false}function Je(n){return null==n?false:Uu.call(n)==K?$u.test(Su.call(n)):h(n)&&bt.test(n)||false}function Xe(n){return typeof n=="number"||h(n)&&Uu.call(n)==V||false }function He(n){return h(n)&&Uu.call(n)==Z||false}function Qe(n){return typeof n=="string"||h(n)&&Uu.call(n)==G||false}function nu(n){return h(n)&&ue(n.length)&&Ct[Uu.call(n)]||false}function tu(n){return nr(n,eu(n))}function ru(n){return dr(n,eu(n))}function eu(n){if(null==n)return[];Ge(n)||(n=ku(n));for(var t=n.length,t=t&&ue(t)&&(To(n)||_o.nonEnumArgs&&Ke(n))&&t||0,r=n.constructor,e=-1,r=typeof r=="function"&&r.prototype==n,u=mu(t),o=0<t;++e<t;)u[e]=e+"";for(var i in n)o&&re(i,t)||"constructor"==i&&(r||!Nu.call(n,i))||u.push(i); return u}function uu(n){return Or(n,Fo(n))}function ou(n){return(n=e(n))&&n.replace(wt,c)}function iu(n){return(n=e(n))&&jt.test(n)?n.replace(At,"\\$&"):n}function au(n,t,r){return r&&ee(n,t,r)&&(t=0),ao(n,t)}function fu(n,t){var r="";if(n=e(n),t=+t,1>t||!n||!to(t))return r;do t%2&&(r+=n),t=qu(t/2),n+=n;while(t);return r}function cu(n,t,r){var u=n;return(n=e(n))?(r?ee(u,t,r):null==t)?n.slice(d(n),y(n)+1):(t=e(t),n.slice(o(n,t),i(n,t)+1)):n}function lu(n,t,r){return r&&ee(n,t,r)&&(t=null),n=e(n),n.match(t||Rt)||[] }function su(n){try{return n()}catch(t){return Ye(t)?t:wu(t)}}function pu(n,t,r){return r&&ee(n,t,r)&&(t=null),tr(n,t)}function hu(n){return function(){return n}}function gu(n){return n}function vu(n){return wr(n,true)}function du(n,t,r){if(null==r){var e=Ge(t),u=e&&Fo(t);((u=u&&u.length&&dr(t,u))?u.length:e)||(u=false,r=t,t=n,n=this)}u||(u=dr(t,Fo(t)));var o=true,e=-1,i=Ze(n),a=u.length;false===r?o=false:Ge(r)&&"chain"in r&&(o=r.chain);for(;++e<a;){r=u[e];var f=t[r];n[r]=f,i&&(n.prototype[r]=function(t){return function(){var r=this.__chain__; if(o||r){var e=n(this.__wrapped__);return(e.__actions__=zt(this.__actions__)).push({func:t,args:arguments,thisArg:n}),e.__chain__=r,e}return r=[this.value()],Ku.apply(r,arguments),t.apply(n,r)}}(f))}return n}function yu(){}function _u(n){return Ar(n+"")}g=g?Dt.defaults($t.Object(),g,Dt.pick($t,Ot)):$t;var mu=g.Array,bu=g.Date,wu=g.Error,xu=g.Function,Au=g.Math,ju=g.Number,ku=g.Object,Eu=g.RegExp,Ru=g.String,Iu=g.TypeError,Ou=mu.prototype,Cu=ku.prototype,Tu=(Tu=g.window)&&Tu.document,Su=xu.prototype.toString,Wu=Ar("length"),Nu=Cu.hasOwnProperty,Fu=0,Uu=Cu.toString,Lu=g._,$u=Eu("^"+iu(Uu).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bu=Je(Bu=g.ArrayBuffer)&&Bu,zu=Je(zu=Bu&&new Bu(0).slice)&&zu,Du=Au.ceil,Mu=g.clearTimeout,qu=Au.floor,Pu=Je(Pu=ku.getPrototypeOf)&&Pu,Ku=Ou.push,Vu=Cu.propertyIsEnumerable,Yu=Je(Yu=g.Set)&&Yu,Zu=g.setTimeout,Gu=Ou.splice,Ju=Je(Ju=g.Uint8Array)&&Ju,Xu=Je(Xu=g.WeakMap)&&Xu,Hu=function(){try{var n=Je(n=g.Float64Array)&&n,t=new n(new Bu(10),0,1)&&n }catch(r){}return t}(),Qu=Je(Qu=mu.isArray)&&Qu,no=Je(no=ku.create)&&no,to=g.isFinite,ro=Je(ro=ku.keys)&&ro,eo=Au.max,uo=Au.min,oo=Je(oo=bu.now)&&oo,io=Je(io=ju.isFinite)&&io,ao=g.parseInt,fo=Au.random,co=ju.NEGATIVE_INFINITY,lo=ju.POSITIVE_INFINITY,so=Au.pow(2,32)-1,po=so-1,ho=so>>>1,go=Hu?Hu.BYTES_PER_ELEMENT:0,vo=Au.pow(2,53)-1,yo=Xu&&new Xu,_o=Wt.support={};!function(n){_o.funcDecomp=!Je(g.WinRTError)&&kt.test(m),_o.funcNames=typeof xu.name=="string";try{_o.dom=11===Tu.createDocumentFragment().nodeType }catch(t){_o.dom=false}try{_o.nonEnumArgs=!Vu.call(arguments,1)}catch(r){_o.nonEnumArgs=true}}(0,0),Wt.templateSettings={escape:ht,evaluate:gt,interpolate:vt,variable:"",imports:{_:Wt}};var mo=function(){function n(){}return function(t){if(Ge(t)){n.prototype=t;var r=new n;n.prototype=null}return r||g.Object()}}(),bo=yo?function(n,t){return yo.set(n,t),n}:gu;zu||(Nr=Bu&&Ju?function(n){var t=n.byteLength,r=Hu?qu(t/go):0,e=r*go,u=new Bu(t);if(r){var o=new Hu(u,0,r);o.set(new Hu(n,0,r))}return t!=e&&(o=new Ju(u,e),o.set(new Ju(n,e))),u }:hu(null));var wo=no&&Yu?function(n){return new Lt(n)}:hu(null),xo=yo?function(n){return yo.get(n)}:yu,Ao=function(){var n=0,t=0;return function(r,e){var u=Co(),o=N-(u-t);if(t=u,0<o){if(++n>=W)return r}else n=0;return bo(r,e)}}(),jo=Lr(function(n,t,r){Nu.call(n,r)?++n[r]:n[r]=1}),ko=Lr(function(n,t,r){Nu.call(n,r)?n[r].push(t):n[r]=[t]}),Eo=Lr(function(n,t,r){n[r]=t}),Ro=Mr(Vt),Io=Mr(function(n){for(var t=-1,r=n.length,e=lo;++t<r;){var u=n[t];u<e&&(e=u)}return e},true),Oo=Lr(function(n,t,r){n[r?0:1].push(t) },function(){return[[],[]]}),Co=oo||function(){return(new bu).getTime()},To=Qu||function(n){return h(n)&&ue(n.length)&&Uu.call(n)==D||false};_o.dom||(Ve=function(n){return n&&1===n.nodeType&&h(n)&&!Wo(n)||false});var So=io||function(n){return typeof n=="number"&&to(n)};(Ze(/x/)||Ju&&!Ze(Ju))&&(Ze=function(n){return Uu.call(n)==K});var Wo=Pu?function(n){if(!n||Uu.call(n)!=Y)return false;var t=n.valueOf,r=Je(t)&&(r=Pu(t))&&Pu(r);return r?n==r||Pu(n)==r:fe(n)}:fe,No=$r(Ht),Fo=ro?function(n){if(n)var t=n.constructor,r=n.length; return typeof t=="function"&&t.prototype===n||typeof n!="function"&&r&&ue(r)?ce(n):Ge(n)?ro(n):[]}:ce,Uo=$r(xr),Lo=zr(function(n,t,r){return t=t.toLowerCase(),r?n+t.charAt(0).toUpperCase()+t.slice(1):t}),$o=zr(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()});8!=ao(It+"08")&&(au=function(n,t,r){return(r?ee(n,t,r):null==t)?t=0:t&&(t=+t),n=cu(n),ao(n,t||(mt.test(n)?16:10))});var Bo=zr(function(n,t,r){return n+(r?"_":"")+t.toLowerCase()});return Nt.prototype=Wt.prototype,Ut.prototype["delete"]=function(n){return this.has(n)&&delete this.__data__[n] },Ut.prototype.get=function(n){return"__proto__"==n?b:this.__data__[n]},Ut.prototype.has=function(n){return"__proto__"!=n&&Nu.call(this.__data__,n)},Ut.prototype.set=function(n,t){return"__proto__"!=n&&(this.__data__[n]=t),this},Lt.prototype.push=function(n){var t=this.data;typeof n=="string"||Ge(n)?t.set.add(n):t.hash[n]=true},Me.Cache=Ut,Wt.after=function(n,t){if(!Ze(t)){if(!Ze(n))throw new Iu($);var r=n;n=t,t=r}return n=to(n=+n)?n:0,function(){return 1>--n?t.apply(this,arguments):void 0}},Wt.ary=function(n,t,r){return r&&ee(n,t,r)&&(t=null),t=n&&null==t?n.length:eo(+t||0,0),Vr(n,C,null,null,null,null,t) },Wt.assign=No,Wt.at=function(n){return ue(n?n.length:0)&&(n=le(n)),Qt(n,lr(arguments,false,false,1))},Wt.before=Fe,Wt.bind=Ue,Wt.bindAll=function(n){for(var t=n,r=1<arguments.length?lr(arguments,false,false,1):ru(n),e=-1,u=r.length;++e<u;){var o=r[e];t[o]=Vr(t[o],x,t)}return t},Wt.bindKey=Le,Wt.callback=pu,Wt.chain=we,Wt.chunk=function(n,t,r){t=(r?ee(n,t,r):null==t)?1:eo(+t||1,1),r=0;for(var e=n?n.length:0,u=-1,o=mu(Du(e/t));r<e;)o[++u]=Er(n,r,r+=t);return o},Wt.compact=function(n){for(var t=-1,r=n?n.length:0,e=-1,u=[];++t<r;){var o=n[t]; o&&(u[++e]=o)}return u},Wt.constant=hu,Wt.countBy=jo,Wt.create=function(n,t,r){var e=mo(n);return r&&ee(n,t,r)&&(t=null),t?nr(t,e,Fo(t)):e},Wt.curry=$e,Wt.curryRight=Be,Wt.debounce=ze,Wt.defaults=function(n){if(null==n)return n;var t=zt(arguments);return t.push(Jt),No.apply(b,t)},Wt.defer=function(n){return er(n,1,arguments,1)},Wt.delay=function(n,t){return er(n,t,arguments,2)},Wt.difference=function(){for(var n=-1,t=arguments.length;++n<t;){var r=arguments[n];if(To(r)||Ke(r))break}return ur(r,lr(arguments,false,true,++n)) },Wt.drop=pe,Wt.dropRight=he,Wt.dropRightWhile=function(n,t,r){var e=n?n.length:0;if(!e)return[];for(t=Xr(t,r,3);e--&&t(n[e],e,n););return Er(n,0,e+1)},Wt.dropWhile=function(n,t,r){var e=n?n.length:0;if(!e)return[];var u=-1;for(t=Xr(t,r,3);++u<e&&t(n[u],u,n););return Er(n,u)},Wt.filter=ke,Wt.flatten=function(n,t,r){var e=n?n.length:0;return r&&ee(n,t,r)&&(t=false),e?lr(n,t):[]},Wt.flattenDeep=function(n){return n&&n.length?lr(n,true):[]},Wt.flow=function(){var n=arguments,t=n.length;if(!t)return function(){}; if(!qt(n,Ze))throw new Iu($);return function(){for(var r=0,e=n[r].apply(this,arguments);++r<t;)e=n[r].call(this,e);return e}},Wt.flowRight=De,Wt.forEach=Re,Wt.forEachRight=Ie,Wt.forIn=function(n,t,r){return(typeof t!="function"||typeof r!="undefined")&&(t=Wr(t,r,3)),sr(n,t,eu)},Wt.forInRight=function(n,t,r){return t=Wr(t,r,3),pr(n,t,eu)},Wt.forOwn=function(n,t,r){return(typeof t!="function"||typeof r!="undefined")&&(t=Wr(t,r,3)),gr(n,t)},Wt.forOwnRight=function(n,t,r){return t=Wr(t,r,3),pr(n,t,Fo) },Wt.functions=ru,Wt.groupBy=ko,Wt.indexBy=Eo,Wt.initial=function(n){return he(n,1)},Wt.intersection=function(){for(var n=[],r=-1,e=arguments.length,u=[],o=Hr(),i=o==t;++r<e;){var a=arguments[r];(To(a)||Ke(a))&&(n.push(a),u.push(i&&120<=a.length&&wo(r&&a)))}var e=n.length,i=n[0],f=-1,c=i?i.length:0,l=[],s=u[0];n:for(;++f<c;)if(a=i[f],0>(s?Bt(s,a):o(l,a))){for(r=e;--r;){var p=u[r];if(0>(p?Bt(p,a):o(n[r],a)))continue n}s&&s.push(a),l.push(a)}return l},Wt.invert=function(n,t,r){r&&ee(n,t,r)&&(t=null),r=-1; for(var e=Fo(n),u=e.length,o={};++r<u;){var i=e[r],a=n[i];t?Nu.call(o,a)?o[a].push(i):o[a]=[i]:o[a]=i}return o},Wt.invoke=function(n,t){return yr(n,t,Er(arguments,2))},Wt.keys=Fo,Wt.keysIn=eu,Wt.map=Oe,Wt.mapValues=function(n,t,r){var e={};return t=Xr(t,r,3),gr(n,function(n,r,u){e[r]=t(n,r,u)}),e},Wt.matches=vu,Wt.memoize=Me,Wt.merge=Uo,Wt.mixin=du,Wt.negate=function(n){if(!Ze(n))throw new Iu($);return function(){return!n.apply(this,arguments)}},Wt.omit=function(n,t,r){if(null==n)return{};if(typeof t!="function"){var e=Kt(lr(arguments,false,false,1),Ru); return ie(n,ur(eu(n),e))}return t=Wr(t,r,3),ae(n,function(n,r,e){return!t(n,r,e)})},Wt.once=function(n){return Fe(n,2)},Wt.pairs=function(n){for(var t=-1,r=Fo(n),e=r.length,u=mu(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},Wt.partial=qe,Wt.partialRight=Pe,Wt.partition=Oo,Wt.pick=function(n,t,r){return null==n?{}:typeof t=="function"?ae(n,Wr(t,r,3)):ie(n,lr(arguments,false,false,1))},Wt.pluck=function(n,t){return Oe(n,_u(t))},Wt.property=_u,Wt.propertyOf=function(n){return function(t){return null==n?b:n[t] }},Wt.pull=function(){var n=arguments[0];if(!n||!n.length)return n;for(var t=0,r=Hr(),e=arguments.length;++t<e;)for(var u=0,o=arguments[t];-1<(u=r(n,o,u));)Gu.call(n,u,1);return n},Wt.pullAt=function(t){var r=t||[],e=lr(arguments,false,false,1),u=e.length,o=Qt(r,e);for(e.sort(n);u--;){var i=parseFloat(e[u]);if(i!=a&&re(i)){var a=i;Gu.call(r,i,1)}}return o},Wt.range=function(n,t,r){r&&ee(n,t,r)&&(t=r=null),n=+n||0,r=null==r?1:+r||0,null==t?(t=n,n=0):t=+t||0;var e=-1;t=eo(Du((t-n)/(r||1)),0);for(var u=mu(t);++e<t;)u[e]=n,n+=r; return u},Wt.rearg=function(n){var t=lr(arguments,false,false,1);return Vr(n,O,null,null,null,t)},Wt.reject=function(n,t,r){var e=To(n)?Pt:fr;return t=Xr(t,r,3),e(n,function(n,r,e){return!t(n,r,e)})},Wt.remove=function(n,t,r){var e=-1,u=n?n.length:0,o=[];for(t=Xr(t,r,3);++e<u;)r=n[e],t(r,e,n)&&(o.push(r),Gu.call(n,e--,1),u--);return o},Wt.rest=ye,Wt.shuffle=We,Wt.slice=function(n,t,r){var e=n?n.length:0;return e?(r&&typeof r!="number"&&ee(n,t,r)&&(t=0,r=e),Er(n,t,r)):[]},Wt.sortBy=function(n,t,e){var u=-1,o=n?n.length:0,i=ue(o)?mu(o):[]; return e&&ee(n,t,e)&&(t=null),t=Xr(t,e,3),or(n,function(n,r,e){i[++u]={a:t(n,r,e),b:u,c:n}}),r(i,a)},Wt.sortByAll=function(n){var t=arguments;3<t.length&&ee(t[1],t[2],t[3])&&(t=[n,t[1]]);var e=-1,u=n?n.length:0,o=lr(t,false,false,1),i=ue(u)?mu(u):[];return or(n,function(n){for(var t=o.length,r=mu(t);t--;)r[t]=null==n?b:n[o[t]];i[++e]={a:r,b:e,c:n}}),r(i,f)},Wt.take=function(n,t,r){return n&&n.length?((r?ee(n,t,r):null==t)&&(t=1),Er(n,0,0>t?0:t)):[]},Wt.takeRight=function(n,t,r){var e=n?n.length:0;return e?((r?ee(n,t,r):null==t)&&(t=1),t=e-(+t||0),Er(n,0>t?0:t)):[] },Wt.takeRightWhile=function(n,t,r){var e=n?n.length:0;if(!e)return[];for(t=Xr(t,r,3);e--&&t(n[e],e,n););return Er(n,e+1)},Wt.takeWhile=function(n,t,r){var e=n?n.length:0;if(!e)return[];var u=-1;for(t=Xr(t,r,3);++u<e&&t(n[u],u,n););return Er(n,0,u)},Wt.tap=function(n,t,r){return t.call(r,n),n},Wt.throttle=function(n,t,r){var e=true,u=true;if(!Ze(n))throw new Iu($);return false===r?e=false:Ge(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),St.leading=e,St.maxWait=+t,St.trailing=u,ze(n,t,St) },Wt.thru=xe,Wt.times=function(n,t,r){if(n=+n,1>n||!to(n))return[];var e=-1,u=mu(uo(n,so));for(t=Wr(t,r,1);++e<n;)e<so?u[e]=t(e):t(e);return u},Wt.toArray=function(n){var t=n?n.length:0;return ue(t)?t?zt(n):[]:uu(n)},Wt.toPlainObject=tu,Wt.transform=function(n,t,r,e){var u=To(n)||nu(n);return t=Xr(t,e,4),null==r&&(u||Ge(n)?(e=n.constructor,r=u?To(n)?new e:[]:mo(typeof e=="function"&&e.prototype)):r={}),(u?Mt:gr)(n,function(n,e,u){return t(r,n,e,u)}),r},Wt.union=function(){return Ir(lr(arguments,false,true)) },Wt.uniq=_e,Wt.unzip=me,Wt.values=uu,Wt.valuesIn=function(n){return Or(n,eu(n))},Wt.where=function(n,t){return ke(n,vu(t))},Wt.without=function(n){return ur(n,Er(arguments,1))},Wt.wrap=function(n,t){return t=null==t?gu:t,Vr(t,R,null,[n],[])},Wt.xor=function(){for(var n=-1,t=arguments.length;++n<t;){var r=arguments[n];if(To(r)||Ke(r))var e=e?ur(e,r).concat(ur(r,e)):r}return e?Ir(e):[]},Wt.zip=function(){for(var n=arguments.length,t=mu(n);n--;)t[n]=arguments[n];return me(t)},Wt.zipObject=be,Wt.backflow=De,Wt.collect=Oe,Wt.compose=De,Wt.each=Re,Wt.eachRight=Ie,Wt.extend=No,Wt.iteratee=pu,Wt.methods=ru,Wt.object=be,Wt.select=ke,Wt.tail=ye,Wt.unique=_e,du(Wt,Wt),Wt.attempt=su,Wt.camelCase=Lo,Wt.capitalize=function(n){return(n=e(n))&&n.charAt(0).toUpperCase()+n.slice(1) },Wt.clone=function(n,t,r,e){return typeof t!="boolean"&&null!=t&&(e=r,r=ee(n,t,e)?null:t,t=false),r=typeof r=="function"&&Wr(r,e,1),rr(n,t,r)},Wt.cloneDeep=function(n,t,r){return t=typeof t=="function"&&Wr(t,r,1),rr(n,true,t)},Wt.deburr=ou,Wt.endsWith=function(n,t,r){n=e(n),t+="";var u=n.length;return r=(typeof r=="undefined"?u:uo(0>r?0:+r||0,u))-t.length,0<=r&&n.indexOf(t,r)==r},Wt.escape=function(n){return(n=e(n))&&pt.test(n)?n.replace(lt,l):n},Wt.escapeRegExp=iu,Wt.every=je,Wt.find=Ee,Wt.findIndex=ge,Wt.findKey=function(n,t,r){return t=Xr(t,r,3),cr(n,t,gr,true) },Wt.findLast=function(n,t,r){return t=Xr(t,r,3),cr(n,t,ir)},Wt.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=Xr(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},Wt.findLastKey=function(n,t,r){return t=Xr(t,r,3),cr(n,t,vr,true)},Wt.findWhere=function(n,t){return Ee(n,vu(t))},Wt.first=ve,Wt.has=function(n,t){return n?Nu.call(n,t):false},Wt.identity=gu,Wt.includes=Ae,Wt.indexOf=de,Wt.isArguments=Ke,Wt.isArray=To,Wt.isBoolean=function(n){return true===n||false===n||h(n)&&Uu.call(n)==M||false},Wt.isDate=function(n){return h(n)&&Uu.call(n)==q||false },Wt.isElement=Ve,Wt.isEmpty=function(n){if(null==n)return true;var t=n.length;return ue(t)&&(To(n)||Qe(n)||Ke(n)||h(n)&&Ze(n.splice))?!t:!Fo(n).length},Wt.isEqual=function(n,t,r,e){return r=typeof r=="function"&&Wr(r,e,3),!r&&oe(n)&&oe(t)?n===t:(e=r?r(n,t):b,typeof e=="undefined"?_r(n,t,r):!!e)},Wt.isError=Ye,Wt.isFinite=So,Wt.isFunction=Ze,Wt.isMatch=function(n,t,r,e){var u=Fo(t),o=u.length;if(r=typeof r=="function"&&Wr(r,e,3),!r&&1==o){var i=u[0];if(e=t[i],oe(e))return null!=n&&e===n[i]&&Nu.call(n,i) }for(var i=mu(o),a=mu(o);o--;)e=i[o]=t[u[o]],a[o]=oe(e);return mr(n,u,i,a,r)},Wt.isNaN=function(n){return Xe(n)&&n!=+n},Wt.isNative=Je,Wt.isNull=function(n){return null===n},Wt.isNumber=Xe,Wt.isObject=Ge,Wt.isPlainObject=Wo,Wt.isRegExp=He,Wt.isString=Qe,Wt.isTypedArray=nu,Wt.isUndefined=function(n){return typeof n=="undefined"},Wt.kebabCase=$o,Wt.last=function(n){var t=n?n.length:0;return t?n[t-1]:b},Wt.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(typeof r=="number")u=(0>r?eo(e+r,0):uo(r||0,e-1))+1; else if(r)return u=Tr(n,t,true)-1,n=n[u],(t===t?t===n:n!==n)?u:-1;if(t!==t)return p(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},Wt.max=Ro,Wt.min=Io,Wt.noConflict=function(){return g._=Lu,this},Wt.noop=yu,Wt.now=Co,Wt.pad=function(n,t,r){n=e(n),t=+t;var u=n.length;return u<t&&to(t)?(u=(t-u)/2,t=qu(u),u=Du(u),r=Pr("",u,r),r.slice(0,t)+n+r):n},Wt.padLeft=function(n,t,r){return(n=e(n))&&Pr(n,t,r)+n},Wt.padRight=function(n,t,r){return(n=e(n))&&n+Pr(n,t,r)},Wt.parseInt=au,Wt.random=function(n,t,r){r&&ee(n,t,r)&&(t=r=null); var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=fo(),uo(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):jr(n,t)},Wt.reduce=Ce,Wt.reduceRight=Te,Wt.repeat=fu,Wt.result=function(n,t,r){return t=null==n?b:n[t],typeof t=="undefined"&&(t=r),Ze(t)?t.call(n):t},Wt.runInContext=m,Wt.size=function(n){var t=n?n.length:0;return ue(t)?t:Fo(n).length},Wt.snakeCase=Bo,Wt.some=Ne,Wt.sortedIndex=function(n,t,r,e){var u=Xr(r); return u===tr&&null==r?Tr(n,t):Sr(n,t,u(r,e,1))},Wt.sortedLastIndex=function(n,t,r,e){var u=Xr(r);return u===tr&&null==r?Tr(n,t,true):Sr(n,t,u(r,e,1),true)},Wt.startsWith=function(n,t,r){return n=e(n),r=null==r?0:uo(0>r?0:+r||0,n.length),n.lastIndexOf(t,r)==r},Wt.template=function(n,t,r){var u=Wt.templateSettings;r&&ee(n,t,r)&&(t=r=null),n=e(n),t=Ht(Ht({},r||t),u,Xt),r=Ht(Ht({},t.imports),u.imports,Xt);var o,i,a=Fo(r),f=Or(r,a),c=0;r=t.interpolate||xt;var l="__p+='";r=Eu((t.escape||xt).source+"|"+r.source+"|"+(r===vt?dt:xt).source+"|"+(t.evaluate||xt).source+"|$","g"); var p="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,u,a,f){return e||(e=u),l+=n.slice(c,f).replace(Et,s),r&&(o=true,l+="'+__e("+r+")+'"),a&&(i=true,l+="';"+a+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),c=f+t.length,t}),l+="';",(t=t.variable)||(l="with(obj){"+l+"}"),l=(i?l.replace(it,""):l).replace(at,"$1").replace(ft,"$1;"),l="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(o?",__e=_.escape":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",t=su(function(){return xu(a,p+"return "+l).apply(b,f) }),t.source=l,Ye(t))throw t;return t},Wt.trim=cu,Wt.trimLeft=function(n,t,r){var u=n;return(n=e(n))?n.slice((r?ee(u,t,r):null==t)?d(n):o(n,e(t))):n},Wt.trimRight=function(n,t,r){var u=n;return(n=e(n))?(r?ee(u,t,r):null==t)?n.slice(0,y(n)+1):n.slice(0,i(n,e(t))+1):n},Wt.trunc=function(n,t,r){r&&ee(n,t,r)&&(t=null);var u=T;if(r=S,null!=t)if(Ge(t)){var o="separator"in t?t.separator:o,u="length"in t?+t.length||0:u;r="omission"in t?e(t.omission):r}else u=+t||0;if(n=e(n),u>=n.length)return n;if(u-=r.length,1>u)return r; if(t=n.slice(0,u),null==o)return t+r;if(He(o)){if(n.slice(u).search(o)){var i,a=n.slice(0,u);for(o.global||(o=Eu(o.source,(yt.exec(o)||"")+"g")),o.lastIndex=0;n=o.exec(a);)i=n.index;t=t.slice(0,null==i?u:i)}}else n.indexOf(o,u)!=u&&(o=t.lastIndexOf(o),-1<o&&(t=t.slice(0,o)));return t+r},Wt.unescape=function(n){return(n=e(n))&&st.test(n)?n.replace(ct,_):n},Wt.uniqueId=function(n){var t=++Fu;return e(n)+t},Wt.words=lu,Wt.all=je,Wt.any=Ne,Wt.contains=Ae,Wt.detect=Ee,Wt.foldl=Ce,Wt.foldr=Te,Wt.head=ve,Wt.include=Ae,Wt.inject=Ce,du(Wt,function(){var n={}; return gr(Wt,function(t,r){Wt.prototype[r]||(n[r]=t)}),n}(),false),Wt.sample=Se,Wt.prototype.sample=function(n){return this.__chain__||null!=n?this.thru(function(t){return Se(t,n)}):Se(this.value())},Wt.VERSION=w,Mt("bind bindKey curry curryRight partial partialRight".split(" "),function(n){Wt[n].placeholder=Wt}),Mt(["filter","map","takeWhile"],function(n,t){var r=t==F;Ft.prototype[n]=function(n,e){var u=this.clone(),o=u.filtered,i=u.iteratees||(u.iteratees=[]);return u.filtered=o||r||t==L&&0>u.dir,i.push({iteratee:Xr(n,e,3),type:t}),u }}),Mt(["drop","take"],function(n,t){var r=n+"Count",e=n+"While";Ft.prototype[n]=function(e){e=null==e?1:eo(+e||0,0);var u=this.clone();if(u.filtered){var o=u[r];u[r]=t?uo(o,e):o+e}else(u.views||(u.views=[])).push({size:e,type:n+(0>u.dir?"Right":"")});return u},Ft.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()},Ft.prototype[n+"RightWhile"]=function(n,t){return this.reverse()[e](n,t).reverse()}}),Mt(["first","last"],function(n,t){var r="take"+(t?"Right":"");Ft.prototype[n]=function(){return this[r](1).value()[0] }}),Mt(["initial","rest"],function(n,t){var r="drop"+(t?"":"Right");Ft.prototype[n]=function(){return this[r](1)}}),Mt(["pluck","where"],function(n,t){var r=t?"filter":"map",e=t?vu:_u;Ft.prototype[n]=function(n){return this[r](e(n))}}),Ft.prototype.dropWhile=function(n,t){var r,e,u=0>this.dir;return n=Xr(n,t,3),this.filter(function(t,o,i){return r=r&&(u?o<e:o>e),e=o,r||(r=!n(t,o,i))})},Ft.prototype.reject=function(n,t){return n=Xr(n,t,3),this.filter(function(t,r,e){return!n(t,r,e)})},Ft.prototype.slice=function(n,t){n=null==n?0:+n||0; var r=0>n?this.takeRight(-n):this.drop(n);return typeof t!="undefined"&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-n)),r},gr(Ft.prototype,function(n,t){var r=/^(?:first|last)$/.test(t);Wt.prototype[t]=function(){function e(n){return n=[n],Ku.apply(n,o),Wt[t].apply(Wt,n)}var u=this.__wrapped__,o=arguments,i=this.__chain__,a=!!this.__actions__.length,f=u instanceof Ft,c=f&&!a;return r&&!i?c?n.call(u):Wt[t](this.value()):f||To(u)?(u=n.apply(c?u:new Ft(this),o),r||!a&&!u.actions||(u.actions||(u.actions=[])).push({func:xe,args:[e],thisArg:Wt}),new Nt(u,i)):this.thru(e) }}),Mt("concat join pop push shift sort splice unshift".split(" "),function(n){var t=Ou[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:join|pop|shift)$/.test(n);Wt.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),Ft.prototype.clone=function(){var n=this.actions,t=this.iteratees,r=this.views,e=new Ft(this.wrapped);return e.actions=n?zt(n):null,e.dir=this.dir,e.dropCount=this.dropCount,e.filtered=this.filtered,e.iteratees=t?zt(t):null,e.takeCount=this.takeCount,e.views=r?zt(r):null,e },Ft.prototype.reverse=function(){var n=this.filtered,t=n?new Ft(this):this.clone();return t.dir=-1*this.dir,t.filtered=n,t},Ft.prototype.value=function(){var n=this.wrapped.value();if(!To(n))return Cr(n,this.actions);var t,r=this.dir,e=0>r,u=n.length;t=u;for(var o=this.views,i=0,a=-1,f=o?o.length:0;++a<f;){var c=o[a],l=c.size;switch(c.type){case"drop":i+=l;break;case"dropRight":t-=l;break;case"take":t=uo(t,i+l);break;case"takeRight":i=eo(i,t-l)}}t={start:i,end:t},i=t.start,a=t.end,t=this.dropCount,o=uo(a-i,this.takeCount-t),i=e?a:i-1,f=(a=this.iteratees)?a.length:0,c=0,l=[]; n:for(;u--&&c<o;){for(var i=i+r,s=-1,p=n[i];++s<f;){var h=a[s],g=h.iteratee(p,i,n),h=h.type;if(h==U)p=g;else if(!g){if(h==F)continue n;break n}}t?t--:l[c++]=p}return e?l.reverse():l},Wt.prototype.chain=function(){return we(this)},Wt.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof Ft?new Nt(n.reverse()):this.thru(function(n){return n.reverse()})},Wt.prototype.toString=function(){return this.value()+""},Wt.prototype.toJSON=Wt.prototype.valueOf=Wt.prototype.value=function(){return Cr(this.__wrapped__,this.__actions__) },Wt.prototype.collect=Wt.prototype.map,Wt.prototype.head=Wt.prototype.first,Wt.prototype.select=Wt.prototype.filter,Wt.prototype.tail=Wt.prototype.rest,Wt}var b,w="3.0.0",x=1,A=2,j=4,k=8,E=16,R=32,I=64,O=128,C=256,T=30,S="...",W=150,N=16,F=0,U=1,L=2,$="Expected a function",B="__lodash_placeholder__",z="[object Arguments]",D="[object Array]",M="[object Boolean]",q="[object Date]",P="[object Error]",K="[object Function]",V="[object Number]",Y="[object Object]",Z="[object RegExp]",G="[object String]",J="[object ArrayBuffer]",X="[object Float32Array]",H="[object Float64Array]",Q="[object Int8Array]",nt="[object Int16Array]",tt="[object Int32Array]",rt="[object Uint8Array]",et="[object Uint8ClampedArray]",ut="[object Uint16Array]",ot="[object Uint32Array]",it=/\b__p\+='';/g,at=/\b(__p\+=)''\+/g,ft=/(__e\(.*?\)|\b__t\))\+'';/g,ct=/&(?:amp|lt|gt|quot|#39|#96);/g,lt=/[&<>"'`]/g,st=RegExp(ct.source),pt=RegExp(lt.source),ht=/<%-([\s\S]+?)%>/g,gt=/<%([\s\S]+?)%>/g,vt=/<%=([\s\S]+?)%>/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yt=/\w*$/,_t=/^\s*function[ \n\r\t]+\w/,mt=/^0[xX]/,bt=/^\[object .+?Constructor\]$/,wt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xt=/($^)/,At=/[.*+?^${}()|[\]\/\\]/g,jt=RegExp(At.source),kt=/\bthis\b/,Et=/['\n\r\u2028\u2029\\]/g,Rt=RegExp("[A-Z\\xc0-\\xd6\\xd8-\\xde]{2,}(?=[A-Z\\xc0-\\xd6\\xd8-\\xde][a-z\\xdf-\\xf6\\xf8-\\xff]+)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+|[A-Z\\xc0-\\xd6\\xd8-\\xde]+|[0-9]+","g"),It=" \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",Ot="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout document isFinite parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap window WinRTError".split(" "),Ct={}; Ct[X]=Ct[H]=Ct[Q]=Ct[nt]=Ct[tt]=Ct[rt]=Ct[et]=Ct[ut]=Ct[ot]=true,Ct[z]=Ct[D]=Ct[J]=Ct[M]=Ct[q]=Ct[P]=Ct[K]=Ct["[object Map]"]=Ct[V]=Ct[Y]=Ct[Z]=Ct["[object Set]"]=Ct[G]=Ct["[object WeakMap]"]=false;var Tt={};Tt[z]=Tt[D]=Tt[J]=Tt[M]=Tt[q]=Tt[X]=Tt[H]=Tt[Q]=Tt[nt]=Tt[tt]=Tt[V]=Tt[Y]=Tt[Z]=Tt[G]=Tt[rt]=Tt[et]=Tt[ut]=Tt[ot]=true,Tt[P]=Tt[K]=Tt["[object Map]"]=Tt["[object Set]"]=Tt["[object WeakMap]"]=false;var St={leading:false,maxWait:0,trailing:false},Wt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Nt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},Ft={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},Ut={"function":true,object:true},Lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$t=Ut[typeof window]&&window!==(this&&this.window)?window:this,Bt=Ut[typeof exports]&&exports&&!exports.nodeType&&exports,Ut=Ut[typeof module]&&module&&!module.nodeType&&module,zt=Bt&&Ut&&typeof global=="object"&&global; !zt||zt.global!==zt&&zt.window!==zt&&zt.self!==zt||($t=zt);var zt=Ut&&Ut.exports===Bt&&Bt,Dt=m();typeof define=="function"&&typeof define.amd=="object"&&define.amd?($t._=Dt, define(function(){return Dt})):Bt&&Ut?zt?(Ut.exports=Dt)._=Dt:Bt._=Dt:$t._=Dt}).call(this);
JimBobSquarePants/cdnjs
ajax/libs/lodash.js/3.0.0/lodash.min.js
JavaScript
mit
46,493
/* * This file is part of the SDWebImage package. * (c) Olivier Poitrey <rs@dailymotion.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #import "UIImageView+WebCache.h" #import "objc/runtime.h" #import "UIView+WebCacheOperation.h" static char imageURLKey; @implementation UIImageView (WebCache) - (void)sd_setImageWithURL:(NSURL *)url { [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:nil]; } - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder { [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:nil]; } - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:nil]; } - (void)sd_setImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:completedBlock]; } - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:completedBlock]; } - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; } - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { [self sd_cancelCurrentImageLoad]; objc_setAssociatedObject(self, &imageURLKey, url, OBJC_ASSOCIATION_RETAIN_NONATOMIC); if (!(options & SDWebImageDelayPlaceholder)) { dispatch_main_async_safe(^{ self.image = placeholder; }); } if (url) { __weak __typeof(self)wself = self; id <SDWebImageOperation> operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { if (!wself) return; dispatch_main_sync_safe(^{ if (!wself) return; if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock) { completedBlock(image, error, cacheType, url); return; } else if (image) { wself.image = image; [wself setNeedsLayout]; } else { if ((options & SDWebImageDelayPlaceholder)) { wself.image = placeholder; [wself setNeedsLayout]; } } if (completedBlock && finished) { completedBlock(image, error, cacheType, url); } }); }]; [self sd_setImageLoadOperation:operation forKey:@"UIImageViewImageLoad"]; } else { dispatch_main_async_safe(^{ NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; if (completedBlock) { completedBlock(nil, error, SDImageCacheTypeNone, url); } }); } } - (void)sd_setImageWithPreviousCachedImageWithURL:(NSURL *)url andPlaceholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:url]; UIImage *lastPreviousCachedImage = [[SDImageCache sharedImageCache] imageFromDiskCacheForKey:key]; [self sd_setImageWithURL:url placeholderImage:lastPreviousCachedImage ?: placeholder options:options progress:progressBlock completed:completedBlock]; } - (NSURL *)sd_imageURL { return objc_getAssociatedObject(self, &imageURLKey); } - (void)sd_setAnimationImagesWithURLs:(NSArray *)arrayOfURLs { [self sd_cancelCurrentAnimationImagesLoad]; __weak __typeof(self)wself = self; NSMutableArray *operationsArray = [[NSMutableArray alloc] init]; for (NSURL *logoImageURL in arrayOfURLs) { id <SDWebImageOperation> operation = [SDWebImageManager.sharedManager downloadImageWithURL:logoImageURL options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { if (!wself) return; dispatch_main_sync_safe(^{ __strong UIImageView *sself = wself; [sself stopAnimating]; if (sself && image) { NSMutableArray *currentImages = [[sself animationImages] mutableCopy]; if (!currentImages) { currentImages = [[NSMutableArray alloc] init]; } [currentImages addObject:image]; sself.animationImages = currentImages; [sself setNeedsLayout]; } [sself startAnimating]; }); }]; [operationsArray addObject:operation]; } [self sd_setImageLoadOperation:[NSArray arrayWithArray:operationsArray] forKey:@"UIImageViewAnimationImages"]; } - (void)sd_cancelCurrentImageLoad { [self sd_cancelImageLoadOperationWithKey:@"UIImageViewImageLoad"]; } - (void)sd_cancelCurrentAnimationImagesLoad { [self sd_cancelImageLoadOperationWithKey:@"UIImageViewAnimationImages"]; } @end @implementation UIImageView (WebCacheDeprecated) - (NSURL *)imageURL { return [self sd_imageURL]; } - (void)setImageWithURL:(NSURL *)url { [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:nil]; } - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder { [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:nil]; } - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:nil]; } - (void)setImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { if (completedBlock) { completedBlock(image, error, cacheType); } }]; } - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { if (completedBlock) { completedBlock(image, error, cacheType); } }]; } - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { if (completedBlock) { completedBlock(image, error, cacheType); } }]; } - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { if (completedBlock) { completedBlock(image, error, cacheType); } }]; } - (void)cancelCurrentArrayLoad { [self sd_cancelCurrentAnimationImagesLoad]; } - (void)cancelCurrentImageLoad { [self sd_cancelCurrentImageLoad]; } - (void)setAnimationImagesWithURLs:(NSArray *)arrayOfURLs { [self sd_setAnimationImagesWithURLs:arrayOfURLs]; } @end
ddc391565320/ZLPhotoLib
Demo/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.m
Matlab
mit
8,702
YUI.add('node-pluginhost', function (Y, NAME) { /** * @module node * @submodule node-pluginhost */ /** * Registers plugins to be instantiated at the class level (plugins * which should be plugged into every instance of Node by default). * * @method plug * @static * @for Node * @param {Function | Array} plugin Either the plugin class, an array of plugin classes or an array of objects (with fn and cfg properties defined) * @param {Object} config (Optional) If plugin is the plugin class, the configuration for the plugin */ Y.Node.plug = function() { var args = Y.Array(arguments); args.unshift(Y.Node); Y.Plugin.Host.plug.apply(Y.Base, args); return Y.Node; }; /** * Unregisters any class level plugins which have been registered by the Node * * @method unplug * @static * * @param {Function | Array} plugin The plugin class, or an array of plugin classes */ Y.Node.unplug = function() { var args = Y.Array(arguments); args.unshift(Y.Node); Y.Plugin.Host.unplug.apply(Y.Base, args); return Y.Node; }; Y.mix(Y.Node, Y.Plugin.Host, false, null, 1); // run PluginHost constructor on cached Node instances Y.Object.each(Y.Node._instances, function (node) { Y.Plugin.Host.apply(node); }); // allow batching of plug/unplug via NodeList // doesn't use NodeList.importMethod because we need real Nodes (not tmpNode) /** * Adds a plugin to each node in the NodeList. * This will instantiate the plugin and attach it to the configured namespace on each node * @method plug * @for NodeList * @param P {Function | Object |Array} Accepts the plugin class, or an * object with a "fn" property specifying the plugin class and * a "cfg" property specifying the configuration for the Plugin. * <p> * Additionally an Array can also be passed in, with the above function or * object values, allowing the user to add multiple plugins in a single call. * </p> * @param config (Optional) If the first argument is the plugin class, the second argument * can be the configuration for the plugin. * @chainable */ Y.NodeList.prototype.plug = function() { var args = arguments; Y.NodeList.each(this, function(node) { Y.Node.prototype.plug.apply(Y.one(node), args); }); return this; }; /** * Removes a plugin from all nodes in the NodeList. This will destroy the * plugin instance and delete the namespace each node. * @method unplug * @for NodeList * @param {String | Function} plugin The namespace of the plugin, or the plugin class with the static NS namespace property defined. If not provided, * all registered plugins are unplugged. * @chainable */ Y.NodeList.prototype.unplug = function() { var args = arguments; Y.NodeList.each(this, function(node) { Y.Node.prototype.unplug.apply(Y.one(node), args); }); return this; }; }, '3.18.0', {"requires": ["node-base", "pluginhost"]});
mival/cdnjs
ajax/libs/yui/3.18.0/node-pluginhost/node-pluginhost-debug.js
JavaScript
mit
2,896
YUI.add('tree', function (Y, NAME) { /*jshint boss:true, expr:true, onevar:false */ /** Provides a generic tree data structure and related functionality. A tree has a root node, which may contain any number of child nodes, which may themselves contain child nodes, ad infinitum. Child nodes are lightweight function instances which delegate to the tree for all significant functionality, so trees remain performant and memory-efficient even with thousands and thousands of nodes. @module tree @main tree **/ /** The `Tree` class represents a generic tree data structure. A tree has a root node, which may contain any number of child nodes, which may themselves contain child nodes, ad infinitum. This class doesn't expose any UI, but is intended to be used as a data structure or base class for other components. For example, the SmugMug TreeView gallery module extends Tree and provides a TreeView UI. @class Tree @param {Object} [config] Config options. @param {Object[]|Tree.Node[]} [config.nodes] Array of tree node config objects or `Tree.Node` instances to add to this tree at initialization time. @param {Object|Tree.Node} [config.rootNode] Node to use as the root node of this tree. @constructor @extends Base **/ var Lang = Y.Lang, /** Fired when a node is added to this Tree. The `src` property will indicate how the node was added ("append", "insert", "prepend", etc.). @event add @param {Number} index Index at which the node will be added. @param {Tree.Node} node Node being added. @param {Tree.Node} parent Parent node to which the node will be added. @param {String} src Source of the event ("append", "insert", "prepend", etc.). @preventable _defAddFn **/ EVT_ADD = 'add', /** Fired when this Tree is cleared. @event clear @param {Tree.Node} rootNode New root node of this tree (the old root node is always destroyed when a tree is cleared). @param {String} src Source of the event. @preventable _defClearFn **/ EVT_CLEAR = 'clear', /** Fired when a node is removed from this Tree. @event remove @param {Boolean} destroy Whether or not the node will be destroyed after being removed from this tree. @param {Tree.Node} node Node being removed. @param {Tree.Node} parent Parent node from which the node will be removed. @param {String} src Source of the event. @preventable _defRemoveFn **/ EVT_REMOVE = 'remove'; var Tree = Y.Base.create('tree', Y.Base, [], { // -- Public Properties ---------------------------------------------------- /** Reference to the `children` array of this Tree's `rootNode`. This is a convenience property to allow you to type `tree.children` instead of `tree.rootNode.children`. @property {Tree.Node[]} children @readOnly **/ /** The `Tree.Node` class or subclass that should be used for nodes created by this tree. You may specify an actual class reference or a string that resolves to a class reference at runtime. @property {String|Tree.Node} nodeClass @default Y.Tree.Node **/ nodeClass: Y.Tree.Node, /** Optional array containing one or more extension classes that should be mixed into the `nodeClass` when this Tree is instantiated. The resulting composed node class will be unique to this Tree instance and will not affect any other instances, nor will it modify the defined `nodeClass` itself. This provides a late-binding extension mechanism for nodes that doesn't require them to extend `Y.Base`, which would incur a significant performance hit. @property {Array} nodeExtensions @default [] **/ nodeExtensions: [], /** Root node of this Tree. @property {Tree.Node} rootNode @readOnly **/ // -- Protected Properties ------------------------------------------------- /** Simple way to type-check that this is a Tree instance. @property {Boolean} _isYUITree @default true @protected **/ _isYUITree: true, /** Composed node class based on `nodeClass` that mixes in any extensions specified in `nodeExtensions`. If there are no extensions, this will just be a reference to `nodeClass`. @property {Tree.Node} _nodeClass @protected **/ /** Mapping of node ids to node instances for nodes in this tree. @property {Object} _nodeMap @protected **/ /** Default config object for the root node. @property {Object} _rootNodeConfig @protected **/ _rootNodeConfig: {canHaveChildren: true}, // -- Lifecycle ------------------------------------------------------------ initializer: function (config) { config || (config = {}); if (config.nodeClass) { this.nodeClass = config.nodeClass; } if (config.nodeExtensions) { this.nodeExtensions = this.nodeExtensions.concat(config.nodeExtensions); } /** Hash of published custom events. @property {Object} _published @default {} @protected **/ this._published || (this._published = {}); this._nodeMap = {}; // Allow all extensions to initialize, then finish up. this.onceAfter('initializedChange', function () { this._composeNodeClass(); this.clear(config.rootNode, {silent: true}); if (config.nodes) { this.insertNode(this.rootNode, config.nodes, {silent: true}); } }); }, destructor: function () { this.destroyNode(this.rootNode, {silent: true}); this.children = null; this.rootNode = null; this._nodeClass = null; this._nodeMap = null; this._published = null; }, // -- Public Methods ------------------------------------------------------- /** Appends a node or array of nodes as the last child of the specified parent node. If a node being appended is from another tree, it and all its children will be removed from that tree and moved to this one. @method appendNode @param {Tree.Node} parent Parent node. @param {Object|Object[]|Tree.Node|Tree.Node[]} node Child node, node config object, array of child nodes, or array of node config objects to append to the given parent. Node config objects will automatically be converted into node instances. @param {Object} [options] Options. @param {Boolean} [options.silent=false] If `true`, the `add` event will be suppressed. @return {Tree.Node|Tree.Node[]} Node or array of nodes that were appended. **/ appendNode: function (parent, node, options) { return this.insertNode(parent, node, Y.merge(options, { index: parent.children.length, src : 'append' })); }, /** Clears this tree by destroying the root node and all its children. If a `rootNode` argument is provided, that node will become the root node of this tree; otherwise, a new root node will be created. @method clear @param {Object|Tree.Node} [rootNode] If specified, this node will be used as the new root node. @param {Object} [options] Options. @param {Boolean} [options.silent=false] If `true`, the `clear` event will be suppressed. @param {String} [options.src] Source of the change, to be passed along to the event facade of the resulting event. This can be used to distinguish between changes triggered by a user and changes triggered programmatically, for example. @chainable **/ clear: function (rootNode, options) { return this._fireTreeEvent(EVT_CLEAR, { rootNode: this.createNode(rootNode || this._rootNodeConfig), src : options && options.src }, { defaultFn: this._defClearFn, silent : options && options.silent }); }, /** Creates and returns a new `Tree.Node` instance associated with (but not yet appended to) this tree. @method createNode @param {Object|Tree.Node} [config] Node configuration. If a `Tree.Node` instance is specified instead of a config object, that node will be adopted into this tree (if it doesn't already belong to this tree) and removed from any other tree to which it belongs. @return {Tree.Node|null} New node, or `null` if a node could not be created from the given _config_. **/ createNode: function (config) { config || (config = {}); // If `config` is already a node, just ensure it hasn't been destroyed // and is in the node map, then return it. if (config._isYUITreeNode) { if (config.state.destroyed) { Y.error('Cannot insert a node that has already been destroyed.', null, 'tree'); return null; } this._adoptNode(config); return config; } // First, create nodes for any children of this node. if (config.children) { var children = []; for (var i = 0, len = config.children.length; i < len; i++) { children.push(this.createNode(config.children[i])); } config = Y.merge(config, {children: children}); } var node = new this._nodeClass(this, config); return this._nodeMap[node.id] = node; }, /** Removes and destroys a node and all its child nodes. Once destroyed, a node is eligible for garbage collection and cannot be reused or re-added to the tree. @method destroyNode @param {Tree.Node} node Node to destroy. @param {Object} [options] Options. @param {Boolean} [options.silent=false] If `true`, `remove` events will be suppressed. @param {String} [options.src] Source of the change, to be passed along to the event facade of the resulting events. This can be used to distinguish between changes triggered by a user and changes triggered programmatically, for example. @chainable **/ destroyNode: function (node, options) { var child, i, len; options || (options = {}); for (i = 0, len = node.children.length; i < len; i++) { child = node.children[i]; // Manually remove the child from its parent; this makes destroying // all children of the parent much faster since there's no splicing // involved. child.parent = null; // Destroy the child. this.destroyNode(child, options); } if (node.parent) { this.removeNode(node, options); } node.children = []; node.data = {}; node.state = {destroyed: true}; node.tree = null; node._indexMap = {}; delete this._nodeMap[node.id]; return this; }, /** Removes all children from the specified node. The removed children will still be reusable unless the `destroy` option is truthy. @method emptyNode @param {Tree.Node} node Node to empty. @param {Object} [options] Options. @param {Boolean} [options.destroy=false] If `true`, the children will also be destroyed, which makes them available for garbage collection and means they can't be reused. @param {Boolean} [options.silent=false] If `true`, `remove` events will be suppressed. @param {String} [options.src] Source of the change, to be passed along to the event facade of the resulting events. This can be used to distinguish between changes triggered by a user and changes triggered programmatically, for example. @return {Tree.Node[]} Array of removed child nodes. **/ emptyNode: function (node, options) { var children = node.children, removed = []; for (var i = children.length - 1; i > -1; --i) { removed[i] = this.removeNode(children[i], options); } return removed; }, /** Performs a depth-first traversal of _node_, passing it and each of its descendants to the specified _callback_, and returning the first node for which the callback returns a truthy value. Traversal will stop as soon as a truthy value is returned from the callback. See `traverseNode()` for more details on how depth-first traversal works. @method findNode @param {Tree.Node} node Node to traverse. @param {Object} [options] Options. @param {Number} [options.depth] Depth limit. If specified, descendants will only be traversed to this depth before backtracking and moving on. @param {Function} callback Callback function to call with the traversed node and each of its descendants. If this function returns a truthy value, traversal will be stopped and the current node will be returned. @param {Tree.Node} callback.node Node being traversed. @param {Object} [thisObj] `this` object to use when executing _callback_. @return {Tree.Node|null} Returns the first node for which the _callback_ returns a truthy value, or `null` if the callback never returns a truthy value. **/ findNode: function (node, options, callback, thisObj) { var match = null; // Allow callback as second argument. if (typeof options === 'function') { thisObj = callback; callback = options; options = {}; } this.traverseNode(node, options, function (descendant) { if (callback.call(thisObj, descendant)) { match = descendant; return Tree.STOP_TRAVERSAL; } }); return match; }, /** Returns the tree node with the specified id, or `undefined` if the node doesn't exist in this tree. @method getNodeById @param {String} id Node id. @return {Tree.Node} Node, or `undefined` if not found. **/ getNodeById: function (id) { return this._nodeMap[id]; }, /** Inserts a node or array of nodes at the specified index under the given parent node, or appends them to the parent if no index is specified. If a node being inserted is from another tree, it and all its children will be removed from that tree and moved to this one. @method insertNode @param {Tree.Node} parent Parent node. @param {Object|Object[]|Tree.Node|Tree.Node[]} node Child node, node config object, array of child nodes, or array of node config objects to insert under the given parent. Node config objects will automatically be converted into node instances. @param {Object} [options] Options. @param {Number} [options.index] Index at which to insert the child node. If not specified, the node will be appended as the last child of the parent. @param {Boolean} [options.silent=false] If `true`, the `add` event will be suppressed. @param {String} [options.src='insert'] Source of the change, to be passed along to the event facade of the resulting event. This can be used to distinguish between changes triggered by a user and changes triggered programmatically, for example. @return {Tree.Node|Tree.Node[]} Node or array of nodes that were inserted. **/ insertNode: function (parent, node, options) { options || (options = {}); parent || (parent = this.rootNode); // If `node` is an array, recurse to insert each node it contains. // // Note: If you're getting an exception here because `node` is null when // you've passed in a reference to some other node's `children` array, // that's happening because nodes must be removed from their current // parent before being added to the new one, and the `children` array is // being modified while the nodes are inserted. // // Solution: pass a copy of the other node's `children` array instead of // the original. Doing the copy operation here would have a negative // impact on performance, so you're on your own since this is such a // rare edge case. if ('length' in node && Lang.isArray(node)) { var hasIndex = 'index' in options, insertedNodes = [], insertedNode; for (var i = 0, len = node.length; i < len; i++) { insertedNode = this.insertNode(parent, node[i], options); if (insertedNode) { insertedNodes.push(insertedNode); if (hasIndex) { options.index += 1; } } } return insertedNodes; } node = this.createNode(node); if (node) { var index = options.index; if (typeof index === 'undefined') { index = this._getDefaultNodeIndex(parent, node, options); } this._fireTreeEvent(EVT_ADD, { index : index, node : node, parent: parent, src : options.src || 'insert' }, { defaultFn: this._defAddFn, silent : options.silent }); } return node; }, /** Prepends a node or array of nodes at the beginning of the specified parent node. If a node being prepended is from another tree, it and all its children will be removed from that tree and moved to this one. @method prependNode @param {Tree.Node} parent Parent node. @param {Object|Object[]|Tree.Node|Tree.Node[]} node Child node, node config object, array of child nodes, or array of node config objects to prepend to the given parent. Node config objects will automatically be converted into node instances. @param {Object} [options] Options. @param {Boolean} [options.silent=false] If `true`, the `add` event will be suppressed. @return {Tree.Node|Tree.Node[]} Node or array of nodes that were prepended. **/ prependNode: function (parent, node, options) { return this.insertNode(parent, node, Y.merge(options, { index: 0, src : 'prepend' })); }, /** Removes the specified node from its parent node. The removed node will still be reusable unless the `destroy` option is truthy. @method removeNode @param {Tree.Node} node Node to remove. @param {Object} [options] Options. @param {Boolean} [options.destroy=false] If `true`, the node and all its children will also be destroyed, which makes them available for garbage collection and means they can't be reused. @param {Boolean} [options.silent=false] If `true`, the `remove` event will be suppressed. @param {String} [options.src] Source of the change, to be passed along to the event facade of the resulting event. This can be used to distinguish between changes triggered by a user and changes triggered programmatically, for example. @return {Tree.Node} Node that was removed. **/ removeNode: function (node, options) { options || (options = {}); this._fireTreeEvent(EVT_REMOVE, { destroy: !!options.destroy, node : node, parent : node.parent, src : options.src || 'remove' }, { defaultFn: this._defRemoveFn, silent : options.silent }); return node; }, /** Returns the total number of nodes in this tree, at all levels. Use `rootNode.children.length` to get only the number of top-level nodes. @method size @return {Number} Total number of nodes in this tree. **/ size: function () { return this.rootNode.size() + 1; }, /** Serializes this tree to an object suitable for use in JSON. @method toJSON @return {Object} Serialized tree object. **/ toJSON: function () { return this.rootNode.toJSON(); }, /** Performs a depth-first traversal of _node_, passing it and each of its descendants to the specified _callback_. If the callback function returns `Tree.STOP_TRAVERSAL`, traversal will be stopped immediately. Otherwise, it will continue until the deepest descendant of _node_ has been traversed, or until each branch has been traversed to the optional maximum depth limit. Since traversal is depth-first, that means nodes are traversed like this: 1 / | \ 2 8 9 / \ \ 3 7 10 / | \ / \ 4 5 6 11 12 @method traverseNode @param {Tree.Node} node Node to traverse. @param {Object} [options] Options. @param {Number} [options.depth] Depth limit. If specified, descendants will only be traversed to this depth before backtracking and moving on. @param {Function} callback Callback function to call with the traversed node and each of its descendants. @param {Tree.Node} callback.node Node being traversed. @param {Object} [thisObj] `this` object to use when executing _callback_. @return {Mixed} Returns `Tree.STOP_TRAVERSAL` if traversal was stopped; otherwise returns `undefined`. **/ traverseNode: function (node, options, callback, thisObj) { if (node.state.destroyed) { Y.error('Cannot traverse a node that has been destroyed.', null, 'tree'); return; } // Allow callback as second argument. if (typeof options === 'function') { thisObj = callback; callback = options; options = {}; } options || (options = {}); var stop = Tree.STOP_TRAVERSAL, unlimited = typeof options.depth === 'undefined'; if (callback.call(thisObj, node) === stop) { return stop; } var children = node.children; if (unlimited || options.depth > 0) { var childOptions = unlimited ? options : {depth: options.depth - 1}; for (var i = 0, len = children.length; i < len; i++) { if (this.traverseNode(children[i], childOptions, callback, thisObj) === stop) { return stop; } } } }, // -- Protected Methods ---------------------------------------------------- /** Moves the specified node and all its children from another tree to this tree. @method _adoptNode @param {Tree.Node} node Node to adopt. @param {Object} [options] Options to pass along to `removeNode()`. @protected **/ _adoptNode: function (node, options) { var oldTree = node.tree, child; if (oldTree === this) { return; } for (var i = 0, len = node.children.length; i < len; i++) { child = node.children[i]; child.parent = null; // Prevents the child from being removed from // its parent during the adoption. this._adoptNode(child, {silent: true}); child.parent = node; } if (node.parent) { oldTree.removeNode(node, options); } delete oldTree._nodeMap[node.id]; // If this node isn't an instance of this tree's composed _nodeClass, // then we need to recreate it to avoid potentially breaking things in // really weird ways. if (!(node instanceof this._nodeClass) || oldTree._nodeClass !== this._nodeClass) { node = this.createNode(node.toJSON()); } node.tree = this; node._isIndexStale = true; this._nodeMap[node.id] = node; }, /** Composes a custom late-bound tree node class (if necessary) based on the classes specified in this Tree's `nodeClass` and `nodeExtensions` properties. The composed class is stored in this Tree's `_nodeClass` property. If composition wasn't necessary, then `_nodeClass` will just be a reference to `nodeClass`. @method _composeNodeClass @protected **/ _composeNodeClass: function () { var nodeClass = this.nodeClass, nodeExtensions = this.nodeExtensions, composedClass; if (typeof nodeClass === 'string') { // Look for a namespaced node class on `Y`. nodeClass = Y.Object.getValue(Y, nodeClass.split('.')); if (nodeClass) { this.nodeClass = nodeClass; } else { Y.error('Node class not found: ' + nodeClass, null, 'tree'); return; } } if (!nodeExtensions.length) { this._nodeClass = nodeClass; return; } // Compose a new class by mixing extensions into nodeClass. composedClass = function () { var extensions = composedClass._nodeExtensions; nodeClass.apply(this, arguments); for (var i = 0, len = extensions.length; i < len; i++) { extensions[i].apply(this, arguments); } }; Y.extend(composedClass, nodeClass); for (var i = 0, len = nodeExtensions.length; i < len; i++) { Y.mix(composedClass.prototype, nodeExtensions[i].prototype, true); } composedClass._nodeExtensions = nodeExtensions; this._nodeClass = composedClass; }, /** Utility method for lazily publishing and firing events. @method _fireTreeEvent @param {String} name Event name to fire. @param {Object} facade Event facade. @param {Object} [options] Options. @param {Function} [options.defaultFn] Default handler for this event. @param {Boolean} [options.silent=false] Whether the default handler should be executed directly without actually firing the event. @chainable @protected **/ _fireTreeEvent: function (name, facade, options) { if (options && options.silent) { if (options.defaultFn) { facade.silent = true; // intentionally modifying the facade options.defaultFn.call(this, facade); } } else { if (options && options.defaultFn && !this._published[name]) { this._published[name] = this.publish(name, { defaultFn: options.defaultFn }); } this.fire(name, facade); } return this; }, /** Returns the default insertion index that should be used when _node_ is inserted as a child of _parent_ without an explicit index. The primary purpose of this method is to serve as a hook point for extensions and plugins that need to customize insertion order. @method _getDefaultNodeIndex @param {Tree.Node} parent Parent node. @param {Tree.Node} node Node being inserted. @param {Object} [options] Options passed to `insertNode()`. @return {Number} Index at which _node_ should be inserted into _parent_'s `children` array. @protected **/ _getDefaultNodeIndex: function (parent/*, node, options*/) { return parent.children.length; }, /** Removes the specified node from its parent node if it has one. @method _removeNodeFromParent @param {Tree.Node} node Node to remove. @protected **/ _removeNodeFromParent: function (node) { var parent = node.parent, index; if (parent) { index = parent.indexOf(node); if (index > -1) { var children = parent.children; if (index === children.length - 1) { children.pop(); } else { children.splice(index, 1); parent._isIndexStale = true; } node.parent = null; } } }, // -- Default Event Handlers ----------------------------------------------- _defAddFn: function (e) { var index = e.index, node = e.node, parent = e.parent, oldIndex; // Remove the node from its existing parent if it has one. if (node.parent) { // If the node's existing parent is the same parent it's being // inserted into, adjust the index to avoid an off-by-one error. if (node.parent === parent) { oldIndex = parent.indexOf(node); if (oldIndex === index) { // Old index is the same as the new index, so just don't do // anything. return; } else if (oldIndex < index) { // Removing the node from its old index will affect the new // index, so decrement the new index by one. index -= 1; } } this.removeNode(node, { silent: e.silent, src : 'add' }); } // Add the node to its new parent at the desired index. node.parent = parent; parent.children.splice(index, 0, node); parent.canHaveChildren = true; parent._isIndexStale = true; }, _defClearFn: function (e) { var newRootNode = e.rootNode; if (this.rootNode) { this.destroyNode(this.rootNode, {silent: true}); } this._nodeMap = {}; this._nodeMap[newRootNode.id] = newRootNode; this.rootNode = newRootNode; this.children = newRootNode.children; }, _defRemoveFn: function (e) { var node = e.node; if (e.destroy) { this.destroyNode(node, {silent: true}); } else if (e.parent) { this._removeNodeFromParent(node); } else if (this.rootNode === node) { // Guess we'll need a new root node! this.rootNode = this.createNode(this._rootNodeConfig); this.children = this.rootNode.children; } } }, { /** Return this value from a `Tree#traverseNode()` or `Tree.Node#traverse()` callback to immediately stop traversal. @property STOP_TRAVERSAL @static **/ STOP_TRAVERSAL: {} }); Y.Tree = Y.mix(Tree, Y.Tree); }, '3.18.0', {"requires": ["base-build", "tree-node"]});
Piicksarn/cdnjs
ajax/libs/yui/3.18.0/tree/tree-debug.js
JavaScript
mit
31,093
YUI.add('series-pie', function (Y, NAME) { /** * Provides functionality for creating a pie series. * * @module charts * @submodule series-pie */ /** * PieSeries visualizes data as a circular chart divided into wedges which represent data as a * percentage of a whole. * * @class PieSeries * @constructor * @extends SeriesBase * @uses Plots * @param {Object} config (optional) Configuration parameters. * @submodule series-pie */ var CONFIG = Y.config, DOCUMENT = CONFIG.doc, _getClassName = Y.ClassNameManager.getClassName, SERIES_MARKER = _getClassName("seriesmarker"); Y.PieSeries = Y.Base.create("pieSeries", Y.SeriesBase, [Y.Plots], { /** * Image map used for interactivity when rendered with canvas. * * @property _map * @type HTMLElement * @private */ _map: null, /** * Image used for image map when rendered with canvas. * * @property _image * @type HTMLElement * @private */ _image: null, /** * Creates or updates the image map when rendered with canvas. * * @method _setMap * @private */ _setMap: function() { var id = "pieHotSpotMapi_" + Math.round(100000 * Math.random()), graph = this.get("graph"), graphic, cb, areaNode; if(graph) { cb = graph.get("contentBox"); } else { graphic = this.get("graphic"); cb = graphic.get("node"); } if(this._image) { cb.removeChild(this._image); while(this._areaNodes && this._areaNodes.length > 0) { areaNode = this._areaNodes.shift(); this._map.removeChild(areaNode); } cb.removeChild(this._map); } this._image = DOCUMENT.createElement("img"); this._image.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSB" + "JbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg=="; cb.appendChild(this._image); this._image.style.position = "absolute"; this._image.style.left = "0px"; this._image.style.top = "0px"; this._image.setAttribute("usemap", "#" + id); this._image.style.zIndex = 3; this._image.style.opacity = 0; this._image.setAttribute("alt", "imagemap"); this._map = DOCUMENT.createElement("map"); cb.appendChild(this._map); this._map.setAttribute("name", id); this._map.setAttribute("id", id); this._areaNodes = []; }, /** * Storage for `categoryDisplayName` attribute. * * @property _categoryDisplayName * @private */ _categoryDisplayName: null, /** * Storage for `valueDisplayName` attribute. * * @property _valueDisplayName * @private */ _valueDisplayName: null, /** * Adds event listeners. * * @method addListeners * @private */ addListeners: function() { var categoryAxis = this.get("categoryAxis"), valueAxis = this.get("valueAxis"); if(categoryAxis) { categoryAxis.after("dataReady", Y.bind(this._categoryDataChangeHandler, this)); categoryAxis.after("dataUpdate", Y.bind(this._categoryDataChangeHandler, this)); } if(valueAxis) { valueAxis.after("dataReady", Y.bind(this._valueDataChangeHandler, this)); valueAxis.after("dataUpdate", Y.bind(this._valueDataChangeHandler, this)); } this.after("categoryAxisChange", this.categoryAxisChangeHandler); this.after("valueAxisChange", this.valueAxisChangeHandler); this._stylesChangeHandle = this.after("stylesChange", this._updateHandler); this._visibleChangeHandle = this.after("visibleChange", this._handleVisibleChange); }, /** * Draws the series. * * @method validate * @private */ validate: function() { this.draw(); this._renderered = true; }, /** * Event handler for the categoryAxisChange event. * * @method _categoryAxisChangeHandler * @param {Object} e Event object. * @private */ _categoryAxisChangeHandler: function() { var categoryAxis = this.get("categoryAxis"); categoryAxis.after("dataReady", Y.bind(this._categoryDataChangeHandler, this)); categoryAxis.after("dataUpdate", Y.bind(this._categoryDataChangeHandler, this)); }, /** * Event handler for the valueAxisChange event. * * @method _valueAxisChangeHandler * @param {Object} e Event object. * @private */ _valueAxisChangeHandler: function() { var valueAxis = this.get("valueAxis"); valueAxis.after("dataReady", Y.bind(this._valueDataChangeHandler, this)); valueAxis.after("dataUpdate", Y.bind(this._valueDataChangeHandler, this)); }, /** * Constant used to generate unique id. * * @property GUID * @type String * @private */ GUID: "pieseries", /** * Event handler for categoryDataChange event. * * @method _categoryDataChangeHandler * @param {Object} event Event object. * @private */ _categoryDataChangeHandler: function() { if(this._rendered && this.get("categoryKey") && this.get("valueKey")) { this.draw(); } }, /** * Event handler for valueDataChange event. * * @method _valueDataChangeHandler * @param {Object} event Event object. * @private */ _valueDataChangeHandler: function() { if(this._rendered && this.get("categoryKey") && this.get("valueKey")) { this.draw(); } }, /** * Returns the sum of all values for the series. * * @method getTotalValues * @return Number */ getTotalValues: function() { var total = this.get("valueAxis").getTotalByKey(this.get("valueKey")); return total; }, /** * Draws the series. Overrides the base implementation. * * @method draw * @protected */ draw: function() { var w = this.get("width"), h = this.get("height"); if(isFinite(w) && isFinite(h) && w > 0 && h > 0) { this._rendered = true; if(this._drawing) { this._callLater = true; return; } this._drawing = true; this._callLater = false; this.drawSeries(); this._drawing = false; if(this._callLater) { this.draw(); } else { this.fire("drawingComplete"); } } }, /** * Draws the markers * * @method drawPlots * @protected */ drawPlots: function() { var values = this.get("valueAxis").getDataByKey(this.get("valueKey")).concat(), totalValue = 0, itemCount = values.length, styles = this.get("styles").marker, fillColors = styles.fill.colors, fillAlphas = styles.fill.alphas || ["1"], borderColors = styles.border.colors, borderWeights = [styles.border.weight], borderAlphas = [styles.border.alpha], tbw = borderWeights.concat(), tbc = borderColors.concat(), tba = borderAlphas.concat(), tfc, tfa, padding = styles.padding, graphic = this.get("graphic"), minDimension = Math.min(graphic.get("width"), graphic.get("height")), w = minDimension - (padding.left + padding.right), h = minDimension - (padding.top + padding.bottom), startAngle = -90, halfWidth = w / 2, halfHeight = h / 2, radius = Math.min(halfWidth, halfHeight), i = 0, value, angle = 0, lc, la, lw, wedgeStyle, marker, graphOrder = this.get("graphOrder") || 0, isCanvas = Y.Graphic.NAME === "canvasGraphic"; for(; i < itemCount; ++i) { value = parseFloat(values[i]); values.push(value); if(!isNaN(value)) { totalValue += value; } } tfc = fillColors ? fillColors.concat() : null; tfa = fillAlphas ? fillAlphas.concat() : null; this._createMarkerCache(); if(isCanvas) { this._setMap(); this._image.width = w; this._image.height = h; } for(i = 0; i < itemCount; i++) { value = values[i]; if(totalValue === 0) { angle = 360 / values.length; } else { angle = 360 * (value / totalValue); } if(tfc && tfc.length < 1) { tfc = fillColors.concat(); } if(tfa && tfa.length < 1) { tfa = fillAlphas.concat(); } if(tbw && tbw.length < 1) { tbw = borderWeights.concat(); } if(tbw && tbc.length < 1) { tbc = borderColors.concat(); } if(tba && tba.length < 1) { tba = borderAlphas.concat(); } lw = tbw ? tbw.shift() : null; lc = tbc ? tbc.shift() : null; la = tba ? tba.shift() : null; startAngle += angle; wedgeStyle = { border: { color:lc, weight:lw, alpha:la }, fill: { color:tfc ? tfc.shift() : this._getDefaultColor(i, "slice"), alpha:tfa ? tfa.shift() : null }, type: "pieslice", arc: angle, radius: radius, startAngle: startAngle, cx: halfWidth, cy: halfHeight, width: w, height: h }; marker = this.getMarker(wedgeStyle, graphOrder, i); if(isCanvas) { this._addHotspot(wedgeStyle, graphOrder, i); } } this._clearMarkerCache(); }, /** * @protected * * Method used by `styles` setter. Overrides base implementation. * * @method _setStyles * @param {Object} newStyles Hash of properties to update. * @return Object */ _setStyles: function(val) { if(!val.marker) { val = {marker:val}; } val = this._parseMarkerStyles(val); return Y.PieSeries.superclass._mergeStyles.apply(this, [val, this._getDefaultStyles()]); }, /** * Adds an interactive map when rendering in canvas. * * @method _addHotspot * @param {Object} cfg Object containing data used to draw the hotspot * @param {Number} seriesIndex Index of series in the `seriesCollection`. * @param {Number} index Index of the marker using the hotspot. * @private */ _addHotspot: function(cfg, seriesIndex, index) { var areaNode = DOCUMENT.createElement("area"), i = 1, x = cfg.cx, y = cfg.cy, arc = cfg.arc, startAngle = cfg.startAngle - arc, endAngle = cfg.startAngle, radius = cfg.radius, ax = x + Math.cos(startAngle / 180 * Math.PI) * radius, ay = y + Math.sin(startAngle / 180 * Math.PI) * radius, bx = x + Math.cos(endAngle / 180 * Math.PI) * radius, by = y + Math.sin(endAngle / 180 * Math.PI) * radius, numPoints = Math.floor(arc/10) - 1, divAngle = (arc/(Math.floor(arc/10)) / 180) * Math.PI, angleCoord = Math.atan((ay - y)/(ax - x)), pts = x + ", " + y + ", " + ax + ", " + ay, cosAng, sinAng, multDivAng; for(i = 1; i <= numPoints; ++i) { multDivAng = divAngle * i; cosAng = Math.cos(angleCoord + multDivAng); sinAng = Math.sin(angleCoord + multDivAng); if(startAngle <= 90) { pts += ", " + (x + (radius * Math.cos(angleCoord + (divAngle * i)))); pts += ", " + (y + (radius * Math.sin(angleCoord + (divAngle * i)))); } else { pts += ", " + (x - (radius * Math.cos(angleCoord + (divAngle * i)))); pts += ", " + (y - (radius * Math.sin(angleCoord + (divAngle * i)))); } } pts += ", " + bx + ", " + by; pts += ", " + x + ", " + y; this._map.appendChild(areaNode); areaNode.setAttribute("class", SERIES_MARKER); areaNode.setAttribute("id", "hotSpot_" + seriesIndex + "_" + index); areaNode.setAttribute("shape", "polygon"); areaNode.setAttribute("coords", pts); this._areaNodes.push(areaNode); }, /** * Resizes and positions markers based on a mouse interaction. * * @method updateMarkerState * @param {String} type state of the marker * @param {Number} i index of the marker * @protected */ updateMarkerState: function(type, i) { if(this._markers[i]) { var state = this._getState(type), markerStyles, indexStyles, marker = this._markers[i], styles = this.get("styles").marker; markerStyles = state === "off" || !styles[state] ? styles : styles[state]; indexStyles = this._mergeStyles(markerStyles, {}); indexStyles.fill.color = indexStyles.fill.colors[i % indexStyles.fill.colors.length]; indexStyles.fill.alpha = indexStyles.fill.alphas[i % indexStyles.fill.alphas.length]; marker.set(indexStyles); } }, /** * Creates a shape to be used as a marker. * * @method _createMarker * @param {Object} styles Hash of style properties. * @return Shape * @private */ _createMarker: function(styles) { var graphic = this.get("graphic"), marker, cfg = this._copyObject(styles); marker = graphic.addShape(cfg); marker.addClass(SERIES_MARKER); return marker; }, /** * Creates a cache of markers for reuse. * * @method _createMarkerCache * @private */ _clearMarkerCache: function() { var len = this._markerCache.length, i = 0, marker; for(; i < len; ++i) { marker = this._markerCache[i]; if(marker) { marker.destroy(); } } this._markerCache = []; }, /** * Gets the default style values for the markers. * * @method _getPlotDefaults * @return Object * @private */ _getPlotDefaults: function() { var defs = { padding:{ top: 0, left: 0, right: 0, bottom: 0 }, fill:{ alphas:["1"] }, border: { weight: 0, alpha: 1 } }; defs.fill.colors = this._defaultSliceColors; defs.border.colors = this._defaultBorderColors; return defs; } }, { ATTRS: { /** * Read-only attribute indicating the type of series. * * @attribute type * @type String * @default pie */ type: { value: "pie" }, /** * Order of this instance of this `type`. * * @attribute order * @type Number */ order: {}, /** * Reference to the `Graph` in which the series is drawn into. * * @attribute graph * @type Graph */ graph: {}, /** * Reference to the `Axis` instance used for assigning * category values to the graph. * * @attribute categoryAxis * @type Axis */ categoryAxis: { value: null, validator: function(value) { return value !== this.get("categoryAxis"); } }, /** * Reference to the `Axis` instance used for assigning * series values to the graph. * * @attribute categoryAxis * @type Axis */ valueAxis: { value: null, validator: function(value) { return value !== this.get("valueAxis"); } }, /** * Indicates which array to from the hash of value arrays in * the category `Axis` instance. * * @attribute categoryKey * @type String */ categoryKey: { value: null, validator: function(value) { return value !== this.get("categoryKey"); } }, /** * Indicates which array to from the hash of value arrays in * the value `Axis` instance. * * @attribute valueKey * @type String */ valueKey: { value: null, validator: function(value) { return value !== this.get("valueKey"); } }, /** * Name used for for displaying category data * * @attribute categoryDisplayName * @type String */ categoryDisplayName: { setter: function(val) { this._categoryDisplayName = val; return val; }, getter: function() { return this._categoryDisplayName || this.get("categoryKey"); } }, /** * Name used for for displaying value data * * @attribute valueDisplayName * @type String */ valueDisplayName: { setter: function(val) { this._valueDisplayName = val; return val; }, getter: function() { return this._valueDisplayName || this.get("valueKey"); } }, /** * @attribute slices * @type Array * @private */ slices: null /** * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default * values: * <dl> * <dt>fill</dt><dd>A hash containing the following values: * <dl> * <dt>colors</dt><dd>An array of colors to be used for the marker fills. The color for each marker is * retrieved from the array below:<br/> * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]` * </dd> * <dt>alphas</dt><dd>An array of alpha references (Number from 0 to 1) indicating the opacity of each marker * fill. The default value is [1].</dd> * </dl> * </dd> * <dt>border</dt><dd>A hash containing the following values: * <dl> * <dt>color</dt><dd>An array of colors to be used for the marker borders. The color for each marker is * retrieved from the array below:<br/> * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]` * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd> * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd> * </dl> * </dd> * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default * values for each style is null. When an over style is not set, the non-over value will be used. For example, * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd> * </dl> * * @attribute styles * @type Object */ } }); }, '3.18.0', {"requires": ["series-base", "series-plot-util"]});
js-data/cdnjs
ajax/libs/yui/3.18.0/series-pie/series-pie-debug.js
JavaScript
mit
21,270
YUI.add('lazy-model-list', function (Y, NAME) { /** Provides the LazyModelList class, which is a ModelList subclass that manages plain objects instead of fully instantiated model instances. @module app @submodule lazy-model-list @since 3.6.0 **/ /** LazyModelList is a subclass of ModelList that maintains a list of plain JavaScript objects rather than a list of Model instances. This makes it well-suited for managing large amounts of data (on the order of thousands of items) that would tend to bog down a vanilla ModelList. The API presented by LazyModelList is the same as that of ModelList, except that in every case where ModelList would provide a Model instance, LazyModelList provides a plain JavaScript object. LazyModelList also provides a `revive()` method that can convert the plain object at a given index into a full Model instance. Since the items stored in a LazyModelList are plain objects and not full Model instances, there are a few caveats to be aware of: * Since items are plain objects and not Model instances, they contain properties rather than Model attributes. To retrieve a property, use `item.foo` rather than `item.get('foo')`. To set a property, use `item.foo = 'bar'` rather than `item.set('foo', 'bar')`. * Model attribute getters and setters aren't supported, since items in the LazyModelList are stored and manipulated as plain objects with simple properties rather than YUI attributes. * Changes made to the plain object version of an item will not trigger or bubble up Model `change` events. However, once an item is revived into a full Model using the `revive()` method, changes to that Model instance will trigger and bubble change events as expected. * Custom `idAttribute` fields are not supported. * `id` and `clientId` properties _are_ supported. If an item doesn't have a `clientId` property, one will be generated automatically when the item is added to a LazyModelList. LazyModelList is generally much more memory efficient than ModelList when managing large numbers of items, and adding/removing items is significantly faster. However, the tradeoff is that LazyModelList is only well-suited for storing very simple items without complex attributes, and consumers must explicitly revive items into full Model instances as needed (this is not done transparently for performance reasons). @class LazyModelList @extends ModelList @constructor @since 3.6.0 **/ var AttrProto = Y.Attribute.prototype, GlobalEnv = YUI.namespace('Env.Model'), Lang = Y.Lang, YArray = Y.Array, EVT_ADD = 'add', EVT_ERROR = 'error', EVT_RESET = 'reset'; Y.LazyModelList = Y.Base.create('lazyModelList', Y.ModelList, [], { // -- Lifecycle ------------------------------------------------------------ initializer: function () { this.after('*:change', this._afterModelChange); }, // -- Public Methods ------------------------------------------------------- /** Deletes the specified model from the model cache to release memory. The model won't be destroyed or removed from the list, just freed from the cache; it can still be instantiated again using `revive()`. If no model or model index is specified, all cached models in this list will be freed. Note: Specifying an index is faster than specifying a model instance, since the latter requires an `indexOf()` call. @method free @param {Model|Number} [model] Model or index of the model to free. If not specified, all instantiated models in this list will be freed. @chainable @see revive() **/ free: function (model) { var index; if (model) { index = Lang.isNumber(model) ? model : this.indexOf(model); if (index >= 0) { // We don't detach the model because it's not being removed from // the list, just being freed from memory. If something else // still holds a reference to it, it may still bubble events to // the list, but that's okay. // // `this._models` is a sparse array, which ensures that the // indices of models and items match even if we don't have model // instances for all items. delete this._models[index]; } } else { this._models = []; } return this; }, /** Overrides ModelList#get() to return a map of property values rather than performing attribute lookups. @method get @param {String} name Property name. @return {String[]} Array of property values. @see ModelList.get() **/ get: function (name) { if (this.attrAdded(name)) { return AttrProto.get.apply(this, arguments); } return YArray.map(this._items, function (item) { return item[name]; }); }, /** Overrides ModelList#getAsHTML() to return a map of HTML-escaped property values rather than performing attribute lookups. @method getAsHTML @param {String} name Property name. @return {String[]} Array of HTML-escaped property values. @see ModelList.getAsHTML() **/ getAsHTML: function (name) { if (this.attrAdded(name)) { return Y.Escape.html(AttrProto.get.apply(this, arguments)); } return YArray.map(this._items, function (item) { return Y.Escape.html(item[name]); }); }, /** Overrides ModelList#getAsURL() to return a map of URL-encoded property values rather than performing attribute lookups. @method getAsURL @param {String} name Property name. @return {String[]} Array of URL-encoded property values. @see ModelList.getAsURL() **/ getAsURL: function (name) { if (this.attrAdded(name)) { return encodeURIComponent(AttrProto.get.apply(this, arguments)); } return YArray.map(this._items, function (item) { return encodeURIComponent(item[name]); }); }, /** Returns the index of the given object or Model instance in this LazyModelList. @method indexOf @param {Model|Object} needle The object or Model instance to search for. @return {Number} Item index, or `-1` if not found. @see ModelList.indexOf() **/ indexOf: function (model) { return YArray.indexOf(model && model._isYUIModel ? this._models : this._items, model); }, /** Overrides ModelList#reset() to work with plain objects. @method reset @param {Object[]|Model[]|ModelList} [models] Models to add. @param {Object} [options] Options. @chainable @see ModelList.reset() **/ reset: function (items, options) { items || (items = []); options || (options = {}); var facade = Y.merge({src: 'reset'}, options); // Convert `items` into an array of plain objects, since we don't want // model instances. items = items._isYUIModelList ? items.map(this._modelToObject) : YArray.map(items, this._modelToObject); facade.models = items; if (options.silent) { this._defResetFn(facade); } else { // Sort the items before firing the reset event. if (this.comparator) { items.sort(Y.bind(this._sort, this)); } this.fire(EVT_RESET, facade); } return this; }, /** Revives an item (or all items) into a full Model instance. The _item_ argument may be the index of an object in this list, an actual object (which must exist in the list), or may be omitted to revive all items in the list. Once revived, Model instances are attached to this list and cached so that reviving them in the future doesn't require another Model instantiation. Use the `free()` method to explicitly uncache and detach a previously revived Model instance. Note: Specifying an index rather than an object will be faster, since objects require an `indexOf()` lookup in order to retrieve the index. @method revive @param {Number|Object} [item] Index of the object to revive, or the object itself. If an object, that object must exist in this list. If not specified, all items in the list will be revived and an array of models will be returned. @return {Model|Model[]|null} Revived Model instance, array of revived Model instances, or `null` if the given index or object was not found in this list. @see free() **/ revive: function (item) { var i, len, models; if (item || item === 0) { return this._revive(Lang.isNumber(item) ? item : this.indexOf(item)); } else { models = []; for (i = 0, len = this._items.length; i < len; i++) { models.push(this._revive(i)); } return models; } }, /** Overrides ModelList#toJSON() to use toArray() instead, since it's more efficient for LazyModelList. @method toJSON @return {Object[]} Array of objects. @see ModelList.toJSON() **/ toJSON: function () { return this.toArray(); }, // -- Protected Methods ---------------------------------------------------- /** Overrides ModelList#add() to work with plain objects. @method _add @param {Object|Model} item Object or model to add. @param {Object} [options] Options. @return {Object} Added item. @protected @see ModelList._add() **/ _add: function (item, options) { var facade; options || (options = {}); // If the item is a model instance, convert it to a plain object. item = this._modelToObject(item); // Ensure that the item has a clientId. if (!('clientId' in item)) { item.clientId = this._generateClientId(); } if (this._isInList(item)) { this.fire(EVT_ERROR, { error: 'Model is already in the list.', model: item, src : 'add' }); return; } facade = Y.merge(options, { index: 'index' in options ? options.index : this._findIndex(item), model: item }); options.silent ? this._defAddFn(facade) : this.fire(EVT_ADD, facade); return item; }, /** Overrides ModelList#clear() to support `this._models`. @method _clear @protected @see ModelList.clear() **/ _clear: function () { YArray.each(this._models, this._detachList, this); this._clientIdMap = {}; this._idMap = {}; this._items = []; this._models = []; }, /** Generates an ad-hoc clientId for a non-instantiated Model. @method _generateClientId @return {String} Unique clientId. @protected **/ _generateClientId: function () { GlobalEnv.lastId || (GlobalEnv.lastId = 0); return this.model.NAME + '_' + (GlobalEnv.lastId += 1); }, /** Returns `true` if the given item is in this list, `false` otherwise. @method _isInList @param {Object} item Plain object item. @return {Boolean} `true` if the item is in this list, `false` otherwise. @protected **/ _isInList: function (item) { return !!(('clientId' in item && this._clientIdMap[item.clientId]) || ('id' in item && this._idMap[item.id])); }, /** Converts a Model instance into a plain object. If _model_ is not a Model instance, it will be returned as is. This method differs from Model#toJSON() in that it doesn't delete the `clientId` property. @method _modelToObject @param {Model|Object} model Model instance to convert. @return {Object} Plain object. @protected **/ _modelToObject: function (model) { if (model._isYUIModel) { model = model.getAttrs(); delete model.destroyed; delete model.initialized; } return model; }, /** Overrides ModelList#_remove() to convert Model instances to indices before removing to ensure consistency in the `remove` event facade. @method _remove @param {Object|Model} item Object or model to remove. @param {Object} [options] Options. @return {Object} Removed object. @protected **/ _remove: function (item, options) { // If the given item is a model instance, turn it into an index before // calling the parent _remove method, since we only want to deal with // the plain object version. if (item._isYUIModel) { item = this.indexOf(item); } return Y.ModelList.prototype._remove.call(this, item, options); }, /** Revives a single model at the specified index and returns it. This is the underlying implementation for `revive()`. @method _revive @param {Number} index Index of the item to revive. @return {Model} Revived model. @protected **/ _revive: function (index) { var item, model; if (index < 0) { return null; } item = this._items[index]; if (!item) { return null; } model = this._models[index]; if (!model) { model = new this.model(item); // The clientId attribute is read-only, but revived models should // have the same clientId as the original object, so we need to set // it manually. model._set('clientId', item.clientId); this._attachList(model); this._models[index] = model; } return model; }, // -- Event Handlers ------------------------------------------------------- /** Handles `change` events on revived models and updates the original objects with the changes. @method _afterModelChange @param {EventFacade} e @protected **/ _afterModelChange: function (e) { var changed = e.changed, item = this._clientIdMap[e.target.get('clientId')], name; if (item) { for (name in changed) { if (changed.hasOwnProperty(name)) { item[name] = changed[name].newVal; } } } }, // -- Default Event Handlers ----------------------------------------------- /** Overrides ModelList#_defAddFn() to support plain objects. @method _defAddFn @param {EventFacade} e @protected **/ _defAddFn: function (e) { var item = e.model; this._clientIdMap[item.clientId] = item; if (Lang.isValue(item.id)) { this._idMap[item.id] = item; } this._items.splice(e.index, 0, item); }, /** Overrides ModelList#_defRemoveFn() to support plain objects. @method _defRemoveFn @param {EventFacade} e @protected **/ _defRemoveFn: function (e) { var index = e.index, item = e.model, model = this._models[index]; delete this._clientIdMap[item.clientId]; if ('id' in item) { delete this._idMap[item.id]; } if (model) { this._detachList(model); } this._items.splice(index, 1); this._models.splice(index, 1); } }); }, '3.18.0', {"requires": ["model-list"]});
bsquochoaidownloadfolders/cdnjs
ajax/libs/yui/3.18.0/lazy-model-list/lazy-model-list.js
JavaScript
mit
15,670
YUI.add('datatable-formatters', function (Y, NAME) { /** Adds predefined cell formatters to `Y.DataTable.BodyView`. @module datatable-formatters **/ var Lang = Y.Lang, isValue = Lang.isValue, escape = Y.Escape.html, getCName = Y.ClassNameManager.getClassName, cName = function (name) { return getCName('datatable', name); }, stringValue = function (value, def) { return (isValue(value) ? escape(value.toString()) : def || ''); }, /** Registry of function producing cell formatting functions. Allows for names to be used in the column definition `formatter` property: {key:"myColumn", formatter:"date"} These functions are not meant to be used directly. Instead, they will be automatically called when their names are used as values for the `formatter` property in a columnd definition. They will be called just once per rendering cycle and will receive the column configuration. They are expected to return a function that will then be called once per row and will do the actual formatting. They are expected to do all the preparatory once-per-render work so that the actual formatting function doesn't need to repeat it. @class DataTable.BodyView.Formatters **/ Formatters = { /** Returns a formatter that produces a BUTTON element using the value of the [buttonLabel](DataTable.Column.html#property_buttonLabel) column definition attribute as its label or the text `Click` if not found. Applies the CSS className `yui3-datatable-button` to the cell. @method button @param col {Object} The column definition. @return {Function} A formatter function that produces a `<button>` element. @static **/ button: function (col) { var className = cName('button'), html = '<button>' + (col.buttonLabel || 'Click') + '</button>'; col.allowHTML = true; return function(o) { o.className = className; return html; }; }, /** Returns a formatter function that returns the texts `"true"` or `"false"` and assigns the CSS classNames `yui3-datatable-true` or `yui3-datatable-false` based on the value of the cell. If either a [booleanLabels](DataTable.Column.html#property_booleanLabels) configuration object is defined for the column or a [booleanLabels](DataTable.html#attr_booleanLabels) configuration attribute is defined for the datatable, the formatter will use the values for the properties `true` or `false` of either of those objects as the text to show. It returns `null`s or `undefined`s unchanged so that the `emptyCellValue` configuration attribute will eventually apply. {key:"active", formatter: "boolean", booleanLabels: { "true": "yes", "false": "no" }} @method boolean @param col {Object} The column definition. @return {Function} A formatter function that formats boolean data. @static **/ 'boolean': function (col) { var labels = col.booleanLabels || this.get('booleanLabels') || {'true':'true', 'false':'false'}; return function(o) { var value = o.value; if (!value && value !== false) { return value; } value = value?'true':'false'; o.className = cName(value); return labels[value]; }; }, /** Returns a formatter function that formats values as currency using the [Number.format](Number.html#method_format) method. It looks for the format to apply in the [currencyFormat](DataTable.Column.html#property_currencyFormat) property of the column or in the [currencyFormat](DataTable.html#attr_currencyFormat) attribute of the whole table. {key: "amount", formatter: "currency", currencyFormat: { decimalPlaces:2, decimalSeparator: ",", thousandsSeparator: ".", suffix: "&euro;" }} See [Number.format](Number.html#method_format) for the available format specs. Anything that cannot be parsed as a number will be returned unchanged. Applies the CSS className `yui3-datatable-currency` to the cell. @method currency @param col {Object} The column definition. @return {Function} A formatter function that formats numerical data as currency. @static **/ currency: function (col) { var className = cName('currency'), format = col.currencyFormat || this.get('currencyFormat'), fn = Y.Number.format; return function (o) { o.className = className; var value = parseFloat(o.value); if (!value && value !== 0) { return o.value; } return fn(value, format); }; }, /** Returns a date formatting function based on the given format. @method _date @param format {String} The format spec definition. @return {Function} A formatter function that formats numerical data as currency. @private @static **/ _date: function (format) { var className = cName('date'), fn = Y.Date.format; format = {format: format}; return function (o) { o.className = className; return fn(o.value, format); }; }, /** Returns a date formatting function. It looks for the format to apply in the [dateFormat](DataTable.Column.html#property_dateFormat) property of the column or in the [dateFormat](DataTable.html#attr_dateFormat) attribute of the whole table. {key: "DOB", formatter: "date", dateFormat: "%I:%M:%S %p"} See [Date.format](Date.html#method_format) for the available format specs. Anything that is not a date is returned unchanged. Applies the CSS className `yui3-datatable-date` to the cell. @method date @param col {Object} The column definition. @return {Function} A formatter function that formats dates. @static **/ 'date' : function (col) { return Formatters._date(col.dateFormat || this.get('dateFormat')); }, /** Returns a date-only (no time part) formatting function using the current locale. {key: "DOB", formatter: "localDate"} Anything that is not a date is returned unchanged. Applies the CSS className `yui3-datatable-date` to the cell. @method localDate @return {Function} A formatter function that formats dates. @static **/ localDate : function () { return Formatters._date('%x'); }, /** Returns a time-only (no date part) formatting function using the current locale. {key: "startTime", formatter: "localTime"} Anything that is not a date is returned unchanged. Applies the CSS className `yui3-datatable-date` to the cell. @method localTime @return {Function} A formatter function that formats dates. @static **/ localTime : function () { return Formatters._date('%X'); }, /** Returns a date formatting function using the current locale. {key: "DOB", formatter: "localDateTime"} Anything that is not a date is returned unchanged. Applies the CSS className `yui3-datatable-date` to the cell. @method localDateTime @return {Function} A formatter function that formats dates. @static **/ localDateTime : function () { return Formatters._date('%c'); }, /** Returns a function that produces email links. If the column definition contains a property [linkFrom](DataTable.Column.html#property_linkFrom) it will use the value in that field for the link, otherwise, the same column value will be used for both link and text. {key: "contact", formatter: "email", linkFrom: "contactEmail"} It will use the respective [emptyCellValue](DataTable.Column.html#property_emptyCellValue) column configuration attribute for each of the value and the link if either is empty. If the link value is still empty, it will return the value with no link. Applies the CSS className `yui3-datatable-email` to the cell. @method email @param col {Object} The column definition. @return {Function} A formatter function that adds a mailto: link to the value. @static **/ email: function (col) { var className = cName('email'), linkFrom = col.linkFrom, emptyValue = col.emptyCellValue, emptyLink = (this.getColumn(linkFrom) || {}).emptyCellValue; col.allowHTML = true; return function (o) { var value = stringValue(o.value, emptyValue), link = (linkFrom ? stringValue(o.data[linkFrom], emptyLink) : value); o.className = className; if (link) { return '<a href="mailto:' + link + '">' + value + '</a>'; } return value; }; }, /** Returns a function that produces links. If the column definition contains a property [linkFrom](DataTable.Column.html#property_linkFrom) it will use the value in that field for the link, otherwise, the same column value will be used for both link and text. {key: "company", formatter: "link", linkFrom: "webSite"} It will use the respective [emptyCellValue](DataTable.Column.html#property_emptyCellValue) column configuration attribute for each of the value and the link if either is empty. If the link value is still empty, it will return the value with no link. Applies the CSS className `yui3-datatable-link` to the cell. @method link @param col {Object} The column definition. @return {Function} A formatter function that adds a link to the value. @static **/ link: function (col) { var className = cName('link'), linkFrom = col.linkFrom, emptyValue = col.emptyCellValue, emptyLink = (this.getColumn(linkFrom) || {}).emptyCellValue; col.allowHTML = true; return function (o) { var value = stringValue(o.value, emptyValue), link = (linkFrom ? stringValue(o.data[linkFrom], emptyLink) : value); o.className = className; if (link) { return '<a href="' + link + '">' + value + '</a>'; } return value; }; }, /** Returns a formatter function that formats values using the [Number.format](Number.html#method_format) method. It looks for the format to apply in the [numberFormat](DataTable.Column.html#property_numberFormat) property of the column or in the [numberFormat](DataTable.html#attr_numberFormat) attribute of the whole table. {key: "weight", formatter: "number", numberFormat: { decimalPlaces:2, decimalSeparator: ",", thousandsSeparator: ",", suffix: "kg" }} See [Number.format](Number.html#method_format) for the available format specs. Anything that cannot be parsed as a number will be returned unchanged. Applies the CSS className `yui3-datatable-number` to the cell. @method number @param col {Object} The column definition. @return {Function} A formatter function that formats numerical data as currency. @static **/ number: function (col) { var className = cName('number'), format = col.numberFormat || this.get('numberFormat'), fn = Y.Number.format; return function (o) { o.className = className; var value = parseFloat(o.value); if (!value && value !== 0) { return o.value; } return fn(value, format); }; }, /** Returns a formatter function that returns texts from a lookup table based on the stored value. It looks for the translation to apply in the [lookupTable](DataTable.Column.html#property_lookupTable) property of the column in either of these two formats: {key: "status", formatter: "lookup", lookupTable: { 0: "unknown", 1: "requested", 2: "approved", 3: "delivered" }}, {key: "otherStatus", formatter: "lookup", lookupTable: [ {value:0, text: "unknown"}, {value:1, text: "requested"}, {value:2, text: "approved"}, {value:3, text: "delivered"} ]} Applies the CSS className `yui3-datatable-lookup` to the cell. @method lookup @param col {Object} The column definition @return {Function} A formatter function that returns the `text` associated with `value`. @static */ lookup: function (col) { var className = cName('lookup'), lookup = col.lookupTable || {}, entries, i, len; if (Lang.isArray(lookup)) { entries = lookup; lookup = {}; for (i = 0, len = entries.length; i < len; ++i) { lookup[entries[i].value] = entries[i].text; } } return function (o) { o.className = className; return lookup[o.value]; }; } }; Y.mix(Y.DataTable.BodyView.Formatters, Formatters); /** Label to be shown in the face of a button produced by the [button](DataTable.BodyView.Formatters.html#method_button) formatter @property buttonLabel @type String @for DataTable.Column */ /** Determines the texts to be shown to represent Boolean values when the [boolean](DataTable.BodyView.Formatters.html#method_boolean) formatter is used. The attribute is an object with text values for properties `true` and `false`. {key:"active", formatter: "boolean", booleanLabels: { "true": "yes", "false": "no" }} @property booleanLabels @type Object @for DataTable.Column */ /** Determines the texts to be shown to represent Boolean values when the [boolean](DataTable.BodyView.Formatters.html#method_boolean) formatter is used on any column. It works like the column-specific [booleanLabels](DataTable.Column.html#property_booleanLabels) but for all columns using the [boolean](DataTable.BodyView.Formatters.html#method_boolean) formatter at once. The values are often retrieved from a resource of localized texts. @attribute booleanLabels @type Object @for DataTable */ /** Format specification for columns using the [currency](DataTable.BodyView.Formatters.html#method_currency) formatter. It contains an object as described in [Number.format](Number.html#method_format). @property currencyFormat @type Object @for DataTable.Column */ /** Format specification for columns using the [currency](DataTable.BodyView.Formatters.html#method_currency) formatter. It contains an object as described in [Number.format](Number.html#method_format). It is similar to [currencyFormat](DataTable.Column.html#property_currencyFormat) but it applies to any column using the [currency](DataTable.BodyView.Formatters.html#method_currency) formatter. The values are often retrieved from a resource of localized configuration. @attribute currencyFormat @type Object @for DataTable */ /** Format specification for columns using the [date](DataTable.BodyView.Formatters.html#method_date) formatter. It contains a string as described in [Date.format](Date.html#method_format). @property dateFormat @type String @for DataTable.Column */ /** Format specification for columns using the [date](DataTable.BodyView.Formatters.html#method_date) formatter. It contains an object as described in [Date.format](Date.html#method_format). It is similar to [dateFormat](DataTable.Column.html#property_dateFormat) but it applies to any column using the [date](DataTable.BodyView.Formatters.html#method_date) formatter. The values are often retrieved from a resource of localized configuration. @attribute dateFormat @type String @for DataTable */ /** Name of the field that is to provide the link for a column using the [email](DataTable.BodyView.Formatters.html#method_email) or [link](DataTable.BodyView.Formatters.html#method_link) formatters. @property linkFrom @type String @for DataTable.Column */ /** Format specification for columns using the [number](DataTable.BodyView.Formatters.html#method_number) formatter. It contains an object as described in [Number.format](Number.html#method_format). @property numberFormat @type Object @for DataTable.Column */ /** Format specification for columns using the [number](DataTable.BodyView.Formatters.html#method_number) formatter. It contains an object as described in [Number.format](Number.html#method_format). It is similar to [numberFormat](DataTable.Column.html#property_numberFormat) but it applies to any column using the [number](DataTable.BodyView.Formatters.html#method_number) formatter. The values are often retrieved from a resource of localized configuration. @attribute numberFormat @type Object @for DataTable */ /** Map of values to text used to translate internal values to human readable text in columns using the [lookup](DataTable.BodyView.Formatters.html#method_lookup) formatter. The map can be given in either of two formats: {key: "status", formatter: "lookup", lookupTable: { 0: "unknown", 1: "requested", 2: "approved", 3: "delivered" }}, {key: "otherStatus", formatter: "lookup", lookupTable: [ {value:0, text: "unknown"}, {value:1, text: "requested"}, {value:2, text: "approved"}, {value:3, text: "delivered"} ]} The last format is compatible with the [dropdown](DataTable.Editors.html#property_dropdown) and autocomplete-based editors, where the order of the items in the dropdown matters. @property lookupTable @type Object || Array @for DataTable.Column */ }, '3.18.0', {"requires": ["datatable-body", "datatype-number-format", "datatype-date-format", "escape"]});
perfect-pixell/cdnjs
ajax/libs/yui/3.18.0/datatable-formatters/datatable-formatters.js
JavaScript
mit
19,243
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ /** * @requires OpenLayers/BaseTypes.js * @requires OpenLayers/BaseTypes/Bounds.js * @requires OpenLayers/BaseTypes/Element.js * @requires OpenLayers/BaseTypes/LonLat.js * @requires OpenLayers/BaseTypes/Pixel.js * @requires OpenLayers/BaseTypes/Size.js * @requires OpenLayers/Lang.js */ /** * Namespace: Util */ OpenLayers.Util = OpenLayers.Util || {}; /** * Function: getElement * This is the old $() from prototype * * Parameters: * e - {String or DOMElement or Window} * * Returns: * {Array(DOMElement) or DOMElement} */ OpenLayers.Util.getElement = function() { var elements = []; for (var i=0, len=arguments.length; i<len; i++) { var element = arguments[i]; if (typeof element == 'string') { element = document.getElementById(element); } if (arguments.length == 1) { return element; } elements.push(element); } return elements; }; /** * Function: isElement * A cross-browser implementation of "e instanceof Element". * * Parameters: * o - {Object} The object to test. * * Returns: * {Boolean} */ OpenLayers.Util.isElement = function(o) { return !!(o && o.nodeType === 1); }; /** * Function: isArray * Tests that the provided object is an array. * This test handles the cross-IFRAME case not caught * by "a instanceof Array" and should be used instead. * * Parameters: * a - {Object} the object test. * * Returns: * {Boolean} true if the object is an array. */ OpenLayers.Util.isArray = function(a) { return (Object.prototype.toString.call(a) === '[object Array]'); }; /** * Function: removeItem * Remove an object from an array. Iterates through the array * to find the item, then removes it. * * Parameters: * array - {Array} * item - {Object} * * Returns: * {Array} A reference to the array */ OpenLayers.Util.removeItem = function(array, item) { for(var i = array.length - 1; i >= 0; i--) { if(array[i] == item) { array.splice(i,1); //break;more than once?? } } return array; }; /** * Function: indexOf * Seems to exist already in FF, but not in MOZ. * * Parameters: * array - {Array} * obj - {*} * * Returns: * {Integer} The index at which the first object was found in the array. * If not found, returns -1. */ OpenLayers.Util.indexOf = function(array, obj) { // use the build-in function if available. if (typeof array.indexOf == "function") { return array.indexOf(obj); } else { for (var i = 0, len = array.length; i < len; i++) { if (array[i] == obj) { return i; } } return -1; } }; /** * Property: dotless * {RegExp} * Compiled regular expression to match dots ("."). This is used for replacing * dots in identifiers. Because object identifiers are frequently used for * DOM element identifiers by the library, we avoid using dots to make for * more sensible CSS selectors. * * TODO: Use a module pattern to avoid bloating the API with stuff like this. */ OpenLayers.Util.dotless = /\./g; /** * Function: modifyDOMElement * * Modifies many properties of a DOM element all at once. Passing in * null to an individual parameter will avoid setting the attribute. * * Parameters: * element - {DOMElement} DOM element to modify. * id - {String} The element id attribute to set. Note that dots (".") will be * replaced with underscore ("_") in setting the element id. * px - {<OpenLayers.Pixel>|Object} The element left and top position, * OpenLayers.Pixel or an object with * a 'x' and 'y' properties. * sz - {<OpenLayers.Size>|Object} The element width and height, * OpenLayers.Size or an object with a * 'w' and 'h' properties. * position - {String} The position attribute. eg: absolute, * relative, etc. * border - {String} The style.border attribute. eg: * solid black 2px * overflow - {String} The style.overview attribute. * opacity - {Float} Fractional value (0.0 - 1.0) */ OpenLayers.Util.modifyDOMElement = function(element, id, px, sz, position, border, overflow, opacity) { if (id) { element.id = id.replace(OpenLayers.Util.dotless, "_"); } if (px) { element.style.left = px.x + "px"; element.style.top = px.y + "px"; } if (sz) { element.style.width = sz.w + "px"; element.style.height = sz.h + "px"; } if (position) { element.style.position = position; } if (border) { element.style.border = border; } if (overflow) { element.style.overflow = overflow; } if (parseFloat(opacity) >= 0.0 && parseFloat(opacity) < 1.0) { element.style.filter = 'alpha(opacity=' + (opacity * 100) + ')'; element.style.opacity = opacity; } else if (parseFloat(opacity) == 1.0) { element.style.filter = ''; element.style.opacity = ''; } }; /** * Function: createDiv * Creates a new div and optionally set some standard attributes. * Null may be passed to each parameter if you do not wish to * set a particular attribute. * Note - zIndex is NOT set on the resulting div. * * Parameters: * id - {String} An identifier for this element. If no id is * passed an identifier will be created * automatically. Note that dots (".") will be replaced with * underscore ("_") when generating ids. * px - {<OpenLayers.Pixel>|Object} The element left and top position, * OpenLayers.Pixel or an object with * a 'x' and 'y' properties. * sz - {<OpenLayers.Size>|Object} The element width and height, * OpenLayers.Size or an object with a * 'w' and 'h' properties. * imgURL - {String} A url pointing to an image to use as a * background image. * position - {String} The style.position value. eg: absolute, * relative etc. * border - {String} The the style.border value. * eg: 2px solid black * overflow - {String} The style.overflow value. Eg. hidden * opacity - {Float} Fractional value (0.0 - 1.0) * * Returns: * {DOMElement} A DOM Div created with the specified attributes. */ OpenLayers.Util.createDiv = function(id, px, sz, imgURL, position, border, overflow, opacity) { var dom = document.createElement('div'); if (imgURL) { dom.style.backgroundImage = 'url(' + imgURL + ')'; } //set generic properties if (!id) { id = OpenLayers.Util.createUniqueID("OpenLayersDiv"); } if (!position) { position = "absolute"; } OpenLayers.Util.modifyDOMElement(dom, id, px, sz, position, border, overflow, opacity); return dom; }; /** * Function: createImage * Creates an img element with specific attribute values. * * Parameters: * id - {String} The id field for the img. If none assigned one will be * automatically generated. * px - {<OpenLayers.Pixel>|Object} The element left and top position, * OpenLayers.Pixel or an object with * a 'x' and 'y' properties. * sz - {<OpenLayers.Size>|Object} The element width and height, * OpenLayers.Size or an object with a * 'w' and 'h' properties. * imgURL - {String} The url to use as the image source. * position - {String} The style.position value. * border - {String} The border to place around the image. * opacity - {Float} Fractional value (0.0 - 1.0) * delayDisplay - {Boolean} If true waits until the image has been * loaded. * * Returns: * {DOMElement} A DOM Image created with the specified attributes. */ OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border, opacity, delayDisplay) { var image = document.createElement("img"); //set generic properties if (!id) { id = OpenLayers.Util.createUniqueID("OpenLayersDiv"); } if (!position) { position = "relative"; } OpenLayers.Util.modifyDOMElement(image, id, px, sz, position, border, null, opacity); if (delayDisplay) { image.style.display = "none"; function display() { image.style.display = ""; OpenLayers.Event.stopObservingElement(image); } OpenLayers.Event.observe(image, "load", display); OpenLayers.Event.observe(image, "error", display); } //set special properties image.style.alt = id; image.galleryImg = "no"; if (imgURL) { image.src = imgURL; } return image; }; /** * Property: IMAGE_RELOAD_ATTEMPTS * {Integer} How many times should we try to reload an image before giving up? * Default is 0 */ OpenLayers.IMAGE_RELOAD_ATTEMPTS = 0; /** * Property: alphaHackNeeded * {Boolean} true if the png alpha hack is necessary and possible, false otherwise. */ OpenLayers.Util.alphaHackNeeded = null; /** * Function: alphaHack * Checks whether it's necessary (and possible) to use the png alpha * hack which allows alpha transparency for png images under Internet * Explorer. * * Returns: * {Boolean} true if the png alpha hack is necessary and possible, false otherwise. */ OpenLayers.Util.alphaHack = function() { if (OpenLayers.Util.alphaHackNeeded == null) { var arVersion = navigator.appVersion.split("MSIE"); var version = parseFloat(arVersion[1]); var filter = false; // IEs4Lin dies when trying to access document.body.filters, because // the property is there, but requires a DLL that can't be provided. This // means that we need to wrap this in a try/catch so that this can // continue. try { filter = !!(document.body.filters); } catch (e) {} OpenLayers.Util.alphaHackNeeded = (filter && (version >= 5.5) && (version < 7)); } return OpenLayers.Util.alphaHackNeeded; }; /** * Function: modifyAlphaImageDiv * * Parameters: * div - {DOMElement} Div containing Alpha-adjusted Image * id - {String} * px - {<OpenLayers.Pixel>|Object} OpenLayers.Pixel or an object with * a 'x' and 'y' properties. * sz - {<OpenLayers.Size>|Object} OpenLayers.Size or an object with * a 'w' and 'h' properties. * imgURL - {String} * position - {String} * border - {String} * sizing - {String} 'crop', 'scale', or 'image'. Default is "scale" * opacity - {Float} Fractional value (0.0 - 1.0) */ OpenLayers.Util.modifyAlphaImageDiv = function(div, id, px, sz, imgURL, position, border, sizing, opacity) { OpenLayers.Util.modifyDOMElement(div, id, px, sz, position, null, null, opacity); var img = div.childNodes[0]; if (imgURL) { img.src = imgURL; } OpenLayers.Util.modifyDOMElement(img, div.id + "_innerImage", null, sz, "relative", border); if (OpenLayers.Util.alphaHack()) { if(div.style.display != "none") { div.style.display = "inline-block"; } if (sizing == null) { sizing = "scale"; } div.style.filter = "progid:DXImageTransform.Microsoft" + ".AlphaImageLoader(src='" + img.src + "', " + "sizingMethod='" + sizing + "')"; if (parseFloat(div.style.opacity) >= 0.0 && parseFloat(div.style.opacity) < 1.0) { div.style.filter += " alpha(opacity=" + div.style.opacity * 100 + ")"; } img.style.filter = "alpha(opacity=0)"; } }; /** * Function: createAlphaImageDiv * * Parameters: * id - {String} * px - {<OpenLayers.Pixel>|Object} OpenLayers.Pixel or an object with * a 'x' and 'y' properties. * sz - {<OpenLayers.Size>|Object} OpenLayers.Size or an object with * a 'w' and 'h' properties. * imgURL - {String} * position - {String} * border - {String} * sizing - {String} 'crop', 'scale', or 'image'. Default is "scale" * opacity - {Float} Fractional value (0.0 - 1.0) * delayDisplay - {Boolean} If true waits until the image has been * loaded. * * Returns: * {DOMElement} A DOM Div created with a DOM Image inside it. If the hack is * needed for transparency in IE, it is added. */ OpenLayers.Util.createAlphaImageDiv = function(id, px, sz, imgURL, position, border, sizing, opacity, delayDisplay) { var div = OpenLayers.Util.createDiv(); var img = OpenLayers.Util.createImage(null, null, null, null, null, null, null, delayDisplay); img.className = "olAlphaImg"; div.appendChild(img); OpenLayers.Util.modifyAlphaImageDiv(div, id, px, sz, imgURL, position, border, sizing, opacity); return div; }; /** * Function: upperCaseObject * Creates a new hashtable and copies over all the keys from the * passed-in object, but storing them under an uppercased * version of the key at which they were stored. * * Parameters: * object - {Object} * * Returns: * {Object} A new Object with all the same keys but uppercased */ OpenLayers.Util.upperCaseObject = function (object) { var uObject = {}; for (var key in object) { uObject[key.toUpperCase()] = object[key]; } return uObject; }; /** * Function: applyDefaults * Takes an object and copies any properties that don't exist from * another properties, by analogy with OpenLayers.Util.extend() from * Prototype.js. * * Parameters: * to - {Object} The destination object. * from - {Object} The source object. Any properties of this object that * are undefined in the to object will be set on the to object. * * Returns: * {Object} A reference to the to object. Note that the to argument is modified * in place and returned by this function. */ OpenLayers.Util.applyDefaults = function (to, from) { to = to || {}; /* * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative * prototype object" when calling hawOwnProperty if the source object is an * instance of window.Event. */ var fromIsEvt = typeof window.Event == "function" && from instanceof window.Event; for (var key in from) { if (to[key] === undefined || (!fromIsEvt && from.hasOwnProperty && from.hasOwnProperty(key) && !to.hasOwnProperty(key))) { to[key] = from[key]; } } /** * IE doesn't include the toString property when iterating over an object's * properties with the for(property in object) syntax. Explicitly check if * the source has its own toString property. */ if(!fromIsEvt && from && from.hasOwnProperty && from.hasOwnProperty('toString') && !to.hasOwnProperty('toString')) { to.toString = from.toString; } return to; }; /** * Function: getParameterString * * Parameters: * params - {Object} * * Returns: * {String} A concatenation of the properties of an object in * http parameter notation. * (ex. <i>"key1=value1&key2=value2&key3=value3"</i>) * If a parameter is actually a list, that parameter will then * be set to a comma-seperated list of values (foo,bar) instead * of being URL escaped (foo%3Abar). */ OpenLayers.Util.getParameterString = function(params) { var paramsArray = []; for (var key in params) { var value = params[key]; if ((value != null) && (typeof value != 'function')) { var encodedValue; if (typeof value == 'object' && value.constructor == Array) { /* value is an array; encode items and separate with "," */ var encodedItemArray = []; var item; for (var itemIndex=0, len=value.length; itemIndex<len; itemIndex++) { item = value[itemIndex]; encodedItemArray.push(encodeURIComponent( (item === null || item === undefined) ? "" : item) ); } encodedValue = encodedItemArray.join(","); } else { /* value is a string; simply encode */ encodedValue = encodeURIComponent(value); } paramsArray.push(encodeURIComponent(key) + "=" + encodedValue); } } return paramsArray.join("&"); }; /** * Function: urlAppend * Appends a parameter string to a url. This function includes the logic for * using the appropriate character (none, & or ?) to append to the url before * appending the param string. * * Parameters: * url - {String} The url to append to * paramStr - {String} The param string to append * * Returns: * {String} The new url */ OpenLayers.Util.urlAppend = function(url, paramStr) { var newUrl = url; if(paramStr) { var parts = (url + " ").split(/[?&]/); newUrl += (parts.pop() === " " ? paramStr : parts.length ? "&" + paramStr : "?" + paramStr); } return newUrl; }; /** * Function: getImagesLocation * * Returns: * {String} The fully formatted image location string */ OpenLayers.Util.getImagesLocation = function() { return OpenLayers.ImgPath || (OpenLayers._getScriptLocation() + "img/"); }; /** * Function: getImageLocation * * Returns: * {String} The fully formatted location string for a specified image */ OpenLayers.Util.getImageLocation = function(image) { return OpenLayers.Util.getImagesLocation() + image; }; /** * Function: Try * Execute functions until one of them doesn't throw an error. * Capitalized because "try" is a reserved word in JavaScript. * Taken directly from OpenLayers.Util.Try() * * Parameters: * [*] - {Function} Any number of parameters may be passed to Try() * It will attempt to execute each of them until one of them * successfully executes. * If none executes successfully, returns null. * * Returns: * {*} The value returned by the first successfully executed function. */ OpenLayers.Util.Try = function() { var returnValue = null; for (var i=0, len=arguments.length; i<len; i++) { var lambda = arguments[i]; try { returnValue = lambda(); break; } catch (e) {} } return returnValue; }; /** * Function: getXmlNodeValue * * Parameters: * node - {XMLNode} * * Returns: * {String} The text value of the given node, without breaking in firefox or IE */ OpenLayers.Util.getXmlNodeValue = function(node) { var val = null; OpenLayers.Util.Try( function() { val = node.text; if (!val) { val = node.textContent; } if (!val) { val = node.firstChild.nodeValue; } }, function() { val = node.textContent; }); return val; }; /** * Function: mouseLeft * * Parameters: * evt - {Event} * div - {HTMLDivElement} * * Returns: * {Boolean} */ OpenLayers.Util.mouseLeft = function (evt, div) { // start with the element to which the mouse has moved var target = (evt.relatedTarget) ? evt.relatedTarget : evt.toElement; // walk up the DOM tree. while (target != div && target != null) { target = target.parentNode; } // if the target we stop at isn't the div, then we've left the div. return (target != div); }; /** * Property: precision * {Number} The number of significant digits to retain to avoid * floating point precision errors. * * We use 14 as a "safe" default because, although IEEE 754 double floats * (standard on most modern operating systems) support up to about 16 * significant digits, 14 significant digits are sufficient to represent * sub-millimeter accuracy in any coordinate system that anyone is likely to * use with OpenLayers. * * If DEFAULT_PRECISION is set to 0, the original non-truncating behavior * of OpenLayers <2.8 is preserved. Be aware that this will cause problems * with certain projections, e.g. spherical Mercator. * */ OpenLayers.Util.DEFAULT_PRECISION = 14; /** * Function: toFloat * Convenience method to cast an object to a Number, rounded to the * desired floating point precision. * * Parameters: * number - {Number} The number to cast and round. * precision - {Number} An integer suitable for use with * Number.toPrecision(). Defaults to OpenLayers.Util.DEFAULT_PRECISION. * If set to 0, no rounding is performed. * * Returns: * {Number} The cast, rounded number. */ OpenLayers.Util.toFloat = function (number, precision) { if (precision == null) { precision = OpenLayers.Util.DEFAULT_PRECISION; } if (typeof number !== "number") { number = parseFloat(number); } return precision === 0 ? number : parseFloat(number.toPrecision(precision)); }; /** * Function: rad * * Parameters: * x - {Float} * * Returns: * {Float} */ OpenLayers.Util.rad = function(x) {return x*Math.PI/180;}; /** * Function: deg * * Parameters: * x - {Float} * * Returns: * {Float} */ OpenLayers.Util.deg = function(x) {return x*180/Math.PI;}; /** * Property: VincentyConstants * {Object} Constants for Vincenty functions. */ OpenLayers.Util.VincentyConstants = { a: 6378137, b: 6356752.3142, f: 1/298.257223563 }; /** * APIFunction: distVincenty * Given two objects representing points with geographic coordinates, this * calculates the distance between those points on the surface of an * ellipsoid. * * Parameters: * p1 - {<OpenLayers.LonLat>} (or any object with both .lat, .lon properties) * p2 - {<OpenLayers.LonLat>} (or any object with both .lat, .lon properties) * * Returns: * {Float} The distance (in km) between the two input points as measured on an * ellipsoid. Note that the input point objects must be in geographic * coordinates (decimal degrees) and the return distance is in kilometers. */ OpenLayers.Util.distVincenty = function(p1, p2) { var ct = OpenLayers.Util.VincentyConstants; var a = ct.a, b = ct.b, f = ct.f; var L = OpenLayers.Util.rad(p2.lon - p1.lon); var U1 = Math.atan((1-f) * Math.tan(OpenLayers.Util.rad(p1.lat))); var U2 = Math.atan((1-f) * Math.tan(OpenLayers.Util.rad(p2.lat))); var sinU1 = Math.sin(U1), cosU1 = Math.cos(U1); var sinU2 = Math.sin(U2), cosU2 = Math.cos(U2); var lambda = L, lambdaP = 2*Math.PI; var iterLimit = 20; while (Math.abs(lambda-lambdaP) > 1e-12 && --iterLimit>0) { var sinLambda = Math.sin(lambda), cosLambda = Math.cos(lambda); var sinSigma = Math.sqrt((cosU2*sinLambda) * (cosU2*sinLambda) + (cosU1*sinU2-sinU1*cosU2*cosLambda) * (cosU1*sinU2-sinU1*cosU2*cosLambda)); if (sinSigma==0) { return 0; // co-incident points } var cosSigma = sinU1*sinU2 + cosU1*cosU2*cosLambda; var sigma = Math.atan2(sinSigma, cosSigma); var alpha = Math.asin(cosU1 * cosU2 * sinLambda / sinSigma); var cosSqAlpha = Math.cos(alpha) * Math.cos(alpha); var cos2SigmaM = cosSigma - 2*sinU1*sinU2/cosSqAlpha; var C = f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha)); lambdaP = lambda; lambda = L + (1-C) * f * Math.sin(alpha) * (sigma + C*sinSigma*(cos2SigmaM+C*cosSigma*(-1+2*cos2SigmaM*cos2SigmaM))); } if (iterLimit==0) { return NaN; // formula failed to converge } var uSq = cosSqAlpha * (a*a - b*b) / (b*b); var A = 1 + uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq))); var B = uSq/1024 * (256+uSq*(-128+uSq*(74-47*uSq))); var deltaSigma = B*sinSigma*(cos2SigmaM+B/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)- B/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM))); var s = b*A*(sigma-deltaSigma); var d = s.toFixed(3)/1000; // round to 1mm precision return d; }; /** * APIFunction: destinationVincenty * Calculate destination point given start point lat/long (numeric degrees), * bearing (numeric degrees) & distance (in m). * Adapted from Chris Veness work, see * http://www.movable-type.co.uk/scripts/latlong-vincenty-direct.html * * Parameters: * lonlat - {<OpenLayers.LonLat>} (or any object with both .lat, .lon * properties) The start point. * brng - {Float} The bearing (degrees). * dist - {Float} The ground distance (meters). * * Returns: * {<OpenLayers.LonLat>} The destination point. */ OpenLayers.Util.destinationVincenty = function(lonlat, brng, dist) { var u = OpenLayers.Util; var ct = u.VincentyConstants; var a = ct.a, b = ct.b, f = ct.f; var lon1 = lonlat.lon; var lat1 = lonlat.lat; var s = dist; var alpha1 = u.rad(brng); var sinAlpha1 = Math.sin(alpha1); var cosAlpha1 = Math.cos(alpha1); var tanU1 = (1-f) * Math.tan(u.rad(lat1)); var cosU1 = 1 / Math.sqrt((1 + tanU1*tanU1)), sinU1 = tanU1*cosU1; var sigma1 = Math.atan2(tanU1, cosAlpha1); var sinAlpha = cosU1 * sinAlpha1; var cosSqAlpha = 1 - sinAlpha*sinAlpha; var uSq = cosSqAlpha * (a*a - b*b) / (b*b); var A = 1 + uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq))); var B = uSq/1024 * (256+uSq*(-128+uSq*(74-47*uSq))); var sigma = s / (b*A), sigmaP = 2*Math.PI; while (Math.abs(sigma-sigmaP) > 1e-12) { var cos2SigmaM = Math.cos(2*sigma1 + sigma); var sinSigma = Math.sin(sigma); var cosSigma = Math.cos(sigma); var deltaSigma = B*sinSigma*(cos2SigmaM+B/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)- B/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM))); sigmaP = sigma; sigma = s / (b*A) + deltaSigma; } var tmp = sinU1*sinSigma - cosU1*cosSigma*cosAlpha1; var lat2 = Math.atan2(sinU1*cosSigma + cosU1*sinSigma*cosAlpha1, (1-f)*Math.sqrt(sinAlpha*sinAlpha + tmp*tmp)); var lambda = Math.atan2(sinSigma*sinAlpha1, cosU1*cosSigma - sinU1*sinSigma*cosAlpha1); var C = f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha)); var L = lambda - (1-C) * f * sinAlpha * (sigma + C*sinSigma*(cos2SigmaM+C*cosSigma*(-1+2*cos2SigmaM*cos2SigmaM))); var revAz = Math.atan2(sinAlpha, -tmp); // final bearing return new OpenLayers.LonLat(lon1+u.deg(L), u.deg(lat2)); }; /** * Function: getParameters * Parse the parameters from a URL or from the current page itself into a * JavaScript Object. Note that parameter values with commas are separated * out into an Array. * * Parameters: * url - {String} Optional url used to extract the query string. * If url is null or is not supplied, query string is taken * from the page location. * options - {Object} Additional options. Optional. * * Valid options: * splitArgs - {Boolean} Split comma delimited params into arrays? Default is * true. * * Returns: * {Object} An object of key/value pairs from the query string. */ OpenLayers.Util.getParameters = function(url, options) { options = options || {}; // if no url specified, take it from the location bar url = (url === null || url === undefined) ? window.location.href : url; //parse out parameters portion of url string var paramsString = ""; if (OpenLayers.String.contains(url, '?')) { var start = url.indexOf('?') + 1; var end = OpenLayers.String.contains(url, "#") ? url.indexOf('#') : url.length; paramsString = url.substring(start, end); } var parameters = {}; var pairs = paramsString.split(/[&;]/); for(var i=0, len=pairs.length; i<len; ++i) { var keyValue = pairs[i].split('='); if (keyValue[0]) { var key = keyValue[0]; try { key = decodeURIComponent(key); } catch (err) { key = unescape(key); } // being liberal by replacing "+" with " " var value = (keyValue[1] || '').replace(/\+/g, " "); try { value = decodeURIComponent(value); } catch (err) { value = unescape(value); } // follow OGC convention of comma delimited values if (options.splitArgs !== false) { value = value.split(","); } //if there's only one value, do not return as array if (value.length == 1) { value = value[0]; } parameters[key] = value; } } return parameters; }; /** * Property: lastSeqID * {Integer} The ever-incrementing count variable. * Used for generating unique ids. */ OpenLayers.Util.lastSeqID = 0; /** * Function: createUniqueID * Create a unique identifier for this session. Each time this function * is called, a counter is incremented. The return will be the optional * prefix (defaults to "id_") appended with the counter value. * * Parameters: * prefix - {String} Optional string to prefix unique id. Default is "id_". * Note that dots (".") in the prefix will be replaced with underscore ("_"). * * Returns: * {String} A unique id string, built on the passed in prefix. */ OpenLayers.Util.createUniqueID = function(prefix) { if (prefix == null) { prefix = "id_"; } else { prefix = prefix.replace(OpenLayers.Util.dotless, "_"); } OpenLayers.Util.lastSeqID += 1; return prefix + OpenLayers.Util.lastSeqID; }; /** * Constant: INCHES_PER_UNIT * {Object} Constant inches per unit -- borrowed from MapServer mapscale.c * derivation of nautical miles from http://en.wikipedia.org/wiki/Nautical_mile * Includes the full set of units supported by CS-MAP (http://trac.osgeo.org/csmap/) * and PROJ.4 (http://trac.osgeo.org/proj/) * The hardcoded table is maintain in a CS-MAP source code module named CSdataU.c * The hardcoded table of PROJ.4 units are in pj_units.c. */ OpenLayers.INCHES_PER_UNIT = { 'inches': 1.0, 'ft': 12.0, 'mi': 63360.0, 'm': 39.37, 'km': 39370, 'dd': 4374754, 'yd': 36 }; OpenLayers.INCHES_PER_UNIT["in"]= OpenLayers.INCHES_PER_UNIT.inches; OpenLayers.INCHES_PER_UNIT["degrees"] = OpenLayers.INCHES_PER_UNIT.dd; OpenLayers.INCHES_PER_UNIT["nmi"] = 1852 * OpenLayers.INCHES_PER_UNIT.m; // Units from CS-Map OpenLayers.METERS_PER_INCH = 0.02540005080010160020; OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT, { "Inch": OpenLayers.INCHES_PER_UNIT.inches, "Meter": 1.0 / OpenLayers.METERS_PER_INCH, //EPSG:9001 "Foot": 0.30480060960121920243 / OpenLayers.METERS_PER_INCH, //EPSG:9003 "IFoot": 0.30480000000000000000 / OpenLayers.METERS_PER_INCH, //EPSG:9002 "ClarkeFoot": 0.3047972651151 / OpenLayers.METERS_PER_INCH, //EPSG:9005 "SearsFoot": 0.30479947153867624624 / OpenLayers.METERS_PER_INCH, //EPSG:9041 "GoldCoastFoot": 0.30479971018150881758 / OpenLayers.METERS_PER_INCH, //EPSG:9094 "IInch": 0.02540000000000000000 / OpenLayers.METERS_PER_INCH, "MicroInch": 0.00002540000000000000 / OpenLayers.METERS_PER_INCH, "Mil": 0.00000002540000000000 / OpenLayers.METERS_PER_INCH, "Centimeter": 0.01000000000000000000 / OpenLayers.METERS_PER_INCH, "Kilometer": 1000.00000000000000000000 / OpenLayers.METERS_PER_INCH, //EPSG:9036 "Yard": 0.91440182880365760731 / OpenLayers.METERS_PER_INCH, "SearsYard": 0.914398414616029 / OpenLayers.METERS_PER_INCH, //EPSG:9040 "IndianYard": 0.91439853074444079983 / OpenLayers.METERS_PER_INCH, //EPSG:9084 "IndianYd37": 0.91439523 / OpenLayers.METERS_PER_INCH, //EPSG:9085 "IndianYd62": 0.9143988 / OpenLayers.METERS_PER_INCH, //EPSG:9086 "IndianYd75": 0.9143985 / OpenLayers.METERS_PER_INCH, //EPSG:9087 "IndianFoot": 0.30479951 / OpenLayers.METERS_PER_INCH, //EPSG:9080 "IndianFt37": 0.30479841 / OpenLayers.METERS_PER_INCH, //EPSG:9081 "IndianFt62": 0.3047996 / OpenLayers.METERS_PER_INCH, //EPSG:9082 "IndianFt75": 0.3047995 / OpenLayers.METERS_PER_INCH, //EPSG:9083 "Mile": 1609.34721869443738887477 / OpenLayers.METERS_PER_INCH, "IYard": 0.91440000000000000000 / OpenLayers.METERS_PER_INCH, //EPSG:9096 "IMile": 1609.34400000000000000000 / OpenLayers.METERS_PER_INCH, //EPSG:9093 "NautM": 1852.00000000000000000000 / OpenLayers.METERS_PER_INCH, //EPSG:9030 "Lat-66": 110943.316488932731 / OpenLayers.METERS_PER_INCH, "Lat-83": 110946.25736872234125 / OpenLayers.METERS_PER_INCH, "Decimeter": 0.10000000000000000000 / OpenLayers.METERS_PER_INCH, "Millimeter": 0.00100000000000000000 / OpenLayers.METERS_PER_INCH, "Dekameter": 10.00000000000000000000 / OpenLayers.METERS_PER_INCH, "Decameter": 10.00000000000000000000 / OpenLayers.METERS_PER_INCH, "Hectometer": 100.00000000000000000000 / OpenLayers.METERS_PER_INCH, "GermanMeter": 1.0000135965 / OpenLayers.METERS_PER_INCH, //EPSG:9031 "CaGrid": 0.999738 / OpenLayers.METERS_PER_INCH, "ClarkeChain": 20.1166194976 / OpenLayers.METERS_PER_INCH, //EPSG:9038 "GunterChain": 20.11684023368047 / OpenLayers.METERS_PER_INCH, //EPSG:9033 "BenoitChain": 20.116782494375872 / OpenLayers.METERS_PER_INCH, //EPSG:9062 "SearsChain": 20.11676512155 / OpenLayers.METERS_PER_INCH, //EPSG:9042 "ClarkeLink": 0.201166194976 / OpenLayers.METERS_PER_INCH, //EPSG:9039 "GunterLink": 0.2011684023368047 / OpenLayers.METERS_PER_INCH, //EPSG:9034 "BenoitLink": 0.20116782494375872 / OpenLayers.METERS_PER_INCH, //EPSG:9063 "SearsLink": 0.2011676512155 / OpenLayers.METERS_PER_INCH, //EPSG:9043 "Rod": 5.02921005842012 / OpenLayers.METERS_PER_INCH, "IntnlChain": 20.1168 / OpenLayers.METERS_PER_INCH, //EPSG:9097 "IntnlLink": 0.201168 / OpenLayers.METERS_PER_INCH, //EPSG:9098 "Perch": 5.02921005842012 / OpenLayers.METERS_PER_INCH, "Pole": 5.02921005842012 / OpenLayers.METERS_PER_INCH, "Furlong": 201.1684023368046 / OpenLayers.METERS_PER_INCH, "Rood": 3.778266898 / OpenLayers.METERS_PER_INCH, "CapeFoot": 0.3047972615 / OpenLayers.METERS_PER_INCH, "Brealey": 375.00000000000000000000 / OpenLayers.METERS_PER_INCH, "ModAmFt": 0.304812252984505969011938 / OpenLayers.METERS_PER_INCH, "Fathom": 1.8288 / OpenLayers.METERS_PER_INCH, "NautM-UK": 1853.184 / OpenLayers.METERS_PER_INCH, "50kilometers": 50000.0 / OpenLayers.METERS_PER_INCH, "150kilometers": 150000.0 / OpenLayers.METERS_PER_INCH }); //unit abbreviations supported by PROJ.4 OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT, { "mm": OpenLayers.INCHES_PER_UNIT["Meter"] / 1000.0, "cm": OpenLayers.INCHES_PER_UNIT["Meter"] / 100.0, "dm": OpenLayers.INCHES_PER_UNIT["Meter"] * 100.0, "km": OpenLayers.INCHES_PER_UNIT["Meter"] * 1000.0, "kmi": OpenLayers.INCHES_PER_UNIT["nmi"], //International Nautical Mile "fath": OpenLayers.INCHES_PER_UNIT["Fathom"], //International Fathom "ch": OpenLayers.INCHES_PER_UNIT["IntnlChain"], //International Chain "link": OpenLayers.INCHES_PER_UNIT["IntnlLink"], //International Link "us-in": OpenLayers.INCHES_PER_UNIT["inches"], //U.S. Surveyor's Inch "us-ft": OpenLayers.INCHES_PER_UNIT["Foot"], //U.S. Surveyor's Foot "us-yd": OpenLayers.INCHES_PER_UNIT["Yard"], //U.S. Surveyor's Yard "us-ch": OpenLayers.INCHES_PER_UNIT["GunterChain"], //U.S. Surveyor's Chain "us-mi": OpenLayers.INCHES_PER_UNIT["Mile"], //U.S. Surveyor's Statute Mile "ind-yd": OpenLayers.INCHES_PER_UNIT["IndianYd37"], //Indian Yard "ind-ft": OpenLayers.INCHES_PER_UNIT["IndianFt37"], //Indian Foot "ind-ch": 20.11669506 / OpenLayers.METERS_PER_INCH //Indian Chain }); /** * Constant: DOTS_PER_INCH * {Integer} 72 (A sensible default) */ OpenLayers.DOTS_PER_INCH = 72; /** * Function: normalizeScale * * Parameters: * scale - {float} * * Returns: * {Float} A normalized scale value, in 1 / X format. * This means that if a value less than one ( already 1/x) is passed * in, it just returns scale directly. Otherwise, it returns * 1 / scale */ OpenLayers.Util.normalizeScale = function (scale) { var normScale = (scale > 1.0) ? (1.0 / scale) : scale; return normScale; }; /** * Function: getResolutionFromScale * * Parameters: * scale - {Float} * units - {String} Index into OpenLayers.INCHES_PER_UNIT hashtable. * Default is degrees * * Returns: * {Float} The corresponding resolution given passed-in scale and unit * parameters. If the given scale is falsey, the returned resolution will * be undefined. */ OpenLayers.Util.getResolutionFromScale = function (scale, units) { var resolution; if (scale) { if (units == null) { units = "degrees"; } var normScale = OpenLayers.Util.normalizeScale(scale); resolution = 1 / (normScale * OpenLayers.INCHES_PER_UNIT[units] * OpenLayers.DOTS_PER_INCH); } return resolution; }; /** * Function: getScaleFromResolution * * Parameters: * resolution - {Float} * units - {String} Index into OpenLayers.INCHES_PER_UNIT hashtable. * Default is degrees * * Returns: * {Float} The corresponding scale given passed-in resolution and unit * parameters. */ OpenLayers.Util.getScaleFromResolution = function (resolution, units) { if (units == null) { units = "degrees"; } var scale = resolution * OpenLayers.INCHES_PER_UNIT[units] * OpenLayers.DOTS_PER_INCH; return scale; }; /** * Function: pagePosition * Calculates the position of an element on the page (see * http://code.google.com/p/doctype/wiki/ArticlePageOffset) * * OpenLayers.Util.pagePosition is based on Yahoo's getXY method, which is * Copyright (c) 2006, Yahoo! Inc. * All rights reserved. * * Redistribution and use of this software in source and binary forms, with or * without modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * Neither the name of Yahoo! Inc. nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission of Yahoo! Inc. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * Parameters: * forElement - {DOMElement} * * Returns: * {Array} two item array, Left value then Top value. */ OpenLayers.Util.pagePosition = function(forElement) { // NOTE: If element is hidden (display none or disconnected or any the // ancestors are hidden) we get (0,0) by default but we still do the // accumulation of scroll position. var pos = [0, 0]; var viewportElement = OpenLayers.Util.getViewportElement(); if (!forElement || forElement == window || forElement == viewportElement) { // viewport is always at 0,0 as that defined the coordinate system for // this function - this avoids special case checks in the code below return pos; } // Gecko browsers normally use getBoxObjectFor to calculate the position. // When invoked for an element with an implicit absolute position though it // can be off by one. Therefore the recursive implementation is used in // those (relatively rare) cases. var BUGGY_GECKO_BOX_OBJECT = OpenLayers.IS_GECKO && document.getBoxObjectFor && OpenLayers.Element.getStyle(forElement, 'position') == 'absolute' && (forElement.style.top == '' || forElement.style.left == ''); var parent = null; var box; if (forElement.getBoundingClientRect) { // IE box = forElement.getBoundingClientRect(); var scrollTop = window.pageYOffset || viewportElement.scrollTop; var scrollLeft = window.pageXOffset || viewportElement.scrollLeft; pos[0] = box.left + scrollLeft; pos[1] = box.top + scrollTop; } else if (document.getBoxObjectFor && !BUGGY_GECKO_BOX_OBJECT) { // gecko // Gecko ignores the scroll values for ancestors, up to 1.9. See: // https://bugzilla.mozilla.org/show_bug.cgi?id=328881 and // https://bugzilla.mozilla.org/show_bug.cgi?id=330619 box = document.getBoxObjectFor(forElement); var vpBox = document.getBoxObjectFor(viewportElement); pos[0] = box.screenX - vpBox.screenX; pos[1] = box.screenY - vpBox.screenY; } else { // safari/opera pos[0] = forElement.offsetLeft; pos[1] = forElement.offsetTop; parent = forElement.offsetParent; if (parent != forElement) { while (parent) { pos[0] += parent.offsetLeft; pos[1] += parent.offsetTop; parent = parent.offsetParent; } } var browser = OpenLayers.BROWSER_NAME; // opera & (safari absolute) incorrectly account for body offsetTop if (browser == "opera" || (browser == "safari" && OpenLayers.Element.getStyle(forElement, 'position') == 'absolute')) { pos[1] -= document.body.offsetTop; } // accumulate the scroll positions for everything but the body element parent = forElement.offsetParent; while (parent && parent != document.body) { pos[0] -= parent.scrollLeft; // see https://bugs.opera.com/show_bug.cgi?id=249965 if (browser != "opera" || parent.tagName != 'TR') { pos[1] -= parent.scrollTop; } parent = parent.offsetParent; } } return pos; }; /** * Function: getViewportElement * Returns die viewport element of the document. The viewport element is * usually document.documentElement, except in IE,where it is either * document.body or document.documentElement, depending on the document's * compatibility mode (see * http://code.google.com/p/doctype/wiki/ArticleClientViewportElement) * * Returns: * {DOMElement} */ OpenLayers.Util.getViewportElement = function() { var viewportElement = arguments.callee.viewportElement; if (viewportElement == undefined) { viewportElement = (OpenLayers.BROWSER_NAME == "msie" && document.compatMode != 'CSS1Compat') ? document.body : document.documentElement; arguments.callee.viewportElement = viewportElement; } return viewportElement; }; /** * Function: isEquivalentUrl * Test two URLs for equivalence. * * Setting 'ignoreCase' allows for case-independent comparison. * * Comparison is based on: * - Protocol * - Host (evaluated without the port) * - Port (set 'ignorePort80' to ignore "80" values) * - Hash ( set 'ignoreHash' to disable) * - Pathname (for relative <-> absolute comparison) * - Arguments (so they can be out of order) * * Parameters: * url1 - {String} * url2 - {String} * options - {Object} Allows for customization of comparison: * 'ignoreCase' - Default is True * 'ignorePort80' - Default is True * 'ignoreHash' - Default is True * * Returns: * {Boolean} Whether or not the two URLs are equivalent */ OpenLayers.Util.isEquivalentUrl = function(url1, url2, options) { options = options || {}; OpenLayers.Util.applyDefaults(options, { ignoreCase: true, ignorePort80: true, ignoreHash: true, splitArgs: false }); var urlObj1 = OpenLayers.Util.createUrlObject(url1, options); var urlObj2 = OpenLayers.Util.createUrlObject(url2, options); //compare all keys except for "args" (treated below) for(var key in urlObj1) { if(key !== "args") { if(urlObj1[key] != urlObj2[key]) { return false; } } } // compare search args - irrespective of order for(var key in urlObj1.args) { if(urlObj1.args[key] != urlObj2.args[key]) { return false; } delete urlObj2.args[key]; } // urlObj2 shouldn't have any args left for(var key in urlObj2.args) { return false; } return true; }; /** * Function: createUrlObject * * Parameters: * url - {String} * options - {Object} A hash of options. * * Valid options: * ignoreCase - {Boolean} lowercase url, * ignorePort80 - {Boolean} don't include explicit port if port is 80, * ignoreHash - {Boolean} Don't include part of url after the hash (#). * splitArgs - {Boolean} Split comma delimited params into arrays? Default is * true. * * Returns: * {Object} An object with separate url, a, port, host, and args parsed out * and ready for comparison */ OpenLayers.Util.createUrlObject = function(url, options) { options = options || {}; // deal with relative urls first if(!(/^\w+:\/\//).test(url)) { var loc = window.location; var port = loc.port ? ":" + loc.port : ""; var fullUrl = loc.protocol + "//" + loc.host.split(":").shift() + port; if(url.indexOf("/") === 0) { // full pathname url = fullUrl + url; } else { // relative to current path var parts = loc.pathname.split("/"); parts.pop(); url = fullUrl + parts.join("/") + "/" + url; } } if (options.ignoreCase) { url = url.toLowerCase(); } var a = document.createElement('a'); a.href = url; var urlObject = {}; //host (without port) urlObject.host = a.host.split(":").shift(); //protocol urlObject.protocol = a.protocol; //port (get uniform browser behavior with port 80 here) if(options.ignorePort80) { urlObject.port = (a.port == "80" || a.port == "0") ? "" : a.port; } else { urlObject.port = (a.port == "" || a.port == "0") ? "80" : a.port; } //hash urlObject.hash = (options.ignoreHash || a.hash === "#") ? "" : a.hash; //args var queryString = a.search; if (!queryString) { var qMark = url.indexOf("?"); queryString = (qMark != -1) ? url.substr(qMark) : ""; } urlObject.args = OpenLayers.Util.getParameters(queryString, {splitArgs: options.splitArgs}); // pathname // // This is a workaround for Internet Explorer where // window.location.pathname has a leading "/", but // a.pathname has no leading "/". urlObject.pathname = (a.pathname.charAt(0) == "/") ? a.pathname : "/" + a.pathname; return urlObject; }; /** * Function: removeTail * Takes a url and removes everything after the ? and # * * Parameters: * url - {String} The url to process * * Returns: * {String} The string with all queryString and Hash removed */ OpenLayers.Util.removeTail = function(url) { var head = null; var qMark = url.indexOf("?"); var hashMark = url.indexOf("#"); if (qMark == -1) { head = (hashMark != -1) ? url.substr(0,hashMark) : url; } else { head = (hashMark != -1) ? url.substr(0,Math.min(qMark, hashMark)) : url.substr(0, qMark); } return head; }; /** * Constant: IS_GECKO * {Boolean} True if the userAgent reports the browser to use the Gecko engine */ OpenLayers.IS_GECKO = (function() { var ua = navigator.userAgent.toLowerCase(); return ua.indexOf("webkit") == -1 && ua.indexOf("gecko") != -1; })(); /** * Constant: CANVAS_SUPPORTED * {Boolean} True if canvas 2d is supported. */ OpenLayers.CANVAS_SUPPORTED = (function() { var elem = document.createElement('canvas'); return !!(elem.getContext && elem.getContext('2d')); })(); /** * Constant: BROWSER_NAME * {String} * A substring of the navigator.userAgent property. Depending on the userAgent * property, this will be the empty string or one of the following: * * "opera" -- Opera * * "msie" -- Internet Explorer * * "safari" -- Safari * * "firefox" -- Firefox * * "mozilla" -- Mozilla */ OpenLayers.BROWSER_NAME = (function() { var name = ""; var ua = navigator.userAgent.toLowerCase(); if (ua.indexOf("opera") != -1) { name = "opera"; } else if (ua.indexOf("msie") != -1) { name = "msie"; } else if (ua.indexOf("safari") != -1) { name = "safari"; } else if (ua.indexOf("mozilla") != -1) { if (ua.indexOf("firefox") != -1) { name = "firefox"; } else { name = "mozilla"; } } return name; })(); /** * Function: getBrowserName * * Returns: * {String} A string which specifies which is the current * browser in which we are running. * * Currently-supported browser detection and codes: * * 'opera' -- Opera * * 'msie' -- Internet Explorer * * 'safari' -- Safari * * 'firefox' -- Firefox * * 'mozilla' -- Mozilla * * If we are unable to property identify the browser, we * return an empty string. */ OpenLayers.Util.getBrowserName = function() { return OpenLayers.BROWSER_NAME; }; /** * Method: getRenderedDimensions * Renders the contentHTML offscreen to determine actual dimensions for * popup sizing. As we need layout to determine dimensions the content * is rendered -9999px to the left and absolute to ensure the * scrollbars do not flicker * * Parameters: * contentHTML * size - {<OpenLayers.Size>} If either the 'w' or 'h' properties is * specified, we fix that dimension of the div to be measured. This is * useful in the case where we have a limit in one dimension and must * therefore meaure the flow in the other dimension. * options - {Object} * * Allowed Options: * displayClass - {String} Optional parameter. A CSS class name(s) string * to provide the CSS context of the rendered content. * containerElement - {DOMElement} Optional parameter. Insert the HTML to * this node instead of the body root when calculating dimensions. * * Returns: * {<OpenLayers.Size>} */ OpenLayers.Util.getRenderedDimensions = function(contentHTML, size, options) { var w, h; // create temp container div with restricted size var container = document.createElement("div"); container.style.visibility = "hidden"; var containerElement = (options && options.containerElement) ? options.containerElement : document.body; // Opera and IE7 can't handle a node with position:aboslute if it inherits // position:absolute from a parent. var parentHasPositionAbsolute = false; var superContainer = null; var parent = containerElement; while (parent && parent.tagName.toLowerCase()!="body") { var parentPosition = OpenLayers.Element.getStyle(parent, "position"); if(parentPosition == "absolute") { parentHasPositionAbsolute = true; break; } else if (parentPosition && parentPosition != "static") { break; } parent = parent.parentNode; } if(parentHasPositionAbsolute && (containerElement.clientHeight === 0 || containerElement.clientWidth === 0) ){ superContainer = document.createElement("div"); superContainer.style.visibility = "hidden"; superContainer.style.position = "absolute"; superContainer.style.overflow = "visible"; superContainer.style.width = document.body.clientWidth + "px"; superContainer.style.height = document.body.clientHeight + "px"; superContainer.appendChild(container); } container.style.position = "absolute"; //fix a dimension, if specified. if (size) { if (size.w) { w = size.w; container.style.width = w + "px"; } else if (size.h) { h = size.h; container.style.height = h + "px"; } } //add css classes, if specified if (options && options.displayClass) { container.className = options.displayClass; } // create temp content div and assign content var content = document.createElement("div"); content.innerHTML = contentHTML; // we need overflow visible when calculating the size content.style.overflow = "visible"; if (content.childNodes) { for (var i=0, l=content.childNodes.length; i<l; i++) { if (!content.childNodes[i].style) continue; content.childNodes[i].style.overflow = "visible"; } } // add content to restricted container container.appendChild(content); // append container to body for rendering if (superContainer) { containerElement.appendChild(superContainer); } else { containerElement.appendChild(container); } // calculate scroll width of content and add corners and shadow width if (!w) { w = parseInt(content.scrollWidth); // update container width to allow height to adjust container.style.width = w + "px"; } // capture height and add shadow and corner image widths if (!h) { h = parseInt(content.scrollHeight); } // remove elements container.removeChild(content); if (superContainer) { superContainer.removeChild(container); containerElement.removeChild(superContainer); } else { containerElement.removeChild(container); } return new OpenLayers.Size(w, h); }; /** * APIFunction: getScrollbarWidth * This function has been modified by the OpenLayers from the original version, * written by Matthew Eernisse and released under the Apache 2 * license here: * * http://www.fleegix.org/articles/2006/05/30/getting-the-scrollbar-width-in-pixels * * It has been modified simply to cache its value, since it is physically * impossible that this code could ever run in more than one browser at * once. * * Returns: * {Integer} */ OpenLayers.Util.getScrollbarWidth = function() { var scrollbarWidth = OpenLayers.Util._scrollbarWidth; if (scrollbarWidth == null) { var scr = null; var inn = null; var wNoScroll = 0; var wScroll = 0; // Outer scrolling div scr = document.createElement('div'); scr.style.position = 'absolute'; scr.style.top = '-1000px'; scr.style.left = '-1000px'; scr.style.width = '100px'; scr.style.height = '50px'; // Start with no scrollbar scr.style.overflow = 'hidden'; // Inner content div inn = document.createElement('div'); inn.style.width = '100%'; inn.style.height = '200px'; // Put the inner div in the scrolling div scr.appendChild(inn); // Append the scrolling div to the doc document.body.appendChild(scr); // Width of the inner div sans scrollbar wNoScroll = inn.offsetWidth; // Add the scrollbar scr.style.overflow = 'scroll'; // Width of the inner div width scrollbar wScroll = inn.offsetWidth; // Remove the scrolling div from the doc document.body.removeChild(document.body.lastChild); // Pixel width of the scroller OpenLayers.Util._scrollbarWidth = (wNoScroll - wScroll); scrollbarWidth = OpenLayers.Util._scrollbarWidth; } return scrollbarWidth; }; /** * APIFunction: getFormattedLonLat * This function will return latitude or longitude value formatted as * * Parameters: * coordinate - {Float} the coordinate value to be formatted * axis - {String} value of either 'lat' or 'lon' to indicate which axis is to * to be formatted (default = lat) * dmsOption - {String} specify the precision of the output can be one of: * 'dms' show degrees minutes and seconds * 'dm' show only degrees and minutes * 'd' show only degrees * * Returns: * {String} the coordinate value formatted as a string */ OpenLayers.Util.getFormattedLonLat = function(coordinate, axis, dmsOption) { if (!dmsOption) { dmsOption = 'dms'; //default to show degree, minutes, seconds } coordinate = (coordinate+540)%360 - 180; // normalize for sphere being round var abscoordinate = Math.abs(coordinate); var coordinatedegrees = Math.floor(abscoordinate); var coordinateminutes = (abscoordinate - coordinatedegrees)/(1/60); var tempcoordinateminutes = coordinateminutes; coordinateminutes = Math.floor(coordinateminutes); var coordinateseconds = (tempcoordinateminutes - coordinateminutes)/(1/60); coordinateseconds = Math.round(coordinateseconds*10); coordinateseconds /= 10; if( coordinateseconds >= 60) { coordinateseconds -= 60; coordinateminutes += 1; if( coordinateminutes >= 60) { coordinateminutes -= 60; coordinatedegrees += 1; } } if( coordinatedegrees < 10 ) { coordinatedegrees = "0" + coordinatedegrees; } var str = coordinatedegrees + "\u00B0"; if (dmsOption.indexOf('dm') >= 0) { if( coordinateminutes < 10 ) { coordinateminutes = "0" + coordinateminutes; } str += coordinateminutes + "'"; if (dmsOption.indexOf('dms') >= 0) { if( coordinateseconds < 10 ) { coordinateseconds = "0" + coordinateseconds; } str += coordinateseconds + '"'; } } if (axis == "lon") { str += coordinate < 0 ? OpenLayers.i18n("W") : OpenLayers.i18n("E"); } else { str += coordinate < 0 ? OpenLayers.i18n("S") : OpenLayers.i18n("N"); } return str; };
jamesarosen/cdnjs
ajax/libs/openlayers/2.13.1/lib/OpenLayers/Util.js
JavaScript
mit
60,429
YUI.add('datasource-textschema', function (Y, NAME) { /** * Extends DataSource with schema-parsing on text data. * * @module datasource * @submodule datasource-textschema */ /** * Adds schema-parsing to the DataSource Utility. * @class DataSourceTextSchema * @extends Plugin.Base */ var DataSourceTextSchema = function() { DataSourceTextSchema.superclass.constructor.apply(this, arguments); }; Y.mix(DataSourceTextSchema, { /** * The namespace for the plugin. This will be the property on the host which * references the plugin instance. * * @property NS * @type String * @static * @final * @value "schema" */ NS: "schema", /** * Class name. * * @property NAME * @type String * @static * @final * @value "dataSourceTextSchema" */ NAME: "dataSourceTextSchema", ///////////////////////////////////////////////////////////////////////////// // // DataSourceTextSchema Attributes // ///////////////////////////////////////////////////////////////////////////// ATTRS: { schema: { //value: {} } } }); Y.extend(DataSourceTextSchema, Y.Plugin.Base, { /** * Internal init() handler. * * @method initializer * @param config {Object} Config object. * @private */ initializer: function(config) { this.doBefore("_defDataFn", this._beforeDefDataFn); }, /** * Parses raw data into a normalized response. * * @method _beforeDefDataFn * @param tId {Number} Unique transaction ID. * @param request {Object} The request. * @param callback {Object} The callback object with the following properties: * <dl> * <dt>success (Function)</dt> <dd>Success handler.</dd> * <dt>failure (Function)</dt> <dd>Failure handler.</dd> * </dl> * @param data {Object} Raw data. * @protected */ _beforeDefDataFn: function(e) { var schema = this.get('schema'), payload = e.details[0], // TODO: Do I need to sniff for DS.IO + isString(responseText)? data = e.data.responseText || e.data; payload.response = Y.DataSchema.Text.apply.call(this, schema, data) || { meta: {}, results: data }; this.get("host").fire("response", payload); return new Y.Do.Halt("DataSourceTextSchema plugin halted _defDataFn"); } }); Y.namespace('Plugin').DataSourceTextSchema = DataSourceTextSchema; }, '3.18.0', {"requires": ["datasource-local", "plugin", "dataschema-text"]});
ankitjamuar/cdnjs
ajax/libs/yui/3.18.0/datasource-textschema/datasource-textschema.js
JavaScript
mit
2,644
YUI.add('test-console', function (Y, NAME) { /** Provides a specialized log console widget that's pre-configured to display YUI Test output with no extra configuration. @example <div id="log" class="yui3-skin-sam"></div> <script> YUI().use('test-console', function (Y) { // ... set up your test cases here ... // Render the console inside the #log div, then run the tests. new Y.Test.Console().render('#log'); Y.Test.Runner.run(); }); </script> @module test-console @namespace Test @class Console @extends Console @constructor @param {Object} [config] Config attributes. @param {Object} [config.filters] Category filter configuration. @since 3.5.0 **/ function TestConsole() { TestConsole.superclass.constructor.apply(this, arguments); } Y.namespace('Test').Console = Y.extend(TestConsole, Y.Console, { initializer: function (config) { this.on('entry', this._onEntry); this.plug(Y.Plugin.ConsoleFilters, { category: Y.merge({ info : true, pass : false, fail : true, status: false }, (config && config.filters) || {}), defaultVisibility: false, source: { TestRunner: true } }); Y.Test.Runner.on('complete', Y.bind(this._parseCoverage, this)); }, // -- Protected Coverage Parser --------------------------------------------- /** * Scans the coverage data to determine if it's an Istanbul coverage object. * @method _isIstanbul * @param {Object} json The coverage data to scan * @return {Boolean} True if this is Istanbul Coverage */ _isIstanbul: function(json) { var first = Object.keys(json)[0], ret = false; if (json[first].s !== undefined && json[first].fnMap !== undefined) { ret = true; } if (json.s !== undefined && json.fnMap !== undefined) { ret = true; } return ret; }, /** * Parses and logs a summary of YUITest coverage data. * @method parseYUITest * @param {Object} coverage The YUITest Coverage JSON data */ parseYUITestCoverage: function (coverage) { var cov = { lines: { hit: 0, miss: 0, total: 0, percent: 0 }, functions: { hit: 0, miss: 0, total: 0, percent: 0 } }, coverageLog; Y.Object.each(coverage, function(info) { cov.lines.total += info.coveredLines; cov.lines.hit += info.calledLines; cov.lines.miss += (info.coveredLines - info.calledLines); cov.lines.percent = Math.floor((cov.lines.hit / cov.lines.total) * 100); cov.functions.total += info.coveredFunctions; cov.functions.hit += info.calledFunctions; cov.functions.miss += (info.coveredFunctions - info.calledFunctions); cov.functions.percent = Math.floor((cov.functions.hit / cov.functions.total) * 100); }); coverageLog = 'Lines: Hit:' + cov.lines.hit + ' Missed:' + cov.lines.miss + ' Total:' + cov.lines.total + ' Percent:' + cov.lines.percent + '%\n'; coverageLog += 'Functions: Hit:' + cov.functions.hit + ' Missed:' + cov.functions.miss + ' Total:' + cov.functions.total + ' Percent:' + cov.functions.percent + '%'; this.log('Coverage: ' + coverageLog, 'info', 'TestRunner'); }, /** * Generates a generic summary object used for Istanbul conversions. * @method _blankSummary * @return {Object} Generic summary object */ _blankSummary: function () { return { lines: { total: 0, covered: 0, pct: 'Unknown' }, statements: { total: 0, covered: 0, pct: 'Unknown' }, functions: { total: 0, covered: 0, pct: 'Unknown' }, branches: { total: 0, covered: 0, pct: 'Unknown' } }; }, /** * Calculates line numbers from statement coverage * @method _addDerivedInfoForFile * @private * @param {Object} fileCoverage JSON coverage data */ _addDerivedInfoForFile: function (fileCoverage) { var statementMap = fileCoverage.statementMap, statements = fileCoverage.s, lineMap; if (!fileCoverage.l) { fileCoverage.l = lineMap = {}; Y.Object.each(statements, function (value, st) { var line = statementMap[st].start.line, count = statements[st], prevVal = lineMap[line]; if (typeof prevVal === 'undefined' || prevVal < count) { lineMap[line] = count; } }); } }, /** * Generic percent calculator * @method _percent * @param {Number} covered The covered amount * @param {Number} total The total * @private */ _percent: function (covered, total) { var tmp, pct = 100.00; if (total > 0) { tmp = 1000 * 100 * covered / total + 5; pct = Math.floor(tmp / 10) / 100; } return pct; }, /** * Summarize simple properties in the coverage data * @method _computSimpleTotals * @private * @param {Object} fileCoverage JSON coverage data * @param {String} property The property to summarize */ _computeSimpleTotals: function (fileCoverage, property) { var stats = fileCoverage[property], ret = { total: 0, covered: 0 }; Y.Object.each(stats, function(val) { ret.total += 1; if (val) { ret.covered += 1; } }); ret.pct = this._percent(ret.covered, ret.total); return ret; }, /** * Noramlizes branch data from Istanbul * @method _computeBranchTotals * @private * @param {Object} fileCoverage JSON coverage data */ _computeBranchTotals: function (fileCoverage) { var stats = fileCoverage.b, ret = { total: 0, covered: 0 }; Y.Object.each(stats, function (branches) { var covered = Y.Array.filter(branches, function (num) { return num > 0; }); ret.total += branches.length; ret.covered += covered.length; }); ret.pct = this._percent(ret.covered, ret.total); return ret; }, /** * Takes an Istanbul coverage object, normalizes it and prints a log with a summary * @method parseInstanbul * @param {Object} coverage The coverage object to normalize and log */ parseIstanbul: function (coverage) { var self = this, str = 'Coverage Report:\n'; Y.Object.each(coverage, function(fileCoverage, file) { var ret = self._blankSummary(); self._addDerivedInfoForFile(fileCoverage); ret.lines = self._computeSimpleTotals(fileCoverage, 'l'); ret.functions = self._computeSimpleTotals(fileCoverage, 'f'); ret.statements = self._computeSimpleTotals(fileCoverage, 's'); ret.branches = self._computeBranchTotals(fileCoverage); str += file + ':\n'; Y.Array.each(['lines','functions','statements','branches'], function(key) { str += ' ' + key +': ' + ret[key].covered + '/' + ret[key].total + ' : ' + ret[key].pct + '%\n'; }); }); this.log(str, 'info', 'TestRunner'); }, /** * Parses YUITest or Istanbul coverage results if they are available and logs them. * @method _parseCoverage * @private */ _parseCoverage: function() { var coverage = Y.Test.Runner.getCoverage(); if (!coverage) { return; } if (this._isIstanbul(coverage)) { this.parseIstanbul(coverage); } else { this.parseYUITestCoverage(coverage); } }, // -- Protected Event Handlers --------------------------------------------- _onEntry: function (e) { var msg = e.message; if (msg.category === 'info' && /\s(?:case|suite)\s|yuitests\d+|began/.test(msg.message)) { msg.category = 'status'; } else if (msg.category === 'fail') { this.printBuffer(); } } }, { NAME: 'testConsole', ATTRS: { entryTemplate: { value: '<div class="{entry_class} {cat_class} {src_class}">' + '<div class="{entry_content_class}">{message}</div>' + '</div>' }, height: { value: '350px' }, newestOnTop: { value: false }, style: { value: 'block' }, width: { value: Y.UA.ie && Y.UA.ie < 9 ? '100%' : 'inherit' } } }); }, '@VERSION@', {"requires": ["console-filters", "test", "array-extras"], "skinnable": true});
bspaulding/cdnjs
ajax/libs/yui/3.8.0pr2/test-console/test-console-debug.js
JavaScript
mit
9,356
YUI.add('test-console', function (Y, NAME) { /** Provides a specialized log console widget that's pre-configured to display YUI Test output with no extra configuration. @example <div id="log" class="yui3-skin-sam"></div> <script> YUI().use('test-console', function (Y) { // ... set up your test cases here ... // Render the console inside the #log div, then run the tests. new Y.Test.Console().render('#log'); Y.Test.Runner.run(); }); </script> @module test-console @namespace Test @class Console @extends Console @constructor @param {Object} [config] Config attributes. @param {Object} [config.filters] Category filter configuration. @since 3.5.0 **/ function TestConsole() { TestConsole.superclass.constructor.apply(this, arguments); } Y.namespace('Test').Console = Y.extend(TestConsole, Y.Console, { initializer: function (config) { this.on('entry', this._onEntry); this.plug(Y.Plugin.ConsoleFilters, { category: Y.merge({ info : true, pass : false, fail : true, status: false }, (config && config.filters) || {}), defaultVisibility: false, source: { TestRunner: true } }); Y.Test.Runner.on('complete', Y.bind(this._parseCoverage, this)); }, // -- Protected Coverage Parser --------------------------------------------- /** * Scans the coverage data to determine if it's an Istanbul coverage object. * @method _isIstanbul * @param {Object} json The coverage data to scan * @return {Boolean} True if this is Istanbul Coverage */ _isIstanbul: function(json) { var first = Object.keys(json)[0], ret = false; if (json[first].s !== undefined && json[first].fnMap !== undefined) { ret = true; } if (json.s !== undefined && json.fnMap !== undefined) { ret = true; } return ret; }, /** * Parses and logs a summary of YUITest coverage data. * @method parseYUITest * @param {Object} coverage The YUITest Coverage JSON data */ parseYUITestCoverage: function (coverage) { var cov = { lines: { hit: 0, miss: 0, total: 0, percent: 0 }, functions: { hit: 0, miss: 0, total: 0, percent: 0 } }, coverageLog; Y.Object.each(coverage, function(info) { cov.lines.total += info.coveredLines; cov.lines.hit += info.calledLines; cov.lines.miss += (info.coveredLines - info.calledLines); cov.lines.percent = Math.floor((cov.lines.hit / cov.lines.total) * 100); cov.functions.total += info.coveredFunctions; cov.functions.hit += info.calledFunctions; cov.functions.miss += (info.coveredFunctions - info.calledFunctions); cov.functions.percent = Math.floor((cov.functions.hit / cov.functions.total) * 100); }); coverageLog = 'Lines: Hit:' + cov.lines.hit + ' Missed:' + cov.lines.miss + ' Total:' + cov.lines.total + ' Percent:' + cov.lines.percent + '%\n'; coverageLog += 'Functions: Hit:' + cov.functions.hit + ' Missed:' + cov.functions.miss + ' Total:' + cov.functions.total + ' Percent:' + cov.functions.percent + '%'; this.log('Coverage: ' + coverageLog, 'info', 'TestRunner'); }, /** * Generates a generic summary object used for Istanbul conversions. * @method _blankSummary * @return {Object} Generic summary object */ _blankSummary: function () { return { lines: { total: 0, covered: 0, pct: 'Unknown' }, statements: { total: 0, covered: 0, pct: 'Unknown' }, functions: { total: 0, covered: 0, pct: 'Unknown' }, branches: { total: 0, covered: 0, pct: 'Unknown' } }; }, /** * Calculates line numbers from statement coverage * @method _addDerivedInfoForFile * @private * @param {Object} fileCoverage JSON coverage data */ _addDerivedInfoForFile: function (fileCoverage) { var statementMap = fileCoverage.statementMap, statements = fileCoverage.s, lineMap; if (!fileCoverage.l) { fileCoverage.l = lineMap = {}; Y.Object.each(statements, function (value, st) { var line = statementMap[st].start.line, count = statements[st], prevVal = lineMap[line]; if (typeof prevVal === 'undefined' || prevVal < count) { lineMap[line] = count; } }); } }, /** * Generic percent calculator * @method _percent * @param {Number} covered The covered amount * @param {Number} total The total * @private */ _percent: function (covered, total) { var tmp, pct = 100.00; if (total > 0) { tmp = 1000 * 100 * covered / total + 5; pct = Math.floor(tmp / 10) / 100; } return pct; }, /** * Summarize simple properties in the coverage data * @method _computSimpleTotals * @private * @param {Object} fileCoverage JSON coverage data * @param {String} property The property to summarize */ _computeSimpleTotals: function (fileCoverage, property) { var stats = fileCoverage[property], ret = { total: 0, covered: 0 }; Y.Object.each(stats, function(val) { ret.total += 1; if (val) { ret.covered += 1; } }); ret.pct = this._percent(ret.covered, ret.total); return ret; }, /** * Noramlizes branch data from Istanbul * @method _computeBranchTotals * @private * @param {Object} fileCoverage JSON coverage data */ _computeBranchTotals: function (fileCoverage) { var stats = fileCoverage.b, ret = { total: 0, covered: 0 }; Y.Object.each(stats, function (branches) { var covered = Y.Array.filter(branches, function (num) { return num > 0; }); ret.total += branches.length; ret.covered += covered.length; }); ret.pct = this._percent(ret.covered, ret.total); return ret; }, /** * Takes an Istanbul coverage object, normalizes it and prints a log with a summary * @method parseInstanbul * @param {Object} coverage The coverage object to normalize and log */ parseIstanbul: function (coverage) { var self = this, str = 'Coverage Report:\n'; Y.Object.each(coverage, function(fileCoverage, file) { var ret = self._blankSummary(); self._addDerivedInfoForFile(fileCoverage); ret.lines = self._computeSimpleTotals(fileCoverage, 'l'); ret.functions = self._computeSimpleTotals(fileCoverage, 'f'); ret.statements = self._computeSimpleTotals(fileCoverage, 's'); ret.branches = self._computeBranchTotals(fileCoverage); str += file + ':\n'; Y.Array.each(['lines','functions','statements','branches'], function(key) { str += ' ' + key +': ' + ret[key].covered + '/' + ret[key].total + ' : ' + ret[key].pct + '%\n'; }); }); this.log(str, 'info', 'TestRunner'); }, /** * Parses YUITest or Istanbul coverage results if they are available and logs them. * @method _parseCoverage * @private */ _parseCoverage: function() { var coverage = Y.Test.Runner.getCoverage(); if (!coverage) { return; } if (this._isIstanbul(coverage)) { this.parseIstanbul(coverage); } else { this.parseYUITestCoverage(coverage); } }, // -- Protected Event Handlers --------------------------------------------- _onEntry: function (e) { var msg = e.message; if (msg.category === 'info' && /\s(?:case|suite)\s|yuitests\d+|began/.test(msg.message)) { msg.category = 'status'; } else if (msg.category === 'fail') { this.printBuffer(); } } }, { NAME: 'testConsole', ATTRS: { entryTemplate: { value: '<div class="{entry_class} {cat_class} {src_class}">' + '<div class="{entry_content_class}">{message}</div>' + '</div>' }, height: { value: '350px' }, newestOnTop: { value: false }, style: { value: 'block' }, width: { value: Y.UA.ie && Y.UA.ie < 9 ? '100%' : 'inherit' } } }); }, '@VERSION@', {"requires": ["console-filters", "test", "array-extras"], "skinnable": true});
vetruvet/cdnjs
ajax/libs/yui/3.8.1/test-console/test-console.js
JavaScript
mit
9,356
var baseDifference = require('./_baseDifference'), baseFlatten = require('./_baseFlatten'), baseUniq = require('./_baseUniq'); /** * The base implementation of methods like `_.xor`, without support for * iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of values. */ function baseXor(arrays, iteratee, comparator) { var length = arrays.length; if (length < 2) { return length ? baseUniq(arrays[0]) : []; } var index = -1, result = Array(length); while (++index < length) { var array = arrays[index], othIndex = -1; while (++othIndex < length) { if (othIndex != index) { result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); } } } return baseUniq(baseFlatten(result, 1), iteratee, comparator); } module.exports = baseXor;
ArgonTrainDiagram/TrainProject
node_modules/inquirer/node_modules/lodash/_baseXor.js
JavaScript
mit
1,099
<?php namespace Illuminate\Cache; use Exception; use Illuminate\Contracts\Cache\Store; use Illuminate\Filesystem\Filesystem; use Illuminate\Support\InteractsWithTime; class FileStore implements Store { use InteractsWithTime, RetrievesMultipleKeys; /** * The Illuminate Filesystem instance. * * @var \Illuminate\Filesystem\Filesystem */ protected $files; /** * The file cache directory. * * @var string */ protected $directory; /** * Create a new file cache store instance. * * @param \Illuminate\Filesystem\Filesystem $files * @param string $directory * @return void */ public function __construct(Filesystem $files, $directory) { $this->files = $files; $this->directory = $directory; } /** * Retrieve an item from the cache by key. * * @param string|array $key * @return mixed */ public function get($key) { return $this->getPayload($key)['data'] ?? null; } /** * Store an item in the cache for a given number of minutes. * * @param string $key * @param mixed $value * @param float|int $minutes * @return void */ public function put($key, $value, $minutes) { $this->ensureCacheDirectoryExists($path = $this->path($key)); $this->files->put( $path, $this->expiration($minutes).serialize($value), true ); } /** * Create the file cache directory if necessary. * * @param string $path * @return void */ protected function ensureCacheDirectoryExists($path) { if (! $this->files->exists(dirname($path))) { $this->files->makeDirectory(dirname($path), 0777, true, true); } } /** * Increment the value of an item in the cache. * * @param string $key * @param mixed $value * @return int */ public function increment($key, $value = 1) { $raw = $this->getPayload($key); return tap(((int) $raw['data']) + $value, function ($newValue) use ($key, $raw) { $this->put($key, $newValue, $raw['time']); }); } /** * Decrement the value of an item in the cache. * * @param string $key * @param mixed $value * @return int */ public function decrement($key, $value = 1) { return $this->increment($key, $value * -1); } /** * Store an item in the cache indefinitely. * * @param string $key * @param mixed $value * @return void */ public function forever($key, $value) { $this->put($key, $value, 0); } /** * Remove an item from the cache. * * @param string $key * @return bool */ public function forget($key) { if ($this->files->exists($file = $this->path($key))) { return $this->files->delete($file); } return false; } /** * Remove all items from the cache. * * @return bool */ public function flush() { if (! $this->files->isDirectory($this->directory)) { return false; } foreach ($this->files->directories($this->directory) as $directory) { if (! $this->files->deleteDirectory($directory)) { return false; } } return true; } /** * Retrieve an item and expiry time from the cache by key. * * @param string $key * @return array */ protected function getPayload($key) { $path = $this->path($key); // If the file doesn't exists, we obviously can't return the cache so we will // just return null. Otherwise, we'll get the contents of the file and get // the expiration UNIX timestamps from the start of the file's contents. try { $expire = substr( $contents = $this->files->get($path, true), 0, 10 ); } catch (Exception $e) { return $this->emptyPayload(); } // If the current time is greater than expiration timestamps we will delete // the file and return null. This helps clean up the old files and keeps // this directory much cleaner for us as old files aren't hanging out. if ($this->currentTime() >= $expire) { $this->forget($key); return $this->emptyPayload(); } $data = unserialize(substr($contents, 10)); // Next, we'll extract the number of minutes that are remaining for a cache // so that we can properly retain the time for things like the increment // operation that may be performed on this cache on a later operation. $time = ($expire - $this->currentTime()) / 60; return compact('data', 'time'); } /** * Get a default empty payload for the cache. * * @return array */ protected function emptyPayload() { return ['data' => null, 'time' => null]; } /** * Get the full path for the given cache key. * * @param string $key * @return string */ protected function path($key) { $parts = array_slice(str_split($hash = sha1($key), 2), 0, 2); return $this->directory.'/'.implode('/', $parts).'/'.$hash; } /** * Get the expiration time based on the given minutes. * * @param float|int $minutes * @return int */ protected function expiration($minutes) { $time = $this->availableAt((int) ($minutes * 60)); return $minutes === 0 || $time > 9999999999 ? 9999999999 : (int) $time; } /** * Get the Filesystem instance. * * @return \Illuminate\Filesystem\Filesystem */ public function getFilesystem() { return $this->files; } /** * Get the working directory of the cache. * * @return string */ public function getDirectory() { return $this->directory; } /** * Get the cache key prefix. * * @return string */ public function getPrefix() { return ''; } }
Fenzland/laravel
src/Illuminate/Cache/FileStore.php
PHP
mit
6,269
namespace StudentSystem.Data.Migrations { using StudentSystem.Models; using System; using System.Data.Entity.Migrations; using System.Linq; public sealed class Configuration : DbMigrationsConfiguration<StudentSystemDbContext> { public Configuration() { AutomaticMigrationsEnabled = true; AutomaticMigrationDataLossAllowed = true; ContextKey = "StudentSystem.Data.StudentSystemDbContext"; } protected override void Seed(StudentSystemDbContext context) { this.SeedCourses(context); this.SeedStudents(context); } private void SeedStudents(StudentSystemDbContext context) { if (context.Students.Any()) { return; } context.Students.Add(new Student { FirstName = "Evlogi", LastName = "Hristov", Level = 1 }); context.Students.Add(new Student { FirstName = "Ivaylo", LastName = "Kenov", Level = 2, }); context.Students.Add(new Student { FirstName = "Doncho", LastName = "Minkov", Level = 3 }); context.Students.Add(new Student { FirstName = "Nikolay", LastName = "Kostov", Level = 9999 }); } private void SeedCourses(StudentSystemDbContext context) { if (context.Courses.Any()) { return; } context.Courses.Add(new Course { Name = "Seeded course", Description = "Initial course for testing" }); } } }
StefanSinapov/TelerikAcademy
11. Databases and SQL/09. Code First in Entity Framework/0. Demos/StudentsSystem/StudentSystem.Data/Migrations/Configuration.cs
C#
mit
1,894
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // // file: method.cpp // // #include "ilasmpch.h" #include "assembler.h" Method::Method(Assembler *pAssembler, Class *pClass, __in __nullterminated char *pszName, BinStr* pbsSig, DWORD Attr) { // default values m_pClass = pClass; m_MaxStack = 8; m_Flags = 0; m_LocalsSig = 0; m_dwNumExceptions = 0; m_dwNumEndfilters = 0; m_firstArgName = NULL; m_firstVarName = NULL; m_pMethodSig = NULL; m_wImplAttr = miIL; //default, if native or optil are not specified m_wVTEntry = 0; m_wVTSlot = 0; m_pAssembler = pAssembler; m_pCurrScope = &m_MainScope; m_pRetMarshal = NULL; m_pRetValue = NULL; m_szExportAlias = NULL; m_dwExportOrdinal = 0xFFFFFFFF; m_ulLines[0]=m_ulLines[1]=0; m_ulColumns[0]=m_ulColumns[1]=0; m_pbsBody = NULL; m_fNewBody = TRUE; m_fNew = TRUE; // move the PInvoke descriptor (if any) from Assembler // (Assembler gets the descriptor BEFORE it calls new Method) m_pPInvoke = pAssembler->m_pPInvoke; pAssembler->m_pPInvoke = NULL; _ASSERTE(pszName); if (!pszName) return; m_szName = pszName; m_dwName = (DWORD)strlen(pszName); m_ExceptionList = new COR_ILMETHOD_SECT_EH_CLAUSE_FAT[MAX_EXCEPTIONS]; m_EndfilterOffsetList = new DWORD[MAX_EXCEPTIONS]; if((m_ExceptionList==NULL)||(m_EndfilterOffsetList==NULL)) { fprintf(stderr,"\nOutOfMemory!\n"); return; } m_dwMaxNumExceptions = MAX_EXCEPTIONS; m_dwMaxNumEndfilters = MAX_EXCEPTIONS; m_Attr = Attr; if((!strcmp(pszName,COR_CCTOR_METHOD_NAME))||(!strcmp(pszName,COR_CTOR_METHOD_NAME))) m_Attr |= mdSpecialName; m_fEntryPoint = FALSE; m_fGlobalMethod = FALSE; if(pbsSig) { m_dwMethodCSig = pbsSig->length(); m_pMethodSig = (COR_SIGNATURE*)(pbsSig->ptr()); m_pbsMethodSig = pbsSig; } m_firstArgName = pAssembler->getArgNameList(); if(pClass == NULL) pClass = pAssembler->m_pModuleClass; // fake "class" <Module> pClass->m_MethodList.PUSH(this); pClass->m_fNewMembers = TRUE; m_pPermissions = NULL; m_pPermissionSets = NULL; m_TyPars = NULL; m_NumTyPars = 0; } // lexical scope handling void Method::OpenScope() { Scope* psc = new Scope; if(psc) { psc->dwStart = m_pAssembler->m_CurPC; psc->pSuperScope = m_pCurrScope; m_pCurrScope->SubScope.PUSH(psc); m_pCurrScope = psc; } } void Method::CloseScope() { VarDescr* pVD; ARG_NAME_LIST* pAN; for(pAN=m_pCurrScope->pLocals; pAN; pAN = pAN->pNext) { if((pVD = m_Locals.PEEK(pAN->dwAttr))) pVD->bInScope = FALSE; } m_pCurrScope->dwEnd = m_pAssembler->m_CurPC; m_pCurrScope = m_pCurrScope->pSuperScope; } Label *Method::FindLabel(LPCUTF8 pszName) { Label lSearch(pszName,0), *pL; lSearch.m_szName = pszName; //pL = m_lstLabel.FIND(&lSearch); pL = m_pAssembler->m_lstLabel.FIND(&lSearch); lSearch.m_szName = NULL; return pL; //return m_lstLabel.FIND(pszName); } Label *Method::FindLabel(DWORD PC) { Label *pSearch; //for (int i = 0; (pSearch = m_lstLabel.PEEK(i)); i++) for (int i = 0; (pSearch = m_pAssembler->m_lstLabel.PEEK(i)); i++) { if (pSearch->m_PC == PC) return pSearch; } return NULL; } void Method::AddGenericParamConstraint(int index, char * pStrGenericParam, mdToken tkTypeConstraint) { if (index > 0) { if (pStrGenericParam != 0) { m_pAssembler->report->error("LOGIC ERROR - we have both an index and a pStrGenericParam"); return; } if (index > (int)m_NumTyPars) { m_pAssembler->report->error("Type parameter index out of range: 1.. %d\n", m_NumTyPars); return; } index = index - 1; } else // index was 0, so a name must be supplied by pStrGenericParam { if (pStrGenericParam == 0) { m_pAssembler->report->error("LOGIC ERROR - we have neither an index or a pStrGenericParam"); return; } index = FindTyPar(pStrGenericParam); if (index == -1) { m_pAssembler->report->error("Type parameter '%s' undefined\n", pStrGenericParam); return; } } m_pAssembler->CheckAddGenericParamConstraint(&m_GPCList, index, tkTypeConstraint); }
poizan42/coreclr
src/ilasm/method.cpp
C++
mit
4,666
import { isString, Json } from '../src/facade/lang'; import { BaseException } from '../src/facade/exceptions'; import { isJsObject } from './http_utils'; /** * Creates `Response` instances from provided values. * * Though this object isn't * usually instantiated by end-users, it is the primary object interacted with when it comes time to * add data to a view. * * ### Example * * ``` * http.request('my-friends.txt').subscribe(response => this.friends = response.text()); * ``` * * The Response's interface is inspired by the Response constructor defined in the [Fetch * Spec](https://fetch.spec.whatwg.org/#response-class), but is considered a static value whose body * can be accessed many times. There are other differences in the implementation, but this is the * most significant. */ export class Response { constructor(responseOptions) { this._body = responseOptions.body; this.status = responseOptions.status; this.ok = (this.status >= 200 && this.status <= 299); this.statusText = responseOptions.statusText; this.headers = responseOptions.headers; this.type = responseOptions.type; this.url = responseOptions.url; } /** * Not yet implemented */ // TODO: Blob return type blob() { throw new BaseException('"blob()" method not implemented on Response superclass'); } /** * Attempts to return body as parsed `JSON` object, or raises an exception. */ json() { var jsonResponse; if (isJsObject(this._body)) { jsonResponse = this._body; } else if (isString(this._body)) { jsonResponse = Json.parse(this._body); } return jsonResponse; } /** * Returns the body as a string, presuming `toString()` can be called on the response body. */ text() { return this._body.toString(); } /** * Not yet implemented */ // TODO: ArrayBuffer return type arrayBuffer() { throw new BaseException('"arrayBuffer()" method not implemented on Response superclass'); } } //# sourceMappingURL=static_response.js.map
cyberpuffin/remanddel
node_modules/@angular/http/esm/src/static_response.js
JavaScript
mit
2,144
require 'rack/utils' require 'forwardable' module Rack # Rack::Lint validates your application and the requests and # responses according to the Rack spec. class Lint def initialize(app) @app = app @content_length = nil end # :stopdoc: class LintError < RuntimeError; end module Assertion def assert(message, &block) unless block.call raise LintError, message end end end include Assertion ## This specification aims to formalize the Rack protocol. You ## can (and should) use Rack::Lint to enforce it. ## ## When you develop middleware, be sure to add a Lint before and ## after to catch all mistakes. ## = Rack applications ## A Rack application is a Ruby object (not a class) that ## responds to +call+. def call(env=nil) dup._call(env) end def _call(env) ## It takes exactly one argument, the *environment* assert("No env given") { env } check_env env env['rack.input'] = InputWrapper.new(env['rack.input']) env['rack.errors'] = ErrorWrapper.new(env['rack.errors']) ## and returns an Array of exactly three values: status, headers, @body = @app.call(env) ## The *status*, check_status status ## the *headers*, check_headers headers check_hijack_response headers, env ## and the *body*. check_content_type status, headers check_content_length status, headers @head_request = env[REQUEST_METHOD] == "HEAD" [status, headers, self] end ## == The Environment def check_env(env) ## The environment must be an instance of Hash that includes ## CGI-like headers. The application is free to modify the ## environment. assert("env #{env.inspect} is not a Hash, but #{env.class}") { env.kind_of? Hash } ## ## The environment is required to include these variables ## (adopted from PEP333), except when they'd be empty, but see ## below. ## <tt>REQUEST_METHOD</tt>:: The HTTP request method, such as ## "GET" or "POST". This cannot ever ## be an empty string, and so is ## always required. ## <tt>SCRIPT_NAME</tt>:: The initial portion of the request ## URL's "path" that corresponds to the ## application object, so that the ## application knows its virtual ## "location". This may be an empty ## string, if the application corresponds ## to the "root" of the server. ## <tt>PATH_INFO</tt>:: The remainder of the request URL's ## "path", designating the virtual ## "location" of the request's target ## within the application. This may be an ## empty string, if the request URL targets ## the application root and does not have a ## trailing slash. This value may be ## percent-encoded when I originating from ## a URL. ## <tt>QUERY_STRING</tt>:: The portion of the request URL that ## follows the <tt>?</tt>, if any. May be ## empty, but is always required! ## <tt>SERVER_NAME</tt>, <tt>SERVER_PORT</tt>:: ## When combined with <tt>SCRIPT_NAME</tt> and ## <tt>PATH_INFO</tt>, these variables can be ## used to complete the URL. Note, however, ## that <tt>HTTP_HOST</tt>, if present, ## should be used in preference to ## <tt>SERVER_NAME</tt> for reconstructing ## the request URL. ## <tt>SERVER_NAME</tt> and <tt>SERVER_PORT</tt> ## can never be empty strings, and so ## are always required. ## <tt>HTTP_</tt> Variables:: Variables corresponding to the ## client-supplied HTTP request ## headers (i.e., variables whose ## names begin with <tt>HTTP_</tt>). The ## presence or absence of these ## variables should correspond with ## the presence or absence of the ## appropriate HTTP header in the ## request. See ## <a href="https://tools.ietf.org/html/rfc3875#section-4.1.18"> ## RFC3875 section 4.1.18</a> for ## specific behavior. ## In addition to this, the Rack environment must include these ## Rack-specific variables: ## <tt>rack.version</tt>:: The Array representing this version of Rack ## See Rack::VERSION, that corresponds to ## the version of this SPEC. ## <tt>rack.url_scheme</tt>:: +http+ or +https+, depending on the ## request URL. ## <tt>rack.input</tt>:: See below, the input stream. ## <tt>rack.errors</tt>:: See below, the error stream. ## <tt>rack.multithread</tt>:: true if the application object may be ## simultaneously invoked by another thread ## in the same process, false otherwise. ## <tt>rack.multiprocess</tt>:: true if an equivalent application object ## may be simultaneously invoked by another ## process, false otherwise. ## <tt>rack.run_once</tt>:: true if the server expects ## (but does not guarantee!) that the ## application will only be invoked this one ## time during the life of its containing ## process. Normally, this will only be true ## for a server based on CGI ## (or something similar). ## <tt>rack.hijack?</tt>:: present and true if the server supports ## connection hijacking. See below, hijacking. ## <tt>rack.hijack</tt>:: an object responding to #call that must be ## called at least once before using ## rack.hijack_io. ## It is recommended #call return rack.hijack_io ## as well as setting it in env if necessary. ## <tt>rack.hijack_io</tt>:: if rack.hijack? is true, and rack.hijack ## has received #call, this will contain ## an object resembling an IO. See hijacking. ## Additional environment specifications have approved to ## standardized middleware APIs. None of these are required to ## be implemented by the server. ## <tt>rack.session</tt>:: A hash like interface for storing ## request session data. ## The store must implement: if session = env['rack.session'] ## store(key, value) (aliased as []=); assert("session #{session.inspect} must respond to store and []=") { session.respond_to?(:store) && session.respond_to?(:[]=) } ## fetch(key, default = nil) (aliased as []); assert("session #{session.inspect} must respond to fetch and []") { session.respond_to?(:fetch) && session.respond_to?(:[]) } ## delete(key); assert("session #{session.inspect} must respond to delete") { session.respond_to?(:delete) } ## clear; assert("session #{session.inspect} must respond to clear") { session.respond_to?(:clear) } end ## <tt>rack.logger</tt>:: A common object interface for logging messages. ## The object must implement: if logger = env['rack.logger'] ## info(message, &block) assert("logger #{logger.inspect} must respond to info") { logger.respond_to?(:info) } ## debug(message, &block) assert("logger #{logger.inspect} must respond to debug") { logger.respond_to?(:debug) } ## warn(message, &block) assert("logger #{logger.inspect} must respond to warn") { logger.respond_to?(:warn) } ## error(message, &block) assert("logger #{logger.inspect} must respond to error") { logger.respond_to?(:error) } ## fatal(message, &block) assert("logger #{logger.inspect} must respond to fatal") { logger.respond_to?(:fatal) } end ## <tt>rack.multipart.buffer_size</tt>:: An Integer hint to the multipart parser as to what chunk size to use for reads and writes. if bufsize = env['rack.multipart.buffer_size'] assert("rack.multipart.buffer_size must be an Integer > 0 if specified") { bufsize.is_a?(Integer) && bufsize > 0 } end ## <tt>rack.multipart.tempfile_factory</tt>:: An object responding to #call with two arguments, the filename and content_type given for the multipart form field, and returning an IO-like object that responds to #<< and optionally #rewind. This factory will be used to instantiate the tempfile for each multipart form file upload field, rather than the default class of Tempfile. if tempfile_factory = env['rack.multipart.tempfile_factory'] assert("rack.multipart.tempfile_factory must respond to #call") { tempfile_factory.respond_to?(:call) } env['rack.multipart.tempfile_factory'] = lambda do |filename, content_type| io = tempfile_factory.call(filename, content_type) assert("rack.multipart.tempfile_factory return value must respond to #<<") { io.respond_to?(:<<) } io end end ## The server or the application can store their own data in the ## environment, too. The keys must contain at least one dot, ## and should be prefixed uniquely. The prefix <tt>rack.</tt> ## is reserved for use with the Rack core distribution and other ## accepted specifications and must not be used otherwise. ## %w[REQUEST_METHOD SERVER_NAME SERVER_PORT QUERY_STRING rack.version rack.input rack.errors rack.multithread rack.multiprocess rack.run_once].each { |header| assert("env missing required key #{header}") { env.include? header } } ## The environment must not contain the keys ## <tt>HTTP_CONTENT_TYPE</tt> or <tt>HTTP_CONTENT_LENGTH</tt> ## (use the versions without <tt>HTTP_</tt>). %w[HTTP_CONTENT_TYPE HTTP_CONTENT_LENGTH].each { |header| assert("env contains #{header}, must use #{header[5,-1]}") { not env.include? header } } ## The CGI keys (named without a period) must have String values. env.each { |key, value| next if key.include? "." # Skip extensions assert("env variable #{key} has non-string value #{value.inspect}") { value.kind_of? String } } ## There are the following restrictions: ## * <tt>rack.version</tt> must be an array of Integers. assert("rack.version must be an Array, was #{env["rack.version"].class}") { env["rack.version"].kind_of? Array } ## * <tt>rack.url_scheme</tt> must either be +http+ or +https+. assert("rack.url_scheme unknown: #{env["rack.url_scheme"].inspect}") { %w[http https].include? env["rack.url_scheme"] } ## * There must be a valid input stream in <tt>rack.input</tt>. check_input env["rack.input"] ## * There must be a valid error stream in <tt>rack.errors</tt>. check_error env["rack.errors"] ## * There may be a valid hijack stream in <tt>rack.hijack_io</tt> check_hijack env ## * The <tt>REQUEST_METHOD</tt> must be a valid token. assert("REQUEST_METHOD unknown: #{env[REQUEST_METHOD]}") { env["REQUEST_METHOD"] =~ /\A[0-9A-Za-z!\#$%&'*+.^_`|~-]+\z/ } ## * The <tt>SCRIPT_NAME</tt>, if non-empty, must start with <tt>/</tt> assert("SCRIPT_NAME must start with /") { !env.include?("SCRIPT_NAME") || env["SCRIPT_NAME"] == "" || env["SCRIPT_NAME"] =~ /\A\// } ## * The <tt>PATH_INFO</tt>, if non-empty, must start with <tt>/</tt> assert("PATH_INFO must start with /") { !env.include?("PATH_INFO") || env["PATH_INFO"] == "" || env["PATH_INFO"] =~ /\A\// } ## * The <tt>CONTENT_LENGTH</tt>, if given, must consist of digits only. assert("Invalid CONTENT_LENGTH: #{env["CONTENT_LENGTH"]}") { !env.include?("CONTENT_LENGTH") || env["CONTENT_LENGTH"] =~ /\A\d+\z/ } ## * One of <tt>SCRIPT_NAME</tt> or <tt>PATH_INFO</tt> must be ## set. <tt>PATH_INFO</tt> should be <tt>/</tt> if ## <tt>SCRIPT_NAME</tt> is empty. assert("One of SCRIPT_NAME or PATH_INFO must be set (make PATH_INFO '/' if SCRIPT_NAME is empty)") { env["SCRIPT_NAME"] || env["PATH_INFO"] } ## <tt>SCRIPT_NAME</tt> never should be <tt>/</tt>, but instead be empty. assert("SCRIPT_NAME cannot be '/', make it '' and PATH_INFO '/'") { env["SCRIPT_NAME"] != "/" } end ## === The Input Stream ## ## The input stream is an IO-like object which contains the raw HTTP ## POST data. def check_input(input) ## When applicable, its external encoding must be "ASCII-8BIT" and it ## must be opened in binary mode, for Ruby 1.9 compatibility. assert("rack.input #{input} does not have ASCII-8BIT as its external encoding") { input.external_encoding.name == "ASCII-8BIT" } if input.respond_to?(:external_encoding) assert("rack.input #{input} is not opened in binary mode") { input.binmode? } if input.respond_to?(:binmode?) ## The input stream must respond to +gets+, +each+, +read+ and +rewind+. [:gets, :each, :read, :rewind].each { |method| assert("rack.input #{input} does not respond to ##{method}") { input.respond_to? method } } end class InputWrapper include Assertion def initialize(input) @input = input end ## * +gets+ must be called without arguments and return a string, ## or +nil+ on EOF. def gets(*args) assert("rack.input#gets called with arguments") { args.size == 0 } v = @input.gets assert("rack.input#gets didn't return a String") { v.nil? or v.kind_of? String } v end ## * +read+ behaves like IO#read. ## Its signature is <tt>read([length, [buffer]])</tt>. ## ## If given, +length+ must be a non-negative Integer (>= 0) or +nil+, ## and +buffer+ must be a String and may not be nil. ## ## If +length+ is given and not nil, then this method reads at most ## +length+ bytes from the input stream. ## ## If +length+ is not given or nil, then this method reads ## all data until EOF. ## ## When EOF is reached, this method returns nil if +length+ is given ## and not nil, or "" if +length+ is not given or is nil. ## ## If +buffer+ is given, then the read data will be placed ## into +buffer+ instead of a newly created String object. def read(*args) assert("rack.input#read called with too many arguments") { args.size <= 2 } if args.size >= 1 assert("rack.input#read called with non-integer and non-nil length") { args.first.kind_of?(Integer) || args.first.nil? } assert("rack.input#read called with a negative length") { args.first.nil? || args.first >= 0 } end if args.size >= 2 assert("rack.input#read called with non-String buffer") { args[1].kind_of?(String) } end v = @input.read(*args) assert("rack.input#read didn't return nil or a String") { v.nil? or v.kind_of? String } if args[0].nil? assert("rack.input#read(nil) returned nil on EOF") { !v.nil? } end v end ## * +each+ must be called without arguments and only yield Strings. def each(*args) assert("rack.input#each called with arguments") { args.size == 0 } @input.each { |line| assert("rack.input#each didn't yield a String") { line.kind_of? String } yield line } end ## * +rewind+ must be called without arguments. It rewinds the input ## stream back to the beginning. It must not raise Errno::ESPIPE: ## that is, it may not be a pipe or a socket. Therefore, handler ## developers must buffer the input data into some rewindable object ## if the underlying input stream is not rewindable. def rewind(*args) assert("rack.input#rewind called with arguments") { args.size == 0 } assert("rack.input#rewind raised Errno::ESPIPE") { begin @input.rewind true rescue Errno::ESPIPE false end } end ## * +close+ must never be called on the input stream. def close(*args) assert("rack.input#close must not be called") { false } end end ## === The Error Stream def check_error(error) ## The error stream must respond to +puts+, +write+ and +flush+. [:puts, :write, :flush].each { |method| assert("rack.error #{error} does not respond to ##{method}") { error.respond_to? method } } end class ErrorWrapper include Assertion def initialize(error) @error = error end ## * +puts+ must be called with a single argument that responds to +to_s+. def puts(str) @error.puts str end ## * +write+ must be called with a single argument that is a String. def write(str) assert("rack.errors#write not called with a String") { str.kind_of? String } @error.write str end ## * +flush+ must be called without arguments and must be called ## in order to make the error appear for sure. def flush @error.flush end ## * +close+ must never be called on the error stream. def close(*args) assert("rack.errors#close must not be called") { false } end end class HijackWrapper include Assertion extend Forwardable REQUIRED_METHODS = [ :read, :write, :read_nonblock, :write_nonblock, :flush, :close, :close_read, :close_write, :closed? ] def_delegators :@io, *REQUIRED_METHODS def initialize(io) @io = io REQUIRED_METHODS.each do |meth| assert("rack.hijack_io must respond to #{meth}") { io.respond_to? meth } end end end ## === Hijacking # # AUTHORS: n.b. The trailing whitespace between paragraphs is important and # should not be removed. The whitespace creates paragraphs in the RDoc # output. # ## ==== Request (before status) def check_hijack(env) if env['rack.hijack?'] ## If rack.hijack? is true then rack.hijack must respond to #call. original_hijack = env['rack.hijack'] assert("rack.hijack must respond to call") { original_hijack.respond_to?(:call) } env['rack.hijack'] = proc do ## rack.hijack must return the io that will also be assigned (or is ## already present, in rack.hijack_io. io = original_hijack.call HijackWrapper.new(io) ## ## rack.hijack_io must respond to: ## <tt>read, write, read_nonblock, write_nonblock, flush, close, ## close_read, close_write, closed?</tt> ## ## The semantics of these IO methods must be a best effort match to ## those of a normal ruby IO or Socket object, using standard ## arguments and raising standard exceptions. Servers are encouraged ## to simply pass on real IO objects, although it is recognized that ## this approach is not directly compatible with SPDY and HTTP 2.0. ## ## IO provided in rack.hijack_io should preference the ## IO::WaitReadable and IO::WaitWritable APIs wherever supported. ## ## There is a deliberate lack of full specification around ## rack.hijack_io, as semantics will change from server to server. ## Users are encouraged to utilize this API with a knowledge of their ## server choice, and servers may extend the functionality of ## hijack_io to provide additional features to users. The purpose of ## rack.hijack is for Rack to "get out of the way", as such, Rack only ## provides the minimum of specification and support. env['rack.hijack_io'] = HijackWrapper.new(env['rack.hijack_io']) io end else ## ## If rack.hijack? is false, then rack.hijack should not be set. assert("rack.hijack? is false, but rack.hijack is present") { env['rack.hijack'].nil? } ## ## If rack.hijack? is false, then rack.hijack_io should not be set. assert("rack.hijack? is false, but rack.hijack_io is present") { env['rack.hijack_io'].nil? } end end ## ==== Response (after headers) ## It is also possible to hijack a response after the status and headers ## have been sent. def check_hijack_response(headers, env) # this check uses headers like a hash, but the spec only requires # headers respond to #each headers = Rack::Utils::HeaderHash.new(headers) ## In order to do this, an application may set the special header ## <tt>rack.hijack</tt> to an object that responds to <tt>call</tt> ## accepting an argument that conforms to the <tt>rack.hijack_io</tt> ## protocol. ## ## After the headers have been sent, and this hijack callback has been ## called, the application is now responsible for the remaining lifecycle ## of the IO. The application is also responsible for maintaining HTTP ## semantics. Of specific note, in almost all cases in the current SPEC, ## applications will have wanted to specify the header Connection:close in ## HTTP/1.1, and not Connection:keep-alive, as there is no protocol for ## returning hijacked sockets to the web server. For that purpose, use the ## body streaming API instead (progressively yielding strings via each). ## ## Servers must ignore the <tt>body</tt> part of the response tuple when ## the <tt>rack.hijack</tt> response API is in use. if env['rack.hijack?'] && headers['rack.hijack'] assert('rack.hijack header must respond to #call') { headers['rack.hijack'].respond_to? :call } original_hijack = headers['rack.hijack'] headers['rack.hijack'] = proc do |io| original_hijack.call HijackWrapper.new(io) end else ## ## The special response header <tt>rack.hijack</tt> must only be set ## if the request env has <tt>rack.hijack?</tt> <tt>true</tt>. assert('rack.hijack header must not be present if server does not support hijacking') { headers['rack.hijack'].nil? } end end ## ==== Conventions ## * Middleware should not use hijack unless it is handling the whole ## response. ## * Middleware may wrap the IO object for the response pattern. ## * Middleware should not wrap the IO object for the request pattern. The ## request pattern is intended to provide the hijacker with "raw tcp". ## == The Response ## === The Status def check_status(status) ## This is an HTTP status. When parsed as integer (+to_i+), it must be ## greater than or equal to 100. assert("Status must be >=100 seen as integer") { status.to_i >= 100 } end ## === The Headers def check_headers(header) ## The header must respond to +each+, and yield values of key and value. assert("headers object should respond to #each, but doesn't (got #{header.class} as headers)") { header.respond_to? :each } header.each { |key, value| ## Special headers starting "rack." are for communicating with the ## server, and must not be sent back to the client. next if key =~ /^rack\..+$/ ## The header keys must be Strings. assert("header key must be a string, was #{key.class}") { key.kind_of? String } ## The header must not contain a +Status+ key. assert("header must not contain Status") { key.downcase != "status" } ## The header must conform to RFC7230 token specification, i.e. cannot ## contain non-printable ASCII, DQUOTE or "(),/:;<=>?@[\]{}". assert("invalid header name: #{key}") { key !~ /[\(\),\/:;<=>\?@\[\\\]{}[[:cntrl:]]]/ } ## The values of the header must be Strings, assert("a header value must be a String, but the value of " + "'#{key}' is a #{value.class}") { value.kind_of? String } ## consisting of lines (for multiple header values, e.g. multiple ## <tt>Set-Cookie</tt> values) separated by "\\n". value.split("\n").each { |item| ## The lines must not contain characters below 037. assert("invalid header value #{key}: #{item.inspect}") { item !~ /[\000-\037]/ } } } end ## === The Content-Type def check_content_type(status, headers) headers.each { |key, value| ## There must not be a <tt>Content-Type</tt>, when the +Status+ is 1xx, ## 204, 205 or 304. if key.downcase == "content-type" assert("Content-Type header found in #{status} response, not allowed") { not Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.include? status.to_i } return end } end ## === The Content-Length def check_content_length(status, headers) headers.each { |key, value| if key.downcase == 'content-length' ## There must not be a <tt>Content-Length</tt> header when the ## +Status+ is 1xx, 204, 205 or 304. assert("Content-Length header found in #{status} response, not allowed") { not Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.include? status.to_i } @content_length = value end } end def verify_content_length(bytes) if @head_request assert("Response body was given for HEAD request, but should be empty") { bytes == 0 } elsif @content_length assert("Content-Length header was #{@content_length}, but should be #{bytes}") { @content_length == bytes.to_s } end end ## === The Body def each @closed = false bytes = 0 ## The Body must respond to +each+ assert("Response body must respond to each") do @body.respond_to?(:each) end @body.each { |part| ## and must only yield String values. assert("Body yielded non-string value #{part.inspect}") { part.kind_of? String } bytes += Rack::Utils.bytesize(part) yield part } verify_content_length(bytes) ## ## The Body itself should not be an instance of String, as this will ## break in Ruby 1.9. ## ## If the Body responds to +close+, it will be called after iteration. If ## the body is replaced by a middleware after action, the original body ## must be closed first, if it responds to close. # XXX howto: assert("Body has not been closed") { @closed } ## ## If the Body responds to +to_path+, it must return a String ## identifying the location of a file whose contents are identical ## to that produced by calling +each+; this may be used by the ## server as an alternative, possibly more efficient way to ## transport the response. if @body.respond_to?(:to_path) assert("The file identified by body.to_path does not exist") { ::File.exist? @body.to_path } end ## ## The Body commonly is an Array of Strings, the application ## instance itself, or a File-like object. end def close @closed = true @body.close if @body.respond_to?(:close) end # :startdoc: end end ## == Thanks ## Some parts of this specification are adopted from PEP333: Python ## Web Server Gateway Interface ## v1.0 (http://www.python.org/dev/peps/pep-0333/). I'd like to thank ## everyone involved in that effort.
yangc5/playlister-sinatra-v-000
.bundle/gems/rack-1.6.0/lib/rack/lint.rb
Ruby
mit
29,968
// // AppMobiPayments.m // appMobiLib // // Copyright 2010 __MyCompanyName__. All rights reserved. // #import "AppMobiOAuth.h" #import "AppMobiDelegate.h" #import "AppMobiViewController.h" #import "AppConfig.h" #import <EventKit/EventKit.h> #import "GTMOAuthAuthentication.h" #import "OAuthService.h" #import "AppMobiWebView.h" #import "OAuthServicesData.h" @implementation GTMOAuthViewControllerTouch2 @synthesize requestIndex; - (id)initWithScope:(NSString *)scope language:(NSString *)language requestTokenURL:(NSURL *)requestURL authorizeTokenURL:(NSURL *)authorizeURL accessTokenURL:(NSURL *)accessURL authentication:(GTMOAuthAuthentication *)auth appServiceName:(NSString *)keychainAppServiceName delegate:(id)delegate finishedSelector:(SEL)finishedSelector requestIndex:(NSString *)index { self = [super initWithScope:scope language:language requestTokenURL:requestURL authorizeTokenURL:authorizeURL accessTokenURL:accessURL authentication:auth appServiceName:keychainAppServiceName delegate:delegate finishedSelector:finishedSelector]; self.requestIndex = index; return self; } - (BOOL)shouldUseKeychain { BOOL hasName = ([keychainApplicationServiceName_ length] > 0); return hasName; } - (void)signIn:(GTMOAuthSignIn *)signIn finishedWithAuth:(GTMOAuthAuthentication *)auth error:(NSError *)error { if (!hasCalledFinished_) { hasCalledFinished_ = YES; if (error == nil) { BOOL shouldUseKeychain = [self shouldUseKeychain]; if (shouldUseKeychain) { NSString *appServiceName = [self keychainApplicationServiceName]; if ([auth canAuthorize]) { // save the auth params in the keychain [[self class] saveParamsToKeychainForName:appServiceName authentication:auth]; } else { // remove the auth params from the keychain [[self class] removeParamsFromKeychainForName:appServiceName]; } } } if (delegate_ && finishedSelector_) { SEL sel = finishedSelector_; NSMethodSignature *sig = [delegate_ methodSignatureForSelector:sel]; NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig]; [invocation setSelector:sel]; [invocation setTarget:delegate_]; [invocation setArgument:&self atIndex:2]; [invocation setArgument:&auth atIndex:3]; [invocation setArgument:&requestIndex atIndex:4]; [invocation setArgument:&error atIndex:5]; [invocation invoke]; } [delegate_ autorelease]; delegate_ = nil; #if NS_BLOCKS_AVAILABLE if (completionBlock_) { completionBlock_(self, auth, error); // release the block here to avoid a retain loop on the controller [completionBlock_ autorelease]; completionBlock_ = nil; } #endif } } @end @implementation VerificationCallbackData @synthesize service, url, iden, method, body, headers; - (id)init { self = [super init]; return self; } - (void) dealloc { [service release]; [url release]; [iden release]; [method release]; [body release]; [headers release]; [super dealloc]; } @end @implementation AppMobiOAuth @synthesize ready; - (id)initWithWebView:(AppMobiWebView *)webview { self = (AppMobiOAuth *) [super initWithWebView:webview]; callbackdata = [[VerificationCallbackData alloc] init]; servicesconfig = [[OAuthServicesData alloc] init]; return self; } - (void)initializeServiceData:(NSString *)key { servicesconfig.secretkey = [key copy]; NSData *servicesData = [NSData dataWithContentsOfFile:[webView.config.baseDirectory stringByAppendingPathComponent:@"services.xml"]]; [servicesconfig initializeServices:servicesData]; ready = YES; BOOL hasConfigs = ([servicesconfig.name2Service count] > 0); NSString *js = [NSString stringWithFormat:@"AppMobi.oauthAvailable = %@;var e = document.createEvent('Events');e.initEvent('appMobi.oauth.setup',true,true);e.success=%@;document.dispatchEvent(e);", (hasConfigs?@"true":@"false"), (hasConfigs?@"true":@"false")]; AMLog(@"%@",js); [webView performSelectorOnMainThread:@selector(injectJS:) withObject:js waitUntilDone:NO]; } - (void)returnNotReadyEvent:(NSString *)iden { NSString *js = [NSString stringWithFormat:@"var e = document.createEvent('Events');e.initEvent('appMobi.oauth.unavailable',true,true);e.success=false;e.id='%@';document.dispatchEvent(e);", iden]; AMLog(@"%@",js); [webView performSelectorOnMainThread:@selector(injectJS:) withObject:js waitUntilDone:NO]; busy = NO; } - (void)returnBusyEvent:(NSString *)iden { NSString *js = [NSString stringWithFormat:@"var e = document.createEvent('Events');e.initEvent('appMobi.oauth.busy',true,true);e.success=false;e.id='%@';document.dispatchEvent(e);", iden]; AMLog(@"%@",js); [webView performSelectorOnMainThread:@selector(injectJS:) withObject:js waitUntilDone:NO]; } - (void)returnErrorEvent:(NSError *)error withData:(NSString *)data { NSString *errorMessage = [NSString stringWithFormat:@"error -- code: %d, localizedDescription: %@", [error code], [error localizedDescription]]; NSString *js = [NSString stringWithFormat:@"var e = document.createEvent('Events');e.initEvent('appMobi.oauth.protected.data',true,true);e.success=false;e.id='%@';e.response='%@';e.error='%@';document.dispatchEvent(e);", callbackdata.iden, data, errorMessage]; AMLog(@"%@",js); [webView performSelectorOnMainThread:@selector(injectJS:) withObject:js waitUntilDone:NO]; busy = NO; } - (void)getProtectedDataWithAccessToken:(GTMOAuthAuthentication*)auth { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSError *error = nil; NSHTTPURLResponse *response = nil; NSData *data = nil; BOOL success = NO; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:callbackdata.url] cachePolicy:NSURLCacheStorageNotAllowed timeoutInterval:5]; //if it's a post, set method and body if([callbackdata.method caseInsensitiveCompare:@"POST"]==NSOrderedSame) { [request setHTTPMethod:@"POST"]; [request setHTTPBody:[callbackdata.body dataUsingEncoding:NSASCIIStringEncoding]]; [request addValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; } NSString *headers = callbackdata.headers; if( [headers length] > 0 ) { int length = 0; NSString *field = nil; NSString *value = nil; NSRange range = [headers rangeOfString:@"~"]; while( range.location != NSNotFound ) { length = [[headers substringToIndex:range.location] intValue]; if( length > 0 ) { field = [[headers substringFromIndex:range.location + 1] substringToIndex:length]; } headers = [headers substringFromIndex:range.location + 1 + length]; range = [headers rangeOfString:@"~"]; length = [[headers substringToIndex:range.location] intValue]; if( length > 0 ) { value = [[headers substringFromIndex:range.location + 1] substringToIndex:length]; } headers = [headers substringFromIndex:range.location + 1 + length]; if( field != nil && value != nil ) { [request addValue:value forHTTPHeaderField:field]; } field = nil; value = nil; range = [headers rangeOfString:@"~"]; } } //authorize the request [auth authorizeRequest:request]; AMLog(@"%@", [[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding]); AMLog(@"%@", [request HTTPMethod]); //send the request data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; //check error if(error != nil) { //AMLog(@"error -- code: %d, localizedDescription: %@", [error code], [error localizedDescription]); } else { //check response status if([[NSString stringWithFormat:@"%d",[response statusCode]] hasPrefix:@"2"]) { success = YES; } else { AMLog(@"error -- code: %d", [response statusCode]); AMLog(@"data: %@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]); } } //inject response NSString* js, *responseBody = @""; if( data != nil ) { responseBody = [[[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding] autorelease]; //check for BOM characters, then strip if present NSRange xmlRange = [responseBody rangeOfString:@"\u00ef\u00bb\u00bf"]; if(xmlRange.location == 0 && xmlRange.length == 3) responseBody = [responseBody substringFromIndex:3]; //escape internal double-quotes responseBody = [responseBody stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""]; responseBody = [responseBody stringByReplacingOccurrencesOfString:@"\\\\\"" withString:@"\\\\\\\""]; //replace newline characters responseBody = [responseBody stringByReplacingOccurrencesOfString:@"\r\n" withString:@"\\n"]; responseBody = [responseBody stringByReplacingOccurrencesOfString:@"\r" withString:@"\\n"]; responseBody = [responseBody stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"]; } if(success) { js = [NSString stringWithFormat:@"var e = document.createEvent('Events');e.initEvent('appMobi.oauth.protected.data',true,true);e.success=true;e.id='%@';e.response=\"%@\";document.dispatchEvent(e);", callbackdata.iden, responseBody]; AMLog(@"%@",js); [webView performSelectorOnMainThread:@selector(injectJS:) withObject:js waitUntilDone:NO]; } else { [self returnErrorEvent:error withData:responseBody]; } busy = NO; [pool release]; } - (void)viewController:(GTMOAuthViewControllerTouch *)viewController finishedWithAuth:(GTMOAuthAuthentication *)auth error:(NSError *)error { [[AppMobiViewController masterViewController] dismissModalViewControllerAnimated:YES]; if (error != nil) { // Authentication failed [self returnErrorEvent:error withData:@""]; busy = NO; } else { // Authentication succeeded [NSThread detachNewThreadSelector:@selector(getProtectedDataWithAccessToken:) toTarget:self withObject:auth]; } } - (void)unauthorizeService:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options { if( webView.config.hasOAuth == NO ) return; if( ready == NO ) { [self returnNotReadyEvent:@""]; return; } if( busy == YES ) { [self returnBusyEvent:@""]; return; } busy = YES; NSString *service = (NSString *)[arguments objectAtIndex:0]; // segment service per app NSString *servicekey = [NSString stringWithFormat:@"%@.%@", webView.config.appName, service]; //get service from map BOOL didUnauth = NO; OAuthService *authservice = [servicesconfig.name2Service objectForKey:service]; if( authservice != nil ) { didUnauth = [GTMOAuthViewControllerTouch removeParamsFromKeychainForName:servicekey]; if( didUnauth == NO ) { NSString *js = [NSString stringWithFormat:@"var e = document.createEvent('Events');e.initEvent('appMobi.oauth.unauthorize',true,true);e.success=false;e.service='%@';e.error='This service wasn\'t already authorized.';document.dispatchEvent(e);", service]; AMLog(@"%@",js); [webView performSelectorOnMainThread:@selector(injectJS:) withObject:js waitUntilDone:NO]; } else { NSString *js = [NSString stringWithFormat:@"var e = document.createEvent('Events');e.initEvent('appMobi.oauth.unauthorize',true,true);e.success=true;e.service='%@';document.dispatchEvent(e);", service]; AMLog(@"%@",js); [webView performSelectorOnMainThread:@selector(injectJS:) withObject:js waitUntilDone:NO]; } } else { NSString *js = [NSString stringWithFormat:@"var e = document.createEvent('Events');e.initEvent('appMobi.oauth.unauthorize',true,true);e.success=false;e.service='%@';e.error='This is not a configured OAuth service.';document.dispatchEvent(e);", service]; AMLog(@"%@",js); [webView performSelectorOnMainThread:@selector(injectJS:) withObject:js waitUntilDone:NO]; } busy = NO; } - (void)downloadProtectedData:(NSMutableArray*)arguments { callbackdata.service = (NSString *)[arguments objectAtIndex:0]; callbackdata.url = (NSString *)[arguments objectAtIndex:1]; callbackdata.iden = (NSString *)[arguments objectAtIndex:2]; callbackdata.method = (NSString *)[arguments objectAtIndex:3]; callbackdata.body = (NSString *)[arguments objectAtIndex:4]; callbackdata.headers = (NSString *)[arguments objectAtIndex:5]; // segment service per app NSString *servicekey = [NSString stringWithFormat:@"%@.%@", webView.config.appName, callbackdata.service]; //get service from map OAuthService *service = [servicesconfig.name2Service objectForKey:callbackdata.service]; if( service == nil ) { NSString *js = [NSString stringWithFormat:@"var e = document.createEvent('Events');e.initEvent('appMobi.oauth.protected.data',true,true);e.success=false;e.id='%@';e.response='';e.error='%@ is not a configured OAuth service.';document.dispatchEvent(e);", callbackdata.iden, callbackdata.service]; AMLog(@"%@",js); [webView performSelectorOnMainThread:@selector(injectJS:) withObject:js waitUntilDone:NO]; busy = NO; return; } //get auth NSString *appKey = service.appKey; NSString *secret = service.secret; GTMOAuthAuthentication *auth = [[[GTMOAuthAuthentication alloc] initWithSignatureMethod:kGTMOAuthSignatureMethodHMAC_SHA1 consumerKey:appKey privateKey:secret] autorelease]; auth.serviceProvider = servicekey; // set the callback URL to which the site should redirect, and for which // the OAuth controller should look to determine when sign-in has // finished or been canceled // // This URL does not need to be for an actual web page - just used to intercept redirect [auth setCallback:@"http://www.example.com/OAuthCallback"]; //scope is used for google services - just init with placeholder NSString *scope = @"http://api.twitter.com/"; //init the view controller GTMOAuthViewControllerTouch *viewController; viewController = [[[GTMOAuthViewControllerTouch alloc] initWithScope:scope language:nil requestTokenURL:[NSURL URLWithString:service.requestTokenEndpoint] authorizeTokenURL:[NSURL URLWithString:service.authorizeEndpoint] accessTokenURL:[NSURL URLWithString:service.accessTokenEndpoint] authentication:auth appServiceName:servicekey delegate:self finishedSelector:@selector(viewController:finishedWithAuth:error:)] autorelease]; BOOL didAuth = [GTMOAuthViewControllerTouch authorizeFromKeychainForName:servicekey authentication:auth]; if (didAuth) { //we have access token, so get the resource [NSThread detachNewThreadSelector:@selector(getProtectedDataWithAccessToken:) toTarget:self withObject:auth]; } else { // Display the autentication view to get an access token [[AppMobiViewController masterViewController] presentModalViewController:viewController animated:YES]; } } //need to move body into thread for quick return - (void)getProtectedData:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options { if( webView.config.hasOAuth == NO ) return; if( ready == NO ) { [self returnNotReadyEvent:[arguments objectAtIndex:2]]; return; } if( busy == YES ) { [self returnBusyEvent:[arguments objectAtIndex:2]]; return; } busy = YES; [self downloadProtectedData:arguments]; } //to signout: [GTMOAuthViewControllerTouch removeParamsFromKeychainForName:kAppServiceName]; - (void) dealloc { [callbackdata release]; [servicesconfig release]; [super dealloc]; } @end
ngocdaothanh/ios
appMobiLib/Classes/appMobiLib/AppMobiOAuth.m
Matlab
mit
15,886
/** * Sinon.JS 1.7.3, 2013/10/18 * * @author Christian Johansen (christian@cjohansen.no) * @author Contributors: https://github.com/cjohansen/Sinon.JS/blob/master/AUTHORS * * (The BSD License) * * Copyright (c) 2010-2013, Christian Johansen, christian@cjohansen.no * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of Christian Johansen nor the names of his contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*jslint eqeqeq: false, onevar: false, forin: true, nomen: false, regexp: false, plusplus: false*/ /*global module, require, __dirname, document*/ /** * Sinon core utilities. For internal use only. * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ var sinon = (function (formatio) { var div = typeof document != "undefined" && document.createElement("div"); var hasOwn = Object.prototype.hasOwnProperty; function isDOMNode(obj) { var success = false; try { obj.appendChild(div); success = div.parentNode == obj; } catch (e) { return false; } finally { try { obj.removeChild(div); } catch (e) { // Remove failed, not much we can do about that } } return success; } function isElement(obj) { return div && obj && obj.nodeType === 1 && isDOMNode(obj); } function isFunction(obj) { return typeof obj === "function" || !!(obj && obj.constructor && obj.call && obj.apply); } function mirrorProperties(target, source) { for (var prop in source) { if (!hasOwn.call(target, prop)) { target[prop] = source[prop]; } } } function isRestorable (obj) { return typeof obj === "function" && typeof obj.restore === "function" && obj.restore.sinon; } var sinon = { wrapMethod: function wrapMethod(object, property, method) { if (!object) { throw new TypeError("Should wrap property of object"); } if (typeof method != "function") { throw new TypeError("Method wrapper should be function"); } var wrappedMethod = object[property], error; if (!isFunction(wrappedMethod)) { error = new TypeError("Attempted to wrap " + (typeof wrappedMethod) + " property " + property + " as function"); } if (wrappedMethod.restore && wrappedMethod.restore.sinon) { error = new TypeError("Attempted to wrap " + property + " which is already wrapped"); } if (wrappedMethod.calledBefore) { var verb = !!wrappedMethod.returns ? "stubbed" : "spied on"; error = new TypeError("Attempted to wrap " + property + " which is already " + verb); } if (error) { if (wrappedMethod._stack) { error.stack += '\n--------------\n' + wrappedMethod._stack; } throw error; } // IE 8 does not support hasOwnProperty on the window object. var owned = hasOwn.call(object, property); object[property] = method; method.displayName = property; method._stack = (new Error('Stack Trace for original')).stack; method.restore = function () { // For prototype properties try to reset by delete first. // If this fails (ex: localStorage on mobile safari) then force a reset // via direct assignment. if (!owned) { delete object[property]; } if (object[property] === method) { object[property] = wrappedMethod; } }; method.restore.sinon = true; mirrorProperties(method, wrappedMethod); return method; }, extend: function extend(target) { for (var i = 1, l = arguments.length; i < l; i += 1) { for (var prop in arguments[i]) { if (arguments[i].hasOwnProperty(prop)) { target[prop] = arguments[i][prop]; } // DONT ENUM bug, only care about toString if (arguments[i].hasOwnProperty("toString") && arguments[i].toString != target.toString) { target.toString = arguments[i].toString; } } } return target; }, create: function create(proto) { var F = function () {}; F.prototype = proto; return new F(); }, deepEqual: function deepEqual(a, b) { if (sinon.match && sinon.match.isMatcher(a)) { return a.test(b); } if (typeof a != "object" || typeof b != "object") { return a === b; } if (isElement(a) || isElement(b)) { return a === b; } if (a === b) { return true; } if ((a === null && b !== null) || (a !== null && b === null)) { return false; } var aString = Object.prototype.toString.call(a); if (aString != Object.prototype.toString.call(b)) { return false; } if (aString == "[object Date]") { return a.valueOf() === b.valueOf(); } var prop, aLength = 0, bLength = 0; if (aString == "[object Array]" && a.length !== b.length) { return false; } for (prop in a) { aLength += 1; if (!deepEqual(a[prop], b[prop])) { return false; } } for (prop in b) { bLength += 1; } return aLength == bLength; }, functionName: function functionName(func) { var name = func.displayName || func.name; // Use function decomposition as a last resort to get function // name. Does not rely on function decomposition to work - if it // doesn't debugging will be slightly less informative // (i.e. toString will say 'spy' rather than 'myFunc'). if (!name) { var matches = func.toString().match(/function ([^\s\(]+)/); name = matches && matches[1]; } return name; }, functionToString: function toString() { if (this.getCall && this.callCount) { var thisValue, prop, i = this.callCount; while (i--) { thisValue = this.getCall(i).thisValue; for (prop in thisValue) { if (thisValue[prop] === this) { return prop; } } } } return this.displayName || "sinon fake"; }, getConfig: function (custom) { var config = {}; custom = custom || {}; var defaults = sinon.defaultConfig; for (var prop in defaults) { if (defaults.hasOwnProperty(prop)) { config[prop] = custom.hasOwnProperty(prop) ? custom[prop] : defaults[prop]; } } return config; }, format: function (val) { return "" + val; }, defaultConfig: { injectIntoThis: true, injectInto: null, properties: ["spy", "stub", "mock", "clock", "server", "requests"], useFakeTimers: true, useFakeServer: true }, timesInWords: function timesInWords(count) { return count == 1 && "once" || count == 2 && "twice" || count == 3 && "thrice" || (count || 0) + " times"; }, calledInOrder: function (spies) { for (var i = 1, l = spies.length; i < l; i++) { if (!spies[i - 1].calledBefore(spies[i]) || !spies[i].called) { return false; } } return true; }, orderByFirstCall: function (spies) { return spies.sort(function (a, b) { // uuid, won't ever be equal var aCall = a.getCall(0); var bCall = b.getCall(0); var aId = aCall && aCall.callId || -1; var bId = bCall && bCall.callId || -1; return aId < bId ? -1 : 1; }); }, log: function () {}, logError: function (label, err) { var msg = label + " threw exception: " sinon.log(msg + "[" + err.name + "] " + err.message); if (err.stack) { sinon.log(err.stack); } setTimeout(function () { err.message = msg + err.message; throw err; }, 0); }, typeOf: function (value) { if (value === null) { return "null"; } else if (value === undefined) { return "undefined"; } var string = Object.prototype.toString.call(value); return string.substring(8, string.length - 1).toLowerCase(); }, createStubInstance: function (constructor) { if (typeof constructor !== "function") { throw new TypeError("The constructor should be a function."); } return sinon.stub(sinon.create(constructor.prototype)); }, restore: function (object) { if (object !== null && typeof object === "object") { for (var prop in object) { if (isRestorable(object[prop])) { object[prop].restore(); } } } else if (isRestorable(object)) { object.restore(); } } }; var isNode = typeof module !== "undefined" && module.exports; if (isNode) { try { formatio = require("formatio"); } catch (e) {} module.exports = sinon; module.exports.spy = require("./sinon/spy"); module.exports.spyCall = require("./sinon/call"); module.exports.stub = require("./sinon/stub"); module.exports.mock = require("./sinon/mock"); module.exports.collection = require("./sinon/collection"); module.exports.assert = require("./sinon/assert"); module.exports.sandbox = require("./sinon/sandbox"); module.exports.test = require("./sinon/test"); module.exports.testCase = require("./sinon/test_case"); module.exports.assert = require("./sinon/assert"); module.exports.match = require("./sinon/match"); } if (formatio) { var formatter = formatio.configure({ quoteStrings: false }); sinon.format = function () { return formatter.ascii.apply(formatter, arguments); }; } else if (isNode) { try { var util = require("util"); sinon.format = function (value) { return typeof value == "object" && value.toString === Object.prototype.toString ? util.inspect(value) : value; }; } catch (e) { /* Node, but no util module - would be very old, but better safe than sorry */ } } return sinon; }(typeof formatio == "object" && formatio)); /*jslint eqeqeq: false, onevar: false*/ /*global sinon, module, require, ActiveXObject, XMLHttpRequest, DOMParser*/ /** * Minimal Event interface implementation * * Original implementation by Sven Fuchs: https://gist.github.com/995028 * Modifications and tests by Christian Johansen. * * @author Sven Fuchs (svenfuchs@artweb-design.de) * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2011 Sven Fuchs, Christian Johansen */ if (typeof sinon == "undefined") { this.sinon = {}; } (function () { var push = [].push; sinon.Event = function Event(type, bubbles, cancelable, target) { this.initEvent(type, bubbles, cancelable, target); }; sinon.Event.prototype = { initEvent: function(type, bubbles, cancelable, target) { this.type = type; this.bubbles = bubbles; this.cancelable = cancelable; this.target = target; }, stopPropagation: function () {}, preventDefault: function () { this.defaultPrevented = true; } }; sinon.EventTarget = { addEventListener: function addEventListener(event, listener, useCapture) { this.eventListeners = this.eventListeners || {}; this.eventListeners[event] = this.eventListeners[event] || []; push.call(this.eventListeners[event], listener); }, removeEventListener: function removeEventListener(event, listener, useCapture) { var listeners = this.eventListeners && this.eventListeners[event] || []; for (var i = 0, l = listeners.length; i < l; ++i) { if (listeners[i] == listener) { return listeners.splice(i, 1); } } }, dispatchEvent: function dispatchEvent(event) { var type = event.type; var listeners = this.eventListeners && this.eventListeners[type] || []; for (var i = 0; i < listeners.length; i++) { if (typeof listeners[i] == "function") { listeners[i].call(this, event); } else { listeners[i].handleEvent(event); } } return !!event.defaultPrevented; } }; }()); /** * @depend ../../sinon.js * @depend event.js */ /*jslint eqeqeq: false, onevar: false*/ /*global sinon, module, require, ActiveXObject, XMLHttpRequest, DOMParser*/ /** * Fake XMLHttpRequest object * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ // wrapper for global (function(global) { if (typeof sinon === "undefined") { global.sinon = {}; } sinon.xhr = { XMLHttpRequest: global.XMLHttpRequest }; var xhr = sinon.xhr; xhr.GlobalXMLHttpRequest = global.XMLHttpRequest; xhr.GlobalActiveXObject = global.ActiveXObject; xhr.supportsActiveX = typeof xhr.GlobalActiveXObject != "undefined"; xhr.supportsXHR = typeof xhr.GlobalXMLHttpRequest != "undefined"; xhr.workingXHR = xhr.supportsXHR ? xhr.GlobalXMLHttpRequest : xhr.supportsActiveX ? function() { return new xhr.GlobalActiveXObject("MSXML2.XMLHTTP.3.0") } : false; /*jsl:ignore*/ var unsafeHeaders = { "Accept-Charset": true, "Accept-Encoding": true, "Connection": true, "Content-Length": true, "Cookie": true, "Cookie2": true, "Content-Transfer-Encoding": true, "Date": true, "Expect": true, "Host": true, "Keep-Alive": true, "Referer": true, "TE": true, "Trailer": true, "Transfer-Encoding": true, "Upgrade": true, "User-Agent": true, "Via": true }; /*jsl:end*/ function FakeXMLHttpRequest() { this.readyState = FakeXMLHttpRequest.UNSENT; this.requestHeaders = {}; this.requestBody = null; this.status = 0; this.statusText = ""; var xhr = this; var events = ["loadstart", "load", "abort", "loadend"]; function addEventListener(eventName) { xhr.addEventListener(eventName, function (event) { var listener = xhr["on" + eventName]; if (listener && typeof listener == "function") { listener(event); } }); } for (var i = events.length - 1; i >= 0; i--) { addEventListener(events[i]); } if (typeof FakeXMLHttpRequest.onCreate == "function") { FakeXMLHttpRequest.onCreate(this); } } function verifyState(xhr) { if (xhr.readyState !== FakeXMLHttpRequest.OPENED) { throw new Error("INVALID_STATE_ERR"); } if (xhr.sendFlag) { throw new Error("INVALID_STATE_ERR"); } } // filtering to enable a white-list version of Sinon FakeXhr, // where whitelisted requests are passed through to real XHR function each(collection, callback) { if (!collection) return; for (var i = 0, l = collection.length; i < l; i += 1) { callback(collection[i]); } } function some(collection, callback) { for (var index = 0; index < collection.length; index++) { if(callback(collection[index]) === true) return true; }; return false; } // largest arity in XHR is 5 - XHR#open var apply = function(obj,method,args) { switch(args.length) { case 0: return obj[method](); case 1: return obj[method](args[0]); case 2: return obj[method](args[0],args[1]); case 3: return obj[method](args[0],args[1],args[2]); case 4: return obj[method](args[0],args[1],args[2],args[3]); case 5: return obj[method](args[0],args[1],args[2],args[3],args[4]); }; }; FakeXMLHttpRequest.filters = []; FakeXMLHttpRequest.addFilter = function(fn) { this.filters.push(fn) }; var IE6Re = /MSIE 6/; FakeXMLHttpRequest.defake = function(fakeXhr,xhrArgs) { var xhr = new sinon.xhr.workingXHR(); each(["open","setRequestHeader","send","abort","getResponseHeader", "getAllResponseHeaders","addEventListener","overrideMimeType","removeEventListener"], function(method) { fakeXhr[method] = function() { return apply(xhr,method,arguments); }; }); var copyAttrs = function(args) { each(args, function(attr) { try { fakeXhr[attr] = xhr[attr] } catch(e) { if(!IE6Re.test(navigator.userAgent)) throw e; } }); }; var stateChange = function() { fakeXhr.readyState = xhr.readyState; if(xhr.readyState >= FakeXMLHttpRequest.HEADERS_RECEIVED) { copyAttrs(["status","statusText"]); } if(xhr.readyState >= FakeXMLHttpRequest.LOADING) { copyAttrs(["responseText"]); } if(xhr.readyState === FakeXMLHttpRequest.DONE) { copyAttrs(["responseXML"]); } if(fakeXhr.onreadystatechange) fakeXhr.onreadystatechange.call(fakeXhr); }; if(xhr.addEventListener) { for(var event in fakeXhr.eventListeners) { if(fakeXhr.eventListeners.hasOwnProperty(event)) { each(fakeXhr.eventListeners[event],function(handler) { xhr.addEventListener(event, handler); }); } } xhr.addEventListener("readystatechange",stateChange); } else { xhr.onreadystatechange = stateChange; } apply(xhr,"open",xhrArgs); }; FakeXMLHttpRequest.useFilters = false; function verifyRequestSent(xhr) { if (xhr.readyState == FakeXMLHttpRequest.DONE) { throw new Error("Request done"); } } function verifyHeadersReceived(xhr) { if (xhr.async && xhr.readyState != FakeXMLHttpRequest.HEADERS_RECEIVED) { throw new Error("No headers received"); } } function verifyResponseBodyType(body) { if (typeof body != "string") { var error = new Error("Attempted to respond to fake XMLHttpRequest with " + body + ", which is not a string."); error.name = "InvalidBodyException"; throw error; } } sinon.extend(FakeXMLHttpRequest.prototype, sinon.EventTarget, { async: true, open: function open(method, url, async, username, password) { this.method = method; this.url = url; this.async = typeof async == "boolean" ? async : true; this.username = username; this.password = password; this.responseText = null; this.responseXML = null; this.requestHeaders = {}; this.sendFlag = false; if(sinon.FakeXMLHttpRequest.useFilters === true) { var xhrArgs = arguments; var defake = some(FakeXMLHttpRequest.filters,function(filter) { return filter.apply(this,xhrArgs) }); if (defake) { return sinon.FakeXMLHttpRequest.defake(this,arguments); } } this.readyStateChange(FakeXMLHttpRequest.OPENED); }, readyStateChange: function readyStateChange(state) { this.readyState = state; if (typeof this.onreadystatechange == "function") { try { this.onreadystatechange(); } catch (e) { sinon.logError("Fake XHR onreadystatechange handler", e); } } this.dispatchEvent(new sinon.Event("readystatechange")); switch (this.readyState) { case FakeXMLHttpRequest.DONE: this.dispatchEvent(new sinon.Event("load", false, false, this)); this.dispatchEvent(new sinon.Event("loadend", false, false, this)); break; } }, setRequestHeader: function setRequestHeader(header, value) { verifyState(this); if (unsafeHeaders[header] || /^(Sec-|Proxy-)/.test(header)) { throw new Error("Refused to set unsafe header \"" + header + "\""); } if (this.requestHeaders[header]) { this.requestHeaders[header] += "," + value; } else { this.requestHeaders[header] = value; } }, // Helps testing setResponseHeaders: function setResponseHeaders(headers) { this.responseHeaders = {}; for (var header in headers) { if (headers.hasOwnProperty(header)) { this.responseHeaders[header] = headers[header]; } } if (this.async) { this.readyStateChange(FakeXMLHttpRequest.HEADERS_RECEIVED); } else { this.readyState = FakeXMLHttpRequest.HEADERS_RECEIVED; } }, // Currently treats ALL data as a DOMString (i.e. no Document) send: function send(data) { verifyState(this); if (!/^(get|head)$/i.test(this.method)) { if (this.requestHeaders["Content-Type"]) { var value = this.requestHeaders["Content-Type"].split(";"); this.requestHeaders["Content-Type"] = value[0] + ";charset=utf-8"; } else { this.requestHeaders["Content-Type"] = "text/plain;charset=utf-8"; } this.requestBody = data; } this.errorFlag = false; this.sendFlag = this.async; this.readyStateChange(FakeXMLHttpRequest.OPENED); if (typeof this.onSend == "function") { this.onSend(this); } this.dispatchEvent(new sinon.Event("loadstart", false, false, this)); }, abort: function abort() { this.aborted = true; this.responseText = null; this.errorFlag = true; this.requestHeaders = {}; if (this.readyState > sinon.FakeXMLHttpRequest.UNSENT && this.sendFlag) { this.readyStateChange(sinon.FakeXMLHttpRequest.DONE); this.sendFlag = false; } this.readyState = sinon.FakeXMLHttpRequest.UNSENT; this.dispatchEvent(new sinon.Event("abort", false, false, this)); if (typeof this.onerror === "function") { this.onerror(); } }, getResponseHeader: function getResponseHeader(header) { if (this.readyState < FakeXMLHttpRequest.HEADERS_RECEIVED) { return null; } if (/^Set-Cookie2?$/i.test(header)) { return null; } header = header.toLowerCase(); for (var h in this.responseHeaders) { if (h.toLowerCase() == header) { return this.responseHeaders[h]; } } return null; }, getAllResponseHeaders: function getAllResponseHeaders() { if (this.readyState < FakeXMLHttpRequest.HEADERS_RECEIVED) { return ""; } var headers = ""; for (var header in this.responseHeaders) { if (this.responseHeaders.hasOwnProperty(header) && !/^Set-Cookie2?$/i.test(header)) { headers += header + ": " + this.responseHeaders[header] + "\r\n"; } } return headers; }, setResponseBody: function setResponseBody(body) { verifyRequestSent(this); verifyHeadersReceived(this); verifyResponseBodyType(body); var chunkSize = this.chunkSize || 10; var index = 0; this.responseText = ""; do { if (this.async) { this.readyStateChange(FakeXMLHttpRequest.LOADING); } this.responseText += body.substring(index, index + chunkSize); index += chunkSize; } while (index < body.length); var type = this.getResponseHeader("Content-Type"); if (this.responseText && (!type || /(text\/xml)|(application\/xml)|(\+xml)/.test(type))) { try { this.responseXML = FakeXMLHttpRequest.parseXML(this.responseText); } catch (e) { // Unable to parse XML - no biggie } } if (this.async) { this.readyStateChange(FakeXMLHttpRequest.DONE); } else { this.readyState = FakeXMLHttpRequest.DONE; } }, respond: function respond(status, headers, body) { this.setResponseHeaders(headers || {}); this.status = typeof status == "number" ? status : 200; this.statusText = FakeXMLHttpRequest.statusCodes[this.status]; this.setResponseBody(body || ""); } }); sinon.extend(FakeXMLHttpRequest, { UNSENT: 0, OPENED: 1, HEADERS_RECEIVED: 2, LOADING: 3, DONE: 4 }); // Borrowed from JSpec FakeXMLHttpRequest.parseXML = function parseXML(text) { var xmlDoc; if (typeof DOMParser != "undefined") { var parser = new DOMParser(); xmlDoc = parser.parseFromString(text, "text/xml"); } else { xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = "false"; xmlDoc.loadXML(text); } return xmlDoc; }; FakeXMLHttpRequest.statusCodes = { 100: "Continue", 101: "Switching Protocols", 200: "OK", 201: "Created", 202: "Accepted", 203: "Non-Authoritative Information", 204: "No Content", 205: "Reset Content", 206: "Partial Content", 300: "Multiple Choice", 301: "Moved Permanently", 302: "Found", 303: "See Other", 304: "Not Modified", 305: "Use Proxy", 307: "Temporary Redirect", 400: "Bad Request", 401: "Unauthorized", 402: "Payment Required", 403: "Forbidden", 404: "Not Found", 405: "Method Not Allowed", 406: "Not Acceptable", 407: "Proxy Authentication Required", 408: "Request Timeout", 409: "Conflict", 410: "Gone", 411: "Length Required", 412: "Precondition Failed", 413: "Request Entity Too Large", 414: "Request-URI Too Long", 415: "Unsupported Media Type", 416: "Requested Range Not Satisfiable", 417: "Expectation Failed", 422: "Unprocessable Entity", 500: "Internal Server Error", 501: "Not Implemented", 502: "Bad Gateway", 503: "Service Unavailable", 504: "Gateway Timeout", 505: "HTTP Version Not Supported" }; sinon.useFakeXMLHttpRequest = function () { sinon.FakeXMLHttpRequest.restore = function restore(keepOnCreate) { if (xhr.supportsXHR) { global.XMLHttpRequest = xhr.GlobalXMLHttpRequest; } if (xhr.supportsActiveX) { global.ActiveXObject = xhr.GlobalActiveXObject; } delete sinon.FakeXMLHttpRequest.restore; if (keepOnCreate !== true) { delete sinon.FakeXMLHttpRequest.onCreate; } }; if (xhr.supportsXHR) { global.XMLHttpRequest = sinon.FakeXMLHttpRequest; } if (xhr.supportsActiveX) { global.ActiveXObject = function ActiveXObject(objId) { if (objId == "Microsoft.XMLHTTP" || /^Msxml2\.XMLHTTP/i.test(objId)) { return new sinon.FakeXMLHttpRequest(); } return new xhr.GlobalActiveXObject(objId); }; } return sinon.FakeXMLHttpRequest; }; sinon.FakeXMLHttpRequest = FakeXMLHttpRequest; })(typeof global === "object" ? global : this); if (typeof module !== 'undefined' && module.exports) { module.exports = sinon; } /** * @depend fake_xml_http_request.js */ /*jslint eqeqeq: false, onevar: false, regexp: false, plusplus: false*/ /*global module, require, window*/ /** * The Sinon "server" mimics a web server that receives requests from * sinon.FakeXMLHttpRequest and provides an API to respond to those requests, * both synchronously and asynchronously. To respond synchronuously, canned * answers have to be provided upfront. * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ if (typeof sinon == "undefined") { var sinon = {}; } sinon.fakeServer = (function () { var push = [].push; function F() {} function create(proto) { F.prototype = proto; return new F(); } function responseArray(handler) { var response = handler; if (Object.prototype.toString.call(handler) != "[object Array]") { response = [200, {}, handler]; } if (typeof response[2] != "string") { throw new TypeError("Fake server response body should be string, but was " + typeof response[2]); } return response; } var wloc = typeof window !== "undefined" ? window.location : {}; var rCurrLoc = new RegExp("^" + wloc.protocol + "//" + wloc.host); function matchOne(response, reqMethod, reqUrl) { var rmeth = response.method; var matchMethod = !rmeth || rmeth.toLowerCase() == reqMethod.toLowerCase(); var url = response.url; var matchUrl = !url || url == reqUrl || (typeof url.test == "function" && url.test(reqUrl)); return matchMethod && matchUrl; } function match(response, request) { var requestMethod = this.getHTTPMethod(request); var requestUrl = request.url; if (!/^https?:\/\//.test(requestUrl) || rCurrLoc.test(requestUrl)) { requestUrl = requestUrl.replace(rCurrLoc, ""); } if (matchOne(response, this.getHTTPMethod(request), requestUrl)) { if (typeof response.response == "function") { var ru = response.url; var args = [request].concat(ru && typeof ru.exec == "function" ? ru.exec(requestUrl).slice(1) : []); return response.response.apply(response, args); } return true; } return false; } function log(response, request) { var str; str = "Request:\n" + sinon.format(request) + "\n\n"; str += "Response:\n" + sinon.format(response) + "\n\n"; sinon.log(str); } return { create: function () { var server = create(this); this.xhr = sinon.useFakeXMLHttpRequest(); server.requests = []; this.xhr.onCreate = function (xhrObj) { server.addRequest(xhrObj); }; return server; }, addRequest: function addRequest(xhrObj) { var server = this; push.call(this.requests, xhrObj); xhrObj.onSend = function () { server.handleRequest(this); }; if (this.autoRespond && !this.responding) { setTimeout(function () { server.responding = false; server.respond(); }, this.autoRespondAfter || 10); this.responding = true; } }, getHTTPMethod: function getHTTPMethod(request) { if (this.fakeHTTPMethods && /post/i.test(request.method)) { var matches = (request.requestBody || "").match(/_method=([^\b;]+)/); return !!matches ? matches[1] : request.method; } return request.method; }, handleRequest: function handleRequest(xhr) { if (xhr.async) { if (!this.queue) { this.queue = []; } push.call(this.queue, xhr); } else { this.processRequest(xhr); } }, respondWith: function respondWith(method, url, body) { if (arguments.length == 1 && typeof method != "function") { this.response = responseArray(method); return; } if (!this.responses) { this.responses = []; } if (arguments.length == 1) { body = method; url = method = null; } if (arguments.length == 2) { body = url; url = method; method = null; } push.call(this.responses, { method: method, url: url, response: typeof body == "function" ? body : responseArray(body) }); }, respond: function respond() { if (arguments.length > 0) this.respondWith.apply(this, arguments); var queue = this.queue || []; var request; while(request = queue.shift()) { this.processRequest(request); } }, processRequest: function processRequest(request) { try { if (request.aborted) { return; } var response = this.response || [404, {}, ""]; if (this.responses) { for (var i = 0, l = this.responses.length; i < l; i++) { if (match.call(this, this.responses[i], request)) { response = this.responses[i].response; break; } } } if (request.readyState != 4) { log(response, request); request.respond(response[0], response[1], response[2]); } } catch (e) { sinon.logError("Fake server request processing", e); } }, restore: function restore() { return this.xhr.restore && this.xhr.restore.apply(this.xhr, arguments); } }; }()); if (typeof module !== 'undefined' && module.exports) { module.exports = sinon; } /*jslint eqeqeq: false, plusplus: false, evil: true, onevar: false, browser: true, forin: false*/ /*global module, require, window*/ /** * Fake timer API * setTimeout * setInterval * clearTimeout * clearInterval * tick * reset * Date * * Inspired by jsUnitMockTimeOut from JsUnit * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ if (typeof sinon == "undefined") { var sinon = {}; } (function (global) { var id = 1; function addTimer(args, recurring) { if (args.length === 0) { throw new Error("Function requires at least 1 parameter"); } var toId = id++; var delay = args[1] || 0; if (!this.timeouts) { this.timeouts = {}; } this.timeouts[toId] = { id: toId, func: args[0], callAt: this.now + delay, invokeArgs: Array.prototype.slice.call(args, 2) }; if (recurring === true) { this.timeouts[toId].interval = delay; } return toId; } function parseTime(str) { if (!str) { return 0; } var strings = str.split(":"); var l = strings.length, i = l; var ms = 0, parsed; if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) { throw new Error("tick only understands numbers and 'h:m:s'"); } while (i--) { parsed = parseInt(strings[i], 10); if (parsed >= 60) { throw new Error("Invalid time " + str); } ms += parsed * Math.pow(60, (l - i - 1)); } return ms * 1000; } function createObject(object) { var newObject; if (Object.create) { newObject = Object.create(object); } else { var F = function () {}; F.prototype = object; newObject = new F(); } newObject.Date.clock = newObject; return newObject; } sinon.clock = { now: 0, create: function create(now) { var clock = createObject(this); if (typeof now == "number") { clock.now = now; } if (!!now && typeof now == "object") { throw new TypeError("now should be milliseconds since UNIX epoch"); } return clock; }, setTimeout: function setTimeout(callback, timeout) { return addTimer.call(this, arguments, false); }, clearTimeout: function clearTimeout(timerId) { if (!this.timeouts) { this.timeouts = []; } if (timerId in this.timeouts) { delete this.timeouts[timerId]; } }, setInterval: function setInterval(callback, timeout) { return addTimer.call(this, arguments, true); }, clearInterval: function clearInterval(timerId) { this.clearTimeout(timerId); }, tick: function tick(ms) { ms = typeof ms == "number" ? ms : parseTime(ms); var tickFrom = this.now, tickTo = this.now + ms, previous = this.now; var timer = this.firstTimerInRange(tickFrom, tickTo); var firstException; while (timer && tickFrom <= tickTo) { if (this.timeouts[timer.id]) { tickFrom = this.now = timer.callAt; try { this.callTimer(timer); } catch (e) { firstException = firstException || e; } } timer = this.firstTimerInRange(previous, tickTo); previous = tickFrom; } this.now = tickTo; if (firstException) { throw firstException; } return this.now; }, firstTimerInRange: function (from, to) { var timer, smallest = null, originalTimer; for (var id in this.timeouts) { if (this.timeouts.hasOwnProperty(id)) { if (this.timeouts[id].callAt < from || this.timeouts[id].callAt > to) { continue; } if (smallest === null || this.timeouts[id].callAt < smallest) { originalTimer = this.timeouts[id]; smallest = this.timeouts[id].callAt; timer = { func: this.timeouts[id].func, callAt: this.timeouts[id].callAt, interval: this.timeouts[id].interval, id: this.timeouts[id].id, invokeArgs: this.timeouts[id].invokeArgs }; } } } return timer || null; }, callTimer: function (timer) { if (typeof timer.interval == "number") { this.timeouts[timer.id].callAt += timer.interval; } else { delete this.timeouts[timer.id]; } try { if (typeof timer.func == "function") { timer.func.apply(null, timer.invokeArgs); } else { eval(timer.func); } } catch (e) { var exception = e; } if (!this.timeouts[timer.id]) { if (exception) { throw exception; } return; } if (exception) { throw exception; } }, reset: function reset() { this.timeouts = {}; }, Date: (function () { var NativeDate = Date; function ClockDate(year, month, date, hour, minute, second, ms) { // Defensive and verbose to avoid potential harm in passing // explicit undefined when user does not pass argument switch (arguments.length) { case 0: return new NativeDate(ClockDate.clock.now); case 1: return new NativeDate(year); case 2: return new NativeDate(year, month); case 3: return new NativeDate(year, month, date); case 4: return new NativeDate(year, month, date, hour); case 5: return new NativeDate(year, month, date, hour, minute); case 6: return new NativeDate(year, month, date, hour, minute, second); default: return new NativeDate(year, month, date, hour, minute, second, ms); } } return mirrorDateProperties(ClockDate, NativeDate); }()) }; function mirrorDateProperties(target, source) { if (source.now) { target.now = function now() { return target.clock.now; }; } else { delete target.now; } if (source.toSource) { target.toSource = function toSource() { return source.toSource(); }; } else { delete target.toSource; } target.toString = function toString() { return source.toString(); }; target.prototype = source.prototype; target.parse = source.parse; target.UTC = source.UTC; target.prototype.toUTCString = source.prototype.toUTCString; return target; } var methods = ["Date", "setTimeout", "setInterval", "clearTimeout", "clearInterval"]; function restore() { var method; for (var i = 0, l = this.methods.length; i < l; i++) { method = this.methods[i]; if (global[method].hadOwnProperty) { global[method] = this["_" + method]; } else { delete global[method]; } } // Prevent multiple executions which will completely remove these props this.methods = []; } function stubGlobal(method, clock) { clock[method].hadOwnProperty = Object.prototype.hasOwnProperty.call(global, method); clock["_" + method] = global[method]; if (method == "Date") { var date = mirrorDateProperties(clock[method], global[method]); global[method] = date; } else { global[method] = function () { return clock[method].apply(clock, arguments); }; for (var prop in clock[method]) { if (clock[method].hasOwnProperty(prop)) { global[method][prop] = clock[method][prop]; } } } global[method].clock = clock; } sinon.useFakeTimers = function useFakeTimers(now) { var clock = sinon.clock.create(now); clock.restore = restore; clock.methods = Array.prototype.slice.call(arguments, typeof now == "number" ? 1 : 0); if (clock.methods.length === 0) { clock.methods = methods; } for (var i = 0, l = clock.methods.length; i < l; i++) { stubGlobal(clock.methods[i], clock); } return clock; }; }(typeof global != "undefined" && typeof global !== "function" ? global : this)); sinon.timers = { setTimeout: setTimeout, clearTimeout: clearTimeout, setInterval: setInterval, clearInterval: clearInterval, Date: Date }; if (typeof module !== 'undefined' && module.exports) { module.exports = sinon; } /** * @depend fake_server.js * @depend fake_timers.js */ /*jslint browser: true, eqeqeq: false, onevar: false*/ /*global sinon*/ /** * Add-on for sinon.fakeServer that automatically handles a fake timer along with * the FakeXMLHttpRequest. The direct inspiration for this add-on is jQuery * 1.3.x, which does not use xhr object's onreadystatehandler at all - instead, * it polls the object for completion with setInterval. Dispite the direct * motivation, there is nothing jQuery-specific in this file, so it can be used * in any environment where the ajax implementation depends on setInterval or * setTimeout. * * @author Christian Johansen (christian@cjohansen.no) * @license BSD * * Copyright (c) 2010-2013 Christian Johansen */ (function () { function Server() {} Server.prototype = sinon.fakeServer; sinon.fakeServerWithClock = new Server(); sinon.fakeServerWithClock.addRequest = function addRequest(xhr) { if (xhr.async) { if (typeof setTimeout.clock == "object") { this.clock = setTimeout.clock; } else { this.clock = sinon.useFakeTimers(); this.resetClock = true; } if (!this.longestTimeout) { var clockSetTimeout = this.clock.setTimeout; var clockSetInterval = this.clock.setInterval; var server = this; this.clock.setTimeout = function (fn, timeout) { server.longestTimeout = Math.max(timeout, server.longestTimeout || 0); return clockSetTimeout.apply(this, arguments); }; this.clock.setInterval = function (fn, timeout) { server.longestTimeout = Math.max(timeout, server.longestTimeout || 0); return clockSetInterval.apply(this, arguments); }; } } return sinon.fakeServer.addRequest.call(this, xhr); }; sinon.fakeServerWithClock.respond = function respond() { var returnVal = sinon.fakeServer.respond.apply(this, arguments); if (this.clock) { this.clock.tick(this.longestTimeout || 0); this.longestTimeout = 0; if (this.resetClock) { this.clock.restore(); this.resetClock = false; } } return returnVal; }; sinon.fakeServerWithClock.restore = function restore() { if (this.clock) { this.clock.restore(); } return sinon.fakeServer.restore.apply(this, arguments); }; }());
quxbaz/pillar.js
test/sinon/pkg/sinon-server-1.7.3.js
JavaScript
mit
51,093
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-redux"),require("redux"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-redux","redux","react-dom"],t):"object"==typeof exports?exports.ReactReduxForm=t(require("react"),require("react-redux"),require("redux"),require("react-dom")):e.ReactReduxForm=t(e.React,e.ReactRedux,e.Redux,e.ReactDOM)}(this,function(e,t,r,n){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){r(48),e.exports=r(48)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){var n=t;if("number"==typeof t){var o=e[t];return void 0===o?r:o}return t.length?((0,l["default"])(n,".")?n=n.slice(0,-1):(0,l["default"])(n,"[]")&&(n=n.slice(0,-2)),(0,a["default"])(e,n,r)):e}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var u=r(152),a=n(u),i=r(40),l=n(i)},function(e,t,r){function n(e){if(!a(e)||p.call(e)!=i||u(e))return!1;var t=o(e);if(null===t)return!0;var r=s.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==d}var o=r(125),u=r(64),a=r(42),i="[object Object]",l=Function.prototype,f=Object.prototype,c=l.toString,s=f.hasOwnProperty,d=c.call(Object),p=f.toString;e.exports=n},function(e,t){"use strict";function r(e,t){var r={};return Object.keys(e||{}).forEach(function(n){r[n]=t(e[n],n,e)}),r}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={BLUR:"rrf/blur",CHANGE:"rrf/change",FOCUS:"rrf/focus",RESET:"rrf/reset",VALIDATE:"rrf/validate",SET_DIRTY:"rrf/setDirty",SET_ERRORS:"rrf/setErrors",SET_INITIAL:"rrf/setInitial",SET_PENDING:"rrf/setPending",SET_PRISTINE:"rrf/setPristine",SET_SUBMITTED:"rrf/setSubmitted",SET_SUBMIT_FAILED:"rrf/setSubmitFailed",SET_TOUCHED:"rrf/setTouched",SET_UNTOUCHED:"rrf/setUntouched",SET_VALIDITY:"rrf/setValidity",SET_VALIDATING:"rrf/setValidating",SET_FIELDS_VALIDITY:"rrf/setFieldsValidity",SET_VIEW_VALUE:"rrf/setViewValue",RESET_VALIDITY:"rrf/resetValidity",BATCH:"rrf/batch",NULL:null,ADD_INTENT:"rrf/addIntent",CLEAR_INTENTS:"rrf/clearIntents"};t["default"]=r},function(e,t,r){"use strict";function n(e){return null!==e&&(Array.isArray(e)||o(e))}function o(e){return"object"==typeof e&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function u(e){for(var t=0,r=e.length,n=Array(r);t<r;t+=1)n[t]=e[t];return n}function a(e){for(var t,r=0,n=Object.keys(e),o=n.length,u={};r<o;r+=1)t=n[r],u[t]=e[t];return u}function i(e){return Array.isArray(e)?u(e):a(e)}function l(e){return n(e)&&(!Object.isFrozen(e),!1)?c(e,[]):e}function f(e){return e}function c(e,t){if(t.some(function(t){return t===e}))throw new Error("object has a reference cycle");return Object.freeze(e),t.push(e),Object.keys(e).forEach(function(r){var o=e[r];n(o)&&c(o,t)}),t.pop(),e}function s(e,t){return(t||[]).reduce(function(e,t){if(e)return e[t]},e)}function d(e,t){return Object.keys(t).reduce(function(e,r){return m.assoc(e,r,t[r])},e)}function p(e,t,r){return null==e||null==t?e:Object.keys(t).reduce(function(e,o){var u=t[o],a=e[o],i=r?r(a,u,o):u;return n(u)&&n(a)?(Object.isFrozen(i)&&Object.isFrozen(a),i===a?e:Array.isArray(u)?m.assoc(e,o,i):y(e,o,p(a,i,r))):y(e,o,i)},e)}function y(e,t,r){return e[t]===r?e:m.assoc(e,t,r)}function v(e,t){var r=t||0,n=e.length;n-=r,n=n<0?0:n;for(var o=new Array(n),u=0;u<n;u+=1)o[u]=e[u+r];return o}function h(e){return v(e,1)}var m=t;t.freeze=function(e){return e},t.thaw=function g(e){if(n(e)&&Object.isFrozen(e)){var t=i(e);return Object.keys(t).forEach(function(e){t[e]=g(t[e])}),t}return e},t.assoc=function(e,t,r){if(e[t]===r)return f(e);var n=i(e);return n[t]=l(r),f(n)},t.set=t.assoc,t.dissoc=function(e,t){var r=i(e);return delete r[t],f(r)},t.unset=t.dissoc,t.assocIn=function _(e,t,r){var n=t[0];return 1===t.length?m.assoc(e,n,r):m.assoc(e,n,_(e[n]||{},t.slice(1),r))},t.setIn=t.assocIn,t.getIn=s,t.updateIn=function(e,t,r){var n=s(e,t);return m.assocIn(e,t,r(n))},["push","unshift","pop","shift","reverse","sort"].forEach(function(e){t[e]=function(t,r){var n=u(t);return n[e](l(r)),f(n)},t[e].displayName="icepick."+e}),t.splice=function(e){var t=u(e),r=h(arguments).map(l);return t.splice.apply(t,r),f(t)},t.slice=function(e,t,r){var n=e.slice(t,r);return f(n)},["map","filter"].forEach(function(e){t[e]=function(t,r){var n=r[e](t);return f(n)},t[e].displayName="icepick."+e}),t.extend=t.assign=function(){var e=h(arguments).reduce(d,arguments[0]);return f(e)},t.merge=p;var b={value:function(){return this.val},thru:function(e){return this.val=l(e(this.val)),this}};Object.keys(t).forEach(function(e){b[e]=function(){var r=v(arguments);return r.unshift(this.val),this.val=t[e].apply(null,r),this}}),t.chain=function(e){var t=Object.create(b);return t.val=e,t},t._weCareAbout=n,t._slice=v},function(t,r){t.exports=e},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={focus:!1,pending:!1,pristine:!0,submitted:!1,submitFailed:!1,retouched:!1,touched:!1,valid:!0,validating:!1,validated:!1,validity:{},errors:{},intents:[]};t["default"]=r},function(e,t){"use strict";function r(e,t){if(null==e)return{};var r=n({},e);return"string"==typeof t?delete r[t]:t.forEach(function(e){delete r[e]}),r}Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};t["default"]=r},function(e,t){"use strict";function r(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function n(e,t){var o=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];if(r(e,t))return!0;if("object"!==("undefined"==typeof e?"undefined":u(e))||null===e||"object"!==("undefined"==typeof t?"undefined":u(t))||null===t)return!1;var i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;for(var f=o.omitKeys,c=o.deepKeys,s=0;s<i.length;s++)if(!(f&&f.length&&~f.indexOf(i[s])))if(c&&c.length&&~c.indexOf(i[s])){var d=n(e[i[s]],t[i[s]]);if(!d)return!1}else if(!a.call(t,i[s])||!r(e[i[s]],t[i[s]]))return!1;return!0}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},u="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return"undefined"==typeof e?"undefined":o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":"undefined"==typeof e?"undefined":o(e)},a=Object.prototype.hasOwnProperty;t["default"]=n},function(e,t){var r=Array.isArray;e.exports=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u=r(44),a=n(u),i=r(71),l=n(i),f=r(27),c=n(f),s=o({},a["default"],l["default"],{batch:c["default"]});t["default"]=s},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r=arguments.length<=2||void 0===arguments[2]?p:arguments[2],n=e&&"$form"in e?e:r.getForm(e,t);if(!n)return null;if(!t.length)return n;var o=(0,l["default"])(n.$form.model),u=(0,l["default"])(t).slice(o.length),i=(0,a["default"])(n,u);return i?(0,d["default"])(i)&&"$form"in i?i.$form:i:null}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var u=r(1),a=n(u),i=r(21),l=n(i),f=r(20),c=n(f),s=r(2),d=n(s),p={getForm:c["default"]}},function(e,t){"use strict";function r(e,t){return"function"==typeof e&&t?e(t):e}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t){function r(e){return e}e.exports=r},function(e,t,r){function n(e){return"symbol"==typeof e||o(e)&&i.call(e)==u}var o=r(42),u="[object Symbol]",a=Object.prototype,i=a.toString;e.exports=n},function(e,r){e.exports=t},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={type:null};t["default"]=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(!e)return!0;if(!e.$form){var t=e.errors;return Array.isArray(t)||(0,i["default"])(t)?Object.keys(e.errors).every(function(t){var r=!e.errors[t];return r}):!t}return Object.keys(e).every(function(t){return o(e[t])})}function u(e){return Object.keys(e).every(function(t){return"$form"===t||o(e[t])})}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o,t.fieldsValid=u;var a=r(2),i=n(a)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function u(e,t){return e?e+"."+t:t}function a(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],n=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],o=void 0,i=n.lazy,l=void 0!==i&&i;if(!(0,b["default"])(t)&&!(0,h["default"])(t))return d["default"].merge(x["default"],f({initialValue:t,value:t,model:e},r));o=l?{}:(0,_["default"])(t,function(t,n){return a(u(e,n),t,r)});var c=d["default"].merge(x["default"],f({initialValue:t,value:t,model:e},r));return d["default"].set(o,"$form",c)}function i(e,t,r){return function(){var n=arguments.length<=0||void 0===arguments[0]?r:arguments[0],o=arguments[1];if(!o.model)return n;var u=(0,O["default"])(o.model);if(t.length&&!(0,y["default"])(u.slice(0,t.length),t))return n;var a=u.slice(t.length);return e(n,o,a)}}function l(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],n=r.plugins,u=void 0===n?[]:n,l=r.initialFieldState,f=r.transformAction,c=void 0===f?null:f,s=(0,O["default"])(e),d=a(e,t,l,r),p=u.concat(F).map(function(e){return i(e,s,d)});return(0,S["default"])(j["default"].apply(void 0,o(p)),void 0,{transformAction:c})}Object.defineProperty(t,"__esModule",{value:!0});var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};t.createInitialState=a,t["default"]=l;var c=r(1),s=(n(c),r(5)),d=n(s),p=r(50),y=n(p),v=r(2),h=n(v),m=r(10),b=n(m),g=r(3),_=n(g),P=r(21),O=n(P),T=r(84),j=n(T),E=r(29),S=n(E),V=r(7),x=n(V),w=r(83),k=n(w),M=r(82),A=n(M),F=[A["default"],k["default"]]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(function(e){return!!e&&e.length}).join(".")}function u(e,t){var r=arguments.length<=2||void 0===arguments[2]?y:arguments[2],n=arguments.length<=3||void 0===arguments[3]?"":arguments[3],a=[],l=null;return r.keys(e).some(function(u){var f=r.get(e,u);if(f&&r.get(f,"$form")){var c=r.get(f,"$form.model");if((0,p["default"])(t,c)||""===c){var s=function(){var e=(0,d.pathDifference)(t,c),a=[n,u],i=f;return e.every(function(e){return!(!r.get(i,e)||!r.get(i,e+".$form")||(i=r.get(i,e),a.push(e),0))}),l=o.apply(void 0,a),{v:!0}}();if("object"===("undefined"==typeof s?"undefined":i(s)))return s.v}return!1}return r.isObject(f)&&a.push(u),!1}),l?l:(a.some(function(a){return l=u(r.get(e,a),t,r,o(n,a)),!!l}),l?l:null)}function a(e,t){var r=arguments.length<=2||void 0===arguments[2]?y:arguments[2],n=h(e,t,r);return n?r.get(e,n):null}Object.defineProperty(t,"__esModule",{value:!0}),t.clearGetFormCache=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};t.getFormStateKey=u;var l=r(1),f=n(l),c=r(2),s=n(c),d=r(91),p=n(d),y={get:f["default"],keys:function(e){return Object.keys(e)},isObject:function(e){return(0,s["default"])(e)}},v={},h=(t.clearGetFormCache=function(){return v={}},function(){return function(e,t){var r=arguments.length<=2||void 0===arguments[2]?y:arguments[2];if(v[t])return v[t];var n=u(e,t,r);return v[t]=n,n}}());t["default"]=a},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=e;return(0,l["default"])(t,".")?t=t.slice(0,-1):(0,l["default"])(t,"[]")&&(t=t.slice(0,-2)),(0,a["default"])(t)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var u=r(69),a=n(u),i=r(40),l=n(i)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return Array.isArray(e)?e:Array.from(e)}function u(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var u="."===e[0];return function(t,n){var a=u?e.slice(1):e,i=u?(0,c["default"])(t,n):t,f=a.split(/\[\]\.?/),s=o(f),p=s[0],y=s.slice(1),v=p,h=(0,c["default"])(i,v);return r.forEach(function(e,t){var r=y[t],n=(0,d["default"])(e),o=r?(0,l["default"])(h,n)+"."+r:""+(0,l["default"])(h,n);h=(0,c["default"])(h,o),v+="."+o}),u?[n,v].join("."):v}}function a(e){return function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return"function"==typeof t?function(r,o){var u=t(o());r(e.apply(void 0,[u].concat(n)))}:e.apply(void 0,[t].concat(n))}}Object.defineProperty(t,"__esModule",{value:!0}),t.trackable=void 0;var i=r(85),l=n(i),f=r(1),c=n(f),s=r(34),d=n(s);t["default"]=u,t.trackable=a},function(e,t,r){function n(e,t){for(var r=e.length;r--;)if(o(e[r][0],t))return r;return-1}var o=r(151);e.exports=n},function(e,t,r){function n(e,t){var r=e.__data__;return o(t)?r["string"==typeof t?"string":"hash"]:r.map}var o=r(135);e.exports=n},function(e,t,r){var n=r(63),o=n(Object,"create");e.exports=o},function(e,t,r){function n(e){return null!=e&&u(e.length)&&!o(e)}var o=r(68),u=r(154);e.exports=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){if(t.length){var n=t.filter(function(e){return!!e});if(n.length)return r(v(e,n))}}Object.defineProperty(t,"__esModule",{value:!0}),t.dispatchBatchIfNeeded=void 0;var u=function(){function e(e,t){var r=[],n=!0,o=!1,u=void 0;try{for(var a,i=e[Symbol.iterator]();!(n=(a=i.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(l){o=!0,u=l}finally{try{!n&&i["return"]&&i["return"]()}finally{if(o)throw u}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=r(4),i=n(a),l=r(90),f=n(l),c=r(2),s=n(c),d=r(22),p=r(17),y=n(p),v=(0,d.trackable)(function(e,t){var r=t.filter(function(e){return!!e});if(!r.length)return y["default"];if(r.length&&r.every(s["default"]))return 1===r.length?r[0]:{type:i["default"].BATCH,model:e,actions:r};var n=(0,f["default"])(r,function(e){return"function"!=typeof e}),o=u(n,2),a=o[0],l=o[1];if(!l.length){if(a.length>1)return{type:i["default"].BATCH,model:e,actions:a};if(1===a.length)return a[0]}return function(t){a.length>1?t({type:i["default"].BATCH,model:e,actions:a}):1===a.length&&t(a[0]),l.forEach(t)}});t["default"]=v,t.dispatchBatchIfNeeded=o},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(){function e(e){return"string"==typeof e?""+e:"number"==typeof e?e:""}function t(e){return(0,i["default"])(e.model)?!!e.modelValue&&e.modelValue.some(function(t){return t===e.value}):!!e.modelValue}var r={name:function(e){return e.name||e.model},disabled:function(e){var t=e.fieldValue,r=e.disabled;return(0,l.iterateeValue)(t,r)},onChange:function(e){var t=e.onChange;return t},onBlur:function(e){var t=e.onBlur;return t},onFocus:function(e){var t=e.onFocus;return t},onKeyPress:function(e){var t=e.onKeyPress;return t}},n=u({},r,{value:function(t){return t.defaultValue||t.hasOwnProperty("value")?t.value:e(t.viewValue)}});return{"default":n,checkbox:u({},r,{checked:function(e){return e.defaultChecked?e.checked:t(e)}}),radio:u({},r,{checked:function(e){return e.defaultChecked?e.checked:e.modelValue===e.value},value:function(e){return e.value}}),select:u({},r,{value:function(e){return e.modelValue}}),text:n,textarea:n,file:r,button:r,reset:u({},r,{onClick:function(e){return function(t){t.preventDefault(),e.dispatch(c["default"].reset(e.model))}}})}}Object.defineProperty(t,"__esModule",{value:!0}),t.createControlPropsMap=void 0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a=r(54),i=n(a),l=r(34),f=r(11),c=n(f),s=o();t["default"]=s,t.createControlPropsMap=o},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],n=r.transformAction;return function(){var r=arguments.length<=0||void 0===arguments[0]?t:arguments[0],o=arguments[1],u=n?n(o):o;return u.type===a["default"].BATCH?u.actions.reduce(e,r):e(r,u)}}Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),a=n(u);t["default"]=o},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){return f["default"].setIn(e,t,r)}function u(){var e=arguments.length<=0||void 0===arguments[0]?b:arguments[0],t=e.get,r=e.set,n=e.object;return function(e){var o=arguments.length<=1||void 0===arguments[1]?n:arguments[1],u=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],a=(0,p["default"])(e),i=function(){var e=arguments.length<=0||void 0===arguments[0]?o:arguments[0],n=arguments[1];if(!n.model)return e;var u=(0,p["default"])(n.model);if(!(0,s["default"])(u.slice(0,a.length),a))return e;var i=u.slice(a.length);switch(n.type){case v["default"].CHANGE:case v["default"].LOAD:return i.length?t(e,i)===n.value?e:r(e,i,n.value):n.value;case v["default"].RESET:return i.length?t(e,i)===t(o,i)?e:r(e,i,t(o,i)):o;default:return e}};return(0,m["default"])(i,o,u)}}Object.defineProperty(t,"__esModule",{value:!0}),t.createModeler=void 0;var a=r(1),i=n(a),l=r(5),f=n(l),c=r(50),s=n(c),d=r(21),p=n(d),y=r(4),v=n(y),h=r(29),m=n(h),b={get:i["default"],set:o,object:{}},g=u();t.createModeler=u,t["default"]=g},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r=(0,a["default"])(t);return"function"==typeof e?e(r):(0,l["default"])(e,function(e){return o(e,r)})}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var u=r(32),a=n(u),i=r(3),l=n(i)},function(e,t){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function n(e){return!!(e&&e.stopPropagation&&e.preventDefault)}function o(e){var t=e.target;if(!t){if(!e.nativeEvent)return;return e.nativeEvent.text}return"file"===t.type?[].concat(r(t.files))||t.dataTransfer&&[].concat(r(t.dataTransfer.files)):t.multiple?[].concat(r(t.selectedOptions)).map(function(e){return e.value}):t.value}function u(e){return n(e)?o(e):e}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=u},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=Array.isArray(e)?l["default"]:c["default"];return(0,a["default"])(e)?t(e,o):!!e}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var u=r(2),a=n(u),i=r(104),l=n(i),f=r(117),c=n(f)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return function(t){return t===e||Object.keys(e).every(function(r){return e[r]===t[r]})}}function u(e){return function(t){return t&&!!t[e]}}function a(e){return"function"==typeof e?e:null===e?c["default"]:"object"===("undefined"==typeof e?"undefined":l(e))?o(e):u(e)}function i(e,t){return"function"==typeof t?t(e):Array.isArray(t)||"object"===("undefined"==typeof t?"undefined":l(t))||"string"==typeof t?a(t)(e):!!t}Object.defineProperty(t,"__esModule",{value:!0});var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};t["default"]=a,t.iterateeValue=i;var f=r(14),c=n(f)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){if(t){if("."===e[0]||"["===e[0])return""+t+e;if("function"==typeof e)return function(r){return e(r,t)}}return e}function l(e){var t=function(t){function r(e,t){o(this,r);var n=u(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,t));return n.model=t.model,n.store=t.localStore,n}return a(r,t),c(r,[{key:"shouldComponentUpdate",value:function(e){return!(0,y["default"])(this.props,e)}},{key:"render",value:function(){var t=i(this.props.model,this.model);return d["default"].createElement(e,f({},this.props,{model:t,store:this.store||void 0}))}}]),r}(v);return t.propTypes={model:s.PropTypes.any},t.contextTypes={model:s.PropTypes.any,localStore:s.PropTypes.shape({subscribe:s.PropTypes.func,dispatch:s.PropTypes.func,getState:s.PropTypes.func})},t}Object.defineProperty(t,"__esModule",{value:!0});var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t["default"]=l;var s=r(6),d=n(s),p=r(9),y=n(p),v=s.PureComponent||s.Component},function(e,t){function r(e,t){for(var r=-1,n=e?e.length:0,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}e.exports=r},function(e,t,r){var n=r(109),o=r(122),u=o(n);e.exports=u},function(e,t,r){var n=r(124),o="object"==typeof self&&self&&self.Object===Object&&self,u=n||o||Function("return this")();e.exports=u},function(e,t,r){function n(e){if("string"==typeof e||o(e))return e;var t=e+"";return"0"==t&&1/e==-u?"-0":t}var o=r(15),u=1/0;e.exports=n},function(e,t,r){function n(e,t,r){e=i(e),t=u(t);var n=e.length;r=void 0===r?n:o(a(r),0,n);var l=r;return r-=t.length,r>=0&&e.slice(r,l)==t}var o=r(105),u=r(62),a=r(159),i=r(70);e.exports=n},function(e,t){function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=r},function(e,t){function r(e){return!!e&&"object"==typeof e}e.exports=r},function(e,t){e.exports=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(){var e=arguments.length<=0||void 0===arguments[0]?C:arguments[0],t=function(e,t){return{type:d["default"].ADD_INTENT,model:e,intent:t}},r=function(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return{type:d["default"].CLEAR_INTENTS,model:e,intents:t,options:r}},n=function(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return a({type:d["default"].FOCUS,model:e,value:t},r)},u=function(e,t){return n(e,t,{silent:!0})},i=function(e){return{type:d["default"].BLUR,model:e}},l=function(e){return{type:d["default"].SET_PRISTINE,model:e}},f=function(e){return{type:d["default"].SET_DIRTY,model:e}},s=function(e){return{type:d["default"].SET_INITIAL,model:e}},p=function(e){var t=arguments.length<=1||void 0===arguments[1]||arguments[1];return{type:d["default"].SET_PENDING,model:e,pending:t}},v=function(e){var t=arguments.length<=1||void 0===arguments[1]||arguments[1];return{type:d["default"].SET_VALIDATING,model:e,validating:t}},m=function(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return o({type:r.errors?d["default"].SET_ERRORS:d["default"].SET_VALIDITY,model:e},r.errors?"errors":"validity",t)},g=function(t){var r=!(arguments.length<=1||void 0===arguments[1])&&arguments[1];return r?function(n,o){var u=e.getFieldFromState(o(),t);n(u?{type:d["default"].SET_VALIDITY,model:t,validity:(0,M["default"])(u.validity,r)}:w["default"])}:{type:d["default"].RESET_VALIDITY,model:t}},P=function(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return{type:d["default"].SET_FIELDS_VALIDITY,model:e,fieldsValidity:t,options:r}},j=function(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return m(e,t,a({},r,{errors:!0}))},E=function(e,t,r){return P(e,t,a({},r,{errors:!0}))},S=g,V=function(e){return{type:d["default"].SET_TOUCHED,model:e}},x=function(e){return{type:d["default"].SET_UNTOUCHED,model:e}},k=function(t,r){return function(n,o){var u=e.get(o(),t);n(v(t,!0));var a=function(e){n(m(t,e))},i=r(u,a);"undefined"!=typeof i&&a(i)}},A=function(e){var t=arguments.length<=1||void 0===arguments[1]||arguments[1];return{type:d["default"].SET_SUBMITTED,model:e,submitted:t}},I=function(e){var t=arguments.length<=1||void 0===arguments[1]||arguments[1];return{type:d["default"].SET_SUBMIT_FAILED,model:e,submitFailed:t}},R=function(r,n){var o=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return"undefined"==typeof n?t(r,{type:"submit"}):function(t,u){if(o.validate){var a=e.getForm(u(),r);if(!a.$form.valid)return t(w["default"]);t(p(r,!0))}else if(o.validators||o.errors){var i=o.validators||o.errors,l=o.errors,f=e.get(u(),r),c=(0,h["default"])(i,f),s=o.errors?!(0,_["default"])(c):(0,b["default"])(c);if(!s)return t(l?j(r,c):m(r,c));t((0,y["default"])(r,[m(r,l?(0,O["default"])(c):c),p(r,!0)]))}else t(p(r,!0));var d=o.fields?E:j;return n.then(function(e){t((0,y["default"])(r,[A(r,!0),m(r,e)]))})["catch"](function(e){F["default"]||console.error(e),t((0,y["default"])(r,[I(r),d(r,e)]))}),n}},$=function(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return R(e,t,a({},r,{fields:!0}))},N=function(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return R(e,t,a({},r,{validate:!0}))},D=function(t,r){return function(n,o){var u=e.get(o(),t),a=(0,h["default"])(r,u);n(m(t,a))}},U=function(t,r){return function(n,o){var u=e.get(o(),t),a=(0,h["default"])(r,u);n(m(t,a,{errors:!0}))}},L=function(t,r){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return function(o,u){var a=e.get(u(),t),i=(0,c["default"])(r,function(t,r){var n=r?e.get(a,r):a,o=(0,h["default"])(t,n);return o}),l=n.errors?E:P;o(l(t,i))}},B=function(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return L(e,t,a({},r,{errors:!0}))};return(0,c["default"])({blur:i,focus:n,silentFocus:u,submit:R,submitFields:$,validSubmit:N,setDirty:f,setErrors:j,setInitial:s,setPending:p,setValidating:v,setPristine:l,setSubmitted:A,setSubmitFailed:I,setTouched:V,setUntouched:x,setValidity:m,setFieldsValidity:P,setFieldsErrors:E,resetValidity:g,resetErrors:S,validate:D,validateErrors:U,validateFields:L,validateFieldsErrors:B,asyncSetValidity:k,addIntent:t,clearIntents:r},T.trackable)}Object.defineProperty(t,"__esModule",{value:!0}),t.createFieldActions=void 0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=r(1),l=n(i),f=r(3),c=n(f),s=r(4),d=n(s),p=r(27),y=n(p),v=r(31),h=n(v),m=r(56),b=n(m),g=r(33),_=n(g),P=r(53),O=n(P),T=r(22),j=r(20),E=n(j),S=r(12),V=n(S),x=r(17),w=n(x),k=r(8),M=n(k),A=r(55),F=n(A),C={get:l["default"],getForm:E["default"],getFieldFromState:V["default"]};t.createFieldActions=u,t["default"]=u()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e){var t=e.modelValue,r=e.controlProps;switch(r.type){case"checkbox":return"undefined"!=typeof r.value?r.value:!t;case"radio":default:return r.value}}function f(){function e(e){return~["radio","checkbox"].indexOf(e.type)}function t(e,t){var r=t.model,o=t.controlProps,u=void 0===o?(0,M["default"])(t,Object.keys(fe)):o,a=(0,H["default"])(r,e),i=n.getFieldFromState(e,a)||oe["default"];return{model:a,modelValue:n.get(e,a),fieldValue:i,controlProps:u}}var r=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=arguments.length<=1||void 0===arguments[1]?ce:arguments[1],f=s({},W["default"],r),h={},b=function(t){function r(t){u(this,r);var n=a(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t));return n.getChangeAction=n.getChangeAction.bind(n),n.getValidateAction=n.getValidateAction.bind(n),n.handleKeyPress=n.handleKeyPress.bind(n),n.createEventHandler=n.createEventHandler.bind(n),n.handleFocus=n.createEventHandler("focus").bind(n),n.handleBlur=n.createEventHandler("blur").bind(n),n.handleUpdate=n.createEventHandler("change").bind(n),n.handleChange=n.handleChange.bind(n),n.handleLoad=n.handleLoad.bind(n),n.getMappedProps=n.getMappedProps.bind(n),n.attachNode=n.attachNode.bind(n),n.readOnlyValue=e(t.controlProps),n.state={viewValue:t.modelValue},n}return i(r,t),c(r,[{key:"componentDidMount",value:function(){this.attachNode(),this.handleLoad()}},{key:"componentWillReceiveProps",value:function(e){e.modelValue!==this.props.modelValue&&this.setViewValue(e.modelValue)}},{key:"shouldComponentUpdate",value:function(e,t){return!(0,g["default"])(this.props,e,{deepKeys:["controlProps"],omitKeys:["mapProps"]})||!(0,g["default"])(this.state.viewValue,t.viewValue)}},{key:"componentDidUpdate",value:function(){this.handleIntents()}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.model,r=e.fieldValue,n=e.dispatch,o=e.validators,u=void 0===o?{}:o,a=e.errors,i=void 0===a?{}:a;if(r&&!r.valid){var l=Object.keys(u).concat(Object.keys(i));n(Y["default"].setValidity(t,(0,M["default"])(r.validity,l)))}}},{key:"getMappedProps",value:function(){var e=this.props,t=e.mapProps,r=this.state.viewValue,n=s({},e,e.controlProps,{onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyPress:this.handleKeyPress,viewValue:r});return(0,V["default"])(t)?(0,E["default"])(t,function(e,t){return"function"==typeof e&&"component"!==t?e(n):e}):t(n)}},{key:"getChangeAction",value:function(e){var t=this.props,r=t.model,n=t.modelValue,o=t.changeAction,u=this.readOnlyValue?l(this.props):e;return o(r,(0,I["default"])(u),{currentValue:n})}},{key:"getValidateAction",value:function(e,t){var r=this.props,n=r.validators,o=r.errors,u=r.model,a=r.modelValue,i=r.updateOn,l=r.fieldValue;if(!n&&!o&&re["default"])return!1;var f=this.getNodeErrors(),c=(0,ae["default"])(i,t)?e:a;if(n||o){var s=(0,$["default"])(n,c),d=(0,T["default"])((0,$["default"])(o,c),f),p=n?(0,T["default"])((0,D["default"])(s),d):d;if(!l||!(0,g["default"])(p,l.errors))return Y["default"].setErrors(u,p)}else if(f&&Object.keys(f).length)return Y["default"].setErrors(u,f); return!1}},{key:"getAsyncValidateAction",value:function(e,t){var r=this.props,n=r.asyncValidators,u=r.fieldValue,a=r.model,i=r.modelValue,l=r.updateOn,f=r.dispatch;if(!n)return!1;var c=(0,ae["default"])(l,t)?e:i,s=Object.keys(n),d=Object.keys(u.validity).every(function(e){return!!~s.indexOf(e)||u.validity[e]});return!!d&&(f(Y["default"].setValidating(a,!0)),(0,E["default"])(n,function(e,t){var r=function(e){var r=w["default"].merge(u.validity,o({},t,e));f(Y["default"].setValidity(a,r))};e((0,I["default"])(c),r)}),c)}},{key:"getNodeErrors",value:function(){var e=this.node,t=this.props.fieldValue;if(!e||!e.willValidate)return null;var r={};return Q["default"].forEach(function(n){var o=e.validity[n];(o||t&&t.errors[n])&&(r[n]=o)}),r}},{key:"setViewValue",value:function(t){e(this.props.controlProps)||this.setState({viewValue:this.parse(t)})}},{key:"handleIntents",value:function(){var t=this,r=this.props,n=r.model,o=r.modelValue,u=r.fieldValue,a=r.fieldValue.intents,i=r.controlProps,l=r.dispatch,f=r.updateOn,c=r.validateOn,s=void 0===c?f:c;a.length&&a.forEach(function(r){switch(r.type){case F["default"].FOCUS:if(re["default"])return;var a=e(i),f=u.focus;return void(!f||!t.node.focus||a&&"undefined"!=typeof r.value&&r.value!==i.value||(t.node.focus(),l(Y["default"].clearIntents(n,r))));case"validate":return void((0,ae["default"])(s,"change")&&(l(Y["default"].clearIntents(n,r)),t.validate()));case"load":return void((0,g["default"])(o,r.value)||(l(Y["default"].clearIntents(n,r)),l(Y["default"].load(n,r.value))));default:return}})}},{key:"parse",value:function(e){return this.props.parser?this.props.parser(e):e}},{key:"handleChange",value:function(e){this.setViewValue((0,I["default"])(e)),this.handleUpdate(e)}},{key:"handleKeyPress",value:function(e){var t=this.parse((0,I["default"])(e));"Enter"===e.key&&this.props.dispatch(this.getChangeAction(t))}},{key:"handleLoad",value:function(){var e=this.props,t=e.model,r=e.modelValue,n=e.fieldValue,o=e.controlProps,u=void 0===o?h:o,a=e.onLoad,i=e.dispatch,l=e.changeAction,f=e.parser,c=void 0;u.hasOwnProperty("defaultValue")?c=u.defaultValue:u.hasOwnProperty("defaultChecked")&&(c=u.defaultChecked);var s=[this.getValidateAction(c)];if("undefined"!=typeof c)s.push(l(t,c));else if(f){var d=f(r);d!==r&&s.push(l(t,d))}(0,X.dispatchBatchIfNeeded)(t,s,i),a&&a(r,n,this.node)}},{key:"createEventHandler",value:function(t){var r=this,n=this.props,o=n.dispatch,u=n.model,a=n.updateOn,i=n.validateOn,l=void 0===i?a:i,f=n.asyncValidateOn,c=n.controlProps,s=void 0===c?h:c,d=n.parser,p=n.ignore,y={focus:Y["default"].silentFocus,blur:Y["default"].blur}[t],b={focus:s.onFocus,blur:s.onBlur,change:s.onChange}[t],g=function(e){var n=[y&&y(u),(0,ae["default"])(l,t)&&r.getValidateAction(e,t),(0,ae["default"])(a,t)&&r.getChangeAction(e)];return(0,X.dispatchBatchIfNeeded)(u,n,o),e};return function(n){return(0,ae["default"])(p,t)?b?b(n):n:e(s)?(0,v.compose)(g,(0,q["default"])(b||m["default"]))(n):(0,v.compose)(function(e){return(0,ae["default"])(f,t)&&r.getAsyncValidateAction(e,t),e},g,d,I["default"],(0,q["default"])(b||m["default"]))(n)}}},{key:"attachNode",value:function(){var e=ie&&ie(this);e&&(this.node=e)}},{key:"validate",value:function(){var e=this.props,t=e.model,r=e.modelValue,n=e.fieldValue,o=e.validators,u=e.errors,a=e.dispatch;if(!o&&!u)return r;if(!n)return r;var i=(0,$["default"])(o,r),l=(0,$["default"])(u,r),f=o?(0,T["default"])((0,D["default"])(i),l):l;return(0,g["default"])(f,n.errors)||a(Y["default"].setErrors(t,f)),r}},{key:"render",value:function(){var e=this.props,t=e.controlProps,r=void 0===t?h:t,n=e.component,o=e.control,u=(0,M["default"])(this.getMappedProps(),le);return o?(0,d.cloneElement)(o,u,r.children):(0,d.createElement)(n,s({},r,u))}}]),r}(d.Component);b.defaultProps={changeAction:n.actions.change,updateOn:"change",asyncValidateOn:"blur",parser:m["default"],controlProps:h,ignore:[],dynamic:!1,mapProps:f["default"],component:"input"};var _=(0,ee["default"])((0,y.connect)(t)(b));return _.input=function(e){return p["default"].createElement(_,s({component:"input",mapProps:s({},f["default"],e.mapProps)},(0,M["default"])(e,"mapProps")))},_.text=function(e){return p["default"].createElement(_,s({component:"input",mapProps:s({},f.text,{type:"text"},e.mapProps)},(0,M["default"])(e,"mapProps")))},_.textarea=function(e){return p["default"].createElement(_,s({component:"textarea",mapProps:s({},f.textarea,e.mapProps)},(0,M["default"])(e,"mapProps")))},_.radio=function(e){return p["default"].createElement(_,s({component:"input",type:"radio",mapProps:s({},f.radio,e.mapProps)},(0,M["default"])(e,"mapProps")))},_.checkbox=function(e){return p["default"].createElement(_,s({component:"input",type:"checkbox",mapProps:s({},f.checkbox,e.mapProps),changeAction:e.changeAction||n.actions.checkWithValue},(0,M["default"])(e,"mapProps")))},_.file=function(e){return p["default"].createElement(_,s({component:"input",type:"file",mapProps:s({},f.file,e.mapProps)},(0,M["default"])(e,"mapProps")))},_.select=function(e){return p["default"].createElement(_,s({component:"select",mapProps:s({},f.select,e.mapProps)},(0,M["default"])(e,"mapProps")))},_.button=function(e){return p["default"].createElement(_,s({component:"button",mapProps:s({},f.button,e.mapProps)},(0,M["default"])(e,"mapProps")))},_.reset=function(e){return p["default"].createElement(_,s({component:"button",type:"reset",mapProps:s({},f.reset,e.mapProps)},(0,M["default"])(e,"mapProps")))},_}Object.defineProperty(t,"__esModule",{value:!0}),t.createControlClass=void 0;var c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},d=r(6),p=n(d),y=r(16),v=r(43),h=r(14),m=n(h),b=r(9),g=n(b),_=r(1),P=n(_),O=r(58),T=n(O),j=r(3),E=n(j),S=r(2),V=n(S),x=r(5),w=n(x),k=r(8),M=n(k),A=r(4),F=n(A),C=r(32),I=n(C),R=r(31),$=n(R),N=r(53),D=n(N),U=r(12),L=n(U),B=r(13),H=n(B),K=r(92),q=n(K),G=r(11),Y=n(G),z=r(28),W=n(z),J=r(76),Q=n(J),X=r(27),Z=r(35),ee=n(Z),te=r(55),re=n(te),ne=r(7),oe=n(ne),ue=r(51),ae=n(ue),ie=re["default"]?null:r(162).findDOMNode,le=["changeAction","getFieldFromState","store"],fe={model:d.PropTypes.oneOfType([d.PropTypes.func,d.PropTypes.string]).isRequired,modelValue:d.PropTypes.any,viewValue:d.PropTypes.any,control:d.PropTypes.any,onLoad:d.PropTypes.func,onSubmit:d.PropTypes.func,fieldValue:d.PropTypes.object,mapProps:d.PropTypes.oneOfType([d.PropTypes.func,d.PropTypes.object]),changeAction:d.PropTypes.func,updateOn:d.PropTypes.oneOfType([d.PropTypes.arrayOf(d.PropTypes.string),d.PropTypes.string]),validateOn:d.PropTypes.oneOfType([d.PropTypes.arrayOf(d.PropTypes.string),d.PropTypes.string]),validators:d.PropTypes.oneOfType([d.PropTypes.func,d.PropTypes.object]),asyncValidateOn:d.PropTypes.oneOfType([d.PropTypes.arrayOf(d.PropTypes.string),d.PropTypes.string]),asyncValidators:d.PropTypes.oneOfType([d.PropTypes.func,d.PropTypes.object]),errors:d.PropTypes.oneOfType([d.PropTypes.func,d.PropTypes.object]),controlProps:d.PropTypes.object,component:d.PropTypes.any,dispatch:d.PropTypes.func,parser:d.PropTypes.func,ignore:d.PropTypes.oneOfType([d.PropTypes.arrayOf(d.PropTypes.string),d.PropTypes.string]),dynamic:d.PropTypes.bool,store:d.PropTypes.shape({subscribe:d.PropTypes.func,dispatch:d.PropTypes.func,getState:d.PropTypes.func})},ce={get:P["default"],getFieldFromState:L["default"],actions:Y["default"]};t.createControlClass=f,t["default"]=f()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(){function e(e,r){var n=r.model,o=(0,I["default"])(n,e);return{model:o,modelValue:t.get(e,o),formValue:t.getForm(e,o)}}var t=arguments.length<=0||void 0===arguments[0]?K:arguments[0],r=function(e){function r(e){o(this,r);var t=u(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.handleSubmit=t.handleSubmit.bind(t),t.handleReset=t.handleReset.bind(t),t.handleValidSubmit=t.handleValidSubmit.bind(t),t.handleInvalidSubmit=t.handleInvalidSubmit.bind(t),t.attachNode=t.attachNode.bind(t),t}return a(r,e),c(r,[{key:"getChildContext",value:function(){return{model:this.props.model,localStore:this.props.store}}},{key:"componentDidMount",value:function(){this.handleUpdate(),this.handleChange(),(0,B["default"])(this.props.validateOn,"change")&&this.validate(this.props,!0)}},{key:"componentWillReceiveProps",value:function(e){(0,B["default"])(e.validateOn,"change")&&this.validate(e)}},{key:"shouldComponentUpdate",value:function(e){return(0,U["default"])(this,e)}},{key:"componentDidUpdate",value:function(e){this.handleIntents(),(0,v["default"])(e.formValue,this.props.formValue)||this.handleUpdate(),(0,v["default"])(e.modelValue,this.props.modelValue)||this.handleChange()}},{key:"handleUpdate",value:function(){this.props.onUpdate&&this.props.onUpdate(this.props.formValue)}},{key:"handleChange",value:function(){this.props.onChange&&this.props.onChange(this.props.modelValue)}},{key:"attachNode",value:function(e){e&&(this._node=e,this._node.submit=this.handleSubmit)}},{key:"validate",value:function(e){var r=!(arguments.length<=1||void 0===arguments[1])&&arguments[1],n=this.props,o=n.model,u=n.dispatch,a=n.formValue,i=n.modelValue,l=e.validators,c=e.errors;if(a){if(!l&&!c&&i!==e.modelValue)return void(!a.$form.valid&&(0,N.fieldsValid)(a)&&u(t.actions.setValidity(o,!0)));var s=l!==this.props.validators||c!==this.props.errors,d=l?(0,P["default"])((0,w["default"])(l),c):c,p=!1,y={},h=function m(n,o){if(~o.indexOf("[]"))!function(){var r=o.split("[]"),u=f(r,2),a=u[0],i=u[1],l=a?t.get(e.modelValue,a):e.modelValue;l.forEach(function(e,t){m(n,a+"["+t+"]"+i)})}();else{var u=o?t.get(e.modelValue,o):e.modelValue,l=o?t.get(i,o):i,c=(0,$["default"])(a,o).errors;if(r||s||u!==l){var d=(0,V["default"])(n,u);p||(0,v["default"])(d,c)||(p=!0),y[o]=d}else y[o]=(0,$["default"])(a,o).errors}};(0,g["default"])(d,h),y.hasOwnProperty("")||(y[""]=!1,p=p||(0,M["default"])(a.$form.errors)),p&&u(t.actions.setFieldsErrors(o,y))}}},{key:"handleValidSubmit",value:function(){var e=this.props,r=e.dispatch,n=e.model,o=e.modelValue,u=e.onSubmit;r(t.actions.setPending(n)),u&&u(o)}},{key:"handleInvalidSubmit",value:function(){var e=this.props,r=e.onSubmitFailed,n=e.formValue,o=e.dispatch;r&&r(n),n.$form.submitFailed||o(t.actions.setSubmitFailed(this.props.model))}},{key:"handleReset",value:function(e){e&&e.preventDefault(),this.props.dispatch(t.actions.reset(this.props.model))}},{key:"handleIntents",value:function(){var e=this,r=this.props,n=r.model,o=r.formValue,u=r.dispatch;o.$form.intents.forEach(function(r){switch(r.type){case"submit":return u(t.actions.clearIntents(n,r)),void(o.$form.valid?e.handleValidSubmit():e.handleInvalidSubmit());default:return}})}},{key:"handleSubmit",value:function(e){e&&e.preventDefault();var r=this.props,n=r.model,o=r.modelValue,u=r.formValue,a=r.onSubmit,i=r.dispatch,l=r.validators,c=r.errors,s=!u||u.$form.valid;if(!l&&a&&s)return a(o),o;var d=l?(0,P["default"])((0,w["default"])(l),c):c,p={},y=function v(e,r){if(~r.indexOf("[]"))!function(){var n=r.split("[]"),u=f(n,2),a=u[0],i=u[1],l=a?t.get(o,a):o;l.forEach(function(t,r){v(e,a+"["+r+"]"+i)})}();else{var n=r?t.get(o,r):o,u=(0,V["default"])(e,n);p[r]=u}};return(0,g["default"])(d,y),i(t.actions.batch(n,[t.actions.setFieldsErrors(n,p),t.actions.addIntent(n,{type:"submit"})])),o}},{key:"render",value:function(){var e=this.props,t=e.component,r=e.children,n=e.formValue,o=(0,T["default"])(this.props,Object.keys(H)),u="function"==typeof r?r(n):r;return d["default"].createElement(t,l({},o,{onSubmit:this.handleSubmit,onReset:this.handleReset,ref:this.attachNode}),u)}}]),r}(s.Component);return r.defaultProps={validateOn:"change",component:"form"},r.childContextTypes={model:s.PropTypes.any,localStore:s.PropTypes.shape({subscribe:s.PropTypes.func,dispatch:s.PropTypes.func,getState:s.PropTypes.func})},(0,p.connect)(e)(r)}Object.defineProperty(t,"__esModule",{value:!0}),t.createFormClass=void 0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f=function(){function e(e,t){var r=[],n=!0,o=!1,u=void 0;try{for(var a,i=e[Symbol.iterator]();!(n=(a=i.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(l){o=!0,u=l}finally{try{!n&&i["return"]&&i["return"]()}finally{if(o)throw u}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(6),d=n(s),p=r(16),y=r(9),v=n(y),h=r(1),m=n(h),b=r(3),g=n(b),_=r(58),P=n(_),O=r(8),T=n(O),j=r(11),E=n(j),S=r(31),V=n(S),x=r(89),w=n(x),k=r(33),M=n(k),A=r(20),F=n(A),C=r(13),I=n(C),R=r(87),$=n(R),N=r(18),D=r(52),U=n(D),L=r(51),B=n(L),H={component:s.PropTypes.any,validators:s.PropTypes.object,errors:s.PropTypes.object,validateOn:s.PropTypes.oneOf(["change","submit"]),model:s.PropTypes.string.isRequired,modelValue:s.PropTypes.any,formValue:s.PropTypes.object,onSubmit:s.PropTypes.func,onSubmitFailed:s.PropTypes.func,dispatch:s.PropTypes.func,children:s.PropTypes.oneOfType([s.PropTypes.func,s.PropTypes.node]),store:s.PropTypes.shape({subscribe:s.PropTypes.func,dispatch:s.PropTypes.func,getState:s.PropTypes.func}),onUpdate:s.PropTypes.func,onChange:s.PropTypes.func},K={get:m["default"],getForm:F["default"],actions:E["default"]};t.createFormClass=i,t["default"]=i()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(){var e=arguments.length<=0||void 0===arguments[0]?a["default"]:arguments[0],t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return function(r,n){var o=void 0;try{o=r(void 0,l["default"])}catch(u){o=null}var a=e(n,o,t);return function(){var e=arguments.length<=0||void 0===arguments[0]?o:arguments[0],t=arguments[1],n=a(e,t);return r(n,t)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.createModelReducerEnhancer=void 0;var u=r(30),a=n(u),i=r(17),l=n(i),f=o(a["default"]);t.createModelReducerEnhancer=o,t["default"]=f},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.track=t.getModel=t.getField=t.form=t.batched=t.modeled=t.createFieldClass=t.Fieldset=t.Errors=t.LocalForm=t.Form=t.Control=t.Field=t.controls=t.actionTypes=t.actions=t.initialFieldState=t.createForms=t.combineForms=t.modelReducer=t.formReducer=void 0;var o=r(11),u=n(o),a=r(4),i=n(a),l=r(73),f=n(l),c=r(74),s=n(c),d=r(45),p=n(d),y=r(46),v=n(y),h=r(75),m=n(h),b=r(72),g=n(b),_=r(28),P=n(_),O=r(47),T=n(O),j=r(29),E=n(j),S=r(19),V=n(S),x=r(7),w=n(x),k=r(49),M=n(k),A=r(30),F=n(A),C=r(22),I=n(C),R=r(12),$=n(R),N=r(1),D=n(N),U=r(77),L=n(U);t.formReducer=V["default"],t.modelReducer=F["default"],t.combineForms=M["default"],t.createForms=k.createForms,t.initialFieldState=w["default"],t.actions=u["default"],t.actionTypes=i["default"],t.controls=P["default"],t.Field=f["default"],t.Control=p["default"],t.Form=v["default"],t.LocalForm=m["default"],t.Errors=g["default"],t.Fieldset=s["default"],t.createFieldClass=l.createFieldClass,t.modeled=T["default"],t.batched=E["default"],t.form=L["default"],t.getField=$["default"],t.getModel=D["default"],t.track=I["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){return e?e+"."+t:t}function a(){function e(e){var t=arguments.length<=1||void 0===arguments[1]?"":arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],a=Object.keys(e),l={},f={},c=i({},g,n),s=c.key,d=c.plugins;return a.forEach(function(n){var o=e[n],a=u(t,n);if("function"==typeof o){var i=void 0;try{i=o(void 0,b["default"])}catch(c){i=null}l[n]=r.modeled(o,a),f[n]=i}else l[n]=r.modelReducer(a,o),f[n]=r.toJS(o)}),i({},l,o({},s,r.formReducer(t,f,{plugins:d})))}function t(t){var r=arguments.length<=1||void 0===arguments[1]?"":arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],o=e(t,r,n);return(0,y.combineReducers)(o)}var r=arguments.length<=0||void 0===arguments[0]?_:arguments[0];return{createForms:e,combineForms:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.createForms=t.createFormCombiner=void 0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l=r(47),f=n(l),c=r(30),s=n(c),d=r(19),p=n(d),y=r(43),v=r(14),h=n(v),m=r(17),b=n(m),g={key:"forms",plugins:[]},_={modelReducer:s["default"],formReducer:p["default"],modeled:f["default"],toJS:h["default"]},P=a(),O=P.combineForms,T=P.createForms;t["default"]=O,t.createFormCombiner=a,t.createForms=T},function(e,t){"use strict";function r(e,t){return e&&t&&e.length===t.length&&e.every(function(e,r){return e===t[r]})}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t){"use strict";function r(e,t){return"string"==typeof e?e===t:!!~e.indexOf(t)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r=e.children,n=t.children;if(i["default"].Children.count(r)!==i["default"].Children.count(n)||!i["default"].Children.count(r)||!i["default"].Children.count(n))return!0;var o=i["default"].Children.toArray(r),a=i["default"].Children.toArray(n);return o.length===a.length&&[].concat(o).some(function(e,t){var r=a[t];return e.props&&r.props?u(e,r.props,r.state):!(0,s["default"])(e,r)})}function u(e,t,r){return e.props.children?(0,f["default"])(e,t,r)||o(e.props,t):(0,f["default"])(e,t,r)}Object.defineProperty(t,"__esModule",{value:!0}),t.compareChildren=o,t["default"]=u;var a=r(6),i=n(a),l=r(161),f=n(l),c=r(9),s=n(c)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return(0,a["default"])(e)?(0,l["default"])(e,o):!e}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var u=r(2),a=n(u),i=r(3),l=n(i)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return(0,a["default"])(e,"[]")}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var u=r(40),a=n(u)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="undefined"!=typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product;t["default"]=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return(0,a["default"])(e)?(0,l["default"])(e,o):!!e}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var u=r(2),a=n(u),i=r(106),l=n(i)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r=Array.isArray(e)?a["default"]:l["default"];return r(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var u=r(36),a=n(u),i=r(113),l=n(i)},function(e,t){"use strict";function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e){return e&&"object"===("undefined"==typeof e?"undefined":u(e))&&!Array.isArray(e)&&null!==e}function o(e,t){return n(e)&&n(t)&&Object.keys(t).forEach(function(u){n(t[u])?(e[u]||Object.assign(e,r({},u,{})),o(e[u],t[u])):Object.assign(e,r({},u,t[u]))}),e}Object.defineProperty(t,"__esModule",{value:!0});var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};t["default"]=o},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function u(e,t,r){var n=t.slice(0,-1),a=n.length?(0,f["default"])(e,n):e;if(!a)return e;var l=a.$form,c="function"==typeof r?r(a):r,s=i["default"].setIn(e,[].concat(o(n),["$form"]),i["default"].merge(l,c));return n.length?u(s,n,r):s}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=u;var a=r(5),i=n(a),l=r(1),f=n(l)},function(e,t,r){"use strict";var n=function(e,t,r,n,o,u,a,i){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[r,n,o,u,a,i],c=0;l=new Error(t.replace(/%s/g,function(){return f[c++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}};e.exports=n},function(e,t,r){var n=r(38),o=n.Symbol;e.exports=o},function(e,t,r){function n(e){if("string"==typeof e)return e;if(u(e))return l?l.call(e):"";var t=e+"";return"0"==t&&1/e==-a?"-0":t}var o=r(61),u=r(15),a=1/0,i=o?o.prototype:void 0,l=i?i.toString:void 0;e.exports=n},function(e,t,r){function n(e,t){var r=u(e,t);return o(r)?r:void 0}var o=r(111),u=r(126);e.exports=n},function(e,t){function r(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(r){}return t}e.exports=r},function(e,t){function r(e,t){return function(r){return e(t(r))}}e.exports=r},function(e,t,r){var n=r(156),o=r(70),u=/^\./,a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,l=n(function(e){e=o(e);var t=[];return u.test(e)&&t.push(""),e.replace(a,function(e,r,n,o){t.push(n?o.replace(i,"$1"):r||e)}),t});e.exports=l},function(e,t,r){function n(e){return o(e)&&i.call(e,"callee")&&(!f.call(e,"callee")||l.call(e)==u)}var o=r(153),u="[object Arguments]",a=Object.prototype,i=a.hasOwnProperty,l=a.toString,f=a.propertyIsEnumerable;e.exports=n},function(e,t,r){function n(e){var t=o(e)?l.call(e):"";return t==u||t==a}var o=r(41),u="[object Function]",a="[object GeneratorFunction]",i=Object.prototype,l=i.toString;e.exports=n},function(e,t,r){function n(e){return a(e)?o(e,f):i(e)?[e]:u(l(e))}var o=r(36),u=r(120),a=r(10),i=r(15),l=r(66),f=r(39);e.exports=n},function(e,t,r){function n(e){return null==e?"":o(e)}var o=r(62);e.exports=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function u(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];if("undefined"!=typeof t)return i({},r,e[t])}function a(){function e(e,n,o,a){var i=function(i){for(var l=arguments.length,f=Array(l>1?l-1:0),c=1;c<l;c++)f[c-1]=arguments[c];return function(l,c){var s=t.get(c(),i,n),d=e.apply(void 0,[s].concat(f)),p=a?a.apply(void 0,[d].concat(f)):void 0;l(r(i,d,u(f,o-1,p)))}};return i.withValue=function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),l=1;l<n;l++)i[l-1]=arguments[l];return function(n){var l=a?a.apply(void 0,[n].concat(i)):void 0;r(t,e.apply(void 0,[n].concat(i)),u(i,o-1,l))}},i}var t=arguments.length<=0||void 0===arguments[0]?T:arguments[0],r=function(e,r){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],o=i({silent:!1,multi:(0,m["default"])(e)},n);return i({type:g["default"].CHANGE,model:e,value:t.getValue(r)},o)},n=e(function(e,r){var n=arguments.length<=2||void 0===arguments[2]?function(e){return e===r}:arguments[2],u=e.filter(function(e){return!n(e)});return t.length(e)===t.length(u)?[].concat(o(e),[r]):u},t.array,3),a=e(function(e,r){return t.push(e||t.array,r)},t.array,2),l=e(function(e){return!e},void 0,1),f=function(e,n){var o=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],u=o.currentValue;if((0,m["default"])(e)){var a=u||t.array,i=(a||t.array).filter(function(e){return e!==n}),l=t.length(i)===t.length(a)?t.push(a,n):i;return r(e,l)}return r(e,!u)},c=function(e,r){return function(n,o){var u=t.get(o(),e),a=f(e,r,{currentValue:u});n(a)}},d=e(function(e,t){return e.filter(t)},t.array,2),p=function(e){return{type:g["default"].RESET,model:e}},y=e(function(e){var t=arguments.length<=1||void 0===arguments[1]?s["default"]:arguments[1];return e.map(t)},t.array,2),v=e(function(e,r){return t.splice(e,r,1)},t.array,2,function(e,t){return{removeKeys:[t]}}),h=e(function(e,r,n){if(r>=t.length(e)||n>=t.length(e))throw new Error("Error moving array item: invalid bounds "+r+", "+n);var o=t.get(e,r),u=t.splice(e,r,1),a=t.splice(u,n,0,o);return a},t.array,3),b=e(t.merge,{},2),_=e(function(e){var r=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n="string"==typeof r?[r]:r,o=n.reduce(function(e,r){return t.remove(e,r)},e);return o},{},2,function(e,t){return{removeKeys:t}}),j=function(e,t){return r(e,t,{silent:!0,load:!0})};return(0,P["default"])({change:r,xor:n,push:a,toggle:l,check:c,checkWithValue:f,filter:d,reset:p,map:y,remove:v,move:h,merge:b,omit:_,load:j},O.trackable)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};t.createModelActions=a;var l=r(1),f=n(l),c=r(14),s=n(c),d=r(5),p=n(d),y=r(32),v=n(y),h=r(54),m=n(h),b=r(4),g=n(b),_=r(3),P=n(_),O=r(22),T={get:f["default"],getValue:v["default"],splice:p["default"].splice,merge:p["default"].merge,remove:p["default"].dissoc,push:p["default"].push,length:function(e){return e.length},object:{},array:[]};t["default"]=a()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];return"function"==typeof r?r(e,t):Array.isArray(r)||"object"===("undefined"==typeof r?"undefined":c(r))||"string"==typeof r?(0,g["default"])(r)(e):!!r}function l(){function e(e,r){var n=r.model,o=(0,M["default"])(n,e),u=t.getForm(e,o);(0,E["default"])(u,"Could not find form state for '"+o+"' model. Please make sure it exists in the store.");var a=u.$form,i=t.getFieldFromState(e,o)||$["default"];return{model:o,modelValue:t.get(e,o),formValue:a,fieldValue:i}}var t=arguments.length<=0||void 0===arguments[0]?U:arguments[0],r=function(e){function t(){return o(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),f(t,[{key:"shouldComponentUpdate",value:function(e){var t=e.fieldValue,r=e.formValue,n=this.props.dynamic;return n?!(0,D["default"])(this.props,e):t!==this.props.fieldValue||r!==this.props.formValue}},{key:"mapErrorMessages",value:function(e){var t=this,r=this.props.messages;return"string"==typeof e?this.renderError(e,"error"):e?(0,m["default"])(e,function(e,n){var o=r[n];if(e){if(o||"string"==typeof e)return t.renderError(o||e,n);if((0,P["default"])(e))return t.mapErrorMessages(e)}return!1}).reduce(function(e,t){return t?e.concat(t):e},[]):null}},{key:"renderError",value:function(e,t){var r=this.props,n=r.component,o=r.model,u=r.modelValue,a=r.fieldValue,i=r.fieldValue.errors,l={key:t,model:o,modelValue:u,fieldValue:a},f="function"==typeof e?e(u,i[t]):e;if(!f)return null;var c="function"==typeof n?l:{key:t};return d["default"].createElement(n,c,f)}},{key:"render",value:function(){var e=this.props,t=e.fieldValue,r=e.formValue,n=e.show,o=e.wrapper,u="function"==typeof o?this.props:(0,T["default"])(this.props,Object.keys(L));if(!i(t,r,n))return null;var a=(0,F["default"])(t)?null:this.mapErrorMessages(t.errors);return a?d["default"].createElement(o,u,a):null}}]),t}(s.Component);return r.defaultProps={wrapper:"div",component:"span",messages:{},show:!0,dynamic:!0},(0,I["default"])((0,p.connect)(e)(r))}Object.defineProperty(t,"__esModule",{value:!0}),t.createErrorsClass=void 0;var f=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},s=r(6),d=n(s),p=r(16),y=r(1),v=n(y),h=r(57),m=n(h),b=r(34),g=n(b),_=r(2),P=n(_),O=r(8),T=n(O),j=r(60),E=n(j),S=r(20),V=n(S),x=r(12),w=n(x),k=r(13),M=n(k),A=r(18),F=n(A),C=r(35),I=n(C),R=r(7),$=n(R),N=r(9),D=n(N),U={get:v["default"],getForm:V["default"],getFieldFromState:w["default"]},L={modelValue:s.PropTypes.any,formValue:s.PropTypes.object,fieldValue:s.PropTypes.object,model:s.PropTypes.string.isRequired,messages:s.PropTypes.objectOf(s.PropTypes.oneOfType([s.PropTypes.string,s.PropTypes.func,s.PropTypes.bool])),show:s.PropTypes.any,wrapper:s.PropTypes.oneOfType([s.PropTypes.string,s.PropTypes.func,s.PropTypes.element]),component:s.PropTypes.oneOfType([s.PropTypes.string,s.PropTypes.func,s.PropTypes.element]),dispatch:s.PropTypes.func,dynamic:s.PropTypes.oneOfType([s.PropTypes.bool,s.PropTypes.arrayOf(s.PropTypes.string)]),store:s.PropTypes.shape({subscribe:s.PropTypes.func,dispatch:s.PropTypes.func,getState:s.PropTypes.func})};t.createErrorsClass=l,t["default"]=l()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t,r){var n=r.controlPropsMap,o=Object.keys(n).filter(function(t){var r=n[t];return!(!(0,g["default"])(r)||!r.component)&&e.type===r.component});if(o.length)return o[0];try{var u=e.constructor.displayName||e.type.displayName||e.type.name||e.type;return"input"===u&&(u=n[e.props.type]?e.props.type:"text"),n[u]?u:null}catch(a){return}}function l(){function e(e,t){var n=t.model,o=(0,R["default"])(n,e),u=r.getFieldFromState(e,o)||B["default"];return{model:o,fieldValue:u}}var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=arguments.length<=1||void 0===arguments[1]?K:arguments[1],n={controlPropsMap:c({},k["default"],t)},l={checkbox:{changeAction:r.actions.checkWithValue}},p=function(e){function t(){return o(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments)); }return a(t,e),f(t,[{key:"shouldComponentUpdate",value:function(e){var t=this.props.dynamic;return t?(0,A["default"])(this,e):(0,C["default"])(this,e)}},{key:"createControlComponent",value:function(e){var t=this.props;if(!e||!e.props||e instanceof x["default"])return e;var o=i(e,t,n),u=t.mapProps,a=void 0===u?n.controlPropsMap[o]:u,f=(0,P["default"])(t,Object.keys(H));return a?d["default"].createElement(r.Control,c({},f,{control:e,controlProps:e.props,component:e.type,mapProps:a},l[o]||{})):d["default"].cloneElement(e,null,this.mapChildrenToControl(e.props.children))}},{key:"mapChildrenToControl",value:function(e){var t=this;return d["default"].Children.count(e)>1?d["default"].Children.map(e,function(e){return t.createControlComponent(e)}):this.createControlComponent(e)}},{key:"render",value:function(){var e=this.props,t=e.component,r=e.children,n=e.fieldValue,o=(0,m["default"])(this.props,Object.keys(H)),u="function"==typeof r?r(n):r;return t?d["default"].createElement(t,o,this.mapChildrenToControl(u)):((0,j["default"])(1===d["default"].Children.count(u),"Empty wrapper components for <Field> are only possiblewhen there is a single child. Please check the children"+('passed into <Field model="'+this.props.model+'">.')),this.createControlComponent(u))}}]),t}(s.Component);return p.defaultProps={updateOn:"change",asyncValidateOn:"blur",parser:v["default"],changeAction:S["default"].change,dynamic:!0,component:"div"},(0,U["default"])((0,O.connect)(e)(p))}Object.defineProperty(t,"__esModule",{value:!0}),t.createFieldClass=t.controlPropsMap=void 0;var f=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s=r(6),d=n(s),p=r(1),y=(n(p),r(14)),v=n(y),h=r(8),m=n(h),b=r(2),g=n(b),_=r(157),P=n(_),O=r(16),T=r(60),j=n(T),E=r(11),S=n(E),V=r(45),x=n(V),w=r(28),k=n(w),M=r(52),A=n(M),F=r(93),C=n(F),I=r(13),R=n(I),$=r(12),N=n($),D=r(35),U=n(D),L=r(7),B=n(L),H={model:s.PropTypes.oneOfType([s.PropTypes.func,s.PropTypes.string]).isRequired,component:s.PropTypes.oneOfType([s.PropTypes.func,s.PropTypes.string]),parser:s.PropTypes.func,updateOn:s.PropTypes.oneOfType([s.PropTypes.arrayOf(s.PropTypes.string),s.PropTypes.string]),changeAction:s.PropTypes.func,validators:s.PropTypes.oneOfType([s.PropTypes.func,s.PropTypes.object]),asyncValidators:s.PropTypes.object,validateOn:s.PropTypes.oneOfType([s.PropTypes.arrayOf(s.PropTypes.string),s.PropTypes.string]),asyncValidateOn:s.PropTypes.oneOfType([s.PropTypes.arrayOf(s.PropTypes.string),s.PropTypes.string]),errors:s.PropTypes.oneOfType([s.PropTypes.func,s.PropTypes.object]),mapProps:s.PropTypes.oneOfType([s.PropTypes.func,s.PropTypes.object]),componentMap:s.PropTypes.object,dynamic:s.PropTypes.bool,dispatch:s.PropTypes.func,fieldValue:s.PropTypes.object,store:s.PropTypes.shape({subscribe:s.PropTypes.func,dispatch:s.PropTypes.func,getState:s.PropTypes.func})},K={Control:x["default"],getFieldFromState:N["default"],actions:S["default"]};t.controlPropsMap=k["default"],t.createFieldClass=l,t["default"]=l(k["default"])},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){var r=t.model,n=(0,p["default"])(r,e);return{model:n}}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),f=r(6),c=n(f),s=r(16),d=r(13),p=n(d),y=r(8),v=n(y),h={model:f.PropTypes.string.isRequired,component:f.PropTypes.any,dispatch:f.PropTypes.func,store:f.PropTypes.shape({subscribe:f.PropTypes.func,dispatch:f.PropTypes.func,getState:f.PropTypes.func})},m=function(e){function t(){return o(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),l(t,[{key:"getChildContext",value:function(){return{model:this.props.model}}},{key:"render",value:function(){var e=this.props.component,t=(0,v["default"])(this.props,Object.keys(h));return c["default"].createElement(e,t)}}]),t}(f.Component);m.childContextTypes={model:f.PropTypes.any},m.defaultProps={component:"div"},t["default"]=(0,s.connect)(i)(m)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(6),s=n(c),d=r(46),p=n(d),y=r(49),v=n(y),h=r(43),m=r(8),b=n(m),g=function(e){function t(e){u(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.store=e.store||(0,h.createStore)((0,v["default"])(o({},e.model,e.initialState))),r}return i(t,e),f(t,[{key:"render",value:function(){var e=(0,b["default"])(this.props,["store","initialState"]);return s["default"].createElement(p["default"],l({store:this.store},e))}}]),t}(s["default"].Component);g.defaultProps={initialState:{},model:"local"},t["default"]=g},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=["badInput","customError","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing"];t["default"]=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return u({},e,{get valid(){return(0,i["default"])(e)},get pending(){return(0,f["default"])(e)},get touched(){return(0,s["default"])(e)},get retouched(){return(0,p["default"])(e)}})}Object.defineProperty(t,"__esModule",{value:!0}),t.isRetouched=t.isTouched=t.isPending=t.isValid=void 0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};t["default"]=o;var a=r(18),i=n(a),l=r(78),f=n(l),c=r(81),s=n(c),d=r(80),p=n(d);t.isValid=i["default"],t.isPending=f["default"],t.isTouched=s["default"],t.isRetouched=p["default"]},function(e,t){"use strict";function r(e){return!!e&&(e.$form?Object.keys(e).some(function(t){return r(e[t])}):e.pending)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t){"use strict";function r(e){return!!e&&(e.$form?Object.keys(e).every(function(t){return"$form"===t||r(e[t])}):e.pristine)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t){"use strict";function r(e){return!!e&&(e.$form?Object.keys(e).some(function(t){return r(e[t])}):e.retouched)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t){"use strict";function r(e){return!!e&&(e.$form?Object.keys(e).some(function(t){return r(e[t])}):e.touched)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t,r){var n=(0,f.getFieldAndForm)(e,r),i=a(n,1),s=i[0],p=s&&s.$form?s.$form:s,v=p.intents,m={},g={},P=void 0;switch(t.type){case l["default"].FOCUS:m={focus:!0,intents:t.silent?v:H(v,t)};break;case l["default"].BLUR:case l["default"].SET_TOUCHED:var T=(0,h["default"])(e,r).$form;m={focus:t.type!==l["default"].BLUR&&s.focus,touched:!0,retouched:!(!T||!T.submitted&&!T.submitFailed)},P={touched:!0,retouched:m.retouched};break;case l["default"].SET_UNTOUCHED:m={focus:!1,touched:!1};break;case l["default"].SET_PRISTINE:case l["default"].SET_DIRTY:var E=t.type===l["default"].SET_PRISTINE;m={pristine:E},g={pristine:E},P=function(e){return{pristine:(0,b["default"])(e)}};break;case l["default"].SET_VALIDATING:m={validating:t.validating,validated:!t.validating};break;case l["default"].SET_VALIDITY:case l["default"].SET_ERRORS:var w,M=t.type===l["default"].SET_ERRORS,F=M?t.errors:t.validity,I=(0,O["default"])(F)?(0,j["default"])(F,S["default"]):!F,$=!s||!s.$form||(0,V.fieldsValid)(s);w={},o(w,M?"errors":"validity",F),o(w,M?"validity":"errors",I),o(w,"validating",!1),o(w,"validated",!0),o(w,"valid",$&&(M?!(0,A["default"])(F):(0,k["default"])(F))),m=w,P=function(e){return{valid:(0,x["default"])(e)}};break;case l["default"].SET_FIELDS_VALIDITY:return(0,_["default"])(t.fieldsValidity,function(e,r){return C["default"].setValidity(r,e,t.options)}).reduce(function(e,t){return u(e,t,r.concat((0,R["default"])(t.model)))},e);case l["default"].RESET_VALIDITY:m={valid:N["default"].valid,validity:N["default"].validity,errors:N["default"].errors},g={valid:N["default"].valid,validity:N["default"].validity,errors:N["default"].errors};break;case l["default"].SET_PENDING:m={pending:t.pending,submitted:!1,submitFailed:!1,retouched:!1},P={pending:t.pending};break;case l["default"].SET_SUBMITTED:var D=!!t.submitted;m={pending:!1,submitted:D,submitFailed:!D&&p&&p.submitFailed,touched:!0,retouched:!1},g={submitted:D,submitFailed:!D&&m.submitFailed,retouched:!1};break;case l["default"].SET_SUBMIT_FAILED:m={pending:!1,submitted:p.submitted&&!t.submitFailed,submitFailed:!!t.submitFailed,touched:!0,retouched:!1},g={pending:!1,submitted:!t.submitFailed,submitFailed:!!t.submitFailed,touched:!0,retouched:!1};break;case l["default"].RESET:return(0,c["default"])(e,r,L,L);case l["default"].SET_INITIAL:return(0,c["default"])(e,r,B,B);case l["default"].ADD_INTENT:m={intents:H(v,t.intent)};break;case l["default"].CLEAR_INTENTS:m={intents:K(v,t.intent)};break;default:return e}var U=(0,c["default"])(e,r,m),q=Object.keys(g).length?(0,y["default"])(U,r,g):U,G=P?(0,d["default"])(q,r,P):q;return G}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){var r=[],n=!0,o=!1,u=void 0;try{for(var a,i=e[Symbol.iterator]();!(n=(a=i.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(l){o=!0,u=l}finally{try{!n&&i["return"]&&i["return"]()}finally{if(o)throw u}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t["default"]=u;var i=r(4),l=n(i),f=r(94),c=n(f),s=r(59),d=n(s),p=r(95),y=n(p),v=r(86),h=n(v),m=r(79),b=n(m),g=r(57),_=n(g),P=r(2),O=n(P),T=r(3),j=n(T),E=r(88),S=n(E),V=r(18),x=n(V),w=r(56),k=n(w),M=r(33),A=n(M),F=r(44),C=n(F),I=r(21),R=n(I),$=r(7),N=n($),D=r(5),U=n(D),L=function q(e,t){return(0,O["default"])(e)?"$form"===t?U["default"].assign(N["default"],{value:e.initialValue,model:e.model,intents:[{type:"validate"},{type:"load",value:e.initialValue}]}):e.$form?(0,j["default"])(e,q):U["default"].assign(N["default"],{value:e.initialValue,model:e.model,intents:[{type:"validate"},{type:"load",value:e.initialValue}]}):e},B=function(e,t){return(0,O["default"])(e)?"$form"===t?U["default"].assign(N["default"],{value:e.value,model:e.model}):e.$form?(0,j["default"])(e,L):U["default"].assign(N["default"],{value:e.value,model:e.model}):e},H=function(e,t){return e?e.some(function(e){return e.type===t.type})?e:e.concat(t):[t]},K=function(e,t){return e&&"undefined"!=typeof t?e.filter(function(e){return e.type!==t.type}):[]}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2],n=t.value,u=t.removeKeys,a=t.silent,f=t.load,c=t.model,s=e&&e.$form?e.$form:e,p={validated:!1,retouched:!!s.submitted||s.retouched,intents:[{type:"validate"}],pristine:!!a&&s.pristine,initialValue:f?n:s.initialValue};if((0,h["default"])(e.value,n))return d["default"].merge(e,p);if(u){var y=function(){var t=Array.isArray(e.$form.value),r=Array.isArray(u)?u:[u],n=void 0;return t?(n=[],Object.keys(e).forEach(function(t){~r.indexOf(+t)||"$form"===t||(n[t]=e[t])}),{v:l({},d["default"].set((0,_["default"])(n),"$form",e.$form))}):(n=l({},e),Object.keys(e).forEach(function(e){~r.indexOf(e)&&delete n[""+e]}),{v:n})}();if("object"===("undefined"==typeof y?"undefined":i(y)))return y.v}if(!Array.isArray(n)&&!(0,b["default"])(n))return d["default"].merge(e,d["default"].set(p,"value",n));var v=(0,O["default"])(n,function(t,n){var u=e[n]||(0,T.createInitialState)(""+(r?r+".":"")+c+"."+n,t);return Object.hasOwnProperty.call(u,"$form")?o(u,{model:n,value:t},r?r+"."+c:c):(0,h["default"])(t,u.value)?u:d["default"].merge(u,d["default"].assign(p,{value:t,initialValue:f?t:u.initialValue}))}),m=d["default"].merge(e.$form||E["default"],d["default"].set(p,"retouched",e.submitted||e.$form&&e.$form.retouched));return d["default"].set(v,"$form",d["default"].set(m,"value",n))}function u(e){if(e&&!e.$form)return e.initialValue;var t=(0,O["default"])(e,function(e,t){if("$form"!==t)return u(e)});return delete t.$form,t}function a(e,t,r){if(t.type!==c["default"].CHANGE)return e;var n=(0,y["default"])(e,r,(0,T.createInitialState)(t.model,t.value)),a=o(n,t);if(!r.length)return a;var i=d["default"].setIn(e,r,a);return t.silent?(0,V["default"])(i,r,function(e){var t=u(e);return{value:t,initialValue:t}}):(0,V["default"])(i,r,{pristine:!1})}Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};t["default"]=a;var f=r(4),c=n(f),s=r(5),d=n(s),p=r(1),y=n(p),v=r(9),h=n(v),m=r(2),b=n(m),g=r(150),_=n(g),P=r(3),O=n(P),T=r(19),j=r(7),E=n(j),S=r(59),V=n(S)},function(e,t){"use strict";function r(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e,r){return t.reduceRight(function(e,t){return t(e,r)},e)}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t){"use strict";function r(e,t){var r=void 0;return Object.keys(e).some(function(n){var o=t(e[n],n,e);return!!o&&(r=n,!0)}),r}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r=t.slice(0,-1);return r.length?(0,a["default"])(e,r):e}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var u=r(1),a=n(u)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r=(0,i["default"])(e,t,f["default"]);return"$form"in r?r.$form:r}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var u=r(2),a=(n(u),r(1)),i=n(a),l=r(7),f=n(l)},function(e,t){"use strict";function r(e){return!e}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return"function"==typeof e?function(t){return!e(t)}:(0,a["default"])(e,o)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var u=r(3),a=n(u)},function(e,t){"use strict";function r(e,t){var r=[[],[]];return e.forEach(function(n,o){t(n,o,e)?r[0].push(n):r[1].push(n)}),r}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(e===t)return!0;var r=(0,i["default"])(e),n=(0,i["default"])(t),o=n.every(function(e,t){return r[t]===e});return o}function u(e,t){if(e===t)return[];var r=(0,i["default"])(e),n=(0,i["default"])(t),o=r.reduce(function(e,t,r){return t===n[r]?e:(e.push(t),e)},[]);return o}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o,t.pathDifference=u;var a=r(69),i=n(a)},function(e,t){"use strict";function r(e){return function(t){return t&&t.persist&&t.persist(),e(t),t}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return!(0,i["default"])(e.props,t,{omitKeys:["children"]})||u.Children.count(e.props.children)!==u.Children.count(t.children)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var u=r(6),a=r(9),i=n(a)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t,r,n){if(!t.length)return s["default"].assign(e,r);if(!n)return s["default"].assocIn(e,t,r);var o=t[0];return n(1===t.length?s["default"].assoc(e,o,r):s["default"].assoc(e,o,u(e[o]||{},t.slice(1),r,n)))}function a(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return 1===e.length?o({},e[0],t):o({},e[0],a(e.slice(1),t))}function i(e,t){var r=(0,p["default"])(e,t),n=e;if(!r){var o=(0,p["default"])(e.$form.initialValue,t);n=s["default"].merge((0,h.createInitialState)(e.$form.model,a(t,o)),e),r=(0,p["default"])(n,t)}return[r,n]}function l(e,t,r,n,o){var a=i(e,t),l=f(a,2),c=l[0],d=l[1];if(!c)return e;var p=c.hasOwnProperty("$form"),y=p?s["default"].push(t,"$form"):t,h=p?c.$form:c,m="function"==typeof r?r(h):r;if(p&&n){var b=(0,v["default"])(c,function(e,t){if("$form"===t)return s["default"].assign(h,m);var r="function"==typeof n?n(e,m):n;return s["default"].assign(e,r)});return t.length?u(d,t,b,o):b}return u(d,y,s["default"].assign(h,m),o)}Object.defineProperty(t,"__esModule",{value:!0});var f=function(){function e(e,t){var r=[],n=!0,o=!1,u=void 0;try{for(var a,i=e[Symbol.iterator]();!(n=(a=i.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(l){o=!0,u=l}finally{try{!n&&i["return"]&&i["return"]()}finally{if(o)throw u}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.getFieldAndForm=i,t["default"]=l;var c=r(5),s=n(c),d=r(1),p=n(d),y=r(3),v=n(y),h=r(19)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(e&&e.$form){var r=function(){var r={};return Object.keys(e).forEach(function(n){"$form"===n?r.$form=c["default"].assign(e.$form,t):r[n]=o(e[n],t)}),{v:r}}();if("object"===("undefined"==typeof r?"undefined":a(r)))return r.v}return c["default"].assign(e,t)}function u(e,t,r){var n=(0,l["default"])(e,t);if(!n.$form)return e;var u={};return Object.keys(n).forEach(function(e){"$form"===e?u.$form=n.$form:u[e]=o(n[e],r)}),t.length?c["default"].assocIn(e,t,u):u}Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};t["default"]=u;var i=r(1),l=n(i),f=r(5),c=n(f)},function(e,t){"use strict";function r(e,t){return e===t?0!==e||0!==t||1/e===1/t:e!==e&&t!==t}function n(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),u=Object.keys(t);if(n.length!==u.length)return!1;for(var a=0;a<n.length;a++)if(!o.call(t,n[a])||!r(e[n[a]],t[n[a]]))return!1;return!0}var o=Object.prototype.hasOwnProperty;e.exports=n},function(e,t,r){function n(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var o=r(127),u=r(128),a=r(129),i=r(130),l=r(131);n.prototype.clear=o,n.prototype["delete"]=u,n.prototype.get=a,n.prototype.has=i,n.prototype.set=l,e.exports=n},function(e,t,r){function n(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var o=r(138),u=r(139),a=r(140),i=r(141),l=r(142);n.prototype.clear=o,n.prototype["delete"]=u,n.prototype.get=a,n.prototype.has=i,n.prototype.set=l,e.exports=n},function(e,t,r){var n=r(63),o=r(38),u=n(o,"Map");e.exports=u},function(e,t,r){function n(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var o=r(143),u=r(144),a=r(145),i=r(146),l=r(147);n.prototype.clear=o,n.prototype["delete"]=u,n.prototype.get=a,n.prototype.has=i,n.prototype.set=l,e.exports=n},function(e,t){function r(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}e.exports=r},function(e,t,r){function n(e,t){var r=a(e)||u(e)?o(e.length,String):[],n=r.length,l=!!n;for(var c in e)!t&&!f.call(e,c)||l&&("length"==c||i(c,n))||r.push(c);return r}var o=r(118),u=r(67),a=r(10),i=r(133),l=Object.prototype,f=l.hasOwnProperty;e.exports=n},function(e,t){function r(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}e.exports=r},function(e,t){function r(e,t){for(var r=-1,n=e?e.length:0;++r<n;)if(t(e[r],r,e))return!0;return!1}e.exports=r},function(e,t){function r(e,t,r){return e===e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}e.exports=r},function(e,t,r){function n(e,t){var r=!0;return o(e,function(e,n,o){return r=!!t(e,n,o)}),r}var o=r(37);e.exports=n},function(e,t,r){function n(e,t,r,a,i){var l=-1,f=e.length;for(r||(r=u),i||(i=[]);++l<f;){var c=e[l];t>0&&r(c)?t>1?n(c,t-1,r,a,i):o(i,c):a||(i[i.length]=c)}return i}var o=r(103),u=r(132);e.exports=n},function(e,t,r){var n=r(123),o=n();e.exports=o},function(e,t,r){function n(e,t){return e&&o(e,t,u)}var o=r(108),u=r(155);e.exports=n},function(e,t,r){function n(e,t){t=u(t,e)?[t]:o(t);for(var r=0,n=t.length;null!=e&&r<n;)e=e[a(t[r++])];return r&&r==n?e:void 0}var o=r(119),u=r(134),a=r(39);e.exports=n},function(e,t,r){function n(e){if(!i(e)||a(e))return!1;var t=o(e)||u(e)?v:c;return t.test(l(e))}var o=r(68),u=r(64),a=r(136),i=r(41),l=r(149),f=/[\\^$.*+?()[\]{}|]/g,c=/^\[object .+?Constructor\]$/,s=Function.prototype,d=Object.prototype,p=s.toString,y=d.hasOwnProperty,v=RegExp("^"+p.call(y).replace(f,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=n},function(e,t,r){function n(e){if(!o(e))return u(e);var t=[];for(var r in Object(e))i.call(e,r)&&"constructor"!=r&&t.push(r);return t}var o=r(137),u=r(148),a=Object.prototype,i=a.hasOwnProperty;e.exports=n},function(e,t,r){function n(e,t){var r=-1,n=u(e)?Array(e.length):[];return o(e,function(e,o,u){n[++r]=t(e,o,u)}),n}var o=r(37),u=r(26);e.exports=n},function(e,t,r){function n(e,t){return e=Object(e),o(e,t,function(t,r){return r in e})}var o=r(115);e.exports=n},function(e,t){function r(e,t,r){for(var n=-1,o=t.length,u={};++n<o;){var a=t[n],i=e[a];r(i,a)&&(u[a]=i)}return u}e.exports=r},function(e,t,r){function n(e,t){return t=u(void 0===t?e.length-1:t,0),function(){for(var r=arguments,n=-1,a=u(r.length-t,0),i=Array(a);++n<a;)i[n]=r[t+n];n=-1;for(var l=Array(t+1);++n<t;)l[n]=r[n];return l[t]=i,o(e,this,l)}}var o=r(101),u=Math.max;e.exports=n},function(e,t,r){function n(e,t){var r;return o(e,function(e,n,o){return r=t(e,n,o),!r}),!!r}var o=r(37);e.exports=n},function(e,t){function r(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}e.exports=r},function(e,t,r){function n(e){return o(e)?e:u(e)}var o=r(10),u=r(66);e.exports=n},function(e,t){function r(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}e.exports=r},function(e,t,r){var n=r(38),o=n["__core-js_shared__"];e.exports=o},function(e,t,r){function n(e,t){return function(r,n){if(null==r)return r;if(!o(r))return e(r,n);for(var u=r.length,a=t?u:-1,i=Object(r);(t?a--:++a<u)&&n(i[a],a,i)!==!1;);return r}}var o=r(26);e.exports=n},function(e,t){function r(e){return function(t,r,n){for(var o=-1,u=Object(t),a=n(t),i=a.length;i--;){var l=a[e?i:++o];if(r(u[l],l,u)===!1)break}return t}}e.exports=r},function(e,t){(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(t,function(){return this}())},function(e,t,r){var n=r(65),o=n(Object.getPrototypeOf,Object);e.exports=o},function(e,t){function r(e,t){return null==e?void 0:e[t]}e.exports=r},function(e,t,r){function n(){this.__data__=o?o(null):{}}var o=r(25);e.exports=n},function(e,t){function r(e){return this.has(e)&&delete this.__data__[e]}e.exports=r},function(e,t,r){function n(e){var t=this.__data__;if(o){var r=t[e];return r===u?void 0:r}return i.call(t,e)?t[e]:void 0}var o=r(25),u="__lodash_hash_undefined__",a=Object.prototype,i=a.hasOwnProperty;e.exports=n},function(e,t,r){function n(e){var t=this.__data__;return o?void 0!==t[e]:a.call(t,e)}var o=r(25),u=Object.prototype,a=u.hasOwnProperty;e.exports=n},function(e,t,r){function n(e,t){var r=this.__data__;return r[e]=o&&void 0===t?u:t,this}var o=r(25),u="__lodash_hash_undefined__";e.exports=n},function(e,t,r){function n(e){return a(e)||u(e)||!!(i&&e&&e[i])}var o=r(61),u=r(67),a=r(10),i=o?o.isConcatSpreadable:void 0;e.exports=n},function(e,t){function r(e,t){return t=null==t?n:t,!!t&&("number"==typeof e||o.test(e))&&e>-1&&e%1==0&&e<t}var n=9007199254740991,o=/^(?:0|[1-9]\d*)$/;e.exports=r},function(e,t,r){function n(e,t){if(o(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!u(e))||i.test(e)||!a.test(e)||null!=t&&e in Object(t)}var o=r(10),u=r(15),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;e.exports=n},function(e,t){function r(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}e.exports=r},function(e,t,r){function n(e){return!!u&&u in e}var o=r(121),u=function(){var e=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=n},function(e,t){function r(e){var t=e&&e.constructor,r="function"==typeof t&&t.prototype||n;return e===r}var n=Object.prototype;e.exports=r},function(e,t){function r(){this.__data__=[]}e.exports=r},function(e,t,r){function n(e){var t=this.__data__,r=o(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():a.call(t,r,1),!0}var o=r(23),u=Array.prototype,a=u.splice;e.exports=n},function(e,t,r){function n(e){var t=this.__data__,r=o(t,e);return r<0?void 0:t[r][1]}var o=r(23);e.exports=n},function(e,t,r){function n(e){return o(this.__data__,e)>-1}var o=r(23);e.exports=n},function(e,t,r){function n(e,t){var r=this.__data__,n=o(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}var o=r(23);e.exports=n},function(e,t,r){function n(){this.__data__={hash:new o,map:new(a||u),string:new o}}var o=r(97),u=r(98),a=r(99);e.exports=n},function(e,t,r){function n(e){return o(this,e)["delete"](e)}var o=r(24);e.exports=n},function(e,t,r){function n(e){return o(this,e).get(e)}var o=r(24);e.exports=n},function(e,t,r){function n(e){return o(this,e).has(e)}var o=r(24);e.exports=n},function(e,t,r){function n(e,t){return o(this,e).set(e,t),this}var o=r(24);e.exports=n},function(e,t,r){var n=r(65),o=n(Object.keys,Object);e.exports=o},function(e,t){function r(e){if(null!=e){try{return o.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var n=Function.prototype,o=n.toString;e.exports=r},function(e,t){function r(e){for(var t=-1,r=e?e.length:0,n=0,o=[];++t<r;){var u=e[t];u&&(o[n++]=u)}return o}e.exports=r},function(e,t){function r(e,t){return e===t||e!==e&&t!==t}e.exports=r},function(e,t,r){function n(e,t,r){var n=null==e?void 0:o(e,t);return void 0===n?r:n}var o=r(110);e.exports=n},function(e,t,r){function n(e){return u(e)&&o(e)}var o=r(26),u=r(42);e.exports=n},function(e,t){function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}var n=9007199254740991;e.exports=r},function(e,t,r){function n(e){return a(e)?o(e):u(e)}var o=r(102),u=r(112),a=r(26);e.exports=n},function(e,t,r){function n(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(u);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],u=r.cache;if(u.has(o))return u.get(o);var a=e.apply(this,n);return r.cache=u.set(o,a),a};return r.cache=new(n.Cache||o),r}var o=r(100),u="Expected a function";n.Cache=o,e.exports=n},function(e,t,r){var n=r(36),o=r(107),u=r(114),a=r(116),i=r(39),l=a(function(e,t){return null==e?{}:u(e,n(o(t,1),i))});e.exports=l},function(e,t,r){function n(e){if(!e)return 0===e?e:0;if(e=o(e),e===u||e===-u){var t=e<0?-1:1;return t*a}return e===e?e:0}var o=r(160),u=1/0,a=1.7976931348623157e308;e.exports=n},function(e,t,r){function n(e){var t=o(e),r=t%1;return t===t?r?t-r:t:0}var o=r(158);e.exports=n},function(e,t,r){function n(e){if("number"==typeof e)return e;if(u(e))return a;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var r=f.test(e);return r||c.test(e)?s(e.slice(2),r?2:8):l.test(e)?a:+e}var o=r(41),u=r(15),a=NaN,i=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=n},function(e,t,r){"use strict";function n(e,t,r){return!o(e.props,t)||!o(e.state,r)}var o=r(96);e.exports=n},function(e,t){e.exports=n}])});
x112358/cdnjs
ajax/libs/react-redux-form/1.3.1/ReactReduxForm.min.js
JavaScript
mit
94,414
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("react")); else if(typeof define === 'function' && define.amd) define(["react"], factory); else if(typeof exports === 'object') exports["Cleave"] = factory(require("react")); else root["Cleave"] = factory(root["React"]); })(this, function(__WEBPACK_EXTERNAL_MODULE_1__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } var React = __webpack_require__(1); var NumeralFormatter = __webpack_require__(2); var DateFormatter = __webpack_require__(3); var PhoneFormatter = __webpack_require__(4); var CreditCardDetector = __webpack_require__(5); var Util = __webpack_require__(6); var DefaultProperties = __webpack_require__(7); var Cleave = React.createClass({ displayName: 'Cleave', componentDidMount: function componentDidMount() { this.init(); }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { var owner = this, phoneRegionCode = nextProps.options.phoneRegionCode, newValue = nextProps.value; if (newValue !== undefined) { newValue = newValue.toString(); if (newValue !== owner.properties.initValue) { owner.properties.initValue = newValue; owner.onInput(newValue); } } // update phone region code if (phoneRegionCode && phoneRegionCode !== owner.properties.phoneRegionCode) { owner.properties.phoneRegionCode = phoneRegionCode; owner.initPhoneFormatter(); owner.onInput(owner.properties.result); } }, getInitialState: function getInitialState() { var owner = this; var _owner$props = owner.props; var value = _owner$props.value; var options = _owner$props.options; var onKeyDown = _owner$props.onKeyDown; var onChange = _owner$props.onChange; var onInit = _owner$props.onInit; owner.registeredEvents = { onInit: onInit || Util.noop, onChange: onChange || Util.noop, onKeyDown: onKeyDown || Util.noop }; options.initValue = value; owner.properties = DefaultProperties.assign({}, options); return { value: owner.properties.result }; }, init: function init() { var owner = this, pps = owner.properties; // so no need for this lib at all if (!pps.numeral && !pps.phone && !pps.creditCard && !pps.date && pps.blocksLength === 0 && !pps.prefix) { return; } pps.maxLength = Util.getMaxLength(pps.blocks); owner.initPhoneFormatter(); owner.initDateFormatter(); owner.initNumeralFormatter(); owner.onInput(pps.initValue); owner.registeredEvents.onInit(owner); }, initNumeralFormatter: function initNumeralFormatter() { var owner = this, pps = owner.properties; if (!pps.numeral) { return; } pps.numeralFormatter = new NumeralFormatter(pps.numeralDecimalMark, pps.numeralDecimalScale, pps.numeralThousandsGroupStyle, pps.numeralPositiveOnly, pps.delimiter); }, initDateFormatter: function initDateFormatter() { var owner = this, pps = owner.properties; if (!pps.date) { return; } pps.dateFormatter = new DateFormatter(pps.datePattern); pps.blocks = pps.dateFormatter.getBlocks(); pps.blocksLength = pps.blocks.length; pps.maxLength = Util.getMaxLength(pps.blocks); }, initPhoneFormatter: function initPhoneFormatter() { var owner = this, pps = owner.properties; if (!pps.phone) { return; } // Cleave.AsYouTypeFormatter should be provided by // external google closure lib try { pps.phoneFormatter = new PhoneFormatter(new pps.root.Cleave.AsYouTypeFormatter(pps.phoneRegionCode), pps.delimiter); } catch (ex) { throw new Error('Please include phone-type-formatter.{country}.js lib'); } }, setRawValue: function setRawValue(value) { var owner = this, pps = owner.properties; value = value !== undefined ? value.toString() : ''; if (pps.numeral) { value = value.replace('.', pps.numeralDecimalMark); } owner.onChange({ target: { value: value } }); }, onInit: function onInit(owner) { return owner; }, onKeyDown: function onKeyDown(event) { var owner = this, pps = owner.properties, charCode = event.which || event.keyCode; // hit backspace when last character is delimiter if (charCode === 8 && Util.isDelimiter(pps.result.slice(-1), pps.delimiter, pps.delimiters)) { pps.backspace = true; } else { pps.backspace = false; } owner.registeredEvents.onKeyDown(event); }, onChange: function onChange(event) { var owner = this, pps = owner.properties, rawValue; owner.onInput(event.target.value); rawValue = pps.result; if (pps.rawValueTrimPrefix) { rawValue = Util.getPrefixStrippedValue(rawValue, pps.prefix, pps.prefixLength); } if (pps.numeral) { rawValue = pps.numeralFormatter.getRawValue(rawValue); } else { rawValue = Util.stripDelimiters(rawValue, pps.delimiter, pps.delimiters); } event.target.rawValue = rawValue; event.target.value = pps.result; owner.registeredEvents.onChange(event); }, onInput: function onInput(value) { var owner = this, pps = owner.properties, prev = pps.result; // case 1: delete one more character "4" // 1234*| -> hit backspace -> 123| // case 2: last character is not delimiter which is: // 12|34* -> hit backspace -> 1|34* if (!pps.numeral && pps.backspace && !Util.isDelimiter(value.slice(-1), pps.delimiter, pps.delimiters)) { value = Util.headStr(value, value.length - 1); } // phone formatter if (pps.phone) { pps.result = pps.phoneFormatter.format(value); owner.updateValueState(); return; } // numeral formatter if (pps.numeral) { pps.result = pps.prefix + pps.numeralFormatter.format(value); owner.updateValueState(); return; } // date if (pps.date) { value = pps.dateFormatter.getValidatedDate(value); } // strip delimiters value = Util.stripDelimiters(value, pps.delimiter, pps.delimiters); // strip prefix value = Util.getPrefixStrippedValue(value, pps.prefix, pps.prefixLength); // strip non-numeric characters value = pps.numericOnly ? Util.strip(value, /[^\d]/g) : value; // convert case value = pps.uppercase ? value.toUpperCase() : value; value = pps.lowercase ? value.toLowerCase() : value; // prefix if (pps.prefix) { value = pps.prefix + value; // no blocks specified, no need to do formatting if (pps.blocksLength === 0) { pps.result = value; owner.updateValueState(); return; } } // update credit card props if (pps.creditCard) { owner.updateCreditCardPropsByValue(value); } // strip over length characters value = Util.headStr(value, pps.maxLength); // apply blocks pps.result = Util.getFormattedValue(value, pps.blocks, pps.blocksLength, pps.delimiter, pps.delimiters); // nothing changed // prevent update value to avoid caret position change if (prev === pps.result && prev !== pps.prefix) { return; } owner.updateValueState(); }, updateCreditCardPropsByValue: function updateCreditCardPropsByValue(value) { var owner = this, pps = owner.properties, creditCardInfo; // At least one of the first 4 characters has changed if (Util.headStr(pps.result, 4) === Util.headStr(value, 4)) { return; } creditCardInfo = CreditCardDetector.getInfo(value, pps.creditCardStrictMode); pps.blocks = creditCardInfo.blocks; pps.blocksLength = pps.blocks.length; pps.maxLength = Util.getMaxLength(pps.blocks); // credit card type changed if (pps.creditCardType !== creditCardInfo.type) { pps.creditCardType = creditCardInfo.type; pps.onCreditCardTypeChanged.call(owner, pps.creditCardType); } }, updateValueState: function updateValueState() { this.setState({ value: this.properties.result }); }, render: function render() { var owner = this; var _owner$props2 = owner.props; var value = _owner$props2.value; var options = _owner$props2.options; var onKeyDown = _owner$props2.onKeyDown; var onChange = _owner$props2.onChange; var onInit = _owner$props2.onInit; var htmlRef = _owner$props2.htmlRef; var propsToTransfer = _objectWithoutProperties(_owner$props2, ['value', 'options', 'onKeyDown', 'onChange', 'onInit', 'htmlRef']); return React.createElement('input', _extends({ type: 'text', ref: htmlRef, value: owner.state.value, onKeyDown: owner.onKeyDown, onChange: owner.onChange }, propsToTransfer, { 'data-cleave-ignore': [value, options, onKeyDown, onChange, onInit, htmlRef] })); } }); module.exports = Cleave; /***/ }, /* 1 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_1__; /***/ }, /* 2 */ /***/ function(module, exports) { 'use strict'; var NumeralFormatter = function NumeralFormatter(numeralDecimalMark, numeralDecimalScale, numeralThousandsGroupStyle, numeralPositiveOnly, delimiter) { var owner = this; owner.numeralDecimalMark = numeralDecimalMark || '.'; owner.numeralDecimalScale = numeralDecimalScale >= 0 ? numeralDecimalScale : 2; owner.numeralThousandsGroupStyle = numeralThousandsGroupStyle || NumeralFormatter.groupStyle.thousand; owner.numeralPositiveOnly = !!numeralPositiveOnly; owner.delimiter = delimiter || delimiter === '' ? delimiter : ','; owner.delimiterRE = delimiter ? new RegExp('\\' + delimiter, 'g') : ''; }; NumeralFormatter.groupStyle = { thousand: 'thousand', lakh: 'lakh', wan: 'wan' }; NumeralFormatter.prototype = { getRawValue: function getRawValue(value) { return value.replace(this.delimiterRE, '').replace(this.numeralDecimalMark, '.'); }, format: function format(value) { var owner = this, parts, partInteger, partDecimal = ''; // strip alphabet letters value = value.replace(/[A-Za-z]/g, '') // replace the first decimal mark with reserved placeholder .replace(owner.numeralDecimalMark, 'M') // strip non numeric letters except minus and "M" // this is to ensure prefix has been stripped .replace(/[^\dM-]/g, '') // replace the leading minus with reserved placeholder .replace(/^\-/, 'N') // strip the other minus sign (if present) .replace(/\-/g, '') // replace the minus sign (if present) .replace('N', owner.numeralPositiveOnly ? '' : '-') // replace decimal mark .replace('M', owner.numeralDecimalMark) // strip any leading zeros .replace(/^(-)?0+(?=\d)/, '$1'); partInteger = value; if (value.indexOf(owner.numeralDecimalMark) >= 0) { parts = value.split(owner.numeralDecimalMark); partInteger = parts[0]; partDecimal = owner.numeralDecimalMark + parts[1].slice(0, owner.numeralDecimalScale); } switch (owner.numeralThousandsGroupStyle) { case NumeralFormatter.groupStyle.lakh: partInteger = partInteger.replace(/(\d)(?=(\d\d)+\d$)/g, '$1' + owner.delimiter); break; case NumeralFormatter.groupStyle.wan: partInteger = partInteger.replace(/(\d)(?=(\d{4})+$)/g, '$1' + owner.delimiter); break; default: partInteger = partInteger.replace(/(\d)(?=(\d{3})+$)/g, '$1' + owner.delimiter); } return partInteger.toString() + (owner.numeralDecimalScale > 0 ? partDecimal.toString() : ''); } }; module.exports = NumeralFormatter; /***/ }, /* 3 */ /***/ function(module, exports) { 'use strict'; var DateFormatter = function DateFormatter(datePattern) { var owner = this; owner.blocks = []; owner.datePattern = datePattern; owner.initBlocks(); }; DateFormatter.prototype = { initBlocks: function initBlocks() { var owner = this; owner.datePattern.forEach(function (value) { if (value === 'Y') { owner.blocks.push(4); } else { owner.blocks.push(2); } }); }, getBlocks: function getBlocks() { return this.blocks; }, getValidatedDate: function getValidatedDate(value) { var owner = this, result = ''; value = value.replace(/[^\d]/g, ''); owner.blocks.forEach(function (length, index) { if (value.length > 0) { var sub = value.slice(0, length), sub0 = sub.slice(0, 1), rest = value.slice(length); switch (owner.datePattern[index]) { case 'd': if (sub === '00') { sub = '01'; } else if (parseInt(sub0, 10) > 3) { sub = '0' + sub0; } else if (parseInt(sub, 10) > 31) { sub = '31'; } break; case 'm': if (sub === '00') { sub = '01'; } else if (parseInt(sub0, 10) > 1) { sub = '0' + sub0; } else if (parseInt(sub, 10) > 12) { sub = '12'; } break; } result += sub; // update remaining string value = rest; } }); return result; } }; module.exports = DateFormatter; /***/ }, /* 4 */ /***/ function(module, exports) { 'use strict'; var PhoneFormatter = function PhoneFormatter(formatter, delimiter) { var owner = this; owner.delimiter = delimiter || delimiter === '' ? delimiter : ' '; owner.delimiterRE = delimiter ? new RegExp('\\' + delimiter, 'g') : ''; owner.formatter = formatter; }; PhoneFormatter.prototype = { setFormatter: function setFormatter(formatter) { this.formatter = formatter; }, format: function format(phoneNumber) { var owner = this; owner.formatter.clear(); // only keep number and + phoneNumber = phoneNumber.replace(/[^\d+]/g, ''); // strip delimiter phoneNumber = phoneNumber.replace(owner.delimiterRE, ''); var result = '', current, validated = false; for (var i = 0, iMax = phoneNumber.length; i < iMax; i++) { current = owner.formatter.inputDigit(phoneNumber.charAt(i)); // has ()- or space inside if (/[\s()-]/g.test(current)) { result = current; validated = true; } else { if (!validated) { result = current; } // else: over length input // it turns to invalid number again } } // strip () // e.g. US: 7161234567 returns (716) 123-4567 result = result.replace(/[()]/g, ''); // replace library delimiter with user customized delimiter result = result.replace(/[\s-]/g, owner.delimiter); return result; } }; module.exports = PhoneFormatter; /***/ }, /* 5 */ /***/ function(module, exports) { 'use strict'; var CreditCardDetector = { blocks: { uatp: [4, 5, 6], amex: [4, 6, 5], diners: [4, 6, 4], discover: [4, 4, 4, 4], mastercard: [4, 4, 4, 4], dankort: [4, 4, 4, 4], instapayment: [4, 4, 4, 4], jcb: [4, 4, 4, 4], maestro: [4, 4, 4, 4], visa: [4, 4, 4, 4], general: [4, 4, 4, 4], generalStrict: [4, 4, 4, 7] }, re: { // starts with 1; 15 digits, not starts with 1800 (jcb card) uatp: /^(?!1800)1\d{0,14}/, // starts with 34/37; 15 digits amex: /^3[47]\d{0,13}/, // starts with 6011/65/644-649; 16 digits discover: /^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/, // starts with 300-305/309 or 36/38/39; 14 digits diners: /^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/, // starts with 51-55/22-27; 16 digits mastercard: /^(5[1-5]|2[2-7])\d{0,14}/, // starts with 5019/4175/4571; 16 digits dankort: /^(5019|4175|4571)\d{0,12}/, // starts with 637-639; 16 digits instapayment: /^63[7-9]\d{0,13}/, // starts with 2131/1800/35; 16 digits jcb: /^(?:2131|1800|35\d{0,2})\d{0,12}/, // starts with 50/56-58/6304/67; 16 digits maestro: /^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/, // starts with 4; 16 digits visa: /^4\d{0,15}/ }, getInfo: function getInfo(value, strictMode) { var blocks = CreditCardDetector.blocks, re = CreditCardDetector.re; // In theory, visa credit card can have up to 19 digits number. // Set strictMode to true will remove the 16 max-length restrain, // however, I never found any website validate card number like // this, hence probably you don't need to enable this option. strictMode = !!strictMode; if (re.amex.test(value)) { return { type: 'amex', blocks: blocks.amex }; } else if (re.uatp.test(value)) { return { type: 'uatp', blocks: blocks.uatp }; } else if (re.diners.test(value)) { return { type: 'diners', blocks: blocks.diners }; } else if (re.discover.test(value)) { return { type: 'discover', blocks: blocks.discover }; } else if (re.mastercard.test(value)) { return { type: 'mastercard', blocks: blocks.mastercard }; } else if (re.dankort.test(value)) { return { type: 'dankort', blocks: blocks.dankort }; } else if (re.instapayment.test(value)) { return { type: 'instapayment', blocks: blocks.instapayment }; } else if (re.jcb.test(value)) { return { type: 'jcb', blocks: blocks.jcb }; } else if (re.maestro.test(value)) { return { type: 'maestro', blocks: blocks.maestro }; } else if (re.visa.test(value)) { return { type: 'visa', blocks: strictMode ? blocks.generalStrict : blocks.visa }; } else { return { type: 'unknown', blocks: blocks.general }; } } }; module.exports = CreditCardDetector; /***/ }, /* 6 */ /***/ function(module, exports) { 'use strict'; var Util = { noop: function noop() {}, strip: function strip(value, re) { return value.replace(re, ''); }, isDelimiter: function isDelimiter(letter, delimiter, delimiters) { // single delimiter if (delimiters.length === 0) { return letter === delimiter; } // multiple delimiters return delimiters.some(function (current) { if (letter === current) { return true; } }); }, stripDelimiters: function stripDelimiters(value, delimiter, delimiters) { // single delimiter if (delimiters.length === 0) { var delimiterRE = delimiter ? new RegExp('\\' + delimiter, 'g') : ''; return value.replace(delimiterRE, ''); } // multiple delimiters delimiters.forEach(function (current) { value = value.replace(new RegExp('\\' + current, 'g'), ''); }); return value; }, headStr: function headStr(str, length) { return str.slice(0, length); }, getMaxLength: function getMaxLength(blocks) { return blocks.reduce(function (previous, current) { return previous + current; }, 0); }, // strip value by prefix length // for prefix: PRE // (PRE123, 3) -> 123 // (PR123, 3) -> 23 this happens when user hits backspace in front of "PRE" getPrefixStrippedValue: function getPrefixStrippedValue(value, prefix, prefixLength) { if (value.slice(0, prefixLength) !== prefix) { var diffIndex = this.getFirstDiffIndex(prefix, value.slice(0, prefixLength)); value = prefix + value.slice(diffIndex, diffIndex + 1) + value.slice(prefixLength + 1); } return value.slice(prefixLength); }, getFirstDiffIndex: function getFirstDiffIndex(prev, current) { var index = 0; while (prev.charAt(index) === current.charAt(index)) { if (prev.charAt(index++) === '') return -1; }return index; }, getFormattedValue: function getFormattedValue(value, blocks, blocksLength, delimiter, delimiters) { var result = '', multipleDelimiters = delimiters.length > 0, currentDelimiter; blocks.forEach(function (length, index) { if (value.length > 0) { var sub = value.slice(0, length), rest = value.slice(length); result += sub; currentDelimiter = multipleDelimiters ? delimiters[index] || currentDelimiter : delimiter; if (sub.length === length && index < blocksLength - 1) { result += currentDelimiter; } // update remaining string value = rest; } }); return result; } }; module.exports = Util; /***/ }, /* 7 */ /***/ function(module, exports) { /* WEBPACK VAR INJECTION */(function(global) {'use strict'; /** * Props Assignment * * Separate this, so react module can share the usage */ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; var DefaultProperties = { // Maybe change to object-assign // for now just keep it as simple assign: function assign(target, opts) { target = target || {}; opts = opts || {}; // credit card target.creditCard = !!opts.creditCard; target.creditCardStrictMode = !!opts.creditCardStrictMode; target.creditCardType = ''; target.onCreditCardTypeChanged = opts.onCreditCardTypeChanged || function () {}; // phone target.phone = !!opts.phone; target.phoneRegionCode = opts.phoneRegionCode || 'AU'; target.phoneFormatter = {}; // date target.date = !!opts.date; target.datePattern = opts.datePattern || ['d', 'm', 'Y']; target.dateFormatter = {}; // numeral target.numeral = !!opts.numeral; target.numeralDecimalScale = opts.numeralDecimalScale >= 0 ? opts.numeralDecimalScale : 2; target.numeralDecimalMark = opts.numeralDecimalMark || '.'; target.numeralThousandsGroupStyle = opts.numeralThousandsGroupStyle || 'thousand'; target.numeralPositiveOnly = !!opts.numeralPositiveOnly; // others target.numericOnly = target.creditCard || target.date || !!opts.numericOnly; target.uppercase = !!opts.uppercase; target.lowercase = !!opts.lowercase; target.prefix = target.creditCard || target.phone || target.date ? '' : opts.prefix || ''; target.prefixLength = target.prefix.length; target.rawValueTrimPrefix = !!opts.rawValueTrimPrefix; target.copyDelimiter = !!opts.copyDelimiter; target.initValue = opts.initValue === undefined ? '' : opts.initValue.toString(); target.delimiter = opts.delimiter || opts.delimiter === '' ? opts.delimiter : opts.date ? '/' : opts.numeral ? ',' : opts.phone ? ' ' : ' '; target.delimiters = opts.delimiters || []; target.blocks = opts.blocks || []; target.blocksLength = target.blocks.length; target.root = (typeof global === 'undefined' ? 'undefined' : _typeof(global)) === 'object' && global ? global : window; target.maxLength = 0; target.backspace = false; target.result = ''; return target; } }; module.exports = DefaultProperties; /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ } /******/ ]) }); ;
redmunds/cdnjs
ajax/libs/cleave.js/0.7.12/cleave-react.js
JavaScript
mit
28,639
<?php // This file was auto-generated from sdk-root/src/data/iot/2015-05-28/api-2.json return [ 'version' => '2.0', 'metadata' => [ 'uid' => 'iot-2015-05-28', 'apiVersion' => '2015-05-28', 'endpointPrefix' => 'iot', 'serviceFullName' => 'AWS IoT', 'signatureVersion' => 'v4', 'signingName' => 'execute-api', 'protocol' => 'rest-json', ], 'operations' => [ 'AcceptCertificateTransfer' => [ 'name' => 'AcceptCertificateTransfer', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/accept-certificate-transfer/{certificateId}', ], 'input' => [ 'shape' => 'AcceptCertificateTransferRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'TransferAlreadyCompletedException', 'error' => [ 'httpStatusCode' => 410, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'AttachPrincipalPolicy' => [ 'name' => 'AttachPrincipalPolicy', 'http' => [ 'method' => 'PUT', 'requestUri' => '/principal-policies/{policyName}', ], 'input' => [ 'shape' => 'AttachPrincipalPolicyRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'LimitExceededException', 'error' => [ 'httpStatusCode' => 410, ], 'exception' => true, ], ], ], 'AttachThingPrincipal' => [ 'name' => 'AttachThingPrincipal', 'http' => [ 'method' => 'PUT', 'requestUri' => '/things/{thingName}/principals', ], 'input' => [ 'shape' => 'AttachThingPrincipalRequest', ], 'output' => [ 'shape' => 'AttachThingPrincipalResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'CancelCertificateTransfer' => [ 'name' => 'CancelCertificateTransfer', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/cancel-certificate-transfer/{certificateId}', ], 'input' => [ 'shape' => 'CancelCertificateTransferRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'TransferAlreadyCompletedException', 'error' => [ 'httpStatusCode' => 410, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'CreateCertificateFromCsr' => [ 'name' => 'CreateCertificateFromCsr', 'http' => [ 'method' => 'POST', 'requestUri' => '/certificates', ], 'input' => [ 'shape' => 'CreateCertificateFromCsrRequest', ], 'output' => [ 'shape' => 'CreateCertificateFromCsrResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'CreateKeysAndCertificate' => [ 'name' => 'CreateKeysAndCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/keys-and-certificate', ], 'input' => [ 'shape' => 'CreateKeysAndCertificateRequest', ], 'output' => [ 'shape' => 'CreateKeysAndCertificateResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'CreatePolicy' => [ 'name' => 'CreatePolicy', 'http' => [ 'method' => 'POST', 'requestUri' => '/policies/{policyName}', ], 'input' => [ 'shape' => 'CreatePolicyRequest', ], 'output' => [ 'shape' => 'CreatePolicyResponse', ], 'errors' => [ [ 'shape' => 'ResourceAlreadyExistsException', 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], [ 'shape' => 'MalformedPolicyException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'CreatePolicyVersion' => [ 'name' => 'CreatePolicyVersion', 'http' => [ 'method' => 'POST', 'requestUri' => '/policies/{policyName}/version', ], 'input' => [ 'shape' => 'CreatePolicyVersionRequest', ], 'output' => [ 'shape' => 'CreatePolicyVersionResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'MalformedPolicyException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'VersionsLimitExceededException', 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'CreateThing' => [ 'name' => 'CreateThing', 'http' => [ 'method' => 'POST', 'requestUri' => '/things/{thingName}', ], 'input' => [ 'shape' => 'CreateThingRequest', ], 'output' => [ 'shape' => 'CreateThingResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'ResourceAlreadyExistsException', 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], ], ], 'CreateThingType' => [ 'name' => 'CreateThingType', 'http' => [ 'method' => 'POST', 'requestUri' => '/thing-types/{thingTypeName}', ], 'input' => [ 'shape' => 'CreateThingTypeRequest', ], 'output' => [ 'shape' => 'CreateThingTypeResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'ResourceAlreadyExistsException', 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], ], ], 'CreateTopicRule' => [ 'name' => 'CreateTopicRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/rules/{ruleName}', ], 'input' => [ 'shape' => 'CreateTopicRuleRequest', ], 'errors' => [ [ 'shape' => 'SqlParseException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'InternalException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ResourceAlreadyExistsException', 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], ], ], 'DeleteCACertificate' => [ 'name' => 'DeleteCACertificate', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/cacertificate/{caCertificateId}', ], 'input' => [ 'shape' => 'DeleteCACertificateRequest', ], 'output' => [ 'shape' => 'DeleteCACertificateResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'CertificateStateException', 'error' => [ 'httpStatusCode' => 406, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], ], ], 'DeleteCertificate' => [ 'name' => 'DeleteCertificate', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/certificates/{certificateId}', ], 'input' => [ 'shape' => 'DeleteCertificateRequest', ], 'errors' => [ [ 'shape' => 'CertificateStateException', 'error' => [ 'httpStatusCode' => 406, ], 'exception' => true, ], [ 'shape' => 'DeleteConflictException', 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], ], ], 'DeletePolicy' => [ 'name' => 'DeletePolicy', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/policies/{policyName}', ], 'input' => [ 'shape' => 'DeletePolicyRequest', ], 'errors' => [ [ 'shape' => 'DeleteConflictException', 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'DeletePolicyVersion' => [ 'name' => 'DeletePolicyVersion', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/policies/{policyName}/version/{policyVersionId}', ], 'input' => [ 'shape' => 'DeletePolicyVersionRequest', ], 'errors' => [ [ 'shape' => 'DeleteConflictException', 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'DeleteRegistrationCode' => [ 'name' => 'DeleteRegistrationCode', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/registrationcode', ], 'input' => [ 'shape' => 'DeleteRegistrationCodeRequest', ], 'output' => [ 'shape' => 'DeleteRegistrationCodeResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'DeleteThing' => [ 'name' => 'DeleteThing', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/things/{thingName}', ], 'input' => [ 'shape' => 'DeleteThingRequest', ], 'output' => [ 'shape' => 'DeleteThingResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'VersionConflictException', 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'DeleteThingType' => [ 'name' => 'DeleteThingType', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/thing-types/{thingTypeName}', ], 'input' => [ 'shape' => 'DeleteThingTypeRequest', ], 'output' => [ 'shape' => 'DeleteThingTypeResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'DeleteTopicRule' => [ 'name' => 'DeleteTopicRule', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/rules/{ruleName}', ], 'input' => [ 'shape' => 'DeleteTopicRuleRequest', ], 'errors' => [ [ 'shape' => 'InternalException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], ], ], 'DeprecateThingType' => [ 'name' => 'DeprecateThingType', 'http' => [ 'method' => 'POST', 'requestUri' => '/thing-types/{thingTypeName}/deprecate', ], 'input' => [ 'shape' => 'DeprecateThingTypeRequest', ], 'output' => [ 'shape' => 'DeprecateThingTypeResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'DescribeCACertificate' => [ 'name' => 'DescribeCACertificate', 'http' => [ 'method' => 'GET', 'requestUri' => '/cacertificate/{caCertificateId}', ], 'input' => [ 'shape' => 'DescribeCACertificateRequest', ], 'output' => [ 'shape' => 'DescribeCACertificateResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], ], ], 'DescribeCertificate' => [ 'name' => 'DescribeCertificate', 'http' => [ 'method' => 'GET', 'requestUri' => '/certificates/{certificateId}', ], 'input' => [ 'shape' => 'DescribeCertificateRequest', ], 'output' => [ 'shape' => 'DescribeCertificateResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], ], ], 'DescribeEndpoint' => [ 'name' => 'DescribeEndpoint', 'http' => [ 'method' => 'GET', 'requestUri' => '/endpoint', ], 'input' => [ 'shape' => 'DescribeEndpointRequest', ], 'output' => [ 'shape' => 'DescribeEndpointResponse', ], 'errors' => [ [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], ], ], 'DescribeThing' => [ 'name' => 'DescribeThing', 'http' => [ 'method' => 'GET', 'requestUri' => '/things/{thingName}', ], 'input' => [ 'shape' => 'DescribeThingRequest', ], 'output' => [ 'shape' => 'DescribeThingResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'DescribeThingType' => [ 'name' => 'DescribeThingType', 'http' => [ 'method' => 'GET', 'requestUri' => '/thing-types/{thingTypeName}', ], 'input' => [ 'shape' => 'DescribeThingTypeRequest', ], 'output' => [ 'shape' => 'DescribeThingTypeResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'DetachPrincipalPolicy' => [ 'name' => 'DetachPrincipalPolicy', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/principal-policies/{policyName}', ], 'input' => [ 'shape' => 'DetachPrincipalPolicyRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'DetachThingPrincipal' => [ 'name' => 'DetachThingPrincipal', 'http' => [ 'method' => 'DELETE', 'requestUri' => '/things/{thingName}/principals', ], 'input' => [ 'shape' => 'DetachThingPrincipalRequest', ], 'output' => [ 'shape' => 'DetachThingPrincipalResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'DisableTopicRule' => [ 'name' => 'DisableTopicRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/rules/{ruleName}/disable', ], 'input' => [ 'shape' => 'DisableTopicRuleRequest', ], 'errors' => [ [ 'shape' => 'InternalException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], ], ], 'EnableTopicRule' => [ 'name' => 'EnableTopicRule', 'http' => [ 'method' => 'POST', 'requestUri' => '/rules/{ruleName}/enable', ], 'input' => [ 'shape' => 'EnableTopicRuleRequest', ], 'errors' => [ [ 'shape' => 'InternalException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], ], ], 'GetLoggingOptions' => [ 'name' => 'GetLoggingOptions', 'http' => [ 'method' => 'GET', 'requestUri' => '/loggingOptions', ], 'input' => [ 'shape' => 'GetLoggingOptionsRequest', ], 'output' => [ 'shape' => 'GetLoggingOptionsResponse', ], 'errors' => [ [ 'shape' => 'InternalException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], ], ], 'GetPolicy' => [ 'name' => 'GetPolicy', 'http' => [ 'method' => 'GET', 'requestUri' => '/policies/{policyName}', ], 'input' => [ 'shape' => 'GetPolicyRequest', ], 'output' => [ 'shape' => 'GetPolicyResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'GetPolicyVersion' => [ 'name' => 'GetPolicyVersion', 'http' => [ 'method' => 'GET', 'requestUri' => '/policies/{policyName}/version/{policyVersionId}', ], 'input' => [ 'shape' => 'GetPolicyVersionRequest', ], 'output' => [ 'shape' => 'GetPolicyVersionResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'GetRegistrationCode' => [ 'name' => 'GetRegistrationCode', 'http' => [ 'method' => 'GET', 'requestUri' => '/registrationcode', ], 'input' => [ 'shape' => 'GetRegistrationCodeRequest', ], 'output' => [ 'shape' => 'GetRegistrationCodeResponse', ], 'errors' => [ [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], ], ], 'GetTopicRule' => [ 'name' => 'GetTopicRule', 'http' => [ 'method' => 'GET', 'requestUri' => '/rules/{ruleName}', ], 'input' => [ 'shape' => 'GetTopicRuleRequest', ], 'output' => [ 'shape' => 'GetTopicRuleResponse', ], 'errors' => [ [ 'shape' => 'InternalException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], ], ], 'ListCACertificates' => [ 'name' => 'ListCACertificates', 'http' => [ 'method' => 'GET', 'requestUri' => '/cacertificates', ], 'input' => [ 'shape' => 'ListCACertificatesRequest', ], 'output' => [ 'shape' => 'ListCACertificatesResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'ListCertificates' => [ 'name' => 'ListCertificates', 'http' => [ 'method' => 'GET', 'requestUri' => '/certificates', ], 'input' => [ 'shape' => 'ListCertificatesRequest', ], 'output' => [ 'shape' => 'ListCertificatesResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'ListCertificatesByCA' => [ 'name' => 'ListCertificatesByCA', 'http' => [ 'method' => 'GET', 'requestUri' => '/certificates-by-ca/{caCertificateId}', ], 'input' => [ 'shape' => 'ListCertificatesByCARequest', ], 'output' => [ 'shape' => 'ListCertificatesByCAResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'ListOutgoingCertificates' => [ 'name' => 'ListOutgoingCertificates', 'http' => [ 'method' => 'GET', 'requestUri' => '/certificates-out-going', ], 'input' => [ 'shape' => 'ListOutgoingCertificatesRequest', ], 'output' => [ 'shape' => 'ListOutgoingCertificatesResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'ListPolicies' => [ 'name' => 'ListPolicies', 'http' => [ 'method' => 'GET', 'requestUri' => '/policies', ], 'input' => [ 'shape' => 'ListPoliciesRequest', ], 'output' => [ 'shape' => 'ListPoliciesResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'ListPolicyPrincipals' => [ 'name' => 'ListPolicyPrincipals', 'http' => [ 'method' => 'GET', 'requestUri' => '/policy-principals', ], 'input' => [ 'shape' => 'ListPolicyPrincipalsRequest', ], 'output' => [ 'shape' => 'ListPolicyPrincipalsResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'ListPolicyVersions' => [ 'name' => 'ListPolicyVersions', 'http' => [ 'method' => 'GET', 'requestUri' => '/policies/{policyName}/version', ], 'input' => [ 'shape' => 'ListPolicyVersionsRequest', ], 'output' => [ 'shape' => 'ListPolicyVersionsResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'ListPrincipalPolicies' => [ 'name' => 'ListPrincipalPolicies', 'http' => [ 'method' => 'GET', 'requestUri' => '/principal-policies', ], 'input' => [ 'shape' => 'ListPrincipalPoliciesRequest', ], 'output' => [ 'shape' => 'ListPrincipalPoliciesResponse', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'ListPrincipalThings' => [ 'name' => 'ListPrincipalThings', 'http' => [ 'method' => 'GET', 'requestUri' => '/principals/things', ], 'input' => [ 'shape' => 'ListPrincipalThingsRequest', ], 'output' => [ 'shape' => 'ListPrincipalThingsResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], ], ], 'ListThingPrincipals' => [ 'name' => 'ListThingPrincipals', 'http' => [ 'method' => 'GET', 'requestUri' => '/things/{thingName}/principals', ], 'input' => [ 'shape' => 'ListThingPrincipalsRequest', ], 'output' => [ 'shape' => 'ListThingPrincipalsResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], ], ], 'ListThingTypes' => [ 'name' => 'ListThingTypes', 'http' => [ 'method' => 'GET', 'requestUri' => '/thing-types', ], 'input' => [ 'shape' => 'ListThingTypesRequest', ], 'output' => [ 'shape' => 'ListThingTypesResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'ListThings' => [ 'name' => 'ListThings', 'http' => [ 'method' => 'GET', 'requestUri' => '/things', ], 'input' => [ 'shape' => 'ListThingsRequest', ], 'output' => [ 'shape' => 'ListThingsResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'ListTopicRules' => [ 'name' => 'ListTopicRules', 'http' => [ 'method' => 'GET', 'requestUri' => '/rules', ], 'input' => [ 'shape' => 'ListTopicRulesRequest', ], 'output' => [ 'shape' => 'ListTopicRulesResponse', ], 'errors' => [ [ 'shape' => 'InternalException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], ], ], 'RegisterCACertificate' => [ 'name' => 'RegisterCACertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/cacertificate', ], 'input' => [ 'shape' => 'RegisterCACertificateRequest', ], 'output' => [ 'shape' => 'RegisterCACertificateResponse', ], 'errors' => [ [ 'shape' => 'ResourceAlreadyExistsException', 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], [ 'shape' => 'RegistrationCodeValidationException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'CertificateValidationException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'LimitExceededException', 'error' => [ 'httpStatusCode' => 410, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'RegisterCertificate' => [ 'name' => 'RegisterCertificate', 'http' => [ 'method' => 'POST', 'requestUri' => '/certificate/register', ], 'input' => [ 'shape' => 'RegisterCertificateRequest', ], 'output' => [ 'shape' => 'RegisterCertificateResponse', ], 'errors' => [ [ 'shape' => 'ResourceAlreadyExistsException', 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'CertificateValidationException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'CertificateStateException', 'error' => [ 'httpStatusCode' => 406, ], 'exception' => true, ], [ 'shape' => 'CertificateConflictException', 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'RejectCertificateTransfer' => [ 'name' => 'RejectCertificateTransfer', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/reject-certificate-transfer/{certificateId}', ], 'input' => [ 'shape' => 'RejectCertificateTransferRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'TransferAlreadyCompletedException', 'error' => [ 'httpStatusCode' => 410, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'ReplaceTopicRule' => [ 'name' => 'ReplaceTopicRule', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/rules/{ruleName}', ], 'input' => [ 'shape' => 'ReplaceTopicRuleRequest', ], 'errors' => [ [ 'shape' => 'SqlParseException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'InternalException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], ], ], 'SetDefaultPolicyVersion' => [ 'name' => 'SetDefaultPolicyVersion', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/policies/{policyName}/version/{policyVersionId}', ], 'input' => [ 'shape' => 'SetDefaultPolicyVersionRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'SetLoggingOptions' => [ 'name' => 'SetLoggingOptions', 'http' => [ 'method' => 'POST', 'requestUri' => '/loggingOptions', ], 'input' => [ 'shape' => 'SetLoggingOptionsRequest', ], 'errors' => [ [ 'shape' => 'InternalException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], ], ], 'TransferCertificate' => [ 'name' => 'TransferCertificate', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/transfer-certificate/{certificateId}', ], 'input' => [ 'shape' => 'TransferCertificateRequest', ], 'output' => [ 'shape' => 'TransferCertificateResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'CertificateStateException', 'error' => [ 'httpStatusCode' => 406, ], 'exception' => true, ], [ 'shape' => 'TransferConflictException', 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'UpdateCACertificate' => [ 'name' => 'UpdateCACertificate', 'http' => [ 'method' => 'PUT', 'requestUri' => '/cacertificate/{caCertificateId}', ], 'input' => [ 'shape' => 'UpdateCACertificateRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'UpdateCertificate' => [ 'name' => 'UpdateCertificate', 'http' => [ 'method' => 'PUT', 'requestUri' => '/certificates/{certificateId}', ], 'input' => [ 'shape' => 'UpdateCertificateRequest', ], 'errors' => [ [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], [ 'shape' => 'CertificateStateException', 'error' => [ 'httpStatusCode' => 406, ], 'exception' => true, ], [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], ], ], 'UpdateThing' => [ 'name' => 'UpdateThing', 'http' => [ 'method' => 'PATCH', 'requestUri' => '/things/{thingName}', ], 'input' => [ 'shape' => 'UpdateThingRequest', ], 'output' => [ 'shape' => 'UpdateThingResponse', ], 'errors' => [ [ 'shape' => 'InvalidRequestException', 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], [ 'shape' => 'VersionConflictException', 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], [ 'shape' => 'ThrottlingException', 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], [ 'shape' => 'UnauthorizedException', 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], [ 'shape' => 'ServiceUnavailableException', 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'InternalFailureException', 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], [ 'shape' => 'ResourceNotFoundException', 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], ], ], ], 'shapes' => [ 'AcceptCertificateTransferRequest' => [ 'type' => 'structure', 'required' => [ 'certificateId', ], 'members' => [ 'certificateId' => [ 'shape' => 'CertificateId', 'location' => 'uri', 'locationName' => 'certificateId', ], 'setAsActive' => [ 'shape' => 'SetAsActive', 'location' => 'querystring', 'locationName' => 'setAsActive', ], ], ], 'Action' => [ 'type' => 'structure', 'members' => [ 'dynamoDB' => [ 'shape' => 'DynamoDBAction', ], 'dynamoDBv2' => [ 'shape' => 'DynamoDBv2Action', ], 'lambda' => [ 'shape' => 'LambdaAction', ], 'sns' => [ 'shape' => 'SnsAction', ], 'sqs' => [ 'shape' => 'SqsAction', ], 'kinesis' => [ 'shape' => 'KinesisAction', ], 'republish' => [ 'shape' => 'RepublishAction', ], 's3' => [ 'shape' => 'S3Action', ], 'firehose' => [ 'shape' => 'FirehoseAction', ], 'cloudwatchMetric' => [ 'shape' => 'CloudwatchMetricAction', ], 'cloudwatchAlarm' => [ 'shape' => 'CloudwatchAlarmAction', ], 'elasticsearch' => [ 'shape' => 'ElasticsearchAction', ], ], ], 'ActionList' => [ 'type' => 'list', 'member' => [ 'shape' => 'Action', ], 'min' => 0, 'max' => 10, ], 'AlarmName' => [ 'type' => 'string', ], 'AllowAutoRegistration' => [ 'type' => 'boolean', ], 'AscendingOrder' => [ 'type' => 'boolean', ], 'AttachPrincipalPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'policyName', 'principal', ], 'members' => [ 'policyName' => [ 'shape' => 'PolicyName', 'location' => 'uri', 'locationName' => 'policyName', ], 'principal' => [ 'shape' => 'Principal', 'location' => 'header', 'locationName' => 'x-amzn-iot-principal', ], ], ], 'AttachThingPrincipalRequest' => [ 'type' => 'structure', 'required' => [ 'thingName', 'principal', ], 'members' => [ 'thingName' => [ 'shape' => 'ThingName', 'location' => 'uri', 'locationName' => 'thingName', ], 'principal' => [ 'shape' => 'Principal', 'location' => 'header', 'locationName' => 'x-amzn-principal', ], ], ], 'AttachThingPrincipalResponse' => [ 'type' => 'structure', 'members' => [], ], 'AttributeName' => [ 'type' => 'string', 'max' => 128, 'pattern' => '[a-zA-Z0-9_.,@/:#-]+', ], 'AttributePayload' => [ 'type' => 'structure', 'members' => [ 'attributes' => [ 'shape' => 'Attributes', ], 'merge' => [ 'shape' => 'Flag', ], ], ], 'AttributeValue' => [ 'type' => 'string', 'max' => 800, 'pattern' => '[a-zA-Z0-9_.,@/:#-]*', ], 'Attributes' => [ 'type' => 'map', 'key' => [ 'shape' => 'AttributeName', ], 'value' => [ 'shape' => 'AttributeValue', ], ], 'AutoRegistrationStatus' => [ 'type' => 'string', 'enum' => [ 'ENABLE', 'DISABLE', ], ], 'AwsAccountId' => [ 'type' => 'string', 'pattern' => '[0-9]{12}', ], 'AwsArn' => [ 'type' => 'string', ], 'AwsIotSqlVersion' => [ 'type' => 'string', ], 'Boolean' => [ 'type' => 'boolean', ], 'BucketName' => [ 'type' => 'string', ], 'CACertificate' => [ 'type' => 'structure', 'members' => [ 'certificateArn' => [ 'shape' => 'CertificateArn', ], 'certificateId' => [ 'shape' => 'CertificateId', ], 'status' => [ 'shape' => 'CACertificateStatus', ], 'creationDate' => [ 'shape' => 'DateType', ], ], ], 'CACertificateDescription' => [ 'type' => 'structure', 'members' => [ 'certificateArn' => [ 'shape' => 'CertificateArn', ], 'certificateId' => [ 'shape' => 'CertificateId', ], 'status' => [ 'shape' => 'CACertificateStatus', ], 'certificatePem' => [ 'shape' => 'CertificatePem', ], 'ownedBy' => [ 'shape' => 'AwsAccountId', ], 'creationDate' => [ 'shape' => 'DateType', ], 'autoRegistrationStatus' => [ 'shape' => 'AutoRegistrationStatus', ], ], ], 'CACertificateStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'INACTIVE', ], ], 'CACertificates' => [ 'type' => 'list', 'member' => [ 'shape' => 'CACertificate', ], ], 'CancelCertificateTransferRequest' => [ 'type' => 'structure', 'required' => [ 'certificateId', ], 'members' => [ 'certificateId' => [ 'shape' => 'CertificateId', 'location' => 'uri', 'locationName' => 'certificateId', ], ], ], 'CannedAccessControlList' => [ 'type' => 'string', 'enum' => [ 'private', 'public-read', 'public-read-write', 'aws-exec-read', 'authenticated-read', 'bucket-owner-read', 'bucket-owner-full-control', 'log-delivery-write', ], ], 'Certificate' => [ 'type' => 'structure', 'members' => [ 'certificateArn' => [ 'shape' => 'CertificateArn', ], 'certificateId' => [ 'shape' => 'CertificateId', ], 'status' => [ 'shape' => 'CertificateStatus', ], 'creationDate' => [ 'shape' => 'DateType', ], ], ], 'CertificateArn' => [ 'type' => 'string', ], 'CertificateConflictException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'CertificateDescription' => [ 'type' => 'structure', 'members' => [ 'certificateArn' => [ 'shape' => 'CertificateArn', ], 'certificateId' => [ 'shape' => 'CertificateId', ], 'caCertificateId' => [ 'shape' => 'CertificateId', ], 'status' => [ 'shape' => 'CertificateStatus', ], 'certificatePem' => [ 'shape' => 'CertificatePem', ], 'ownedBy' => [ 'shape' => 'AwsAccountId', ], 'previousOwnedBy' => [ 'shape' => 'AwsAccountId', ], 'creationDate' => [ 'shape' => 'DateType', ], 'lastModifiedDate' => [ 'shape' => 'DateType', ], 'transferData' => [ 'shape' => 'TransferData', ], ], ], 'CertificateId' => [ 'type' => 'string', 'min' => 64, 'max' => 64, 'pattern' => '(0x)?[a-fA-F0-9]+', ], 'CertificatePem' => [ 'type' => 'string', 'min' => 1, 'max' => 65536, ], 'CertificateSigningRequest' => [ 'type' => 'string', 'min' => 1, ], 'CertificateStateException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 406, ], 'exception' => true, ], 'CertificateStatus' => [ 'type' => 'string', 'enum' => [ 'ACTIVE', 'INACTIVE', 'REVOKED', 'PENDING_TRANSFER', 'REGISTER_INACTIVE', 'PENDING_ACTIVATION', ], ], 'CertificateValidationException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'Certificates' => [ 'type' => 'list', 'member' => [ 'shape' => 'Certificate', ], ], 'ClientId' => [ 'type' => 'string', ], 'CloudwatchAlarmAction' => [ 'type' => 'structure', 'required' => [ 'roleArn', 'alarmName', 'stateReason', 'stateValue', ], 'members' => [ 'roleArn' => [ 'shape' => 'AwsArn', ], 'alarmName' => [ 'shape' => 'AlarmName', ], 'stateReason' => [ 'shape' => 'StateReason', ], 'stateValue' => [ 'shape' => 'StateValue', ], ], ], 'CloudwatchMetricAction' => [ 'type' => 'structure', 'required' => [ 'roleArn', 'metricNamespace', 'metricName', 'metricValue', 'metricUnit', ], 'members' => [ 'roleArn' => [ 'shape' => 'AwsArn', ], 'metricNamespace' => [ 'shape' => 'MetricNamespace', ], 'metricName' => [ 'shape' => 'MetricName', ], 'metricValue' => [ 'shape' => 'MetricValue', ], 'metricUnit' => [ 'shape' => 'MetricUnit', ], 'metricTimestamp' => [ 'shape' => 'MetricTimestamp', ], ], ], 'CreateCertificateFromCsrRequest' => [ 'type' => 'structure', 'required' => [ 'certificateSigningRequest', ], 'members' => [ 'certificateSigningRequest' => [ 'shape' => 'CertificateSigningRequest', ], 'setAsActive' => [ 'shape' => 'SetAsActive', 'location' => 'querystring', 'locationName' => 'setAsActive', ], ], ], 'CreateCertificateFromCsrResponse' => [ 'type' => 'structure', 'members' => [ 'certificateArn' => [ 'shape' => 'CertificateArn', ], 'certificateId' => [ 'shape' => 'CertificateId', ], 'certificatePem' => [ 'shape' => 'CertificatePem', ], ], ], 'CreateKeysAndCertificateRequest' => [ 'type' => 'structure', 'members' => [ 'setAsActive' => [ 'shape' => 'SetAsActive', 'location' => 'querystring', 'locationName' => 'setAsActive', ], ], ], 'CreateKeysAndCertificateResponse' => [ 'type' => 'structure', 'members' => [ 'certificateArn' => [ 'shape' => 'CertificateArn', ], 'certificateId' => [ 'shape' => 'CertificateId', ], 'certificatePem' => [ 'shape' => 'CertificatePem', ], 'keyPair' => [ 'shape' => 'KeyPair', ], ], ], 'CreatePolicyRequest' => [ 'type' => 'structure', 'required' => [ 'policyName', 'policyDocument', ], 'members' => [ 'policyName' => [ 'shape' => 'PolicyName', 'location' => 'uri', 'locationName' => 'policyName', ], 'policyDocument' => [ 'shape' => 'PolicyDocument', ], ], ], 'CreatePolicyResponse' => [ 'type' => 'structure', 'members' => [ 'policyName' => [ 'shape' => 'PolicyName', ], 'policyArn' => [ 'shape' => 'PolicyArn', ], 'policyDocument' => [ 'shape' => 'PolicyDocument', ], 'policyVersionId' => [ 'shape' => 'PolicyVersionId', ], ], ], 'CreatePolicyVersionRequest' => [ 'type' => 'structure', 'required' => [ 'policyName', 'policyDocument', ], 'members' => [ 'policyName' => [ 'shape' => 'PolicyName', 'location' => 'uri', 'locationName' => 'policyName', ], 'policyDocument' => [ 'shape' => 'PolicyDocument', ], 'setAsDefault' => [ 'shape' => 'SetAsDefault', 'location' => 'querystring', 'locationName' => 'setAsDefault', ], ], ], 'CreatePolicyVersionResponse' => [ 'type' => 'structure', 'members' => [ 'policyArn' => [ 'shape' => 'PolicyArn', ], 'policyDocument' => [ 'shape' => 'PolicyDocument', ], 'policyVersionId' => [ 'shape' => 'PolicyVersionId', ], 'isDefaultVersion' => [ 'shape' => 'IsDefaultVersion', ], ], ], 'CreateThingRequest' => [ 'type' => 'structure', 'required' => [ 'thingName', ], 'members' => [ 'thingName' => [ 'shape' => 'ThingName', 'location' => 'uri', 'locationName' => 'thingName', ], 'thingTypeName' => [ 'shape' => 'ThingTypeName', ], 'attributePayload' => [ 'shape' => 'AttributePayload', ], ], ], 'CreateThingResponse' => [ 'type' => 'structure', 'members' => [ 'thingName' => [ 'shape' => 'ThingName', ], 'thingArn' => [ 'shape' => 'ThingArn', ], ], ], 'CreateThingTypeRequest' => [ 'type' => 'structure', 'required' => [ 'thingTypeName', ], 'members' => [ 'thingTypeName' => [ 'shape' => 'ThingTypeName', 'location' => 'uri', 'locationName' => 'thingTypeName', ], 'thingTypeProperties' => [ 'shape' => 'ThingTypeProperties', ], ], ], 'CreateThingTypeResponse' => [ 'type' => 'structure', 'members' => [ 'thingTypeName' => [ 'shape' => 'ThingTypeName', ], 'thingTypeArn' => [ 'shape' => 'ThingTypeArn', ], ], ], 'CreateTopicRuleRequest' => [ 'type' => 'structure', 'required' => [ 'ruleName', 'topicRulePayload', ], 'members' => [ 'ruleName' => [ 'shape' => 'RuleName', 'location' => 'uri', 'locationName' => 'ruleName', ], 'topicRulePayload' => [ 'shape' => 'TopicRulePayload', ], ], 'payload' => 'topicRulePayload', ], 'CreatedAtDate' => [ 'type' => 'timestamp', ], 'CreationDate' => [ 'type' => 'timestamp', ], 'DateType' => [ 'type' => 'timestamp', ], 'DeleteCACertificateRequest' => [ 'type' => 'structure', 'required' => [ 'certificateId', ], 'members' => [ 'certificateId' => [ 'shape' => 'CertificateId', 'location' => 'uri', 'locationName' => 'caCertificateId', ], ], ], 'DeleteCACertificateResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'certificateId', ], 'members' => [ 'certificateId' => [ 'shape' => 'CertificateId', 'location' => 'uri', 'locationName' => 'certificateId', ], ], ], 'DeleteConflictException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'DeletePolicyRequest' => [ 'type' => 'structure', 'required' => [ 'policyName', ], 'members' => [ 'policyName' => [ 'shape' => 'PolicyName', 'location' => 'uri', 'locationName' => 'policyName', ], ], ], 'DeletePolicyVersionRequest' => [ 'type' => 'structure', 'required' => [ 'policyName', 'policyVersionId', ], 'members' => [ 'policyName' => [ 'shape' => 'PolicyName', 'location' => 'uri', 'locationName' => 'policyName', ], 'policyVersionId' => [ 'shape' => 'PolicyVersionId', 'location' => 'uri', 'locationName' => 'policyVersionId', ], ], ], 'DeleteRegistrationCodeRequest' => [ 'type' => 'structure', 'members' => [], ], 'DeleteRegistrationCodeResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteThingRequest' => [ 'type' => 'structure', 'required' => [ 'thingName', ], 'members' => [ 'thingName' => [ 'shape' => 'ThingName', 'location' => 'uri', 'locationName' => 'thingName', ], 'expectedVersion' => [ 'shape' => 'OptionalVersion', 'location' => 'querystring', 'locationName' => 'expectedVersion', ], ], ], 'DeleteThingResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteThingTypeRequest' => [ 'type' => 'structure', 'required' => [ 'thingTypeName', ], 'members' => [ 'thingTypeName' => [ 'shape' => 'ThingTypeName', 'location' => 'uri', 'locationName' => 'thingTypeName', ], ], ], 'DeleteThingTypeResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeleteTopicRuleRequest' => [ 'type' => 'structure', 'members' => [ 'ruleName' => [ 'shape' => 'RuleName', 'location' => 'uri', 'locationName' => 'ruleName', ], ], 'required' => [ 'ruleName', ], ], 'DeliveryStreamName' => [ 'type' => 'string', ], 'DeprecateThingTypeRequest' => [ 'type' => 'structure', 'required' => [ 'thingTypeName', ], 'members' => [ 'thingTypeName' => [ 'shape' => 'ThingTypeName', 'location' => 'uri', 'locationName' => 'thingTypeName', ], 'undoDeprecate' => [ 'shape' => 'UndoDeprecate', ], ], ], 'DeprecateThingTypeResponse' => [ 'type' => 'structure', 'members' => [], ], 'DeprecationDate' => [ 'type' => 'timestamp', ], 'DescribeCACertificateRequest' => [ 'type' => 'structure', 'required' => [ 'certificateId', ], 'members' => [ 'certificateId' => [ 'shape' => 'CertificateId', 'location' => 'uri', 'locationName' => 'caCertificateId', ], ], ], 'DescribeCACertificateResponse' => [ 'type' => 'structure', 'members' => [ 'certificateDescription' => [ 'shape' => 'CACertificateDescription', ], ], ], 'DescribeCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'certificateId', ], 'members' => [ 'certificateId' => [ 'shape' => 'CertificateId', 'location' => 'uri', 'locationName' => 'certificateId', ], ], ], 'DescribeCertificateResponse' => [ 'type' => 'structure', 'members' => [ 'certificateDescription' => [ 'shape' => 'CertificateDescription', ], ], ], 'DescribeEndpointRequest' => [ 'type' => 'structure', 'members' => [], ], 'DescribeEndpointResponse' => [ 'type' => 'structure', 'members' => [ 'endpointAddress' => [ 'shape' => 'EndpointAddress', ], ], ], 'DescribeThingRequest' => [ 'type' => 'structure', 'required' => [ 'thingName', ], 'members' => [ 'thingName' => [ 'shape' => 'ThingName', 'location' => 'uri', 'locationName' => 'thingName', ], ], ], 'DescribeThingResponse' => [ 'type' => 'structure', 'members' => [ 'defaultClientId' => [ 'shape' => 'ClientId', ], 'thingName' => [ 'shape' => 'ThingName', ], 'thingTypeName' => [ 'shape' => 'ThingTypeName', ], 'attributes' => [ 'shape' => 'Attributes', ], 'version' => [ 'shape' => 'Version', ], ], ], 'DescribeThingTypeRequest' => [ 'type' => 'structure', 'required' => [ 'thingTypeName', ], 'members' => [ 'thingTypeName' => [ 'shape' => 'ThingTypeName', 'location' => 'uri', 'locationName' => 'thingTypeName', ], ], ], 'DescribeThingTypeResponse' => [ 'type' => 'structure', 'members' => [ 'thingTypeName' => [ 'shape' => 'ThingTypeName', ], 'thingTypeProperties' => [ 'shape' => 'ThingTypeProperties', ], 'thingTypeMetadata' => [ 'shape' => 'ThingTypeMetadata', ], ], ], 'Description' => [ 'type' => 'string', ], 'DetachPrincipalPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'policyName', 'principal', ], 'members' => [ 'policyName' => [ 'shape' => 'PolicyName', 'location' => 'uri', 'locationName' => 'policyName', ], 'principal' => [ 'shape' => 'Principal', 'location' => 'header', 'locationName' => 'x-amzn-iot-principal', ], ], ], 'DetachThingPrincipalRequest' => [ 'type' => 'structure', 'required' => [ 'thingName', 'principal', ], 'members' => [ 'thingName' => [ 'shape' => 'ThingName', 'location' => 'uri', 'locationName' => 'thingName', ], 'principal' => [ 'shape' => 'Principal', 'location' => 'header', 'locationName' => 'x-amzn-principal', ], ], ], 'DetachThingPrincipalResponse' => [ 'type' => 'structure', 'members' => [], ], 'DisableTopicRuleRequest' => [ 'type' => 'structure', 'required' => [ 'ruleName', ], 'members' => [ 'ruleName' => [ 'shape' => 'RuleName', 'location' => 'uri', 'locationName' => 'ruleName', ], ], ], 'DynamoDBAction' => [ 'type' => 'structure', 'required' => [ 'tableName', 'roleArn', 'hashKeyField', 'hashKeyValue', ], 'members' => [ 'tableName' => [ 'shape' => 'TableName', ], 'roleArn' => [ 'shape' => 'AwsArn', ], 'operation' => [ 'shape' => 'DynamoOperation', ], 'hashKeyField' => [ 'shape' => 'HashKeyField', ], 'hashKeyValue' => [ 'shape' => 'HashKeyValue', ], 'hashKeyType' => [ 'shape' => 'DynamoKeyType', ], 'rangeKeyField' => [ 'shape' => 'RangeKeyField', ], 'rangeKeyValue' => [ 'shape' => 'RangeKeyValue', ], 'rangeKeyType' => [ 'shape' => 'DynamoKeyType', ], 'payloadField' => [ 'shape' => 'PayloadField', ], ], ], 'DynamoDBv2Action' => [ 'type' => 'structure', 'members' => [ 'roleArn' => [ 'shape' => 'AwsArn', ], 'putItem' => [ 'shape' => 'PutItemInput', ], ], ], 'DynamoKeyType' => [ 'type' => 'string', 'enum' => [ 'STRING', 'NUMBER', ], ], 'DynamoOperation' => [ 'type' => 'string', ], 'ElasticsearchAction' => [ 'type' => 'structure', 'required' => [ 'roleArn', 'endpoint', 'index', 'type', 'id', ], 'members' => [ 'roleArn' => [ 'shape' => 'AwsArn', ], 'endpoint' => [ 'shape' => 'ElasticsearchEndpoint', ], 'index' => [ 'shape' => 'ElasticsearchIndex', ], 'type' => [ 'shape' => 'ElasticsearchType', ], 'id' => [ 'shape' => 'ElasticsearchId', ], ], ], 'ElasticsearchEndpoint' => [ 'type' => 'string', 'pattern' => 'https?://.*', ], 'ElasticsearchId' => [ 'type' => 'string', ], 'ElasticsearchIndex' => [ 'type' => 'string', ], 'ElasticsearchType' => [ 'type' => 'string', ], 'EnableTopicRuleRequest' => [ 'type' => 'structure', 'required' => [ 'ruleName', ], 'members' => [ 'ruleName' => [ 'shape' => 'RuleName', 'location' => 'uri', 'locationName' => 'ruleName', ], ], ], 'EndpointAddress' => [ 'type' => 'string', ], 'FirehoseAction' => [ 'type' => 'structure', 'required' => [ 'roleArn', 'deliveryStreamName', ], 'members' => [ 'roleArn' => [ 'shape' => 'AwsArn', ], 'deliveryStreamName' => [ 'shape' => 'DeliveryStreamName', ], 'separator' => [ 'shape' => 'FirehoseSeparator', ], ], ], 'FirehoseSeparator' => [ 'type' => 'string', 'pattern' => '([\\n\\t])|(\\r\\n)|(,)', ], 'Flag' => [ 'type' => 'boolean', ], 'FunctionArn' => [ 'type' => 'string', ], 'GetLoggingOptionsRequest' => [ 'type' => 'structure', 'members' => [], ], 'GetLoggingOptionsResponse' => [ 'type' => 'structure', 'members' => [ 'roleArn' => [ 'shape' => 'AwsArn', ], 'logLevel' => [ 'shape' => 'LogLevel', ], ], ], 'GetPolicyRequest' => [ 'type' => 'structure', 'required' => [ 'policyName', ], 'members' => [ 'policyName' => [ 'shape' => 'PolicyName', 'location' => 'uri', 'locationName' => 'policyName', ], ], ], 'GetPolicyResponse' => [ 'type' => 'structure', 'members' => [ 'policyName' => [ 'shape' => 'PolicyName', ], 'policyArn' => [ 'shape' => 'PolicyArn', ], 'policyDocument' => [ 'shape' => 'PolicyDocument', ], 'defaultVersionId' => [ 'shape' => 'PolicyVersionId', ], ], ], 'GetPolicyVersionRequest' => [ 'type' => 'structure', 'required' => [ 'policyName', 'policyVersionId', ], 'members' => [ 'policyName' => [ 'shape' => 'PolicyName', 'location' => 'uri', 'locationName' => 'policyName', ], 'policyVersionId' => [ 'shape' => 'PolicyVersionId', 'location' => 'uri', 'locationName' => 'policyVersionId', ], ], ], 'GetPolicyVersionResponse' => [ 'type' => 'structure', 'members' => [ 'policyArn' => [ 'shape' => 'PolicyArn', ], 'policyName' => [ 'shape' => 'PolicyName', ], 'policyDocument' => [ 'shape' => 'PolicyDocument', ], 'policyVersionId' => [ 'shape' => 'PolicyVersionId', ], 'isDefaultVersion' => [ 'shape' => 'IsDefaultVersion', ], ], ], 'GetRegistrationCodeRequest' => [ 'type' => 'structure', 'members' => [], ], 'GetRegistrationCodeResponse' => [ 'type' => 'structure', 'members' => [ 'registrationCode' => [ 'shape' => 'RegistrationCode', ], ], ], 'GetTopicRuleRequest' => [ 'type' => 'structure', 'required' => [ 'ruleName', ], 'members' => [ 'ruleName' => [ 'shape' => 'RuleName', 'location' => 'uri', 'locationName' => 'ruleName', ], ], ], 'GetTopicRuleResponse' => [ 'type' => 'structure', 'members' => [ 'ruleArn' => [ 'shape' => 'RuleArn', ], 'rule' => [ 'shape' => 'TopicRule', ], ], ], 'HashKeyField' => [ 'type' => 'string', ], 'HashKeyValue' => [ 'type' => 'string', ], 'InternalException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'InternalFailureException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 500, ], 'exception' => true, 'fault' => true, ], 'InvalidRequestException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'IsDefaultVersion' => [ 'type' => 'boolean', ], 'IsDisabled' => [ 'type' => 'boolean', ], 'Key' => [ 'type' => 'string', ], 'KeyPair' => [ 'type' => 'structure', 'members' => [ 'PublicKey' => [ 'shape' => 'PublicKey', ], 'PrivateKey' => [ 'shape' => 'PrivateKey', ], ], ], 'KinesisAction' => [ 'type' => 'structure', 'required' => [ 'roleArn', 'streamName', ], 'members' => [ 'roleArn' => [ 'shape' => 'AwsArn', ], 'streamName' => [ 'shape' => 'StreamName', ], 'partitionKey' => [ 'shape' => 'PartitionKey', ], ], ], 'LambdaAction' => [ 'type' => 'structure', 'required' => [ 'functionArn', ], 'members' => [ 'functionArn' => [ 'shape' => 'FunctionArn', ], ], ], 'LimitExceededException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 410, ], 'exception' => true, ], 'ListCACertificatesRequest' => [ 'type' => 'structure', 'members' => [ 'pageSize' => [ 'shape' => 'PageSize', 'location' => 'querystring', 'locationName' => 'pageSize', ], 'marker' => [ 'shape' => 'Marker', 'location' => 'querystring', 'locationName' => 'marker', ], 'ascendingOrder' => [ 'shape' => 'AscendingOrder', 'location' => 'querystring', 'locationName' => 'isAscendingOrder', ], ], ], 'ListCACertificatesResponse' => [ 'type' => 'structure', 'members' => [ 'certificates' => [ 'shape' => 'CACertificates', ], 'nextMarker' => [ 'shape' => 'Marker', ], ], ], 'ListCertificatesByCARequest' => [ 'type' => 'structure', 'required' => [ 'caCertificateId', ], 'members' => [ 'caCertificateId' => [ 'shape' => 'CertificateId', 'location' => 'uri', 'locationName' => 'caCertificateId', ], 'pageSize' => [ 'shape' => 'PageSize', 'location' => 'querystring', 'locationName' => 'pageSize', ], 'marker' => [ 'shape' => 'Marker', 'location' => 'querystring', 'locationName' => 'marker', ], 'ascendingOrder' => [ 'shape' => 'AscendingOrder', 'location' => 'querystring', 'locationName' => 'isAscendingOrder', ], ], ], 'ListCertificatesByCAResponse' => [ 'type' => 'structure', 'members' => [ 'certificates' => [ 'shape' => 'Certificates', ], 'nextMarker' => [ 'shape' => 'Marker', ], ], ], 'ListCertificatesRequest' => [ 'type' => 'structure', 'members' => [ 'pageSize' => [ 'shape' => 'PageSize', 'location' => 'querystring', 'locationName' => 'pageSize', ], 'marker' => [ 'shape' => 'Marker', 'location' => 'querystring', 'locationName' => 'marker', ], 'ascendingOrder' => [ 'shape' => 'AscendingOrder', 'location' => 'querystring', 'locationName' => 'isAscendingOrder', ], ], ], 'ListCertificatesResponse' => [ 'type' => 'structure', 'members' => [ 'certificates' => [ 'shape' => 'Certificates', ], 'nextMarker' => [ 'shape' => 'Marker', ], ], ], 'ListOutgoingCertificatesRequest' => [ 'type' => 'structure', 'members' => [ 'pageSize' => [ 'shape' => 'PageSize', 'location' => 'querystring', 'locationName' => 'pageSize', ], 'marker' => [ 'shape' => 'Marker', 'location' => 'querystring', 'locationName' => 'marker', ], 'ascendingOrder' => [ 'shape' => 'AscendingOrder', 'location' => 'querystring', 'locationName' => 'isAscendingOrder', ], ], ], 'ListOutgoingCertificatesResponse' => [ 'type' => 'structure', 'members' => [ 'outgoingCertificates' => [ 'shape' => 'OutgoingCertificates', ], 'nextMarker' => [ 'shape' => 'Marker', ], ], ], 'ListPoliciesRequest' => [ 'type' => 'structure', 'members' => [ 'marker' => [ 'shape' => 'Marker', 'location' => 'querystring', 'locationName' => 'marker', ], 'pageSize' => [ 'shape' => 'PageSize', 'location' => 'querystring', 'locationName' => 'pageSize', ], 'ascendingOrder' => [ 'shape' => 'AscendingOrder', 'location' => 'querystring', 'locationName' => 'isAscendingOrder', ], ], ], 'ListPoliciesResponse' => [ 'type' => 'structure', 'members' => [ 'policies' => [ 'shape' => 'Policies', ], 'nextMarker' => [ 'shape' => 'Marker', ], ], ], 'ListPolicyPrincipalsRequest' => [ 'type' => 'structure', 'required' => [ 'policyName', ], 'members' => [ 'policyName' => [ 'shape' => 'PolicyName', 'location' => 'header', 'locationName' => 'x-amzn-iot-policy', ], 'marker' => [ 'shape' => 'Marker', 'location' => 'querystring', 'locationName' => 'marker', ], 'pageSize' => [ 'shape' => 'PageSize', 'location' => 'querystring', 'locationName' => 'pageSize', ], 'ascendingOrder' => [ 'shape' => 'AscendingOrder', 'location' => 'querystring', 'locationName' => 'isAscendingOrder', ], ], ], 'ListPolicyPrincipalsResponse' => [ 'type' => 'structure', 'members' => [ 'principals' => [ 'shape' => 'Principals', ], 'nextMarker' => [ 'shape' => 'Marker', ], ], ], 'ListPolicyVersionsRequest' => [ 'type' => 'structure', 'required' => [ 'policyName', ], 'members' => [ 'policyName' => [ 'shape' => 'PolicyName', 'location' => 'uri', 'locationName' => 'policyName', ], ], ], 'ListPolicyVersionsResponse' => [ 'type' => 'structure', 'members' => [ 'policyVersions' => [ 'shape' => 'PolicyVersions', ], ], ], 'ListPrincipalPoliciesRequest' => [ 'type' => 'structure', 'required' => [ 'principal', ], 'members' => [ 'principal' => [ 'shape' => 'Principal', 'location' => 'header', 'locationName' => 'x-amzn-iot-principal', ], 'marker' => [ 'shape' => 'Marker', 'location' => 'querystring', 'locationName' => 'marker', ], 'pageSize' => [ 'shape' => 'PageSize', 'location' => 'querystring', 'locationName' => 'pageSize', ], 'ascendingOrder' => [ 'shape' => 'AscendingOrder', 'location' => 'querystring', 'locationName' => 'isAscendingOrder', ], ], ], 'ListPrincipalPoliciesResponse' => [ 'type' => 'structure', 'members' => [ 'policies' => [ 'shape' => 'Policies', ], 'nextMarker' => [ 'shape' => 'Marker', ], ], ], 'ListPrincipalThingsRequest' => [ 'type' => 'structure', 'required' => [ 'principal', ], 'members' => [ 'nextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'principal' => [ 'shape' => 'Principal', 'location' => 'header', 'locationName' => 'x-amzn-principal', ], ], ], 'ListPrincipalThingsResponse' => [ 'type' => 'structure', 'members' => [ 'things' => [ 'shape' => 'ThingNameList', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListThingPrincipalsRequest' => [ 'type' => 'structure', 'required' => [ 'thingName', ], 'members' => [ 'thingName' => [ 'shape' => 'ThingName', 'location' => 'uri', 'locationName' => 'thingName', ], ], ], 'ListThingPrincipalsResponse' => [ 'type' => 'structure', 'members' => [ 'principals' => [ 'shape' => 'Principals', ], ], ], 'ListThingTypesRequest' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'thingTypeName' => [ 'shape' => 'ThingTypeName', 'location' => 'querystring', 'locationName' => 'thingTypeName', ], ], ], 'ListThingTypesResponse' => [ 'type' => 'structure', 'members' => [ 'thingTypes' => [ 'shape' => 'ThingTypeList', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListThingsRequest' => [ 'type' => 'structure', 'members' => [ 'nextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'attributeName' => [ 'shape' => 'AttributeName', 'location' => 'querystring', 'locationName' => 'attributeName', ], 'attributeValue' => [ 'shape' => 'AttributeValue', 'location' => 'querystring', 'locationName' => 'attributeValue', ], 'thingTypeName' => [ 'shape' => 'ThingTypeName', 'location' => 'querystring', 'locationName' => 'thingTypeName', ], ], ], 'ListThingsResponse' => [ 'type' => 'structure', 'members' => [ 'things' => [ 'shape' => 'ThingAttributeList', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'ListTopicRulesRequest' => [ 'type' => 'structure', 'members' => [ 'topic' => [ 'shape' => 'Topic', 'location' => 'querystring', 'locationName' => 'topic', ], 'maxResults' => [ 'shape' => 'MaxResults', 'location' => 'querystring', 'locationName' => 'maxResults', ], 'nextToken' => [ 'shape' => 'NextToken', 'location' => 'querystring', 'locationName' => 'nextToken', ], 'ruleDisabled' => [ 'shape' => 'IsDisabled', 'location' => 'querystring', 'locationName' => 'ruleDisabled', ], ], ], 'ListTopicRulesResponse' => [ 'type' => 'structure', 'members' => [ 'rules' => [ 'shape' => 'TopicRuleList', ], 'nextToken' => [ 'shape' => 'NextToken', ], ], ], 'LogLevel' => [ 'type' => 'string', 'enum' => [ 'DEBUG', 'INFO', 'ERROR', 'WARN', 'DISABLED', ], ], 'LoggingOptionsPayload' => [ 'type' => 'structure', 'required' => [ 'roleArn', ], 'members' => [ 'roleArn' => [ 'shape' => 'AwsArn', ], 'logLevel' => [ 'shape' => 'LogLevel', ], ], ], 'MalformedPolicyException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'Marker' => [ 'type' => 'string', ], 'MaxResults' => [ 'type' => 'integer', 'min' => 1, 'max' => 10000, ], 'Message' => [ 'type' => 'string', 'max' => 128, ], 'MessageFormat' => [ 'type' => 'string', 'enum' => [ 'RAW', 'JSON', ], ], 'MetricName' => [ 'type' => 'string', ], 'MetricNamespace' => [ 'type' => 'string', ], 'MetricTimestamp' => [ 'type' => 'string', ], 'MetricUnit' => [ 'type' => 'string', ], 'MetricValue' => [ 'type' => 'string', ], 'NextToken' => [ 'type' => 'string', ], 'OptionalVersion' => [ 'type' => 'long', ], 'OutgoingCertificate' => [ 'type' => 'structure', 'members' => [ 'certificateArn' => [ 'shape' => 'CertificateArn', ], 'certificateId' => [ 'shape' => 'CertificateId', ], 'transferredTo' => [ 'shape' => 'AwsAccountId', ], 'transferDate' => [ 'shape' => 'DateType', ], 'transferMessage' => [ 'shape' => 'Message', ], 'creationDate' => [ 'shape' => 'DateType', ], ], ], 'OutgoingCertificates' => [ 'type' => 'list', 'member' => [ 'shape' => 'OutgoingCertificate', ], ], 'PageSize' => [ 'type' => 'integer', 'min' => 1, 'max' => 250, ], 'PartitionKey' => [ 'type' => 'string', ], 'PayloadField' => [ 'type' => 'string', ], 'Policies' => [ 'type' => 'list', 'member' => [ 'shape' => 'Policy', ], ], 'Policy' => [ 'type' => 'structure', 'members' => [ 'policyName' => [ 'shape' => 'PolicyName', ], 'policyArn' => [ 'shape' => 'PolicyArn', ], ], ], 'PolicyArn' => [ 'type' => 'string', ], 'PolicyDocument' => [ 'type' => 'string', ], 'PolicyName' => [ 'type' => 'string', 'min' => 1, 'max' => 128, 'pattern' => '[\\w+=,.@-]+', ], 'PolicyVersion' => [ 'type' => 'structure', 'members' => [ 'versionId' => [ 'shape' => 'PolicyVersionId', ], 'isDefaultVersion' => [ 'shape' => 'IsDefaultVersion', ], 'createDate' => [ 'shape' => 'DateType', ], ], ], 'PolicyVersionId' => [ 'type' => 'string', 'pattern' => '[0-9]+', ], 'PolicyVersions' => [ 'type' => 'list', 'member' => [ 'shape' => 'PolicyVersion', ], ], 'Principal' => [ 'type' => 'string', ], 'PrincipalArn' => [ 'type' => 'string', ], 'Principals' => [ 'type' => 'list', 'member' => [ 'shape' => 'PrincipalArn', ], ], 'PrivateKey' => [ 'type' => 'string', 'min' => 1, 'sensitive' => true, ], 'PublicKey' => [ 'type' => 'string', 'min' => 1, ], 'PutItemInput' => [ 'type' => 'structure', 'required' => [ 'tableName', ], 'members' => [ 'tableName' => [ 'shape' => 'TableName', ], ], ], 'QueueUrl' => [ 'type' => 'string', ], 'RangeKeyField' => [ 'type' => 'string', ], 'RangeKeyValue' => [ 'type' => 'string', ], 'RegisterCACertificateRequest' => [ 'type' => 'structure', 'required' => [ 'caCertificate', 'verificationCertificate', ], 'members' => [ 'caCertificate' => [ 'shape' => 'CertificatePem', ], 'verificationCertificate' => [ 'shape' => 'CertificatePem', ], 'setAsActive' => [ 'shape' => 'SetAsActive', 'location' => 'querystring', 'locationName' => 'setAsActive', ], 'allowAutoRegistration' => [ 'shape' => 'AllowAutoRegistration', 'location' => 'querystring', 'locationName' => 'allowAutoRegistration', ], ], ], 'RegisterCACertificateResponse' => [ 'type' => 'structure', 'members' => [ 'certificateArn' => [ 'shape' => 'CertificateArn', ], 'certificateId' => [ 'shape' => 'CertificateId', ], ], ], 'RegisterCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'certificatePem', ], 'members' => [ 'certificatePem' => [ 'shape' => 'CertificatePem', ], 'caCertificatePem' => [ 'shape' => 'CertificatePem', ], 'setAsActive' => [ 'shape' => 'SetAsActiveFlag', 'deprecated' => true, 'location' => 'querystring', 'locationName' => 'setAsActive', ], 'status' => [ 'shape' => 'CertificateStatus', ], ], ], 'RegisterCertificateResponse' => [ 'type' => 'structure', 'members' => [ 'certificateArn' => [ 'shape' => 'CertificateArn', ], 'certificateId' => [ 'shape' => 'CertificateId', ], ], ], 'RegistrationCode' => [ 'type' => 'string', 'min' => 64, 'max' => 64, 'pattern' => '(0x)?[a-fA-F0-9]+', ], 'RegistrationCodeValidationException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'RejectCertificateTransferRequest' => [ 'type' => 'structure', 'required' => [ 'certificateId', ], 'members' => [ 'certificateId' => [ 'shape' => 'CertificateId', 'location' => 'uri', 'locationName' => 'certificateId', ], 'rejectReason' => [ 'shape' => 'Message', ], ], ], 'RemoveThingType' => [ 'type' => 'boolean', ], 'ReplaceTopicRuleRequest' => [ 'type' => 'structure', 'required' => [ 'ruleName', 'topicRulePayload', ], 'members' => [ 'ruleName' => [ 'shape' => 'RuleName', 'location' => 'uri', 'locationName' => 'ruleName', ], 'topicRulePayload' => [ 'shape' => 'TopicRulePayload', ], ], 'payload' => 'topicRulePayload', ], 'RepublishAction' => [ 'type' => 'structure', 'required' => [ 'roleArn', 'topic', ], 'members' => [ 'roleArn' => [ 'shape' => 'AwsArn', ], 'topic' => [ 'shape' => 'TopicPattern', ], ], ], 'ResourceAlreadyExistsException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], 'resourceId' => [ 'shape' => 'resourceId', ], 'resourceArn' => [ 'shape' => 'resourceArn', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'ResourceNotFoundException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 404, ], 'exception' => true, ], 'RuleArn' => [ 'type' => 'string', ], 'RuleName' => [ 'type' => 'string', 'min' => 1, 'max' => 128, 'pattern' => '^[a-zA-Z0-9_]+$', ], 'S3Action' => [ 'type' => 'structure', 'required' => [ 'roleArn', 'bucketName', 'key', ], 'members' => [ 'roleArn' => [ 'shape' => 'AwsArn', ], 'bucketName' => [ 'shape' => 'BucketName', ], 'key' => [ 'shape' => 'Key', ], 'cannedAcl' => [ 'shape' => 'CannedAccessControlList', ], ], ], 'SQL' => [ 'type' => 'string', ], 'SearchableAttributes' => [ 'type' => 'list', 'member' => [ 'shape' => 'AttributeName', ], ], 'ServiceUnavailableException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 503, ], 'exception' => true, 'fault' => true, ], 'SetAsActive' => [ 'type' => 'boolean', ], 'SetAsActiveFlag' => [ 'type' => 'boolean', ], 'SetAsDefault' => [ 'type' => 'boolean', ], 'SetDefaultPolicyVersionRequest' => [ 'type' => 'structure', 'required' => [ 'policyName', 'policyVersionId', ], 'members' => [ 'policyName' => [ 'shape' => 'PolicyName', 'location' => 'uri', 'locationName' => 'policyName', ], 'policyVersionId' => [ 'shape' => 'PolicyVersionId', 'location' => 'uri', 'locationName' => 'policyVersionId', ], ], ], 'SetLoggingOptionsRequest' => [ 'type' => 'structure', 'required' => [ 'loggingOptionsPayload', ], 'members' => [ 'loggingOptionsPayload' => [ 'shape' => 'LoggingOptionsPayload', ], ], 'payload' => 'loggingOptionsPayload', ], 'SnsAction' => [ 'type' => 'structure', 'required' => [ 'targetArn', 'roleArn', ], 'members' => [ 'targetArn' => [ 'shape' => 'AwsArn', ], 'roleArn' => [ 'shape' => 'AwsArn', ], 'messageFormat' => [ 'shape' => 'MessageFormat', ], ], ], 'SqlParseException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 400, ], 'exception' => true, ], 'SqsAction' => [ 'type' => 'structure', 'required' => [ 'roleArn', 'queueUrl', ], 'members' => [ 'roleArn' => [ 'shape' => 'AwsArn', ], 'queueUrl' => [ 'shape' => 'QueueUrl', ], 'useBase64' => [ 'shape' => 'UseBase64', ], ], ], 'StateReason' => [ 'type' => 'string', ], 'StateValue' => [ 'type' => 'string', ], 'StreamName' => [ 'type' => 'string', ], 'TableName' => [ 'type' => 'string', ], 'ThingArn' => [ 'type' => 'string', ], 'ThingAttribute' => [ 'type' => 'structure', 'members' => [ 'thingName' => [ 'shape' => 'ThingName', ], 'thingTypeName' => [ 'shape' => 'ThingTypeName', ], 'attributes' => [ 'shape' => 'Attributes', ], 'version' => [ 'shape' => 'Version', ], ], ], 'ThingAttributeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ThingAttribute', ], ], 'ThingName' => [ 'type' => 'string', 'min' => 1, 'max' => 128, 'pattern' => '[a-zA-Z0-9:_-]+', ], 'ThingNameList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ThingName', ], ], 'ThingTypeArn' => [ 'type' => 'string', ], 'ThingTypeDefinition' => [ 'type' => 'structure', 'members' => [ 'thingTypeName' => [ 'shape' => 'ThingTypeName', ], 'thingTypeProperties' => [ 'shape' => 'ThingTypeProperties', ], 'thingTypeMetadata' => [ 'shape' => 'ThingTypeMetadata', ], ], ], 'ThingTypeDescription' => [ 'type' => 'string', 'max' => 2028, 'pattern' => '[\\p{Graph}\\x20]*', ], 'ThingTypeList' => [ 'type' => 'list', 'member' => [ 'shape' => 'ThingTypeDefinition', ], ], 'ThingTypeMetadata' => [ 'type' => 'structure', 'members' => [ 'deprecated' => [ 'shape' => 'Boolean', ], 'deprecationDate' => [ 'shape' => 'DeprecationDate', ], 'creationDate' => [ 'shape' => 'CreationDate', ], ], ], 'ThingTypeName' => [ 'type' => 'string', 'min' => 1, 'max' => 128, 'pattern' => '[a-zA-Z0-9:_-]+', ], 'ThingTypeProperties' => [ 'type' => 'structure', 'members' => [ 'thingTypeDescription' => [ 'shape' => 'ThingTypeDescription', ], 'searchableAttributes' => [ 'shape' => 'SearchableAttributes', ], ], ], 'ThrottlingException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 429, ], 'exception' => true, ], 'Topic' => [ 'type' => 'string', ], 'TopicPattern' => [ 'type' => 'string', ], 'TopicRule' => [ 'type' => 'structure', 'members' => [ 'ruleName' => [ 'shape' => 'RuleName', ], 'sql' => [ 'shape' => 'SQL', ], 'description' => [ 'shape' => 'Description', ], 'createdAt' => [ 'shape' => 'CreatedAtDate', ], 'actions' => [ 'shape' => 'ActionList', ], 'ruleDisabled' => [ 'shape' => 'IsDisabled', ], 'awsIotSqlVersion' => [ 'shape' => 'AwsIotSqlVersion', ], ], ], 'TopicRuleList' => [ 'type' => 'list', 'member' => [ 'shape' => 'TopicRuleListItem', ], ], 'TopicRuleListItem' => [ 'type' => 'structure', 'members' => [ 'ruleArn' => [ 'shape' => 'RuleArn', ], 'ruleName' => [ 'shape' => 'RuleName', ], 'topicPattern' => [ 'shape' => 'TopicPattern', ], 'createdAt' => [ 'shape' => 'CreatedAtDate', ], 'ruleDisabled' => [ 'shape' => 'IsDisabled', ], ], ], 'TopicRulePayload' => [ 'type' => 'structure', 'required' => [ 'sql', 'actions', ], 'members' => [ 'sql' => [ 'shape' => 'SQL', ], 'description' => [ 'shape' => 'Description', ], 'actions' => [ 'shape' => 'ActionList', ], 'ruleDisabled' => [ 'shape' => 'IsDisabled', ], 'awsIotSqlVersion' => [ 'shape' => 'AwsIotSqlVersion', ], ], ], 'TransferAlreadyCompletedException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 410, ], 'exception' => true, ], 'TransferCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'certificateId', 'targetAwsAccount', ], 'members' => [ 'certificateId' => [ 'shape' => 'CertificateId', 'location' => 'uri', 'locationName' => 'certificateId', ], 'targetAwsAccount' => [ 'shape' => 'AwsAccountId', 'location' => 'querystring', 'locationName' => 'targetAwsAccount', ], 'transferMessage' => [ 'shape' => 'Message', ], ], ], 'TransferCertificateResponse' => [ 'type' => 'structure', 'members' => [ 'transferredCertificateArn' => [ 'shape' => 'CertificateArn', ], ], ], 'TransferConflictException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'TransferData' => [ 'type' => 'structure', 'members' => [ 'transferMessage' => [ 'shape' => 'Message', ], 'rejectReason' => [ 'shape' => 'Message', ], 'transferDate' => [ 'shape' => 'DateType', ], 'acceptDate' => [ 'shape' => 'DateType', ], 'rejectDate' => [ 'shape' => 'DateType', ], ], ], 'UnauthorizedException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 401, ], 'exception' => true, ], 'UndoDeprecate' => [ 'type' => 'boolean', ], 'UpdateCACertificateRequest' => [ 'type' => 'structure', 'required' => [ 'certificateId', ], 'members' => [ 'certificateId' => [ 'shape' => 'CertificateId', 'location' => 'uri', 'locationName' => 'caCertificateId', ], 'newStatus' => [ 'shape' => 'CACertificateStatus', 'location' => 'querystring', 'locationName' => 'newStatus', ], 'newAutoRegistrationStatus' => [ 'shape' => 'AutoRegistrationStatus', 'location' => 'querystring', 'locationName' => 'newAutoRegistrationStatus', ], ], ], 'UpdateCertificateRequest' => [ 'type' => 'structure', 'required' => [ 'certificateId', 'newStatus', ], 'members' => [ 'certificateId' => [ 'shape' => 'CertificateId', 'location' => 'uri', 'locationName' => 'certificateId', ], 'newStatus' => [ 'shape' => 'CertificateStatus', 'location' => 'querystring', 'locationName' => 'newStatus', ], ], ], 'UpdateThingRequest' => [ 'type' => 'structure', 'required' => [ 'thingName', ], 'members' => [ 'thingName' => [ 'shape' => 'ThingName', 'location' => 'uri', 'locationName' => 'thingName', ], 'thingTypeName' => [ 'shape' => 'ThingTypeName', ], 'attributePayload' => [ 'shape' => 'AttributePayload', ], 'expectedVersion' => [ 'shape' => 'OptionalVersion', ], 'removeThingType' => [ 'shape' => 'RemoveThingType', ], ], ], 'UpdateThingResponse' => [ 'type' => 'structure', 'members' => [], ], 'UseBase64' => [ 'type' => 'boolean', ], 'Version' => [ 'type' => 'long', ], 'VersionConflictException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'VersionsLimitExceededException' => [ 'type' => 'structure', 'members' => [ 'message' => [ 'shape' => 'errorMessage', ], ], 'error' => [ 'httpStatusCode' => 409, ], 'exception' => true, ], 'errorMessage' => [ 'type' => 'string', ], 'resourceArn' => [ 'type' => 'string', ], 'resourceId' => [ 'type' => 'string', ], ],];
vshen009/ss3mod
vendor/aws/aws-sdk-php/src/data/iot/2015-05-28/api-2.json.php
PHP
mit
95,556
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@cryptsoft.com)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include <openssl/digest.h> #include <assert.h> #include <string.h> #include <openssl/md4.h> #include <openssl/md5.h> #include <openssl/obj.h> #include <openssl/sha.h> #include "internal.h" #if defined(NDEBUG) #define CHECK(x) (void) (x) #else #define CHECK(x) assert(x) #endif static void md4_init(EVP_MD_CTX *ctx) { CHECK(MD4_Init(ctx->md_data)); } static void md4_update(EVP_MD_CTX *ctx, const void *data, size_t count) { CHECK(MD4_Update(ctx->md_data, data, count)); } static void md4_final(EVP_MD_CTX *ctx, uint8_t *out) { CHECK(MD4_Final(out, ctx->md_data)); } static const EVP_MD md4_md = { NID_md4, MD4_DIGEST_LENGTH, 0 /* flags */, md4_init, md4_update, md4_final, 64 /* block size */, sizeof(MD4_CTX), }; const EVP_MD *EVP_md4(void) { return &md4_md; } static void md5_init(EVP_MD_CTX *ctx) { CHECK(MD5_Init(ctx->md_data)); } static void md5_update(EVP_MD_CTX *ctx, const void *data, size_t count) { CHECK(MD5_Update(ctx->md_data, data, count)); } static void md5_final(EVP_MD_CTX *ctx, uint8_t *out) { CHECK(MD5_Final(out, ctx->md_data)); } static const EVP_MD md5_md = { NID_md5, MD5_DIGEST_LENGTH, 0 /* flags */, md5_init, md5_update, md5_final, 64 /* block size */, sizeof(MD5_CTX), }; const EVP_MD *EVP_md5(void) { return &md5_md; } static void sha1_init(EVP_MD_CTX *ctx) { CHECK(SHA1_Init(ctx->md_data)); } static void sha1_update(EVP_MD_CTX *ctx, const void *data, size_t count) { CHECK(SHA1_Update(ctx->md_data, data, count)); } static void sha1_final(EVP_MD_CTX *ctx, uint8_t *md) { CHECK(SHA1_Final(md, ctx->md_data)); } static const EVP_MD sha1_md = { NID_sha1, SHA_DIGEST_LENGTH, 0 /* flags */, sha1_init, sha1_update, sha1_final, 64 /* block size */, sizeof(SHA_CTX), }; const EVP_MD *EVP_sha1(void) { return &sha1_md; } static void sha224_init(EVP_MD_CTX *ctx) { CHECK(SHA224_Init(ctx->md_data)); } static void sha224_update(EVP_MD_CTX *ctx, const void *data, size_t count) { CHECK(SHA224_Update(ctx->md_data, data, count)); } static void sha224_final(EVP_MD_CTX *ctx, uint8_t *md) { CHECK(SHA224_Final(md, ctx->md_data)); } static const EVP_MD sha224_md = { NID_sha224, SHA224_DIGEST_LENGTH, 0 /* flags */, sha224_init, sha224_update, sha224_final, 64 /* block size */, sizeof(SHA256_CTX), }; const EVP_MD *EVP_sha224(void) { return &sha224_md; } static void sha256_init(EVP_MD_CTX *ctx) { CHECK(SHA256_Init(ctx->md_data)); } static void sha256_update(EVP_MD_CTX *ctx, const void *data, size_t count) { CHECK(SHA256_Update(ctx->md_data, data, count)); } static void sha256_final(EVP_MD_CTX *ctx, uint8_t *md) { CHECK(SHA256_Final(md, ctx->md_data)); } static const EVP_MD sha256_md = { NID_sha256, SHA256_DIGEST_LENGTH, 0 /* flags */, sha256_init, sha256_update, sha256_final, 64 /* block size */, sizeof(SHA256_CTX), }; const EVP_MD *EVP_sha256(void) { return &sha256_md; } static void sha384_init(EVP_MD_CTX *ctx) { CHECK(SHA384_Init(ctx->md_data)); } static void sha384_update(EVP_MD_CTX *ctx, const void *data, size_t count) { CHECK(SHA384_Update(ctx->md_data, data, count)); } static void sha384_final(EVP_MD_CTX *ctx, uint8_t *md) { CHECK(SHA384_Final(md, ctx->md_data)); } static const EVP_MD sha384_md = { NID_sha384, SHA384_DIGEST_LENGTH, 0 /* flags */, sha384_init, sha384_update, sha384_final, 128 /* block size */, sizeof(SHA512_CTX), }; const EVP_MD *EVP_sha384(void) { return &sha384_md; } static void sha512_init(EVP_MD_CTX *ctx) { CHECK(SHA512_Init(ctx->md_data)); } static void sha512_update(EVP_MD_CTX *ctx, const void *data, size_t count) { CHECK(SHA512_Update(ctx->md_data, data, count)); } static void sha512_final(EVP_MD_CTX *ctx, uint8_t *md) { CHECK(SHA512_Final(md, ctx->md_data)); } static const EVP_MD sha512_md = { NID_sha512, SHA512_DIGEST_LENGTH, 0 /* flags */, sha512_init, sha512_update, sha512_final, 128 /* block size */, sizeof(SHA512_CTX), }; const EVP_MD *EVP_sha512(void) { return &sha512_md; } typedef struct { MD5_CTX md5; SHA_CTX sha1; } MD5_SHA1_CTX; static void md5_sha1_init(EVP_MD_CTX *md_ctx) { MD5_SHA1_CTX *ctx = md_ctx->md_data; CHECK(MD5_Init(&ctx->md5) && SHA1_Init(&ctx->sha1)); } static void md5_sha1_update(EVP_MD_CTX *md_ctx, const void *data, size_t count) { MD5_SHA1_CTX *ctx = md_ctx->md_data; CHECK(MD5_Update(&ctx->md5, data, count) && SHA1_Update(&ctx->sha1, data, count)); } static void md5_sha1_final(EVP_MD_CTX *md_ctx, uint8_t *out) { MD5_SHA1_CTX *ctx = md_ctx->md_data; CHECK(MD5_Final(out, &ctx->md5) && SHA1_Final(out + MD5_DIGEST_LENGTH, &ctx->sha1)); } static const EVP_MD md5_sha1_md = { NID_md5_sha1, MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH, 0 /* flags */, md5_sha1_init, md5_sha1_update, md5_sha1_final, 64 /* block size */, sizeof(MD5_SHA1_CTX), }; const EVP_MD *EVP_md5_sha1(void) { return &md5_sha1_md; } struct nid_to_digest { int nid; const EVP_MD* (*md_func)(void); const char *short_name; const char *long_name; }; static const struct nid_to_digest nid_to_digest_mapping[] = { { NID_md4, EVP_md4, SN_md4, LN_md4 }, { NID_md5, EVP_md5, SN_md5, LN_md5 }, { NID_sha1, EVP_sha1, SN_sha1, LN_sha1 }, { NID_sha224, EVP_sha224, SN_sha224, LN_sha224 }, { NID_sha256, EVP_sha256, SN_sha256, LN_sha256 }, { NID_sha384, EVP_sha384, SN_sha384, LN_sha384 }, { NID_sha512, EVP_sha512, SN_sha512, LN_sha512 }, { NID_md5_sha1, EVP_md5_sha1, SN_md5_sha1, LN_md5_sha1 }, { NID_dsaWithSHA, EVP_sha1, SN_dsaWithSHA, LN_dsaWithSHA }, { NID_dsaWithSHA1, EVP_sha1, SN_dsaWithSHA1, LN_dsaWithSHA1 }, { NID_ecdsa_with_SHA1, EVP_sha1, SN_ecdsa_with_SHA1, NULL }, { NID_md5WithRSAEncryption, EVP_md5, SN_md5WithRSAEncryption, LN_md5WithRSAEncryption }, { NID_sha1WithRSAEncryption, EVP_sha1, SN_sha1WithRSAEncryption, LN_sha1WithRSAEncryption }, { NID_sha224WithRSAEncryption, EVP_sha224, SN_sha224WithRSAEncryption, LN_sha224WithRSAEncryption }, { NID_sha256WithRSAEncryption, EVP_sha256, SN_sha256WithRSAEncryption, LN_sha256WithRSAEncryption }, { NID_sha384WithRSAEncryption, EVP_sha384, SN_sha384WithRSAEncryption, LN_sha384WithRSAEncryption }, { NID_sha512WithRSAEncryption, EVP_sha512, SN_sha512WithRSAEncryption, LN_sha512WithRSAEncryption }, }; const EVP_MD* EVP_get_digestbynid(int nid) { unsigned i; for (i = 0; i < sizeof(nid_to_digest_mapping) / sizeof(struct nid_to_digest); i++) { if (nid_to_digest_mapping[i].nid == nid) { return nid_to_digest_mapping[i].md_func(); } } return NULL; } const EVP_MD* EVP_get_digestbyobj(const ASN1_OBJECT *obj) { return EVP_get_digestbynid(OBJ_obj2nid(obj)); } const EVP_MD *EVP_get_digestbyname(const char *name) { unsigned i; for (i = 0; i < sizeof(nid_to_digest_mapping) / sizeof(struct nid_to_digest); i++) { const char *short_name = nid_to_digest_mapping[i].short_name; const char *long_name = nid_to_digest_mapping[i].long_name; if ((short_name && strcmp(short_name, name) == 0) || (long_name && strcmp(long_name, name) == 0)) { return nid_to_digest_mapping[i].md_func(); } } return NULL; }
Qlwentt/walle
node_modules/grpc/third_party/boringssl/crypto/digest/digests.c
C
mit
10,545
<?php require_once '../../src/Google_Client.php'; require_once '../../src/contrib/Google_SiteVerificationService.php'; session_start(); $client = new Google_Client(); $client->setApplicationName("Google Site Verification PHP Sample"); // Visit https://code.google.com/apis/console?api=siteVerification to generate // your client id, client secret, and to register your redirect uri. // $client->setClientId('insert_your_oauth2_client_id'); // $client->setClientSecret('insert_your_oauth2_client_secret'); // $client->setRedirectUri('insert_your_oauth2_redirect_uri'); // $client->setDeveloperKey('insert_your_developer_key'); $service = new Google_SiteVerificationService($client); if (isset($_GET['logout'])) { unset($_SESSION['token']); } if (isset($_GET['code'])) { $client->authenticate(); $_SESSION['token'] = $client->getAccessToken(); $redirect = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL)); } if (isset($_SESSION['token'])) { $client->setAccessToken($_SESSION['token']); } if ($client->getAccessToken()) { $resources = $service->webResource->listWebResource(); print '<pre>' . print_r($resources, true) . '</pre>'; $_SESSION['token'] = $client->getAccessToken(); } else { $authUrl = $client->createAuthUrl(); print "<a class='login' href='$authUrl'>Connect Me!</a>"; }
mpgn/swindle
Swindle-Foundation5/google-api-php-client/examples/siteVerification/simple.php
PHP
mit
1,385
;(function(){ // CommonJS require() function require(p){ var path = require.resolve(p) , mod = require.modules[path]; if (!mod) throw new Error('failed to require "' + p + '"'); if (!mod.exports) { mod.exports = {}; mod.call(mod.exports, mod, mod.exports, require.relative(path)); } return mod.exports; } require.modules = {}; require.resolve = function (path){ var orig = path , reg = path + '.js' , index = path + '/index.js'; return require.modules[reg] && reg || require.modules[index] && index || orig; }; require.register = function (path, fn){ require.modules[path] = fn; }; require.relative = function (parent) { return function(p){ if ('.' != p.charAt(0)) return require(p); var path = parent.split('/') , segs = p.split('/'); path.pop(); for (var i = 0; i < segs.length; i++) { var seg = segs[i]; if ('..' == seg) path.pop(); else if ('.' != seg) path.push(seg); } return require(path.join('/')); }; }; require.register("browser/debug.js", function(module, exports, require){ module.exports = function(type){ return function(){ } }; }); // module: browser/debug.js require.register("browser/diff.js", function(module, exports, require){ }); // module: browser/diff.js require.register("browser/events.js", function(module, exports, require){ /** * Module exports. */ exports.EventEmitter = EventEmitter; /** * Check if `obj` is an array. */ function isArray(obj) { return '[object Array]' == {}.toString.call(obj); } /** * Event emitter constructor. * * @api public. */ function EventEmitter(){}; /** * Adds a listener. * * @api public */ EventEmitter.prototype.on = function (name, fn) { if (!this.$events) { this.$events = {}; } if (!this.$events[name]) { this.$events[name] = fn; } else if (isArray(this.$events[name])) { this.$events[name].push(fn); } else { this.$events[name] = [this.$events[name], fn]; } return this; }; EventEmitter.prototype.addListener = EventEmitter.prototype.on; /** * Adds a volatile listener. * * @api public */ EventEmitter.prototype.once = function (name, fn) { var self = this; function on () { self.removeListener(name, on); fn.apply(this, arguments); }; on.listener = fn; this.on(name, on); return this; }; /** * Removes a listener. * * @api public */ EventEmitter.prototype.removeListener = function (name, fn) { if (this.$events && this.$events[name]) { var list = this.$events[name]; if (isArray(list)) { var pos = -1; for (var i = 0, l = list.length; i < l; i++) { if (list[i] === fn || (list[i].listener && list[i].listener === fn)) { pos = i; break; } } if (pos < 0) { return this; } list.splice(pos, 1); if (!list.length) { delete this.$events[name]; } } else if (list === fn || (list.listener && list.listener === fn)) { delete this.$events[name]; } } return this; }; /** * Removes all listeners for an event. * * @api public */ EventEmitter.prototype.removeAllListeners = function (name) { if (name === undefined) { this.$events = {}; return this; } if (this.$events && this.$events[name]) { this.$events[name] = null; } return this; }; /** * Gets all listeners for a certain event. * * @api publci */ EventEmitter.prototype.listeners = function (name) { if (!this.$events) { this.$events = {}; } if (!this.$events[name]) { this.$events[name] = []; } if (!isArray(this.$events[name])) { this.$events[name] = [this.$events[name]]; } return this.$events[name]; }; /** * Emits an event. * * @api public */ EventEmitter.prototype.emit = function (name) { if (!this.$events) { return false; } var handler = this.$events[name]; if (!handler) { return false; } var args = [].slice.call(arguments, 1); if ('function' == typeof handler) { handler.apply(this, args); } else if (isArray(handler)) { var listeners = handler.slice(); for (var i = 0, l = listeners.length; i < l; i++) { listeners[i].apply(this, args); } } else { return false; } return true; }; }); // module: browser/events.js require.register("browser/fs.js", function(module, exports, require){ }); // module: browser/fs.js require.register("browser/path.js", function(module, exports, require){ }); // module: browser/path.js require.register("browser/progress.js", function(module, exports, require){ /** * Expose `Progress`. */ module.exports = Progress; /** * Initialize a new `Progress` indicator. */ function Progress() { this.percent = 0; this.size(0); this.fontSize(11); this.font('helvetica, arial, sans-serif'); } /** * Set progress size to `n`. * * @param {Number} n * @return {Progress} for chaining * @api public */ Progress.prototype.size = function(n){ this._size = n; return this; }; /** * Set text to `str`. * * @param {String} str * @return {Progress} for chaining * @api public */ Progress.prototype.text = function(str){ this._text = str; return this; }; /** * Set font size to `n`. * * @param {Number} n * @return {Progress} for chaining * @api public */ Progress.prototype.fontSize = function(n){ this._fontSize = n; return this; }; /** * Set font `family`. * * @param {String} family * @return {Progress} for chaining */ Progress.prototype.font = function(family){ this._font = family; return this; }; /** * Update percentage to `n`. * * @param {Number} n * @return {Progress} for chaining */ Progress.prototype.update = function(n){ this.percent = n; return this; }; /** * Draw on `ctx`. * * @param {CanvasRenderingContext2d} ctx * @return {Progress} for chaining */ Progress.prototype.draw = function(ctx){ var percent = Math.min(this.percent, 100) , size = this._size , half = size / 2 , x = half , y = half , rad = half - 1 , fontSize = this._fontSize; ctx.font = fontSize + 'px ' + this._font; var angle = Math.PI * 2 * (percent / 100); ctx.clearRect(0, 0, size, size); // outer circle ctx.strokeStyle = '#9f9f9f'; ctx.beginPath(); ctx.arc(x, y, rad, 0, angle, false); ctx.stroke(); // inner circle ctx.strokeStyle = '#eee'; ctx.beginPath(); ctx.arc(x, y, rad - 1, 0, angle, true); ctx.stroke(); // text var text = this._text || (percent | 0) + '%' , w = ctx.measureText(text).width; ctx.fillText( text , x - w / 2 + 1 , y + fontSize / 2 - 1); return this; }; }); // module: browser/progress.js require.register("browser/tty.js", function(module, exports, require){ exports.isatty = function(){ return true; }; exports.getWindowSize = function(){ return [window.innerHeight, window.innerWidth]; }; }); // module: browser/tty.js require.register("context.js", function(module, exports, require){ /** * Expose `Context`. */ module.exports = Context; /** * Initialize a new `Context`. * * @api private */ function Context(){} /** * Set the context `Test` to `test`. * * @param {Test} test * @return {Context} * @api private */ Context.prototype.test = function(test){ this._test = test; return this; }; /** * Set test timeout `ms`. * * @param {Number} ms * @return {Context} self * @api private */ Context.prototype.timeout = function(ms){ this._test.timeout(ms); return this; }; /** * Inspect the context void of `._test`. * * @return {String} * @api private */ Context.prototype.inspect = function(){ return JSON.stringify(this, function(key, val){ return '_test' == key ? undefined : val; }, 2); }; }); // module: context.js require.register("hook.js", function(module, exports, require){ /** * Module dependencies. */ var Runnable = require('./runnable'); /** * Expose `Hook`. */ module.exports = Hook; /** * Initialize a new `Hook` with the given `title` and callback `fn`. * * @param {String} title * @param {Function} fn * @api private */ function Hook(title, fn) { Runnable.call(this, title, fn); this.type = 'hook'; } /** * Inherit from `Runnable.prototype`. */ Hook.prototype = new Runnable; Hook.prototype.constructor = Hook; }); // module: hook.js require.register("interfaces/bdd.js", function(module, exports, require){ /** * Module dependencies. */ var Suite = require('../suite') , Test = require('../test'); /** * BDD-style interface: * * describe('Array', function(){ * describe('#indexOf()', function(){ * it('should return -1 when not present', function(){ * * }); * * it('should return the index when present', function(){ * * }); * }); * }); * */ module.exports = function(suite){ var suites = [suite]; suite.on('pre-require', function(context){ // noop variants context.xdescribe = function(){}; context.xit = function(){}; /** * Execute before running tests. */ context.before = function(fn){ suites[0].beforeAll(fn); }; /** * Execute after running tests. */ context.after = function(fn){ suites[0].afterAll(fn); }; /** * Execute before each test case. */ context.beforeEach = function(fn){ suites[0].beforeEach(fn); }; /** * Execute after each test case. */ context.afterEach = function(fn){ suites[0].afterEach(fn); }; /** * Describe a "suite" with the given `title` * and callback `fn` containing nested suites * and/or tests. */ context.describe = function(title, fn){ var suite = Suite.create(suites[0], title); suites.unshift(suite); fn(); suites.shift(); }; /** * Describe a specification or test-case * with the given `title` and callback `fn` * acting as a thunk. */ context.it = function(title, fn){ suites[0].addTest(new Test(title, fn)); }; }); }; }); // module: interfaces/bdd.js require.register("interfaces/exports.js", function(module, exports, require){ /** * Module dependencies. */ var Suite = require('../suite') , Test = require('../test'); /** * TDD-style interface: * * exports.Array = { * '#indexOf()': { * 'should return -1 when the value is not present': function(){ * * }, * * 'should return the correct index when the value is present': function(){ * * } * } * }; * */ module.exports = function(suite){ var suites = [suite]; suite.on('require', visit); function visit(obj) { var suite; for (var key in obj) { if ('function' == typeof obj[key]) { var fn = obj[key]; switch (key) { case 'before': suites[0].beforeAll(fn); break; case 'after': suites[0].afterAll(fn); break; case 'beforeEach': suites[0].beforeEach(fn); break; case 'afterEach': suites[0].afterEach(fn); break; default: suites[0].addTest(new Test(key, fn)); } } else { var suite = Suite.create(suites[0], key); suites.unshift(suite); visit(obj[key]); suites.shift(); } } } }; }); // module: interfaces/exports.js require.register("interfaces/index.js", function(module, exports, require){ exports.bdd = require('./bdd'); exports.tdd = require('./tdd'); exports.qunit = require('./qunit'); exports.exports = require('./exports'); }); // module: interfaces/index.js require.register("interfaces/qunit.js", function(module, exports, require){ /** * Module dependencies. */ var Suite = require('../suite') , Test = require('../test'); /** * QUnit-style interface: * * suite('Array'); * * test('#length', function(){ * var arr = [1,2,3]; * ok(arr.length == 3); * }); * * test('#indexOf()', function(){ * var arr = [1,2,3]; * ok(arr.indexOf(1) == 0); * ok(arr.indexOf(2) == 1); * ok(arr.indexOf(3) == 2); * }); * * suite('String'); * * test('#length', function(){ * ok('foo'.length == 3); * }); * */ module.exports = function(suite){ var suites = [suite]; suite.on('pre-require', function(context){ /** * Execute before running tests. */ context.before = function(fn){ suites[0].beforeAll(fn); }; /** * Execute after running tests. */ context.after = function(fn){ suites[0].afterAll(fn); }; /** * Execute before each test case. */ context.beforeEach = function(fn){ suites[0].beforeEach(fn); }; /** * Execute after each test case. */ context.afterEach = function(fn){ suites[0].afterEach(fn); }; /** * Describe a "suite" with the given `title`. */ context.suite = function(title){ if (suites.length > 1) suites.shift(); var suite = Suite.create(suites[0], title); suites.unshift(suite); }; /** * Describe a specification or test-case * with the given `title` and callback `fn` * acting as a thunk. */ context.test = function(title, fn){ suites[0].addTest(new Test(title, fn)); }; }); }; }); // module: interfaces/qunit.js require.register("interfaces/tdd.js", function(module, exports, require){ /** * Module dependencies. */ var Suite = require('../suite') , Test = require('../test'); /** * TDD-style interface: * * suite('Array', function(){ * suite('#indexOf()', function(){ * suiteSetup(function(){ * * }); * * test('should return -1 when not present', function(){ * * }); * * test('should return the index when present', function(){ * * }); * * suiteTeardown(function(){ * * }); * }); * }); * */ module.exports = function(suite){ var suites = [suite]; suite.on('pre-require', function(context){ /** * Execute before each test case. */ context.setup = function(fn){ suites[0].beforeEach(fn); }; /** * Execute after each test case. */ context.teardown = function(fn){ suites[0].afterEach(fn); }; /** * Execute before the suite. */ context.suiteSetup = function(fn){ suites[0].beforeAll(fn); }; /** * Execute after the suite. */ context.suiteTeardown = function(fn){ suites[0].afterAll(fn); }; /** * Describe a "suite" with the given `title` * and callback `fn` containing nested suites * and/or tests. */ context.suite = function(title, fn){ var suite = Suite.create(suites[0], title); suites.unshift(suite); fn(); suites.shift(); }; /** * Describe a specification or test-case * with the given `title` and callback `fn` * acting as a thunk. */ context.test = function(title, fn){ suites[0].addTest(new Test(title, fn)); }; }); }; }); // module: interfaces/tdd.js require.register("mocha.js", function(module, exports, require){ /*! * mocha * Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca> * MIT Licensed */ /** * Library version. */ exports.version = '0.14.0'; exports.utils = require('./utils'); exports.interfaces = require('./interfaces'); exports.reporters = require('./reporters'); exports.Runnable = require('./runnable'); exports.Context = require('./context'); exports.Runner = require('./runner'); exports.Suite = require('./suite'); exports.Hook = require('./hook'); exports.Test = require('./test'); }); // module: mocha.js require.register("reporters/base.js", function(module, exports, require){ /** * Module dependencies. */ var tty = require('browser/tty') , diff = require('browser/diff'); /** * Check if both stdio streams are associated with a tty. */ var isatty = tty.isatty(1) && tty.isatty(2); /** * Expose `Base`. */ exports = module.exports = Base; /** * Enable coloring by default. */ exports.useColors = isatty; /** * Default color map. */ exports.colors = { 'pass': 90 , 'fail': 31 , 'bright pass': 92 , 'bright fail': 91 , 'bright yellow': 93 , 'pending': 36 , 'suite': 0 , 'error title': 0 , 'error message': 31 , 'error stack': 90 , 'checkmark': 32 , 'fast': 90 , 'medium': 33 , 'slow': 31 , 'green': 32 , 'light': 90 , 'diff gutter': 90 , 'diff added': 42 , 'diff removed': 41 }; /** * Color `str` with the given `type`, * allowing colors to be disabled, * as well as user-defined color * schemes. * * @param {String} type * @param {String} str * @return {String} * @api private */ var color = exports.color = function(type, str) { if (!exports.useColors) return str; return '\033[' + exports.colors[type] + 'm' + str + '\033[0m'; }; /** * Expose term window size, with some * defaults for when stderr is not a tty. */ exports.window = { width: isatty ? process.stdout.getWindowSize ? process.stdout.getWindowSize(1)[0] : tty.getWindowSize()[1] : 75 }; /** * Expose some basic cursor interactions * that are common among reporters. */ exports.cursor = { hide: function(){ process.stdout.write('\033[?25l'); }, show: function(){ process.stdout.write('\033[?25h'); }, deleteLine: function(){ process.stdout.write('\033[2K'); }, beginningOfLine: function(){ process.stdout.write('\033[0G'); }, CR: function(){ exports.cursor.deleteLine(); exports.cursor.beginningOfLine(); } }; /** * A test is considered slow if it * exceeds the following value in milliseconds. */ exports.slow = 75; /** * Outut the given `failures` as a list. * * @param {Array} failures * @api public */ exports.list = function(failures){ console.error(); failures.forEach(function(test, i){ // format var fmt = color('error title', ' %s) %s:\n') + color('error message', ' %s') + color('error stack', '\n%s\n'); // msg var err = test.err , message = err.message || '' , stack = err.stack || message , index = stack.indexOf(message) + message.length , msg = stack.slice(0, index) , actual = err.actual , expected = err.expected; // actual / expected diff if ('string' == typeof actual && 'string' == typeof expected) { var len = Math.max(actual.length, expected.length); if (len < 20) msg = errorDiff(err, 'Chars'); else msg = errorDiff(err, 'Words'); // linenos var lines = msg.split('\n'); if (lines.length > 4) { var width = String(lines.length).length; msg = lines.map(function(str, i){ return pad(++i, width) + ' |' + ' ' + str; }).join('\n'); } // legend msg = '\n' + color('diff removed', 'actual') + ' ' + color('diff added', 'expected') + '\n\n' + msg + '\n'; // indent msg = msg.replace(/^/gm, ' '); fmt = color('error title', ' %s) %s:\n%s') + color('error stack', '\n%s\n'); } // indent stack trace without msg stack = stack.slice(index + 1) .replace(/^/gm, ' '); console.error(fmt, (i + 1), test.fullTitle(), msg, stack); }); }; /** * Initialize a new `Base` reporter. * * All other reporters generally * inherit from this reporter, providing * stats such as test duration, number * of tests passed / failed etc. * * @param {Runner} runner * @api public */ function Base(runner) { var self = this , stats = this.stats = { suites: 0, tests: 0, passes: 0, failures: 0 } , failures = this.failures = []; if (!runner) return; this.runner = runner; runner.on('start', function(){ stats.start = new Date; }); runner.on('suite', function(suite){ stats.suites = stats.suites || 0; suite.root || stats.suites++; }); runner.on('test end', function(test){ stats.tests = stats.tests || 0; stats.tests++; }); runner.on('pass', function(test){ stats.passes = stats.passes || 0; var medium = exports.slow / 2; test.speed = test.duration > exports.slow ? 'slow' : test.duration > medium ? 'medium' : 'fast'; stats.passes++; }); runner.on('fail', function(test, err){ stats.failures = stats.failures || 0; stats.failures++; test.err = err; failures.push(test); }); runner.on('end', function(){ stats.end = new Date; stats.duration = new Date - stats.start; }); } /** * Output common epilogue used by many of * the bundled reporters. * * @api public */ Base.prototype.epilogue = function(){ var stats = this.stats , fmt; console.log(); // failure if (stats.failures) { fmt = color('bright fail', ' βœ–') + color('fail', ' %d of %d tests failed') + color('light', ':') console.error(fmt, stats.failures, this.runner.total); Base.list(this.failures); console.error(); return; } // pass fmt = color('bright pass', ' βœ”') + color('green', ' %d tests complete') + color('light', ' (%dms)'); console.log(fmt, stats.tests || 0, stats.duration); console.log(); }; /** * Pad the given `str` to `len`. * * @param {String} str * @param {String} len * @return {String} * @api private */ function pad(str, len) { str = String(str); return Array(len - str.length + 1).join(' ') + str; } /** * Return a character diff for `err`. * * @param {Error} err * @return {String} * @api private */ function errorDiff(err, type) { return diff['diff' + type](err.actual, err.expected).map(function(str){ if (str.added) return colorLines('diff added', str.value); if (str.removed) return colorLines('diff removed', str.value); return str.value; }).join(''); } /** * Color lines for `str`, using the color `name`. * * @param {String} name * @param {String} str * @return {String} * @api private */ function colorLines(name, str) { return str.split('\n').map(function(str){ return color(name, str); }).join('\n'); } }); // module: reporters/base.js require.register("reporters/doc.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , utils = require('../utils'); /** * Expose `Doc`. */ exports = module.exports = Doc; /** * Initialize a new `Doc` reporter. * * @param {Runner} runner * @api public */ function Doc(runner) { Base.call(this, runner); var self = this , stats = this.stats , total = runner.total , indents = 2; function indent() { return Array(indents).join(' '); } runner.on('suite', function(suite){ if (suite.root) return; ++indents; console.log('%s<section class="suite">', indent()); ++indents; console.log('%s<h1>%s</h1>', indent(), suite.title); console.log('%s<dl>', indent()); }); runner.on('suite end', function(suite){ if (suite.root) return; console.log('%s</dl>', indent()); --indents; console.log('%s</section>', indent()); --indents; }); runner.on('pass', function(test){ console.log('%s <dt>%s</dt>', indent(), test.title); var code = utils.escape(clean(test.fn.toString())); console.log('%s <dd><pre><code>%s</code></pre></dd>', indent(), code); }); } /** * Strip the function definition from `str`, * and re-indent for pre whitespace. */ function clean(str) { str = str .replace(/^function *\(.*\) *{/, '') .replace(/\s+\}$/, ''); var spaces = str.match(/^\n?( *)/)[1].length , re = new RegExp('^ {' + spaces + '}', 'gm'); str = str.replace(re, ''); return str; } }); // module: reporters/doc.js require.register("reporters/dot.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , color = Base.color; /** * Expose `Dot`. */ exports = module.exports = Dot; /** * Initialize a new `Dot` matrix test reporter. * * @param {Runner} runner * @api public */ function Dot(runner) { Base.call(this, runner); var self = this , stats = this.stats , width = Base.window.width * .75 | 0 , n = 0; runner.on('start', function(){ process.stdout.write('\n '); }); runner.on('pending', function(test){ process.stdout.write(color('pending', '.')); }); runner.on('pass', function(test){ if (++n % width == 0) process.stdout.write('\n '); if ('slow' == test.speed) { process.stdout.write(color('bright yellow', '.')); } else { process.stdout.write(color(test.speed, '.')); } }); runner.on('fail', function(test, err){ if (++n % width == 0) process.stdout.write('\n '); process.stdout.write(color('fail', '.')); }); runner.on('end', function(){ console.log(); self.epilogue(); }); } /** * Inherit from `Base.prototype`. */ Dot.prototype = new Base; Dot.prototype.constructor = Dot; }); // module: reporters/dot.js require.register("reporters/html-cov.js", function(module, exports, require){ /** * Module dependencies. */ var JSONCov = require('./json-cov') , fs = require('browser/fs'); /** * Expose `HTMLCov`. */ exports = module.exports = HTMLCov; /** * Initialize a new `JsCoverage` reporter. * * @param {Runner} runner * @api public */ function HTMLCov(runner) { var jade = require('jade') , file = __dirname + '/templates/coverage.jade' , str = fs.readFileSync(file, 'utf8') , fn = jade.compile(str, { filename: file }) , self = this; JSONCov.call(this, runner, false); runner.on('end', function(){ process.stdout.write(fn({ cov: self.cov , coverageClass: coverageClass })); }); } function coverageClass(n) { if (n >= 75) return 'high'; if (n >= 50) return 'medium'; if (n >= 25) return 'low'; return 'terrible'; } }); // module: reporters/html-cov.js require.register("reporters/html.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , utils = require('../utils') , Progress = require('../browser/progress') , escape = utils.escape; /** * Expose `Doc`. */ exports = module.exports = HTML; /** * Stats template. */ var statsTemplate = '<ul id="stats">' + '<li class="progress"><canvas width="40" height="40"></canvas></li>' + '<li class="passes">passes: <em>0</em></li>' + '<li class="failures">failures: <em>0</em></li>' + '<li class="duration">duration: <em>0</em>s</li>' + '</ul>'; /** * Initialize a new `Doc` reporter. * * @param {Runner} runner * @api public */ function HTML(runner) { Base.call(this, runner); var self = this , stats = this.stats , total = runner.total , root = document.getElementById('mocha') , stat = fragment(statsTemplate) , items = stat.getElementsByTagName('li') , passes = items[1].getElementsByTagName('em')[0] , failures = items[2].getElementsByTagName('em')[0] , duration = items[3].getElementsByTagName('em')[0] , canvas = stat.getElementsByTagName('canvas')[0] , stack = [root] , progress , ctx if (canvas.getContext) { ctx = canvas.getContext('2d'); progress = new Progress; } if (!root) return error('#mocha div missing, add it to your document'); root.appendChild(stat); if (progress) progress.size(40); runner.on('suite', function(suite){ if (suite.root) return; // suite var el = fragment('<div class="suite"><h1>%s</h1></div>', suite.title); // container stack[0].appendChild(el); stack.unshift(document.createElement('div')); el.appendChild(stack[0]); }); runner.on('suite end', function(suite){ if (suite.root) return; stack.shift(); }); runner.on('fail', function(test, err){ if (err.uncaught) runner.emit('test end', test); }); runner.on('test end', function(test){ // TODO: add to stats var percent = stats.tests / total * 100 | 0; if (progress) progress.update(percent).draw(ctx); // update stats var ms = new Date - stats.start; text(passes, stats.passes); text(failures, stats.failures); text(duration, (ms / 1000).toFixed(2)); // test if ('passed' == test.state) { var el = fragment('<div class="test pass"><h2>%e</h2></div>', test.title); } else if (test.pending) { var el = fragment('<div class="test pass pending"><h2>%e</h2></div>', test.title); } else { var el = fragment('<div class="test fail"><h2>%e</h2></div>', test.title); var str = test.err.stack || test.err; // <=IE7 stringifies to [Object Error]. Since it can be overloaded, we // check for the result of the stringifying. if ('[object Error]' == str) str = test.err.message; el.appendChild(fragment('<pre class="error">%e</pre>', str)); } // toggle code var h2 = el.getElementsByTagName('h2')[0]; on(h2, 'click', function(){ pre.style.display = 'none' == pre.style.display ? 'block' : 'none'; }); // code // TODO: defer if (!test.pending) { var pre = fragment('<pre><code>%e</code></pre>', clean(test.fn.toString())); el.appendChild(pre); pre.style.display = 'none'; } stack[0].appendChild(el); }); } /** * Display error `msg`. */ function error(msg) { document.body.appendChild(fragment('<div id="error">%s</div>', msg)); } /** * Return a DOM fragment from `html`. */ function fragment(html) { var args = arguments , div = document.createElement('div') , i = 1; div.innerHTML = html.replace(/%([se])/g, function(_, type){ switch (type) { case 's': return String(args[i++]); case 'e': return escape(args[i++]); } }); return div.firstChild; } /** * Set `el` text to `str`. */ function text(el, str) { if (el.textContent) { el.textContent = str; } else { el.innerText = str; } } /** * Listen on `event` with callback `fn`. */ function on(el, event, fn) { if (el.addEventListener) { el.addEventListener(event, fn, false); } else { el.attachEvent('on' + event, fn); } } /** * Strip the function definition from `str`, * and re-indent for pre whitespace. */ function clean(str) { str = str .replace(/^function *\(.*\) *{/, '') .replace(/\s+\}$/, ''); var spaces = str.match(/^\n?( *)/)[1].length , re = new RegExp('^ {' + spaces + '}', 'gm'); str = str .replace(re, '') .replace(/^\s+/, ''); return str; } }); // module: reporters/html.js require.register("reporters/index.js", function(module, exports, require){ exports.Base = require('./base'); exports.Dot = require('./dot'); exports.Doc = require('./doc'); exports.TAP = require('./tap'); exports.JSON = require('./json'); exports.HTML = require('./html'); exports.List = require('./list'); exports.Spec = require('./spec'); exports.Progress = require('./progress'); exports.Landing = require('./landing'); exports.JSONCov = require('./json-cov'); exports.HTMLCov = require('./html-cov'); exports.JSONStream = require('./json-stream'); exports.XUnit = require('./xunit') }); // module: reporters/index.js require.register("reporters/json-cov.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base'); /** * Expose `JSONCov`. */ exports = module.exports = JSONCov; /** * Initialize a new `JsCoverage` reporter. * * @param {Runner} runner * @param {Boolean} output * @api public */ function JSONCov(runner, output) { var self = this , output = 1 == arguments.length ? true : output; Base.call(this, runner); var tests = [] , failures = [] , passes = []; runner.on('test end', function(test){ tests.push(test); }); runner.on('pass', function(test){ passes.push(test); }); runner.on('fail', function(test){ failures.push(test); }); runner.on('end', function(){ var cov = global._$jscoverage || {}; var result = self.cov = map(cov); result.stats = self.stats; result.tests = tests.map(clean); result.failures = failures.map(clean); result.passes = passes.map(clean); if (!output) return; process.stdout.write(JSON.stringify(result, null, 2 )); }); } /** * Map jscoverage data to a JSON structure * suitable for reporting. * * @param {Object} cov * @return {Object} * @api private */ function map(cov) { var ret = { instrumentation: 'node-jscoverage' , sloc: 0 , hits: 0 , misses: 0 , coverage: 0 , files: [] }; for (var filename in cov) { var data = coverage(filename, cov[filename]); ret.files.push(data); ret.hits += data.hits; ret.misses += data.misses; ret.sloc += data.sloc; } if (ret.sloc > 0) { ret.coverage = (ret.hits / ret.sloc) * 100; } return ret; }; /** * Map jscoverage data for a single source file * to a JSON structure suitable for reporting. * * @param {String} filename name of the source file * @param {Object} data jscoverage coverage data * @return {Object} * @api private */ function coverage(filename, data) { var ret = { filename: filename, coverage: 0, hits: 0, misses: 0, sloc: 0, source: {} }; data.source.forEach(function(line, num){ num++; if (data[num] === 0) { ret.misses++; ret.sloc++; } else if (data[num] !== undefined) { ret.hits++; ret.sloc++; } ret.source[num] = { source: line , coverage: data[num] === undefined ? '' : data[num] }; }); ret.coverage = ret.hits / ret.sloc * 100; return ret; } /** * Return a plain-object representation of `test` * free of cyclic properties etc. * * @param {Object} test * @return {Object} * @api private */ function clean(test) { return { title: test.title , fullTitle: test.fullTitle() , duration: test.duration } } }); // module: reporters/json-cov.js require.register("reporters/json-stream.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , color = Base.color; /** * Expose `List`. */ exports = module.exports = List; /** * Initialize a new `List` test reporter. * * @param {Runner} runner * @api public */ function List(runner) { Base.call(this, runner); var self = this , stats = this.stats , total = runner.total; runner.on('start', function(){ console.log(JSON.stringify(['start', { total: total }])); }); runner.on('pass', function(test){ console.log(JSON.stringify(['pass', clean(test)])); }); runner.on('fail', function(test, err){ console.log(JSON.stringify(['fail', clean(test)])); }); runner.on('end', function(){ process.stdout.write(JSON.stringify(['end', self.stats])); }); } /** * Return a plain-object representation of `test` * free of cyclic properties etc. * * @param {Object} test * @return {Object} * @api private */ function clean(test) { return { title: test.title , fullTitle: test.fullTitle() , duration: test.duration } } }); // module: reporters/json-stream.js require.register("reporters/json.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , cursor = Base.cursor , color = Base.color; /** * Expose `JSON`. */ exports = module.exports = JSONReporter; /** * Initialize a new `JSON` reporter. * * @param {Runner} runner * @api public */ function JSONReporter(runner) { var self = this; Base.call(this, runner); var tests = [] , failures = [] , passes = []; runner.on('test end', function(test){ tests.push(test); }); runner.on('pass', function(test){ passes.push(test); }); runner.on('fail', function(test){ failures.push(test); }); runner.on('end', function(){ var obj = { stats: self.stats , tests: tests.map(clean) , failures: failures.map(clean) , passes: passes.map(clean) }; process.stdout.write(JSON.stringify(obj, null, 2)); }); } /** * Return a plain-object representation of `test` * free of cyclic properties etc. * * @param {Object} test * @return {Object} * @api private */ function clean(test) { return { title: test.title , fullTitle: test.fullTitle() , duration: test.duration } } }); // module: reporters/json.js require.register("reporters/landing.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , cursor = Base.cursor , color = Base.color; /** * Expose `Landing`. */ exports = module.exports = Landing; /** * Airplane color. */ Base.colors.plane = 0; /** * Airplane crash color. */ Base.colors['plane crash'] = 31; /** * Runway color. */ Base.colors.runway = 90; /** * Initialize a new `Landing` reporter. * * @param {Runner} runner * @api public */ function Landing(runner) { Base.call(this, runner); var self = this , stats = this.stats , width = Base.window.width * .75 | 0 , total = runner.total , stream = process.stdout , plane = color('plane', '✈') , crashed = -1 , n = 0; function runway() { var buf = Array(width).join('-'); return ' ' + color('runway', buf); } runner.on('start', function(){ stream.write('\n '); cursor.hide(); }); runner.on('test end', function(test){ // check if the plane crashed var col = -1 == crashed ? width * ++n / total | 0 : crashed; // show the crash if ('failed' == test.state) { plane = color('plane crash', '✈'); crashed = col; } // render landing strip stream.write('\033[4F\n\n'); stream.write(runway()); stream.write('\n '); stream.write(color('runway', Array(col).join('β‹…'))); stream.write(plane) stream.write(color('runway', Array(width - col).join('β‹…') + '\n')); stream.write(runway()); stream.write('\033[0m'); }); runner.on('end', function(){ cursor.show(); console.log(); self.epilogue(); }); } /** * Inherit from `Base.prototype`. */ Landing.prototype = new Base; Landing.prototype.constructor = Landing; }); // module: reporters/landing.js require.register("reporters/list.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , cursor = Base.cursor , color = Base.color; /** * Expose `List`. */ exports = module.exports = List; /** * Initialize a new `List` test reporter. * * @param {Runner} runner * @api public */ function List(runner) { Base.call(this, runner); var self = this , stats = this.stats , n = 0; runner.on('start', function(){ console.log(); }); runner.on('test', function(test){ process.stdout.write(color('pass', ' ' + test.fullTitle() + ': ')); }); runner.on('pending', function(test){ var fmt = color('checkmark', ' -') + color('pending', ' %s'); console.log(fmt, test.fullTitle()); }); runner.on('pass', function(test){ var fmt = color('checkmark', ' βœ“') + color('pass', ' %s: ') + color(test.speed, '%dms'); cursor.CR(); console.log(fmt, test.fullTitle(), test.duration); }); runner.on('fail', function(test, err){ cursor.CR(); console.log(color('fail', ' %d) %s'), ++n, test.fullTitle()); }); runner.on('end', self.epilogue.bind(self)); } /** * Inherit from `Base.prototype`. */ List.prototype = new Base; List.prototype.constructor = List; }); // module: reporters/list.js require.register("reporters/progress.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , cursor = Base.cursor , color = Base.color; /** * Expose `Progress`. */ exports = module.exports = Progress; /** * General progress bar color. */ Base.colors.progress = 90; /** * Initialize a new `Progress` bar test reporter. * * @param {Runner} runner * @param {Object} options * @api public */ function Progress(runner, options) { Base.call(this, runner); var self = this , options = options || {} , stats = this.stats , width = Base.window.width * .50 | 0 , total = runner.total , complete = 0 , max = Math.max; // default chars options.open = options.open || '['; options.complete = options.complete || 'β–¬'; options.incomplete = options.incomplete || 'β‹…'; options.close = options.close || ']'; options.verbose = false; // tests started runner.on('start', function(){ console.log(); cursor.hide(); }); // tests complete runner.on('test end', function(){ var incomplete = total - complete , percent = complete++ / total , n = width * percent | 0 , i = width - n; cursor.CR(); process.stdout.write('\033[J'); process.stdout.write(color('progress', ' ' + options.open)); process.stdout.write(Array(n).join(options.complete)); process.stdout.write(Array(i).join(options.incomplete)); process.stdout.write(color('progress', options.close)); if (options.verbose) { process.stdout.write(color('progress', ' ' + complete + ' of ' + total)); } }); // tests are complete, output some stats // and the failures if any runner.on('end', function(){ cursor.show(); console.log(); self.epilogue(); }); } /** * Inherit from `Base.prototype`. */ Progress.prototype = new Base; Progress.prototype.constructor = Progress; }); // module: reporters/progress.js require.register("reporters/spec.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , cursor = Base.cursor , color = Base.color; /** * Expose `Spec`. */ exports = module.exports = Spec; /** * Initialize a new `Spec` test reporter. * * @param {Runner} runner * @api public */ function Spec(runner) { Base.call(this, runner); var self = this , stats = this.stats , indents = 0 , n = 0; function indent() { return Array(indents).join(' ') } runner.on('start', function(){ console.log(); }); runner.on('suite', function(suite){ ++indents; console.log(color('suite', '%s%s'), indent(), suite.title); }); runner.on('suite end', function(suite){ --indents; if (1 == indents) console.log(); }); runner.on('test', function(test){ process.stdout.write(indent() + color('pass', ' β—¦ ' + test.title + ': ')); }); runner.on('pending', function(test){ var fmt = indent() + color('pending', ' - %s'); console.log(fmt, test.title); }); runner.on('pass', function(test){ if ('fast' == test.speed) { var fmt = indent() + color('checkmark', ' βœ“') + color('pass', ' %s '); cursor.CR(); console.log(fmt, test.title); } else { var fmt = indent() + color('checkmark', ' βœ“') + color('pass', ' %s ') + color(test.speed, '(%dms)'); cursor.CR(); console.log(fmt, test.title, test.duration); } }); runner.on('fail', function(test, err){ cursor.CR(); console.log(indent() + color('fail', ' %d) %s'), ++n, test.title); }); runner.on('end', self.epilogue.bind(self)); } /** * Inherit from `Base.prototype`. */ Spec.prototype = new Base; Spec.prototype.constructor = Spec; }); // module: reporters/spec.js require.register("reporters/tap.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , cursor = Base.cursor , color = Base.color; /** * Expose `TAP`. */ exports = module.exports = TAP; /** * Initialize a new `TAP` reporter. * * @param {Runner} runner * @api public */ function TAP(runner) { Base.call(this, runner); var self = this , stats = this.stats , total = runner.total , n = 1; runner.on('start', function(){ console.log('%d..%d', 1, total); }); runner.on('test end', function(){ ++n; }); runner.on('pending', function(test){ console.log('ok %d %s # SKIP -', n, title(test)); }); runner.on('pass', function(test){ console.log('ok %d %s', n, title(test)); }); runner.on('fail', function(test, err){ console.log('not ok %d %s', n, title(test)); console.log(err.stack.replace(/^/gm, ' ')); }); } /** * Return a TAP-safe title of `test` * * @param {Object} test * @return {String} * @api private */ function title(test) { return test.fullTitle().replace(/#/g, ''); } }); // module: reporters/tap.js require.register("reporters/teamcity.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base'); /** * Expose `Teamcity`. */ exports = module.exports = Teamcity; /** * Initialize a new `Teamcity` reporter. * * @param {Runner} runner * @api public */ function Teamcity(runner) { Base.call(this, runner); var stats = this.stats; runner.on('start', function() { console.log("##teamcity[testSuiteStarted name='mocha.suite']"); }); runner.on('test', function(test) { console.log("##teamcity[testStarted name='%s']", escape(test.fullTitle())); }); runner.on('fail', function(test, err) { console.log("##teamcity[testFailed name='%s' message='%s']", escape(test.fullTitle()), escape(err.message)); }); runner.on('pending', function(test) { console.log("##teamcity[testIgnored name='%s' message='pending']", escape(test.fullTitle())); }); runner.on('test end', function(test) { console.log("##teamcity[testFinished name='%s' duration='%s']", escape(test.fullTitle()), test.duration); }); runner.on('end', function() { console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']", stats.duration); }); } /** * Escape the given `str`. */ function escape(str) { return str.replace(/'/g, "|'"); } }); // module: reporters/teamcity.js require.register("reporters/xunit.js", function(module, exports, require){ /** * Module dependencies. */ var Base = require('./base') , utils = require('../utils') , escape = utils.escape; /** * Expose `XUnit`. */ exports = module.exports = XUnit; /** * Initialize a new `XUnit` reporter. * * @param {Runner} runner * @api public */ function XUnit(runner) { Base.call(this, runner); var stats = this.stats , tests = [] , self = this; runner.on('test end', function(test){ tests.push(test); }); runner.on('end', function(){ console.log(tag('testsuite', { name: 'Mocha Tests' , tests: stats.tests , failures: stats.failures , errors: stats.failures , skip: stats.tests - stats.failures - stats.passes , timestamp: (new Date).toUTCString() , time: stats.duration / 1000 }, false)); tests.forEach(test); console.log('</testsuite>'); }); } /** * Inherit from `Base.prototype`. */ XUnit.prototype = new Base; XUnit.prototype.constructor = XUnit; /** * Output tag for the given `test.` */ function test(test) { var attrs = { classname: test.parent.fullTitle() , name: test.title , time: test.duration / 1000 }; if ('failed' == test.state) { var err = test.err; attrs.message = escape(err.message); console.log(tag('testcase', attrs, false, tag('failure', attrs, false, cdata(err.stack)))); } else if (test.pending) { console.log(tag('testcase', attrs, false, tag('skipped', {}, true))); } else { console.log(tag('testcase', attrs, true) ); } } /** * HTML tag helper. */ function tag(name, attrs, close, content) { var end = close ? '/>' : '>' , pairs = [] , tag; for (var key in attrs) { pairs.push(key + '="' + escape(attrs[key]) + '"'); } tag = '<' + name + (pairs.length ? ' ' + pairs.join(' ') : '') + end; if (content) tag += content + '</' + name + end; return tag; } /** * Return cdata escaped CDATA `str`. */ function cdata(str) { return '<![CDATA[' + escape(str) + ']]>'; } }); // module: reporters/xunit.js require.register("runnable.js", function(module, exports, require){ /** * Module dependencies. */ var EventEmitter = require('browser/events').EventEmitter , debug = require('browser/debug')('runnable'); /** * Expose `Runnable`. */ module.exports = Runnable; /** * Initialize a new `Runnable` with the given `title` and callback `fn`. * * @param {String} title * @param {Function} fn * @api private */ function Runnable(title, fn) { this.title = title; this.fn = fn; this.async = fn && fn.length; this.sync = ! this.async; this._timeout = 2000; this.timedOut = false; } /** * Inherit from `EventEmitter.prototype`. */ Runnable.prototype = new EventEmitter; Runnable.prototype.constructor = Runnable; /** * Set & get timeout `ms`. * * @param {Number} ms * @return {Runnable|Number} ms or self * @api private */ Runnable.prototype.timeout = function(ms){ if (0 == arguments.length) return this._timeout; debug('timeout %d', ms); this._timeout = ms; if (this.timer) this.resetTimeout(); return this; }; /** * Return the full title generated by recursively * concatenating the parent's full title. * * @return {String} * @api public */ Runnable.prototype.fullTitle = function(){ return this.parent.fullTitle() + ' ' + this.title; }; /** * Clear the timeout. * * @api private */ Runnable.prototype.clearTimeout = function(){ clearTimeout(this.timer); }; /** * Reset the timeout. * * @api private */ Runnable.prototype.resetTimeout = function(){ var self = this , ms = this.timeout(); this.clearTimeout(); if (ms) { this.timer = setTimeout(function(){ self.callback(new Error('timeout of ' + ms + 'ms exceeded')); self.timedOut = true; }, ms); } }; /** * Run the test and invoke `fn(err)`. * * @param {Function} fn * @api private */ Runnable.prototype.run = function(fn){ var self = this , ms = this.timeout() , start = new Date , ctx = this.ctx , finished , emitted; // timeout if (this.async) { if (ms) { this.timer = setTimeout(function(){ done(new Error('timeout of ' + ms + 'ms exceeded')); self.timedOut = true; }, ms); } } // called multiple times function multiple() { if (emitted) return; emitted = true; self.emit('error', new Error('done() called multiple times')); } // finished function done(err) { if (self.timedOut) return; if (finished) return multiple(); self.clearTimeout(); self.duration = new Date - start; finished = true; fn(err); } // for .resetTimeout() this.callback = done; // async if (this.async) { try { this.fn.call(ctx, function(err){ if (err instanceof Error) return done(err); if (null != err) return done(new Error('done() invoked with non-Error: ' + err)); done(); }); } catch (err) { done(err); } return; } // sync try { if (!this.pending) this.fn.call(ctx); this.duration = new Date - start; fn(); } catch (err) { fn(err); } }; }); // module: runnable.js require.register("runner.js", function(module, exports, require){ /** * Module dependencies. */ var EventEmitter = require('browser/events').EventEmitter , debug = require('browser/debug')('runner') , Test = require('./test') , utils = require('./utils') , noop = function(){}; /** * Expose `Runner`. */ module.exports = Runner; /** * Initialize a `Runner` for the given `suite`. * * Events: * * - `start` execution started * - `end` execution complete * - `suite` (suite) test suite execution started * - `suite end` (suite) all tests (and sub-suites) have finished * - `test` (test) test execution started * - `test end` (test) test completed * - `hook` (hook) hook execution started * - `hook end` (hook) hook complete * - `pass` (test) test passed * - `fail` (test, err) test failed * * @api public */ function Runner(suite) { var self = this; this._globals = []; this.suite = suite; this.total = suite.total(); this.failures = 0; this.on('test end', function(test){ self.checkGlobals(test); }); this.on('hook end', function(hook){ self.checkGlobals(hook); }); this.grep(/.*/); this.globals(utils.keys(global).concat(['errno'])); } /** * Inherit from `EventEmitter.prototype`. */ Runner.prototype = new EventEmitter; Runner.prototype.constructor = Runner; /** * Run tests with full titles matching `re`. * * @param {RegExp} re * @return {Runner} for chaining * @api public */ Runner.prototype.grep = function(re){ debug('grep %s', re); this._grep = re; return this; }; /** * Allow the given `arr` of globals. * * @param {Array} arr * @return {Runner} for chaining * @api public */ Runner.prototype.globals = function(arr){ if (0 == arguments.length) return this._globals; debug('globals %j', arr); utils.forEach(arr, function(arr){ this._globals.push(arr); }, this); return this; }; /** * Check for global variable leaks. * * @api private */ Runner.prototype.checkGlobals = function(test){ if (this.ignoreLeaks) return; var leaks = utils.filter(utils.keys(global), function(key){ return !~utils.indexOf(this._globals, key) && (!global.navigator || 'onerror' !== key); }, this); this._globals = this._globals.concat(leaks); if (leaks.length > 1) { this.fail(test, new Error('global leaks detected: ' + leaks.join(', ') + '')); } else if (leaks.length) { this.fail(test, new Error('global leak detected: ' + leaks[0])); } }; /** * Fail the given `test`. * * @param {Test} test * @param {Error} err * @api private */ Runner.prototype.fail = function(test, err){ ++this.failures; test.state = 'failed'; this.emit('fail', test, err); }; /** * Fail the given `hook` with `err`. * * Hook failures (currently) hard-end due * to that fact that a failing hook will * surely cause subsequent tests to fail, * causing jumbled reporting. * * @param {Hook} hook * @param {Error} err * @api private */ Runner.prototype.failHook = function(hook, err){ this.fail(hook, err); this.emit('end'); }; /** * Run hook `name` callbacks and then invoke `fn()`. * * @param {String} name * @param {Function} function * @api private */ Runner.prototype.hook = function(name, fn){ var suite = this.suite , hooks = suite['_' + name] , ms = suite._timeout , self = this , timer; function next(i) { var hook = hooks[i]; if (!hook) return fn(); self.currentRunnable = hook; hook.ctx.test(self.test); self.emit('hook', hook); hook.on('error', function(err){ self.failHook(hook, err); }); hook.run(function(err){ hook.removeAllListeners('error'); if (err) return self.failHook(hook, err); self.emit('hook end', hook); next(++i); }); } process.nextTick(function(){ next(0); }); }; /** * Run hook `name` for the given array of `suites` * in order, and callback `fn(err)`. * * @param {String} name * @param {Array} suites * @param {Function} fn * @api private */ Runner.prototype.hooks = function(name, suites, fn){ var self = this , orig = this.suite; function next(suite) { self.suite = suite; if (!suite) { self.suite = orig; return fn(); } self.hook(name, function(err){ if (err) { self.suite = orig; return fn(err); } next(suites.pop()); }); } next(suites.pop()); }; /** * Run hooks from the top level down. * * @param {String} name * @param {Function} fn * @api private */ Runner.prototype.hookUp = function(name, fn){ var suites = [this.suite].concat(this.parents()).reverse(); this.hooks(name, suites, fn); }; /** * Run hooks from the bottom up. * * @param {String} name * @param {Function} fn * @api private */ Runner.prototype.hookDown = function(name, fn){ var suites = [this.suite].concat(this.parents()); this.hooks(name, suites, fn); }; /** * Return an array of parent Suites from * closest to furthest. * * @return {Array} * @api private */ Runner.prototype.parents = function(){ var suite = this.suite , suites = []; while (suite = suite.parent) suites.push(suite); return suites; }; /** * Run the current test and callback `fn(err)`. * * @param {Function} fn * @api private */ Runner.prototype.runTest = function(fn){ var test = this.test , self = this; try { test.ctx.test(test); test.on('error', function(err){ self.fail(test, err); }); test.run(fn); } catch (err) { fn(err); } }; /** * Run tests in the given `suite` and invoke * the callback `fn()` when complete. * * @param {Suite} suite * @param {Function} fn * @api private */ Runner.prototype.runTests = function(suite, fn){ var self = this , tests = suite.tests , test; function next(err) { // if we bail after first err if (self.failures && suite._bail) return fn(); // next test test = tests.shift(); // all done if (!test) return fn(); // grep if (!self._grep.test(test.fullTitle())) return next(); // pending if (test.pending) { self.emit('pending', test); self.emit('test end', test); return next(); } // execute test and hook(s) self.emit('test', self.test = test); self.hookDown('beforeEach', function(){ self.currentRunnable = self.test; self.runTest(function(err){ test = self.test; if (err) { self.fail(test, err); self.emit('test end', test); return self.hookUp('afterEach', next); } test.state = 'passed'; self.emit('pass', test); self.emit('test end', test); self.hookUp('afterEach', next); }); }); } this.next = next; next(); }; /** * Run the given `suite` and invoke the * callback `fn()` when complete. * * @param {Suite} suite * @param {Function} fn * @api private */ Runner.prototype.runSuite = function(suite, fn){ var self = this , i = 0; debug('run suite %s', suite.fullTitle()); this.emit('suite', this.suite = suite); function next() { var curr = suite.suites[i++]; if (!curr) return done(); self.runSuite(curr, next); } function done() { self.suite = suite; self.hook('afterAll', function(){ self.emit('suite end', suite); fn(); }); } this.hook('beforeAll', function(){ self.runTests(suite, next); }); }; /** * Handle uncaught exceptions. * * @param {Error} err * @api private */ Runner.prototype.uncaught = function(err){ debug('uncaught exception'); var runnable = this.currentRunnable; if ('failed' == runnable.state) return; runnable.clearTimeout(); err.uncaught = true; this.fail(runnable, err); // recover from test if ('test' == runnable.type) { this.emit('test end', runnable); this.hookUp('afterEach', this.next); return; } // bail on hooks this.emit('end'); }; /** * Run the root suite and invoke `fn(failures)` * on completion. * * @param {Function} fn * @return {Runner} for chaining * @api public */ Runner.prototype.run = function(fn){ var self = this , fn = fn || function(){}; debug('start'); // callback this.on('end', function(){ debug('end'); process.removeListener('uncaughtException', this.uncaught); fn(self.failures); }); // run suites this.emit('start'); this.runSuite(this.suite, function(){ debug('finished running'); self.emit('end'); }); // uncaught exception process.on('uncaughtException', function(err){ self.uncaught(err); }); return this; }; }); // module: runner.js require.register("suite.js", function(module, exports, require){ /** * Module dependencies. */ var EventEmitter = require('browser/events').EventEmitter , debug = require('browser/debug')('suite') , utils = require('./utils') , Hook = require('./hook'); /** * Expose `Suite`. */ exports = module.exports = Suite; /** * Create a new `Suite` with the given `title` * and parent `Suite`. When a suite with the * same title is already present, that suite * is returned to provide nicer reporter * and more flexible meta-testing. * * @param {Suite} parent * @param {String} title * @return {Suite} * @api public */ exports.create = function(parent, title){ var suite = new Suite(title, parent.ctx); suite.parent = parent; title = suite.fullTitle(); parent.addSuite(suite); return suite; }; /** * Initialize a new `Suite` with the given * `title` and `ctx`. * * @param {String} title * @param {Context} ctx * @api private */ function Suite(title, ctx) { this.title = title; this.ctx = ctx; this.suites = []; this.tests = []; this._beforeEach = []; this._beforeAll = []; this._afterEach = []; this._afterAll = []; this.root = !title; this._timeout = 2000; this._bail = false; } /** * Inherit from `EventEmitter.prototype`. */ Suite.prototype = new EventEmitter; Suite.prototype.constructor = Suite; /** * Return a clone of this `Suite`. * * @return {Suite} * @api private */ Suite.prototype.clone = function(){ var suite = new Suite(this.title); debug('clone'); suite.ctx = this.ctx; suite.timeout(this.timeout()); suite.bail(this.bail()); return suite; }; /** * Set timeout `ms` or short-hand such as "2s". * * @param {Number|String} ms * @return {Suite|Number} for chaining * @api private */ Suite.prototype.timeout = function(ms){ if (0 == arguments.length) return this._timeout; if (String(ms).match(/s$/)) ms = parseFloat(ms) * 1000; debug('timeout %d', ms); this._timeout = parseInt(ms, 10); return this; }; /** * Sets whether to bail after first error. * * @parma {Boolean} bail * @return {Suite|Number} for chaining * @api private */ Suite.prototype.bail = function(bail){ if (0 == arguments.length) return this._bail; debug('bail %s', bail); this._bail = bail; return this; }; /** * Run `fn(test[, done])` before running tests. * * @param {Function} fn * @return {Suite} for chaining * @api private */ Suite.prototype.beforeAll = function(fn){ var hook = new Hook('"before all" hook', fn); hook.parent = this; hook.timeout(this.timeout()); hook.ctx = this.ctx; this._beforeAll.push(hook); this.emit('beforeAll', hook); return this; }; /** * Run `fn(test[, done])` after running tests. * * @param {Function} fn * @return {Suite} for chaining * @api private */ Suite.prototype.afterAll = function(fn){ var hook = new Hook('"after all" hook', fn); hook.parent = this; hook.timeout(this.timeout()); hook.ctx = this.ctx; this._afterAll.push(hook); this.emit('afterAll', hook); return this; }; /** * Run `fn(test[, done])` before each test case. * * @param {Function} fn * @return {Suite} for chaining * @api private */ Suite.prototype.beforeEach = function(fn){ var hook = new Hook('"before each" hook', fn); hook.parent = this; hook.timeout(this.timeout()); hook.ctx = this.ctx; this._beforeEach.push(hook); this.emit('beforeEach', hook); return this; }; /** * Run `fn(test[, done])` after each test case. * * @param {Function} fn * @return {Suite} for chaining * @api private */ Suite.prototype.afterEach = function(fn){ var hook = new Hook('"after each" hook', fn); hook.parent = this; hook.timeout(this.timeout()); hook.ctx = this.ctx; this._afterEach.push(hook); this.emit('afterEach', hook); return this; }; /** * Add a test `suite`. * * @param {Suite} suite * @return {Suite} for chaining * @api private */ Suite.prototype.addSuite = function(suite){ suite.parent = this; suite.timeout(this.timeout()); suite.bail(this.bail()); this.suites.push(suite); this.emit('suite', suite); return this; }; /** * Add a `test` to this suite. * * @param {Test} test * @return {Suite} for chaining * @api private */ Suite.prototype.addTest = function(test){ test.parent = this; test.timeout(this.timeout()); test.ctx = this.ctx; this.tests.push(test); this.emit('test', test); return this; }; /** * Return the full title generated by recursively * concatenating the parent's full title. * * @return {String} * @api public */ Suite.prototype.fullTitle = function(){ if (this.parent) { var full = this.parent.fullTitle(); if (full) return full + ' ' + this.title; } return this.title; }; /** * Return the total number of tests. * * @return {Number} * @api public */ Suite.prototype.total = function(){ return utils.reduce(this.suites, function(sum, suite){ return sum + suite.total(); }, 0) + this.tests.length; }; }); // module: suite.js require.register("test.js", function(module, exports, require){ /** * Module dependencies. */ var Runnable = require('./runnable'); /** * Expose `Test`. */ module.exports = Test; /** * Initialize a new `Test` with the given `title` and callback `fn`. * * @param {String} title * @param {Function} fn * @api private */ function Test(title, fn) { Runnable.call(this, title, fn); this.pending = !fn; this.type = 'test'; } /** * Inherit from `Runnable.prototype`. */ Test.prototype = new Runnable; Test.prototype.constructor = Test; /** * Inspect the context void of private properties. * * @return {String} * @api private */ Test.prototype.inspect = function(){ return JSON.stringify(this, function(key, val){ return '_' == key[0] ? undefined : 'parent' == key ? '#<Suite>' : val; }, 2); }; }); // module: test.js require.register("utils.js", function(module, exports, require){ /** * Module dependencies. */ var fs = require('browser/fs') , path = require('browser/path') , join = path.join , debug = require('browser/debug')('watch'); /** * Ignored directories. */ var ignore = ['node_modules', '.git']; /** * Escape special characters in the given string of html. * * @param {String} html * @return {String} * @api private */ exports.escape = function(html) { return String(html) .replace(/&/g, '&amp;') .replace(/"/g, '&quot;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;'); }; /** * Array#forEach (<=IE8) * * @param {Array} array * @param {Function} fn * @param {Object} scope * @api private */ exports.forEach = function(arr, fn, scope) { for (var i = 0, l = arr.length; i < l; i++) fn.call(scope, arr[i], i); }; /** * Array#indexOf (<=IE8) * * @parma {Array} arr * @param {Object} obj to find index of * @param {Number} start * @api private */ exports.indexOf = function (arr, obj, start) { for (var i = start || 0, l = arr.length; i < l; i++) { if (arr[i] === obj) return i; } return -1; }; /** * Array#reduce (<=IE8) * * @param {Array} array * @param {Function} fn * @param {Object} initial value * @param {Object} scope * @api private */ exports.reduce = function(arr, fn, val, scope) { var rval = val; for (var i = 0, l = arr.length; i < l; i++) { rval = fn.call(scope, rval, arr[i], i, arr); } return rval; }; /** * Array#filter (<=IE8) * * @param {Array} array * @param {Function} fn * @param {Object} scope * @api private */ exports.filter = function(arr, fn, scope) { var ret = []; for (var i = 0, l = arr.length; i < l; i++) { var val = arr[i]; if (fn.call(scope, val, i, arr)) ret.push(val); } return ret; }; /** * Object.keys (<=IE8) * * @param {Object} obj * @return {Array} keys * @api private */ exports.keys = Object.keys || function(obj) { var keys = [] , has = Object.prototype.hasOwnProperty // for `window` on <=IE8 for (var key in obj) { if (has.call(obj, key)) { keys.push(key); } } return keys; }; /** * Watch the given `files` for changes * and invoke `fn(file)` on modification. * * @param {Array} files * @param {Function} fn * @api private */ exports.watch = function(files, fn){ var options = { interval: 100 }; files.forEach(function(file){ debug('file %s', file); fs.watchFile(file, options, function(curr, prev){ if (prev.mtime < curr.mtime) fn(file); }); }); }; /** * Ignored files. */ function ignored(path){ return !~ignore.indexOf(path); } /** * Lookup files in the given `dir`. * * @return {Array} * @api private */ exports.files = function(dir, ret){ ret = ret || []; fs.readdirSync(dir) .filter(ignored) .forEach(function(path){ path = join(dir, path); if (fs.statSync(path).isDirectory()) { exports.files(path, ret); } else if (path.match(/\.(js|coffee)$/)) { ret.push(path); } }); return ret; }; }); // module: utils.js /** * Node shims. * * These are meant only to allow * mocha.js to run untouched, not * to allow running node code in * the browser. */ process = {}; process.exit = function(status){}; process.stdout = {}; global = window; /** * next tick implementation. */ process.nextTick = (function(){ // postMessage behaves badly on IE8 if (window.ActiveXObject || !window.postMessage) { return function(fn){ fn() }; } // based on setZeroTimeout by David Baron // - http://dbaron.org/log/20100309-faster-timeouts var timeouts = [] , name = 'mocha-zero-timeout' return function(fn){ timeouts.push(fn); window.postMessage(name, '*'); window.addEventListener('message', function(e){ if (e.source == window && e.data == name) { if (e.stopPropagation) e.stopPropagation(); if (timeouts.length) timeouts.shift()(); } }, true); } })(); /** * Remove uncaughtException listener. */ process.removeListener = function(e){ if ('uncaughtException' == e) { window.onerror = null; } }; /** * Implements uncaughtException listener. */ process.on = function(e, fn){ if ('uncaughtException' == e) { window.onerror = fn; } }; /** * Expose mocha. */ window.mocha = require('mocha'); // boot ;(function(){ var suite = new mocha.Suite('', new mocha.Context) , utils = mocha.utils /** * Highlight the given string of `js`. */ function highlight(js) { return js .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/\/\/(.*)/gm, '<span class="comment">//$1</span>') .replace(/('.*?')/gm, '<span class="string">$1</span>') .replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>') .replace(/(\d+)/gm, '<span class="number">$1</span>') .replace(/\bnew *(\w+)/gm, '<span class="keyword">new</span> <span class="init">$1</span>') .replace(/\b(function|new|throw|return|var|if|else)\b/gm, '<span class="keyword">$1</span>') } /** * Highlight code contents. */ function highlightCode() { var code = document.getElementsByTagName('code'); for (var i = 0, len = code.length; i < len; ++i) { code[i].innerHTML = highlight(code[i].innerHTML); } } /** * Parse the given `qs`. */ function parse(qs) { return utils.reduce(qs.replace('?', '').split('&'), function(obj, pair){ var i = pair.indexOf('=') , key = pair.slice(0, i) , val = pair.slice(++i); obj[key] = decodeURIComponent(val); return obj; }, {}); } /** * Setup mocha with the give `ui` name. */ mocha.setup = function(ui){ ui = mocha.interfaces[ui]; if (!ui) throw new Error('invalid mocha interface "' + ui + '"'); ui(suite); suite.emit('pre-require', window); }; /** * Run mocha, returning the Runner. */ mocha.run = function(Reporter){ suite.emit('run'); var runner = new mocha.Runner(suite); Reporter = Reporter || mocha.reporters.HTML; var reporter = new Reporter(runner); var query = parse(window.location.search || ""); if (query.grep) runner.grep(new RegExp(query.grep)); runner.on('end', highlightCode); return runner.run(); }; })(); })();
pombredanne/cdnjs
ajax/libs/mocha/0.14.1/mocha.js
JavaScript
mit
72,383
// Get twitter status for given account (or for the default one, "PhantomJS") var page = require('webpage').create(), system = require('system'), twitterId = "PhantomJS"; //< default value // Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this") page.onConsoleMessage = function(msg) { console.log(msg); }; // Print usage message, if no twitter ID is passed if (system.args.length < 2) { console.log("Usage: tweets.js [twitter ID]"); } else { twitterId = system.args[1]; } // Heading console.log("*** Latest tweets from @" + twitterId + " ***\n"); // Open Twitter Mobile and, onPageLoad, do... page.open(encodeURI("http://mobile.twitter.com/" + twitterId), function (status) { // Check for page load success if (status !== "success") { console.log("Unable to access network"); } else { // Execute some DOM inspection within the page context page.evaluate(function() { var list = document.querySelectorAll('div.tweet-text'); for (var i = 0; i < list.length; ++i) { console.log((i + 1) + ": " + list[i].innerText); } }); } phantom.exit(); });
dorton/tiy-information-kiosk
node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/tweets.js
JavaScript
mit
1,223
<?php /* * This file is part of SwiftMailer. * (c) 2004-2009 Chris Corbyn * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Prints all log messages in real time. * * @package Swift * @subpackage Transport * @author Chris Corbyn */ class Swift_Plugins_Loggers_EchoLogger implements Swift_Plugins_Logger { /** Whether or not HTML should be output */ private $_isHtml; /** * Create a new EchoLogger. * * @param boolean $isHtml */ public function __construct($isHtml = true) { $this->_isHtml = $isHtml; } /** * Add a log entry. * * @param string $entry */ public function add($entry) { if ($this->_isHtml) { printf('%s%s%s', htmlspecialchars($entry, ENT_QUOTES), '<br />', PHP_EOL); } else { printf('%s%s', $entry, PHP_EOL); } } /** * Not implemented. */ public function clear() { } /** * Not implemented. */ public function dump() { } }
CondeMonteCristo/biblioteca
vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php
PHP
mit
1,133